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>
#include<string.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 SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0)

#define MOD 1000000007 

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

    //A[0]~A[N-1]に格納する
    int* p;
    NEW(p,N);
    for(int i=0;i<N;i++){
        scanf("%d",&p[i]);
    }

    int ans=0;
    for(int i=0;i<N;i++){
        if(p[i]-1==i){
            ans++;
            if(i==N-1) SWAP(int, p[i],p[i-1]);
            else SWAP(int, p[i],p[i+1]);
        }
    }
    printf("%d\n",ans);

    return 0;
}

//そうすれば最適にswapできるかという規則をコードを書くまえに見つけ出せるかどうか次第```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %r14
	salq	$2, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L2
	movq	%rax, %rbx
	movq	%rax, %r12
	xorl	%ebp, %ebp
	testl	%r14d, %r14d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	addq	$4, %r12
	cmpl	%ebp, %edx
	jg	.L5
	testl	%edx, %edx
	jle	.L4
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	leal	-1(%rdx), %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %eax
	addq	$4, %rbx
	cmpl	%eax, %edx
	je	.L9
.L8:
	movl	(%rbx), %ecx
	leal	-1(%rcx), %esi
	cmpl	%eax, %esi
	jne	.L6
	addl	$1, %r8d
	cmpl	%eax, %edi
	je	.L16
	movd	4(%rbx), %xmm0
	movd	%ecx, %xmm1
	addl	$1, %eax
	addq	$4, %rbx
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -4(%rbx)
	cmpl	%eax, %edx
	jne	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movd	-4(%rbx), %xmm2
	movd	%ecx, %xmm0
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, -4(%rbx)
	jmp	.L6
.L4:
	xorl	%r8d, %r8d
	jmp	.L9
.L17:
	call	__stack_chk_fail@PLT
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE51:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %r14
	salq	$2, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L2
	movq	%rax, %rbx
	movq	%rax, %r12
	xorl	%ebp, %ebp
	testl	%r14d, %r14d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	addq	$4, %r12
	cmpl	%ebp, %edx
	jg	.L5
	testl	%edx, %edx
	jle	.L4
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	leal	-1(%rdx), %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %eax
	addq	$4, %rbx
	cmpl	%eax, %edx
	je	.L9
.L8:
	movl	(%rbx), %ecx
	leal	-1(%rcx), %esi
	cmpl	%eax, %esi
	jne	.L6
	addl	$1, %r8d
	cmpl	%eax, %edi
	je	.L16
	movd	4(%rbx), %xmm0
	movd	%ecx, %xmm1
	addl	$1, %eax
	addq	$4, %rbx
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -4(%rbx)
	cmpl	%eax, %edx
	jne	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movd	-4(%rbx), %xmm2
	movd	%ecx, %xmm0
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, -4(%rbx)
	jmp	.L6
.L4:
	xorl	%r8d, %r8d
	jmp	.L9
.L17:
	call	__stack_chk_fail@PLT
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE51:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %r14
	salq	$2, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L2
	movq	%rax, %rbx
	movq	%rax, %r12
	xorl	%ebp, %ebp
	testl	%r14d, %r14d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	addq	$4, %r12
	cmpl	%ebp, %edx
	jg	.L5
	testl	%edx, %edx
	jle	.L4
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	leal	-1(%rdx), %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %eax
	addq	$4, %rbx
	cmpl	%eax, %edx
	je	.L9
.L8:
	movl	(%rbx), %ecx
	leal	-1(%rcx), %esi
	cmpl	%eax, %esi
	jne	.L6
	addl	$1, %r8d
	cmpl	%eax, %edi
	je	.L16
	movd	4(%rbx), %xmm0
	movd	%ecx, %xmm1
	addl	$1, %eax
	addq	$4, %rbx
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -4(%rbx)
	cmpl	%eax, %edx
	jne	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movd	-4(%rbx), %xmm2
	movd	%ecx, %xmm0
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, -4(%rbx)
	jmp	.L6
.L4:
	xorl	%r8d, %r8d
	jmp	.L9
.L17:
	call	__stack_chk_fail@PLT
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE51:
	.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>
#include<string.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 SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0)

#define MOD 1000000007 

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

    //A[0]~A[N-1]に格納する
    int* p;
    NEW(p,N);
    for(int i=0;i<N;i++){
        scanf("%d",&p[i]);
    }

    int ans=0;
    for(int i=0;i<N;i++){
        if(p[i]-1==i){
            ans++;
            if(i==N-1) SWAP(int, p[i],p[i-1]);
            else SWAP(int, p[i],p[i+1]);
        }
    }
    printf("%d\n",ans);

    return 0;
}

//そうすれば最適にswapできるかという規則をコードを書くまえに見つけ出せるかどうか次第```
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>
#include<string.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 SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0)

#define MOD 1000000007 

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

    //A[0]~A[N-1]に格納する
    int* p;
    NEW(p,N);
    for(int i=0;i<N;i++){
        scanf("%d",&p[i]);
    }

    int ans=0;
    for(int i=0;i<N;i++){
        if(p[i]-1==i){
            ans++;
            if(i==N-1) SWAP(int, p[i],p[i-1]);
            else SWAP(int, p[i],p[i+1]);
        }
    }
    printf("%d\n",ans);

    return 0;
}

//そうすれば最適にswapできるかという規則をコードを書くまえに見つけ出せるかどうか次第```

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:

5
1 4 4 5 2
 9
1 2 4 9 5 8 7 6 6
 9
1 2 4 9 5 8 4 6 6
 5
0 4 4 5 1
 2
1 0
 2
1 1
 5
1 4 4 5 1
 2
1 -1
 2
0 2
 9
2 2 4 9 5 8 4 6 6

1
 3
 2
 0
 1
 1
 1
 1
 1
 2

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>
#include<string.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 SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0)

#define MOD 1000000007 

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

    //A[0]~A[N-1]に格納する
    int* p;
    NEW(p,N);
    for(int i=0;i<N;i++){
        scanf("%d",&p[i]);
    }

    int ans=0;
    for(int i=0;i<N;i++){
        if(p[i]-1==i){
            ans++;
            if(i==N-1) SWAP(int, p[i],p[i-1]);
            else SWAP(int, p[i],p[i+1]);
        }
    }
    printf("%d\n",ans);

    return 0;
}

//そうすれば最適にswapできるかという規則をコードを書くまえに見つけ出せるかどうか次第```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %r14
	salq	$2, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L2
	movq	%rax, %rbx
	movq	%rax, %r12
	xorl	%ebp, %ebp
	testl	%r14d, %r14d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	addq	$4, %r12
	cmpl	%ebp, %edx
	jg	.L5
	testl	%edx, %edx
	jle	.L4
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	leal	-1(%rdx), %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %eax
	addq	$4, %rbx
	cmpl	%eax, %edx
	je	.L9
.L8:
	movl	(%rbx), %ecx
	leal	-1(%rcx), %esi
	cmpl	%eax, %esi
	jne	.L6
	addl	$1, %r8d
	cmpl	%eax, %edi
	je	.L16
	movd	4(%rbx), %xmm0
	movd	%ecx, %xmm1
	addl	$1, %eax
	addq	$4, %rbx
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -4(%rbx)
	cmpl	%eax, %edx
	jne	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movd	-4(%rbx), %xmm2
	movd	%ecx, %xmm0
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, -4(%rbx)
	jmp	.L6
.L4:
	xorl	%r8d, %r8d
	jmp	.L9
.L17:
	call	__stack_chk_fail@PLT
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE51:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %r14
	salq	$2, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L2
	movq	%rax, %rbx
	movq	%rax, %r12
	xorl	%ebp, %ebp
	testl	%r14d, %r14d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	addq	$4, %r12
	cmpl	%ebp, %edx
	jg	.L5
	testl	%edx, %edx
	jle	.L4
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	leal	-1(%rdx), %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %eax
	addq	$4, %rbx
	cmpl	%eax, %edx
	je	.L9
.L8:
	movl	(%rbx), %ecx
	leal	-1(%rcx), %esi
	cmpl	%eax, %esi
	jne	.L6
	addl	$1, %r8d
	cmpl	%eax, %edi
	je	.L16
	movd	4(%rbx), %xmm0
	movd	%ecx, %xmm1
	addl	$1, %eax
	addq	$4, %rbx
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, -4(%rbx)
	cmpl	%eax, %edx
	jne	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	movd	-4(%rbx), %xmm2
	movd	%ecx, %xmm0
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, -4(%rbx)
	jmp	.L6
.L4:
	xorl	%r8d, %r8d
	jmp	.L9
.L17:
	call	__stack_chk_fail@PLT
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE51:
	.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:
```