Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
G[9999],v[9999],i,a,b;main(N){for(;scanf("%d",&N)*N;printf("%d\n",b)){for(i=0;b=i<N*N;G[i++]=a+b*N)v[i]=-scanf("%d%d",&a,&b);for(;i--;b+=v[a]==i)for(a=i;v[a]<0;a=G[a])v[a]=i;}}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	-4+v(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	b(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	a(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	leaq	12(%rsp), %rax
	movl	%edi, 12(%rsp)
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, i(%rip)
	imull	%edx, %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	setg	%al
	movl	%eax, b(%rip)
	jle	.L3
	leaq	.LC0(%rip), %r15
	leaq	v(%rip), %r13
	leaq	G(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	scanf@PLT
	movslq	i(%rip), %r10
	movl	b(%rip), %edi
	negl	%eax
	movl	%eax, 0(%r13,%r10,4)
	movl	%eax, %edx
	movl	12(%rsp), %eax
	leal	1(%r10), %r9d
	movl	%r9d, i(%rip)
	imull	%eax, %edi
	addl	a(%rip), %edi
	imull	%eax, %eax
	movl	%edi, (%r14,%r10,4)
	cmpl	%eax, %r9d
	setl	%al
	movzbl	%al, %eax
	movl	%eax, b(%rip)
	jl	.L4
	movl	%r10d, i(%rip)
	testl	%r9d, %r9d
	je	.L5
	movl	%r10d, %esi
	movq	%r10, %r11
	xorl	%r9d, %r9d
	movl	%r10d, %edi
	subq	%rsi, %r11
	testl	%edx, %edx
	jns	.L11
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%r10d, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edi, 0(%r13,%rax,4)
	movslq	(%r14,%rax,4), %rax
	movl	0(%r13,%rax,4), %edx
	movq	%rax, %rsi
	testl	%edx, %edx
	js	.L7
	xorl	%eax, %eax
	cmpl	%r10d, %edx
	sete	%al
	addl	%eax, %r9d
	cmpq	%r11, %r10
	je	.L8
.L22:
	movl	(%r12,%r10,4), %edx
	subq	$1, %r10
	movl	%r10d, %edi
	testl	%edx, %edx
	js	.L21
.L11:
	xorl	%eax, %eax
	cmpl	%r10d, %edx
	movl	%r10d, %esi
	sete	%al
	addl	%eax, %r9d
	cmpq	%r11, %r10
	jne	.L22
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%esi, a(%rip)
	movl	%r9d, b(%rip)
	movl	$-1, i(%rip)
.L5:
	movl	%r9d, %esi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
.L20:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	movl	$-1, i(%rip)
	xorl	%r9d, %r9d
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	b
	.bss
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 39996
v:
	.zero	39996
	.globl	G
	.align 32
	.type	G, @object
	.size	G, 39996
G:
	.zero	39996
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	-4+v(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	b(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	a(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	leaq	12(%rsp), %rax
	movl	%edi, 12(%rsp)
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, i(%rip)
	imull	%edx, %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	setg	%al
	movl	%eax, b(%rip)
	jle	.L3
	leaq	.LC0(%rip), %r15
	leaq	v(%rip), %r13
	leaq	G(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	scanf@PLT
	movslq	i(%rip), %r10
	movl	b(%rip), %edi
	negl	%eax
	movl	%eax, 0(%r13,%r10,4)
	movl	%eax, %edx
	movl	12(%rsp), %eax
	leal	1(%r10), %r9d
	movl	%r9d, i(%rip)
	imull	%eax, %edi
	addl	a(%rip), %edi
	imull	%eax, %eax
	movl	%edi, (%r14,%r10,4)
	cmpl	%eax, %r9d
	setl	%al
	movzbl	%al, %eax
	movl	%eax, b(%rip)
	jl	.L4
	movl	%r10d, i(%rip)
	testl	%r9d, %r9d
	je	.L5
	movl	%r10d, %esi
	movq	%r10, %r11
	xorl	%r9d, %r9d
	movl	%r10d, %edi
	subq	%rsi, %r11
	testl	%edx, %edx
	jns	.L11
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%r10d, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edi, 0(%r13,%rax,4)
	movslq	(%r14,%rax,4), %rax
	movl	0(%r13,%rax,4), %edx
	movq	%rax, %rsi
	testl	%edx, %edx
	js	.L7
	xorl	%eax, %eax
	cmpl	%r10d, %edx
	sete	%al
	addl	%eax, %r9d
	cmpq	%r11, %r10
	je	.L8
.L22:
	movl	(%r12,%r10,4), %edx
	subq	$1, %r10
	movl	%r10d, %edi
	testl	%edx, %edx
	js	.L21
.L11:
	xorl	%eax, %eax
	cmpl	%r10d, %edx
	movl	%r10d, %esi
	sete	%al
	addl	%eax, %r9d
	cmpq	%r11, %r10
	jne	.L22
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%esi, a(%rip)
	movl	%r9d, b(%rip)
	movl	$-1, i(%rip)
.L5:
	movl	%r9d, %esi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
.L20:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	movl	$-1, i(%rip)
	xorl	%r9d, %r9d
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	b
	.bss
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 39996
v:
	.zero	39996
	.globl	G
	.align 32
	.type	G, @object
	.size	G, 39996
G:
	.zero	39996
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	-4+v(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	b(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	a(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	leaq	12(%rsp), %rax
	movl	%edi, 12(%rsp)
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, i(%rip)
	imull	%edx, %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	setg	%al
	movl	%eax, b(%rip)
	jle	.L3
	leaq	.LC0(%rip), %r15
	leaq	v(%rip), %r13
	leaq	G(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	scanf@PLT
	movslq	i(%rip), %r10
	movl	b(%rip), %edi
	negl	%eax
	movl	%eax, 0(%r13,%r10,4)
	movl	%eax, %edx
	movl	12(%rsp), %eax
	leal	1(%r10), %r9d
	movl	%r9d, i(%rip)
	imull	%eax, %edi
	addl	a(%rip), %edi
	imull	%eax, %eax
	movl	%edi, (%r14,%r10,4)
	cmpl	%eax, %r9d
	setl	%al
	movzbl	%al, %eax
	movl	%eax, b(%rip)
	jl	.L4
	movl	%r10d, i(%rip)
	testl	%r9d, %r9d
	je	.L5
	movl	%r10d, %esi
	movq	%r10, %r11
	xorl	%r9d, %r9d
	movl	%r10d, %edi
	subq	%rsi, %r11
	testl	%edx, %edx
	jns	.L11
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%r10d, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edi, 0(%r13,%rax,4)
	movslq	(%r14,%rax,4), %rax
	movl	0(%r13,%rax,4), %edx
	movq	%rax, %rsi
	testl	%edx, %edx
	js	.L7
	xorl	%eax, %eax
	cmpl	%r10d, %edx
	sete	%al
	addl	%eax, %r9d
	cmpq	%r11, %r10
	je	.L8
.L22:
	movl	(%r12,%r10,4), %edx
	subq	$1, %r10
	movl	%r10d, %edi
	testl	%edx, %edx
	js	.L21
.L11:
	xorl	%eax, %eax
	cmpl	%r10d, %edx
	movl	%r10d, %esi
	sete	%al
	addl	%eax, %r9d
	cmpq	%r11, %r10
	jne	.L22
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%esi, a(%rip)
	movl	%r9d, b(%rip)
	movl	$-1, i(%rip)
.L5:
	movl	%r9d, %esi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
.L20:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	movl	$-1, i(%rip)
	xorl	%r9d, %r9d
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	b
	.bss
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 39996
v:
	.zero	39996
	.globl	G
	.align 32
	.type	G, @object
	.size	G, 39996
G:
	.zero	39996
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
```c
G[9999],v[9999],i,a,b;main(N){for(;scanf("%d",&N)*N;printf("%d\n",b)){for(i=0;b=i<N*N;G[i++]=a+b*N)v[i]=-scanf("%d%d",&a,&b);for(;i--;b+=v[a]==i)for(a=i;v[a]<0;a=G[a])v[a]=i;}}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
G[9999],v[9999],i,a,b;main(N){for(;scanf("%d",&N)*N;printf("%d\n",b)){for(i=0;b=i<N*N;G[i++]=a+b*N)v[i]=-scanf("%d%d",&a,&b);for(;i--;b+=v[a]==i)for(a=i;v[a]<0;a=G[a])v[a]=i;}}```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

1
0 0
2
1 1 0 1
1 0 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 0
0 2 1 2 2 1
0 0 0 1 1 1
4
3 2 2 0 3 2 2 1
1 1 0 3 1 1 3 1
0 3 2 3 3 0 2 3
1 1 1 1 3 2 1 3
0
 1
0 0
2
1 1 0 1
1 0 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 0
0 2 1 2 2 1
0 0 0 1 1 0
4
3 2 2 0 3 2 2 1
1 1 0 3 1 1 3 1
0 3 2 3 3 0 2 3
1 1 1 1 3 2 1 3
0
 1
0 0
2
1 1 0 1
1 0 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 2
0 2 1 2 2 1
0 0 0 1 1 0
4
3 2 2 0 3 2 2 1
1 1 0 3 1 1 3 0
0 3 2 3 3 0 2 3
1 1 1 1 3 2 1 3
0
 1
0 0
2
1 1 0 1
1 1 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 1
0 2 1 2 2 1
0 0 0 1 1 1
4
3 2 2 0 3 2 2 1
1 1 0 3 1 1 3 1
0 3 2 3 3 0 2 3
1 1 1 1 3 2 1 3
0
 1
0 0
2
1 1 0 1
1 0 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 2
0 2 1 2 2 1
0 0 0 1 1 1
4
3 2 2 0 3 2 2 1
1 1 0 3 1 1 3 0
0 3 2 3 3 0 2 3
1 1 1 1 3 2 1 3
0
 1
0 0
2
1 1 0 1
0 0 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 2
0 2 1 2 2 1
0 0 0 1 1 0
4
3 2 2 0 3 2 2 1
1 1 0 3 1 2 3 0
0 3 2 3 3 0 2 3
1 1 1 1 3 2 1 3
0
 1
0 0
0
1 1 0 1
1 0 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 0
0 2 1 2 2 1
0 1 0 1 1 0
4
3 2 2 0 3 2 2 1
1 2 0 3 1 1 3 1
0 3 2 3 3 0 2 3
1 1 1 1 3 2 1 3
0
 1
0 0
2
1 1 0 1
1 0 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 2
0 2 1 2 2 1
0 0 0 1 1 0
4
3 2 2 0 3 2 2 1
1 1 0 3 1 2 3 0
0 3 1 3 3 0 3 3
1 1 1 1 3 2 1 3
0
 1
0 0
2
1 1 1 1
1 0 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 0
0 2 1 2 2 1
0 0 0 1 1 0
4
3 2 2 0 3 2 2 1
1 1 0 3 1 1 3 1
0 3 2 3 3 0 2 3
1 1 0 1 3 2 1 3
0
 1
0 0
2
1 1 1 1
1 0 0 0
2
1 1 0 1
1 1 1 0
3
0 1 2 2 2 0
0 2 1 2 2 1
0 0 0 1 1 0
4
3 2 2 0 3 2 2 1
1 1 0 3 1 1 3 1
0 3 2 3 1 0 0 3
1 1 0 2 3 2 1 3
0

1
2
1
3
3
 1
2
1
4
3
 1
2
1
3
2
 1
1
1
2
3
 1
2
1
2
2
 1
1
1
3
2
 1
 1
2
1
3
1
 1
1
1
4
3
 1
1
1
4
2

Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
G[9999],v[9999],i,a,b;main(N){for(;scanf("%d",&N)*N;printf("%d\n",b)){for(i=0;b=i<N*N;G[i++]=a+b*N)v[i]=-scanf("%d%d",&a,&b);for(;i--;b+=v[a]==i)for(a=i;v[a]<0;a=G[a])v[a]=i;}}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	-4+v(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	b(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	a(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	leaq	12(%rsp), %rax
	movl	%edi, 12(%rsp)
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, i(%rip)
	imull	%edx, %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	setg	%al
	movl	%eax, b(%rip)
	jle	.L3
	leaq	.LC0(%rip), %r15
	leaq	v(%rip), %r13
	leaq	G(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	scanf@PLT
	movslq	i(%rip), %r10
	movl	b(%rip), %edi
	negl	%eax
	movl	%eax, 0(%r13,%r10,4)
	movl	%eax, %edx
	movl	12(%rsp), %eax
	leal	1(%r10), %r9d
	movl	%r9d, i(%rip)
	imull	%eax, %edi
	addl	a(%rip), %edi
	imull	%eax, %eax
	movl	%edi, (%r14,%r10,4)
	cmpl	%eax, %r9d
	setl	%al
	movzbl	%al, %eax
	movl	%eax, b(%rip)
	jl	.L4
	movl	%r10d, i(%rip)
	testl	%r9d, %r9d
	je	.L5
	movl	%r10d, %esi
	movq	%r10, %r11
	xorl	%r9d, %r9d
	movl	%r10d, %edi
	subq	%rsi, %r11
	testl	%edx, %edx
	jns	.L11
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%r10d, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edi, 0(%r13,%rax,4)
	movslq	(%r14,%rax,4), %rax
	movl	0(%r13,%rax,4), %edx
	movq	%rax, %rsi
	testl	%edx, %edx
	js	.L7
	xorl	%eax, %eax
	cmpl	%r10d, %edx
	sete	%al
	addl	%eax, %r9d
	cmpq	%r11, %r10
	je	.L8
.L22:
	movl	(%r12,%r10,4), %edx
	subq	$1, %r10
	movl	%r10d, %edi
	testl	%edx, %edx
	js	.L21
.L11:
	xorl	%eax, %eax
	cmpl	%r10d, %edx
	movl	%r10d, %esi
	sete	%al
	addl	%eax, %r9d
	cmpq	%r11, %r10
	jne	.L22
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%esi, a(%rip)
	movl	%r9d, b(%rip)
	movl	$-1, i(%rip)
.L5:
	movl	%r9d, %esi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
.L20:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	movl	$-1, i(%rip)
	xorl	%r9d, %r9d
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	b
	.bss
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 39996
v:
	.zero	39996
	.globl	G
	.align 32
	.type	G, @object
	.size	G, 39996
G:
	.zero	39996
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	-4+v(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	b(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	a(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	leaq	12(%rsp), %rax
	movl	%edi, 12(%rsp)
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, i(%rip)
	imull	%edx, %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	setg	%al
	movl	%eax, b(%rip)
	jle	.L3
	leaq	.LC0(%rip), %r15
	leaq	v(%rip), %r13
	leaq	G(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	scanf@PLT
	movslq	i(%rip), %r10
	movl	b(%rip), %edi
	negl	%eax
	movl	%eax, 0(%r13,%r10,4)
	movl	%eax, %edx
	movl	12(%rsp), %eax
	leal	1(%r10), %r9d
	movl	%r9d, i(%rip)
	imull	%eax, %edi
	addl	a(%rip), %edi
	imull	%eax, %eax
	movl	%edi, (%r14,%r10,4)
	cmpl	%eax, %r9d
	setl	%al
	movzbl	%al, %eax
	movl	%eax, b(%rip)
	jl	.L4
	movl	%r10d, i(%rip)
	testl	%r9d, %r9d
	je	.L5
	movl	%r10d, %esi
	movq	%r10, %r11
	xorl	%r9d, %r9d
	movl	%r10d, %edi
	subq	%rsi, %r11
	testl	%edx, %edx
	jns	.L11
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%r10d, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edi, 0(%r13,%rax,4)
	movslq	(%r14,%rax,4), %rax
	movl	0(%r13,%rax,4), %edx
	movq	%rax, %rsi
	testl	%edx, %edx
	js	.L7
	xorl	%eax, %eax
	cmpl	%r10d, %edx
	sete	%al
	addl	%eax, %r9d
	cmpq	%r11, %r10
	je	.L8
.L22:
	movl	(%r12,%r10,4), %edx
	subq	$1, %r10
	movl	%r10d, %edi
	testl	%edx, %edx
	js	.L21
.L11:
	xorl	%eax, %eax
	cmpl	%r10d, %edx
	movl	%r10d, %esi
	sete	%al
	addl	%eax, %r9d
	cmpq	%r11, %r10
	jne	.L22
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%esi, a(%rip)
	movl	%r9d, b(%rip)
	movl	$-1, i(%rip)
.L5:
	movl	%r9d, %esi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
.L20:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	movl	$-1, i(%rip)
	xorl	%r9d, %r9d
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	b
	.bss
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 39996
v:
	.zero	39996
	.globl	G
	.align 32
	.type	G, @object
	.size	G, 39996
G:
	.zero	39996
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```