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>
long cmp(const void *a,const void *b){
  return *(long*)a - *(long*)b;
}

int main(){
  long n;
  long a;
  long b;
  long x[100010] = {};
  long diff[100010] = {};
  long i;
  long sum=0;
  long cnt = 0;
 
  scanf("%ld %ld %ld",&n,&a,&b);
  for(i=0;i<n;i++){
    scanf("%ld",&x[i]);
  }
  for(i=0;i<n-1;i++){
    diff[i] = (x[i+1] - x[i])*a;
  }
  
  qsort(diff,n-1,sizeof(long),cmp);
  
  /*for(i=0;i<n;i++){
    printf("%ld/",diff[i]);
  }*/
  for(i=0;i<n-1;i++){
    if(diff[i] <= b){
      sum += diff[i];
    }else{
      sum += b;
    }
  }
  printf("%ld",sum);
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	(%rsi), %rax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597488
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2768, %rsp
	.cfi_def_cfa_offset 1600256
	movl	$800080, %edx
	xorl	%esi, %esi
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 1600200(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbp
	leaq	800112(%rsp), %rbx
	movq	%rbp, %rdi
	call	memset@PLT
	movl	$800080, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	24(%rsp), %rcx
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	testq	%rax, %rax
	jle	.L4
	movq	%rbp, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$8, %r14
	cmpq	%r13, %rax
	jg	.L5
.L4:
	leaq	-1(%rax), %rsi
	testq	%rsi, %rsi
	jle	.L6
	movq	16(%rsp), %rdi
	cmpq	$2, %rax
	je	.L15
	movq	%rdi, %xmm3
	movq	%rsi, %rcx
	movq	%rbp, %rax
	movq	%rbx, %rdx
	punpcklqdq	%xmm3, %xmm3
	shrq	%rcx
	salq	$4, %rcx
	movdqa	%xmm3, %xmm4
	addq	%rbp, %rcx
	psrlq	$32, %xmm4
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	8(%rax), %xmm1
	psubq	(%rax), %xmm1
	addq	$16, %rax
	addq	$16, %rdx
	movdqa	%xmm1, %xmm0
	movdqa	%xmm1, %xmm2
	psrlq	$32, %xmm0
	pmuludq	%xmm4, %xmm1
	pmuludq	%xmm3, %xmm0
	pmuludq	%xmm3, %xmm2
	paddq	%xmm1, %xmm0
	psllq	$32, %xmm0
	paddq	%xmm2, %xmm0
	movaps	%xmm0, -16(%rdx)
	cmpq	%rcx, %rax
	jne	.L8
	movq	%rsi, %rdx
	andq	$-2, %rdx
	testb	$1, %sil
	je	.L6
.L7:
	movq	40(%rsp,%rdx,8), %rax
	subq	32(%rsp,%rdx,8), %rax
	imulq	%rdi, %rax
	movq	%rax, 800112(%rsp,%rdx,8)
.L6:
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	8(%rsp), %rdx
	cmpq	$1, %rdx
	jle	.L16
	movq	24(%rsp), %rsi
	leaq	800104(%rsp,%rdx,8), %r8
	movq	%rbx, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movq	(%rax), %rcx
	leaq	(%rdx,%rcx), %rdi
	addq	%rsi, %rdx
	cmpq	%rcx, %rsi
	cmovge	%rdi, %rdx
	addq	$8, %rax
	cmpq	%rax, %r8
	jne	.L13
.L10:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$1600208, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L10
.L15:
	xorl	%edx, %edx
	jmp	.L7
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	(%rsi), %rax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597488
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2768, %rsp
	.cfi_def_cfa_offset 1600256
	movl	$800080, %edx
	xorl	%esi, %esi
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 1600200(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbp
	leaq	800112(%rsp), %rbx
	movq	%rbp, %rdi
	call	memset@PLT
	movl	$800080, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	24(%rsp), %rcx
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	testq	%rax, %rax
	jle	.L4
	movq	%rbp, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$8, %r14
	cmpq	%r13, %rax
	jg	.L5
.L4:
	leaq	-1(%rax), %rsi
	testq	%rsi, %rsi
	jle	.L6
	movq	16(%rsp), %rdi
	cmpq	$2, %rax
	je	.L15
	movq	%rdi, %xmm3
	movq	%rsi, %rcx
	movq	%rbp, %rax
	movq	%rbx, %rdx
	punpcklqdq	%xmm3, %xmm3
	shrq	%rcx
	salq	$4, %rcx
	movdqa	%xmm3, %xmm4
	addq	%rbp, %rcx
	psrlq	$32, %xmm4
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	8(%rax), %xmm1
	psubq	(%rax), %xmm1
	addq	$16, %rax
	addq	$16, %rdx
	movdqa	%xmm1, %xmm0
	movdqa	%xmm1, %xmm2
	psrlq	$32, %xmm0
	pmuludq	%xmm4, %xmm1
	pmuludq	%xmm3, %xmm0
	pmuludq	%xmm3, %xmm2
	paddq	%xmm1, %xmm0
	psllq	$32, %xmm0
	paddq	%xmm2, %xmm0
	movaps	%xmm0, -16(%rdx)
	cmpq	%rcx, %rax
	jne	.L8
	movq	%rsi, %rdx
	andq	$-2, %rdx
	testb	$1, %sil
	je	.L6
.L7:
	movq	40(%rsp,%rdx,8), %rax
	subq	32(%rsp,%rdx,8), %rax
	imulq	%rdi, %rax
	movq	%rax, 800112(%rsp,%rdx,8)
.L6:
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	8(%rsp), %rdx
	cmpq	$1, %rdx
	jle	.L16
	movq	24(%rsp), %rsi
	leaq	800104(%rsp,%rdx,8), %r8
	movq	%rbx, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movq	(%rax), %rcx
	leaq	(%rdx,%rcx), %rdi
	addq	%rsi, %rdx
	cmpq	%rcx, %rsi
	cmovge	%rdi, %rdx
	addq	$8, %rax
	cmpq	%rax, %r8
	jne	.L13
.L10:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$1600208, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L10
.L15:
	xorl	%edx, %edx
	jmp	.L7
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	(%rsi), %rax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597488
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2768, %rsp
	.cfi_def_cfa_offset 1600256
	movl	$800080, %edx
	xorl	%esi, %esi
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 1600200(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbp
	leaq	800112(%rsp), %rbx
	movq	%rbp, %rdi
	call	memset@PLT
	movl	$800080, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	24(%rsp), %rcx
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	testq	%rax, %rax
	jle	.L4
	movq	%rbp, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$8, %r14
	cmpq	%r13, %rax
	jg	.L5
.L4:
	leaq	-1(%rax), %rsi
	testq	%rsi, %rsi
	jle	.L6
	movq	16(%rsp), %rdi
	cmpq	$2, %rax
	je	.L15
	movq	%rdi, %xmm3
	movq	%rsi, %rcx
	movq	%rbp, %rax
	movq	%rbx, %rdx
	punpcklqdq	%xmm3, %xmm3
	shrq	%rcx
	salq	$4, %rcx
	movdqa	%xmm3, %xmm4
	addq	%rbp, %rcx
	psrlq	$32, %xmm4
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	8(%rax), %xmm1
	psubq	(%rax), %xmm1
	addq	$16, %rax
	addq	$16, %rdx
	movdqa	%xmm1, %xmm0
	movdqa	%xmm1, %xmm2
	psrlq	$32, %xmm0
	pmuludq	%xmm4, %xmm1
	pmuludq	%xmm3, %xmm0
	pmuludq	%xmm3, %xmm2
	paddq	%xmm1, %xmm0
	psllq	$32, %xmm0
	paddq	%xmm2, %xmm0
	movaps	%xmm0, -16(%rdx)
	cmpq	%rcx, %rax
	jne	.L8
	movq	%rsi, %rdx
	andq	$-2, %rdx
	testb	$1, %sil
	je	.L6
.L7:
	movq	40(%rsp,%rdx,8), %rax
	subq	32(%rsp,%rdx,8), %rax
	imulq	%rdi, %rax
	movq	%rax, 800112(%rsp,%rdx,8)
.L6:
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	8(%rsp), %rdx
	cmpq	$1, %rdx
	jle	.L16
	movq	24(%rsp), %rsi
	leaq	800104(%rsp,%rdx,8), %r8
	movq	%rbx, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movq	(%rax), %rcx
	leaq	(%rdx,%rcx), %rdi
	addq	%rsi, %rdx
	cmpq	%rcx, %rsi
	cmovge	%rdi, %rdx
	addq	$8, %rax
	cmpq	%rax, %r8
	jne	.L13
.L10:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$1600208, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L10
.L15:
	xorl	%edx, %edx
	jmp	.L7
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
```
```c
#include<stdio.h>
#include<stdlib.h>
long cmp(const void *a,const void *b){
  return *(long*)a - *(long*)b;
}

int main(){
  long n;
  long a;
  long b;
  long x[100010] = {};
  long diff[100010] = {};
  long i;
  long sum=0;
  long cnt = 0;
 
  scanf("%ld %ld %ld",&n,&a,&b);
  for(i=0;i<n;i++){
    scanf("%ld",&x[i]);
  }
  for(i=0;i<n-1;i++){
    diff[i] = (x[i+1] - x[i])*a;
  }
  
  qsort(diff,n-1,sizeof(long),cmp);
  
  /*for(i=0;i<n;i++){
    printf("%ld/",diff[i]);
  }*/
  for(i=0;i<n-1;i++){
    if(diff[i] <= b){
      sum += diff[i];
    }else{
      sum += b;
    }
  }
  printf("%ld",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>
long cmp(const void *a,const void *b){
  return *(long*)a - *(long*)b;
}

int main(){
  long n;
  long a;
  long b;
  long x[100010] = {};
  long diff[100010] = {};
  long i;
  long sum=0;
  long cnt = 0;
 
  scanf("%ld %ld %ld",&n,&a,&b);
  for(i=0;i<n;i++){
    scanf("%ld",&x[i]);
  }
  for(i=0;i<n-1;i++){
    diff[i] = (x[i+1] - x[i])*a;
  }
  
  qsort(diff,n-1,sizeof(long),cmp);
  
  /*for(i=0;i<n;i++){
    printf("%ld/",diff[i]);
  }*/
  for(i=0;i<n-1;i++){
    if(diff[i] <= b){
      sum += diff[i];
    }else{
      sum += b;
    }
  }
  printf("%ld",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:

4 2 5
1 2 5 7

11
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>
long cmp(const void *a,const void *b){
  return *(long*)a - *(long*)b;
}

int main(){
  long n;
  long a;
  long b;
  long x[100010] = {};
  long diff[100010] = {};
  long i;
  long sum=0;
  long cnt = 0;
 
  scanf("%ld %ld %ld",&n,&a,&b);
  for(i=0;i<n;i++){
    scanf("%ld",&x[i]);
  }
  for(i=0;i<n-1;i++){
    diff[i] = (x[i+1] - x[i])*a;
  }
  
  qsort(diff,n-1,sizeof(long),cmp);
  
  /*for(i=0;i<n;i++){
    printf("%ld/",diff[i]);
  }*/
  for(i=0;i<n-1;i++){
    if(diff[i] <= b){
      sum += diff[i];
    }else{
      sum += b;
    }
  }
  printf("%ld",sum);
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	(%rsi), %rax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597488
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2768, %rsp
	.cfi_def_cfa_offset 1600256
	movl	$800080, %edx
	xorl	%esi, %esi
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 1600200(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbp
	leaq	800112(%rsp), %rbx
	movq	%rbp, %rdi
	call	memset@PLT
	movl	$800080, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	24(%rsp), %rcx
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	testq	%rax, %rax
	jle	.L4
	movq	%rbp, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$8, %r14
	cmpq	%r13, %rax
	jg	.L5
.L4:
	leaq	-1(%rax), %rsi
	testq	%rsi, %rsi
	jle	.L6
	movq	16(%rsp), %rdi
	cmpq	$2, %rax
	je	.L15
	movq	%rdi, %xmm3
	movq	%rsi, %rcx
	movq	%rbp, %rax
	movq	%rbx, %rdx
	punpcklqdq	%xmm3, %xmm3
	shrq	%rcx
	salq	$4, %rcx
	movdqa	%xmm3, %xmm4
	addq	%rbp, %rcx
	psrlq	$32, %xmm4
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	8(%rax), %xmm1
	psubq	(%rax), %xmm1
	addq	$16, %rax
	addq	$16, %rdx
	movdqa	%xmm1, %xmm0
	movdqa	%xmm1, %xmm2
	psrlq	$32, %xmm0
	pmuludq	%xmm4, %xmm1
	pmuludq	%xmm3, %xmm0
	pmuludq	%xmm3, %xmm2
	paddq	%xmm1, %xmm0
	psllq	$32, %xmm0
	paddq	%xmm2, %xmm0
	movaps	%xmm0, -16(%rdx)
	cmpq	%rcx, %rax
	jne	.L8
	movq	%rsi, %rdx
	andq	$-2, %rdx
	testb	$1, %sil
	je	.L6
.L7:
	movq	40(%rsp,%rdx,8), %rax
	subq	32(%rsp,%rdx,8), %rax
	imulq	%rdi, %rax
	movq	%rax, 800112(%rsp,%rdx,8)
.L6:
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	8(%rsp), %rdx
	cmpq	$1, %rdx
	jle	.L16
	movq	24(%rsp), %rsi
	leaq	800104(%rsp,%rdx,8), %r8
	movq	%rbx, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movq	(%rax), %rcx
	leaq	(%rdx,%rcx), %rdi
	addq	%rsi, %rdx
	cmpq	%rcx, %rsi
	cmovge	%rdi, %rdx
	addq	$8, %rax
	cmpq	%rax, %r8
	jne	.L13
.L10:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$1600208, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L10
.L15:
	xorl	%edx, %edx
	jmp	.L7
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	(%rsi), %rax
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-1597440(%rsp), %r11
	.cfi_def_cfa 11, 1597488
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2768, %rsp
	.cfi_def_cfa_offset 1600256
	movl	$800080, %edx
	xorl	%esi, %esi
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 1600200(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbp
	leaq	800112(%rsp), %rbx
	movq	%rbp, %rdi
	call	memset@PLT
	movl	$800080, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	24(%rsp), %rcx
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	testq	%rax, %rax
	jle	.L4
	movq	%rbp, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rax
	addq	$8, %r14
	cmpq	%r13, %rax
	jg	.L5
.L4:
	leaq	-1(%rax), %rsi
	testq	%rsi, %rsi
	jle	.L6
	movq	16(%rsp), %rdi
	cmpq	$2, %rax
	je	.L15
	movq	%rdi, %xmm3
	movq	%rsi, %rcx
	movq	%rbp, %rax
	movq	%rbx, %rdx
	punpcklqdq	%xmm3, %xmm3
	shrq	%rcx
	salq	$4, %rcx
	movdqa	%xmm3, %xmm4
	addq	%rbp, %rcx
	psrlq	$32, %xmm4
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	8(%rax), %xmm1
	psubq	(%rax), %xmm1
	addq	$16, %rax
	addq	$16, %rdx
	movdqa	%xmm1, %xmm0
	movdqa	%xmm1, %xmm2
	psrlq	$32, %xmm0
	pmuludq	%xmm4, %xmm1
	pmuludq	%xmm3, %xmm0
	pmuludq	%xmm3, %xmm2
	paddq	%xmm1, %xmm0
	psllq	$32, %xmm0
	paddq	%xmm2, %xmm0
	movaps	%xmm0, -16(%rdx)
	cmpq	%rcx, %rax
	jne	.L8
	movq	%rsi, %rdx
	andq	$-2, %rdx
	testb	$1, %sil
	je	.L6
.L7:
	movq	40(%rsp,%rdx,8), %rax
	subq	32(%rsp,%rdx,8), %rax
	imulq	%rdi, %rax
	movq	%rax, 800112(%rsp,%rdx,8)
.L6:
	movl	$8, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbx, %rdi
	call	qsort@PLT
	movq	8(%rsp), %rdx
	cmpq	$1, %rdx
	jle	.L16
	movq	24(%rsp), %rsi
	leaq	800104(%rsp,%rdx,8), %r8
	movq	%rbx, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movq	(%rax), %rcx
	leaq	(%rdx,%rcx), %rdi
	addq	%rsi, %rdx
	cmpq	%rcx, %rsi
	cmovge	%rdi, %rdx
	addq	$8, %rax
	cmpq	%rax, %r8
	jne	.L13
.L10:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	1600200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$1600208, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L10
.L15:
	xorl	%edx, %edx
	jmp	.L7
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
```