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>

int N,M,ans;
int gra[101][101];
int pgra[101][101];
int used[101][101];

int min(int x,int y){
	if(x<y)return x;
	return y;
}

void search(int start,int goal){
	int i;
	int cur;
	cur=start;
	/*while(cur!=goal){
		for(i=1;i<=N;i++)
			if((i!=cur) && (pgra[cur][i]+gra[i][goal]==gra[cur][goal])){
				if(used[cur][i]==0)ans--;
				used[cur][i]=1;
				used[i][cur]=1;
				cur=i;
				break;
			}
	}*/
	for(i=1;i<=N;i++)
		if((i!=cur) && (pgra[cur][i]+gra[i][goal]==gra[cur][goal])){
			if(used[cur][i]==0)ans--;
			used[cur][i]=1;
			used[i][cur]=1;
			search(i,goal);
		}
}

int main(){
	
	scanf("%d%d",&N,&M);
	ans=M;
	
	for(int i=1;i<=N;i++)
		for(int j=1;j<=N;j++)if(i!=j)gra[i][j]=9999999;
	
	for(int i=0;i<M;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		gra[a][b]=gra[b][a]=c;
	}
	
	for(int i=1;i<=N;i++)
		for(int j=1;j<=N;j++)pgra[i][j]=gra[i][j];
	
	
	for(int k=1;k<=N;k++)
		for(int i=1;i<=N;i++)
			for(int j=1;j<=N;j++){
				gra[i][j]=min(gra[i][j],gra[i][k]+gra[k][j]);
			}
	
	for(int i=1;i<N;i++)
		for(int j=i+1;j<=N;j++)search(i,j);
			
	printf("%d\n",ans);
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	gra
	.align 32
	.type	gra, @object
	.size	gra, 40804
gra:
	.zero	40804
	.globl	pgra
	.align 32
	.type	pgra, @object
	.size	pgra, 40804
pgra:
	.zero	40804
	.globl	used
	.align 32
	.type	used, @object
	.size	used, 40804
used:
	.zero	40804
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L2
	movl	-4(%rbp), %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	search
	.type	search, @function
search:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	$1, -8(%rbp)
	jmp	.L5
.L8:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	je	.L6
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	pgra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L6
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	used(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L7
	movl	ans(%rip), %eax
	subl	$1, %eax
	movl	%eax, ans(%rip)
.L7:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	used(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	used(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-24(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	search
.L6:
	addl	$1, -8(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L8
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %eax
	movl	%eax, ans(%rip)
	movl	$1, -48(%rbp)
	jmp	.L10
.L14:
	movl	$1, -44(%rbp)
	jmp	.L11
.L13:
	movl	-48(%rbp), %eax
	cmpl	-44(%rbp), %eax
	je	.L12
	movl	-44(%rbp), %eax
	movslq	%eax, %rcx
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	$9999999, (%rdx,%rax)
.L12:
	addl	$1, -44(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L13
	addl	$1, -48(%rbp)
.L10:
	movl	N(%rip), %eax
	cmpl	%eax, -48(%rbp)
	jle	.L14
	movl	$0, -40(%rbp)
	jmp	.L15
.L16:
	leaq	-52(%rbp), %rcx
	leaq	-56(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %ecx
	movl	-60(%rbp), %esi
	movl	-52(%rbp), %edi
	movslq	%esi, %r8
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r9
	addq	%r9, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	-60(%rbp), %edi
	movl	-56(%rbp), %r8d
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movslq	%r8d, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -40(%rbp)
.L15:
	movl	M(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L16
	movl	$1, -36(%rbp)
	jmp	.L17
.L20:
	movl	$1, -32(%rbp)
	jmp	.L18
.L19:
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	pgra(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -32(%rbp)
.L18:
	movl	N(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L19
	addl	$1, -36(%rbp)
.L17:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L20
	movl	$1, -28(%rbp)
	jmp	.L21
.L26:
	movl	$1, -24(%rbp)
	jmp	.L22
.L25:
	movl	$1, -20(%rbp)
	jmp	.L23
.L24:
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L23:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L24
	addl	$1, -24(%rbp)
.L22:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L25
	addl	$1, -28(%rbp)
.L21:
	movl	N(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L26
	movl	$1, -16(%rbp)
	jmp	.L27
.L30:
	movl	-16(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L28
.L29:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	search
	addl	$1, -12(%rbp)
.L28:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L29
	addl	$1, -16(%rbp)
.L27:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L30
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.p2align 4
	.globl	search
	.type	search, @function
search:
.LFB24:
	.cfi_startproc
	endbr64
	movl	N(%rip), %r11d
	testl	%r11d, %r11d
	jle	.L11
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %r15
	leaq	used(%rip), %rax
	movslq	%esi, %r9
	imulq	$404, %r15, %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	gra(%rip), %r8
	movl	%edi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	404(%rax,%r15,4), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	4(%rax,%rcx), %r12
	leaq	pgra(%rip), %rax
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	addq	%rax, %rcx
	leaq	(%r15,%r15,4), %rax
	movl	$1, %ebx
	leaq	404(%r8,%r9,4), %rbp
	leaq	(%rax,%rax,4), %r10
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
.L7:
	movl	%ebx, %edi
	cmpl	%ebx, %r14d
	je	.L5
	leaq	(%r15,%r10,4), %rax
	movl	0(%rbp), %edx
	addl	(%rcx,%rbx,4), %edx
	addq	%r9, %rax
	cmpl	(%r8,%rax,4), %edx
	je	.L14
.L5:
	addq	$1, %rbx
	addq	$4, %r12
	addq	$404, %r13
	addq	$404, %rbp
	cmpl	%ebx, %r11d
	jge	.L7
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L14:
	.cfi_restore_state
	movl	(%r12), %eax
	testl	%eax, %eax
	jne	.L6
	subl	$1, ans(%rip)
.L6:
	movl	$1, (%r12)
	movl	$1, 0(%r13)
	movq	%r10, 24(%rsp)
	movq	%r9, 16(%rsp)
	movq	%rcx, 8(%rsp)
	movl	%esi, 4(%rsp)
	call	search
	movl	N(%rip), %r11d
	movq	24(%rsp), %r10
	leaq	gra(%rip), %r8
	movq	16(%rsp), %r9
	movq	8(%rsp), %rcx
	movl	4(%rsp), %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE24:
	.size	search, .-search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	M(%rip), %rdx
	leaq	N(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %rdi
	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	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %r9d
	movl	N(%rip), %edx
	movl	%r9d, ans(%rip)
	testl	%edx, %edx
	jle	.L16
	leal	1(%rdx), %edi
	leaq	404+gra(%rip), %rsi
	movl	$1, %ecx
	movq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%eax, %ecx
	je	.L17
	movl	$9999999, (%rsi,%rax,4)
.L17:
	addq	$1, %rax
	cmpq	%rdi, %rax
	jne	.L18
	addl	$1, %ecx
	addq	$404, %rsi
	cmpl	%r8d, %ecx
	jne	.L19
	testl	%r9d, %r9d
	jle	.L65
.L41:
	xorl	%r15d, %r15d
	leaq	148(%rsp), %r14
	leaq	144(%rsp), %r13
	leaq	140(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	gra(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movslq	144(%rsp), %rax
	movslq	140(%rsp), %rdx
	movl	148(%rsp), %esi
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,4), %rcx
	addq	%rdx, %rcx
	movl	%esi, (%rbx,%rcx,4)
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,4), %rdx
	addq	%rdx, %rax
	cmpl	%r15d, M(%rip)
	movl	%esi, (%rbx,%rax,4)
	jg	.L23
	movl	N(%rip), %r14d
	testl	%r14d, %r14d
	jle	.L22
.L21:
	leal	-1(%r14), %eax
	movl	$408, %r15d
	leaq	pgra(%rip), %r12
	imulq	$404, %rax, %rbp
	movl	%eax, 40(%rsp)
	movq	%rax, 8(%rsp)
	movl	%r14d, %eax
	movq	%rax, 16(%rsp)
	leaq	0(,%rax,4), %r13
	addq	$812, %rbp
	.p2align 4,,10
	.p2align 3
.L25:
	leaq	(%r12,%r15), %rdi
	leaq	(%rbx,%r15), %rsi
	movq	%r13, %rdx
	addq	$404, %r15
	call	memcpy@PLT
	cmpq	%rbp, %r15
	jne	.L25
	movq	8(%rsp), %rsi
	movl	%r14d, %edi
	leal	1(%r14), %edx
	movq	$-404, 104(%rsp)
	andl	$-4, %edi
	movl	%edx, 36(%rsp)
	leaq	408+gra(%rip), %r8
	movl	$4, %r12d
	leaq	2(%rsi), %rax
	leal	2(%rdi), %ecx
	movl	%edi, 44(%rsp)
	movl	$404, %r13d
	movq	%rax, 120(%rsp)
	movq	16(%rsp), %rax
	movl	%ecx, 72(%rsp)
	movq	$1, 88(%rsp)
	salq	$2, %rax
	movq	%rax, 24(%rsp)
	movl	%r14d, %eax
	shrl	$2, %eax
	subl	$1, %eax
	addq	$1, %rax
	salq	$4, %rax
	movq	%rax, %r15
	leal	1(%rdi), %eax
	addl	$3, %edi
	cltq
	movl	%edi, 76(%rsp)
	movq	%rax, 48(%rsp)
	movslq	%ecx, %rax
	movq	%rax, 80(%rsp)
	movslq	%edi, %rax
	movq	%rax, 96(%rsp)
	leaq	4(%rbx,%rsi,4), %rax
	movq	%rax, 112(%rsp)
	.p2align 4,,10
	.p2align 3
.L26:
	leaq	-4(%r12), %rcx
	movslq	88(%rsp), %rdx
	leaq	(%rbx,%r12), %rdi
	movl	$408, %esi
	movq	%rcx, 8(%rsp)
	movq	104(%rsp), %rcx
	leaq	408+gra(%rip), %rax
	movl	$1, %r10d
	subq	$8, %rcx
	movq	%rcx, 16(%rsp)
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,4), %rcx
	movq	%rcx, 64(%rsp)
	addq	48(%rsp), %rcx
	movq	%rcx, 56(%rsp)
	.p2align 4,,10
	.p2align 3
.L37:
	movq	8(%rsp), %rcx
	movq	24(%rsp), %rdx
	addq	%rsi, %rcx
	addq	%rsi, %rdx
	cmpq	%rdx, %rcx
	leaq	(%rsi,%r12), %rdx
	setge	%cl
	cmpq	%rdx, %rsi
	setge	%dl
	orb	%cl, %dl
	je	.L35
	movq	16(%rsp), %rcx
	leaq	(%rcx,%rsi), %rdx
	cmpq	$8, %rdx
	seta	%cl
	cmpl	$2, 40(%rsp)
	seta	%dl
	testb	%dl, %cl
	je	.L35
	movd	404(%rdi), %xmm5
	xorl	%edx, %edx
	pshufd	$0, %xmm5, %xmm3
	.p2align 4,,10
	.p2align 3
.L30:
	movdqu	(%r8,%rdx), %xmm2
	movdqu	(%rax,%rdx), %xmm4
	paddd	%xmm3, %xmm2
	movdqa	%xmm4, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm4, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, (%rax,%rdx)
	addq	$16, %rdx
	cmpq	%r15, %rdx
	jne	.L30
	cmpl	%r14d, 44(%rsp)
	je	.L29
	movslq	%r10d, %rdx
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,4), %rcx
	movq	48(%rsp), %rdx
	leaq	(%rcx,%rdx), %r9
	movq	56(%rsp), %rdx
	movl	(%rbx,%r9,4), %r11d
	movl	(%rbx,%rdx,4), %edx
	addl	404(%rdi), %edx
	cmpl	%r11d, %edx
	cmovg	%r11d, %edx
	movl	%edx, (%rbx,%r9,4)
	cmpl	72(%rsp), %r14d
	jl	.L29
	movq	80(%rsp), %r11
	movq	64(%rsp), %rbp
	leaq	(%rcx,%r11), %r9
	movq	%rbp, %rdx
	addq	%r11, %rdx
	movl	(%rbx,%r9,4), %r11d
	movl	(%rbx,%rdx,4), %edx
	addl	404(%rdi), %edx
	cmpl	%r11d, %edx
	cmovg	%r11d, %edx
	movl	%edx, (%rbx,%r9,4)
	cmpl	76(%rsp), %r14d
	jl	.L29
	movq	96(%rsp), %r11
	movq	%rbp, %rdx
	addq	%r11, %rcx
	addq	%r11, %rdx
	movl	(%rbx,%rcx,4), %r9d
	movl	(%rbx,%rdx,4), %edx
	addl	404(%rdi), %edx
	cmpl	%r9d, %edx
	cmovg	%r9d, %edx
	movl	%edx, (%rbx,%rcx,4)
.L29:
	addl	$1, %r10d
	addq	$404, %rsi
	addq	$404, %rax
	addq	$404, %rdi
	cmpl	36(%rsp), %r10d
	jne	.L37
	addq	$1, 88(%rsp)
	addq	$404, %r13
	movq	88(%rsp), %rax
	addq	$4, %r12
	subq	$404, 104(%rsp)
	addq	$404, %r8
	cmpq	120(%rsp), %rax
	jne	.L26
.L36:
	cmpl	$1, %r14d
	jle	.L22
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%r12d, %ebp
	addl	$1, %r12d
	cmpl	%r14d, %r12d
	jg	.L22
	movl	%r12d, %ebx
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%ebx, %esi
	movl	%ebp, %edi
	addl	$1, %ebx
	call	search
	movl	N(%rip), %r14d
	cmpl	%ebx, %r14d
	jge	.L40
	cmpl	%r14d, %r12d
	jl	.L38
.L22:
	movl	ans(%rip), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L66
	addq	$168, %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
.L35:
	.cfi_restore_state
	movq	112(%rsp), %rcx
	movl	$4, %r11d
	subq	%rsi, %r11
	leaq	(%rcx,%rsi), %rbp
	movq	%rax, %rcx
	.p2align 4,,10
	.p2align 3
.L28:
	leaq	(%r11,%rcx), %r9
	movl	404(%rdi), %edx
	addl	(%r9,%r13), %edx
	movl	(%rcx), %r9d
	cmpl	%r9d, %edx
	cmovg	%r9d, %edx
	addq	$4, %rcx
	movl	%edx, -4(%rcx)
	cmpq	%rbp, %rcx
	jne	.L28
	jmp	.L29
.L16:
	testl	%r9d, %r9d
	jg	.L41
	movl	%edx, %r14d
	jmp	.L36
.L65:
	movl	%edx, %r14d
	leaq	gra(%rip), %rbx
	jmp	.L21
.L66:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	used
	.bss
	.align 32
	.type	used, @object
	.size	used, 40804
used:
	.zero	40804
	.globl	pgra
	.align 32
	.type	pgra, @object
	.size	pgra, 40804
pgra:
	.zero	40804
	.globl	gra
	.align 32
	.type	gra, @object
	.size	gra, 40804
gra:
	.zero	40804
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.p2align 4
	.globl	search
	.type	search, @function
search:
.LFB24:
	.cfi_startproc
	endbr64
	movl	N(%rip), %r11d
	testl	%r11d, %r11d
	jle	.L11
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edi, %r15
	leaq	used(%rip), %rax
	movslq	%esi, %r9
	imulq	$404, %r15, %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	gra(%rip), %r8
	movl	%edi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	404(%rax,%r15,4), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	4(%rax,%rcx), %r12
	leaq	pgra(%rip), %rax
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	addq	%rax, %rcx
	leaq	(%r15,%r15,4), %rax
	movl	$1, %ebx
	leaq	404(%r8,%r9,4), %rbp
	leaq	(%rax,%rax,4), %r10
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
.L7:
	movl	%ebx, %edi
	cmpl	%ebx, %r14d
	je	.L5
	leaq	(%r15,%r10,4), %rax
	movl	0(%rbp), %edx
	addl	(%rcx,%rbx,4), %edx
	addq	%r9, %rax
	cmpl	(%r8,%rax,4), %edx
	je	.L14
.L5:
	addq	$1, %rbx
	addq	$4, %r12
	addq	$404, %r13
	addq	$404, %rbp
	cmpl	%ebx, %r11d
	jge	.L7
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L14:
	.cfi_restore_state
	movl	(%r12), %eax
	testl	%eax, %eax
	jne	.L6
	subl	$1, ans(%rip)
.L6:
	movl	$1, (%r12)
	movl	$1, 0(%r13)
	movq	%r10, 24(%rsp)
	movq	%r9, 16(%rsp)
	movq	%rcx, 8(%rsp)
	movl	%esi, 4(%rsp)
	call	search
	movl	N(%rip), %r11d
	movq	24(%rsp), %r10
	leaq	gra(%rip), %r8
	movq	16(%rsp), %r9
	movq	8(%rsp), %rcx
	movl	4(%rsp), %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE24:
	.size	search, .-search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	M(%rip), %rdx
	leaq	N(%rip), %rsi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %rdi
	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	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %r9d
	movl	N(%rip), %edx
	movl	%r9d, ans(%rip)
	testl	%edx, %edx
	jle	.L16
	leal	1(%rdx), %edi
	leaq	404+gra(%rip), %rsi
	movl	$1, %ecx
	movq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	%eax, %ecx
	je	.L17
	movl	$9999999, (%rsi,%rax,4)
.L17:
	addq	$1, %rax
	cmpq	%rdi, %rax
	jne	.L18
	addl	$1, %ecx
	addq	$404, %rsi
	cmpl	%r8d, %ecx
	jne	.L19
	testl	%r9d, %r9d
	jle	.L65
.L41:
	xorl	%r15d, %r15d
	leaq	148(%rsp), %r14
	leaq	144(%rsp), %r13
	leaq	140(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	gra(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L23:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movslq	144(%rsp), %rax
	movslq	140(%rsp), %rdx
	movl	148(%rsp), %esi
	leaq	(%rax,%rax,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rax,%rcx,4), %rcx
	addq	%rdx, %rcx
	movl	%esi, (%rbx,%rcx,4)
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,4), %rdx
	addq	%rdx, %rax
	cmpl	%r15d, M(%rip)
	movl	%esi, (%rbx,%rax,4)
	jg	.L23
	movl	N(%rip), %r14d
	testl	%r14d, %r14d
	jle	.L22
.L21:
	leal	-1(%r14), %eax
	movl	$408, %r15d
	leaq	pgra(%rip), %r12
	imulq	$404, %rax, %rbp
	movl	%eax, 40(%rsp)
	movq	%rax, 8(%rsp)
	movl	%r14d, %eax
	movq	%rax, 16(%rsp)
	leaq	0(,%rax,4), %r13
	addq	$812, %rbp
	.p2align 4,,10
	.p2align 3
.L25:
	leaq	(%r12,%r15), %rdi
	leaq	(%rbx,%r15), %rsi
	movq	%r13, %rdx
	addq	$404, %r15
	call	memcpy@PLT
	cmpq	%rbp, %r15
	jne	.L25
	movq	8(%rsp), %rsi
	movl	%r14d, %edi
	leal	1(%r14), %edx
	movq	$-404, 104(%rsp)
	andl	$-4, %edi
	movl	%edx, 36(%rsp)
	leaq	408+gra(%rip), %r8
	movl	$4, %r12d
	leaq	2(%rsi), %rax
	leal	2(%rdi), %ecx
	movl	%edi, 44(%rsp)
	movl	$404, %r13d
	movq	%rax, 120(%rsp)
	movq	16(%rsp), %rax
	movl	%ecx, 72(%rsp)
	movq	$1, 88(%rsp)
	salq	$2, %rax
	movq	%rax, 24(%rsp)
	movl	%r14d, %eax
	shrl	$2, %eax
	subl	$1, %eax
	addq	$1, %rax
	salq	$4, %rax
	movq	%rax, %r15
	leal	1(%rdi), %eax
	addl	$3, %edi
	cltq
	movl	%edi, 76(%rsp)
	movq	%rax, 48(%rsp)
	movslq	%ecx, %rax
	movq	%rax, 80(%rsp)
	movslq	%edi, %rax
	movq	%rax, 96(%rsp)
	leaq	4(%rbx,%rsi,4), %rax
	movq	%rax, 112(%rsp)
	.p2align 4,,10
	.p2align 3
.L26:
	leaq	-4(%r12), %rcx
	movslq	88(%rsp), %rdx
	leaq	(%rbx,%r12), %rdi
	movl	$408, %esi
	movq	%rcx, 8(%rsp)
	movq	104(%rsp), %rcx
	leaq	408+gra(%rip), %rax
	movl	$1, %r10d
	subq	$8, %rcx
	movq	%rcx, 16(%rsp)
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,4), %rcx
	movq	%rcx, 64(%rsp)
	addq	48(%rsp), %rcx
	movq	%rcx, 56(%rsp)
	.p2align 4,,10
	.p2align 3
.L37:
	movq	8(%rsp), %rcx
	movq	24(%rsp), %rdx
	addq	%rsi, %rcx
	addq	%rsi, %rdx
	cmpq	%rdx, %rcx
	leaq	(%rsi,%r12), %rdx
	setge	%cl
	cmpq	%rdx, %rsi
	setge	%dl
	orb	%cl, %dl
	je	.L35
	movq	16(%rsp), %rcx
	leaq	(%rcx,%rsi), %rdx
	cmpq	$8, %rdx
	seta	%cl
	cmpl	$2, 40(%rsp)
	seta	%dl
	testb	%dl, %cl
	je	.L35
	movd	404(%rdi), %xmm5
	xorl	%edx, %edx
	pshufd	$0, %xmm5, %xmm3
	.p2align 4,,10
	.p2align 3
.L30:
	movdqu	(%r8,%rdx), %xmm2
	movdqu	(%rax,%rdx), %xmm4
	paddd	%xmm3, %xmm2
	movdqa	%xmm4, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm4, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, (%rax,%rdx)
	addq	$16, %rdx
	cmpq	%r15, %rdx
	jne	.L30
	cmpl	%r14d, 44(%rsp)
	je	.L29
	movslq	%r10d, %rdx
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	leaq	(%rdx,%rcx,4), %rcx
	movq	48(%rsp), %rdx
	leaq	(%rcx,%rdx), %r9
	movq	56(%rsp), %rdx
	movl	(%rbx,%r9,4), %r11d
	movl	(%rbx,%rdx,4), %edx
	addl	404(%rdi), %edx
	cmpl	%r11d, %edx
	cmovg	%r11d, %edx
	movl	%edx, (%rbx,%r9,4)
	cmpl	72(%rsp), %r14d
	jl	.L29
	movq	80(%rsp), %r11
	movq	64(%rsp), %rbp
	leaq	(%rcx,%r11), %r9
	movq	%rbp, %rdx
	addq	%r11, %rdx
	movl	(%rbx,%r9,4), %r11d
	movl	(%rbx,%rdx,4), %edx
	addl	404(%rdi), %edx
	cmpl	%r11d, %edx
	cmovg	%r11d, %edx
	movl	%edx, (%rbx,%r9,4)
	cmpl	76(%rsp), %r14d
	jl	.L29
	movq	96(%rsp), %r11
	movq	%rbp, %rdx
	addq	%r11, %rcx
	addq	%r11, %rdx
	movl	(%rbx,%rcx,4), %r9d
	movl	(%rbx,%rdx,4), %edx
	addl	404(%rdi), %edx
	cmpl	%r9d, %edx
	cmovg	%r9d, %edx
	movl	%edx, (%rbx,%rcx,4)
.L29:
	addl	$1, %r10d
	addq	$404, %rsi
	addq	$404, %rax
	addq	$404, %rdi
	cmpl	36(%rsp), %r10d
	jne	.L37
	addq	$1, 88(%rsp)
	addq	$404, %r13
	movq	88(%rsp), %rax
	addq	$4, %r12
	subq	$404, 104(%rsp)
	addq	$404, %r8
	cmpq	120(%rsp), %rax
	jne	.L26
.L36:
	cmpl	$1, %r14d
	jle	.L22
	movl	$1, %r12d
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%r12d, %ebp
	addl	$1, %r12d
	cmpl	%r14d, %r12d
	jg	.L22
	movl	%r12d, %ebx
	.p2align 4,,10
	.p2align 3
.L40:
	movl	%ebx, %esi
	movl	%ebp, %edi
	addl	$1, %ebx
	call	search
	movl	N(%rip), %r14d
	cmpl	%ebx, %r14d
	jge	.L40
	cmpl	%r14d, %r12d
	jl	.L38
.L22:
	movl	ans(%rip), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L66
	addq	$168, %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
.L35:
	.cfi_restore_state
	movq	112(%rsp), %rcx
	movl	$4, %r11d
	subq	%rsi, %r11
	leaq	(%rcx,%rsi), %rbp
	movq	%rax, %rcx
	.p2align 4,,10
	.p2align 3
.L28:
	leaq	(%r11,%rcx), %r9
	movl	404(%rdi), %edx
	addl	(%r9,%r13), %edx
	movl	(%rcx), %r9d
	cmpl	%r9d, %edx
	cmovg	%r9d, %edx
	addq	$4, %rcx
	movl	%edx, -4(%rcx)
	cmpq	%rbp, %rcx
	jne	.L28
	jmp	.L29
.L16:
	testl	%r9d, %r9d
	jg	.L41
	movl	%edx, %r14d
	jmp	.L36
.L65:
	movl	%edx, %r14d
	leaq	gra(%rip), %rbx
	jmp	.L21
.L66:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	used
	.bss
	.align 32
	.type	used, @object
	.size	used, 40804
used:
	.zero	40804
	.globl	pgra
	.align 32
	.type	pgra, @object
	.size	pgra, 40804
pgra:
	.zero	40804
	.globl	gra
	.align 32
	.type	gra, @object
	.size	gra, 40804
gra:
	.zero	40804
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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>

int N,M,ans;
int gra[101][101];
int pgra[101][101];
int used[101][101];

int min(int x,int y){
	if(x<y)return x;
	return y;
}

void search(int start,int goal){
	int i;
	int cur;
	cur=start;
	/*while(cur!=goal){
		for(i=1;i<=N;i++)
			if((i!=cur) && (pgra[cur][i]+gra[i][goal]==gra[cur][goal])){
				if(used[cur][i]==0)ans--;
				used[cur][i]=1;
				used[i][cur]=1;
				cur=i;
				break;
			}
	}*/
	for(i=1;i<=N;i++)
		if((i!=cur) && (pgra[cur][i]+gra[i][goal]==gra[cur][goal])){
			if(used[cur][i]==0)ans--;
			used[cur][i]=1;
			used[i][cur]=1;
			search(i,goal);
		}
}

int main(){
	
	scanf("%d%d",&N,&M);
	ans=M;
	
	for(int i=1;i<=N;i++)
		for(int j=1;j<=N;j++)if(i!=j)gra[i][j]=9999999;
	
	for(int i=0;i<M;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		gra[a][b]=gra[b][a]=c;
	}
	
	for(int i=1;i<=N;i++)
		for(int j=1;j<=N;j++)pgra[i][j]=gra[i][j];
	
	
	for(int k=1;k<=N;k++)
		for(int i=1;i<=N;i++)
			for(int j=1;j<=N;j++){
				gra[i][j]=min(gra[i][j],gra[i][k]+gra[k][j]);
			}
	
	for(int i=1;i<N;i++)
		for(int j=i+1;j<=N;j++)search(i,j);
			
	printf("%d\n",ans);
	
	return 0;
}
3 3
1 2 2
1 3 1
2 3 3
 4 3
1 2 1
1 3 1
2 3 3
 3 2
1 2 2
2 3 1
 3 2
1 3 2
2 3 1
 3 2
1 3 2
2 0 1
 3 2
1 2 2
2 0 1
 3 2
2 2 2
2 0 1
 3 2
1 1 1
2 3 1

0
 -2
 0
 0
 -1
 -1
 0
 -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>

int N,M,ans;
int gra[101][101];
int pgra[101][101];
int used[101][101];

int min(int x,int y){
	if(x<y)return x;
	return y;
}

void search(int start,int goal){
	int i;
	int cur;
	cur=start;
	/*while(cur!=goal){
		for(i=1;i<=N;i++)
			if((i!=cur) && (pgra[cur][i]+gra[i][goal]==gra[cur][goal])){
				if(used[cur][i]==0)ans--;
				used[cur][i]=1;
				used[i][cur]=1;
				cur=i;
				break;
			}
	}*/
	for(i=1;i<=N;i++)
		if((i!=cur) && (pgra[cur][i]+gra[i][goal]==gra[cur][goal])){
			if(used[cur][i]==0)ans--;
			used[cur][i]=1;
			used[i][cur]=1;
			search(i,goal);
		}
}

int main(){
	
	scanf("%d%d",&N,&M);
	ans=M;
	
	for(int i=1;i<=N;i++)
		for(int j=1;j<=N;j++)if(i!=j)gra[i][j]=9999999;
	
	for(int i=0;i<M;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		gra[a][b]=gra[b][a]=c;
	}
	
	for(int i=1;i<=N;i++)
		for(int j=1;j<=N;j++)pgra[i][j]=gra[i][j];
	
	
	for(int k=1;k<=N;k++)
		for(int i=1;i<=N;i++)
			for(int j=1;j<=N;j++){
				gra[i][j]=min(gra[i][j],gra[i][k]+gra[k][j]);
			}
	
	for(int i=1;i<N;i++)
		for(int j=i+1;j<=N;j++)search(i,j);
			
	printf("%d\n",ans);
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	gra
	.align 32
	.type	gra, @object
	.size	gra, 40804
gra:
	.zero	40804
	.globl	pgra
	.align 32
	.type	pgra, @object
	.size	pgra, 40804
pgra:
	.zero	40804
	.globl	used
	.align 32
	.type	used, @object
	.size	used, 40804
used:
	.zero	40804
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L2
	movl	-4(%rbp), %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	search
	.type	search, @function
search:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	$1, -8(%rbp)
	jmp	.L5
.L8:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	je	.L6
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	pgra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L6
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	used(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L7
	movl	ans(%rip), %eax
	subl	$1, %eax
	movl	%eax, ans(%rip)
.L7:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	used(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	used(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-24(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	search
.L6:
	addl	$1, -8(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L8
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %eax
	movl	%eax, ans(%rip)
	movl	$1, -48(%rbp)
	jmp	.L10
.L14:
	movl	$1, -44(%rbp)
	jmp	.L11
.L13:
	movl	-48(%rbp), %eax
	cmpl	-44(%rbp), %eax
	je	.L12
	movl	-44(%rbp), %eax
	movslq	%eax, %rcx
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	$9999999, (%rdx,%rax)
.L12:
	addl	$1, -44(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L13
	addl	$1, -48(%rbp)
.L10:
	movl	N(%rip), %eax
	cmpl	%eax, -48(%rbp)
	jle	.L14
	movl	$0, -40(%rbp)
	jmp	.L15
.L16:
	leaq	-52(%rbp), %rcx
	leaq	-56(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %ecx
	movl	-60(%rbp), %esi
	movl	-52(%rbp), %edi
	movslq	%esi, %r8
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r9
	addq	%r9, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	-60(%rbp), %edi
	movl	-56(%rbp), %r8d
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movslq	%r8d, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -40(%rbp)
.L15:
	movl	M(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L16
	movl	$1, -36(%rbp)
	jmp	.L17
.L20:
	movl	$1, -32(%rbp)
	jmp	.L18
.L19:
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	pgra(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -32(%rbp)
.L18:
	movl	N(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L19
	addl	$1, -36(%rbp)
.L17:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L20
	movl	$1, -28(%rbp)
	jmp	.L21
.L26:
	movl	$1, -24(%rbp)
	jmp	.L22
.L25:
	movl	$1, -20(%rbp)
	jmp	.L23
.L24:
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L23:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L24
	addl	$1, -24(%rbp)
.L22:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L25
	addl	$1, -28(%rbp)
.L21:
	movl	N(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L26
	movl	$1, -16(%rbp)
	jmp	.L27
.L30:
	movl	-16(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L28
.L29:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	search
	addl	$1, -12(%rbp)
.L28:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L29
	addl	$1, -16(%rbp)
.L27:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L30
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	gra
	.align 32
	.type	gra, @object
	.size	gra, 40804
gra:
	.zero	40804
	.globl	pgra
	.align 32
	.type	pgra, @object
	.size	pgra, 40804
pgra:
	.zero	40804
	.globl	used
	.align 32
	.type	used, @object
	.size	used, 40804
used:
	.zero	40804
	.text
	.globl	min
	.type	min, @function
min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L2
	movl	-4(%rbp), %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	search
	.type	search, @function
search:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	$1, -8(%rbp)
	jmp	.L5
.L8:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	je	.L6
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	pgra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	jne	.L6
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	used(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L7
	movl	ans(%rip), %eax
	subl	$1, %eax
	movl	%eax, ans(%rip)
.L7:
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	used(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	used(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-24(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	search
.L6:
	addl	$1, -8(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jle	.L8
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	M(%rip), %eax
	movl	%eax, ans(%rip)
	movl	$1, -48(%rbp)
	jmp	.L10
.L14:
	movl	$1, -44(%rbp)
	jmp	.L11
.L13:
	movl	-48(%rbp), %eax
	cmpl	-44(%rbp), %eax
	je	.L12
	movl	-44(%rbp), %eax
	movslq	%eax, %rcx
	movl	-48(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	$9999999, (%rdx,%rax)
.L12:
	addl	$1, -44(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L13
	addl	$1, -48(%rbp)
.L10:
	movl	N(%rip), %eax
	cmpl	%eax, -48(%rbp)
	jle	.L14
	movl	$0, -40(%rbp)
	jmp	.L15
.L16:
	leaq	-52(%rbp), %rcx
	leaq	-56(%rbp), %rdx
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %ecx
	movl	-60(%rbp), %esi
	movl	-52(%rbp), %edi
	movslq	%esi, %r8
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %r9
	addq	%r9, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%r8, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	%edi, (%rdx,%rax)
	movl	-60(%rbp), %edi
	movl	-56(%rbp), %r8d
	movslq	%esi, %rsi
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movslq	%r8d, %rsi
	movslq	%edi, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -40(%rbp)
.L15:
	movl	M(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L16
	movl	$1, -36(%rbp)
	jmp	.L17
.L20:
	movl	$1, -32(%rbp)
	jmp	.L18
.L19:
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	pgra(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -32(%rbp)
.L18:
	movl	N(%rip), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L19
	addl	$1, -36(%rbp)
.L17:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L20
	movl	$1, -28(%rbp)
	jmp	.L21
.L26:
	movl	$1, -24(%rbp)
	jmp	.L22
.L25:
	movl	$1, -20(%rbp)
	jmp	.L23
.L24:
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	gra(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L23:
	movl	N(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L24
	addl	$1, -24(%rbp)
.L22:
	movl	N(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L25
	addl	$1, -28(%rbp)
.L21:
	movl	N(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L26
	movl	$1, -16(%rbp)
	jmp	.L27
.L30:
	movl	-16(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L28
.L29:
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	search
	addl	$1, -12(%rbp)
.L28:
	movl	N(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L29
	addl	$1, -16(%rbp)
.L27:
	movl	N(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L30
	movl	ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
