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>

int main()
{
	int i, N, P[9], Q[9];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(P[i]));
	for (i = 1; i <= N; i++) scanf("%d", &(Q[i]));
	
	int j, p = 1, q = 1, fact = 1;
	for (i = 1; i <= N - 1; i++) fact *= i;
	for (i = 1; i <= N - 1; i++) {
		p += (P[i] - 1) * fact;
		q += (Q[i] - 1) * fact;
		for (j = i + 1; j <= N; j++) {
			if (P[j] > P[i]) P[j]--;
			if (Q[j] > Q[i]) Q[j]--;
		}
		fact /= N - i;
	}
	
	printf("%d\n", abs(p - q));
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.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
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -116(%rbp)
	jmp	.L2
.L3:
	leaq	-96(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -116(%rbp)
.L2:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jle	.L3
	movl	$1, -116(%rbp)
	jmp	.L4
.L5:
	leaq	-48(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -116(%rbp)
.L4:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jle	.L5
	movl	$1, -108(%rbp)
	movl	$1, -104(%rbp)
	movl	$1, -100(%rbp)
	movl	$1, -116(%rbp)
	jmp	.L6
.L7:
	movl	-100(%rbp), %eax
	imull	-116(%rbp), %eax
	movl	%eax, -100(%rbp)
	addl	$1, -116(%rbp)
.L6:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L7
	movl	$1, -116(%rbp)
	jmp	.L8
.L13:
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	subl	$1, %eax
	imull	-100(%rbp), %eax
	addl	%eax, -108(%rbp)
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	subl	$1, %eax
	imull	-100(%rbp), %eax
	addl	%eax, -104(%rbp)
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L9
.L12:
	movl	-112(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	-112(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-112(%rbp), %eax
	cltq
	movl	%edx, -96(%rbp,%rax,4)
.L10:
	movl	-112(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-112(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-112(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
.L11:
	addl	$1, -112(%rbp)
.L9:
	movl	-120(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jle	.L12
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %ecx
	movl	-100(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, -100(%rbp)
	addl	$1, -116(%rbp)
.L8:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L13
	movl	-108(%rbp), %eax
	subl	-104(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$112, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L26
	leaq	20(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jge	.L3
	testl	%eax, %eax
	jle	.L26
	leaq	68(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$4, %rbp
	cmpl	%ebx, %ecx
	jge	.L4
	cmpl	$1, %ecx
	jle	.L26
	movl	$1, %eax
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	imull	%edx, %eax
	addl	$1, %edx
	cmpl	%edx, %ecx
	jne	.L6
	leaq	16(%rsp), %rdi
	leaq	64(%rsp), %rsi
	movl	$1, %ebx
	movl	$1, %r11d
	movl	$1, %edx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L33:
	movl	8(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L8
	subl	$1, %ebp
	movl	%ebp, 8(%rdi)
.L8:
	movl	8(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L9
	subl	$1, %ebp
	movl	%ebp, 8(%rsi)
.L9:
	leal	2(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	12(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L11
	subl	$1, %ebp
	movl	%ebp, 12(%rdi)
.L11:
	movl	12(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L12
	subl	$1, %ebp
	movl	%ebp, 12(%rsi)
.L12:
	leal	3(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	16(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L13
	subl	$1, %ebp
	movl	%ebp, 16(%rdi)
.L13:
	movl	16(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L14
	subl	$1, %ebp
	movl	%ebp, 16(%rsi)
.L14:
	leal	4(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	20(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L15
	subl	$1, %ebp
	movl	%ebp, 20(%rdi)
.L15:
	movl	20(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L16
	subl	$1, %ebp
	movl	%ebp, 20(%rsi)
.L16:
	leal	5(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	24(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L17
	subl	$1, %ebp
	movl	%ebp, 24(%rdi)
.L17:
	movl	24(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L18
	subl	$1, %ebp
	movl	%ebp, 24(%rsi)
.L18:
	leal	6(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	28(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L19
	subl	$1, %ebp
	movl	%ebp, 28(%rdi)
.L19:
	movl	28(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L20
	subl	$1, %ebp
	movl	%ebp, 28(%rsi)
.L20:
	leal	7(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	32(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L21
	subl	$1, %ebp
	movl	%ebp, 32(%rdi)
.L21:
	movl	32(%rsi), %r9d
	cmpl	%r9d, %r8d
	jge	.L10
	subl	$1, %r9d
	movl	%r9d, 32(%rsi)
.L10:
	movl	%ecx, %r8d
	addq	$4, %rdi
	addq	$4, %rsi
	subl	%edx, %r8d
	cltd
	idivl	%r8d
	cmpl	%r10d, %ecx
	je	.L5
.L24:
	movl	%r10d, %edx
.L23:
	movl	4(%rdi), %r9d
	leal	-1(%r9), %r8d
	imull	%eax, %r8d
	addl	%r8d, %r11d
	movl	4(%rsi), %r8d
	leal	-1(%r8), %r10d
	imull	%eax, %r10d
	addl	%r10d, %ebx
	leal	1(%rdx), %r10d
	cmpl	%r10d, %ecx
	jge	.L33
	movl	%ecx, %r8d
	addq	$4, %rdi
	addq	$4, %rsi
	subl	%edx, %r8d
	cltd
	idivl	%r8d
	jmp	.L24
.L26:
	movl	$1, %ebx
	movl	$1, %r11d
	.p2align 4,,10
	.p2align 3
.L5:
	subl	%ebx, %r11d
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	movl	%r11d, %edx
	negl	%edx
	cmovs	%r11d, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L34:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$112, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 104(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L26
	leaq	20(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jge	.L3
	testl	%eax, %eax
	jle	.L26
	leaq	68(%rsp), %rbp
	movl	$1, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$4, %rbp
	cmpl	%ebx, %ecx
	jge	.L4
	cmpl	$1, %ecx
	jle	.L26
	movl	$1, %eax
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	imull	%edx, %eax
	addl	$1, %edx
	cmpl	%edx, %ecx
	jne	.L6
	leaq	16(%rsp), %rdi
	leaq	64(%rsp), %rsi
	movl	$1, %ebx
	movl	$1, %r11d
	movl	$1, %edx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L33:
	movl	8(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L8
	subl	$1, %ebp
	movl	%ebp, 8(%rdi)
.L8:
	movl	8(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L9
	subl	$1, %ebp
	movl	%ebp, 8(%rsi)
.L9:
	leal	2(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	12(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L11
	subl	$1, %ebp
	movl	%ebp, 12(%rdi)
.L11:
	movl	12(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L12
	subl	$1, %ebp
	movl	%ebp, 12(%rsi)
.L12:
	leal	3(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	16(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L13
	subl	$1, %ebp
	movl	%ebp, 16(%rdi)
.L13:
	movl	16(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L14
	subl	$1, %ebp
	movl	%ebp, 16(%rsi)
.L14:
	leal	4(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	20(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L15
	subl	$1, %ebp
	movl	%ebp, 20(%rdi)
.L15:
	movl	20(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L16
	subl	$1, %ebp
	movl	%ebp, 20(%rsi)
.L16:
	leal	5(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	24(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L17
	subl	$1, %ebp
	movl	%ebp, 24(%rdi)
.L17:
	movl	24(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L18
	subl	$1, %ebp
	movl	%ebp, 24(%rsi)
.L18:
	leal	6(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	28(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L19
	subl	$1, %ebp
	movl	%ebp, 28(%rdi)
.L19:
	movl	28(%rsi), %ebp
	cmpl	%ebp, %r8d
	jge	.L20
	subl	$1, %ebp
	movl	%ebp, 28(%rsi)
.L20:
	leal	7(%rdx), %ebp
	cmpl	%ebp, %ecx
	jl	.L10
	movl	32(%rdi), %ebp
	cmpl	%ebp, %r9d
	jge	.L21
	subl	$1, %ebp
	movl	%ebp, 32(%rdi)
.L21:
	movl	32(%rsi), %r9d
	cmpl	%r9d, %r8d
	jge	.L10
	subl	$1, %r9d
	movl	%r9d, 32(%rsi)
.L10:
	movl	%ecx, %r8d
	addq	$4, %rdi
	addq	$4, %rsi
	subl	%edx, %r8d
	cltd
	idivl	%r8d
	cmpl	%r10d, %ecx
	je	.L5
.L24:
	movl	%r10d, %edx
.L23:
	movl	4(%rdi), %r9d
	leal	-1(%r9), %r8d
	imull	%eax, %r8d
	addl	%r8d, %r11d
	movl	4(%rsi), %r8d
	leal	-1(%r8), %r10d
	imull	%eax, %r10d
	addl	%r10d, %ebx
	leal	1(%rdx), %r10d
	cmpl	%r10d, %ecx
	jge	.L33
	movl	%ecx, %r8d
	addq	$4, %rdi
	addq	$4, %rsi
	subl	%edx, %r8d
	cltd
	idivl	%r8d
	jmp	.L24
.L26:
	movl	$1, %ebx
	movl	$1, %r11d
	.p2align 4,,10
	.p2align 3
.L5:
	subl	%ebx, %r11d
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	movl	%r11d, %edx
	negl	%edx
	cmovs	%r11d, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L34:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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>

int main()
{
	int i, N, P[9], Q[9];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(P[i]));
	for (i = 1; i <= N; i++) scanf("%d", &(Q[i]));
	
	int j, p = 1, q = 1, fact = 1;
	for (i = 1; i <= N - 1; i++) fact *= i;
	for (i = 1; i <= N - 1; i++) {
		p += (P[i] - 1) * fact;
		q += (Q[i] - 1) * fact;
		for (j = i + 1; j <= N; j++) {
			if (P[j] > P[i]) P[j]--;
			if (Q[j] > Q[i]) Q[j]--;
		}
		fact /= N - i;
	}
	
	printf("%d\n", abs(p - q));
	fflush(stdout);
	return 0;
}
3
1 3 2
3 1 2

3

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>

int main()
{
	int i, N, P[9], Q[9];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(P[i]));
	for (i = 1; i <= N; i++) scanf("%d", &(Q[i]));
	
	int j, p = 1, q = 1, fact = 1;
	for (i = 1; i <= N - 1; i++) fact *= i;
	for (i = 1; i <= N - 1; i++) {
		p += (P[i] - 1) * fact;
		q += (Q[i] - 1) * fact;
		for (j = i + 1; j <= N; j++) {
			if (P[j] > P[i]) P[j]--;
			if (Q[j] > Q[i]) Q[j]--;
		}
		fact /= N - i;
	}
	
	printf("%d\n", abs(p - q));
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.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
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -116(%rbp)
	jmp	.L2
.L3:
	leaq	-96(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -116(%rbp)
.L2:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jle	.L3
	movl	$1, -116(%rbp)
	jmp	.L4
.L5:
	leaq	-48(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -116(%rbp)
.L4:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jle	.L5
	movl	$1, -108(%rbp)
	movl	$1, -104(%rbp)
	movl	$1, -100(%rbp)
	movl	$1, -116(%rbp)
	jmp	.L6
.L7:
	movl	-100(%rbp), %eax
	imull	-116(%rbp), %eax
	movl	%eax, -100(%rbp)
	addl	$1, -116(%rbp)
.L6:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L7
	movl	$1, -116(%rbp)
	jmp	.L8
.L13:
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	subl	$1, %eax
	imull	-100(%rbp), %eax
	addl	%eax, -108(%rbp)
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	subl	$1, %eax
	imull	-100(%rbp), %eax
	addl	%eax, -104(%rbp)
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L9
.L12:
	movl	-112(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	-112(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-112(%rbp), %eax
	cltq
	movl	%edx, -96(%rbp,%rax,4)
.L10:
	movl	-112(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-112(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-112(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
.L11:
	addl	$1, -112(%rbp)
.L9:
	movl	-120(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jle	.L12
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %ecx
	movl	-100(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, -100(%rbp)
	addl	$1, -116(%rbp)
.L8:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L13
	movl	-108(%rbp), %eax
	subl	-104(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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"
.LC1:
	.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
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -116(%rbp)
	jmp	.L2
.L3:
	leaq	-96(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -116(%rbp)
.L2:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jle	.L3
	movl	$1, -116(%rbp)
	jmp	.L4
.L5:
	leaq	-48(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -116(%rbp)
.L4:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jle	.L5
	movl	$1, -108(%rbp)
	movl	$1, -104(%rbp)
	movl	$1, -100(%rbp)
	movl	$1, -116(%rbp)
	jmp	.L6
.L7:
	movl	-100(%rbp), %eax
	imull	-116(%rbp), %eax
	movl	%eax, -100(%rbp)
	addl	$1, -116(%rbp)
.L6:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L7
	movl	$1, -116(%rbp)
	jmp	.L8
.L13:
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	subl	$1, %eax
	imull	-100(%rbp), %eax
	addl	%eax, -108(%rbp)
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	subl	$1, %eax
	imull	-100(%rbp), %eax
	addl	%eax, -104(%rbp)
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -112(%rbp)
	jmp	.L9
.L12:
	movl	-112(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	-112(%rbp), %eax
	cltq
	movl	-96(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-112(%rbp), %eax
	cltq
	movl	%edx, -96(%rbp,%rax,4)
.L10:
	movl	-112(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-112(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	leal	-1(%rax), %edx
	movl	-112(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
.L11:
	addl	$1, -112(%rbp)
.L9:
	movl	-120(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jle	.L12
	movl	-120(%rbp), %eax
	subl	-116(%rbp), %eax
	movl	%eax, %ecx
	movl	-100(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, -100(%rbp)
	addl	$1, -116(%rbp)
.L8:
	movl	-120(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L13
	movl	-108(%rbp), %eax
	subl	-104(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
