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

void bubble_sort(int *score, int *num, int n)
{
	int i, j, k;
	
	for (i = 0; i < n; i++){
		for (j = 0; j < n; j++){
			if (score[i] < score[j]){
				num[i]++;
			}
		}
	}
}

int main(void)
{
	int n;
	int i;
	int score[100], num[100];
	int ta, tb, sa, sb;
	
	scanf("%d", &n);
	memset(score, 0, sizeof(score));
	
	for (i = 0; i < n; i++){
		num[i] = 1;
	}
	
	for (i = 0; i < n * (n - 1) / 2; i++){
		scanf("%d%d%d%d", &ta, &tb, &sa, &sb);
		
		if (sa > sb){
			score[ta - 1] += 3;
		}
		else if (sa < sb){
			score[tb - 1] += 3;
		}
		else {
			score[ta - 1]++;
			score[tb - 1]++;
		}
	}
	
	bubble_sort(score, num, n);
	
	for (i = 0; i < n; i++){
		printf("%d\n", num[i]);
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	bubble_sort
	.type	bubble_sort, @function
bubble_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L6:
	movl	$0, -4(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
.L4:
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L5
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	bubble_sort, .-bubble_sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$848, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-840(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-816(%rbp), %rax
	movl	$400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -820(%rbp)
	jmp	.L8
.L9:
	movl	-820(%rbp), %eax
	cltq
	movl	$1, -416(%rbp,%rax,4)
	addl	$1, -820(%rbp)
.L8:
	movl	-840(%rbp), %eax
	cmpl	%eax, -820(%rbp)
	jl	.L9
	movl	$0, -820(%rbp)
	jmp	.L10
.L14:
	leaq	-824(%rbp), %rsi
	leaq	-828(%rbp), %rcx
	leaq	-832(%rbp), %rdx
	leaq	-836(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-828(%rbp), %edx
	movl	-824(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-836(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L12
.L11:
	movl	-828(%rbp), %edx
	movl	-824(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-832(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-832(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L12
.L13:
	movl	-836(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-832(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
.L12:
	addl	$1, -820(%rbp)
.L10:
	movl	-840(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-840(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -820(%rbp)
	jl	.L14
	movl	-840(%rbp), %edx
	leaq	-416(%rbp), %rcx
	leaq	-816(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	bubble_sort
	movl	$0, -820(%rbp)
	jmp	.L15
.L16:
	movl	-820(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -820(%rbp)
.L15:
	movl	-840(%rbp), %eax
	cmpl	%eax, -820(%rbp)
	jl	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.p2align 4
	.globl	bubble_sort
	.type	bubble_sort, @function
bubble_sort:
.LFB51:
	.cfi_startproc
	endbr64
	testl	%edx, %edx
	jle	.L1
	leal	-1(%rdx), %eax
	movq	%rdi, %rdx
	leaq	4(%rdi,%rax,4), %rcx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rax), %r8d
	cmpl	%r8d, (%rdx)
	jge	.L4
	addl	$1, (%rsi)
.L4:
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L5
	addq	$4, %rdx
	addq	$4, %rsi
	cmpq	%rcx, %rdx
	jne	.L3
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	bubble_sort, .-bubble_sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d%d%d%d"
.LC3:
	.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
	leaq	.LC0(%rip), %rdi
	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	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	32(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$50, %ecx
	movq	%rbx, %rdi
	rep stosq
	leal	-1(%rdx), %eax
	testl	%edx, %edx
	jle	.L9
	cmpl	$2, %eax
	jbe	.L10
	movl	%edx, %ecx
	movdqa	.LC1(%rip), %xmm0
	leaq	432(%rsp), %rax
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	448(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L11:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L11
	movl	%edx, %eax
	andl	$-4, %eax
	testb	$3, %dl
	je	.L25
	movslq	%eax, %rcx
	addl	$1, %eax
	movl	$1, 432(%rsp,%rcx,4)
	cmpl	%edx, %eax
	jge	.L25
.L26:
	movslq	%eax, %rcx
	addl	$1, %eax
	movl	$1, 432(%rsp,%rcx,4)
	cmpl	%eax, %edx
	jle	.L25
	cltq
	movl	$1, 432(%rsp,%rax,4)
.L25:
	xorl	%ebp, %ebp
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %r12
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L40:
	movl	16(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 32(%rsp,%rax,4)
.L16:
	movl	12(%rsp), %edx
	addl	$1, %ebp
	leal	-1(%rdx), %ecx
	imull	%edx, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	cmpl	%ebp, %eax
	jle	.L39
.L18:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r15, %r8
	movq	%r12, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %ecx
	movl	28(%rsp), %edx
	cmpl	%edx, %ecx
	jg	.L40
	movl	20(%rsp), %eax
	subl	$1, %eax
	cmpl	%edx, %ecx
	jge	.L17
	cltq
	addl	$3, 32(%rsp,%rax,4)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	movl	16(%rsp), %edi
	cltq
	leal	-1(%rdi), %edx
	movslq	%edx, %rdx
	addl	$1, 32(%rsp,%rdx,4)
	addl	$1, 32(%rsp,%rax,4)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L39:
	testl	%edx, %edx
	jle	.L24
.L14:
	leaq	432(%rsp), %rbp
	xorl	%edi, %edi
	movq	%rbp, %rcx
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%rbx,%rdi,4), %esi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L21:
	cmpl	(%rbx,%rax,4), %esi
	jge	.L20
	addl	$1, (%rcx)
.L20:
	addq	$1, %rax
	cmpl	%eax, %edx
	jg	.L21
	addq	$1, %rdi
	addq	$4, %rcx
	cmpl	%edi, %edx
	jg	.L22
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L23:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L23
.L24:
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$856, %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
	imull	%edx, %eax
	subl	$1, %eax
	jg	.L25
	jmp	.L24
.L10:
	movl	$1, 432(%rsp)
	cmpl	$1, %edx
	je	.L14
	movl	$1, %eax
	jmp	.L26
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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
	.p2align 4
	.globl	bubble_sort
	.type	bubble_sort, @function
bubble_sort:
.LFB51:
	.cfi_startproc
	endbr64
	testl	%edx, %edx
	jle	.L1
	leal	-1(%rdx), %eax
	movq	%rdi, %rdx
	leaq	4(%rdi,%rax,4), %rcx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rax), %r8d
	cmpl	%r8d, (%rdx)
	jge	.L4
	addl	$1, (%rsi)
.L4:
	addq	$4, %rax
	cmpq	%rcx, %rax
	jne	.L5
	addq	$4, %rdx
	addq	$4, %rsi
	cmpq	%rcx, %rdx
	jne	.L3
.L1:
	ret
	.cfi_endproc
.LFE51:
	.size	bubble_sort, .-bubble_sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d%d%d%d"
.LC3:
	.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
	leaq	.LC0(%rip), %rdi
	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	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	32(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$50, %ecx
	movq	%rbx, %rdi
	rep stosq
	leal	-1(%rdx), %eax
	testl	%edx, %edx
	jle	.L9
	cmpl	$2, %eax
	jbe	.L10
	movl	%edx, %ecx
	movdqa	.LC1(%rip), %xmm0
	leaq	432(%rsp), %rax
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	448(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L11:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L11
	movl	%edx, %eax
	andl	$-4, %eax
	testb	$3, %dl
	je	.L25
	movslq	%eax, %rcx
	addl	$1, %eax
	movl	$1, 432(%rsp,%rcx,4)
	cmpl	%edx, %eax
	jge	.L25
.L26:
	movslq	%eax, %rcx
	addl	$1, %eax
	movl	$1, 432(%rsp,%rcx,4)
	cmpl	%eax, %edx
	jle	.L25
	cltq
	movl	$1, 432(%rsp,%rax,4)
.L25:
	xorl	%ebp, %ebp
	leaq	28(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	20(%rsp), %r13
	leaq	16(%rsp), %r12
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L40:
	movl	16(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$3, 32(%rsp,%rax,4)
.L16:
	movl	12(%rsp), %edx
	addl	$1, %ebp
	leal	-1(%rdx), %ecx
	imull	%edx, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	cmpl	%ebp, %eax
	jle	.L39
.L18:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r15, %r8
	movq	%r12, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %ecx
	movl	28(%rsp), %edx
	cmpl	%edx, %ecx
	jg	.L40
	movl	20(%rsp), %eax
	subl	$1, %eax
	cmpl	%edx, %ecx
	jge	.L17
	cltq
	addl	$3, 32(%rsp,%rax,4)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	movl	16(%rsp), %edi
	cltq
	leal	-1(%rdi), %edx
	movslq	%edx, %rdx
	addl	$1, 32(%rsp,%rdx,4)
	addl	$1, 32(%rsp,%rax,4)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L39:
	testl	%edx, %edx
	jle	.L24
.L14:
	leaq	432(%rsp), %rbp
	xorl	%edi, %edi
	movq	%rbp, %rcx
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%rbx,%rdi,4), %esi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L21:
	cmpl	(%rbx,%rax,4), %esi
	jge	.L20
	addl	$1, (%rcx)
.L20:
	addq	$1, %rax
	cmpl	%eax, %edx
	jg	.L21
	addq	$1, %rdi
	addq	$4, %rcx
	cmpl	%edi, %edx
	jg	.L22
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L23:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L23
.L24:
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$856, %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
	imull	%edx, %eax
	subl	$1, %eax
	jg	.L25
	jmp	.L24
.L10:
	movl	$1, 432(%rsp)
	cmpl	$1, %edx
	je	.L14
	movl	$1, %eax
	jmp	.L26
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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>
#include <string.h>
#include <stdlib.h>

void bubble_sort(int *score, int *num, int n)
{
	int i, j, k;
	
	for (i = 0; i < n; i++){
		for (j = 0; j < n; j++){
			if (score[i] < score[j]){
				num[i]++;
			}
		}
	}
}

int main(void)
{
	int n;
	int i;
	int score[100], num[100];
	int ta, tb, sa, sb;
	
	scanf("%d", &n);
	memset(score, 0, sizeof(score));
	
	for (i = 0; i < n; i++){
		num[i] = 1;
	}
	
	for (i = 0; i < n * (n - 1) / 2; i++){
		scanf("%d%d%d%d", &ta, &tb, &sa, &sb);
		
		if (sa > sb){
			score[ta - 1] += 3;
		}
		else if (sa < sb){
			score[tb - 1] += 3;
		}
		else {
			score[ta - 1]++;
			score[tb - 1]++;
		}
	}
	
	bubble_sort(score, num, n);
	
	for (i = 0; i < n; i++){
		printf("%d\n", num[i]);
	}
	
	return (0);
}
4
1 2 0 1
1 3 2 1
1 4 2 2
2 3 2 1
2 4 3 0
3 4 1 3
 4
1 2 0 1
1 3 2 1
1 4 2 2
4 3 2 1
2 4 3 0
3 4 1 3
 4
1 2 1 1
1 3 2 1
1 4 2 2
4 0 3 1
2 4 3 0
0 4 1 4
 4
1 1 1 1
1 3 2 1
1 4 2 0
4 0 3 1
2 4 3 0
0 4 1 4
 4
1 2 0 1
2 3 2 1
1 4 2 2
2 3 2 1
2 4 3 0
3 4 1 3
 4
1 2 0 1
1 3 2 1
1 4 2 2
4 0 2 1
3 4 3 0
0 4 1 4
 4
1 1 1 1
1 3 2 1
1 3 2 2
4 0 3 2
2 4 3 0
0 4 1 4
 4
1 4 0 1
1 3 2 1
1 4 2 2
4 0 2 1
3 4 3 0
-1 4 1 4
 4
1 1 1 1
1 3 2 1
2 4 2 0
4 0 3 1
2 4 3 0
0 4 2 8
 4
1 2 0 1
1 3 2 1
1 4 2 2
2 3 1 0
2 4 3 0
3 4 1 0

2
1
4
2
 3
2
4
1
 2
3
4
1
 1
3
4
2
 3
1
4
2
 2
3
3
1
 1
3
4
1
 2
4
3
1
 3
1
4
1
 2
1
3
4

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

void bubble_sort(int *score, int *num, int n)
{
	int i, j, k;
	
	for (i = 0; i < n; i++){
		for (j = 0; j < n; j++){
			if (score[i] < score[j]){
				num[i]++;
			}
		}
	}
}

int main(void)
{
	int n;
	int i;
	int score[100], num[100];
	int ta, tb, sa, sb;
	
	scanf("%d", &n);
	memset(score, 0, sizeof(score));
	
	for (i = 0; i < n; i++){
		num[i] = 1;
	}
	
	for (i = 0; i < n * (n - 1) / 2; i++){
		scanf("%d%d%d%d", &ta, &tb, &sa, &sb);
		
		if (sa > sb){
			score[ta - 1] += 3;
		}
		else if (sa < sb){
			score[tb - 1] += 3;
		}
		else {
			score[ta - 1]++;
			score[tb - 1]++;
		}
	}
	
	bubble_sort(score, num, n);
	
	for (i = 0; i < n; i++){
		printf("%d\n", num[i]);
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	bubble_sort
	.type	bubble_sort, @function
bubble_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L6:
	movl	$0, -4(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
.L4:
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L5
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	bubble_sort, .-bubble_sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$848, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-840(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-816(%rbp), %rax
	movl	$400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -820(%rbp)
	jmp	.L8
.L9:
	movl	-820(%rbp), %eax
	cltq
	movl	$1, -416(%rbp,%rax,4)
	addl	$1, -820(%rbp)
.L8:
	movl	-840(%rbp), %eax
	cmpl	%eax, -820(%rbp)
	jl	.L9
	movl	$0, -820(%rbp)
	jmp	.L10
.L14:
	leaq	-824(%rbp), %rsi
	leaq	-828(%rbp), %rcx
	leaq	-832(%rbp), %rdx
	leaq	-836(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-828(%rbp), %edx
	movl	-824(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-836(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L12
.L11:
	movl	-828(%rbp), %edx
	movl	-824(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-832(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-832(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L12
.L13:
	movl	-836(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-832(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
.L12:
	addl	$1, -820(%rbp)
.L10:
	movl	-840(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-840(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -820(%rbp)
	jl	.L14
	movl	-840(%rbp), %edx
	leaq	-416(%rbp), %rcx
	leaq	-816(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	bubble_sort
	movl	$0, -820(%rbp)
	jmp	.L15
.L16:
	movl	-820(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -820(%rbp)
.L15:
	movl	-840(%rbp), %eax
	cmpl	%eax, -820(%rbp)
	jl	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.globl	bubble_sort
	.type	bubble_sort, @function
bubble_sort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L6:
	movl	$0, -4(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
.L4:
	addl	$1, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L5
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L6
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	bubble_sort, .-bubble_sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$848, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-840(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-816(%rbp), %rax
	movl	$400, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -820(%rbp)
	jmp	.L8
.L9:
	movl	-820(%rbp), %eax
	cltq
	movl	$1, -416(%rbp,%rax,4)
	addl	$1, -820(%rbp)
.L8:
	movl	-840(%rbp), %eax
	cmpl	%eax, -820(%rbp)
	jl	.L9
	movl	$0, -820(%rbp)
	jmp	.L10
.L14:
	leaq	-824(%rbp), %rsi
	leaq	-828(%rbp), %rcx
	leaq	-832(%rbp), %rdx
	leaq	-836(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-828(%rbp), %edx
	movl	-824(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-836(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L12
.L11:
	movl	-828(%rbp), %edx
	movl	-824(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-832(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	-832(%rbp), %edx
	leal	-1(%rdx), %ecx
	leal	3(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -816(%rbp,%rax,4)
	jmp	.L12
.L13:
	movl	-836(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-832(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -816(%rbp,%rax,4)
.L12:
	addl	$1, -820(%rbp)
.L10:
	movl	-840(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-840(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -820(%rbp)
	jl	.L14
	movl	-840(%rbp), %edx
	leaq	-416(%rbp), %rcx
	leaq	-816(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	bubble_sort
	movl	$0, -820(%rbp)
	jmp	.L15
.L16:
	movl	-820(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -820(%rbp)
.L15:
	movl	-840(%rbp), %eax
	cmpl	%eax, -820(%rbp)
	jl	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
