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>
int main(void)
{
	int n, i, x, y, b, p, s[1000];
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d %d %d %d", &x, &y, &b, &p);
		s[i] = x*b + y*p;
		if (b >= 5 && p >= 2)
			s[i] = s[i] * 0.8;
		if (b < 5) {
			b = 5;
		}
		if (p < 2) {
			p = 2;
		}
		if (s[i]>(x*b + y*p)*0.8)
			s[i] = (x*b + y*p)*0.8;
	}
	for (i = 0; i < n; i++) {
		printf("%d\n", s[i]);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %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	$4048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-4040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4020(%rbp)
	jmp	.L2
.L8:
	leaq	-4024(%rbp), %rsi
	leaq	-4028(%rbp), %rcx
	leaq	-4032(%rbp), %rdx
	leaq	-4036(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-4036(%rbp), %edx
	movl	-4028(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-4032(%rbp), %edx
	movl	-4024(%rbp), %eax
	imull	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-4020(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
	movl	-4028(%rbp), %eax
	cmpl	$4, %eax
	jle	.L3
	movl	-4024(%rbp), %eax
	cmpl	$1, %eax
	jle	.L3
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	movl	-4020(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
.L3:
	movl	-4028(%rbp), %eax
	cmpl	$4, %eax
	jg	.L4
	movl	$5, -4028(%rbp)
.L4:
	movl	-4024(%rbp), %eax
	cmpl	$1, %eax
	jg	.L5
	movl	$2, -4024(%rbp)
.L5:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movl	-4036(%rbp), %edx
	movl	-4028(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-4032(%rbp), %edx
	movl	-4024(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movsd	.LC2(%rip), %xmm1
	mulsd	%xmm2, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L6
	movl	-4036(%rbp), %edx
	movl	-4028(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-4032(%rbp), %edx
	movl	-4024(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	movl	-4020(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
.L6:
	addl	$1, -4020(%rbp)
.L2:
	movl	-4040(%rbp), %eax
	cmpl	%eax, -4020(%rbp)
	jl	.L8
	movl	$0, -4020(%rbp)
	jmp	.L9
.L10:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4020(%rbp)
.L9:
	movl	-4040(%rbp), %eax
	cmpl	%eax, -4020(%rbp)
	jl	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	-1717986918
	.long	1072273817
	.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 %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
	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	$4072, %rsp
	.cfi_def_cfa_offset 4128
	movq	%fs:40, %rax
	movq	%rax, 4056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	48(%rsp), %rbx
	leaq	32(%rsp), %rax
	xorl	%ebp, %ebp
	movq	%rax, 8(%rsp)
	movq	%rbx, %r12
	leaq	44(%rsp), %r15
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L21:
	cmpl	$1, %edx
	jle	.L4
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, (%r12)
.L5:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L17
	cvttsd2sil	%xmm0, %eax
	movl	%eax, (%r12)
.L17:
	movl	28(%rsp), %eax
	addl	$1, %ebp
	addq	$4, %r12
	cmpl	%ebp, %eax
	jle	.L20
.L10:
	movq	8(%rsp), %rsi
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %ecx
	movl	36(%rsp), %r11d
	movl	40(%rsp), %esi
	movl	44(%rsp), %edx
	movl	%ecx, %edi
	movl	%r11d, %r8d
	imull	%esi, %edi
	imull	%edx, %r8d
	leal	(%rdi,%r8), %eax
	movl	%eax, (%r12)
	cmpl	$4, %esi
	jg	.L21
	leal	(%rcx,%rcx,4), %ecx
	movl	$5, 40(%rsp)
	movl	%ecx, %edi
	cmpl	$1, %edx
	jle	.L4
	addl	%ecx, %r8d
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%r8d, %xmm0
	mulsd	.LC2(%rip), %xmm0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leal	(%rdi,%r11,2), %edx
	pxor	%xmm0, %xmm0
	movl	$2, 44(%rsp)
	cvtsi2sdl	%edx, %xmm0
	mulsd	.LC2(%rip), %xmm0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L20:
	testl	%eax, %eax
	jle	.L11
	xorl	%ebp, %ebp
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 28(%rsp)
	jg	.L12
.L11:
	movq	4056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$4072, %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
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	-1717986918
	.long	1072273817
	.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 %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
	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	$4072, %rsp
	.cfi_def_cfa_offset 4128
	movq	%fs:40, %rax
	movq	%rax, 4056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	48(%rsp), %rbx
	leaq	32(%rsp), %rax
	xorl	%ebp, %ebp
	movq	%rax, 8(%rsp)
	movq	%rbx, %r12
	leaq	44(%rsp), %r15
	leaq	40(%rsp), %r14
	leaq	36(%rsp), %r13
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L21:
	cmpl	$1, %edx
	jle	.L4
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, (%r12)
.L5:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	comisd	%xmm0, %xmm1
	jbe	.L17
	cvttsd2sil	%xmm0, %eax
	movl	%eax, (%r12)
.L17:
	movl	28(%rsp), %eax
	addl	$1, %ebp
	addq	$4, %r12
	cmpl	%ebp, %eax
	jle	.L20
.L10:
	movq	8(%rsp), %rsi
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %ecx
	movl	36(%rsp), %r11d
	movl	40(%rsp), %esi
	movl	44(%rsp), %edx
	movl	%ecx, %edi
	movl	%r11d, %r8d
	imull	%esi, %edi
	imull	%edx, %r8d
	leal	(%rdi,%r8), %eax
	movl	%eax, (%r12)
	cmpl	$4, %esi
	jg	.L21
	leal	(%rcx,%rcx,4), %ecx
	movl	$5, 40(%rsp)
	movl	%ecx, %edi
	cmpl	$1, %edx
	jle	.L4
	addl	%ecx, %r8d
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%r8d, %xmm0
	mulsd	.LC2(%rip), %xmm0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leal	(%rdi,%r11,2), %edx
	pxor	%xmm0, %xmm0
	movl	$2, 44(%rsp)
	cvtsi2sdl	%edx, %xmm0
	mulsd	.LC2(%rip), %xmm0
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L20:
	testl	%eax, %eax
	jle	.L11
	xorl	%ebp, %ebp
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 28(%rsp)
	jg	.L12
.L11:
	movq	4056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$4072, %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
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	-1717986918
	.long	1072273817
	.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>
int main(void)
{
	int n, i, x, y, b, p, s[1000];
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d %d %d %d", &x, &y, &b, &p);
		s[i] = x*b + y*p;
		if (b >= 5 && p >= 2)
			s[i] = s[i] * 0.8;
		if (b < 5) {
			b = 5;
		}
		if (p < 2) {
			p = 2;
		}
		if (s[i]>(x*b + y*p)*0.8)
			s[i] = (x*b + y*p)*0.8;
	}
	for (i = 0; i < n; i++) {
		printf("%d\n", s[i]);
	}
	return 0;
}
2
100 000 1 1
1000 500 5 2
 2
100 000 1 1
1010 500 5 2
 2
110 000 1 1
1010 500 5 2
 2
110 000 1 2
1010 500 10 2
 2
110 000 1 2
1010 500 17 2
 2
110 000 2 4
1010 500 17 2
 2
110 000 2 4
0010 500 17 2
 2
110 000 4 8
0010 500 17 2
 2
110 000 4 8
0010 500 33 2
 2
110 100 4 16
0010 500 33 2

100
4800
 100
4840
 110
4840
 110
8880
 110
14536
 220
14536
 220
936
 440
936
 440
1064
 1720
1064

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>
int main(void)
{
	int n, i, x, y, b, p, s[1000];
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d %d %d %d", &x, &y, &b, &p);
		s[i] = x*b + y*p;
		if (b >= 5 && p >= 2)
			s[i] = s[i] * 0.8;
		if (b < 5) {
			b = 5;
		}
		if (p < 2) {
			p = 2;
		}
		if (s[i]>(x*b + y*p)*0.8)
			s[i] = (x*b + y*p)*0.8;
	}
	for (i = 0; i < n; i++) {
		printf("%d\n", s[i]);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %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	$4048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-4040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4020(%rbp)
	jmp	.L2
.L8:
	leaq	-4024(%rbp), %rsi
	leaq	-4028(%rbp), %rcx
	leaq	-4032(%rbp), %rdx
	leaq	-4036(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-4036(%rbp), %edx
	movl	-4028(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-4032(%rbp), %edx
	movl	-4024(%rbp), %eax
	imull	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-4020(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
	movl	-4028(%rbp), %eax
	cmpl	$4, %eax
	jle	.L3
	movl	-4024(%rbp), %eax
	cmpl	$1, %eax
	jle	.L3
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	movl	-4020(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
.L3:
	movl	-4028(%rbp), %eax
	cmpl	$4, %eax
	jg	.L4
	movl	$5, -4028(%rbp)
.L4:
	movl	-4024(%rbp), %eax
	cmpl	$1, %eax
	jg	.L5
	movl	$2, -4024(%rbp)
.L5:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movl	-4036(%rbp), %edx
	movl	-4028(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-4032(%rbp), %edx
	movl	-4024(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movsd	.LC2(%rip), %xmm1
	mulsd	%xmm2, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L6
	movl	-4036(%rbp), %edx
	movl	-4028(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-4032(%rbp), %edx
	movl	-4024(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	movl	-4020(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
.L6:
	addl	$1, -4020(%rbp)
.L2:
	movl	-4040(%rbp), %eax
	cmpl	%eax, -4020(%rbp)
	jl	.L8
	movl	$0, -4020(%rbp)
	jmp	.L9
.L10:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4020(%rbp)
.L9:
	movl	-4040(%rbp), %eax
	cmpl	%eax, -4020(%rbp)
	jl	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	-1717986918
	.long	1072273817
	.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 %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	$4048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-4040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4020(%rbp)
	jmp	.L2
.L8:
	leaq	-4024(%rbp), %rsi
	leaq	-4028(%rbp), %rcx
	leaq	-4032(%rbp), %rdx
	leaq	-4036(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-4036(%rbp), %edx
	movl	-4028(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-4032(%rbp), %edx
	movl	-4024(%rbp), %eax
	imull	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-4020(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
	movl	-4028(%rbp), %eax
	cmpl	$4, %eax
	jle	.L3
	movl	-4024(%rbp), %eax
	cmpl	$1, %eax
	jle	.L3
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	movl	-4020(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
.L3:
	movl	-4028(%rbp), %eax
	cmpl	$4, %eax
	jg	.L4
	movl	$5, -4028(%rbp)
.L4:
	movl	-4024(%rbp), %eax
	cmpl	$1, %eax
	jg	.L5
	movl	$2, -4024(%rbp)
.L5:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movl	-4036(%rbp), %edx
	movl	-4028(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-4032(%rbp), %edx
	movl	-4024(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movsd	.LC2(%rip), %xmm1
	mulsd	%xmm2, %xmm1
	comisd	%xmm1, %xmm0
	jbe	.L6
	movl	-4036(%rbp), %edx
	movl	-4028(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-4032(%rbp), %edx
	movl	-4024(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC2(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	movl	-4020(%rbp), %eax
	cltq
	movl	%edx, -4016(%rbp,%rax,4)
.L6:
	addl	$1, -4020(%rbp)
.L2:
	movl	-4040(%rbp), %eax
	cmpl	%eax, -4020(%rbp)
	jl	.L8
	movl	$0, -4020(%rbp)
	jmp	.L9
.L10:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4020(%rbp)
.L9:
	movl	-4040(%rbp), %eax
	cmpl	%eax, -4020(%rbp)
	jl	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	-1717986918
	.long	1072273817
	.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:
