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>

typedef struct{
	char name[100];
	int win;
	int lose;
	int prior;
}team;

void swap(team *p, team *q){
	team tmp = *p;
	*p = *q;
	*q = tmp;
}

int main(void){
	while(1){
		int n, i, j, a;
		char c[100];
		team t[10];
		
		scanf(" %d", &n);
		if(n==0) break;
	
		for(i=0; i<n; i++){
			scanf(" %s", c);
			strcpy(t[i].name, c);
			t[i].win=0;
			t[i].lose=0;
			t[i].prior=i;
			
			for(j=0; j<n-1; j++){
				scanf(" %d", &a);
				if(a==0) ++t[i].win; 
				else if(a==1) ++t[i].lose;
			}
		}
		
		for(i=0; i<n; i++){
			for(j=0; j<n; j++){
				if( (t[i].win > t[j].win) || (t[i].win==t[j].win && t[i].lose < t[j].lose) ||  (t[i].win==t[j].win && t[i].lose==t[j].lose && t[i].prior < t[j].prior) )
					swap(&t[i], &t[j]);
			}
		}
	
		for(i=0; i<n; i++)
			printf("%s\n", t[i].name);

	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB0:
	.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	$152, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -152(%rbp)
	movq	%rsi, -160(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	-152(%rbp), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -144(%rbp)
	movq	%rbx, -136(%rbp)
	movq	16(%rax), %rcx
	movq	24(%rax), %rbx
	movq	%rcx, -128(%rbp)
	movq	%rbx, -120(%rbp)
	movq	32(%rax), %rcx
	movq	40(%rax), %rbx
	movq	%rcx, -112(%rbp)
	movq	%rbx, -104(%rbp)
	movq	48(%rax), %rcx
	movq	56(%rax), %rbx
	movq	%rcx, -96(%rbp)
	movq	%rbx, -88(%rbp)
	movq	64(%rax), %rcx
	movq	72(%rax), %rbx
	movq	%rcx, -80(%rbp)
	movq	%rbx, -72(%rbp)
	movq	80(%rax), %rcx
	movq	88(%rax), %rbx
	movq	%rcx, -64(%rbp)
	movq	%rbx, -56(%rbp)
	movq	104(%rax), %rdx
	movq	96(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-152(%rbp), %rax
	movq	-160(%rbp), %rdx
	movq	(%rdx), %rcx
	movq	8(%rdx), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	16(%rdx), %rcx
	movq	24(%rdx), %rbx
	movq	%rcx, 16(%rax)
	movq	%rbx, 24(%rax)
	movq	32(%rdx), %rcx
	movq	40(%rdx), %rbx
	movq	%rcx, 32(%rax)
	movq	%rbx, 40(%rax)
	movq	48(%rdx), %rcx
	movq	56(%rdx), %rbx
	movq	%rcx, 48(%rax)
	movq	%rbx, 56(%rax)
	movq	64(%rdx), %rcx
	movq	72(%rdx), %rbx
	movq	%rcx, 64(%rax)
	movq	%rbx, 72(%rax)
	movq	80(%rdx), %rcx
	movq	88(%rdx), %rbx
	movq	%rcx, 80(%rax)
	movq	%rbx, 88(%rax)
	movq	96(%rdx), %rcx
	movq	104(%rdx), %rbx
	movq	%rcx, 96(%rax)
	movq	%rbx, 104(%rax)
	movq	-160(%rbp), %rax
	movq	-144(%rbp), %rcx
	movq	-136(%rbp), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	-128(%rbp), %rcx
	movq	-120(%rbp), %rbx
	movq	%rcx, 16(%rax)
	movq	%rbx, 24(%rax)
	movq	-112(%rbp), %rcx
	movq	-104(%rbp), %rbx
	movq	%rcx, 32(%rax)
	movq	%rbx, 40(%rax)
	movq	-96(%rbp), %rcx
	movq	-88(%rbp), %rbx
	movq	%rcx, 48(%rax)
	movq	%rbx, 56(%rax)
	movq	-80(%rbp), %rcx
	movq	-72(%rbp), %rbx
	movq	%rcx, 64(%rax)
	movq	%rbx, 72(%rax)
	movq	-64(%rbp), %rcx
	movq	-56(%rbp), %rbx
	movq	%rcx, 80(%rax)
	movq	%rbx, 88(%rax)
	movq	-48(%rbp), %rcx
	movq	-40(%rbp), %rbx
	movq	%rcx, 96(%rax)
	movq	%rbx, 104(%rax)
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L2
	call	__stack_chk_fail@PLT
.L2:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	" %s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1248, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L21:
	leaq	-1248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1248(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	jmp	.L23
.L4:
	movl	$0, -1240(%rbp)
	jmp	.L6
.L11:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1232(%rbp), %rcx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcpy@PLT
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	$0, (%rax)
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	$0, (%rax)
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	leaq	-1124(%rax), %rdx
	movl	-1240(%rbp), %eax
	movl	%eax, (%rdx)
	movl	$0, -1236(%rbp)
	jmp	.L7
.L10:
	leaq	-1244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1244(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	leal	1(%rax), %ecx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	%ecx, (%rax)
	jmp	.L9
.L8:
	movl	-1244(%rbp), %eax
	cmpl	$1, %eax
	jne	.L9
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %eax
	leal	1(%rax), %ecx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	%ecx, (%rax)
.L9:
	addl	$1, -1236(%rbp)
.L7:
	movl	-1248(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L10
	addl	$1, -1240(%rbp)
.L6:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L11
	movl	$0, -1240(%rbp)
	jmp	.L12
.L18:
	movl	$0, -1236(%rbp)
	jmp	.L13
.L17:
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jg	.L14
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L15
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jl	.L14
.L15:
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L16
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L16
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1124, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1124, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jge	.L16
.L14:
	leaq	-1232(%rbp), %rcx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-1232(%rbp), %rsi
	movl	-1240(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L16:
	addl	$1, -1236(%rbp)
.L13:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L17
	addl	$1, -1240(%rbp)
.L12:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L18
	movl	$0, -1240(%rbp)
	jmp	.L19
.L20:
	leaq	-1232(%rbp), %rcx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	puts@PLT
	addl	$1, -1240(%rbp)
.L19:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L20
	jmp	.L21
.L23:
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	swap
	.type	swap, @function
swap:
.LFB35:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movdqu	(%rsi), %xmm7
	movdqu	(%rdi), %xmm6
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	movdqu	16(%rdi), %xmm5
	movdqu	32(%rdi), %xmm4
	movups	%xmm7, (%rdi)
	movdqu	16(%rsi), %xmm7
	movdqu	48(%rdi), %xmm3
	movdqu	64(%rdi), %xmm2
	movdqu	80(%rdi), %xmm1
	movups	%xmm7, 16(%rdi)
	movdqu	32(%rsi), %xmm7
	movdqu	96(%rdi), %xmm0
	movups	%xmm7, 32(%rdi)
	movdqu	48(%rsi), %xmm7
	movups	%xmm7, 48(%rdi)
	movdqu	64(%rsi), %xmm7
	movups	%xmm7, 64(%rdi)
	movdqu	80(%rsi), %xmm7
	movups	%xmm7, 80(%rdi)
	movdqu	96(%rsi), %xmm7
	movups	%xmm7, 96(%rdi)
	movups	%xmm6, (%rsi)
	movups	%xmm5, 16(%rsi)
	movups	%xmm4, 32(%rsi)
	movups	%xmm3, 48(%rsi)
	movups	%xmm2, 64(%rsi)
	movups	%xmm1, 80(%rsi)
	movups	%xmm0, 96(%rsi)
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	addq	$136, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	swap, .-swap
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
.LC1:
	.string	" %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.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
	subq	$1400, %rsp
	.cfi_def_cfa_offset 1456
	movq	%fs:40, %rax
	movq	%rax, 1384(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	leaq	1280(%rsp), %r14
	movq	%rax, 16(%rsp)
	leaq	160(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	272(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L19:
	movq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %eax
	testl	%eax, %eax
	je	.L7
	jle	.L19
	movq	8(%rsp), %rbx
	xorl	%r13d, %r13d
	leaq	44(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r14, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	$100, %edx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	__strcpy_chk@PLT
	movl	40(%rsp), %eax
	movl	%r13d, 108(%rbx)
	movq	$0, 100(%rbx)
	cmpl	$1, %eax
	jle	.L9
	xorl	%r15d, %r15d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L32:
	addl	$1, 100(%rbx)
.L11:
	movl	40(%rsp), %eax
	addl	$1, %r15d
	leal	-1(%rax), %ecx
	cmpl	%r15d, %ecx
	jle	.L31
.L12:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L32
	cmpl	$1, %eax
	jne	.L11
	movl	40(%rsp), %eax
	addl	$1, %r15d
	addl	$1, 104(%rbx)
	leal	-1(%rax), %ecx
	cmpl	%r15d, %ecx
	jg	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	addl	$1, %r13d
	addq	$112, %rbx
	cmpl	%r13d, %eax
	jg	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	testl	%eax, %eax
	jle	.L19
	subl	$1, %eax
	movq	8(%rsp), %rdx
	leaq	0(,%rax,8), %rcx
	subq	%rax, %rcx
	salq	$4, %rcx
	addq	24(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L17:
	movq	8(%rsp), %rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L35:
	je	.L33
.L15:
	addq	$112, %rax
	cmpq	%rcx, %rax
	je	.L34
.L16:
	movl	100(%rax), %esi
	cmpl	%esi, 100(%rdx)
	jle	.L35
.L14:
	movdqa	(%rax), %xmm7
	movdqa	(%rdx), %xmm6
	addq	$112, %rax
	movdqa	16(%rdx), %xmm5
	movdqa	32(%rdx), %xmm4
	movaps	%xmm7, (%rdx)
	movdqa	-96(%rax), %xmm7
	movdqa	48(%rdx), %xmm3
	movdqa	64(%rdx), %xmm2
	movdqa	80(%rdx), %xmm1
	movaps	%xmm6, 48(%rsp)
	movaps	%xmm7, 16(%rdx)
	movdqa	-80(%rax), %xmm7
	movdqa	96(%rdx), %xmm0
	movaps	%xmm5, 64(%rsp)
	movaps	%xmm7, 32(%rdx)
	movdqa	-64(%rax), %xmm7
	movaps	%xmm4, 80(%rsp)
	movaps	%xmm7, 48(%rdx)
	movdqa	-48(%rax), %xmm7
	movaps	%xmm3, 96(%rsp)
	movaps	%xmm7, 64(%rdx)
	movdqa	-32(%rax), %xmm7
	movaps	%xmm2, 112(%rsp)
	movaps	%xmm7, 80(%rdx)
	movdqa	-16(%rax), %xmm7
	movaps	%xmm1, 128(%rsp)
	movaps	%xmm7, 96(%rdx)
	movaps	%xmm0, 144(%rsp)
	movaps	%xmm6, -112(%rax)
	movaps	%xmm5, -96(%rax)
	movaps	%xmm4, -80(%rax)
	movaps	%xmm3, -64(%rax)
	movaps	%xmm2, -48(%rax)
	movaps	%xmm1, -32(%rax)
	movaps	%xmm0, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L16
.L34:
	addq	$112, %rdx
	cmpq	%rax, %rdx
	jne	.L17
	movq	8(%rsp), %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r12, %rdi
	addl	$1, %ebx
	addq	$112, %r12
	call	puts@PLT
	cmpl	%ebx, 40(%rsp)
	jg	.L20
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L33:
	movl	104(%rax), %edi
	cmpl	%edi, 104(%rdx)
	jl	.L14
	jne	.L15
	movl	108(%rax), %ebx
	cmpl	%ebx, 108(%rdx)
	jge	.L15
	jmp	.L14
.L7:
	movq	1384(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$1400, %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
.L36:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB35:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movdqu	(%rsi), %xmm7
	movdqu	(%rdi), %xmm6
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	movdqu	16(%rdi), %xmm5
	movdqu	32(%rdi), %xmm4
	movups	%xmm7, (%rdi)
	movdqu	16(%rsi), %xmm7
	movdqu	48(%rdi), %xmm3
	movdqu	64(%rdi), %xmm2
	movdqu	80(%rdi), %xmm1
	movups	%xmm7, 16(%rdi)
	movdqu	32(%rsi), %xmm7
	movdqu	96(%rdi), %xmm0
	movups	%xmm7, 32(%rdi)
	movdqu	48(%rsi), %xmm7
	movups	%xmm7, 48(%rdi)
	movdqu	64(%rsi), %xmm7
	movups	%xmm7, 64(%rdi)
	movdqu	80(%rsi), %xmm7
	movups	%xmm7, 80(%rdi)
	movdqu	96(%rsi), %xmm7
	movups	%xmm7, 96(%rdi)
	movups	%xmm6, (%rsi)
	movups	%xmm5, 16(%rsi)
	movups	%xmm4, 32(%rsi)
	movups	%xmm3, 48(%rsi)
	movups	%xmm2, 64(%rsi)
	movups	%xmm1, 80(%rsi)
	movups	%xmm0, 96(%rsi)
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	addq	$136, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	swap, .-swap
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
.LC1:
	.string	" %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.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
	subq	$1400, %rsp
	.cfi_def_cfa_offset 1456
	movq	%fs:40, %rax
	movq	%rax, 1384(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rax
	leaq	1280(%rsp), %r14
	movq	%rax, 16(%rsp)
	leaq	160(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	272(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L19:
	movq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %eax
	testl	%eax, %eax
	je	.L7
	jle	.L19
	movq	8(%rsp), %rbx
	xorl	%r13d, %r13d
	leaq	44(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r14, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	$100, %edx
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	__strcpy_chk@PLT
	movl	40(%rsp), %eax
	movl	%r13d, 108(%rbx)
	movq	$0, 100(%rbx)
	cmpl	$1, %eax
	jle	.L9
	xorl	%r15d, %r15d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L32:
	addl	$1, 100(%rbx)
.L11:
	movl	40(%rsp), %eax
	addl	$1, %r15d
	leal	-1(%rax), %ecx
	cmpl	%r15d, %ecx
	jle	.L31
.L12:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L32
	cmpl	$1, %eax
	jne	.L11
	movl	40(%rsp), %eax
	addl	$1, %r15d
	addl	$1, 104(%rbx)
	leal	-1(%rax), %ecx
	cmpl	%r15d, %ecx
	jg	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	addl	$1, %r13d
	addq	$112, %rbx
	cmpl	%r13d, %eax
	jg	.L13
	.p2align 4,,10
	.p2align 3
.L9:
	testl	%eax, %eax
	jle	.L19
	subl	$1, %eax
	movq	8(%rsp), %rdx
	leaq	0(,%rax,8), %rcx
	subq	%rax, %rcx
	salq	$4, %rcx
	addq	24(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L17:
	movq	8(%rsp), %rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L35:
	je	.L33
.L15:
	addq	$112, %rax
	cmpq	%rcx, %rax
	je	.L34
.L16:
	movl	100(%rax), %esi
	cmpl	%esi, 100(%rdx)
	jle	.L35
.L14:
	movdqa	(%rax), %xmm7
	movdqa	(%rdx), %xmm6
	addq	$112, %rax
	movdqa	16(%rdx), %xmm5
	movdqa	32(%rdx), %xmm4
	movaps	%xmm7, (%rdx)
	movdqa	-96(%rax), %xmm7
	movdqa	48(%rdx), %xmm3
	movdqa	64(%rdx), %xmm2
	movdqa	80(%rdx), %xmm1
	movaps	%xmm6, 48(%rsp)
	movaps	%xmm7, 16(%rdx)
	movdqa	-80(%rax), %xmm7
	movdqa	96(%rdx), %xmm0
	movaps	%xmm5, 64(%rsp)
	movaps	%xmm7, 32(%rdx)
	movdqa	-64(%rax), %xmm7
	movaps	%xmm4, 80(%rsp)
	movaps	%xmm7, 48(%rdx)
	movdqa	-48(%rax), %xmm7
	movaps	%xmm3, 96(%rsp)
	movaps	%xmm7, 64(%rdx)
	movdqa	-32(%rax), %xmm7
	movaps	%xmm2, 112(%rsp)
	movaps	%xmm7, 80(%rdx)
	movdqa	-16(%rax), %xmm7
	movaps	%xmm1, 128(%rsp)
	movaps	%xmm7, 96(%rdx)
	movaps	%xmm0, 144(%rsp)
	movaps	%xmm6, -112(%rax)
	movaps	%xmm5, -96(%rax)
	movaps	%xmm4, -80(%rax)
	movaps	%xmm3, -64(%rax)
	movaps	%xmm2, -48(%rax)
	movaps	%xmm1, -32(%rax)
	movaps	%xmm0, -16(%rax)
	cmpq	%rcx, %rax
	jne	.L16
.L34:
	addq	$112, %rdx
	cmpq	%rax, %rdx
	jne	.L17
	movq	8(%rsp), %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r12, %rdi
	addl	$1, %ebx
	addq	$112, %r12
	call	puts@PLT
	cmpl	%ebx, 40(%rsp)
	jg	.L20
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L33:
	movl	104(%rax), %edi
	cmpl	%edi, 104(%rdx)
	jl	.L14
	jne	.L15
	movl	108(%rax), %ebx
	cmpl	%ebx, 108(%rdx)
	jge	.L15
	jmp	.L14
.L7:
	movq	1384(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$1400, %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
.L36:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <string.h>

typedef struct{
	char name[100];
	int win;
	int lose;
	int prior;
}team;

void swap(team *p, team *q){
	team tmp = *p;
	*p = *q;
	*q = tmp;
}

int main(void){
	while(1){
		int n, i, j, a;
		char c[100];
		team t[10];
		
		scanf(" %d", &n);
		if(n==0) break;
	
		for(i=0; i<n; i++){
			scanf(" %s", c);
			strcpy(t[i].name, c);
			t[i].win=0;
			t[i].lose=0;
			t[i].prior=i;
			
			for(j=0; j<n-1; j++){
				scanf(" %d", &a);
				if(a==0) ++t[i].win; 
				else if(a==1) ++t[i].lose;
			}
		}
		
		for(i=0; i<n; i++){
			for(j=0; j<n; j++){
				if( (t[i].win > t[j].win) || (t[i].win==t[j].win && t[i].lose < t[j].lose) ||  (t[i].win==t[j].win && t[i].lose==t[j].lose && t[i].prior < t[j].prior) )
					swap(&t[i], &t[j]);
			}
		}
	
		for(i=0; i<n; i++)
			printf("%s\n", t[i].name);

	}

	return 0;
}
6
A 1 0 0 2 0
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 1 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
x 0 0 0
b 0 2 1
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 1 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
x 0 0 0
b 0 2 1
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
x 0 0 0
b 0 2 1
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
x 0 0 0
b 0 2 2
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
g 0 1 2
x 0 0 0
b 0 2 2
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 2
4
g 1 1 1
g 0 1 0
x 0 0 0
b 0 2 2
0
 6
A 1 0 0 2 0
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 1 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
g 0 1 2
x 0 0 0
b 0 2 1
0
 6
A 1 0 0 2 -1
B 1 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
h 0 1 2
x 0 0 0
b 0 2 1
0
 6
A 1 0 0 2 -1
B 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 0 2
E 2 0 0 0 0
F 1 1 0 2 1
4
h 1 1 1
g 0 1 2
x 0 0 0
b 0 2 2
0
 6
A 1 0 0 2 0
C 0 0 1 1 0
C 1 1 1 1 1
D 1 0 0 1 2
E 2 0 0 0 0
F 1 1 0 2 1
4
g 1 1 1
g 0 1 2
x 0 0 0
b 0 2 1
0

E
A
B
D
F
C
x
h
b
g
 E
B
A
D
F
C
x
h
b
g
 E
D
B
A
F
C
x
h
b
g
 E
D
B
A
F
C
x
b
h
g
 E
D
B
A
F
C
x
b
g
g
 E
D
B
A
F
C
x
g
b
g
 E
A
B
D
F
C
x
g
b
g
 E
D
A
B
F
C
x
h
b
g
 E
D
B
A
F
C
x
b
g
h
 E
A
C
D
F
C
x
g
b
g

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>

typedef struct{
	char name[100];
	int win;
	int lose;
	int prior;
}team;

void swap(team *p, team *q){
	team tmp = *p;
	*p = *q;
	*q = tmp;
}

int main(void){
	while(1){
		int n, i, j, a;
		char c[100];
		team t[10];
		
		scanf(" %d", &n);
		if(n==0) break;
	
		for(i=0; i<n; i++){
			scanf(" %s", c);
			strcpy(t[i].name, c);
			t[i].win=0;
			t[i].lose=0;
			t[i].prior=i;
			
			for(j=0; j<n-1; j++){
				scanf(" %d", &a);
				if(a==0) ++t[i].win; 
				else if(a==1) ++t[i].lose;
			}
		}
		
		for(i=0; i<n; i++){
			for(j=0; j<n; j++){
				if( (t[i].win > t[j].win) || (t[i].win==t[j].win && t[i].lose < t[j].lose) ||  (t[i].win==t[j].win && t[i].lose==t[j].lose && t[i].prior < t[j].prior) )
					swap(&t[i], &t[j]);
			}
		}
	
		for(i=0; i<n; i++)
			printf("%s\n", t[i].name);

	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB0:
	.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	$152, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -152(%rbp)
	movq	%rsi, -160(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	-152(%rbp), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -144(%rbp)
	movq	%rbx, -136(%rbp)
	movq	16(%rax), %rcx
	movq	24(%rax), %rbx
	movq	%rcx, -128(%rbp)
	movq	%rbx, -120(%rbp)
	movq	32(%rax), %rcx
	movq	40(%rax), %rbx
	movq	%rcx, -112(%rbp)
	movq	%rbx, -104(%rbp)
	movq	48(%rax), %rcx
	movq	56(%rax), %rbx
	movq	%rcx, -96(%rbp)
	movq	%rbx, -88(%rbp)
	movq	64(%rax), %rcx
	movq	72(%rax), %rbx
	movq	%rcx, -80(%rbp)
	movq	%rbx, -72(%rbp)
	movq	80(%rax), %rcx
	movq	88(%rax), %rbx
	movq	%rcx, -64(%rbp)
	movq	%rbx, -56(%rbp)
	movq	104(%rax), %rdx
	movq	96(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-152(%rbp), %rax
	movq	-160(%rbp), %rdx
	movq	(%rdx), %rcx
	movq	8(%rdx), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	16(%rdx), %rcx
	movq	24(%rdx), %rbx
	movq	%rcx, 16(%rax)
	movq	%rbx, 24(%rax)
	movq	32(%rdx), %rcx
	movq	40(%rdx), %rbx
	movq	%rcx, 32(%rax)
	movq	%rbx, 40(%rax)
	movq	48(%rdx), %rcx
	movq	56(%rdx), %rbx
	movq	%rcx, 48(%rax)
	movq	%rbx, 56(%rax)
	movq	64(%rdx), %rcx
	movq	72(%rdx), %rbx
	movq	%rcx, 64(%rax)
	movq	%rbx, 72(%rax)
	movq	80(%rdx), %rcx
	movq	88(%rdx), %rbx
	movq	%rcx, 80(%rax)
	movq	%rbx, 88(%rax)
	movq	96(%rdx), %rcx
	movq	104(%rdx), %rbx
	movq	%rcx, 96(%rax)
	movq	%rbx, 104(%rax)
	movq	-160(%rbp), %rax
	movq	-144(%rbp), %rcx
	movq	-136(%rbp), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	-128(%rbp), %rcx
	movq	-120(%rbp), %rbx
	movq	%rcx, 16(%rax)
	movq	%rbx, 24(%rax)
	movq	-112(%rbp), %rcx
	movq	-104(%rbp), %rbx
	movq	%rcx, 32(%rax)
	movq	%rbx, 40(%rax)
	movq	-96(%rbp), %rcx
	movq	-88(%rbp), %rbx
	movq	%rcx, 48(%rax)
	movq	%rbx, 56(%rax)
	movq	-80(%rbp), %rcx
	movq	-72(%rbp), %rbx
	movq	%rcx, 64(%rax)
	movq	%rbx, 72(%rax)
	movq	-64(%rbp), %rcx
	movq	-56(%rbp), %rbx
	movq	%rcx, 80(%rax)
	movq	%rbx, 88(%rax)
	movq	-48(%rbp), %rcx
	movq	-40(%rbp), %rbx
	movq	%rcx, 96(%rax)
	movq	%rbx, 104(%rax)
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L2
	call	__stack_chk_fail@PLT
.L2:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	" %s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1248, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L21:
	leaq	-1248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1248(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	jmp	.L23
.L4:
	movl	$0, -1240(%rbp)
	jmp	.L6
.L11:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1232(%rbp), %rcx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcpy@PLT
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	$0, (%rax)
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	$0, (%rax)
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	leaq	-1124(%rax), %rdx
	movl	-1240(%rbp), %eax
	movl	%eax, (%rdx)
	movl	$0, -1236(%rbp)
	jmp	.L7
.L10:
	leaq	-1244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1244(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	leal	1(%rax), %ecx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	%ecx, (%rax)
	jmp	.L9
.L8:
	movl	-1244(%rbp), %eax
	cmpl	$1, %eax
	jne	.L9
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %eax
	leal	1(%rax), %ecx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	%ecx, (%rax)
.L9:
	addl	$1, -1236(%rbp)
.L7:
	movl	-1248(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L10
	addl	$1, -1240(%rbp)
.L6:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L11
	movl	$0, -1240(%rbp)
	jmp	.L12
.L18:
	movl	$0, -1236(%rbp)
	jmp	.L13
.L17:
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jg	.L14
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L15
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jl	.L14
.L15:
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L16
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L16
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1124, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1124, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jge	.L16
.L14:
	leaq	-1232(%rbp), %rcx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-1232(%rbp), %rsi
	movl	-1240(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L16:
	addl	$1, -1236(%rbp)
.L13:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L17
	addl	$1, -1240(%rbp)
.L12:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L18
	movl	$0, -1240(%rbp)
	jmp	.L19
.L20:
	leaq	-1232(%rbp), %rcx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	puts@PLT
	addl	$1, -1240(%rbp)
.L19:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L20
	jmp	.L21
.L23:
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	swap
	.type	swap, @function
swap:
.LFB0:
	.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	$152, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -152(%rbp)
	movq	%rsi, -160(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	-152(%rbp), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rbx
	movq	%rcx, -144(%rbp)
	movq	%rbx, -136(%rbp)
	movq	16(%rax), %rcx
	movq	24(%rax), %rbx
	movq	%rcx, -128(%rbp)
	movq	%rbx, -120(%rbp)
	movq	32(%rax), %rcx
	movq	40(%rax), %rbx
	movq	%rcx, -112(%rbp)
	movq	%rbx, -104(%rbp)
	movq	48(%rax), %rcx
	movq	56(%rax), %rbx
	movq	%rcx, -96(%rbp)
	movq	%rbx, -88(%rbp)
	movq	64(%rax), %rcx
	movq	72(%rax), %rbx
	movq	%rcx, -80(%rbp)
	movq	%rbx, -72(%rbp)
	movq	80(%rax), %rcx
	movq	88(%rax), %rbx
	movq	%rcx, -64(%rbp)
	movq	%rbx, -56(%rbp)
	movq	104(%rax), %rdx
	movq	96(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-152(%rbp), %rax
	movq	-160(%rbp), %rdx
	movq	(%rdx), %rcx
	movq	8(%rdx), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	16(%rdx), %rcx
	movq	24(%rdx), %rbx
	movq	%rcx, 16(%rax)
	movq	%rbx, 24(%rax)
	movq	32(%rdx), %rcx
	movq	40(%rdx), %rbx
	movq	%rcx, 32(%rax)
	movq	%rbx, 40(%rax)
	movq	48(%rdx), %rcx
	movq	56(%rdx), %rbx
	movq	%rcx, 48(%rax)
	movq	%rbx, 56(%rax)
	movq	64(%rdx), %rcx
	movq	72(%rdx), %rbx
	movq	%rcx, 64(%rax)
	movq	%rbx, 72(%rax)
	movq	80(%rdx), %rcx
	movq	88(%rdx), %rbx
	movq	%rcx, 80(%rax)
	movq	%rbx, 88(%rax)
	movq	96(%rdx), %rcx
	movq	104(%rdx), %rbx
	movq	%rcx, 96(%rax)
	movq	%rbx, 104(%rax)
	movq	-160(%rbp), %rax
	movq	-144(%rbp), %rcx
	movq	-136(%rbp), %rbx
	movq	%rcx, (%rax)
	movq	%rbx, 8(%rax)
	movq	-128(%rbp), %rcx
	movq	-120(%rbp), %rbx
	movq	%rcx, 16(%rax)
	movq	%rbx, 24(%rax)
	movq	-112(%rbp), %rcx
	movq	-104(%rbp), %rbx
	movq	%rcx, 32(%rax)
	movq	%rbx, 40(%rax)
	movq	-96(%rbp), %rcx
	movq	-88(%rbp), %rbx
	movq	%rcx, 48(%rax)
	movq	%rbx, 56(%rax)
	movq	-80(%rbp), %rcx
	movq	-72(%rbp), %rbx
	movq	%rcx, 64(%rax)
	movq	%rbx, 72(%rax)
	movq	-64(%rbp), %rcx
	movq	-56(%rbp), %rbx
	movq	%rcx, 80(%rax)
	movq	%rbx, 88(%rax)
	movq	-48(%rbp), %rcx
	movq	-40(%rbp), %rbx
	movq	%rcx, 96(%rax)
	movq	%rbx, 104(%rax)
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L2
	call	__stack_chk_fail@PLT
.L2:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	" %s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1248, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L21:
	leaq	-1248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1248(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	jmp	.L23
.L4:
	movl	$0, -1240(%rbp)
	jmp	.L6
.L11:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-1232(%rbp), %rcx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcpy@PLT
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	$0, (%rax)
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	$0, (%rax)
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	leaq	-1124(%rax), %rdx
	movl	-1240(%rbp), %eax
	movl	%eax, (%rdx)
	movl	$0, -1236(%rbp)
	jmp	.L7
.L10:
	leaq	-1244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1244(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	leal	1(%rax), %ecx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	%ecx, (%rax)
	jmp	.L9
.L8:
	movl	-1244(%rbp), %eax
	cmpl	$1, %eax
	jne	.L9
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %eax
	leal	1(%rax), %ecx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	%ecx, (%rax)
.L9:
	addl	$1, -1236(%rbp)
.L7:
	movl	-1248(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L10
	addl	$1, -1240(%rbp)
.L6:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L11
	movl	$0, -1240(%rbp)
	jmp	.L12
.L18:
	movl	$0, -1236(%rbp)
	jmp	.L13
.L17:
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jg	.L14
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L15
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jl	.L14
.L15:
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1132, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L16
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1128, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jne	.L16
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1124, %rax
	movl	(%rax), %ecx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rbp, %rax
	subq	$1124, %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	jge	.L16
.L14:
	leaq	-1232(%rbp), %rcx
	movl	-1236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	leaq	(%rcx,%rax), %rdx
	leaq	-1232(%rbp), %rsi
	movl	-1240(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L16:
	addl	$1, -1236(%rbp)
.L13:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1236(%rbp)
	jl	.L17
	addl	$1, -1240(%rbp)
.L12:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L18
	movl	$0, -1240(%rbp)
	jmp	.L19
.L20:
	leaq	-1232(%rbp), %rcx
	movl	-1240(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	puts@PLT
	addl	$1, -1240(%rbp)
.L19:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L20
	jmp	.L21
.L23:
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
