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>
#include<string.h>


typedef int (*cmp_t)(const void *, const void *);


#define N_MAX 100000


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


int main(void)
{
	int N, i;
	static int A[N_MAX];
	static double B[N_MAX];
	int count;

	while(scanf("%d", &N)==1)
	{
		for(i=0;i<N;i++)
		{
			scanf("%d", &A[i]);
		}
		qsort(A, N, sizeof(A[0]), (cmp_t)cmp);

		B[0]=A[0];
		for(i=1;i<N;i++)
		{
			B[i]=B[i-1]+A[i];
		}

		count=1;
		for(i=1;i<N;i++)
		{
			if(A[i]<=2*B[i-1])
			{
				count++;
			}
			else
			{
				count=1;
			}
		}
/*
for(i=0;i<N;i++) printf(" %d[%d]", A[i], B[i]);
printf("\n");
*/
		printf("%d\n", count);
	}
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %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
	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	B.0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	-8(%r12), %r13
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	A.1(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L11
	movslq	20(%rsp), %rsi
	movq	%rbx, %r14
	xorl	%r15d, %r15d
	testl	%esi, %esi
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rsi
	addq	$4, %r14
	cmpl	%r15d, %esi
	jg	.L5
.L13:
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	pxor	%xmm0, %xmm0
	movslq	20(%rsp), %rcx
	cvtsi2sdl	(%rbx), %xmm0
	movsd	%xmm0, (%r12)
	cmpl	$1, %ecx
	jle	.L15
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	(%rbx,%rax,4), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%r12,%rax,8)
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L7
	movl	$1, %edx
	movl	$1, %eax
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movsd	0(%r13,%rax,8), %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %edx
	cvtsi2sdl	(%rbx,%rax,4), %xmm1
	addsd	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	cmovb	%esi, %edx
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L10
.L6:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L6
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.local	B.0
	.comm	B.0,800000,32
	.local	A.1
	.comm	A.1,400000,32
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %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
	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	B.0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	-8(%r12), %r13
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	A.1(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L11
	movslq	20(%rsp), %rsi
	movq	%rbx, %r14
	xorl	%r15d, %r15d
	testl	%esi, %esi
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rsi
	addq	$4, %r14
	cmpl	%r15d, %esi
	jg	.L5
.L13:
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	pxor	%xmm0, %xmm0
	movslq	20(%rsp), %rcx
	cvtsi2sdl	(%rbx), %xmm0
	movsd	%xmm0, (%r12)
	cmpl	$1, %ecx
	jle	.L15
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	(%rbx,%rax,4), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%r12,%rax,8)
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L7
	movl	$1, %edx
	movl	$1, %eax
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movsd	0(%r13,%rax,8), %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %edx
	cvtsi2sdl	(%rbx,%rax,4), %xmm1
	addsd	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	cmovb	%esi, %edx
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L10
.L6:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L6
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.local	B.0
	.comm	B.0,800000,32
	.local	A.1
	.comm	A.1,400000,32
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %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
	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	B.0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	-8(%r12), %r13
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	A.1(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L11
	movslq	20(%rsp), %rsi
	movq	%rbx, %r14
	xorl	%r15d, %r15d
	testl	%esi, %esi
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rsi
	addq	$4, %r14
	cmpl	%r15d, %esi
	jg	.L5
.L13:
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	pxor	%xmm0, %xmm0
	movslq	20(%rsp), %rcx
	cvtsi2sdl	(%rbx), %xmm0
	movsd	%xmm0, (%r12)
	cmpl	$1, %ecx
	jle	.L15
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	(%rbx,%rax,4), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%r12,%rax,8)
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L7
	movl	$1, %edx
	movl	$1, %eax
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movsd	0(%r13,%rax,8), %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %edx
	cvtsi2sdl	(%rbx,%rax,4), %xmm1
	addsd	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	cmovb	%esi, %edx
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L10
.L6:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L6
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.local	B.0
	.comm	B.0,800000,32
	.local	A.1
	.comm	A.1,400000,32
	.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>
#include<string.h>


typedef int (*cmp_t)(const void *, const void *);


#define N_MAX 100000


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


int main(void)
{
	int N, i;
	static int A[N_MAX];
	static double B[N_MAX];
	int count;

	while(scanf("%d", &N)==1)
	{
		for(i=0;i<N;i++)
		{
			scanf("%d", &A[i]);
		}
		qsort(A, N, sizeof(A[0]), (cmp_t)cmp);

		B[0]=A[0];
		for(i=1;i<N;i++)
		{
			B[i]=B[i-1]+A[i];
		}

		count=1;
		for(i=1;i<N;i++)
		{
			if(A[i]<=2*B[i-1])
			{
				count++;
			}
			else
			{
				count=1;
			}
		}
/*
for(i=0;i<N;i++) printf(" %d[%d]", A[i], B[i]);
printf("\n");
*/
		printf("%d\n", count);
	}
	return 0;
}
```
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>
#include<string.h>


typedef int (*cmp_t)(const void *, const void *);


#define N_MAX 100000


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


int main(void)
{
	int N, i;
	static int A[N_MAX];
	static double B[N_MAX];
	int count;

	while(scanf("%d", &N)==1)
	{
		for(i=0;i<N;i++)
		{
			scanf("%d", &A[i]);
		}
		qsort(A, N, sizeof(A[0]), (cmp_t)cmp);

		B[0]=A[0];
		for(i=1;i<N;i++)
		{
			B[i]=B[i-1]+A[i];
		}

		count=1;
		for(i=1;i<N;i++)
		{
			if(A[i]<=2*B[i-1])
			{
				count++;
			}
			else
			{
				count=1;
			}
		}
/*
for(i=0;i<N;i++) printf(" %d[%d]", A[i], B[i]);
printf("\n");
*/
		printf("%d\n", count);
	}
	return 0;
}
```

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:

5
1 1 1 1 2
 3
3 1 3
 6
40 1 26 2 7 20
 3
1 1 3
 6
7 2 21 2 9 20
 5
1 2 1 1 2
 6
40 1 26 2 9 20
 5
1 2 1 0 2
 6
40 1 21 2 9 20
 5
1 1 1 0 2

5
 2
 4
 3
 6
 5
 4
 4
 4
 4

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>
#include<string.h>


typedef int (*cmp_t)(const void *, const void *);


#define N_MAX 100000


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


int main(void)
{
	int N, i;
	static int A[N_MAX];
	static double B[N_MAX];
	int count;

	while(scanf("%d", &N)==1)
	{
		for(i=0;i<N;i++)
		{
			scanf("%d", &A[i]);
		}
		qsort(A, N, sizeof(A[0]), (cmp_t)cmp);

		B[0]=A[0];
		for(i=1;i<N;i++)
		{
			B[i]=B[i-1]+A[i];
		}

		count=1;
		for(i=1;i<N;i++)
		{
			if(A[i]<=2*B[i-1])
			{
				count++;
			}
			else
			{
				count=1;
			}
		}
/*
for(i=0;i<N;i++) printf(" %d[%d]", A[i], B[i]);
printf("\n");
*/
		printf("%d\n", count);
	}
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %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
	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	B.0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	-8(%r12), %r13
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	A.1(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L11
	movslq	20(%rsp), %rsi
	movq	%rbx, %r14
	xorl	%r15d, %r15d
	testl	%esi, %esi
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rsi
	addq	$4, %r14
	cmpl	%r15d, %esi
	jg	.L5
.L13:
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	pxor	%xmm0, %xmm0
	movslq	20(%rsp), %rcx
	cvtsi2sdl	(%rbx), %xmm0
	movsd	%xmm0, (%r12)
	cmpl	$1, %ecx
	jle	.L15
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	(%rbx,%rax,4), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%r12,%rax,8)
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L7
	movl	$1, %edx
	movl	$1, %eax
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movsd	0(%r13,%rax,8), %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %edx
	cvtsi2sdl	(%rbx,%rax,4), %xmm1
	addsd	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	cmovb	%esi, %edx
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L10
.L6:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L6
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.local	B.0
	.comm	B.0,800000,32
	.local	A.1
	.comm	A.1,400000,32
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %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
	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	B.0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	-8(%r12), %r13
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	A.1(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L11
	movslq	20(%rsp), %rsi
	movq	%rbx, %r14
	xorl	%r15d, %r15d
	testl	%esi, %esi
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %rsi
	addq	$4, %r14
	cmpl	%r15d, %esi
	jg	.L5
.L13:
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	pxor	%xmm0, %xmm0
	movslq	20(%rsp), %rcx
	cvtsi2sdl	(%rbx), %xmm0
	movsd	%xmm0, (%r12)
	cmpl	$1, %ecx
	jle	.L15
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	(%rbx,%rax,4), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%r12,%rax,8)
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L7
	movl	$1, %edx
	movl	$1, %eax
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movsd	0(%r13,%rax,8), %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %edx
	cvtsi2sdl	(%rbx,%rax,4), %xmm1
	addsd	%xmm0, %xmm0
	comisd	%xmm1, %xmm0
	cmovb	%esi, %edx
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L10
.L6:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L6
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.local	B.0
	.comm	B.0,800000,32
	.local	A.1
	.comm	A.1,400000,32
	.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:
```