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>

#define BUF_SIZE 15

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

int main(void) {
  FILE *fp = stdin;
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, fp)) return 0;
  int num;
  sscanf(line, "%d", &num);

  int i, j;
  int *arr = malloc(sizeof(int)*num);
  for(i = 0; i < num; i++) {
    if(!fgets(line, BUF_SIZE, fp)) return 0;
    sscanf(line, "%d", &arr[i]);
  }
  qsort(arr, num, sizeof(int), comp);

  int res = 0;
  for(i = 0; i < num;) {
    j = i;
    int cnt = 0;
    while(arr[j] == arr[i]) {
      cnt++;
      i++;
    }
    res += (cnt&1);
  }
  printf("%d\n", res);
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.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
	movl	$15, %esi
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	stdin(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	25(%rsp), %r13
	movq	%r14, %rdx
	movq	%r13, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L5
	leaq	.LC0(%rip), %r15
	leaq	20(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	%r15, %rsi
	call	__isoc99_sscanf@PLT
	movslq	20(%rsp), %rbp
	leaq	0(,%rbp,4), %rdi
	movl	%ebp, 12(%rsp)
	call	malloc@PLT
	movl	12(%rsp), %edx
	movq	%rax, %rbx
	testl	%edx, %edx
	jle	.L6
	movq	%rax, %r12
	xorl	%ebp, %ebp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r12, %rdx
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movl	20(%rsp), %edx
	addl	$1, %ebp
	addq	$4, %r12
	cmpl	%ebp, %edx
	jle	.L20
.L8:
	movq	%r14, %rdx
	movl	$15, %esi
	movq	%r13, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L21
.L5:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %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
.L20:
	.cfi_restore_state
	movslq	%edx, %rbp
.L6:
	leaq	comp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	20(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L13
	movl	(%rbx), %edi
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %esi
	xorl	%edx, %edx
	movslq	%esi, %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%eax, %esi
	addq	$1, %rax
	addl	$1, %edx
	movl	-4(%rbx,%rax,4), %ecx
	cmpl	%edi, %ecx
	je	.L11
	andl	$1, %edx
	addl	%edx, %r8d
	cmpl	%esi, %r9d
	jle	.L9
	movl	%ecx, %edi
	jmp	.L10
.L13:
	xorl	%r8d, %r8d
.L9:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.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
	movl	$15, %esi
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	stdin(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	25(%rsp), %r13
	movq	%r14, %rdx
	movq	%r13, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L5
	leaq	.LC0(%rip), %r15
	leaq	20(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	%r15, %rsi
	call	__isoc99_sscanf@PLT
	movslq	20(%rsp), %rbp
	leaq	0(,%rbp,4), %rdi
	movl	%ebp, 12(%rsp)
	call	malloc@PLT
	movl	12(%rsp), %edx
	movq	%rax, %rbx
	testl	%edx, %edx
	jle	.L6
	movq	%rax, %r12
	xorl	%ebp, %ebp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r12, %rdx
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movl	20(%rsp), %edx
	addl	$1, %ebp
	addq	$4, %r12
	cmpl	%ebp, %edx
	jle	.L20
.L8:
	movq	%r14, %rdx
	movl	$15, %esi
	movq	%r13, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L21
.L5:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %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
.L20:
	.cfi_restore_state
	movslq	%edx, %rbp
.L6:
	leaq	comp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	20(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L13
	movl	(%rbx), %edi
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %esi
	xorl	%edx, %edx
	movslq	%esi, %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%eax, %esi
	addq	$1, %rax
	addl	$1, %edx
	movl	-4(%rbx,%rax,4), %ecx
	cmpl	%edi, %ecx
	je	.L11
	andl	$1, %edx
	addl	%edx, %r8d
	cmpl	%esi, %r9d
	jle	.L9
	movl	%ecx, %edi
	jmp	.L10
.L13:
	xorl	%r8d, %r8d
.L9:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.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
	movl	$15, %esi
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	stdin(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	25(%rsp), %r13
	movq	%r14, %rdx
	movq	%r13, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L5
	leaq	.LC0(%rip), %r15
	leaq	20(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	%r15, %rsi
	call	__isoc99_sscanf@PLT
	movslq	20(%rsp), %rbp
	leaq	0(,%rbp,4), %rdi
	movl	%ebp, 12(%rsp)
	call	malloc@PLT
	movl	12(%rsp), %edx
	movq	%rax, %rbx
	testl	%edx, %edx
	jle	.L6
	movq	%rax, %r12
	xorl	%ebp, %ebp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r12, %rdx
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movl	20(%rsp), %edx
	addl	$1, %ebp
	addq	$4, %r12
	cmpl	%ebp, %edx
	jle	.L20
.L8:
	movq	%r14, %rdx
	movl	$15, %esi
	movq	%r13, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L21
.L5:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %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
.L20:
	.cfi_restore_state
	movslq	%edx, %rbp
.L6:
	leaq	comp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	20(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L13
	movl	(%rbx), %edi
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %esi
	xorl	%edx, %edx
	movslq	%esi, %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%eax, %esi
	addq	$1, %rax
	addl	$1, %edx
	movl	-4(%rbx,%rax,4), %ecx
	cmpl	%edi, %ecx
	je	.L11
	andl	$1, %edx
	addl	%edx, %r8d
	cmpl	%esi, %r9d
	jle	.L9
	movl	%ecx, %edi
	jmp	.L10
.L13:
	xorl	%r8d, %r8d
.L9:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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>
#include <string.h>

#define BUF_SIZE 15

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

int main(void) {
  FILE *fp = stdin;
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, fp)) return 0;
  int num;
  sscanf(line, "%d", &num);

  int i, j;
  int *arr = malloc(sizeof(int)*num);
  for(i = 0; i < num; i++) {
    if(!fgets(line, BUF_SIZE, fp)) return 0;
    sscanf(line, "%d", &arr[i]);
  }
  qsort(arr, num, sizeof(int), comp);

  int res = 0;
  for(i = 0; i < num;) {
    j = i;
    int cnt = 0;
    while(arr[j] == arr[i]) {
      cnt++;
      i++;
    }
    res += (cnt&1);
  }
  printf("%d\n", res);
  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>

#define BUF_SIZE 15

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

int main(void) {
  FILE *fp = stdin;
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, fp)) return 0;
  int num;
  sscanf(line, "%d", &num);

  int i, j;
  int *arr = malloc(sizeof(int)*num);
  for(i = 0; i < num; i++) {
    if(!fgets(line, BUF_SIZE, fp)) return 0;
    sscanf(line, "%d", &arr[i]);
  }
  qsort(arr, num, sizeof(int), comp);

  int res = 0;
  for(i = 0; i < num;) {
    j = i;
    int cnt = 0;
    while(arr[j] == arr[i]) {
      cnt++;
      i++;
    }
    res += (cnt&1);
  }
  printf("%d\n", res);
  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
6
2
7
 4
3
5
5
2
 6
12
22
18
22
18
12
 4
3
5
9
1
 6
4
47
28
35
18
12
 3
0
0
10
 3
6
2
8
 4
3
5
5
1
 6
12
22
18
35
18
12
 3
3
2
8

3
 2
 0
 4
 6
 1
 3
 2
 2
 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>
#include <string.h>

#define BUF_SIZE 15

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

int main(void) {
  FILE *fp = stdin;
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, fp)) return 0;
  int num;
  sscanf(line, "%d", &num);

  int i, j;
  int *arr = malloc(sizeof(int)*num);
  for(i = 0; i < num; i++) {
    if(!fgets(line, BUF_SIZE, fp)) return 0;
    sscanf(line, "%d", &arr[i]);
  }
  qsort(arr, num, sizeof(int), comp);

  int res = 0;
  for(i = 0; i < num;) {
    j = i;
    int cnt = 0;
    while(arr[j] == arr[i]) {
      cnt++;
      i++;
    }
    res += (cnt&1);
  }
  printf("%d\n", res);
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.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
	movl	$15, %esi
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	stdin(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	25(%rsp), %r13
	movq	%r14, %rdx
	movq	%r13, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L5
	leaq	.LC0(%rip), %r15
	leaq	20(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	%r15, %rsi
	call	__isoc99_sscanf@PLT
	movslq	20(%rsp), %rbp
	leaq	0(,%rbp,4), %rdi
	movl	%ebp, 12(%rsp)
	call	malloc@PLT
	movl	12(%rsp), %edx
	movq	%rax, %rbx
	testl	%edx, %edx
	jle	.L6
	movq	%rax, %r12
	xorl	%ebp, %ebp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r12, %rdx
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movl	20(%rsp), %edx
	addl	$1, %ebp
	addq	$4, %r12
	cmpl	%ebp, %edx
	jle	.L20
.L8:
	movq	%r14, %rdx
	movl	$15, %esi
	movq	%r13, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L21
.L5:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %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
.L20:
	.cfi_restore_state
	movslq	%edx, %rbp
.L6:
	leaq	comp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	20(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L13
	movl	(%rbx), %edi
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %esi
	xorl	%edx, %edx
	movslq	%esi, %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%eax, %esi
	addq	$1, %rax
	addl	$1, %edx
	movl	-4(%rbx,%rax,4), %ecx
	cmpl	%edi, %ecx
	je	.L11
	andl	$1, %edx
	addl	%edx, %r8d
	cmpl	%esi, %r9d
	jle	.L9
	movl	%ecx, %edi
	jmp	.L10
.L13:
	xorl	%r8d, %r8d
.L9:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.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
	movl	$15, %esi
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	stdin(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	25(%rsp), %r13
	movq	%r14, %rdx
	movq	%r13, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L5
	leaq	.LC0(%rip), %r15
	leaq	20(%rsp), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	%r15, %rsi
	call	__isoc99_sscanf@PLT
	movslq	20(%rsp), %rbp
	leaq	0(,%rbp,4), %rdi
	movl	%ebp, 12(%rsp)
	call	malloc@PLT
	movl	12(%rsp), %edx
	movq	%rax, %rbx
	testl	%edx, %edx
	jle	.L6
	movq	%rax, %r12
	xorl	%ebp, %ebp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r12, %rdx
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	movl	20(%rsp), %edx
	addl	$1, %ebp
	addq	$4, %r12
	cmpl	%ebp, %edx
	jle	.L20
.L8:
	movq	%r14, %rdx
	movl	$15, %esi
	movq	%r13, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L21
.L5:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %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
.L20:
	.cfi_restore_state
	movslq	%edx, %rbp
.L6:
	leaq	comp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	20(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L13
	movl	(%rbx), %edi
	xorl	%r8d, %r8d
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	addl	$1, %esi
	xorl	%edx, %edx
	movslq	%esi, %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%eax, %esi
	addq	$1, %rax
	addl	$1, %edx
	movl	-4(%rbx,%rax,4), %ecx
	cmpl	%edi, %ecx
	je	.L11
	andl	$1, %edx
	addl	%edx, %r8d
	cmpl	%esi, %r9d
	jle	.L9
	movl	%ecx, %edi
	jmp	.L10
.L13:
	xorl	%r8d, %r8d
.L9:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```