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

```c
#include <stdio.h>
#include <stdlib.h>
#define suml(X) ((X) > 1 ? ((X) * ((X) - 1)) / 2 : 0)
typedef long long ll;

int cmp(const void *, const void *);

ll arr[200005] = {};

int main()
{
	ll n;
	ll ans = 0;

	scanf("%lld", &n);
	for (ll i = 1; i <= n; i++) {
		scanf("%lld", &arr[i]);

		arr[i] = arr[i] + arr[i - 1];
	}

	qsort(arr, n + 1, sizeof(ll), cmp);
	arr[n + 1] = -1;

	ll cnt = 0;
	for (ll i = 0; i <= n; i++) {
		cnt++;

		if (arr[i + 1] != arr[i]) {

			ans = ans + suml(cnt);
			cnt = 0;

		}
	}

	printf("%lld\n", ans);

	return 0;
}

int cmp(const void *x, const void *y)
{
	if (*(ll *)x > *(ll *)y) {
		return 1;
	} else if (*(ll *)x == *(ll *)y) {
		return 0;
	} else {
		return -1;
	}
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB40:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jg	.L1
	setne	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE40:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L6
	leaq	8+arr(%rip), %rbx
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	movq	-8(%rbx), %rax
	addq	%rax, (%rbx)
	addq	$8, %rbx
	cmpq	%rbp, %rsi
	jge	.L7
.L6:
	leaq	arr(%rip), %rbx
	addq	$1, %rsi
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	(%rsp), %rsi
	movq	$-1, 8(%rbx,%rsi,8)
	testq	%rsi, %rsi
	js	.L20
	cmpq	$1, %rsi
	jle	.L21
	leaq	-2(%rsi), %rax
	movq	arr(%rip), %r9
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	andq	$-2, %rax
	xorl	%r8d, %r8d
	leaq	8(%rbx), %r10
	addq	$2, %rax
.L14:
	movq	(%r10,%rdx,8), %r11
	leaq	1(%rcx), %rdi
	cmpq	%r9, %r11
	je	.L10
	cmpq	$1, %rdi
	je	.L11
	imulq	%rcx, %rdi
	sarq	%rdi
	addq	%rdi, %r8
.L11:
	addq	$2, %rdx
	movl	$1, %ecx
	movq	(%rbx,%rdx,8), %r9
	cmpq	%r11, %r9
	jne	.L13
.L12:
	cmpq	%rax, %rdx
	jne	.L14
.L9:
	leaq	-8+arr(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	addq	$1, %rax
	leaq	1(%rcx), %rdx
	movq	(%rdi,%rax,8), %r10
	cmpq	%r10, (%rbx,%rax,8)
	je	.L23
	cmpq	$1, %rdx
	je	.L16
	imulq	%rcx, %rdx
	sarq	%rdx
	addq	%rdx, %r8
.L16:
	xorl	%ecx, %ecx
.L15:
	cmpq	%rax, %rsi
	jge	.L17
.L8:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L10:
	.cfi_restore_state
	addq	$2, %rdx
	addq	$2, %rcx
	movq	(%rbx,%rdx,8), %r9
	cmpq	%r9, %r11
	je	.L12
	imulq	%rcx, %rdi
	sarq	%rdi
	addq	%rdi, %r8
.L13:
	xorl	%ecx, %ecx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rdx, %rcx
	jmp	.L15
.L20:
	xorl	%r8d, %r8d
	jmp	.L8
.L21:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L9
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	arr
	.bss
	.align 32
	.type	arr, @object
	.size	arr, 1600040
arr:
	.zero	1600040
	.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
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB40:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jg	.L1
	setne	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE40:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L6
	leaq	8+arr(%rip), %rbx
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	movq	-8(%rbx), %rax
	addq	%rax, (%rbx)
	addq	$8, %rbx
	cmpq	%rbp, %rsi
	jge	.L7
.L6:
	leaq	arr(%rip), %rbx
	addq	$1, %rsi
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	(%rsp), %rsi
	movq	$-1, 8(%rbx,%rsi,8)
	testq	%rsi, %rsi
	js	.L20
	cmpq	$1, %rsi
	jle	.L21
	leaq	-2(%rsi), %rax
	movq	arr(%rip), %r9
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	andq	$-2, %rax
	xorl	%r8d, %r8d
	leaq	8(%rbx), %r10
	addq	$2, %rax
.L14:
	movq	(%r10,%rdx,8), %r11
	leaq	1(%rcx), %rdi
	cmpq	%r9, %r11
	je	.L10
	cmpq	$1, %rdi
	je	.L11
	imulq	%rcx, %rdi
	sarq	%rdi
	addq	%rdi, %r8
.L11:
	addq	$2, %rdx
	movl	$1, %ecx
	movq	(%rbx,%rdx,8), %r9
	cmpq	%r11, %r9
	jne	.L13
.L12:
	cmpq	%rax, %rdx
	jne	.L14
.L9:
	leaq	-8+arr(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	addq	$1, %rax
	leaq	1(%rcx), %rdx
	movq	(%rdi,%rax,8), %r10
	cmpq	%r10, (%rbx,%rax,8)
	je	.L23
	cmpq	$1, %rdx
	je	.L16
	imulq	%rcx, %rdx
	sarq	%rdx
	addq	%rdx, %r8
.L16:
	xorl	%ecx, %ecx
.L15:
	cmpq	%rax, %rsi
	jge	.L17
.L8:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L10:
	.cfi_restore_state
	addq	$2, %rdx
	addq	$2, %rcx
	movq	(%rbx,%rdx,8), %r9
	cmpq	%r9, %r11
	je	.L12
	imulq	%rcx, %rdi
	sarq	%rdi
	addq	%rdi, %r8
.L13:
	xorl	%ecx, %ecx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rdx, %rcx
	jmp	.L15
.L20:
	xorl	%r8d, %r8d
	jmp	.L8
.L21:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L9
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	arr
	.bss
	.align 32
	.type	arr, @object
	.size	arr, 1600040
arr:
	.zero	1600040
	.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
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB40:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jg	.L1
	setne	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE40:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L6
	leaq	8+arr(%rip), %rbx
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	movq	-8(%rbx), %rax
	addq	%rax, (%rbx)
	addq	$8, %rbx
	cmpq	%rbp, %rsi
	jge	.L7
.L6:
	leaq	arr(%rip), %rbx
	addq	$1, %rsi
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	(%rsp), %rsi
	movq	$-1, 8(%rbx,%rsi,8)
	testq	%rsi, %rsi
	js	.L20
	cmpq	$1, %rsi
	jle	.L21
	leaq	-2(%rsi), %rax
	movq	arr(%rip), %r9
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	andq	$-2, %rax
	xorl	%r8d, %r8d
	leaq	8(%rbx), %r10
	addq	$2, %rax
.L14:
	movq	(%r10,%rdx,8), %r11
	leaq	1(%rcx), %rdi
	cmpq	%r9, %r11
	je	.L10
	cmpq	$1, %rdi
	je	.L11
	imulq	%rcx, %rdi
	sarq	%rdi
	addq	%rdi, %r8
.L11:
	addq	$2, %rdx
	movl	$1, %ecx
	movq	(%rbx,%rdx,8), %r9
	cmpq	%r11, %r9
	jne	.L13
.L12:
	cmpq	%rax, %rdx
	jne	.L14
.L9:
	leaq	-8+arr(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	addq	$1, %rax
	leaq	1(%rcx), %rdx
	movq	(%rdi,%rax,8), %r10
	cmpq	%r10, (%rbx,%rax,8)
	je	.L23
	cmpq	$1, %rdx
	je	.L16
	imulq	%rcx, %rdx
	sarq	%rdx
	addq	%rdx, %r8
.L16:
	xorl	%ecx, %ecx
.L15:
	cmpq	%rax, %rsi
	jge	.L17
.L8:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L10:
	.cfi_restore_state
	addq	$2, %rdx
	addq	$2, %rcx
	movq	(%rbx,%rdx,8), %r9
	cmpq	%r9, %r11
	je	.L12
	imulq	%rcx, %rdi
	sarq	%rdi
	addq	%rdi, %r8
.L13:
	xorl	%ecx, %ecx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rdx, %rcx
	jmp	.L15
.L20:
	xorl	%r8d, %r8d
	jmp	.L8
.L21:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L9
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	arr
	.bss
	.align 32
	.type	arr, @object
	.size	arr, 1600040
arr:
	.zero	1600040
	.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
#include <stdio.h>
#include <stdlib.h>
#define suml(X) ((X) > 1 ? ((X) * ((X) - 1)) / 2 : 0)
typedef long long ll;

int cmp(const void *, const void *);

ll arr[200005] = {};

int main()
{
	ll n;
	ll ans = 0;

	scanf("%lld", &n);
	for (ll i = 1; i <= n; i++) {
		scanf("%lld", &arr[i]);

		arr[i] = arr[i] + arr[i - 1];
	}

	qsort(arr, n + 1, sizeof(ll), cmp);
	arr[n + 1] = -1;

	ll cnt = 0;
	for (ll i = 0; i <= n; i++) {
		cnt++;

		if (arr[i + 1] != arr[i]) {

			ans = ans + suml(cnt);
			cnt = 0;

		}
	}

	printf("%lld\n", ans);

	return 0;
}

int cmp(const void *x, const void *y)
{
	if (*(ll *)x > *(ll *)y) {
		return 1;
	} else if (*(ll *)x == *(ll *)y) {
		return 0;
	} else {
		return -1;
	}
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#define suml(X) ((X) > 1 ? ((X) * ((X) - 1)) / 2 : 0)
typedef long long ll;

int cmp(const void *, const void *);

ll arr[200005] = {};

int main()
{
	ll n;
	ll ans = 0;

	scanf("%lld", &n);
	for (ll i = 1; i <= n; i++) {
		scanf("%lld", &arr[i]);

		arr[i] = arr[i] + arr[i - 1];
	}

	qsort(arr, n + 1, sizeof(ll), cmp);
	arr[n + 1] = -1;

	ll cnt = 0;
	for (ll i = 0; i <= n; i++) {
		cnt++;

		if (arr[i + 1] != arr[i]) {

			ans = ans + suml(cnt);
			cnt = 0;

		}
	}

	printf("%lld\n", ans);

	return 0;
}

int cmp(const void *x, const void *y)
{
	if (*(ll *)x > *(ll *)y) {
		return 1;
	} else if (*(ll *)x == *(ll *)y) {
		return 0;
	} else {
		return -1;
	}
}
```

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:

7
0 -1 1 -1 1 -1 1
 5
1 -2 5 -4 5
 6
1 3 -2 2 2 -2
 7
0 -1 0 -1 1 -1 1
 5
1 -1 5 -4 5
 7
0 -1 0 -1 1 -1 0
 7
0 -1 0 -2 1 -1 0
 7
0 -1 0 -2 1 0 -1
 6
0 1 -4 3 0 -2
 7
0 -1 1 -4 0 0 0

13
 1
 3
 8
 2
 7
 5
 4
 6
 9

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

```c
#include <stdio.h>
#include <stdlib.h>
#define suml(X) ((X) > 1 ? ((X) * ((X) - 1)) / 2 : 0)
typedef long long ll;

int cmp(const void *, const void *);

ll arr[200005] = {};

int main()
{
	ll n;
	ll ans = 0;

	scanf("%lld", &n);
	for (ll i = 1; i <= n; i++) {
		scanf("%lld", &arr[i]);

		arr[i] = arr[i] + arr[i - 1];
	}

	qsort(arr, n + 1, sizeof(ll), cmp);
	arr[n + 1] = -1;

	ll cnt = 0;
	for (ll i = 0; i <= n; i++) {
		cnt++;

		if (arr[i + 1] != arr[i]) {

			ans = ans + suml(cnt);
			cnt = 0;

		}
	}

	printf("%lld\n", ans);

	return 0;
}

int cmp(const void *x, const void *y)
{
	if (*(ll *)x > *(ll *)y) {
		return 1;
	} else if (*(ll *)x == *(ll *)y) {
		return 0;
	} else {
		return -1;
	}
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB40:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jg	.L1
	setne	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE40:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L6
	leaq	8+arr(%rip), %rbx
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	movq	-8(%rbx), %rax
	addq	%rax, (%rbx)
	addq	$8, %rbx
	cmpq	%rbp, %rsi
	jge	.L7
.L6:
	leaq	arr(%rip), %rbx
	addq	$1, %rsi
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	(%rsp), %rsi
	movq	$-1, 8(%rbx,%rsi,8)
	testq	%rsi, %rsi
	js	.L20
	cmpq	$1, %rsi
	jle	.L21
	leaq	-2(%rsi), %rax
	movq	arr(%rip), %r9
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	andq	$-2, %rax
	xorl	%r8d, %r8d
	leaq	8(%rbx), %r10
	addq	$2, %rax
.L14:
	movq	(%r10,%rdx,8), %r11
	leaq	1(%rcx), %rdi
	cmpq	%r9, %r11
	je	.L10
	cmpq	$1, %rdi
	je	.L11
	imulq	%rcx, %rdi
	sarq	%rdi
	addq	%rdi, %r8
.L11:
	addq	$2, %rdx
	movl	$1, %ecx
	movq	(%rbx,%rdx,8), %r9
	cmpq	%r11, %r9
	jne	.L13
.L12:
	cmpq	%rax, %rdx
	jne	.L14
.L9:
	leaq	-8+arr(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	addq	$1, %rax
	leaq	1(%rcx), %rdx
	movq	(%rdi,%rax,8), %r10
	cmpq	%r10, (%rbx,%rax,8)
	je	.L23
	cmpq	$1, %rdx
	je	.L16
	imulq	%rcx, %rdx
	sarq	%rdx
	addq	%rdx, %r8
.L16:
	xorl	%ecx, %ecx
.L15:
	cmpq	%rax, %rsi
	jge	.L17
.L8:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L10:
	.cfi_restore_state
	addq	$2, %rdx
	addq	$2, %rcx
	movq	(%rbx,%rdx,8), %r9
	cmpq	%r9, %r11
	je	.L12
	imulq	%rcx, %rdi
	sarq	%rdi
	addq	%rdi, %r8
.L13:
	xorl	%ecx, %ecx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rdx, %rcx
	jmp	.L15
.L20:
	xorl	%r8d, %r8d
	jmp	.L8
.L21:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L9
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	arr
	.bss
	.align 32
	.type	arr, @object
	.size	arr, 1600040
arr:
	.zero	1600040
	.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
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB40:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jg	.L1
	setne	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE40:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L6
	leaq	8+arr(%rip), %rbx
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	movq	-8(%rbx), %rax
	addq	%rax, (%rbx)
	addq	$8, %rbx
	cmpq	%rbp, %rsi
	jge	.L7
.L6:
	leaq	arr(%rip), %rbx
	addq	$1, %rsi
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	(%rsp), %rsi
	movq	$-1, 8(%rbx,%rsi,8)
	testq	%rsi, %rsi
	js	.L20
	cmpq	$1, %rsi
	jle	.L21
	leaq	-2(%rsi), %rax
	movq	arr(%rip), %r9
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	andq	$-2, %rax
	xorl	%r8d, %r8d
	leaq	8(%rbx), %r10
	addq	$2, %rax
.L14:
	movq	(%r10,%rdx,8), %r11
	leaq	1(%rcx), %rdi
	cmpq	%r9, %r11
	je	.L10
	cmpq	$1, %rdi
	je	.L11
	imulq	%rcx, %rdi
	sarq	%rdi
	addq	%rdi, %r8
.L11:
	addq	$2, %rdx
	movl	$1, %ecx
	movq	(%rbx,%rdx,8), %r9
	cmpq	%r11, %r9
	jne	.L13
.L12:
	cmpq	%rax, %rdx
	jne	.L14
.L9:
	leaq	-8+arr(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	addq	$1, %rax
	leaq	1(%rcx), %rdx
	movq	(%rdi,%rax,8), %r10
	cmpq	%r10, (%rbx,%rax,8)
	je	.L23
	cmpq	$1, %rdx
	je	.L16
	imulq	%rcx, %rdx
	sarq	%rdx
	addq	%rdx, %r8
.L16:
	xorl	%ecx, %ecx
.L15:
	cmpq	%rax, %rsi
	jge	.L17
.L8:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L10:
	.cfi_restore_state
	addq	$2, %rdx
	addq	$2, %rcx
	movq	(%rbx,%rdx,8), %r9
	cmpq	%r9, %r11
	je	.L12
	imulq	%rcx, %rdi
	sarq	%rdi
	addq	%rdi, %r8
.L13:
	xorl	%ecx, %ecx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%rdx, %rcx
	jmp	.L15
.L20:
	xorl	%r8d, %r8d
	jmp	.L8
.L21:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L9
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	arr
	.bss
	.align 32
	.type	arr, @object
	.size	arr, 1600040
arr:
	.zero	1600040
	.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:
```