Given the following C code and 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;
}
		```

Assembly Code:

```assembly
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.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
```assembly
	.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:
```
```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;
}
		```
Given the following C 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;
}
		```

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.
Optimized Assembly Code:

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 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;
}
		```

Assembly Code:

```assembly
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.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:
```