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>
#include<string.h>
typedef struct D{int n,s,t,p[15];}D;
D team[55];
int M,T,P,R,i,m,t,p,j;

int cmp(const void *a,const void*b)
{
	D x=(*(D*)a),y=(*(D*)b);
	if(x.s==y.s&&x.t==y.t)return y.n-x.n;
	if(x.s==y.s)return x.t-y.t;
	return y.s-x.s;
}

int main()
{
	for(;scanf("%d%d%d%d",&M,&T,&P,&R),M;)
	{
		memset(team,0,sizeof(team));
		for(i=0;i<T;i++)team[i].n=i+1;
		for(i=0;i<R;i++)
		{
			scanf("%d%d%d%d",&m,&t,&p,&j);
			if(j==0)
			{
				team[t-1].s++;
				team[t-1].t+=m+team[t-1].p[p]*20;
			}
			else
			{
				team[t-1].p[p]++;
			}
		}
		qsort(team,T,sizeof(D),cmp);
		for(i=0;i<T;i++)
			printf("%s%d%s",i==0?"":team[i-1].s==team[i].s&&team[i-1].t==team[i].t?"=":",",team[i].n,i==T-1?"\n":"");
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	team
	.bss
	.align 32
	.type	team, @object
	.size	team, 3960
team:
	.zero	3960
	.globl	M
	.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	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	m
	.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	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$184, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -184(%rbp)
	movq	%rsi, -192(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	-184(%rbp), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -176(%rbp)
	movq	%rbx, -168(%rbp)
	movq	16(%rax), %rcx
	movq	24(%rax), %rbx
	movq	%rcx, -160(%rbp)
	movq	%rbx, -152(%rbp)
	movq	32(%rax), %rcx
	movq	40(%rax), %rbx
	movq	%rcx, -144(%rbp)
	movq	%rbx, -136(%rbp)
	movq	48(%rax), %rcx
	movq	56(%rax), %rbx
	movq	%rcx, -128(%rbp)
	movq	%rbx, -120(%rbp)
	movq	64(%rax), %rax
	movq	%rax, -112(%rbp)
	movq	-192(%rbp), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -96(%rbp)
	movq	%rbx, -88(%rbp)
	movq	16(%rax), %rcx
	movq	24(%rax), %rbx
	movq	%rcx, -80(%rbp)
	movq	%rbx, -72(%rbp)
	movq	32(%rax), %rcx
	movq	40(%rax), %rbx
	movq	%rcx, -64(%rbp)
	movq	%rbx, -56(%rbp)
	movq	48(%rax), %rcx
	movq	56(%rax), %rbx
	movq	%rcx, -48(%rbp)
	movq	%rbx, -40(%rbp)
	movq	64(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	-172(%rbp), %edx
	movl	-92(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L2
	movl	-168(%rbp), %edx
	movl	-88(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L2
	movl	-96(%rbp), %eax
	movl	-176(%rbp), %edx
	subl	%edx, %eax
	jmp	.L5
.L2:
	movl	-172(%rbp), %edx
	movl	-92(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L4
	movl	-168(%rbp), %eax
	movl	-88(%rbp), %edx
	subl	%edx, %eax
	jmp	.L5
.L4:
	movl	-92(%rbp), %eax
	movl	-172(%rbp), %edx
	subl	%edx, %eax
.L5:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d%d%d%d"
.LC1:
	.string	"\n"
.LC2:
	.string	""
.LC3:
	.string	"="
.LC4:
	.string	","
.LC5:
	.string	"%s%d%s"
	.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
	jmp	.L8
.L23:
	movl	$3960, %edx
	movl	$0, %esi
	leaq	team(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, i(%rip)
	jmp	.L9
.L10:
	movl	i(%rip), %edx
	movl	i(%rip), %eax
	leal	1(%rdx), %ecx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	team(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	T(%rip), %eax
	cmpl	%eax, %edx
	jl	.L10
	movl	$0, i(%rip)
	jmp	.L11
.L14:
	leaq	j(%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	j(%rip), %eax
	testl	%eax, %eax
	jne	.L12
	movl	t(%rip), %eax
	leal	-1(%rax), %edx
	movslq	%edx, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	4+team(%rip), %rax
	movl	(%rcx,%rax), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	4+team(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	t(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+team(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	t(%rip), %eax
	leal	-1(%rax), %edx
	movl	p(%rip), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+team(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	sall	$2, %eax
	movl	%eax, %edx
	movl	m(%rip), %eax
	addl	%eax, %edx
	movl	t(%rip), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+team(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L12:
	movl	t(%rip), %eax
	leal	-1(%rax), %ecx
	movl	p(%rip), %edx
	movslq	%edx, %rdi
	movslq	%ecx, %rsi
	movq	%rsi, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rsi
	leaq	12+team(%rip), %rax
	movl	(%rsi,%rax), %eax
	leal	1(%rax), %esi
	movslq	%edx, %rdi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+team(%rip), %rax
	movl	%esi, (%rdx,%rax)
.L13:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	R(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	T(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$72, %edx
	movq	%rax, %rsi
	leaq	team(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, i(%rip)
	jmp	.L15
.L22:
	movl	T(%rip), %eax
	leal	-1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jne	.L16
	leaq	.LC1(%rip), %rdx
	jmp	.L17
.L16:
	leaq	.LC2(%rip), %rdx
.L17:
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	team(%rip), %rax
	movl	(%rcx,%rax), %esi
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L18
	movl	i(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	4+team(%rip), %rax
	movl	(%rcx,%rax), %edi
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	4+team(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edi
	jne	.L19
	movl	i(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+team(%rip), %rax
	movl	(%rcx,%rax), %edi
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+team(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edi
	jne	.L19
	leaq	.LC3(%rip), %rax
	jmp	.L21
.L19:
	leaq	.LC4(%rip), %rax
	jmp	.L21
.L18:
	leaq	.LC2(%rip), %rax
.L21:
	movq	%rdx, %rcx
	movl	%esi, %edx
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L15:
	movl	i(%rip), %edx
	movl	T(%rip), %eax
	cmpl	%eax, %edx
	jl	.L22
.L8:
	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), %eax
	testl	%eax, %eax
	jne	.L23
	movl	$0, %eax
	popq	%rbp
	.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	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	4(%rsi), %edx
	movl	4(%rdi), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%edx, %ecx
	je	.L6
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	movl	8(%rdi), %ecx
	movl	8(%rsi), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	cmpl	%edx, %ecx
	jne	.L1
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\n"
.LC1:
	.string	""
.LC2:
	.string	","
.LC3:
	.string	"="
.LC4:
	.string	"%d%d%d%d"
.LC5:
	.string	"%s%d%s"
	.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	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	p(%rip), %r14
	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	team(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC4(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L8:
	leaq	R(%rip), %r8
	leaq	P(%rip), %rcx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	T(%rip), %rdx
	leaq	M(%rip), %rsi
	call	__isoc99_scanf@PLT
	movl	M(%rip), %eax
	testl	%eax, %eax
	je	.L32
	movslq	T(%rip), %rsi
	movl	$495, %ecx
	xorl	%eax, %eax
	movq	%rbp, %rdi
	rep stosq
	testl	%esi, %esi
	jle	.L9
	leaq	team(%rip), %rdx
	leal	1(%rsi), %ecx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%eax, (%rdx)
	addq	$1, %rax
	addq	$72, %rdx
	cmpq	%rcx, %rax
	jne	.L10
.L9:
	movl	$0, i(%rip)
	movl	R(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L11
	leaq	t(%rip), %r13
	leaq	m(%rip), %r12
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L34:
	movslq	p(%rip), %rcx
	cltq
	movd	.LC6(%rip), %xmm0
	leaq	(%rax,%rax,8), %rdx
	leaq	0(%rbp,%rdx,8), %rax
	leaq	(%rcx,%rdx,2), %rdx
	movl	12(%rbp,%rdx,4), %edx
	movq	4(%rax), %xmm1
	leal	(%rdx,%rdx,4), %ecx
	movl	m(%rip), %edx
	leal	(%rdx,%rcx,4), %edx
	movd	%edx, %xmm2
	punpckldq	%xmm2, %xmm0
	paddd	%xmm1, %xmm0
	movq	%xmm0, 4(%rax)
.L31:
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	R(%rip), %eax
	movl	%eax, i(%rip)
	jge	.L33
.L15:
	movq	%r13, %rdx
	leaq	j(%rip), %r8
	movq	%r14, %rcx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	t(%rip), %eax
	movl	j(%rip), %edx
	subl	$1, %eax
	testl	%edx, %edx
	je	.L34
	movslq	p(%rip), %rdx
	cltq
	leaq	(%rax,%rax,8), %rax
	leaq	(%rdx,%rax,2), %rax
	addl	$1, 12(%rbp,%rax,4)
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L33:
	movslq	T(%rip), %rsi
.L11:
	movl	$72, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	T(%rip), %edx
	xorl	%eax, %eax
	movl	$0, i(%rip)
	leaq	.LC5(%rip), %r13
	leaq	.LC0(%rip), %r12
	testl	%edx, %edx
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L16:
	subl	$1, %edx
	movq	%r15, %r8
	cmpl	%eax, %edx
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,8), %rdx
	cmove	%r12, %r8
	leaq	0(%rbp,%rdx,8), %rcx
	movq	%r15, %rdx
	movl	(%rcx), %r9d
	testl	%eax, %eax
	je	.L18
	subl	$1, %eax
	movl	4(%rcx), %edi
	leaq	.LC2(%rip), %rdx
	cltq
	leaq	(%rax,%rax,8), %rax
	leaq	0(%rbp,%rax,8), %rax
	cmpl	%edi, 4(%rax)
	jne	.L18
	movl	8(%rcx), %edi
	cmpl	%edi, 8(%rax)
	leaq	.LC3(%rip), %rax
	cmove	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%r9d, %ecx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	i(%rip), %eax
	movl	T(%rip), %edx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L16
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L32:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.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
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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
	.globl	team
	.align 32
	.type	team, @object
	.size	team, 3960
team:
	.zero	3960
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC6:
	.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	cmp
	.type	cmp, @function
cmp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	4(%rsi), %edx
	movl	4(%rdi), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%edx, %ecx
	je	.L6
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	movl	8(%rdi), %ecx
	movl	8(%rsi), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	cmpl	%edx, %ecx
	jne	.L1
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"\n"
.LC1:
	.string	""
.LC2:
	.string	","
.LC3:
	.string	"="
.LC4:
	.string	"%d%d%d%d"
.LC5:
	.string	"%s%d%s"
	.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	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	p(%rip), %r14
	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	team(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC4(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L8:
	leaq	R(%rip), %r8
	leaq	P(%rip), %rcx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	T(%rip), %rdx
	leaq	M(%rip), %rsi
	call	__isoc99_scanf@PLT
	movl	M(%rip), %eax
	testl	%eax, %eax
	je	.L32
	movslq	T(%rip), %rsi
	movl	$495, %ecx
	xorl	%eax, %eax
	movq	%rbp, %rdi
	rep stosq
	testl	%esi, %esi
	jle	.L9
	leaq	team(%rip), %rdx
	leal	1(%rsi), %ecx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%eax, (%rdx)
	addq	$1, %rax
	addq	$72, %rdx
	cmpq	%rcx, %rax
	jne	.L10
.L9:
	movl	$0, i(%rip)
	movl	R(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L11
	leaq	t(%rip), %r13
	leaq	m(%rip), %r12
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L34:
	movslq	p(%rip), %rcx
	cltq
	movd	.LC6(%rip), %xmm0
	leaq	(%rax,%rax,8), %rdx
	leaq	0(%rbp,%rdx,8), %rax
	leaq	(%rcx,%rdx,2), %rdx
	movl	12(%rbp,%rdx,4), %edx
	movq	4(%rax), %xmm1
	leal	(%rdx,%rdx,4), %ecx
	movl	m(%rip), %edx
	leal	(%rdx,%rcx,4), %edx
	movd	%edx, %xmm2
	punpckldq	%xmm2, %xmm0
	paddd	%xmm1, %xmm0
	movq	%xmm0, 4(%rax)
.L31:
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	R(%rip), %eax
	movl	%eax, i(%rip)
	jge	.L33
.L15:
	movq	%r13, %rdx
	leaq	j(%rip), %r8
	movq	%r14, %rcx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	t(%rip), %eax
	movl	j(%rip), %edx
	subl	$1, %eax
	testl	%edx, %edx
	je	.L34
	movslq	p(%rip), %rdx
	cltq
	leaq	(%rax,%rax,8), %rax
	leaq	(%rdx,%rax,2), %rax
	addl	$1, 12(%rbp,%rax,4)
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L33:
	movslq	T(%rip), %rsi
.L11:
	movl	$72, %edx
	leaq	cmp(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	T(%rip), %edx
	xorl	%eax, %eax
	movl	$0, i(%rip)
	leaq	.LC5(%rip), %r13
	leaq	.LC0(%rip), %r12
	testl	%edx, %edx
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L16:
	subl	$1, %edx
	movq	%r15, %r8
	cmpl	%eax, %edx
	movslq	%eax, %rdx
	leaq	(%rdx,%rdx,8), %rdx
	cmove	%r12, %r8
	leaq	0(%rbp,%rdx,8), %rcx
	movq	%r15, %rdx
	movl	(%rcx), %r9d
	testl	%eax, %eax
	je	.L18
	subl	$1, %eax
	movl	4(%rcx), %edi
	leaq	.LC2(%rip), %rdx
	cltq
	leaq	(%rax,%rax,8), %rax
	leaq	0(%rbp,%rax,8), %rax
	cmpl	%edi, 4(%rax)
	jne	.L18
	movl	8(%rcx), %edi
	cmpl	%edi, 8(%rax)
	leaq	.LC3(%rip), %rax
	cmove	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%r9d, %ecx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	i(%rip), %eax
	movl	T(%rip), %edx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L16
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L32:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.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
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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
	.globl	team
	.align 32
	.type	team, @object
	.size	team, 3960
team:
	.zero	3960
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC6:
	.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>
#include<string.h>
typedef struct D{int n,s,t,p[15];}D;
D team[55];
int M,T,P,R,i,m,t,p,j;

int cmp(const void *a,const void*b)
{
	D x=(*(D*)a),y=(*(D*)b);
	if(x.s==y.s&&x.t==y.t)return y.n-x.n;
	if(x.s==y.s)return x.t-y.t;
	return y.s-x.s;
}

int main()
{
	for(;scanf("%d%d%d%d",&M,&T,&P,&R),M;)
	{
		memset(team,0,sizeof(team));
		for(i=0;i<T;i++)team[i].n=i+1;
		for(i=0;i<R;i++)
		{
			scanf("%d%d%d%d",&m,&t,&p,&j);
			if(j==0)
			{
				team[t-1].s++;
				team[t-1].t+=m+team[t-1].p[p]*20;
			}
			else
			{
				team[t-1].p[p]++;
			}
		}
		qsort(team,T,sizeof(D),cmp);
		for(i=0;i<T;i++)
			printf("%s%d%s",i==0?"":team[i-1].s==team[i].s&&team[i-1].t==team[i].t?"=":",",team[i].n,i==T-1?"\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>
#include<string.h>
typedef struct D{int n,s,t,p[15];}D;
D team[55];
int M,T,P,R,i,m,t,p,j;

int cmp(const void *a,const void*b)
{
	D x=(*(D*)a),y=(*(D*)b);
	if(x.s==y.s&&x.t==y.t)return y.n-x.n;
	if(x.s==y.s)return x.t-y.t;
	return y.s-x.s;
}

int main()
{
	for(;scanf("%d%d%d%d",&M,&T,&P,&R),M;)
	{
		memset(team,0,sizeof(team));
		for(i=0;i<T;i++)team[i].n=i+1;
		for(i=0;i<R;i++)
		{
			scanf("%d%d%d%d",&m,&t,&p,&j);
			if(j==0)
			{
				team[t-1].s++;
				team[t-1].t+=m+team[t-1].p[p]*20;
			}
			else
			{
				team[t-1].p[p]++;
			}
		}
		qsort(team,T,sizeof(D),cmp);
		for(i=0;i<T;i++)
			printf("%s%d%s",i==0?"":team[i-1].s==team[i].s&&team[i-1].t==team[i].t?"=":",",team[i].n,i==T-1?"\n":"");
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	team
	.bss
	.align 32
	.type	team, @object
	.size	team, 3960
team:
	.zero	3960
	.globl	M
	.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	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	m
	.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	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$184, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -184(%rbp)
	movq	%rsi, -192(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	-184(%rbp), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -176(%rbp)
	movq	%rbx, -168(%rbp)
	movq	16(%rax), %rcx
	movq	24(%rax), %rbx
	movq	%rcx, -160(%rbp)
	movq	%rbx, -152(%rbp)
	movq	32(%rax), %rcx
	movq	40(%rax), %rbx
	movq	%rcx, -144(%rbp)
	movq	%rbx, -136(%rbp)
	movq	48(%rax), %rcx
	movq	56(%rax), %rbx
	movq	%rcx, -128(%rbp)
	movq	%rbx, -120(%rbp)
	movq	64(%rax), %rax
	movq	%rax, -112(%rbp)
	movq	-192(%rbp), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -96(%rbp)
	movq	%rbx, -88(%rbp)
	movq	16(%rax), %rcx
	movq	24(%rax), %rbx
	movq	%rcx, -80(%rbp)
	movq	%rbx, -72(%rbp)
	movq	32(%rax), %rcx
	movq	40(%rax), %rbx
	movq	%rcx, -64(%rbp)
	movq	%rbx, -56(%rbp)
	movq	48(%rax), %rcx
	movq	56(%rax), %rbx
	movq	%rcx, -48(%rbp)
	movq	%rbx, -40(%rbp)
	movq	64(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	-172(%rbp), %edx
	movl	-92(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L2
	movl	-168(%rbp), %edx
	movl	-88(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L2
	movl	-96(%rbp), %eax
	movl	-176(%rbp), %edx
	subl	%edx, %eax
	jmp	.L5
.L2:
	movl	-172(%rbp), %edx
	movl	-92(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L4
	movl	-168(%rbp), %eax
	movl	-88(%rbp), %edx
	subl	%edx, %eax
	jmp	.L5
.L4:
	movl	-92(%rbp), %eax
	movl	-172(%rbp), %edx
	subl	%edx, %eax
.L5:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d%d%d%d"
.LC1:
	.string	"\n"
.LC2:
	.string	""
.LC3:
	.string	"="
.LC4:
	.string	","
.LC5:
	.string	"%s%d%s"
	.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
	jmp	.L8
.L23:
	movl	$3960, %edx
	movl	$0, %esi
	leaq	team(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, i(%rip)
	jmp	.L9
.L10:
	movl	i(%rip), %edx
	movl	i(%rip), %eax
	leal	1(%rdx), %ecx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	team(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	T(%rip), %eax
	cmpl	%eax, %edx
	jl	.L10
	movl	$0, i(%rip)
	jmp	.L11
.L14:
	leaq	j(%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	j(%rip), %eax
	testl	%eax, %eax
	jne	.L12
	movl	t(%rip), %eax
	leal	-1(%rax), %edx
	movslq	%edx, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	4+team(%rip), %rax
	movl	(%rcx,%rax), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	4+team(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	t(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+team(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	t(%rip), %eax
	leal	-1(%rax), %edx
	movl	p(%rip), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+team(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	sall	$2, %eax
	movl	%eax, %edx
	movl	m(%rip), %eax
	addl	%eax, %edx
	movl	t(%rip), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+team(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L12:
	movl	t(%rip), %eax
	leal	-1(%rax), %ecx
	movl	p(%rip), %edx
	movslq	%edx, %rdi
	movslq	%ecx, %rsi
	movq	%rsi, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rsi
	leaq	12+team(%rip), %rax
	movl	(%rsi,%rax), %eax
	leal	1(%rax), %esi
	movslq	%edx, %rdi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+team(%rip), %rax
	movl	%esi, (%rdx,%rax)
.L13:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	R(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	T(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$72, %edx
	movq	%rax, %rsi
	leaq	team(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, i(%rip)
	jmp	.L15
.L22:
	movl	T(%rip), %eax
	leal	-1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jne	.L16
	leaq	.LC1(%rip), %rdx
	jmp	.L17
.L16:
	leaq	.LC2(%rip), %rdx
.L17:
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	team(%rip), %rax
	movl	(%rcx,%rax), %esi
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L18
	movl	i(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	4+team(%rip), %rax
	movl	(%rcx,%rax), %edi
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	4+team(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edi
	jne	.L19
	movl	i(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+team(%rip), %rax
	movl	(%rcx,%rax), %edi
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+team(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edi
	jne	.L19
	leaq	.LC3(%rip), %rax
	jmp	.L21
.L19:
	leaq	.LC4(%rip), %rax
	jmp	.L21
.L18:
	leaq	.LC2(%rip), %rax
.L21:
	movq	%rdx, %rcx
	movl	%esi, %edx
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L15:
	movl	i(%rip), %edx
	movl	T(%rip), %eax
	cmpl	%eax, %edx
	jl	.L22
.L8:
	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), %eax
	testl	%eax, %eax
	jne	.L23
	movl	$0, %eax
	popq	%rbp
	.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.
val
	.file	"temp.c"
	.text
	.globl	team
	.bss
	.align 32
	.type	team, @object
	.size	team, 3960
team:
	.zero	3960
	.globl	M
	.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	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	m
	.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	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$184, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -184(%rbp)
	movq	%rsi, -192(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	-184(%rbp), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -176(%rbp)
	movq	%rbx, -168(%rbp)
	movq	16(%rax), %rcx
	movq	24(%rax), %rbx
	movq	%rcx, -160(%rbp)
	movq	%rbx, -152(%rbp)
	movq	32(%rax), %rcx
	movq	40(%rax), %rbx
	movq	%rcx, -144(%rbp)
	movq	%rbx, -136(%rbp)
	movq	48(%rax), %rcx
	movq	56(%rax), %rbx
	movq	%rcx, -128(%rbp)
	movq	%rbx, -120(%rbp)
	movq	64(%rax), %rax
	movq	%rax, -112(%rbp)
	movq	-192(%rbp), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -96(%rbp)
	movq	%rbx, -88(%rbp)
	movq	16(%rax), %rcx
	movq	24(%rax), %rbx
	movq	%rcx, -80(%rbp)
	movq	%rbx, -72(%rbp)
	movq	32(%rax), %rcx
	movq	40(%rax), %rbx
	movq	%rcx, -64(%rbp)
	movq	%rbx, -56(%rbp)
	movq	48(%rax), %rcx
	movq	56(%rax), %rbx
	movq	%rcx, -48(%rbp)
	movq	%rbx, -40(%rbp)
	movq	64(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	-172(%rbp), %edx
	movl	-92(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L2
	movl	-168(%rbp), %edx
	movl	-88(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L2
	movl	-96(%rbp), %eax
	movl	-176(%rbp), %edx
	subl	%edx, %eax
	jmp	.L5
.L2:
	movl	-172(%rbp), %edx
	movl	-92(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L4
	movl	-168(%rbp), %eax
	movl	-88(%rbp), %edx
	subl	%edx, %eax
	jmp	.L5
.L4:
	movl	-92(%rbp), %eax
	movl	-172(%rbp), %edx
	subl	%edx, %eax
.L5:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d%d%d%d"
.LC1:
	.string	"\n"
.LC2:
	.string	""
.LC3:
	.string	"="
.LC4:
	.string	","
.LC5:
	.string	"%s%d%s"
	.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
	jmp	.L8
.L23:
	movl	$3960, %edx
	movl	$0, %esi
	leaq	team(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, i(%rip)
	jmp	.L9
.L10:
	movl	i(%rip), %edx
	movl	i(%rip), %eax
	leal	1(%rdx), %ecx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	team(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	T(%rip), %eax
	cmpl	%eax, %edx
	jl	.L10
	movl	$0, i(%rip)
	jmp	.L11
.L14:
	leaq	j(%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	j(%rip), %eax
	testl	%eax, %eax
	jne	.L12
	movl	t(%rip), %eax
	leal	-1(%rax), %edx
	movslq	%edx, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	4+team(%rip), %rax
	movl	(%rcx,%rax), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	4+team(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	t(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+team(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	t(%rip), %eax
	leal	-1(%rax), %edx
	movl	p(%rip), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+team(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	sall	$2, %eax
	movl	%eax, %edx
	movl	m(%rip), %eax
	addl	%eax, %edx
	movl	t(%rip), %eax
	subl	$1, %eax
	addl	%edx, %ecx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	leaq	8+team(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L13
.L12:
	movl	t(%rip), %eax
	leal	-1(%rax), %ecx
	movl	p(%rip), %edx
	movslq	%edx, %rdi
	movslq	%ecx, %rsi
	movq	%rsi, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rsi
	leaq	12+team(%rip), %rax
	movl	(%rsi,%rax), %eax
	leal	1(%rax), %esi
	movslq	%edx, %rdi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	12+team(%rip), %rax
	movl	%esi, (%rdx,%rax)
.L13:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	R(%rip), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	T(%rip), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$72, %edx
	movq	%rax, %rsi
	leaq	team(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, i(%rip)
	jmp	.L15
.L22:
	movl	T(%rip), %eax
	leal	-1(%rax), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	jne	.L16
	leaq	.LC1(%rip), %rdx
	jmp	.L17
.L16:
	leaq	.LC2(%rip), %rdx
.L17:
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	team(%rip), %rax
	movl	(%rcx,%rax), %esi
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L18
	movl	i(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	4+team(%rip), %rax
	movl	(%rcx,%rax), %edi
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	4+team(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edi
	jne	.L19
	movl	i(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+team(%rip), %rax
	movl	(%rcx,%rax), %edi
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	%rax, %rcx
	leaq	8+team(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edi
	jne	.L19
	leaq	.LC3(%rip), %rax
	jmp	.L21
.L19:
	leaq	.LC4(%rip), %rax
	jmp	.L21
.L18:
	leaq	.LC2(%rip), %rax
.L21:
	movq	%rdx, %rcx
	movl	%esi, %edx
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L15:
	movl	i(%rip), %edx
	movl	T(%rip), %eax
	cmpl	%eax, %edx
	jl	.L22
.L8:
	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), %eax
	testl	%eax, %eax
	jne	.L23
	movl	$0, %eax
	popq	%rbp
	.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:
