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>


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

#define N_MAX 100000
int times[ N_MAX + 1 ] ;


int main( void )
{
	int N ,K ;
	scanf( "%d %d" ,&N ,&K ) ;
	int i ;
	for( i = 0 ; i < N ; ++i )
	{
		scanf( "%d" ,times + i ) ;

		if( i > 0 )
		{
			times[ i - 1 ] = times[ i ] - times[ i - 1 ] - 1 ;
		}
	}
	
	qsort( times ,N - 1 ,sizeof( int ) ,cmp ) ;
	
	int sum = N ;	N -= K ;
	for( i = 0 ; i < N ; ++i )
	{
		sum += times[ i ] ;
	}

	printf( "%d\n" ,sum ) ;

	return 0 ;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	times(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L5
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	4(%r12), %rbx
	movl	$1, %r13d
	leaq	.LC1(%rip), %rbp
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	cmpl	$1, %esi
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	movl	(%rsp), %esi
	addq	$4, %rbx
	subl	-8(%rbx), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbx)
	cmpl	%r13d, %esi
	jg	.L6
.L5:
	subl	$1, %esi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	(%rsp), %r8d
	movl	%r8d, %ecx
	subl	4(%rsp), %ecx
	movl	%ecx, (%rsp)
	testl	%ecx, %ecx
	jle	.L7
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%ecx, %edx
	leaq	times(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rsi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, %r8d
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L7
.L8:
	movslq	%eax, %rdx
	addl	(%r12,%rdx,4), %r8d
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L7
	movslq	%edx, %rdx
	addl	$2, %eax
	addl	(%r12,%rdx,4), %r8d
	cmpl	%eax, %ecx
	jle	.L7
	cltq
	addl	(%r12,%rax,4), %r8d
.L7:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L8
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	times
	.bss
	.align 32
	.type	times, @object
	.size	times, 400004
times:
	.zero	400004
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	times(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L5
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	4(%r12), %rbx
	movl	$1, %r13d
	leaq	.LC1(%rip), %rbp
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	cmpl	$1, %esi
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	movl	(%rsp), %esi
	addq	$4, %rbx
	subl	-8(%rbx), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbx)
	cmpl	%r13d, %esi
	jg	.L6
.L5:
	subl	$1, %esi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	(%rsp), %r8d
	movl	%r8d, %ecx
	subl	4(%rsp), %ecx
	movl	%ecx, (%rsp)
	testl	%ecx, %ecx
	jle	.L7
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%ecx, %edx
	leaq	times(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rsi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, %r8d
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L7
.L8:
	movslq	%eax, %rdx
	addl	(%r12,%rdx,4), %r8d
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L7
	movslq	%edx, %rdx
	addl	$2, %eax
	addl	(%r12,%rdx,4), %r8d
	cmpl	%eax, %ecx
	jle	.L7
	cltq
	addl	(%r12,%rax,4), %r8d
.L7:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L8
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	times
	.bss
	.align 32
	.type	times, @object
	.size	times, 400004
times:
	.zero	400004
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	times(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L5
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	4(%r12), %rbx
	movl	$1, %r13d
	leaq	.LC1(%rip), %rbp
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	cmpl	$1, %esi
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	movl	(%rsp), %esi
	addq	$4, %rbx
	subl	-8(%rbx), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbx)
	cmpl	%r13d, %esi
	jg	.L6
.L5:
	subl	$1, %esi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	(%rsp), %r8d
	movl	%r8d, %ecx
	subl	4(%rsp), %ecx
	movl	%ecx, (%rsp)
	testl	%ecx, %ecx
	jle	.L7
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%ecx, %edx
	leaq	times(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rsi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, %r8d
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L7
.L8:
	movslq	%eax, %rdx
	addl	(%r12,%rdx,4), %r8d
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L7
	movslq	%edx, %rdx
	addl	$2, %eax
	addl	(%r12,%rdx,4), %r8d
	cmpl	%eax, %ecx
	jle	.L7
	cltq
	addl	(%r12,%rax,4), %r8d
.L7:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L8
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	times
	.bss
	.align 32
	.type	times, @object
	.size	times, 400004
times:
	.zero	400004
	.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>


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

#define N_MAX 100000
int times[ N_MAX + 1 ] ;


int main( void )
{
	int N ,K ;
	scanf( "%d %d" ,&N ,&K ) ;
	int i ;
	for( i = 0 ; i < N ; ++i )
	{
		scanf( "%d" ,times + i ) ;

		if( i > 0 )
		{
			times[ i - 1 ] = times[ i ] - times[ i - 1 ] - 1 ;
		}
	}
	
	qsort( times ,N - 1 ,sizeof( int ) ,cmp ) ;
	
	int sum = N ;	N -= K ;
	for( i = 0 ; i < N ; ++i )
	{
		sum += times[ i ] ;
	}

	printf( "%d\n" ,sum ) ;

	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>


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

#define N_MAX 100000
int times[ N_MAX + 1 ] ;


int main( void )
{
	int N ,K ;
	scanf( "%d %d" ,&N ,&K ) ;
	int i ;
	for( i = 0 ; i < N ; ++i )
	{
		scanf( "%d" ,times + i ) ;

		if( i > 0 )
		{
			times[ i - 1 ] = times[ i ] - times[ i - 1 ] - 1 ;
		}
	}
	
	qsort( times ,N - 1 ,sizeof( int ) ,cmp ) ;
	
	int sum = N ;	N -= K ;
	for( i = 0 ; i < N ; ++i )
	{
		sum += times[ i ] ;
	}

	printf( "%d\n" ,sum ) ;

	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:

3 2
1
3
11
 3 2
0
3
11
 3 3
1
3
14
 3 2
0
4
11
 2 2
0
3
20
 3 2
1
6
16
 3 2
0
4
1
 3 1
0
3
11
 3 2
-2
4
11
 3 2
0
6
1

4
 5
 3
 6
 2
 7
 -1
 12
 8
 -3

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>


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

#define N_MAX 100000
int times[ N_MAX + 1 ] ;


int main( void )
{
	int N ,K ;
	scanf( "%d %d" ,&N ,&K ) ;
	int i ;
	for( i = 0 ; i < N ; ++i )
	{
		scanf( "%d" ,times + i ) ;

		if( i > 0 )
		{
			times[ i - 1 ] = times[ i ] - times[ i - 1 ] - 1 ;
		}
	}
	
	qsort( times ,N - 1 ,sizeof( int ) ,cmp ) ;
	
	int sum = N ;	N -= K ;
	for( i = 0 ; i < N ; ++i )
	{
		sum += times[ i ] ;
	}

	printf( "%d\n" ,sum ) ;

	return 0 ;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	times(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L5
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	4(%r12), %rbx
	movl	$1, %r13d
	leaq	.LC1(%rip), %rbp
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	cmpl	$1, %esi
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	movl	(%rsp), %esi
	addq	$4, %rbx
	subl	-8(%rbx), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbx)
	cmpl	%r13d, %esi
	jg	.L6
.L5:
	subl	$1, %esi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	(%rsp), %r8d
	movl	%r8d, %ecx
	subl	4(%rsp), %ecx
	movl	%ecx, (%rsp)
	testl	%ecx, %ecx
	jle	.L7
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%ecx, %edx
	leaq	times(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rsi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, %r8d
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L7
.L8:
	movslq	%eax, %rdx
	addl	(%r12,%rdx,4), %r8d
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L7
	movslq	%edx, %rdx
	addl	$2, %eax
	addl	(%r12,%rdx,4), %r8d
	cmpl	%eax, %ecx
	jle	.L7
	cltq
	addl	(%r12,%rax,4), %r8d
.L7:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L8
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	times
	.bss
	.align 32
	.type	times, @object
	.size	times, 400004
times:
	.zero	400004
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	times(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L5
	movq	%r12, %rsi
	xorl	%eax, %eax
	leaq	4(%r12), %rbx
	movl	$1, %r13d
	leaq	.LC1(%rip), %rbp
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	cmpl	$1, %esi
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	movl	(%rsp), %esi
	addq	$4, %rbx
	subl	-8(%rbx), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbx)
	cmpl	%r13d, %esi
	jg	.L6
.L5:
	subl	$1, %esi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	movslq	%esi, %rsi
	call	qsort@PLT
	movl	(%rsp), %r8d
	movl	%r8d, %ecx
	subl	4(%rsp), %ecx
	movl	%ecx, (%rsp)
	testl	%ecx, %ecx
	jle	.L7
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%ecx, %edx
	leaq	times(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rsi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%eax, %r8d
	movl	%ecx, %eax
	andl	$-4, %eax
	testb	$3, %cl
	je	.L7
.L8:
	movslq	%eax, %rdx
	addl	(%r12,%rdx,4), %r8d
	leal	1(%rax), %edx
	cmpl	%edx, %ecx
	jle	.L7
	movslq	%edx, %rdx
	addl	$2, %eax
	addl	(%r12,%rdx,4), %r8d
	cmpl	%eax, %ecx
	jle	.L7
	cltq
	addl	(%r12,%rax,4), %r8d
.L7:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L8
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	times
	.bss
	.align 32
	.type	times, @object
	.size	times, 400004
times:
	.zero	400004
	.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:
```