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 <stdlib.h>

typedef struct{
	int id;
	int score;
	int time;
	int wrong[10];
}team;

int comp(const void* c1, const void*c2){
	team* t1 = (team*)c1;
	team* t2 = (team*)c2;
	if(t1->score - t2->score){
		return t2->score - t1->score;
	}else if(t1->time - t2->time){
		return t1->time - t2->time;
	}else{
		return t2->id - t1->id;
	}
}

int M,T,P,R;
team teams[50];

int main(void){
	int i,j;
	while(scanf("%d %d %d %d",&M,&T,&P,&R),M|T|P|R){
		for(i=0;i<T;i++){
			teams[i].id=i+1;
			teams[i].score=0;
			teams[i].time=0;
			for(j=0;j<10;j++){
				teams[i].wrong[j]=0;
			}
		}
		int m,t,p,j;
		for(i=0;i<R;i++){
			scanf("%d %d %d %d",&m,&t,&p,&j);
			if(j==0){
				teams[t-1].score++;
				teams[t-1].time+=m+20*(teams[t-1].wrong[p-1]);
			}else{
				teams[t-1].wrong[p-1]++;
			}
		}
		qsort(teams,T,sizeof(team),comp);
		for(i=0;i<T;i++){

			if(i==0){
				printf("%d",teams[i].id);
			}else{
				if(teams[i-1].score==teams[i].score && teams[i-1].time==teams[i].time){
					printf("=%d",teams[i].id);
				}else{
					printf(",%d",teams[i].id);
				}
			}
		}
		printf("\n");
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.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)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	je	.L2
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L3
.L2:
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	je	.L4
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L3
.L4:
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	M
	.bss
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	P
	.align 4
	.type	P, @object
	.size	P, 4
P:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	teams
	.align 32
	.type	teams, @object
	.size	teams, 2600
teams:
	.zero	2600
	.section	.rodata
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"=%d"
.LC3:
	.string	",%d"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L20:
	movl	$0, -16(%rbp)
	jmp	.L7
.L10:
	movl	-16(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$0, -12(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L8:
	cmpl	$9, -12(%rbp)
	jle	.L9
	addl	$1, -16(%rbp)
.L7:
	movl	T(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	movl	$0, -16(%rbp)
	jmp	.L11
.L14:
	leaq	-20(%rbp), %rsi
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-28(%rbp), %eax
	leal	-1(%rax), %ecx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %esi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	%esi, (%rdx,%rax)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	sall	$2, %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	addl	%eax, %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L12:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %esi
	movslq	%esi, %rdi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edi
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	%edi, (%rdx,%rax)
.L13:
	addl	$1, -16(%rbp)
.L11:
	movl	R(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	movl	T(%rip), %eax
	cltq
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$52, %edx
	movq	%rax, %rsi
	leaq	teams(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -16(%rbp)
	jmp	.L15
.L19:
	cmpl	$0, -16(%rbp)
	jne	.L16
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L16:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L18
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L18
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L18:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -16(%rbp)
.L15:
	movl	T(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L19
	movl	$10, %edi
	call	putchar@PLT
.L6:
	leaq	R(%rip), %r8
	leaq	P(%rip), %rax
	movq	%rax, %rcx
	leaq	T(%rip), %rax
	movq	%rax, %rdx
	leaq	M(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %edx
	movl	T(%rip), %eax
	orl	%eax, %edx
	movl	P(%rip), %eax
	orl	%eax, %edx
	movl	R(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	jne	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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	comp
	.type	comp, @function
comp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %edx
	movl	4(%rsi), %eax
	cmpl	%eax, %edx
	jne	.L5
	movl	8(%rdi), %eax
	movl	8(%rsi), %edx
	cmpl	%edx, %eax
	je	.L4
.L5:
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"=%d"
.LC3:
	.string	",%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	teams(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	leaq	P(%rip), %rcx
	leaq	M(%rip), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	leaq	R(%rip), %r8
	leaq	T(%rip), %rdx
	call	__isoc99_scanf@PLT
	movl	T(%rip), %ecx
	movl	M(%rip), %eax
	movl	R(%rip), %esi
	orl	%ecx, %eax
	orl	P(%rip), %eax
	orl	%esi, %eax
	je	.L21
	movq	%rbx, %rax
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jle	.L23
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %edx
	movl	$0, 4(%rax)
	addq	$52, %rax
	movl	%edx, -52(%rax)
	movl	$0, -44(%rax)
	movl	$0, -40(%rax)
	movl	$0, -36(%rax)
	movl	$0, -32(%rax)
	movl	$0, -28(%rax)
	movl	$0, -24(%rax)
	movl	$0, -20(%rax)
	movl	$0, -16(%rax)
	movl	$0, -12(%rax)
	movl	$0, -8(%rax)
	movl	$0, -4(%rax)
	cmpl	%ecx, %edx
	jne	.L9
.L23:
	testl	%esi, %esi
	jle	.L10
	leaq	36(%rsp), %r15
	leaq	24(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	32(%rsp), %r14
	leaq	28(%rsp), %r13
	movq	%rax, 8(%rsp)
	movq	%r15, %rax
	movq	%r14, %r15
	movq	%r13, %r14
	movl	%r12d, %r13d
	movq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L14:
	movq	8(%rsp), %rsi
	movq	%r14, %rdx
	movq	%r12, %r8
	movq	%r15, %rcx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	movl	36(%rsp), %edx
	subl	$1, %eax
	testl	%edx, %edx
	jne	.L11
	cltq
	movd	.LC4(%rip), %xmm0
	addl	$1, %r13d
	leaq	(%rax,%rax,2), %rdx
	leaq	(%rax,%rdx,4), %rdx
	movl	32(%rsp), %eax
	leaq	(%rbx,%rdx,4), %rcx
	subl	$1, %eax
	movq	4(%rcx), %xmm1
	cltq
	addq	%rax, %rdx
	movl	12(%rbx,%rdx,4), %eax
	leal	(%rax,%rax,4), %edx
	movl	24(%rsp), %eax
	leal	(%rax,%rdx,4), %eax
	movd	%eax, %xmm2
	punpckldq	%xmm2, %xmm0
	paddd	%xmm1, %xmm0
	movq	%xmm0, 4(%rcx)
	cmpl	R(%rip), %r13d
	jl	.L14
.L13:
	movl	T(%rip), %ecx
.L10:
	movslq	%ecx, %rsi
	movl	$52, %edx
	movq	%rbx, %rdi
	xorl	%r13d, %r13d
	leaq	comp(%rip), %rcx
	leaq	teams(%rip), %r12
	call	qsort@PLT
	movl	T(%rip), %eax
	leaq	.LC2(%rip), %r15
	leaq	.LC1(%rip), %r14
	testl	%eax, %eax
	jg	.L19
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%r12), %edx
	movl	4(%r12), %eax
	cmpl	%eax, -48(%r12)
	jne	.L18
	movl	8(%r12), %eax
	cmpl	%eax, -44(%r12)
	je	.L32
.L18:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	addl	$1, %r13d
	addq	$52, %r12
	cmpl	%r13d, T(%rip)
	jle	.L20
.L19:
	testl	%r13d, %r13d
	jne	.L16
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L11:
	movl	32(%rsp), %edi
	cltq
	addl	$1, %r13d
	leaq	(%rax,%rax,2), %rcx
	leal	-1(%rdi), %edx
	leaq	(%rax,%rcx,4), %rax
	movslq	%edx, %rdx
	addq	%rdx, %rax
	addl	$1, 12(%rbx,%rax,4)
	cmpl	%r13d, R(%rip)
	jg	.L14
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L8
.L32:
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L21:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
.L33:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	teams
	.bss
	.align 32
	.type	teams, @object
	.size	teams, 2600
teams:
	.zero	2600
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	P
	.align 4
	.type	P, @object
	.size	P, 4
P:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC4:
	.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	comp
	.type	comp, @function
comp:
.LFB39:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %edx
	movl	4(%rsi), %eax
	cmpl	%eax, %edx
	jne	.L5
	movl	8(%rdi), %eax
	movl	8(%rsi), %edx
	cmpl	%edx, %eax
	je	.L4
.L5:
	subl	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"=%d"
.LC3:
	.string	",%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	teams(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	leaq	P(%rip), %rcx
	leaq	M(%rip), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	leaq	R(%rip), %r8
	leaq	T(%rip), %rdx
	call	__isoc99_scanf@PLT
	movl	T(%rip), %ecx
	movl	M(%rip), %eax
	movl	R(%rip), %esi
	orl	%ecx, %eax
	orl	P(%rip), %eax
	orl	%esi, %eax
	je	.L21
	movq	%rbx, %rax
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jle	.L23
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %edx
	movl	$0, 4(%rax)
	addq	$52, %rax
	movl	%edx, -52(%rax)
	movl	$0, -44(%rax)
	movl	$0, -40(%rax)
	movl	$0, -36(%rax)
	movl	$0, -32(%rax)
	movl	$0, -28(%rax)
	movl	$0, -24(%rax)
	movl	$0, -20(%rax)
	movl	$0, -16(%rax)
	movl	$0, -12(%rax)
	movl	$0, -8(%rax)
	movl	$0, -4(%rax)
	cmpl	%ecx, %edx
	jne	.L9
.L23:
	testl	%esi, %esi
	jle	.L10
	leaq	36(%rsp), %r15
	leaq	24(%rsp), %rax
	xorl	%r12d, %r12d
	leaq	32(%rsp), %r14
	leaq	28(%rsp), %r13
	movq	%rax, 8(%rsp)
	movq	%r15, %rax
	movq	%r14, %r15
	movq	%r13, %r14
	movl	%r12d, %r13d
	movq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L14:
	movq	8(%rsp), %rsi
	movq	%r14, %rdx
	movq	%r12, %r8
	movq	%r15, %rcx
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	movl	36(%rsp), %edx
	subl	$1, %eax
	testl	%edx, %edx
	jne	.L11
	cltq
	movd	.LC4(%rip), %xmm0
	addl	$1, %r13d
	leaq	(%rax,%rax,2), %rdx
	leaq	(%rax,%rdx,4), %rdx
	movl	32(%rsp), %eax
	leaq	(%rbx,%rdx,4), %rcx
	subl	$1, %eax
	movq	4(%rcx), %xmm1
	cltq
	addq	%rax, %rdx
	movl	12(%rbx,%rdx,4), %eax
	leal	(%rax,%rax,4), %edx
	movl	24(%rsp), %eax
	leal	(%rax,%rdx,4), %eax
	movd	%eax, %xmm2
	punpckldq	%xmm2, %xmm0
	paddd	%xmm1, %xmm0
	movq	%xmm0, 4(%rcx)
	cmpl	R(%rip), %r13d
	jl	.L14
.L13:
	movl	T(%rip), %ecx
.L10:
	movslq	%ecx, %rsi
	movl	$52, %edx
	movq	%rbx, %rdi
	xorl	%r13d, %r13d
	leaq	comp(%rip), %rcx
	leaq	teams(%rip), %r12
	call	qsort@PLT
	movl	T(%rip), %eax
	leaq	.LC2(%rip), %r15
	leaq	.LC1(%rip), %r14
	testl	%eax, %eax
	jg	.L19
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%r12), %edx
	movl	4(%r12), %eax
	cmpl	%eax, -48(%r12)
	jne	.L18
	movl	8(%r12), %eax
	cmpl	%eax, -44(%r12)
	je	.L32
.L18:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	addl	$1, %r13d
	addq	$52, %r12
	cmpl	%r13d, T(%rip)
	jle	.L20
.L19:
	testl	%r13d, %r13d
	jne	.L16
	movl	(%rbx), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L11:
	movl	32(%rsp), %edi
	cltq
	addl	$1, %r13d
	leaq	(%rax,%rax,2), %rcx
	leal	-1(%rdi), %edx
	leaq	(%rax,%rcx,4), %rax
	movslq	%edx, %rdx
	addq	%rdx, %rax
	addl	$1, 12(%rbx,%rax,4)
	cmpl	%r13d, R(%rip)
	jg	.L14
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L8
.L32:
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L21:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	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
.L33:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	teams
	.bss
	.align 32
	.type	teams, @object
	.size	teams, 2600
teams:
	.zero	2600
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	P
	.align 4
	.type	P, @object
	.size	P, 4
P:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC4:
	.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 <stdlib.h>

typedef struct{
	int id;
	int score;
	int time;
	int wrong[10];
}team;

int comp(const void* c1, const void*c2){
	team* t1 = (team*)c1;
	team* t2 = (team*)c2;
	if(t1->score - t2->score){
		return t2->score - t1->score;
	}else if(t1->time - t2->time){
		return t1->time - t2->time;
	}else{
		return t2->id - t1->id;
	}
}

int M,T,P,R;
team teams[50];

int main(void){
	int i,j;
	while(scanf("%d %d %d %d",&M,&T,&P,&R),M|T|P|R){
		for(i=0;i<T;i++){
			teams[i].id=i+1;
			teams[i].score=0;
			teams[i].time=0;
			for(j=0;j<10;j++){
				teams[i].wrong[j]=0;
			}
		}
		int m,t,p,j;
		for(i=0;i<R;i++){
			scanf("%d %d %d %d",&m,&t,&p,&j);
			if(j==0){
				teams[t-1].score++;
				teams[t-1].time+=m+20*(teams[t-1].wrong[p-1]);
			}else{
				teams[t-1].wrong[p-1]++;
			}
		}
		qsort(teams,T,sizeof(team),comp);
		for(i=0;i<T;i++){

			if(i==0){
				printf("%d",teams[i].id);
			}else{
				if(teams[i-1].score==teams[i].score && teams[i-1].time==teams[i].time){
					printf("=%d",teams[i].id);
				}else{
					printf(",%d",teams[i].id);
				}
			}
		}
		printf("\n");
	}
	return 0;
}
300 10 8 5
50 5 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 2 2 0
240 5 5 7
50 1 1 0
60 2 2 0
70 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
20 2 2 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 1
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
50 2 2 0
60 1 2 0
120 3 3 2
0 1 1 0
1 2 2 0
300 5 8 0
0 0 0 0
 300 10 8 5
50 5 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 2 2 0
240 5 5 7
50 1 1 0
60 2 2 0
70 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
20 2 2 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 1
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
50 2 2 0
60 1 2 0
120 3 3 2
0 1 1 0
1 1 2 0
300 5 8 0
0 0 0 0
 300 10 8 5
50 5 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 3 2 0
240 5 5 7
50 1 1 0
60 2 2 0
70 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
13 2 2 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 1
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
50 2 2 0
60 1 2 0
120 3 3 2
0 1 1 0
1 2 2 0
300 5 8 0
0 0 0 0
 300 10 8 5
50 5 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 2 2 0
240 5 5 7
50 1 1 0
60 2 2 0
70 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
20 2 2 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 1
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
13 2 2 0
60 1 2 0
120 3 3 2
0 1 1 0
1 2 2 0
300 5 8 0
0 0 0 0
 300 10 8 5
50 5 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 2 2 0
240 5 5 7
50 1 1 0
60 2 2 0
41 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
20 2 2 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 0
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
13 2 2 0
60 1 2 0
120 3 3 2
0 1 1 0
1 2 2 0
300 5 8 0
0 0 0 0
 300 10 8 5
50 6 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 3 2 0
240 5 5 7
50 1 1 0
60 2 2 0
70 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
20 2 2 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 1
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
50 2 2 0
60 1 2 0
120 3 3 2
0 1 1 0
1 2 2 0
300 5 8 0
0 0 0 0
 300 10 8 5
50 6 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 2 2 0
240 5 5 7
50 1 1 0
60 2 2 0
70 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
20 2 2 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 1
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
50 2 2 0
60 1 2 0
120 3 3 2
0 1 1 0
1 2 2 0
300 5 8 0
0 0 0 0
 300 10 8 5
50 5 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 3 2 0
240 5 5 7
50 1 1 0
60 2 2 0
70 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
13 2 2 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 1
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
1 2 2 0
60 1 2 0
120 3 3 2
0 1 1 0
1 2 2 0
300 5 8 0
0 0 0 0
 300 10 8 5
50 5 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 2 2 0
240 5 5 7
50 1 1 0
60 2 2 0
41 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
20 2 2 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 1
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
13 2 2 0
60 1 2 0
120 6 3 2
0 1 1 0
1 2 2 0
300 5 8 0
0 0 0 0
 300 10 8 5
50 6 2 1
70 5 2 0
75 1 1 0
100 3 1 0
150 2 2 0
240 5 5 7
50 1 1 0
60 2 2 0
70 2 3 0
90 1 3 0
120 3 5 0
140 4 1 0
150 2 4 1
180 3 5 4
15 2 2 1
20 2 1 1
25 2 2 0
60 1 1 0
120 5 5 4
15 5 4 1
20 5 4 0
40 1 1 0
40 2 2 0
120 2 3 4
30 1 1 0
40 2 1 0
50 2 2 0
60 1 2 0
120 3 3 2
0 1 1 0
1 2 2 0
300 5 8 0
0 0 0 0

1,5,3,2,10=9=8=7=6=4
2,1,3,4,5
1,2,3
5=2=1,4=3
2=1
1,2,3
5=4=3=2=1
 1,5,3,2,10=9=8=7=6=4
2,1,3,4,5
1,2,3
5=2=1,4=3
2=1
1,3=2
5=4=3=2=1
 3,1,5,10=9=8=7=6=4=2
2,1,3,4,5
1,2,3
5=2=1,4=3
2=1
1,2,3
5=4=3=2=1
 1,5,3,2,10=9=8=7=6=4
2,1,3,4,5
1,2,3
5=2=1,4=3
2,1
1,2,3
5=4=3=2=1
 1,5,3,2,10=9=8=7=6=4
2,1,3,4,5
1,2,3
5,2=1,4=3
2,1
1,2,3
5=4=3=2=1
 3,5,1,10=9=8=7=6=4=2
2,1,3,4,5
1,2,3
5=2=1,4=3
2=1
1,2,3
5=4=3=2=1
 5,1,3,2,10=9=8=7=6=4
2,1,3,4,5
1,2,3
5=2=1,4=3
2=1
1,2,3
5=4=3=2=1
 3,1,5,10=9=8=7=6=4=2
2,1,3,4,5
1,2,3
5=2=1,4=3
2,1
1,2,3
5=4=3=2=1
 1,5,3,2,10=9=8=7=6=4
2,1,3,4,5
1,2,3
5=2=1,4=3
2,1
1,2,6=5=4=3
5=4=3=2=1
 5,1,3,2,10=9=8=7=6=4
2,1,3,4,5
2,1,3
5=2=1,4=3
2=1
1,2,3
5=4=3=2=1

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 <stdlib.h>

typedef struct{
	int id;
	int score;
	int time;
	int wrong[10];
}team;

int comp(const void* c1, const void*c2){
	team* t1 = (team*)c1;
	team* t2 = (team*)c2;
	if(t1->score - t2->score){
		return t2->score - t1->score;
	}else if(t1->time - t2->time){
		return t1->time - t2->time;
	}else{
		return t2->id - t1->id;
	}
}

int M,T,P,R;
team teams[50];

int main(void){
	int i,j;
	while(scanf("%d %d %d %d",&M,&T,&P,&R),M|T|P|R){
		for(i=0;i<T;i++){
			teams[i].id=i+1;
			teams[i].score=0;
			teams[i].time=0;
			for(j=0;j<10;j++){
				teams[i].wrong[j]=0;
			}
		}
		int m,t,p,j;
		for(i=0;i<R;i++){
			scanf("%d %d %d %d",&m,&t,&p,&j);
			if(j==0){
				teams[t-1].score++;
				teams[t-1].time+=m+20*(teams[t-1].wrong[p-1]);
			}else{
				teams[t-1].wrong[p-1]++;
			}
		}
		qsort(teams,T,sizeof(team),comp);
		for(i=0;i<T;i++){

			if(i==0){
				printf("%d",teams[i].id);
			}else{
				if(teams[i-1].score==teams[i].score && teams[i-1].time==teams[i].time){
					printf("=%d",teams[i].id);
				}else{
					printf(",%d",teams[i].id);
				}
			}
		}
		printf("\n");
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.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)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	je	.L2
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L3
.L2:
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	je	.L4
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L3
.L4:
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	M
	.bss
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	P
	.align 4
	.type	P, @object
	.size	P, 4
P:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	teams
	.align 32
	.type	teams, @object
	.size	teams, 2600
teams:
	.zero	2600
	.section	.rodata
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"=%d"
.LC3:
	.string	",%d"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L20:
	movl	$0, -16(%rbp)
	jmp	.L7
.L10:
	movl	-16(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$0, -12(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L8:
	cmpl	$9, -12(%rbp)
	jle	.L9
	addl	$1, -16(%rbp)
.L7:
	movl	T(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	movl	$0, -16(%rbp)
	jmp	.L11
.L14:
	leaq	-20(%rbp), %rsi
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-28(%rbp), %eax
	leal	-1(%rax), %ecx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %esi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	%esi, (%rdx,%rax)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	sall	$2, %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	addl	%eax, %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L12:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %esi
	movslq	%esi, %rdi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edi
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	%edi, (%rdx,%rax)
.L13:
	addl	$1, -16(%rbp)
.L11:
	movl	R(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	movl	T(%rip), %eax
	cltq
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$52, %edx
	movq	%rax, %rsi
	leaq	teams(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -16(%rbp)
	jmp	.L15
.L19:
	cmpl	$0, -16(%rbp)
	jne	.L16
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L16:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L18
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L18
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L18:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -16(%rbp)
.L15:
	movl	T(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L19
	movl	$10, %edi
	call	putchar@PLT
.L6:
	leaq	R(%rip), %r8
	leaq	P(%rip), %rax
	movq	%rax, %rcx
	leaq	T(%rip), %rax
	movq	%rax, %rdx
	leaq	M(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %edx
	movl	T(%rip), %eax
	orl	%eax, %edx
	movl	P(%rip), %eax
	orl	%eax, %edx
	movl	R(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	jne	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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	comp
	.type	comp, @function
comp:
.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)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	je	.L2
	movq	-8(%rbp), %rax
	movl	4(%rax), %edx
	movq	-16(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L3
.L2:
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	je	.L4
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L3
.L4:
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	M
	.bss
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	P
	.align 4
	.type	P, @object
	.size	P, 4
P:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	teams
	.align 32
	.type	teams, @object
	.size	teams, 2600
teams:
	.zero	2600
	.section	.rodata
.LC0:
	.string	"%d %d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"=%d"
.LC3:
	.string	",%d"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L20:
	movl	$0, -16(%rbp)
	jmp	.L7
.L10:
	movl	-16(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$0, -12(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L8:
	cmpl	$9, -12(%rbp)
	jle	.L9
	addl	$1, -16(%rbp)
.L7:
	movl	T(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	movl	$0, -16(%rbp)
	jmp	.L11
.L14:
	leaq	-20(%rbp), %rsi
	leaq	-24(%rbp), %rcx
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
	movl	-28(%rbp), %eax
	leal	-1(%rax), %ecx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %esi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	%esi, (%rdx,%rax)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	sall	$2, %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	addl	%eax, %edx
	movl	-28(%rbp), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L12:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %esi
	movslq	%esi, %rdi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edi
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+teams(%rip), %rax
	movl	%edi, (%rdx,%rax)
.L13:
	addl	$1, -16(%rbp)
.L11:
	movl	R(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L14
	movl	T(%rip), %eax
	cltq
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$52, %edx
	movq	%rax, %rsi
	leaq	teams(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -16(%rbp)
	jmp	.L15
.L19:
	cmpl	$0, -16(%rbp)
	jne	.L16
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L16:
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	4+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L18
	movl	-16(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	8+teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L18
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L18:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	leaq	teams(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -16(%rbp)
.L15:
	movl	T(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L19
	movl	$10, %edi
	call	putchar@PLT
.L6:
	leaq	R(%rip), %r8
	leaq	P(%rip), %rax
	movq	%rax, %rcx
	leaq	T(%rip), %rax
	movq	%rax, %rdx
	leaq	M(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %edx
	movl	T(%rip), %eax
	orl	%eax, %edx
	movl	P(%rip), %eax
	orl	%eax, %edx
	movl	R(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	jne	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	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:
