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 h;
	int p;
	int q;
} amida;

int cmph(const void* a,const void* b){
	return ((amida*)b)->h - ((amida*)a)->h;
}

int main(){
	int n,m,a,i,tmp;
	amida line[1000];
	while(scanf("%d %d %d",&n,&m,&a)!=0 && (n!=0) && (m!=0) && (a!=0)){
		for(i=0;i<m;i++){
			scanf("%d %d %d",&(line[i].h),&(line[i].p),&(line[i].q));
		}
		qsort(line,m,sizeof(amida),cmph);
		for(i=0;i<m;i++){
			if(line[i].p==a){
				a=line[i].q;
			}else if(line[i].q==a){
				a=line[i].p;
			}
		}
		printf("%d\n",a);
	}
	return 0;
}
		```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	cmph
	.type	cmph, @function
cmph:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmph, .-cmph
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3840, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L4
.L12:
	movl	$0, -12020(%rbp)
	jmp	.L5
.L6:
	leaq	-12016(%rbp), %rcx
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	8(%rax), %rcx
	leaq	-12016(%rbp), %rsi
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	4(%rax), %rdx
	leaq	-12016(%rbp), %rdi
	movl	-12020(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12020(%rbp)
.L5:
	movl	-12028(%rbp), %eax
	cmpl	%eax, -12020(%rbp)
	jl	.L6
	movl	-12028(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-12016(%rbp), %rax
	leaq	cmph(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -12020(%rbp)
	jmp	.L7
.L10:
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12012, %rax
	movl	(%rax), %edx
	movl	-12024(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L8
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12008, %rax
	movl	(%rax), %eax
	movl	%eax, -12024(%rbp)
	jmp	.L9
.L8:
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12008, %rax
	movl	(%rax), %edx
	movl	-12024(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12012, %rax
	movl	(%rax), %eax
	movl	%eax, -12024(%rbp)
.L9:
	addl	$1, -12020(%rbp)
.L7:
	movl	-12028(%rbp), %eax
	cmpl	%eax, -12020(%rbp)
	jl	.L10
	movl	-12024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L4:
	leaq	-12024(%rbp), %rcx
	leaq	-12028(%rbp), %rdx
	leaq	-12032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L11
	movl	-12032(%rbp), %eax
	testl	%eax, %eax
	je	.L11
	movl	-12028(%rbp), %eax
	testl	%eax, %eax
	je	.L11
	movl	-12024(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
.L11:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	cmph
	.type	cmph, @function
cmph:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmph, .-cmph
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$3864, %rsp
	.cfi_def_cfa_offset 12112
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 12040(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	leaq	28(%rsp), %r14
	movq	%rax, 8(%rsp)
	leaq	24(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L10
	movl	20(%rsp), %edx
	testl	%edx, %edx
	je	.L10
	movslq	24(%rsp), %rsi
	testl	%esi, %esi
	je	.L10
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L10
	leaq	32(%rsp), %rbp
	xorl	%r15d, %r15d
	movq	%rbp, %r12
	testl	%esi, %esi
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	leaq	8(%r12), %rcx
	leaq	4(%r12), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	addq	$12, %r12
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rsi
	cmpl	%r15d, %esi
	jg	.L5
.L12:
	movl	$12, %edx
	leaq	cmph(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	jle	.L27
	movl	28(%rsp), %r9d
	subl	$1, %edx
	leaq	36(%rsp), %rax
	xorl	%r8d, %r8d
	leaq	(%rdx,%rdx,2), %rdx
	leaq	48(%rsp,%rdx,4), %rdi
	movl	%r9d, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	%esi, %edx
	jne	.L8
	movl	%ecx, %edx
	movl	$1, %r8d
.L8:
	addq	$12, %rax
	cmpq	%rdi, %rax
	je	.L28
.L9:
	movl	(%rax), %ecx
	movl	4(%rax), %esi
	cmpl	%edx, %ecx
	jne	.L29
	addq	$12, %rax
	movl	%esi, %edx
	movl	$1, %r8d
	cmpq	%rdi, %rax
	jne	.L9
.L28:
	testb	%r8b, %r8b
	je	.L16
	movl	%edx, 28(%rsp)
.L7:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%r9d, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L10:
	movq	12040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$12056, %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
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movl	28(%rsp), %edx
	jmp	.L7
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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	cmph
	.type	cmph, @function
cmph:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	cmph, .-cmph
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$3864, %rsp
	.cfi_def_cfa_offset 12112
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 12040(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	leaq	28(%rsp), %r14
	movq	%rax, 8(%rsp)
	leaq	24(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L10
	movl	20(%rsp), %edx
	testl	%edx, %edx
	je	.L10
	movslq	24(%rsp), %rsi
	testl	%esi, %esi
	je	.L10
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L10
	leaq	32(%rsp), %rbp
	xorl	%r15d, %r15d
	movq	%rbp, %r12
	testl	%esi, %esi
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	leaq	8(%r12), %rcx
	leaq	4(%r12), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	addq	$12, %r12
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rsi
	cmpl	%r15d, %esi
	jg	.L5
.L12:
	movl	$12, %edx
	leaq	cmph(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	jle	.L27
	movl	28(%rsp), %r9d
	subl	$1, %edx
	leaq	36(%rsp), %rax
	xorl	%r8d, %r8d
	leaq	(%rdx,%rdx,2), %rdx
	leaq	48(%rsp,%rdx,4), %rdi
	movl	%r9d, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	%esi, %edx
	jne	.L8
	movl	%ecx, %edx
	movl	$1, %r8d
.L8:
	addq	$12, %rax
	cmpq	%rdi, %rax
	je	.L28
.L9:
	movl	(%rax), %ecx
	movl	4(%rax), %esi
	cmpl	%edx, %ecx
	jne	.L29
	addq	$12, %rax
	movl	%esi, %edx
	movl	$1, %r8d
	cmpq	%rdi, %rax
	jne	.L9
.L28:
	testb	%r8b, %r8b
	je	.L16
	movl	%edx, 28(%rsp)
.L7:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%r9d, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L10:
	movq	12040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$12056, %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
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movl	28(%rsp), %edx
	jmp	.L7
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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<stdlib.h>

typedef struct{
	int h;
	int p;
	int q;
} amida;

int cmph(const void* a,const void* b){
	return ((amida*)b)->h - ((amida*)a)->h;
}

int main(){
	int n,m,a,i,tmp;
	amida line[1000];
	while(scanf("%d %d %d",&n,&m,&a)!=0 && (n!=0) && (m!=0) && (a!=0)){
		for(i=0;i<m;i++){
			scanf("%d %d %d",&(line[i].h),&(line[i].p),&(line[i].q));
		}
		qsort(line,m,sizeof(amida),cmph);
		for(i=0;i<m;i++){
			if(line[i].p==a){
				a=line[i].q;
			}else if(line[i].q==a){
				a=line[i].p;
			}
		}
		printf("%d\n",a);
	}
	return 0;
}
		
4 4 1
3 1 2
2 2 4
3 3 4
1 3 4
0 0 0
 4 4 1
3 1 2
2 2 3
4 3 4
1 3 4
0 0 0
 4 4 1
3 1 2
2 2 4
3 3 4
1 1 4
0 0 0
 4 4 1
0 1 2
2 2 3
3 3 4
0 3 4
0 0 0
 4 3 1
3 1 2
0 1 3
4 3 4
1 0 1
0 0 0
 4 3 1
3 1 1
0 1 3
4 3 4
1 0 1
0 0 0
 7 4 1
3 1 4
0 1 3
8 3 4
1 4 6
0 0 0
 6 4 1
3 0 2
2 2 3
0 5 1
0 2 0
0 0 0
 4 4 1
3 1 2
2 2 3
3 3 4
0 3 4
0 0 0
 4 4 1
3 1 2
2 2 3
4 3 4
1 0 4
0 0 0

3
 4
 1
 2
 2
 3
 6
 5
 4
 3

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 h;
	int p;
	int q;
} amida;

int cmph(const void* a,const void* b){
	return ((amida*)b)->h - ((amida*)a)->h;
}

int main(){
	int n,m,a,i,tmp;
	amida line[1000];
	while(scanf("%d %d %d",&n,&m,&a)!=0 && (n!=0) && (m!=0) && (a!=0)){
		for(i=0;i<m;i++){
			scanf("%d %d %d",&(line[i].h),&(line[i].p),&(line[i].q));
		}
		qsort(line,m,sizeof(amida),cmph);
		for(i=0;i<m;i++){
			if(line[i].p==a){
				a=line[i].q;
			}else if(line[i].q==a){
				a=line[i].p;
			}
		}
		printf("%d\n",a);
	}
	return 0;
}
		```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	cmph
	.type	cmph, @function
cmph:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmph, .-cmph
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3840, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L4
.L12:
	movl	$0, -12020(%rbp)
	jmp	.L5
.L6:
	leaq	-12016(%rbp), %rcx
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	8(%rax), %rcx
	leaq	-12016(%rbp), %rsi
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	4(%rax), %rdx
	leaq	-12016(%rbp), %rdi
	movl	-12020(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12020(%rbp)
.L5:
	movl	-12028(%rbp), %eax
	cmpl	%eax, -12020(%rbp)
	jl	.L6
	movl	-12028(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-12016(%rbp), %rax
	leaq	cmph(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -12020(%rbp)
	jmp	.L7
.L10:
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12012, %rax
	movl	(%rax), %edx
	movl	-12024(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L8
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12008, %rax
	movl	(%rax), %eax
	movl	%eax, -12024(%rbp)
	jmp	.L9
.L8:
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12008, %rax
	movl	(%rax), %edx
	movl	-12024(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12012, %rax
	movl	(%rax), %eax
	movl	%eax, -12024(%rbp)
.L9:
	addl	$1, -12020(%rbp)
.L7:
	movl	-12028(%rbp), %eax
	cmpl	%eax, -12020(%rbp)
	jl	.L10
	movl	-12024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L4:
	leaq	-12024(%rbp), %rcx
	leaq	-12028(%rbp), %rdx
	leaq	-12032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L11
	movl	-12032(%rbp), %eax
	testl	%eax, %eax
	je	.L11
	movl	-12028(%rbp), %eax
	testl	%eax, %eax
	je	.L11
	movl	-12024(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
.L11:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	cmph
	.type	cmph, @function
cmph:
.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmph, .-cmph
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3840, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L4
.L12:
	movl	$0, -12020(%rbp)
	jmp	.L5
.L6:
	leaq	-12016(%rbp), %rcx
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	8(%rax), %rcx
	leaq	-12016(%rbp), %rsi
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	leaq	4(%rax), %rdx
	leaq	-12016(%rbp), %rdi
	movl	-12020(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12020(%rbp)
.L5:
	movl	-12028(%rbp), %eax
	cmpl	%eax, -12020(%rbp)
	jl	.L6
	movl	-12028(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-12016(%rbp), %rax
	leaq	cmph(%rip), %rdx
	movq	%rdx, %rcx
	movl	$12, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -12020(%rbp)
	jmp	.L7
.L10:
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12012, %rax
	movl	(%rax), %edx
	movl	-12024(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L8
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12008, %rax
	movl	(%rax), %eax
	movl	%eax, -12024(%rbp)
	jmp	.L9
.L8:
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12008, %rax
	movl	(%rax), %edx
	movl	-12024(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-12020(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rbp, %rax
	subq	$12012, %rax
	movl	(%rax), %eax
	movl	%eax, -12024(%rbp)
.L9:
	addl	$1, -12020(%rbp)
.L7:
	movl	-12028(%rbp), %eax
	cmpl	%eax, -12020(%rbp)
	jl	.L10
	movl	-12024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L4:
	leaq	-12024(%rbp), %rcx
	leaq	-12028(%rbp), %rdx
	leaq	-12032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L11
	movl	-12032(%rbp), %eax
	testl	%eax, %eax
	je	.L11
	movl	-12028(%rbp), %eax
	testl	%eax, %eax
	je	.L11
	movl	-12024(%rbp), %eax
	testl	%eax, %eax
	jne	.L12
.L11:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
