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

```c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef long long int lli;



int main(void){
	int n;
	int i;
	int j;
	lli t;
	lli p,q;
	lli x;
	lli *a;
	lli **d;
	lli ans=0;
	scanf("%d%lld",&n,&x);
	a = calloc(sizeof(lli),n);
	d = calloc(sizeof(lli*),n);
	for(i = 0;i < n;i++){
		d[i] = calloc(sizeof(lli),n);
		scanf("%lld",&a[i]);
		ans += d[i][0] = a[i];
	}
	for(i = 1;i < n;i++){
		t = i*x;
		for(j = 0;j < n;j++){
			p = a[(j-i+n)%n];
			q = d[j][i-1];
			t += d[j][i] = p<q?p:q;
		}
		ans = ans<t?ans:t;
	}
	printf("%lld\n", ans);
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$0, -64(%rbp)
	leaq	-80(%rbp), %rdx
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -56(%rbp)
	movl	-92(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -88(%rbp)
	jmp	.L2
.L3:
	movl	-92(%rbp), %eax
	cltq
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, (%rbx)
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	(%rdx), %rdx
	movq	%rdx, (%rax)
	movq	(%rax), %rax
	addq	%rax, -64(%rbp)
	addl	$1, -88(%rbp)
.L2:
	movl	-92(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L3
	movl	$1, -88(%rbp)
	jmp	.L4
.L7:
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	movq	-80(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -72(%rbp)
	movl	$0, -84(%rbp)
	jmp	.L5
.L6:
	movl	-84(%rbp), %eax
	subl	-88(%rbp), %eax
	movl	%eax, %edx
	movl	-92(%rbp), %eax
	addl	%edx, %eax
	movl	-92(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movl	-84(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	subq	$8, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	-84(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rcx
	movq	-40(%rbp), %rdx
	cmpq	%rdx, %rcx
	cmovle	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	(%rax), %rax
	addq	%rax, -72(%rbp)
	addl	$1, -84(%rbp)
.L5:
	movl	-92(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jl	.L6
	movq	-64(%rbp), %rdx
	movq	-72(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, -64(%rbp)
	addl	$1, -88(%rbp)
.L4:
	movl	-92(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L7
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rsi
	movl	$8, %edi
	movq	%rsi, %rbx
	movq	%rsi, 8(%rsp)
	call	calloc@PLT
	movq	8(%rsp), %rsi
	movl	$8, %edi
	movq	%rax, %r12
	call	calloc@PLT
	testl	%ebx, %ebx
	jle	.L7
	movq	8(%rsp), %rsi
	movq	%rax, %rbp
	movq	%r12, %r15
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%ebx, %rsi
.L3:
	movl	$8, %edi
	call	calloc@PLT
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	addq	$8, %r15
	movq	%rax, 0(%rbp,%r14,8)
	movq	%rax, %rbx
	xorl	%eax, %eax
	addq	$1, %r14
	call	__isoc99_scanf@PLT
	movq	-8(%r15), %rax
	movq	%rax, (%rbx)
	movl	28(%rsp), %ebx
	addq	%rax, %r13
	cmpl	%r14d, %ebx
	jg	.L14
	cmpl	$1, %ebx
	jle	.L2
	movq	32(%rsp), %r15
	leal	-1(%rbx), %r9d
	xorl	%r8d, %r8d
	movl	%ebx, %r11d
	movq	%r15, %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r8, %r10
	movq	%r14, %rdi
	addq	$8, %r8
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L4:
	leal	(%r9,%rcx), %eax
	movq	0(%rbp,%rcx,8), %rsi
	cltd
	idivl	%ebx
	movslq	%edx, %rdx
	movq	(%r12,%rdx,8), %rax
	movq	(%rsi,%r10), %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	addq	$1, %rcx
	movq	%rax, (%rsi,%r8)
	addq	%rax, %rdi
	cmpq	%rcx, %r11
	jne	.L4
	cmpq	%rdi, %r13
	cmovg	%rdi, %r13
	addq	%r15, %r14
	subl	$1, %r9d
	jne	.L5
.L2:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	xorl	%r13d, %r13d
	jmp	.L2
.L15:
	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%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rsi
	movl	$8, %edi
	movq	%rsi, %rbx
	movq	%rsi, 8(%rsp)
	call	calloc@PLT
	movq	8(%rsp), %rsi
	movl	$8, %edi
	movq	%rax, %r12
	call	calloc@PLT
	testl	%ebx, %ebx
	jle	.L7
	movq	8(%rsp), %rsi
	movq	%rax, %rbp
	movq	%r12, %r15
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	movslq	%ebx, %rsi
.L3:
	movl	$8, %edi
	call	calloc@PLT
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	addq	$8, %r15
	movq	%rax, 0(%rbp,%r14,8)
	movq	%rax, %rbx
	xorl	%eax, %eax
	addq	$1, %r14
	call	__isoc99_scanf@PLT
	movq	-8(%r15), %rax
	movq	%rax, (%rbx)
	movl	28(%rsp), %ebx
	addq	%rax, %r13
	cmpl	%r14d, %ebx
	jg	.L14
	cmpl	$1, %ebx
	jle	.L2
	movq	32(%rsp), %r15
	leal	-1(%rbx), %r9d
	xorl	%r8d, %r8d
	movl	%ebx, %r11d
	movq	%r15, %r14
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r8, %r10
	movq	%r14, %rdi
	addq	$8, %r8
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L4:
	leal	(%r9,%rcx), %eax
	movq	0(%rbp,%rcx,8), %rsi
	cltd
	idivl	%ebx
	movslq	%edx, %rdx
	movq	(%r12,%rdx,8), %rax
	movq	(%rsi,%r10), %rdx
	cmpq	%rdx, %rax
	cmovg	%rdx, %rax
	addq	$1, %rcx
	movq	%rax, (%rsi,%r8)
	addq	%rax, %rdi
	cmpq	%rcx, %r11
	jne	.L4
	cmpq	%rdi, %r13
	cmovg	%rdi, %r13
	addq	%r15, %r14
	subl	$1, %r9d
	jne	.L5
.L2:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	xorl	%r13d, %r13d
	jmp	.L2
.L15:
	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>
#include <math.h>
typedef long long int lli;



int main(void){
	int n;
	int i;
	int j;
	lli t;
	lli p,q;
	lli x;
	lli *a;
	lli **d;
	lli ans=0;
	scanf("%d%lld",&n,&x);
	a = calloc(sizeof(lli),n);
	d = calloc(sizeof(lli*),n);
	for(i = 0;i < n;i++){
		d[i] = calloc(sizeof(lli),n);
		scanf("%lld",&a[i]);
		ans += d[i][0] = a[i];
	}
	for(i = 1;i < n;i++){
		t = i*x;
		for(j = 0;j < n;j++){
			p = a[(j-i+n)%n];
			q = d[j][i-1];
			t += d[j][i] = p<q?p:q;
		}
		ans = ans<t?ans:t;
	}
	printf("%lld\n", ans);
	
	return 0;
}
4 10
1 1 3 4
 2 10
1 101
 3 12
100 1 100
 3 12
000 1 100
 3 12
010 1 100
 3 12
011 1 100
 3 18
011 1 100
 3 18
011 2 100
 3 35
011 2 100
 3 35
011 4 100

9
 12
 27
 13
 24
 25
 31
 33
 50
 54

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

```c
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef long long int lli;



int main(void){
	int n;
	int i;
	int j;
	lli t;
	lli p,q;
	lli x;
	lli *a;
	lli **d;
	lli ans=0;
	scanf("%d%lld",&n,&x);
	a = calloc(sizeof(lli),n);
	d = calloc(sizeof(lli*),n);
	for(i = 0;i < n;i++){
		d[i] = calloc(sizeof(lli),n);
		scanf("%lld",&a[i]);
		ans += d[i][0] = a[i];
	}
	for(i = 1;i < n;i++){
		t = i*x;
		for(j = 0;j < n;j++){
			p = a[(j-i+n)%n];
			q = d[j][i-1];
			t += d[j][i] = p<q?p:q;
		}
		ans = ans<t?ans:t;
	}
	printf("%lld\n", ans);
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$0, -64(%rbp)
	leaq	-80(%rbp), %rdx
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -56(%rbp)
	movl	-92(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -88(%rbp)
	jmp	.L2
.L3:
	movl	-92(%rbp), %eax
	cltq
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, (%rbx)
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	(%rdx), %rdx
	movq	%rdx, (%rax)
	movq	(%rax), %rax
	addq	%rax, -64(%rbp)
	addl	$1, -88(%rbp)
.L2:
	movl	-92(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L3
	movl	$1, -88(%rbp)
	jmp	.L4
.L7:
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	movq	-80(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -72(%rbp)
	movl	$0, -84(%rbp)
	jmp	.L5
.L6:
	movl	-84(%rbp), %eax
	subl	-88(%rbp), %eax
	movl	%eax, %edx
	movl	-92(%rbp), %eax
	addl	%edx, %eax
	movl	-92(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movl	-84(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	subq	$8, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	-84(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rcx
	movq	-40(%rbp), %rdx
	cmpq	%rdx, %rcx
	cmovle	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	(%rax), %rax
	addq	%rax, -72(%rbp)
	addl	$1, -84(%rbp)
.L5:
	movl	-92(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jl	.L6
	movq	-64(%rbp), %rdx
	movq	-72(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, -64(%rbp)
	addl	$1, -88(%rbp)
.L4:
	movl	-92(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L7
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	$0, -64(%rbp)
	leaq	-80(%rbp), %rdx
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -56(%rbp)
	movl	-92(%rbp), %eax
	cltq
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, -48(%rbp)
	movl	$0, -88(%rbp)
	jmp	.L2
.L3:
	movl	-92(%rbp), %eax
	cltq
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rsi
	movl	$8, %edi
	call	calloc@PLT
	movq	%rax, (%rbx)
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movq	(%rdx), %rdx
	movq	%rdx, (%rax)
	movq	(%rax), %rax
	addq	%rax, -64(%rbp)
	addl	$1, -88(%rbp)
.L2:
	movl	-92(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L3
	movl	$1, -88(%rbp)
	jmp	.L4
.L7:
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	movq	-80(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -72(%rbp)
	movl	$0, -84(%rbp)
	jmp	.L5
.L6:
	movl	-84(%rbp), %eax
	subl	-88(%rbp), %eax
	movl	%eax, %edx
	movl	-92(%rbp), %eax
	addl	%edx, %eax
	movl	-92(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movl	-84(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	subq	$8, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movl	-84(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-88(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rcx
	movq	-40(%rbp), %rdx
	cmpq	%rdx, %rcx
	cmovle	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	(%rax), %rax
	addq	%rax, -72(%rbp)
	addl	$1, -84(%rbp)
.L5:
	movl	-92(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jl	.L6
	movq	-64(%rbp), %rdx
	movq	-72(%rbp), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, -64(%rbp)
	addl	$1, -88(%rbp)
.L4:
	movl	-92(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L7
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
