Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

#define INF 999999999

typedef long* vector;

int main(void){
    int N,M;
    scanf("%d%d",&N,&M);

    int* A;
    int* B;
    long* C;
    NEW(A,M);
    NEW(B,M);
    NEW(C,M);

    vector* dist;
    NEW(dist,N);
    for(int i=0;i<N;i++){
        NEW(dist[i],N);
        for(int j=0;j<N;j++) dist[i][j]=INF;
        dist[i][i]=0;
    }


    for(int i=0;i<M;i++){
        scanf("%d%d%ld",&A[i],&B[i],&C[i]);
        A[i]--;
        B[i]--;
        dist[A[i]][B[i]]=C[i];
        dist[B[i]][A[i]]=C[i];
    }

    //ワーシャルフロイド法
    for(int k=0;k<N;k++){
        for(int i=0;i<N;i++){
            for(int j=0;j<N;j++) dist[i][j]=MIN(dist[i][j], dist[i][k]+dist[k][j]);
        }
    }

    int ans=0;
    for(int i=0;i<M;i++){
        if(dist[A[i]][B[i]]!=C[i]) ans++;
    }
    printf("%d\n",ans);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%d%d%ld"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-92(%rbp), %rdx
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	cmpq	$0, -56(%rbp)
	jne	.L2
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L2:
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	cmpq	$0, -48(%rbp)
	jne	.L3
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L3:
	movl	-92(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	cmpq	$0, -40(%rbp)
	jne	.L4
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L4:
	movl	-96(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L5
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L5:
	movl	$0, -88(%rbp)
	jmp	.L6
.L10:
	movl	-96(%rbp), %eax
	cltq
	salq	$3, %rax
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L7:
	movl	$0, -84(%rbp)
	jmp	.L8
.L9:
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$999999999, (%rax)
	addl	$1, -84(%rbp)
.L8:
	movl	-96(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jl	.L9
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addl	$1, -88(%rbp)
.L6:
	movl	-96(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L10
	movl	$0, -80(%rbp)
	jmp	.L11
.L12:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-56(%rbp), %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-48(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-56(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	addl	$1, -80(%rbp)
.L11:
	movl	-92(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L12
	movl	$0, -76(%rbp)
	jmp	.L13
.L18:
	movl	$0, -72(%rbp)
	jmp	.L14
.L17:
	movl	$0, -68(%rbp)
	jmp	.L15
.L16:
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-68(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	addq	%rax, %rdx
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-68(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movl	-72(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	movq	-32(%rbp), %rcx
	addq	%rsi, %rcx
	movq	(%rcx), %rsi
	movl	-68(%rbp), %ecx
	movslq	%ecx, %rcx
	salq	$3, %rcx
	addq	%rsi, %rcx
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, (%rcx)
	addl	$1, -68(%rbp)
.L15:
	movl	-96(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L16
	addl	$1, -72(%rbp)
.L14:
	movl	-96(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L17
	addl	$1, -76(%rbp)
.L13:
	movl	-96(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L18
	movl	$0, -64(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L19
.L21:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	je	.L20
	addl	$1, -64(%rbp)
.L20:
	addl	$1, -60(%rbp)
.L19:
	movl	-92(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L21
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"not enough memory"
.LC3:
	.string	"%d%d%ld"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	36(%rsp), %r13
	leaq	0(,%r13,4), %r12
	movl	%r13d, 4(%rsp)
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	je	.L3
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	je	.L3
	leaq	0(,%r13,8), %rdi
	call	malloc@PLT
	movq	%rax, 24(%rsp)
	testq	%rax, %rax
	je	.L3
	movslq	32(%rsp), %rdi
	leaq	0(,%rdi,8), %rbx
	movq	%rdi, %r12
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rax, %rbp
	testq	%rax, %rax
	je	.L3
	testl	%r12d, %r12d
	jle	.L4
	movl	%r12d, %eax
	movl	%r12d, %r14d
	xorl	%r13d, %r13d
	shrl	%eax
	andl	$-2, %r14d
	leal	-1(%rax), %r15d
	addq	$1, %r15
	salq	$4, %r15
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rax, 0(%rbp,%r13)
	testq	%rax, %rax
	je	.L3
	cmpl	$1, %r12d
	movdqa	.LC2(%rip), %xmm0
	je	.L24
	movq	%rax, %rdx
	leaq	(%r15,%rax), %r9
	.p2align 4,,10
	.p2align 3
.L6:
	movups	%xmm0, (%rdx)
	addq	$16, %rdx
	cmpq	%r9, %rdx
	jne	.L6
	movslq	%r14d, %rdx
	cmpl	%r14d, %r12d
	je	.L7
.L5:
	movq	$999999999, (%rax,%rdx,8)
.L7:
	movq	$0, (%rax,%r13)
	addq	$8, %r13
	cmpq	%r13, %rbx
	jne	.L8
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L21
.L20:
	movq	8(%rsp), %r14
	movq	16(%rsp), %r15
	xorl	%r12d, %r12d
	leaq	.LC3(%rip), %rbx
	movq	24(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rcx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	addq	$4, %r14
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	movl	-4(%r14), %eax
	movl	-4(%r15), %esi
	addq	$8, %r13
	movq	-8(%r13), %rdi
	subl	$1, %eax
	leal	-1(%rsi), %edx
	movl	%eax, -4(%r14)
	cltq
	movq	0(%rbp,%rax,8), %r10
	movl	%edx, -4(%r15)
	movslq	%edx, %rdx
	movq	%rdi, (%r10,%rdx,8)
	movq	0(%rbp,%rdx,8), %rdx
	movq	%rdi, (%rdx,%rax,8)
	movl	36(%rsp), %eax
	movl	%eax, 4(%rsp)
	cmpl	%r12d, %eax
	jg	.L10
	movl	32(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L11
.L21:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L12:
	movq	0(%rbp,%r14,8), %r9
	leaq	0(,%r14,8), %r11
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L15:
	movq	0(%rbp,%r10,8), %rcx
	xorl	%edx, %edx
	leaq	(%rcx,%r11), %rdi
	.p2align 4,,10
	.p2align 3
.L13:
	movq	(%rcx,%rdx,8), %r15
	movq	(%r9,%rdx,8), %rax
	addq	(%rdi), %rax
	cmpq	%r15, %rax
	cmovg	%r15, %rax
	movq	%rax, (%rcx,%rdx,8)
	addq	$1, %rdx
	cmpl	%edx, %r12d
	jg	.L13
	addq	$1, %r10
	cmpl	%r10d, %r12d
	jg	.L15
	addq	$1, %r14
	cmpl	%r14d, %r12d
	jg	.L12
.L11:
	movslq	4(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%r9d, %r9d
	testl	%esi, %esi
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L19:
	movq	8(%rsp), %rbx
	movslq	(%rbx,%rax,4), %rdx
	movq	16(%rsp), %rbx
	movq	0(%rbp,%rdx,8), %rdx
	movslq	(%rbx,%rax,4), %rcx
	movq	24(%rsp), %rbx
	movq	(%rdx,%rcx,8), %rdi
	cmpq	%rdi, (%rbx,%rax,8)
	je	.L18
	addl	$1, %r9d
.L18:
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L19
.L17:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$56, %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
.L24:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L5
.L4:
	cmpl	$0, 4(%rsp)
	jg	.L20
.L22:
	xorl	%r9d, %r9d
	jmp	.L17
.L47:
	call	__stack_chk_fail@PLT
.L3:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.quad	999999999
	.quad	999999999
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"not enough memory"
.LC3:
	.string	"%d%d%ld"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rdx
	leaq	32(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	36(%rsp), %r13
	leaq	0(,%r13,4), %r12
	movl	%r13d, 4(%rsp)
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	je	.L3
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%rax, 16(%rsp)
	testq	%rax, %rax
	je	.L3
	leaq	0(,%r13,8), %rdi
	call	malloc@PLT
	movq	%rax, 24(%rsp)
	testq	%rax, %rax
	je	.L3
	movslq	32(%rsp), %rdi
	leaq	0(,%rdi,8), %rbx
	movq	%rdi, %r12
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rax, %rbp
	testq	%rax, %rax
	je	.L3
	testl	%r12d, %r12d
	jle	.L4
	movl	%r12d, %eax
	movl	%r12d, %r14d
	xorl	%r13d, %r13d
	shrl	%eax
	andl	$-2, %r14d
	leal	-1(%rax), %r15d
	addq	$1, %r15
	salq	$4, %r15
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rax, 0(%rbp,%r13)
	testq	%rax, %rax
	je	.L3
	cmpl	$1, %r12d
	movdqa	.LC2(%rip), %xmm0
	je	.L24
	movq	%rax, %rdx
	leaq	(%r15,%rax), %r9
	.p2align 4,,10
	.p2align 3
.L6:
	movups	%xmm0, (%rdx)
	addq	$16, %rdx
	cmpq	%r9, %rdx
	jne	.L6
	movslq	%r14d, %rdx
	cmpl	%r14d, %r12d
	je	.L7
.L5:
	movq	$999999999, (%rax,%rdx,8)
.L7:
	movq	$0, (%rax,%r13)
	addq	$8, %r13
	cmpq	%r13, %rbx
	jne	.L8
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L21
.L20:
	movq	8(%rsp), %r14
	movq	16(%rsp), %r15
	xorl	%r12d, %r12d
	leaq	.LC3(%rip), %rbx
	movq	24(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rcx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	addq	$4, %r14
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	movl	-4(%r14), %eax
	movl	-4(%r15), %esi
	addq	$8, %r13
	movq	-8(%r13), %rdi
	subl	$1, %eax
	leal	-1(%rsi), %edx
	movl	%eax, -4(%r14)
	cltq
	movq	0(%rbp,%rax,8), %r10
	movl	%edx, -4(%r15)
	movslq	%edx, %rdx
	movq	%rdi, (%r10,%rdx,8)
	movq	0(%rbp,%rdx,8), %rdx
	movq	%rdi, (%rdx,%rax,8)
	movl	36(%rsp), %eax
	movl	%eax, 4(%rsp)
	cmpl	%r12d, %eax
	jg	.L10
	movl	32(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L11
.L21:
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L12:
	movq	0(%rbp,%r14,8), %r9
	leaq	0(,%r14,8), %r11
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L15:
	movq	0(%rbp,%r10,8), %rcx
	xorl	%edx, %edx
	leaq	(%rcx,%r11), %rdi
	.p2align 4,,10
	.p2align 3
.L13:
	movq	(%rcx,%rdx,8), %r15
	movq	(%r9,%rdx,8), %rax
	addq	(%rdi), %rax
	cmpq	%r15, %rax
	cmovg	%r15, %rax
	movq	%rax, (%rcx,%rdx,8)
	addq	$1, %rdx
	cmpl	%edx, %r12d
	jg	.L13
	addq	$1, %r10
	cmpl	%r10d, %r12d
	jg	.L15
	addq	$1, %r14
	cmpl	%r14d, %r12d
	jg	.L12
.L11:
	movslq	4(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%r9d, %r9d
	testl	%esi, %esi
	jle	.L22
	.p2align 4,,10
	.p2align 3
.L19:
	movq	8(%rsp), %rbx
	movslq	(%rbx,%rax,4), %rdx
	movq	16(%rsp), %rbx
	movq	0(%rbp,%rdx,8), %rdx
	movslq	(%rbx,%rax,4), %rcx
	movq	24(%rsp), %rbx
	movq	(%rdx,%rcx,8), %rdi
	cmpq	%rdi, (%rbx,%rax,8)
	je	.L18
	addl	$1, %r9d
.L18:
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L19
.L17:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC4(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$56, %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
.L24:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L5
.L4:
	cmpl	$0, 4(%rsp)
	jg	.L20
.L22:
	xorl	%r9d, %r9d
	jmp	.L17
.L47:
	call	__stack_chk_fail@PLT
.L3:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.quad	999999999
	.quad	999999999
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

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

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

#define INF 999999999

typedef long* vector;

int main(void){
    int N,M;
    scanf("%d%d",&N,&M);

    int* A;
    int* B;
    long* C;
    NEW(A,M);
    NEW(B,M);
    NEW(C,M);

    vector* dist;
    NEW(dist,N);
    for(int i=0;i<N;i++){
        NEW(dist[i],N);
        for(int j=0;j<N;j++) dist[i][j]=INF;
        dist[i][i]=0;
    }


    for(int i=0;i<M;i++){
        scanf("%d%d%ld",&A[i],&B[i],&C[i]);
        A[i]--;
        B[i]--;
        dist[A[i]][B[i]]=C[i];
        dist[B[i]][A[i]]=C[i];
    }

    //ワーシャルフロイド法
    for(int k=0;k<N;k++){
        for(int i=0;i<N;i++){
            for(int j=0;j<N;j++) dist[i][j]=MIN(dist[i][j], dist[i][k]+dist[k][j]);
        }
    }

    int ans=0;
    for(int i=0;i<M;i++){
        if(dist[A[i]][B[i]]!=C[i]) ans++;
    }
    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

0
 1
 0
 0

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

#define INF 999999999

typedef long* vector;

int main(void){
    int N,M;
    scanf("%d%d",&N,&M);

    int* A;
    int* B;
    long* C;
    NEW(A,M);
    NEW(B,M);
    NEW(C,M);

    vector* dist;
    NEW(dist,N);
    for(int i=0;i<N;i++){
        NEW(dist[i],N);
        for(int j=0;j<N;j++) dist[i][j]=INF;
        dist[i][i]=0;
    }


    for(int i=0;i<M;i++){
        scanf("%d%d%ld",&A[i],&B[i],&C[i]);
        A[i]--;
        B[i]--;
        dist[A[i]][B[i]]=C[i];
        dist[B[i]][A[i]]=C[i];
    }

    //ワーシャルフロイド法
    for(int k=0;k<N;k++){
        for(int i=0;i<N;i++){
            for(int j=0;j<N;j++) dist[i][j]=MIN(dist[i][j], dist[i][k]+dist[k][j]);
        }
    }

    int ans=0;
    for(int i=0;i<M;i++){
        if(dist[A[i]][B[i]]!=C[i]) ans++;
    }
    printf("%d\n",ans);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%d%d%ld"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-92(%rbp), %rdx
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	cmpq	$0, -56(%rbp)
	jne	.L2
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L2:
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	cmpq	$0, -48(%rbp)
	jne	.L3
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L3:
	movl	-92(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	cmpq	$0, -40(%rbp)
	jne	.L4
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L4:
	movl	-96(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L5
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L5:
	movl	$0, -88(%rbp)
	jmp	.L6
.L10:
	movl	-96(%rbp), %eax
	cltq
	salq	$3, %rax
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L7:
	movl	$0, -84(%rbp)
	jmp	.L8
.L9:
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$999999999, (%rax)
	addl	$1, -84(%rbp)
.L8:
	movl	-96(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jl	.L9
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addl	$1, -88(%rbp)
.L6:
	movl	-96(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L10
	movl	$0, -80(%rbp)
	jmp	.L11
.L12:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-56(%rbp), %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-48(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-56(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	addl	$1, -80(%rbp)
.L11:
	movl	-92(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L12
	movl	$0, -76(%rbp)
	jmp	.L13
.L18:
	movl	$0, -72(%rbp)
	jmp	.L14
.L17:
	movl	$0, -68(%rbp)
	jmp	.L15
.L16:
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-68(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	addq	%rax, %rdx
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-68(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movl	-72(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	movq	-32(%rbp), %rcx
	addq	%rsi, %rcx
	movq	(%rcx), %rsi
	movl	-68(%rbp), %ecx
	movslq	%ecx, %rcx
	salq	$3, %rcx
	addq	%rsi, %rcx
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, (%rcx)
	addl	$1, -68(%rbp)
.L15:
	movl	-96(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L16
	addl	$1, -72(%rbp)
.L14:
	movl	-96(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L17
	addl	$1, -76(%rbp)
.L13:
	movl	-96(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L18
	movl	$0, -64(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L19
.L21:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	je	.L20
	addl	$1, -64(%rbp)
.L20:
	addl	$1, -60(%rbp)
.L19:
	movl	-92(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L21
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%d%d%ld"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-92(%rbp), %rdx
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	cmpq	$0, -56(%rbp)
	jne	.L2
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L2:
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	cmpq	$0, -48(%rbp)
	jne	.L3
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L3:
	movl	-92(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	cmpq	$0, -40(%rbp)
	jne	.L4
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L4:
	movl	-96(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L5
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L5:
	movl	$0, -88(%rbp)
	jmp	.L6
.L10:
	movl	-96(%rbp), %eax
	cltq
	salq	$3, %rax
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jne	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
.L7:
	movl	$0, -84(%rbp)
	jmp	.L8
.L9:
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-84(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$999999999, (%rax)
	addl	$1, -84(%rbp)
.L8:
	movl	-96(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jl	.L9
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addl	$1, -88(%rbp)
.L6:
	movl	-96(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L10
	movl	$0, -80(%rbp)
	jmp	.L11
.L12:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-56(%rbp), %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-48(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rsi
	movq	-56(%rbp), %rdx
	addq	%rsi, %rdx
	movl	(%rdx), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	addl	$1, -80(%rbp)
.L11:
	movl	-92(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L12
	movl	$0, -76(%rbp)
	jmp	.L13
.L18:
	movl	$0, -72(%rbp)
	jmp	.L14
.L17:
	movl	$0, -68(%rbp)
	jmp	.L15
.L16:
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-76(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-68(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	addq	%rax, %rdx
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movl	-68(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movl	-72(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	movq	-32(%rbp), %rcx
	addq	%rsi, %rcx
	movq	(%rcx), %rsi
	movl	-68(%rbp), %ecx
	movslq	%ecx, %rcx
	salq	$3, %rcx
	addq	%rsi, %rcx
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, (%rcx)
	addl	$1, -68(%rbp)
.L15:
	movl	-96(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jl	.L16
	addl	$1, -72(%rbp)
.L14:
	movl	-96(%rbp), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L17
	addl	$1, -76(%rbp)
.L13:
	movl	-96(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L18
	movl	$0, -64(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L19
.L21:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	je	.L20
	addl	$1, -64(%rbp)
.L20:
	addl	$1, -60(%rbp)
.L19:
	movl	-92(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L21
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
