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>
#define int long long
#define p (int)(1e9 + 7)

int MOD(int a){
	a %= p;
	return a >= 0 ? a : a + p;
}

int rank(int **A, int N){
	int i, j, k, l, *tmp;
	for(i = 0, j = 0; j < N; j++){
//		printf("(i, j) = (%lld, %lld)\n", i, j);
		for(k = i; k < N && A[k][j] == 0; k++);
//		printf("k = %lld\n", k);
		if(k == N){
			continue;
		}
		tmp = A[i];
		A[i] = A[k];
		A[k] = tmp;
		for(k = 0; k < N; k++){
			if(i == k || A[k][j] == 0){
				continue;
			}
			for(l = j; l < N; l++){
				A[k][l] ^= A[i][l];
			}
		}
		i++;
	}
	return i;
}

signed main(){
	int N, R, i, j, k;
	scanf("%lld", &N);
	int **C = (int **)malloc(sizeof(int *) * N);
	for(i = 0; i < N; i++){
		C[i] = (int *)malloc(sizeof(int) * N);
		for(j = 0; j < N; j++){
			scanf("%lld", &C[i][j]);
		}
	}
	R = rank(C, N);
//	printf("R = %lld\n", R);

	int *pow2 = (int *)malloc(sizeof(int) * (N * N + 1));
	pow2[0] = 1;
	for(i = 1; i <= N * N; i++){
		pow2[i] = MOD(pow2[i - 1] * 2);
	}

	int ***dp = (int ***)malloc(sizeof(int **) * (N + 1));
	for(i = 0; i <= N; i++){
		dp[i] = (int **)malloc(sizeof(int *) * (N + 2));
		for(j = 0; j <= N + 1; j++){
			dp[i][j] = (int *)malloc(sizeof(int) * (N + 2));
			for(k = 0; k <= N + 1; k++){
				dp[i][j][k] = 0;
			}
		}
	}
	dp[0][0][0] = 1;
	for(i = 0; i < N; i++){
		for(j = 0; j <= N; j++){
			for(k = 0; k <= N; k++){
				if(k > R || j < k){
					dp[i][j][k] = 0;
				}
				else{
					dp[i + 1][j][k] = MOD(dp[i + 1][j][k] + pow2[j] * dp[i][j][k]);
					dp[i + 1][j + 1][k] = MOD(dp[i + 1][j + 1][k] + MOD(pow2[N] - pow2[R - k + j]) * dp[i][j][k]);
					dp[i + 1][j + 1][k + 1] = MOD(dp[i + 1][j + 1][k + 1] + MOD(pow2[R - k + j] - pow2[j]) * dp[i][j][k]);
				}
			}
		}
	}
/*	for(i = 0; i <= N; i++){
		for(j = 0; j <= N; j++){
			for(k = 0; k <= N; k++){
				printf("dp[%lld][%lld][%lld] = %lld\n", i, j, k, dp[i][j][k]);
			}
		}
		printf("\n");
	}
*/	int ans = 0;
	for(j = 0; j <= N; j++){
		ans = MOD(ans + pow2[N * (N - j)] * dp[N][j][R]);
	}
	printf("%lld\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	MOD
	.type	MOD, @function
MOD:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jns	.L2
	movq	-8(%rbp), %rax
	addq	$1000000007, %rax
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	MOD, .-MOD
	.globl	rank
	.type	rank, @function
rank:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -56(%rbp)
	movq	%rsi, -64(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	jmp	.L6
.L19:
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L7
.L9:
	addq	$1, -24(%rbp)
.L7:
	movq	-24(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jge	.L8
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L9
.L8:
	movq	-24(%rbp), %rax
	cmpq	-64(%rbp), %rax
	je	.L21
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	-40(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rdx)
	movq	$0, -24(%rbp)
	jmp	.L12
.L18:
	movq	-40(%rbp), %rax
	cmpq	-24(%rbp), %rax
	je	.L22
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L22
	movq	-32(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L16
.L17:
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rsi
	movq	-56(%rbp), %rax
	addq	%rsi, %rax
	movq	(%rax), %rsi
	movq	-16(%rbp), %rax
	salq	$3, %rax
	addq	%rsi, %rax
	xorq	%rcx, %rdx
	movq	%rdx, (%rax)
	addq	$1, -16(%rbp)
.L16:
	movq	-16(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jl	.L17
	jmp	.L15
.L22:
	nop
.L15:
	addq	$1, -24(%rbp)
.L12:
	movq	-24(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jl	.L18
	addq	$1, -40(%rbp)
	jmp	.L11
.L21:
	nop
.L11:
	addq	$1, -32(%rbp)
.L6:
	movq	-32(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jl	.L19
	movq	-40(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	rank, .-rank
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	movq	$0, -88(%rbp)
	jmp	.L24
.L27:
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	$0, -80(%rbp)
	jmp	.L25
.L26:
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -80(%rbp)
.L25:
	movq	-96(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jl	.L26
	addq	$1, -88(%rbp)
.L24:
	movq	-96(%rbp), %rax
	cmpq	%rax, -88(%rbp)
	jl	.L27
	movq	-96(%rbp), %rdx
	movq	-56(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	rank
	movq	%rax, -48(%rbp)
	movq	-96(%rbp), %rdx
	movq	-96(%rbp), %rax
	imulq	%rdx, %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	-40(%rbp), %rax
	movq	$1, (%rax)
	movq	$1, -88(%rbp)
	jmp	.L28
.L29:
	movq	-88(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	addq	$1, -88(%rbp)
.L28:
	movq	-96(%rbp), %rdx
	movq	-96(%rbp), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -88(%rbp)
	jle	.L29
	movq	-96(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movq	$0, -88(%rbp)
	jmp	.L30
.L35:
	movq	-96(%rbp), %rax
	addq	$2, %rax
	salq	$3, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	$0, -80(%rbp)
	jmp	.L31
.L34:
	movq	-96(%rbp), %rax
	addq	$2, %rax
	salq	$3, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	$0, -72(%rbp)
	jmp	.L32
.L33:
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -72(%rbp)
.L32:
	movq	-96(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -72(%rbp)
	jle	.L33
	addq	$1, -80(%rbp)
.L31:
	movq	-96(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -80(%rbp)
	jle	.L34
	addq	$1, -88(%rbp)
.L30:
	movq	-96(%rbp), %rax
	cmpq	%rax, -88(%rbp)
	jle	.L35
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	$1, (%rax)
	movq	$0, -88(%rbp)
	jmp	.L36
.L44:
	movq	$0, -80(%rbp)
	jmp	.L37
.L43:
	movq	$0, -72(%rbp)
	jmp	.L38
.L42:
	movq	-72(%rbp), %rax
	cmpq	-48(%rbp), %rax
	jg	.L39
	movq	-80(%rbp), %rax
	cmpq	-72(%rbp), %rax
	jge	.L40
.L39:
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	jmp	.L41
.L40:
	movq	-88(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rsi
	movq	-32(%rbp), %rax
	addq	%rsi, %rax
	movq	(%rax), %rsi
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rsi
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rax
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	-88(%rbp), %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-88(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rbx
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-48(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	imulq	%rdx, %rax
	addq	%rbx, %rax
	movq	-88(%rbp), %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	addq	$1, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-88(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rbx
	movq	-48(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-80(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	imulq	%rdx, %rax
	addq	%rbx, %rax
	movq	-88(%rbp), %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	addq	$1, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	addq	$1, %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
.L41:
	addq	$1, -72(%rbp)
.L38:
	movq	-96(%rbp), %rax
	cmpq	%rax, -72(%rbp)
	jle	.L42
	addq	$1, -80(%rbp)
.L37:
	movq	-96(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jle	.L43
	addq	$1, -88(%rbp)
.L36:
	movq	-96(%rbp), %rax
	cmpq	%rax, -88(%rbp)
	jl	.L44
	movq	$0, -64(%rbp)
	movq	$0, -80(%rbp)
	jmp	.L45
.L46:
	movq	-96(%rbp), %rax
	subq	-80(%rbp), %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-48(%rbp), %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	imulq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	%rax, -64(%rbp)
	addq	$1, -80(%rbp)
.L45:
	movq	-96(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jle	.L46
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L48
	call	__stack_chk_fail@PLT
.L48:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	MOD
	.type	MOD, @function
MOD:
.LFB39:
	.cfi_startproc
	endbr64
	movabsq	$-8543223828751151131, %rdx
	movq	%rdi, %rax
	imulq	%rdx
	leaq	(%rdx,%rdi), %rax
	movq	%rdi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	ret
	.cfi_endproc
.LFE39:
	.size	MOD, .-MOD
	.p2align 4
	.globl	rank
	.type	rank, @function
rank:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	-1(%rsi), %rax
	xorl	%r15d, %r15d
	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
	movq	%rax, -16(%rsp)
	testq	%rsi, %rsi
	jle	.L4
	movq	%rdi, %r12
	movq	%rsi, %r8
	xorl	%r9d, %r9d
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L5:
	cmpq	%r8, %r15
	jge	.L19
	leaq	(%r12,%r15,8), %rax
	movq	%r15, %rdx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rdx
	addq	$8, %rax
	cmpq	%rdx, %r8
	je	.L41
.L20:
	movq	(%rax), %rcx
	movq	%rax, %rsi
	cmpq	$0, (%rcx,%r9)
	je	.L8
.L9:
	leaq	(%r12,%r15,8), %r13
	movl	$1, %ebx
	leaq	8(%r9), %rbp
	movq	0(%r13), %rax
	movq	%rcx, 0(%r13)
	movq	%rax, (%rsi)
	movq	%r8, %rax
	subq	%r14, %rax
	cmpq	%r14, %r8
	cmovle	%rbx, %rax
	xorl	%esi, %esi
	movq	%rax, %r11
	movq	%rax, -32(%rsp)
	andq	$-2, %rax
	leaq	(%r14,%rax), %rdi
	movq	%rax, -24(%rsp)
	movq	-16(%rsp), %rax
	shrq	%r11
	salq	$4, %r11
	salq	$3, %rdi
	subq	%r14, %rax
	movq	%rax, -40(%rsp)
	jmp	.L11
.L13:
	addq	$1, %rsi
	cmpq	%rsi, %r8
	je	.L42
	.p2align 4,,10
	.p2align 3
.L11:
	cmpq	%rsi, %r15
	je	.L13
	movq	(%r12,%rsi,8), %rdx
	leaq	(%rdx,%r9), %rcx
	cmpq	$0, (%rcx)
	je	.L13
	cmpq	$1, -40(%rsp)
	movq	0(%r13), %r10
	seta	%bl
	cmpq	%r14, %r8
	setg	%al
	testb	%al, %bl
	je	.L22
	leaq	(%r10,%rbp), %rax
	cmpq	%rax, %rcx
	je	.L22
	leaq	(%r10,%r9), %rbx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L15:
	movdqu	(%rcx,%rax), %xmm0
	movdqu	(%rbx,%rax), %xmm1
	pxor	%xmm1, %xmm0
	movups	%xmm0, (%rcx,%rax)
	addq	$16, %rax
	cmpq	%rax, %r11
	jne	.L15
	movq	-24(%rsp), %rbx
	cmpq	%rbx, -32(%rsp)
	je	.L13
	addq	$1, %rsi
	movq	(%r10,%rdi), %rax
	xorq	%rax, (%rdx,%rdi)
	cmpq	%rsi, %r8
	jne	.L11
.L42:
	addq	$1, %r15
.L7:
	addq	$1, %r14
	movq	%rbp, %r9
	cmpq	%r14, %r8
	jne	.L5
.L4:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movq	%r15, %rax
	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
.L41:
	.cfi_restore_state
	leaq	8(%r9), %rbp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L14:
	movq	(%r10,%rax,8), %rcx
	xorq	%rcx, (%rdx,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %r8
	jg	.L14
	jmp	.L13
.L19:
	je	.L41
	leaq	(%r12,%r15,8), %rsi
	movq	(%rsi), %rcx
	jmp	.L9
	.cfi_endproc
.LFE40:
	.size	rank, .-rank
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	112(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	112(%rsp), %r15
	leaq	0(,%r15,8), %rdi
	call	malloc@PLT
	movq	%rax, %r13
	testq	%r15, %r15
	jle	.L44
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L83:
	leaq	0(,%r15,8), %rdi
	xorl	%r14d, %r14d
	call	malloc@PLT
	movq	%rax, 0(%r13,%r12,8)
	movq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L45:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r14
	call	__isoc99_scanf@PLT
	movq	112(%rsp), %r15
	addq	$8, %rbx
	cmpq	%r14, %r15
	jg	.L45
	addq	$1, %r12
	cmpq	%r12, %r15
	jg	.L83
.L44:
	movq	%r15, %rsi
	movq	%r13, %rdi
	call	rank
	movq	112(%rsp), %r15
	movq	%rax, 56(%rsp)
	movq	%r15, %r14
	imulq	%r15, %r14
	leaq	8(,%r14,8), %rbx
	movq	%r14, 104(%rsp)
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rax, 48(%rsp)
	movq	$1, (%rax)
	testq	%r14, %r14
	je	.L52
	cmpq	$1, 104(%rsp)
	movq	$2, 8(%rax)
	leaq	16(%rax), %rsi
	leaq	(%rax,%rbx), %rdi
	movabsq	$-8543223828751151131, %r8
	movl	$2, %eax
	je	.L52
	.p2align 4,,10
	.p2align 3
.L51:
	leaq	(%rax,%rax), %rcx
	movq	%rcx, %rax
	imulq	%r8
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	addq	$8, %rsi
	movq	%rax, -8(%rsi)
	cmpq	%rdi, %rsi
	jne	.L51
.L52:
	leaq	1(%r15), %rax
	movq	%rax, 8(%rsp)
	salq	$3, %rax
	movq	%rax, %rdi
	movq	%rax, 96(%rsp)
	call	malloc@PLT
	xorl	%edx, %edx
	movq	%rax, 88(%rsp)
	testq	%r15, %r15
	js	.L49
	movq	%rax, %rdi
	movq	96(%rsp), %rax
	movq	%r15, 40(%rsp)
	movq	%rdi, 32(%rsp)
	movq	%rax, %rsi
	leaq	8(%rax), %rbx
	subq	$8, %rax
	movq	%rdi, (%rsp)
	movq	%rax, 24(%rsp)
	addq	%rdi, %rsi
	leaq	2(%r15), %rax
	movq	%rax, %r12
	movq	%rsi, 16(%rsp)
	movq	%rax, %r14
	movq	%rax, %r13
	shrq	%r12
	andq	$-2, %r14
	salq	$4, %r12
	.p2align 4,,10
	.p2align 3
.L54:
	movq	%rbx, %rdi
	call	malloc@PLT
	cmpq	$0, 8(%rsp)
	movq	%rax, %r8
	movq	(%rsp), %rax
	movq	%r8, %r15
	leaq	(%r8,%rbx), %rbp
	movq	%r8, (%rax)
	js	.L59
	.p2align 4,,10
	.p2align 3
.L58:
	movq	%rbx, %rdi
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	movq	%rax, (%r15)
	movq	%rax, %rdx
	leaq	(%rax,%r12), %rcx
	.p2align 4,,10
	.p2align 3
.L56:
	movups	%xmm0, (%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rcx
	jne	.L56
	cmpq	%r14, %r13
	je	.L57
	movq	$0, (%rax,%r14,8)
.L57:
	addq	$8, %r15
	cmpq	%rbp, %r15
	jne	.L58
.L59:
	addq	$8, (%rsp)
	movq	(%rsp), %rax
	cmpq	%rax, 16(%rsp)
	jne	.L54
	movq	88(%rsp), %rax
	movq	40(%rsp), %r15
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	$1, (%rax)
	testq	%r15, %r15
	je	.L73
	movq	48(%rsp), %rax
	movq	24(%rsp), %rsi
	movq	%r15, %r14
	movabsq	$-8543223828751151131, %r13
	movq	%rax, %rbx
	addq	%rsi, %rbx
	addq	88(%rsp), %rsi
	movq	%rbx, 64(%rsp)
	movq	56(%rsp), %rbx
	movq	%rsi, 72(%rsp)
	leaq	(%rax,%rbx,8), %rax
	movq	%rax, 80(%rsp)
	.p2align 4,,10
	.p2align 3
.L60:
	movq	$0, 8(%rsp)
	movq	80(%rsp), %rbp
	movq	$0, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L74:
	movq	8(%rsp), %rax
	movq	56(%rsp), %rbx
	movq	%rax, 24(%rsp)
	addq	$8, %rax
	movq	%rax, 8(%rsp)
	movq	16(%rsp), %rax
	cmpq	%rax, %rbx
	cmovle	%rbx, %rax
	testq	%rax, %rax
	jns	.L72
	xorl	%esi, %esi
	addq	$8, %rbp
.L70:
	movq	32(%rsp), %rax
	movq	24(%rsp), %rbx
	movq	(%rax), %rax
	movq	(%rax,%rbx), %rax
	.p2align 4,,10
	.p2align 3
.L68:
	movq	$0, (%rax,%rsi,8)
	addq	$1, %rsi
	cmpq	%rsi, %r14
	jge	.L68
	movq	16(%rsp), %rbx
	leaq	1(%rbx), %rax
	cmpq	%rbx, %r14
	je	.L71
.L104:
	movq	%rax, 16(%rsp)
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L72:
	cmpq	%rax, %r14
	movq	24(%rsp), %rsi
	movq	32(%rsp), %rcx
	movq	%rbp, %r9
	cmovle	%r14, %rax
	movq	%r14, 40(%rsp)
	leaq	8(%rbp), %rbp
	movq	(%rcx), %rdx
	movq	%rax, %rdi
	movq	64(%rsp), %rax
	movq	(%rdx,%rsi), %r12
	movq	%rdi, %r14
	movq	(%rax), %rax
	movq	%rax, (%rsp)
	movq	48(%rsp), %rax
	movq	(%rax,%rsi), %rbx
	movq	8(%rcx), %rax
	movq	(%rax,%rsi), %r15
	movq	8(%rsp), %rsi
	movq	(%rax,%rsi), %r11
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L67:
	leaq	0(,%rsi,8), %r8
	leaq	(%r12,%r8), %r10
	leaq	(%r15,%r8), %rdi
	movq	(%r10), %rcx
	imulq	%rbx, %rcx
	addq	(%rdi), %rcx
	movq	%rcx, %rax
	imulq	%r13
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	leaq	1000000007(%rcx), %rax
	movq	%rcx, %rdx
	movq	(%rsp), %rcx
	cmovs	%rax, %rdx
	addq	%r11, %r8
	movq	%rdx, (%rdi)
	movq	(%r9), %rdi
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%r13
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	movq	(%r8), %rcx
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	imulq	(%r10), %rax
	addq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%r13
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	leaq	1000000007(%rcx), %rax
	movq	%rcx, %rdx
	movq	%rbp, %rcx
	cmovs	%rax, %rdx
	subq	%rbx, %rdi
	subq	%r9, %rcx
	movq	%rdi, %rax
	addq	%r11, %rcx
	movq	%rdx, (%r8)
	imulq	%r13
	movq	%rdi, %r8
	sarq	$63, %r8
	leaq	(%rdx,%rdi), %rax
	sarq	$29, %rax
	subq	%r8, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	imulq	(%r10), %rax
	addq	(%rcx), %rax
	movq	%rax, %rdi
	imulq	%r13
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rdi
	movq	%rdi, %rdx
	leaq	1000000007(%rdi), %rax
	cmovs	%rax, %rdx
	addq	$1, %rsi
	subq	$8, %r9
	movq	%rdx, (%rcx)
	cmpq	%rsi, %r14
	jge	.L67
	movq	40(%rsp), %r14
	cmpq	%rsi, %r14
	jge	.L70
	movq	16(%rsp), %rbx
	leaq	1(%rbx), %rax
	cmpq	%rbx, %r14
	jne	.L104
	.p2align 4,,10
	.p2align 3
.L71:
	addq	$8, 32(%rsp)
	movq	32(%rsp), %rax
	cmpq	72(%rsp), %rax
	jne	.L60
	movq	%r14, %r15
.L73:
	movq	88(%rsp), %rax
	movq	96(%rsp), %rbx
	movq	-8(%rax,%rbx), %rdi
	movq	56(%rsp), %rax
	leaq	0(,%rax,8), %rsi
	cmpq	$1, %r15
	jne	.L105
	movq	%rax, %rbx
	movq	48(%rsp), %r11
	movq	(%rdi), %rax
	movabsq	$-8543223828751151131, %rsi
	movq	(%rax,%rbx,8), %rcx
	imulq	8(%r11), %rcx
	movq	%rcx, %rax
	imulq	%rsi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	movq	8(%rdi), %rdx
	movq	(%rdx,%rbx,8), %rcx
	imulq	(%r11), %rcx
	addq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	leaq	1000000007(%rcx), %rax
	cmovs	%rax, %rdx
.L49:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L106
	addq	$136, %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
.L105:
	.cfi_restore_state
	movq	48(%rsp), %rax
	movq	104(%rsp), %rbx
	imulq	$-8, %r15, %r8
	xorl	%edx, %edx
	movabsq	$-8543223828751151131, %r10
	movq	96(%rsp), %r11
	leaq	(%rax,%rbx,8), %r9
	addq	%rdi, %r11
.L77:
	movq	(%rdi), %rax
	movq	(%rax,%rsi), %rcx
	imulq	(%r9), %rcx
	addq	%rdx, %rcx
	movq	%rcx, %rax
	imulq	%r10
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	leaq	1000000007(%rcx), %rax
	cmovs	%rax, %rdx
	addq	$8, %rdi
	addq	%r8, %r9
	cmpq	%rdi, %r11
	jne	.L77
	jmp	.L49
.L106:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	MOD
	.type	MOD, @function
MOD:
.LFB39:
	.cfi_startproc
	endbr64
	movabsq	$-8543223828751151131, %rdx
	movq	%rdi, %rax
	imulq	%rdx
	leaq	(%rdx,%rdi), %rax
	movq	%rdi, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	ret
	.cfi_endproc
.LFE39:
	.size	MOD, .-MOD
	.p2align 4
	.globl	rank
	.type	rank, @function
rank:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	-1(%rsi), %rax
	xorl	%r15d, %r15d
	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
	movq	%rax, -16(%rsp)
	testq	%rsi, %rsi
	jle	.L4
	movq	%rdi, %r12
	movq	%rsi, %r8
	xorl	%r9d, %r9d
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L5:
	cmpq	%r8, %r15
	jge	.L19
	leaq	(%r12,%r15,8), %rax
	movq	%r15, %rdx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rdx
	addq	$8, %rax
	cmpq	%rdx, %r8
	je	.L41
.L20:
	movq	(%rax), %rcx
	movq	%rax, %rsi
	cmpq	$0, (%rcx,%r9)
	je	.L8
.L9:
	leaq	(%r12,%r15,8), %r13
	movl	$1, %ebx
	leaq	8(%r9), %rbp
	movq	0(%r13), %rax
	movq	%rcx, 0(%r13)
	movq	%rax, (%rsi)
	movq	%r8, %rax
	subq	%r14, %rax
	cmpq	%r14, %r8
	cmovle	%rbx, %rax
	xorl	%esi, %esi
	movq	%rax, %r11
	movq	%rax, -32(%rsp)
	andq	$-2, %rax
	leaq	(%r14,%rax), %rdi
	movq	%rax, -24(%rsp)
	movq	-16(%rsp), %rax
	shrq	%r11
	salq	$4, %r11
	salq	$3, %rdi
	subq	%r14, %rax
	movq	%rax, -40(%rsp)
	jmp	.L11
.L13:
	addq	$1, %rsi
	cmpq	%rsi, %r8
	je	.L42
	.p2align 4,,10
	.p2align 3
.L11:
	cmpq	%rsi, %r15
	je	.L13
	movq	(%r12,%rsi,8), %rdx
	leaq	(%rdx,%r9), %rcx
	cmpq	$0, (%rcx)
	je	.L13
	cmpq	$1, -40(%rsp)
	movq	0(%r13), %r10
	seta	%bl
	cmpq	%r14, %r8
	setg	%al
	testb	%al, %bl
	je	.L22
	leaq	(%r10,%rbp), %rax
	cmpq	%rax, %rcx
	je	.L22
	leaq	(%r10,%r9), %rbx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L15:
	movdqu	(%rcx,%rax), %xmm0
	movdqu	(%rbx,%rax), %xmm1
	pxor	%xmm1, %xmm0
	movups	%xmm0, (%rcx,%rax)
	addq	$16, %rax
	cmpq	%rax, %r11
	jne	.L15
	movq	-24(%rsp), %rbx
	cmpq	%rbx, -32(%rsp)
	je	.L13
	addq	$1, %rsi
	movq	(%r10,%rdi), %rax
	xorq	%rax, (%rdx,%rdi)
	cmpq	%rsi, %r8
	jne	.L11
.L42:
	addq	$1, %r15
.L7:
	addq	$1, %r14
	movq	%rbp, %r9
	cmpq	%r14, %r8
	jne	.L5
.L4:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movq	%r15, %rax
	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
.L41:
	.cfi_restore_state
	leaq	8(%r9), %rbp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L14:
	movq	(%r10,%rax,8), %rcx
	xorq	%rcx, (%rdx,%rax,8)
	addq	$1, %rax
	cmpq	%rax, %r8
	jg	.L14
	jmp	.L13
.L19:
	je	.L41
	leaq	(%r12,%r15,8), %rsi
	movq	(%rsi), %rcx
	jmp	.L9
	.cfi_endproc
.LFE40:
	.size	rank, .-rank
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	112(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	112(%rsp), %r15
	leaq	0(,%r15,8), %rdi
	call	malloc@PLT
	movq	%rax, %r13
	testq	%r15, %r15
	jle	.L44
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L83:
	leaq	0(,%r15,8), %rdi
	xorl	%r14d, %r14d
	call	malloc@PLT
	movq	%rax, 0(%r13,%r12,8)
	movq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L45:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$1, %r14
	call	__isoc99_scanf@PLT
	movq	112(%rsp), %r15
	addq	$8, %rbx
	cmpq	%r14, %r15
	jg	.L45
	addq	$1, %r12
	cmpq	%r12, %r15
	jg	.L83
.L44:
	movq	%r15, %rsi
	movq	%r13, %rdi
	call	rank
	movq	112(%rsp), %r15
	movq	%rax, 56(%rsp)
	movq	%r15, %r14
	imulq	%r15, %r14
	leaq	8(,%r14,8), %rbx
	movq	%r14, 104(%rsp)
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rax, 48(%rsp)
	movq	$1, (%rax)
	testq	%r14, %r14
	je	.L52
	cmpq	$1, 104(%rsp)
	movq	$2, 8(%rax)
	leaq	16(%rax), %rsi
	leaq	(%rax,%rbx), %rdi
	movabsq	$-8543223828751151131, %r8
	movl	$2, %eax
	je	.L52
	.p2align 4,,10
	.p2align 3
.L51:
	leaq	(%rax,%rax), %rcx
	movq	%rcx, %rax
	imulq	%r8
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	addq	$8, %rsi
	movq	%rax, -8(%rsi)
	cmpq	%rdi, %rsi
	jne	.L51
.L52:
	leaq	1(%r15), %rax
	movq	%rax, 8(%rsp)
	salq	$3, %rax
	movq	%rax, %rdi
	movq	%rax, 96(%rsp)
	call	malloc@PLT
	xorl	%edx, %edx
	movq	%rax, 88(%rsp)
	testq	%r15, %r15
	js	.L49
	movq	%rax, %rdi
	movq	96(%rsp), %rax
	movq	%r15, 40(%rsp)
	movq	%rdi, 32(%rsp)
	movq	%rax, %rsi
	leaq	8(%rax), %rbx
	subq	$8, %rax
	movq	%rdi, (%rsp)
	movq	%rax, 24(%rsp)
	addq	%rdi, %rsi
	leaq	2(%r15), %rax
	movq	%rax, %r12
	movq	%rsi, 16(%rsp)
	movq	%rax, %r14
	movq	%rax, %r13
	shrq	%r12
	andq	$-2, %r14
	salq	$4, %r12
	.p2align 4,,10
	.p2align 3
.L54:
	movq	%rbx, %rdi
	call	malloc@PLT
	cmpq	$0, 8(%rsp)
	movq	%rax, %r8
	movq	(%rsp), %rax
	movq	%r8, %r15
	leaq	(%r8,%rbx), %rbp
	movq	%r8, (%rax)
	js	.L59
	.p2align 4,,10
	.p2align 3
.L58:
	movq	%rbx, %rdi
	call	malloc@PLT
	pxor	%xmm0, %xmm0
	movq	%rax, (%r15)
	movq	%rax, %rdx
	leaq	(%rax,%r12), %rcx
	.p2align 4,,10
	.p2align 3
.L56:
	movups	%xmm0, (%rdx)
	addq	$16, %rdx
	cmpq	%rdx, %rcx
	jne	.L56
	cmpq	%r14, %r13
	je	.L57
	movq	$0, (%rax,%r14,8)
.L57:
	addq	$8, %r15
	cmpq	%rbp, %r15
	jne	.L58
.L59:
	addq	$8, (%rsp)
	movq	(%rsp), %rax
	cmpq	%rax, 16(%rsp)
	jne	.L54
	movq	88(%rsp), %rax
	movq	40(%rsp), %r15
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	$1, (%rax)
	testq	%r15, %r15
	je	.L73
	movq	48(%rsp), %rax
	movq	24(%rsp), %rsi
	movq	%r15, %r14
	movabsq	$-8543223828751151131, %r13
	movq	%rax, %rbx
	addq	%rsi, %rbx
	addq	88(%rsp), %rsi
	movq	%rbx, 64(%rsp)
	movq	56(%rsp), %rbx
	movq	%rsi, 72(%rsp)
	leaq	(%rax,%rbx,8), %rax
	movq	%rax, 80(%rsp)
	.p2align 4,,10
	.p2align 3
.L60:
	movq	$0, 8(%rsp)
	movq	80(%rsp), %rbp
	movq	$0, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L74:
	movq	8(%rsp), %rax
	movq	56(%rsp), %rbx
	movq	%rax, 24(%rsp)
	addq	$8, %rax
	movq	%rax, 8(%rsp)
	movq	16(%rsp), %rax
	cmpq	%rax, %rbx
	cmovle	%rbx, %rax
	testq	%rax, %rax
	jns	.L72
	xorl	%esi, %esi
	addq	$8, %rbp
.L70:
	movq	32(%rsp), %rax
	movq	24(%rsp), %rbx
	movq	(%rax), %rax
	movq	(%rax,%rbx), %rax
	.p2align 4,,10
	.p2align 3
.L68:
	movq	$0, (%rax,%rsi,8)
	addq	$1, %rsi
	cmpq	%rsi, %r14
	jge	.L68
	movq	16(%rsp), %rbx
	leaq	1(%rbx), %rax
	cmpq	%rbx, %r14
	je	.L71
.L104:
	movq	%rax, 16(%rsp)
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L72:
	cmpq	%rax, %r14
	movq	24(%rsp), %rsi
	movq	32(%rsp), %rcx
	movq	%rbp, %r9
	cmovle	%r14, %rax
	movq	%r14, 40(%rsp)
	leaq	8(%rbp), %rbp
	movq	(%rcx), %rdx
	movq	%rax, %rdi
	movq	64(%rsp), %rax
	movq	(%rdx,%rsi), %r12
	movq	%rdi, %r14
	movq	(%rax), %rax
	movq	%rax, (%rsp)
	movq	48(%rsp), %rax
	movq	(%rax,%rsi), %rbx
	movq	8(%rcx), %rax
	movq	(%rax,%rsi), %r15
	movq	8(%rsp), %rsi
	movq	(%rax,%rsi), %r11
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L67:
	leaq	0(,%rsi,8), %r8
	leaq	(%r12,%r8), %r10
	leaq	(%r15,%r8), %rdi
	movq	(%r10), %rcx
	imulq	%rbx, %rcx
	addq	(%rdi), %rcx
	movq	%rcx, %rax
	imulq	%r13
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	leaq	1000000007(%rcx), %rax
	movq	%rcx, %rdx
	movq	(%rsp), %rcx
	cmovs	%rax, %rdx
	addq	%r11, %r8
	movq	%rdx, (%rdi)
	movq	(%r9), %rdi
	subq	%rdi, %rcx
	movq	%rcx, %rax
	imulq	%r13
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	movq	(%r8), %rcx
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	imulq	(%r10), %rax
	addq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%r13
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	leaq	1000000007(%rcx), %rax
	movq	%rcx, %rdx
	movq	%rbp, %rcx
	cmovs	%rax, %rdx
	subq	%rbx, %rdi
	subq	%r9, %rcx
	movq	%rdi, %rax
	addq	%r11, %rcx
	movq	%rdx, (%r8)
	imulq	%r13
	movq	%rdi, %r8
	sarq	$63, %r8
	leaq	(%rdx,%rdi), %rax
	sarq	$29, %rax
	subq	%r8, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	imulq	(%r10), %rax
	addq	(%rcx), %rax
	movq	%rax, %rdi
	imulq	%r13
	movq	%rdi, %rax
	sarq	$63, %rax
	addq	%rdi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rdi
	movq	%rdi, %rdx
	leaq	1000000007(%rdi), %rax
	cmovs	%rax, %rdx
	addq	$1, %rsi
	subq	$8, %r9
	movq	%rdx, (%rcx)
	cmpq	%rsi, %r14
	jge	.L67
	movq	40(%rsp), %r14
	cmpq	%rsi, %r14
	jge	.L70
	movq	16(%rsp), %rbx
	leaq	1(%rbx), %rax
	cmpq	%rbx, %r14
	jne	.L104
	.p2align 4,,10
	.p2align 3
.L71:
	addq	$8, 32(%rsp)
	movq	32(%rsp), %rax
	cmpq	72(%rsp), %rax
	jne	.L60
	movq	%r14, %r15
.L73:
	movq	88(%rsp), %rax
	movq	96(%rsp), %rbx
	movq	-8(%rax,%rbx), %rdi
	movq	56(%rsp), %rax
	leaq	0(,%rax,8), %rsi
	cmpq	$1, %r15
	jne	.L105
	movq	%rax, %rbx
	movq	48(%rsp), %r11
	movq	(%rdi), %rax
	movabsq	$-8543223828751151131, %rsi
	movq	(%rax,%rbx,8), %rcx
	imulq	8(%r11), %rcx
	movq	%rcx, %rax
	imulq	%rsi
	leaq	(%rdx,%rcx), %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	sarq	$29, %rax
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	leaq	1000000007(%rax), %rdx
	cmovs	%rdx, %rax
	movq	8(%rdi), %rdx
	movq	(%rdx,%rbx,8), %rcx
	imulq	(%r11), %rcx
	addq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	leaq	1000000007(%rcx), %rax
	cmovs	%rax, %rdx
.L49:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L106
	addq	$136, %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
.L105:
	.cfi_restore_state
	movq	48(%rsp), %rax
	movq	104(%rsp), %rbx
	imulq	$-8, %r15, %r8
	xorl	%edx, %edx
	movabsq	$-8543223828751151131, %r10
	movq	96(%rsp), %r11
	leaq	(%rax,%rbx,8), %r9
	addq	%rdi, %r11
.L77:
	movq	(%rdi), %rax
	movq	(%rax,%rsi), %rcx
	imulq	(%r9), %rcx
	addq	%rdx, %rcx
	movq	%rcx, %rax
	imulq	%r10
	movq	%rcx, %rax
	sarq	$63, %rax
	addq	%rcx, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	leaq	1000000007(%rcx), %rax
	cmovs	%rax, %rdx
	addq	$8, %rdi
	addq	%r8, %r9
	cmpq	%rdi, %r11
	jne	.L77
	jmp	.L49
.L106:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <stdlib.h>
#define int long long
#define p (int)(1e9 + 7)

int MOD(int a){
	a %= p;
	return a >= 0 ? a : a + p;
}

int rank(int **A, int N){
	int i, j, k, l, *tmp;
	for(i = 0, j = 0; j < N; j++){
//		printf("(i, j) = (%lld, %lld)\n", i, j);
		for(k = i; k < N && A[k][j] == 0; k++);
//		printf("k = %lld\n", k);
		if(k == N){
			continue;
		}
		tmp = A[i];
		A[i] = A[k];
		A[k] = tmp;
		for(k = 0; k < N; k++){
			if(i == k || A[k][j] == 0){
				continue;
			}
			for(l = j; l < N; l++){
				A[k][l] ^= A[i][l];
			}
		}
		i++;
	}
	return i;
}

signed main(){
	int N, R, i, j, k;
	scanf("%lld", &N);
	int **C = (int **)malloc(sizeof(int *) * N);
	for(i = 0; i < N; i++){
		C[i] = (int *)malloc(sizeof(int) * N);
		for(j = 0; j < N; j++){
			scanf("%lld", &C[i][j]);
		}
	}
	R = rank(C, N);
//	printf("R = %lld\n", R);

	int *pow2 = (int *)malloc(sizeof(int) * (N * N + 1));
	pow2[0] = 1;
	for(i = 1; i <= N * N; i++){
		pow2[i] = MOD(pow2[i - 1] * 2);
	}

	int ***dp = (int ***)malloc(sizeof(int **) * (N + 1));
	for(i = 0; i <= N; i++){
		dp[i] = (int **)malloc(sizeof(int *) * (N + 2));
		for(j = 0; j <= N + 1; j++){
			dp[i][j] = (int *)malloc(sizeof(int) * (N + 2));
			for(k = 0; k <= N + 1; k++){
				dp[i][j][k] = 0;
			}
		}
	}
	dp[0][0][0] = 1;
	for(i = 0; i < N; i++){
		for(j = 0; j <= N; j++){
			for(k = 0; k <= N; k++){
				if(k > R || j < k){
					dp[i][j][k] = 0;
				}
				else{
					dp[i + 1][j][k] = MOD(dp[i + 1][j][k] + pow2[j] * dp[i][j][k]);
					dp[i + 1][j + 1][k] = MOD(dp[i + 1][j + 1][k] + MOD(pow2[N] - pow2[R - k + j]) * dp[i][j][k]);
					dp[i + 1][j + 1][k + 1] = MOD(dp[i + 1][j + 1][k + 1] + MOD(pow2[R - k + j] - pow2[j]) * dp[i][j][k]);
				}
			}
		}
	}
/*	for(i = 0; i <= N; i++){
		for(j = 0; j <= N; j++){
			for(k = 0; k <= N; k++){
				printf("dp[%lld][%lld][%lld] = %lld\n", i, j, k, dp[i][j][k]);
			}
		}
		printf("\n");
	}
*/	int ans = 0;
	for(j = 0; j <= N; j++){
		ans = MOD(ans + pow2[N * (N - j)] * dp[N][j][R]);
	}
	printf("%lld\n", ans);
	return 0;
}
2
0 1
1 0

6

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>
#define int long long
#define p (int)(1e9 + 7)

int MOD(int a){
	a %= p;
	return a >= 0 ? a : a + p;
}

int rank(int **A, int N){
	int i, j, k, l, *tmp;
	for(i = 0, j = 0; j < N; j++){
//		printf("(i, j) = (%lld, %lld)\n", i, j);
		for(k = i; k < N && A[k][j] == 0; k++);
//		printf("k = %lld\n", k);
		if(k == N){
			continue;
		}
		tmp = A[i];
		A[i] = A[k];
		A[k] = tmp;
		for(k = 0; k < N; k++){
			if(i == k || A[k][j] == 0){
				continue;
			}
			for(l = j; l < N; l++){
				A[k][l] ^= A[i][l];
			}
		}
		i++;
	}
	return i;
}

signed main(){
	int N, R, i, j, k;
	scanf("%lld", &N);
	int **C = (int **)malloc(sizeof(int *) * N);
	for(i = 0; i < N; i++){
		C[i] = (int *)malloc(sizeof(int) * N);
		for(j = 0; j < N; j++){
			scanf("%lld", &C[i][j]);
		}
	}
	R = rank(C, N);
//	printf("R = %lld\n", R);

	int *pow2 = (int *)malloc(sizeof(int) * (N * N + 1));
	pow2[0] = 1;
	for(i = 1; i <= N * N; i++){
		pow2[i] = MOD(pow2[i - 1] * 2);
	}

	int ***dp = (int ***)malloc(sizeof(int **) * (N + 1));
	for(i = 0; i <= N; i++){
		dp[i] = (int **)malloc(sizeof(int *) * (N + 2));
		for(j = 0; j <= N + 1; j++){
			dp[i][j] = (int *)malloc(sizeof(int) * (N + 2));
			for(k = 0; k <= N + 1; k++){
				dp[i][j][k] = 0;
			}
		}
	}
	dp[0][0][0] = 1;
	for(i = 0; i < N; i++){
		for(j = 0; j <= N; j++){
			for(k = 0; k <= N; k++){
				if(k > R || j < k){
					dp[i][j][k] = 0;
				}
				else{
					dp[i + 1][j][k] = MOD(dp[i + 1][j][k] + pow2[j] * dp[i][j][k]);
					dp[i + 1][j + 1][k] = MOD(dp[i + 1][j + 1][k] + MOD(pow2[N] - pow2[R - k + j]) * dp[i][j][k]);
					dp[i + 1][j + 1][k + 1] = MOD(dp[i + 1][j + 1][k + 1] + MOD(pow2[R - k + j] - pow2[j]) * dp[i][j][k]);
				}
			}
		}
	}
/*	for(i = 0; i <= N; i++){
		for(j = 0; j <= N; j++){
			for(k = 0; k <= N; k++){
				printf("dp[%lld][%lld][%lld] = %lld\n", i, j, k, dp[i][j][k]);
			}
		}
		printf("\n");
	}
*/	int ans = 0;
	for(j = 0; j <= N; j++){
		ans = MOD(ans + pow2[N * (N - j)] * dp[N][j][R]);
	}
	printf("%lld\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	MOD
	.type	MOD, @function
MOD:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jns	.L2
	movq	-8(%rbp), %rax
	addq	$1000000007, %rax
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	MOD, .-MOD
	.globl	rank
	.type	rank, @function
rank:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -56(%rbp)
	movq	%rsi, -64(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	jmp	.L6
.L19:
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L7
.L9:
	addq	$1, -24(%rbp)
.L7:
	movq	-24(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jge	.L8
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L9
.L8:
	movq	-24(%rbp), %rax
	cmpq	-64(%rbp), %rax
	je	.L21
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	-40(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rdx)
	movq	$0, -24(%rbp)
	jmp	.L12
.L18:
	movq	-40(%rbp), %rax
	cmpq	-24(%rbp), %rax
	je	.L22
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L22
	movq	-32(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L16
.L17:
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rsi
	movq	-56(%rbp), %rax
	addq	%rsi, %rax
	movq	(%rax), %rsi
	movq	-16(%rbp), %rax
	salq	$3, %rax
	addq	%rsi, %rax
	xorq	%rcx, %rdx
	movq	%rdx, (%rax)
	addq	$1, -16(%rbp)
.L16:
	movq	-16(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jl	.L17
	jmp	.L15
.L22:
	nop
.L15:
	addq	$1, -24(%rbp)
.L12:
	movq	-24(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jl	.L18
	addq	$1, -40(%rbp)
	jmp	.L11
.L21:
	nop
.L11:
	addq	$1, -32(%rbp)
.L6:
	movq	-32(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jl	.L19
	movq	-40(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	rank, .-rank
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	movq	$0, -88(%rbp)
	jmp	.L24
.L27:
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	$0, -80(%rbp)
	jmp	.L25
.L26:
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -80(%rbp)
.L25:
	movq	-96(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jl	.L26
	addq	$1, -88(%rbp)
.L24:
	movq	-96(%rbp), %rax
	cmpq	%rax, -88(%rbp)
	jl	.L27
	movq	-96(%rbp), %rdx
	movq	-56(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	rank
	movq	%rax, -48(%rbp)
	movq	-96(%rbp), %rdx
	movq	-96(%rbp), %rax
	imulq	%rdx, %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	-40(%rbp), %rax
	movq	$1, (%rax)
	movq	$1, -88(%rbp)
	jmp	.L28
.L29:
	movq	-88(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	addq	$1, -88(%rbp)
.L28:
	movq	-96(%rbp), %rdx
	movq	-96(%rbp), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -88(%rbp)
	jle	.L29
	movq	-96(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movq	$0, -88(%rbp)
	jmp	.L30
.L35:
	movq	-96(%rbp), %rax
	addq	$2, %rax
	salq	$3, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	$0, -80(%rbp)
	jmp	.L31
.L34:
	movq	-96(%rbp), %rax
	addq	$2, %rax
	salq	$3, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	$0, -72(%rbp)
	jmp	.L32
.L33:
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -72(%rbp)
.L32:
	movq	-96(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -72(%rbp)
	jle	.L33
	addq	$1, -80(%rbp)
.L31:
	movq	-96(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -80(%rbp)
	jle	.L34
	addq	$1, -88(%rbp)
.L30:
	movq	-96(%rbp), %rax
	cmpq	%rax, -88(%rbp)
	jle	.L35
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	$1, (%rax)
	movq	$0, -88(%rbp)
	jmp	.L36
.L44:
	movq	$0, -80(%rbp)
	jmp	.L37
.L43:
	movq	$0, -72(%rbp)
	jmp	.L38
.L42:
	movq	-72(%rbp), %rax
	cmpq	-48(%rbp), %rax
	jg	.L39
	movq	-80(%rbp), %rax
	cmpq	-72(%rbp), %rax
	jge	.L40
.L39:
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	jmp	.L41
.L40:
	movq	-88(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rsi
	movq	-32(%rbp), %rax
	addq	%rsi, %rax
	movq	(%rax), %rsi
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rsi
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rax
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	-88(%rbp), %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-88(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rbx
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-48(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	imulq	%rdx, %rax
	addq	%rbx, %rax
	movq	-88(%rbp), %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	addq	$1, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-88(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rbx
	movq	-48(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-80(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	imulq	%rdx, %rax
	addq	%rbx, %rax
	movq	-88(%rbp), %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	addq	$1, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	addq	$1, %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
.L41:
	addq	$1, -72(%rbp)
.L38:
	movq	-96(%rbp), %rax
	cmpq	%rax, -72(%rbp)
	jle	.L42
	addq	$1, -80(%rbp)
.L37:
	movq	-96(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jle	.L43
	addq	$1, -88(%rbp)
.L36:
	movq	-96(%rbp), %rax
	cmpq	%rax, -88(%rbp)
	jl	.L44
	movq	$0, -64(%rbp)
	movq	$0, -80(%rbp)
	jmp	.L45
.L46:
	movq	-96(%rbp), %rax
	subq	-80(%rbp), %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-48(%rbp), %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	imulq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	%rax, -64(%rbp)
	addq	$1, -80(%rbp)
.L45:
	movq	-96(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jle	.L46
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L48
	call	__stack_chk_fail@PLT
.L48:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	MOD
	.type	MOD, @function
MOD:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jns	.L2
	movq	-8(%rbp), %rax
	addq	$1000000007, %rax
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	MOD, .-MOD
	.globl	rank
	.type	rank, @function
rank:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -56(%rbp)
	movq	%rsi, -64(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	jmp	.L6
.L19:
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	jmp	.L7
.L9:
	addq	$1, -24(%rbp)
.L7:
	movq	-24(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jge	.L8
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L9
.L8:
	movq	-24(%rbp), %rax
	cmpq	-64(%rbp), %rax
	je	.L21
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	-40(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rdx)
	movq	$0, -24(%rbp)
	jmp	.L12
.L18:
	movq	-40(%rbp), %rax
	cmpq	-24(%rbp), %rax
	je	.L22
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L22
	movq	-32(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L16
.L17:
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-40(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rsi
	movq	-56(%rbp), %rax
	addq	%rsi, %rax
	movq	(%rax), %rsi
	movq	-16(%rbp), %rax
	salq	$3, %rax
	addq	%rsi, %rax
	xorq	%rcx, %rdx
	movq	%rdx, (%rax)
	addq	$1, -16(%rbp)
.L16:
	movq	-16(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jl	.L17
	jmp	.L15
.L22:
	nop
.L15:
	addq	$1, -24(%rbp)
.L12:
	movq	-24(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jl	.L18
	addq	$1, -40(%rbp)
	jmp	.L11
.L21:
	nop
.L11:
	addq	$1, -32(%rbp)
.L6:
	movq	-32(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jl	.L19
	movq	-40(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	rank, .-rank
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	movq	$0, -88(%rbp)
	jmp	.L24
.L27:
	movq	-96(%rbp), %rax
	salq	$3, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-56(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	$0, -80(%rbp)
	jmp	.L25
.L26:
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -80(%rbp)
.L25:
	movq	-96(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jl	.L26
	addq	$1, -88(%rbp)
.L24:
	movq	-96(%rbp), %rax
	cmpq	%rax, -88(%rbp)
	jl	.L27
	movq	-96(%rbp), %rdx
	movq	-56(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	rank
	movq	%rax, -48(%rbp)
	movq	-96(%rbp), %rdx
	movq	-96(%rbp), %rax
	imulq	%rdx, %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	-40(%rbp), %rax
	movq	$1, (%rax)
	movq	$1, -88(%rbp)
	jmp	.L28
.L29:
	movq	-88(%rbp), %rax
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	addq	$1, -88(%rbp)
.L28:
	movq	-96(%rbp), %rdx
	movq	-96(%rbp), %rax
	imulq	%rdx, %rax
	cmpq	%rax, -88(%rbp)
	jle	.L29
	movq	-96(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movq	$0, -88(%rbp)
	jmp	.L30
.L35:
	movq	-96(%rbp), %rax
	addq	$2, %rax
	salq	$3, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	$0, -80(%rbp)
	jmp	.L31
.L34:
	movq	-96(%rbp), %rax
	addq	$2, %rax
	salq	$3, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movq	$0, -72(%rbp)
	jmp	.L32
.L33:
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	addq	$1, -72(%rbp)
.L32:
	movq	-96(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -72(%rbp)
	jle	.L33
	addq	$1, -80(%rbp)
.L31:
	movq	-96(%rbp), %rax
	addq	$1, %rax
	cmpq	%rax, -80(%rbp)
	jle	.L34
	addq	$1, -88(%rbp)
.L30:
	movq	-96(%rbp), %rax
	cmpq	%rax, -88(%rbp)
	jle	.L35
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	$1, (%rax)
	movq	$0, -88(%rbp)
	jmp	.L36
.L44:
	movq	$0, -80(%rbp)
	jmp	.L37
.L43:
	movq	$0, -72(%rbp)
	jmp	.L38
.L42:
	movq	-72(%rbp), %rax
	cmpq	-48(%rbp), %rax
	jg	.L39
	movq	-80(%rbp), %rax
	cmpq	-72(%rbp), %rax
	jge	.L40
.L39:
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	jmp	.L41
.L40:
	movq	-88(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rsi
	movq	-32(%rbp), %rax
	addq	%rsi, %rax
	movq	(%rax), %rsi
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rsi
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	(%rax), %rax
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	-88(%rbp), %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-88(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rbx
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-48(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	imulq	%rdx, %rax
	addq	%rbx, %rax
	movq	-88(%rbp), %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	addq	$1, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
	movq	-88(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-80(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-72(%rbp), %rax
	addq	$1, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rbx
	movq	-48(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-80(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	imulq	%rdx, %rax
	addq	%rbx, %rax
	movq	-88(%rbp), %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-80(%rbp), %rdx
	addq	$1, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-72(%rbp), %rdx
	addq	$1, %rdx
	salq	$3, %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	MOD
	movq	%rax, (%rbx)
.L41:
	addq	$1, -72(%rbp)
.L38:
	movq	-96(%rbp), %rax
	cmpq	%rax, -72(%rbp)
	jle	.L42
	addq	$1, -80(%rbp)
.L37:
	movq	-96(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jle	.L43
	addq	$1, -88(%rbp)
.L36:
	movq	-96(%rbp), %rax
	cmpq	%rax, -88(%rbp)
	jl	.L44
	movq	$0, -64(%rbp)
	movq	$0, -80(%rbp)
	jmp	.L45
.L46:
	movq	-96(%rbp), %rax
	subq	-80(%rbp), %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rcx
	movq	-48(%rbp), %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	imulq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdi
	call	MOD
	movq	%rax, -64(%rbp)
	addq	$1, -80(%rbp)
.L45:
	movq	-96(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jle	.L46
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L48
	call	__stack_chk_fail@PLT
.L48:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
