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

```c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int N,i,j,k,c,a,A[10000000],R[3]={9999999999,9999999999,9999999999};

int cmp(int *a,int *b){return *a>*b;}

int main()
{
	scanf("%d",&N);
	for(i=0;i<N;i++)scanf("%d",&A[i]);

	for(i=0;i<N;i++)
		for(j=0;j<N;j++)
		{
			if(i!=j)
			{
				for(k=10;A[j]%k!=A[j];k*=10);
				a=A[i]*k+A[j];
				for(k=0;k<3;k++)
					if(R[k]>a)a^=R[k]^=a^=R[k];
			}
		}
	printf("%d\n",R[2]);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 40000000
A:
	.zero	40000000
	.globl	R
	.data
	.align 8
	.type	R, @object
	.size	R, 12
R:
	.long	1410065407
	.long	1410065407
	.long	1410065407
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L4
.L5:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L4:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	$0, i(%rip)
	jmp	.L6
.L15:
	movl	$0, j(%rip)
	jmp	.L7
.L14:
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	je	.L8
	movl	$10, k(%rip)
	jmp	.L9
.L10:
	movl	k(%rip), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, k(%rip)
.L9:
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	k(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L10
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	k(%rip), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, a(%rip)
	movl	$0, k(%rip)
	jmp	.L11
.L13:
	movl	k(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jle	.L12
	movl	k(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	a(%rip), %eax
	xorl	%edx, %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %ecx
	movl	k(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	k(%rip), %eax
	movl	%ecx, %esi
	xorl	%edx, %esi
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	R(%rip), %rdx
	movl	%esi, (%rcx,%rdx)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	a(%rip), %eax
	xorl	%edx, %eax
	movl	%eax, a(%rip)
.L12:
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L11:
	movl	k(%rip), %eax
	cmpl	$2, %eax
	jle	.L13
.L8:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L7:
	movl	j(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L15
	movl	8+R(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.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.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	setg	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L42
	xorl	%eax, %eax
	leaq	A(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	N(%rip), %r12d
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%r12d, %eax
	jl	.L4
	movl	$0, i(%rip)
	testl	%r12d, %r12d
	jle	.L42
	movl	8+R(%rip), %eax
	movslq	%r12d, %r9
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	movl	a(%rip), %ecx
	movl	R(%rip), %ebp
	xorl	%r15d, %r15d
	xorl	%r8d, %r8d
	movl	4+R(%rip), %r11d
	movl	%eax, 12(%rsp)
	movl	%eax, %r10d
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L14:
	xorl	%esi, %esi
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rsi
	cmpq	%r9, %rsi
	je	.L43
.L13:
	cmpl	%r8d, %esi
	je	.L7
	movslq	(%rbx,%rsi,4), %rax
	movl	$10, %ecx
	movq	%rax, %rdi
	imulq	$1717986919, %rax, %rax
	movl	%edi, %edx
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	movl	%edi, %edx
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	subl	%eax, %edx
	cmpl	%edi, %edx
	je	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edi, %eax
	leal	(%rcx,%rcx,4), %ecx
	addl	%ecx, %ecx
	cltd
	idivl	%ecx
	cmpl	%edi, %edx
	jne	.L9
.L8:
	imull	(%rbx,%r8,4), %ecx
	addl	%edi, %ecx
	cmpl	%ecx, %ebp
	jle	.L10
	movl	%ecx, %eax
	movl	$1, %r15d
	movl	%ebp, %ecx
	movl	%eax, %ebp
.L10:
	cmpl	%r11d, %ecx
	jge	.L11
	movl	%ecx, %eax
	movl	$1, %r13d
	movl	%r11d, %ecx
	movl	%eax, %r11d
.L11:
	cmpl	%r10d, %ecx
	jge	.L12
	movl	%ecx, %eax
	movl	$1, %r14d
	movl	%r10d, %ecx
	movl	%eax, %r10d
.L12:
	addq	$1, %rsi
	movl	$1, %eax
	cmpq	%r9, %rsi
	jne	.L13
.L43:
	addq	$1, %r8
	cmpq	%rsi, %r8
	jne	.L14
	testb	%r13b, %r13b
	je	.L15
	movl	%r11d, 4+R(%rip)
.L15:
	testb	%r14b, %r14b
	je	.L16
	movl	%r10d, 8+R(%rip)
	movl	%r10d, 12(%rsp)
.L16:
	testb	%r15b, %r15b
	je	.L17
	movl	%ebp, R(%rip)
.L17:
	movl	%r12d, j(%rip)
	movl	%r12d, i(%rip)
	testb	%al, %al
	je	.L5
	movl	$3, k(%rip)
	movl	%ecx, a(%rip)
.L5:
	movl	12(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	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
.L42:
	.cfi_restore_state
	movl	8+R(%rip), %eax
	movl	%eax, 12(%rsp)
	jmp	.L5
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	R
	.data
	.align 8
	.type	R, @object
	.size	R, 12
R:
	.long	1410065407
	.long	1410065407
	.long	1410065407
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 40000000
A:
	.zero	40000000
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	setg	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	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
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L42
	xorl	%eax, %eax
	leaq	A(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	N(%rip), %r12d
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%r12d, %eax
	jl	.L4
	movl	$0, i(%rip)
	testl	%r12d, %r12d
	jle	.L42
	movl	8+R(%rip), %eax
	movslq	%r12d, %r9
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	movl	a(%rip), %ecx
	movl	R(%rip), %ebp
	xorl	%r15d, %r15d
	xorl	%r8d, %r8d
	movl	4+R(%rip), %r11d
	movl	%eax, 12(%rsp)
	movl	%eax, %r10d
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L14:
	xorl	%esi, %esi
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rsi
	cmpq	%r9, %rsi
	je	.L43
.L13:
	cmpl	%r8d, %esi
	je	.L7
	movslq	(%rbx,%rsi,4), %rax
	movl	$10, %ecx
	movq	%rax, %rdi
	imulq	$1717986919, %rax, %rax
	movl	%edi, %edx
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	movl	%edi, %edx
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	subl	%eax, %edx
	cmpl	%edi, %edx
	je	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edi, %eax
	leal	(%rcx,%rcx,4), %ecx
	addl	%ecx, %ecx
	cltd
	idivl	%ecx
	cmpl	%edi, %edx
	jne	.L9
.L8:
	imull	(%rbx,%r8,4), %ecx
	addl	%edi, %ecx
	cmpl	%ecx, %ebp
	jle	.L10
	movl	%ecx, %eax
	movl	$1, %r15d
	movl	%ebp, %ecx
	movl	%eax, %ebp
.L10:
	cmpl	%r11d, %ecx
	jge	.L11
	movl	%ecx, %eax
	movl	$1, %r13d
	movl	%r11d, %ecx
	movl	%eax, %r11d
.L11:
	cmpl	%r10d, %ecx
	jge	.L12
	movl	%ecx, %eax
	movl	$1, %r14d
	movl	%r10d, %ecx
	movl	%eax, %r10d
.L12:
	addq	$1, %rsi
	movl	$1, %eax
	cmpq	%r9, %rsi
	jne	.L13
.L43:
	addq	$1, %r8
	cmpq	%rsi, %r8
	jne	.L14
	testb	%r13b, %r13b
	je	.L15
	movl	%r11d, 4+R(%rip)
.L15:
	testb	%r14b, %r14b
	je	.L16
	movl	%r10d, 8+R(%rip)
	movl	%r10d, 12(%rsp)
.L16:
	testb	%r15b, %r15b
	je	.L17
	movl	%ebp, R(%rip)
.L17:
	movl	%r12d, j(%rip)
	movl	%r12d, i(%rip)
	testb	%al, %al
	je	.L5
	movl	$3, k(%rip)
	movl	%ecx, a(%rip)
.L5:
	movl	12(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	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
.L42:
	.cfi_restore_state
	movl	8+R(%rip), %eax
	movl	%eax, 12(%rsp)
	jmp	.L5
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	R
	.data
	.align 8
	.type	R, @object
	.size	R, 12
R:
	.long	1410065407
	.long	1410065407
	.long	1410065407
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 40000000
A:
	.zero	40000000
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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:

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int N,i,j,k,c,a,A[10000000],R[3]={9999999999,9999999999,9999999999};

int cmp(int *a,int *b){return *a>*b;}

int main()
{
	scanf("%d",&N);
	for(i=0;i<N;i++)scanf("%d",&A[i]);

	for(i=0;i<N;i++)
		for(j=0;j<N;j++)
		{
			if(i!=j)
			{
				for(k=10;A[j]%k!=A[j];k*=10);
				a=A[i]*k+A[j];
				for(k=0;k<3;k++)
					if(R[k]>a)a^=R[k]^=a^=R[k];
			}
		}
	printf("%d\n",R[2]);
	return 0;
}
3
2
7
5

52

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

```c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int N,i,j,k,c,a,A[10000000],R[3]={9999999999,9999999999,9999999999};

int cmp(int *a,int *b){return *a>*b;}

int main()
{
	scanf("%d",&N);
	for(i=0;i<N;i++)scanf("%d",&A[i]);

	for(i=0;i<N;i++)
		for(j=0;j<N;j++)
		{
			if(i!=j)
			{
				for(k=10;A[j]%k!=A[j];k*=10);
				a=A[i]*k+A[j];
				for(k=0;k<3;k++)
					if(R[k]>a)a^=R[k]^=a^=R[k];
			}
		}
	printf("%d\n",R[2]);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 40000000
A:
	.zero	40000000
	.globl	R
	.data
	.align 8
	.type	R, @object
	.size	R, 12
R:
	.long	1410065407
	.long	1410065407
	.long	1410065407
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L4
.L5:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L4:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	$0, i(%rip)
	jmp	.L6
.L15:
	movl	$0, j(%rip)
	jmp	.L7
.L14:
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	je	.L8
	movl	$10, k(%rip)
	jmp	.L9
.L10:
	movl	k(%rip), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, k(%rip)
.L9:
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	k(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L10
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	k(%rip), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, a(%rip)
	movl	$0, k(%rip)
	jmp	.L11
.L13:
	movl	k(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jle	.L12
	movl	k(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	a(%rip), %eax
	xorl	%edx, %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %ecx
	movl	k(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	k(%rip), %eax
	movl	%ecx, %esi
	xorl	%edx, %esi
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	R(%rip), %rdx
	movl	%esi, (%rcx,%rdx)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	a(%rip), %eax
	xorl	%edx, %eax
	movl	%eax, a(%rip)
.L12:
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L11:
	movl	k(%rip), %eax
	cmpl	$2, %eax
	jle	.L13
.L8:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L7:
	movl	j(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L15
	movl	8+R(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.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.
train
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 40000000
A:
	.zero	40000000
	.globl	R
	.data
	.align 8
	.type	R, @object
	.size	R, 12
R:
	.long	1410065407
	.long	1410065407
	.long	1410065407
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L4
.L5:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L4:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L5
	movl	$0, i(%rip)
	jmp	.L6
.L15:
	movl	$0, j(%rip)
	jmp	.L7
.L14:
	movl	i(%rip), %edx
	movl	j(%rip), %eax
	cmpl	%eax, %edx
	je	.L8
	movl	$10, k(%rip)
	jmp	.L9
.L10:
	movl	k(%rip), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, k(%rip)
.L9:
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	k(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L10
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	k(%rip), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	j(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, a(%rip)
	movl	$0, k(%rip)
	jmp	.L11
.L13:
	movl	k(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	a(%rip), %eax
	cmpl	%eax, %edx
	jle	.L12
	movl	k(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	a(%rip), %eax
	xorl	%edx, %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %ecx
	movl	k(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	k(%rip), %eax
	movl	%ecx, %esi
	xorl	%edx, %esi
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	R(%rip), %rdx
	movl	%esi, (%rcx,%rdx)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	R(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	a(%rip), %eax
	xorl	%edx, %eax
	movl	%eax, a(%rip)
.L12:
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L11:
	movl	k(%rip), %eax
	cmpl	$2, %eax
	jle	.L13
.L8:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L7:
	movl	j(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	N(%rip), %eax
	cmpl	%eax, %edx
	jl	.L15
	movl	8+R(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.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:
