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>
#define N 1000
#define EMPTY 2000000000

int main(){
	int n,q,i;
	int a[N];
	int copy[N];
	int b,m,e;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		copy[i]=EMPTY;
	}
	
	scanf("%d",&q);
	for(i=0;i<q;i++){
		scanf("%d %d %d",&b,&m,&e);
		
		for(int j=0;j<(e-b);j++){
			copy[b+((j+(e-m))%(e-b))]=a[b+j];
		}
		
		for(int j=0;j<n;j++){
			if(copy[j]!=EMPTY){
				a[j]=copy[j];
				copy[j]=EMPTY;
			}
		}
		
	}
	
	for(i=0;i<n-1;i++){
		printf("%d ",a[i]);
	}
	printf("%d\n",a[n-1]);
	
	return 0;
	
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d "
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3952, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-8048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8028(%rbp)
	jmp	.L2
.L3:
	leaq	-8016(%rbp), %rdx
	movl	-8028(%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
	movl	-8028(%rbp), %eax
	cltq
	movl	$2000000000, -4016(%rbp,%rax,4)
	addl	$1, -8028(%rbp)
.L2:
	movl	-8048(%rbp), %eax
	cmpl	%eax, -8028(%rbp)
	jl	.L3
	leaq	-8044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8028(%rbp)
	jmp	.L4
.L10:
	leaq	-8032(%rbp), %rcx
	leaq	-8036(%rbp), %rdx
	leaq	-8040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8024(%rbp)
	jmp	.L5
.L6:
	movl	-8040(%rbp), %edx
	movl	-8024(%rbp), %eax
	leal	(%rdx,%rax), %esi
	movl	-8032(%rbp), %eax
	movl	-8036(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-8024(%rbp), %eax
	addl	%ecx, %eax
	movl	-8032(%rbp), %edx
	movl	-8040(%rbp), %edi
	movl	%edx, %ecx
	subl	%edi, %ecx
	cltd
	idivl	%ecx
	movl	-8040(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movslq	%esi, %rax
	movl	-8016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -4016(%rbp,%rax,4)
	addl	$1, -8024(%rbp)
.L5:
	movl	-8032(%rbp), %eax
	movl	-8040(%rbp), %edx
	subl	%edx, %eax
	cmpl	%eax, -8024(%rbp)
	jl	.L6
	movl	$0, -8020(%rbp)
	jmp	.L7
.L9:
	movl	-8020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cmpl	$2000000000, %eax
	je	.L8
	movl	-8020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-8020(%rbp), %eax
	cltq
	movl	%edx, -8016(%rbp,%rax,4)
	movl	-8020(%rbp), %eax
	cltq
	movl	$2000000000, -4016(%rbp,%rax,4)
.L8:
	addl	$1, -8020(%rbp)
.L7:
	movl	-8048(%rbp), %eax
	cmpl	%eax, -8020(%rbp)
	jl	.L9
	addl	$1, -8028(%rbp)
.L4:
	movl	-8044(%rbp), %eax
	cmpl	%eax, -8028(%rbp)
	jl	.L10
	movl	$0, -8028(%rbp)
	jmp	.L11
.L12:
	movl	-8028(%rbp), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8028(%rbp)
.L11:
	movl	-8048(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -8028(%rbp)
	jl	.L12
	movl	-8048(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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 %d %d"
.LC2:
	.string	"%d "
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$3960, %rsp
	.cfi_def_cfa_offset 8112
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 8040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	32(%rsp), %rbp
	leaq	4032(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	movl	$2000000000, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jg	.L5
.L6:
	leaq	16(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L31
	xorl	%r15d, %r15d
	leaq	28(%rsp), %r14
	leaq	24(%rsp), %r13
	leaq	20(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	32(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rcx
	movq	%rbp, %rdi
	movq	%r13, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	movl	20(%rsp), %r8d
	movl	%ecx, %edi
	subl	%r8d, %edi
	testl	%edi, %edi
	jle	.L11
	subl	24(%rsp), %ecx
	movslq	%r8d, %rax
	leaq	(%rbx,%rax,4), %rsi
	leal	(%rdi,%rcx), %r9d
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%ecx, %eax
	addl	$1, %ecx
	addq	$4, %rsi
	cltd
	idivl	%edi
	movl	-4(%rsi), %eax
	addl	%r8d, %edx
	movslq	%edx, %rdx
	movl	%eax, 4032(%rsp,%rdx,4)
	cmpl	%r9d, %ecx
	jne	.L10
.L11:
	movl	12(%rsp), %edi
	testl	%edi, %edi
	jle	.L9
	leal	-1(%rdi), %ecx
	leaq	4032(%rsp), %rax
	movq	%rbx, %rdx
	leaq	4036(%rsp,%rcx,4), %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%rax), %ecx
	cmpl	$2000000000, %ecx
	je	.L13
	movl	%ecx, (%rdx)
	movl	$2000000000, (%rax)
.L13:
	addq	$4, %rax
	addq	$4, %rdx
	cmpq	%rsi, %rax
	jne	.L14
.L9:
	addl	$1, %r15d
	cmpl	%r15d, 16(%rsp)
	jg	.L3
.L12:
	subl	$1, %edi
	testl	%edi, %edi
	jle	.L15
	xorl	%ebx, %ebx
	leaq	32(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%r12,%rbx,4), %edx
	movl	$1, %edi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edi
	cmpl	%ebx, %edi
	jg	.L16
.L15:
	movslq	%edi, %rdi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	32(%rsp,%rdi,4), %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$8056, %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
.L31:
	.cfi_restore_state
	movl	12(%rsp), %edi
	jmp	.L12
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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 %d %d"
.LC2:
	.string	"%d "
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$3960, %rsp
	.cfi_def_cfa_offset 8112
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 8040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	32(%rsp), %rbp
	leaq	4032(%rsp), %r13
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	movl	$2000000000, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jg	.L5
.L6:
	leaq	16(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L31
	xorl	%r15d, %r15d
	leaq	28(%rsp), %r14
	leaq	24(%rsp), %r13
	leaq	20(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	32(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rcx
	movq	%rbp, %rdi
	movq	%r13, %rdx
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	movl	20(%rsp), %r8d
	movl	%ecx, %edi
	subl	%r8d, %edi
	testl	%edi, %edi
	jle	.L11
	subl	24(%rsp), %ecx
	movslq	%r8d, %rax
	leaq	(%rbx,%rax,4), %rsi
	leal	(%rdi,%rcx), %r9d
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%ecx, %eax
	addl	$1, %ecx
	addq	$4, %rsi
	cltd
	idivl	%edi
	movl	-4(%rsi), %eax
	addl	%r8d, %edx
	movslq	%edx, %rdx
	movl	%eax, 4032(%rsp,%rdx,4)
	cmpl	%r9d, %ecx
	jne	.L10
.L11:
	movl	12(%rsp), %edi
	testl	%edi, %edi
	jle	.L9
	leal	-1(%rdi), %ecx
	leaq	4032(%rsp), %rax
	movq	%rbx, %rdx
	leaq	4036(%rsp,%rcx,4), %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%rax), %ecx
	cmpl	$2000000000, %ecx
	je	.L13
	movl	%ecx, (%rdx)
	movl	$2000000000, (%rax)
.L13:
	addq	$4, %rax
	addq	$4, %rdx
	cmpq	%rsi, %rax
	jne	.L14
.L9:
	addl	$1, %r15d
	cmpl	%r15d, 16(%rsp)
	jg	.L3
.L12:
	subl	$1, %edi
	testl	%edi, %edi
	jle	.L15
	xorl	%ebx, %ebx
	leaq	32(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L16:
	movl	(%r12,%rbx,4), %edx
	movl	$1, %edi
	movq	%rbp, %rsi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edi
	cmpl	%ebx, %edi
	jg	.L16
.L15:
	movslq	%edi, %rdi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	32(%rsp,%rdi,4), %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$8056, %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
.L31:
	.cfi_restore_state
	movl	12(%rsp), %edi
	jmp	.L12
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>
#define N 1000
#define EMPTY 2000000000

int main(){
	int n,q,i;
	int a[N];
	int copy[N];
	int b,m,e;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		copy[i]=EMPTY;
	}
	
	scanf("%d",&q);
	for(i=0;i<q;i++){
		scanf("%d %d %d",&b,&m,&e);
		
		for(int j=0;j<(e-b);j++){
			copy[b+((j+(e-m))%(e-b))]=a[b+j];
		}
		
		for(int j=0;j<n;j++){
			if(copy[j]!=EMPTY){
				a[j]=copy[j];
				copy[j]=EMPTY;
			}
		}
		
	}
	
	for(i=0;i<n-1;i++){
		printf("%d ",a[i]);
	}
	printf("%d\n",a[n-1]);
	
	return 0;
	
}

11
1 2 3 4 5 6 7 8 18 10 11
1
2 6 9
 11
1 2 3 4 5 6 7 8 18 10 11
1
4 6 9
 11
1 2 3 4 5 6 7 5 18 10 11
1
4 6 9
 11
1 2 3 4 5 6 7 5 18 10 10
1
4 6 9
 11
1 2 3 4 5 9 7 5 18 10 10
1
4 6 9
 11
2 2 3 4 5 9 7 5 18 10 10
1
4 6 9
 11
2 2 3 4 5 9 7 5 18 10 2
1
4 6 9
 11
2 2 1 4 5 9 7 5 18 10 2
1
4 6 9
 11
2 2 1 4 5 9 7 5 29 10 2
1
4 6 9
 11
2 2 1 4 5 9 7 5 29 10 1
1
4 6 9

1 2 7 8 18 3 4 5 6 10 11
 1 2 3 4 7 8 18 5 6 10 11
 1 2 3 4 7 5 18 5 6 10 11
 1 2 3 4 7 5 18 5 6 10 10
 1 2 3 4 7 5 18 5 9 10 10
 2 2 3 4 7 5 18 5 9 10 10
 2 2 3 4 7 5 18 5 9 10 2
 2 2 1 4 7 5 18 5 9 10 2
 2 2 1 4 7 5 29 5 9 10 2
 2 2 1 4 7 5 29 5 9 10 1

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>
#define N 1000
#define EMPTY 2000000000

int main(){
	int n,q,i;
	int a[N];
	int copy[N];
	int b,m,e;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
		copy[i]=EMPTY;
	}
	
	scanf("%d",&q);
	for(i=0;i<q;i++){
		scanf("%d %d %d",&b,&m,&e);
		
		for(int j=0;j<(e-b);j++){
			copy[b+((j+(e-m))%(e-b))]=a[b+j];
		}
		
		for(int j=0;j<n;j++){
			if(copy[j]!=EMPTY){
				a[j]=copy[j];
				copy[j]=EMPTY;
			}
		}
		
	}
	
	for(i=0;i<n-1;i++){
		printf("%d ",a[i]);
	}
	printf("%d\n",a[n-1]);
	
	return 0;
	
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d "
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3952, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-8048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8028(%rbp)
	jmp	.L2
.L3:
	leaq	-8016(%rbp), %rdx
	movl	-8028(%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
	movl	-8028(%rbp), %eax
	cltq
	movl	$2000000000, -4016(%rbp,%rax,4)
	addl	$1, -8028(%rbp)
.L2:
	movl	-8048(%rbp), %eax
	cmpl	%eax, -8028(%rbp)
	jl	.L3
	leaq	-8044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8028(%rbp)
	jmp	.L4
.L10:
	leaq	-8032(%rbp), %rcx
	leaq	-8036(%rbp), %rdx
	leaq	-8040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8024(%rbp)
	jmp	.L5
.L6:
	movl	-8040(%rbp), %edx
	movl	-8024(%rbp), %eax
	leal	(%rdx,%rax), %esi
	movl	-8032(%rbp), %eax
	movl	-8036(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-8024(%rbp), %eax
	addl	%ecx, %eax
	movl	-8032(%rbp), %edx
	movl	-8040(%rbp), %edi
	movl	%edx, %ecx
	subl	%edi, %ecx
	cltd
	idivl	%ecx
	movl	-8040(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movslq	%esi, %rax
	movl	-8016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -4016(%rbp,%rax,4)
	addl	$1, -8024(%rbp)
.L5:
	movl	-8032(%rbp), %eax
	movl	-8040(%rbp), %edx
	subl	%edx, %eax
	cmpl	%eax, -8024(%rbp)
	jl	.L6
	movl	$0, -8020(%rbp)
	jmp	.L7
.L9:
	movl	-8020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cmpl	$2000000000, %eax
	je	.L8
	movl	-8020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-8020(%rbp), %eax
	cltq
	movl	%edx, -8016(%rbp,%rax,4)
	movl	-8020(%rbp), %eax
	cltq
	movl	$2000000000, -4016(%rbp,%rax,4)
.L8:
	addl	$1, -8020(%rbp)
.L7:
	movl	-8048(%rbp), %eax
	cmpl	%eax, -8020(%rbp)
	jl	.L9
	addl	$1, -8028(%rbp)
.L4:
	movl	-8044(%rbp), %eax
	cmpl	%eax, -8028(%rbp)
	jl	.L10
	movl	$0, -8028(%rbp)
	jmp	.L11
.L12:
	movl	-8028(%rbp), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8028(%rbp)
.L11:
	movl	-8048(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -8028(%rbp)
	jl	.L12
	movl	-8048(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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 %d %d"
.LC2:
	.string	"%d "
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$3952, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-8048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8028(%rbp)
	jmp	.L2
.L3:
	leaq	-8016(%rbp), %rdx
	movl	-8028(%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
	movl	-8028(%rbp), %eax
	cltq
	movl	$2000000000, -4016(%rbp,%rax,4)
	addl	$1, -8028(%rbp)
.L2:
	movl	-8048(%rbp), %eax
	cmpl	%eax, -8028(%rbp)
	jl	.L3
	leaq	-8044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8028(%rbp)
	jmp	.L4
.L10:
	leaq	-8032(%rbp), %rcx
	leaq	-8036(%rbp), %rdx
	leaq	-8040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -8024(%rbp)
	jmp	.L5
.L6:
	movl	-8040(%rbp), %edx
	movl	-8024(%rbp), %eax
	leal	(%rdx,%rax), %esi
	movl	-8032(%rbp), %eax
	movl	-8036(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-8024(%rbp), %eax
	addl	%ecx, %eax
	movl	-8032(%rbp), %edx
	movl	-8040(%rbp), %edi
	movl	%edx, %ecx
	subl	%edi, %ecx
	cltd
	idivl	%ecx
	movl	-8040(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movslq	%esi, %rax
	movl	-8016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -4016(%rbp,%rax,4)
	addl	$1, -8024(%rbp)
.L5:
	movl	-8032(%rbp), %eax
	movl	-8040(%rbp), %edx
	subl	%edx, %eax
	cmpl	%eax, -8024(%rbp)
	jl	.L6
	movl	$0, -8020(%rbp)
	jmp	.L7
.L9:
	movl	-8020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	cmpl	$2000000000, %eax
	je	.L8
	movl	-8020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-8020(%rbp), %eax
	cltq
	movl	%edx, -8016(%rbp,%rax,4)
	movl	-8020(%rbp), %eax
	cltq
	movl	$2000000000, -4016(%rbp,%rax,4)
.L8:
	addl	$1, -8020(%rbp)
.L7:
	movl	-8048(%rbp), %eax
	cmpl	%eax, -8020(%rbp)
	jl	.L9
	addl	$1, -8028(%rbp)
.L4:
	movl	-8044(%rbp), %eax
	cmpl	%eax, -8028(%rbp)
	jl	.L10
	movl	$0, -8028(%rbp)
	jmp	.L11
.L12:
	movl	-8028(%rbp), %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -8028(%rbp)
.L11:
	movl	-8048(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -8028(%rbp)
	jl	.L12
	movl	-8048(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-8016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
