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

```c
#include<stdio.h>
int main(){
  int n, p[100], a, b, i, aa = 0, ab = 0, ac = 0, ans = 100;
  scanf("%d", &n);
  scanf("%d %d", &a, &b);
  for(i = 0; i < n; ++i) {
    scanf("%d", &p[i]);
    if(p[i] <= a) aa++;
    if(p[i] >= a + 1 && p[i] <= b) ab++;
    if(p[i] >= b + 1) ac++;
  }
  if(ans > aa) ans = aa;
  if(ans > ab) ans = ab;
  if(ans > ac) ans = ac;
  printf("%d\n", ans);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -432(%rbp)
	movl	$0, -428(%rbp)
	movl	$0, -424(%rbp)
	movl	$100, -420(%rbp)
	leaq	-448(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-440(%rbp), %rdx
	leaq	-444(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -436(%rbp)
	jmp	.L2
.L6:
	leaq	-416(%rbp), %rdx
	movl	-436(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-444(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L3
	addl	$1, -432(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-444(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L4
	addl	$1, -428(%rbp)
.L4:
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L5
	addl	$1, -424(%rbp)
.L5:
	addl	$1, -436(%rbp)
.L2:
	movl	-448(%rbp), %eax
	cmpl	%eax, -436(%rbp)
	jl	.L6
	movl	-420(%rbp), %eax
	cmpl	-432(%rbp), %eax
	jle	.L7
	movl	-432(%rbp), %eax
	movl	%eax, -420(%rbp)
.L7:
	movl	-420(%rbp), %eax
	cmpl	-428(%rbp), %eax
	jle	.L8
	movl	-428(%rbp), %eax
	movl	%eax, -420(%rbp)
.L8:
	movl	-420(%rbp), %eax
	cmpl	-424(%rbp), %eax
	jle	.L9
	movl	-424(%rbp), %eax
	movl	%eax, -420(%rbp)
.L9:
	movl	-420(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	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	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L9
	leaq	16(%rsp), %rbx
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %r12d
	cmpl	12(%rsp), %eax
	jle	.L5
.L4:
	addl	$1, %r14d
.L5:
	addl	$1, %ebp
	addq	$4, %rbx
	cmpl	%ebp, 4(%rsp)
	jle	.L15
.L6:
	movq	%rbx, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	cmpl	8(%rsp), %eax
	jle	.L16
	cmpl	12(%rsp), %eax
	jg	.L4
	addl	$1, %r13d
	addl	$1, %ebp
	addq	$4, %rbx
	cmpl	%ebp, 4(%rsp)
	jg	.L6
.L15:
	movl	$100, %eax
	cmpl	%eax, %r12d
	cmovg	%eax, %r12d
.L2:
	cmpl	%r12d, %r13d
	movl	%r14d, %edx
	movl	$1, %edi
	cmovg	%r12d, %r13d
	leaq	.LC2(%rip), %rsi
	cmpl	%r14d, %r13d
	cmovle	%r13d, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$440, %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
.L9:
	.cfi_restore_state
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	jmp	.L2
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	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	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L9
	leaq	16(%rsp), %rbx
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %r12d
	cmpl	12(%rsp), %eax
	jle	.L5
.L4:
	addl	$1, %r14d
.L5:
	addl	$1, %ebp
	addq	$4, %rbx
	cmpl	%ebp, 4(%rsp)
	jle	.L15
.L6:
	movq	%rbx, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	cmpl	8(%rsp), %eax
	jle	.L16
	cmpl	12(%rsp), %eax
	jg	.L4
	addl	$1, %r13d
	addl	$1, %ebp
	addq	$4, %rbx
	cmpl	%ebp, 4(%rsp)
	jg	.L6
.L15:
	movl	$100, %eax
	cmpl	%eax, %r12d
	cmovg	%eax, %r12d
.L2:
	cmpl	%r12d, %r13d
	movl	%r14d, %edx
	movl	$1, %edi
	cmovg	%r12d, %r13d
	leaq	.LC2(%rip), %rsi
	cmpl	%r14d, %r13d
	cmovle	%r13d, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$440, %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
.L9:
	.cfi_restore_state
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	jmp	.L2
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

#include<stdio.h>
int main(){
  int n, p[100], a, b, i, aa = 0, ab = 0, ac = 0, ans = 100;
  scanf("%d", &n);
  scanf("%d %d", &a, &b);
  for(i = 0; i < n; ++i) {
    scanf("%d", &p[i]);
    if(p[i] <= a) aa++;
    if(p[i] >= a + 1 && p[i] <= b) ab++;
    if(p[i] >= b + 1) ac++;
  }
  if(ans > aa) ans = aa;
  if(ans > ab) ans = ab;
  if(ans > ac) ans = ac;
  printf("%d\n", ans);
  return 0;
}
3
5 11
5 6 10
 7
5 15
1 10 28 2 7 20 12
 8
3 8
5 5 5 2 10 10 15 20
 3
5 11
5 6 4
 7
5 15
1 13 28 2 7 20 12
 8
3 8
5 5 5 2 10 12 15 20
 3
5 11
5 6 3
 7
5 21
1 13 28 2 7 20 12
 8
3 8
5 5 5 2 9 12 15 20
 3
6 11
5 6 3

0
 2
 1
 0
 2
 1
 0
 1
 1
 0

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

```c
#include<stdio.h>
int main(){
  int n, p[100], a, b, i, aa = 0, ab = 0, ac = 0, ans = 100;
  scanf("%d", &n);
  scanf("%d %d", &a, &b);
  for(i = 0; i < n; ++i) {
    scanf("%d", &p[i]);
    if(p[i] <= a) aa++;
    if(p[i] >= a + 1 && p[i] <= b) ab++;
    if(p[i] >= b + 1) ac++;
  }
  if(ans > aa) ans = aa;
  if(ans > ab) ans = ab;
  if(ans > ac) ans = ac;
  printf("%d\n", ans);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -432(%rbp)
	movl	$0, -428(%rbp)
	movl	$0, -424(%rbp)
	movl	$100, -420(%rbp)
	leaq	-448(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-440(%rbp), %rdx
	leaq	-444(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -436(%rbp)
	jmp	.L2
.L6:
	leaq	-416(%rbp), %rdx
	movl	-436(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-444(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L3
	addl	$1, -432(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-444(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L4
	addl	$1, -428(%rbp)
.L4:
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L5
	addl	$1, -424(%rbp)
.L5:
	addl	$1, -436(%rbp)
.L2:
	movl	-448(%rbp), %eax
	cmpl	%eax, -436(%rbp)
	jl	.L6
	movl	-420(%rbp), %eax
	cmpl	-432(%rbp), %eax
	jle	.L7
	movl	-432(%rbp), %eax
	movl	%eax, -420(%rbp)
.L7:
	movl	-420(%rbp), %eax
	cmpl	-428(%rbp), %eax
	jle	.L8
	movl	-428(%rbp), %eax
	movl	%eax, -420(%rbp)
.L8:
	movl	-420(%rbp), %eax
	cmpl	-424(%rbp), %eax
	jle	.L9
	movl	-424(%rbp), %eax
	movl	%eax, -420(%rbp)
.L9:
	movl	-420(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -432(%rbp)
	movl	$0, -428(%rbp)
	movl	$0, -424(%rbp)
	movl	$100, -420(%rbp)
	leaq	-448(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-440(%rbp), %rdx
	leaq	-444(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -436(%rbp)
	jmp	.L2
.L6:
	leaq	-416(%rbp), %rdx
	movl	-436(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-444(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L3
	addl	$1, -432(%rbp)
.L3:
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-444(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L4
	addl	$1, -428(%rbp)
.L4:
	movl	-436(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L5
	addl	$1, -424(%rbp)
.L5:
	addl	$1, -436(%rbp)
.L2:
	movl	-448(%rbp), %eax
	cmpl	%eax, -436(%rbp)
	jl	.L6
	movl	-420(%rbp), %eax
	cmpl	-432(%rbp), %eax
	jle	.L7
	movl	-432(%rbp), %eax
	movl	%eax, -420(%rbp)
.L7:
	movl	-420(%rbp), %eax
	cmpl	-428(%rbp), %eax
	jle	.L8
	movl	-428(%rbp), %eax
	movl	%eax, -420(%rbp)
.L8:
	movl	-420(%rbp), %eax
	cmpl	-424(%rbp), %eax
	jle	.L9
	movl	-424(%rbp), %eax
	movl	%eax, -420(%rbp)
.L9:
	movl	-420(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
