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

```c
#include <stdio.h>

int main(){
	int n, x, y, b, p, i, j, m[366], a;
	scanf("%d", &n);
	for(i = 0; i < n; i++){
		scanf("%d %d %d %d", &x, &y, &b, &p);
		a =  x * b + y * p;
		if(b >= 5 && p >= 2){
			m[i] = a * 0.8;
		} else if(b < 5 && p >= 2){
			m[i] = (x * 5 + y * p) * 0.8;
			if(m[i] > a){
				m[i] = a;
			}
		} else if(b >= 5 && p < 2){
			m[i] = (x * b + y * 2) * 0.8;
			if(m[i] > a){
				m[i] = a;
			}
		} else {
			m[i] = a;
		}
	}
	for(i = 0; i < n; i++){
		printf("%d\n", m[i]);
	}
	return 0;
}```

Assembly Code:

```assembly
	.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	$1528, %rsp
	.cfi_def_cfa_offset 1584
	movq	%fs:40, %rax
	movq	%rax, 1512(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	48(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	44(%rsp), %r8
	movq	%rbp, %r12
	leaq	40(%rsp), %r15
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	$1, %edx
	jle	.L6
	leal	(%rcx,%rcx,4), %eax
	addl	%esi, %eax
.L20:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	cmpl	%edi, %eax
	jg	.L6
	movl	%eax, (%r12)
.L5:
	movl	28(%rsp), %eax
	addl	$1, %ebx
	addq	$4, %r12
	cmpl	%ebx, %eax
	jle	.L22
.L10:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movq	%r8, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %ecx
	movl	36(%rsp), %r11d
	movl	40(%rsp), %eax
	movl	44(%rsp), %edx
	movl	%ecx, %r10d
	movl	%r11d, %esi
	movq	8(%rsp), %r8
	imull	%eax, %r10d
	imull	%edx, %esi
	cmpl	$4, %eax
	leal	(%r10,%rsi), %edi
	jle	.L3
	cmpl	$1, %edx
	jle	.L4
	pxor	%xmm0, %xmm0
	addl	$1, %ebx
	addq	$4, %r12
	cvtsi2sdl	%edi, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%r12)
	movl	28(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L10
.L22:
	testl	%eax, %eax
	jle	.L11
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 28(%rsp)
	jg	.L12
.L11:
	movq	1512(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$1528, %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
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	movl	%edi, (%r12)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leal	(%r10,%r11,2), %eax
	jmp	.L20
.L23:
	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:
```

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.
Optimized Assembly Code:

user
```assembly
	.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	$1528, %rsp
	.cfi_def_cfa_offset 1584
	movq	%fs:40, %rax
	movq	%rax, 1512(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	48(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	44(%rsp), %r8
	movq	%rbp, %r12
	leaq	40(%rsp), %r15
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	$1, %edx
	jle	.L6
	leal	(%rcx,%rcx,4), %eax
	addl	%esi, %eax
.L20:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	cmpl	%edi, %eax
	jg	.L6
	movl	%eax, (%r12)
.L5:
	movl	28(%rsp), %eax
	addl	$1, %ebx
	addq	$4, %r12
	cmpl	%ebx, %eax
	jle	.L22
.L10:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movq	%r8, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %ecx
	movl	36(%rsp), %r11d
	movl	40(%rsp), %eax
	movl	44(%rsp), %edx
	movl	%ecx, %r10d
	movl	%r11d, %esi
	movq	8(%rsp), %r8
	imull	%eax, %r10d
	imull	%edx, %esi
	cmpl	$4, %eax
	leal	(%r10,%rsi), %edi
	jle	.L3
	cmpl	$1, %edx
	jle	.L4
	pxor	%xmm0, %xmm0
	addl	$1, %ebx
	addq	$4, %r12
	cvtsi2sdl	%edi, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%r12)
	movl	28(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L10
.L22:
	testl	%eax, %eax
	jle	.L11
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 28(%rsp)
	jg	.L12
.L11:
	movq	1512(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$1528, %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
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	movl	%edi, (%r12)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leal	(%r10,%r11,2), %eax
	jmp	.L20
.L23:
	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
```assembly
	.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	$1528, %rsp
	.cfi_def_cfa_offset 1584
	movq	%fs:40, %rax
	movq	%rax, 1512(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	48(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	44(%rsp), %r8
	movq	%rbp, %r12
	leaq	40(%rsp), %r15
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	$1, %edx
	jle	.L6
	leal	(%rcx,%rcx,4), %eax
	addl	%esi, %eax
.L20:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	cmpl	%edi, %eax
	jg	.L6
	movl	%eax, (%r12)
.L5:
	movl	28(%rsp), %eax
	addl	$1, %ebx
	addq	$4, %r12
	cmpl	%ebx, %eax
	jle	.L22
.L10:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movq	%r8, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %ecx
	movl	36(%rsp), %r11d
	movl	40(%rsp), %eax
	movl	44(%rsp), %edx
	movl	%ecx, %r10d
	movl	%r11d, %esi
	movq	8(%rsp), %r8
	imull	%eax, %r10d
	imull	%edx, %esi
	cmpl	$4, %eax
	leal	(%r10,%rsi), %edi
	jle	.L3
	cmpl	$1, %edx
	jle	.L4
	pxor	%xmm0, %xmm0
	addl	$1, %ebx
	addq	$4, %r12
	cvtsi2sdl	%edi, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%r12)
	movl	28(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L10
.L22:
	testl	%eax, %eax
	jle	.L11
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 28(%rsp)
	jg	.L12
.L11:
	movq	1512(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$1528, %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
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	movl	%edi, (%r12)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leal	(%r10,%r11,2), %eax
	jmp	.L20
.L23:
	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:
```
```c
#include <stdio.h>

int main(){
	int n, x, y, b, p, i, j, m[366], a;
	scanf("%d", &n);
	for(i = 0; i < n; i++){
		scanf("%d %d %d %d", &x, &y, &b, &p);
		a =  x * b + y * p;
		if(b >= 5 && p >= 2){
			m[i] = a * 0.8;
		} else if(b < 5 && p >= 2){
			m[i] = (x * 5 + y * p) * 0.8;
			if(m[i] > a){
				m[i] = a;
			}
		} else if(b >= 5 && p < 2){
			m[i] = (x * b + y * 2) * 0.8;
			if(m[i] > a){
				m[i] = a;
			}
		} else {
			m[i] = a;
		}
	}
	for(i = 0; i < n; i++){
		printf("%d\n", m[i]);
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(){
	int n, x, y, b, p, i, j, m[366], a;
	scanf("%d", &n);
	for(i = 0; i < n; i++){
		scanf("%d %d %d %d", &x, &y, &b, &p);
		a =  x * b + y * p;
		if(b >= 5 && p >= 2){
			m[i] = a * 0.8;
		} else if(b < 5 && p >= 2){
			m[i] = (x * 5 + y * p) * 0.8;
			if(m[i] > a){
				m[i] = a;
			}
		} else if(b >= 5 && p < 2){
			m[i] = (x * b + y * 2) * 0.8;
			if(m[i] > a){
				m[i] = a;
			}
		} else {
			m[i] = a;
		}
	}
	for(i = 0; i < n; i++){
		printf("%d\n", m[i]);
	}
	return 0;
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(){
	int n, x, y, b, p, i, j, m[366], a;
	scanf("%d", &n);
	for(i = 0; i < n; i++){
		scanf("%d %d %d %d", &x, &y, &b, &p);
		a =  x * b + y * p;
		if(b >= 5 && p >= 2){
			m[i] = a * 0.8;
		} else if(b < 5 && p >= 2){
			m[i] = (x * 5 + y * p) * 0.8;
			if(m[i] > a){
				m[i] = a;
			}
		} else if(b >= 5 && p < 2){
			m[i] = (x * b + y * 2) * 0.8;
			if(m[i] > a){
				m[i] = a;
			}
		} else {
			m[i] = a;
		}
	}
	for(i = 0; i < n; i++){
		printf("%d\n", m[i]);
	}
	return 0;
}```

Assembly Code:

```assembly
	.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	$1528, %rsp
	.cfi_def_cfa_offset 1584
	movq	%fs:40, %rax
	movq	%rax, 1512(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	48(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	44(%rsp), %r8
	movq	%rbp, %r12
	leaq	40(%rsp), %r15
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	$1, %edx
	jle	.L6
	leal	(%rcx,%rcx,4), %eax
	addl	%esi, %eax
.L20:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	cmpl	%edi, %eax
	jg	.L6
	movl	%eax, (%r12)
.L5:
	movl	28(%rsp), %eax
	addl	$1, %ebx
	addq	$4, %r12
	cmpl	%ebx, %eax
	jle	.L22
.L10:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movq	%r8, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %ecx
	movl	36(%rsp), %r11d
	movl	40(%rsp), %eax
	movl	44(%rsp), %edx
	movl	%ecx, %r10d
	movl	%r11d, %esi
	movq	8(%rsp), %r8
	imull	%eax, %r10d
	imull	%edx, %esi
	cmpl	$4, %eax
	leal	(%r10,%rsi), %edi
	jle	.L3
	cmpl	$1, %edx
	jle	.L4
	pxor	%xmm0, %xmm0
	addl	$1, %ebx
	addq	$4, %r12
	cvtsi2sdl	%edi, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%r12)
	movl	28(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L10
.L22:
	testl	%eax, %eax
	jle	.L11
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 28(%rsp)
	jg	.L12
.L11:
	movq	1512(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$1528, %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
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	movl	%edi, (%r12)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leal	(%r10,%r11,2), %eax
	jmp	.L20
.L23:
	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:
```

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.
Optimized Assembly Code:

train
```assembly
	.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	$1528, %rsp
	.cfi_def_cfa_offset 1584
	movq	%fs:40, %rax
	movq	%rax, 1512(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	leaq	48(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	44(%rsp), %r8
	movq	%rbp, %r12
	leaq	40(%rsp), %r15
	leaq	36(%rsp), %r14
	leaq	32(%rsp), %r13
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	$1, %edx
	jle	.L6
	leal	(%rcx,%rcx,4), %eax
	addl	%esi, %eax
.L20:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	cmpl	%edi, %eax
	jg	.L6
	movl	%eax, (%r12)
.L5:
	movl	28(%rsp), %eax
	addl	$1, %ebx
	addq	$4, %r12
	cmpl	%ebx, %eax
	jle	.L22
.L10:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movq	%r8, 8(%rsp)
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %ecx
	movl	36(%rsp), %r11d
	movl	40(%rsp), %eax
	movl	44(%rsp), %edx
	movl	%ecx, %r10d
	movl	%r11d, %esi
	movq	8(%rsp), %r8
	imull	%eax, %r10d
	imull	%edx, %esi
	cmpl	$4, %eax
	leal	(%r10,%rsi), %edi
	jle	.L3
	cmpl	$1, %edx
	jle	.L4
	pxor	%xmm0, %xmm0
	addl	$1, %ebx
	addq	$4, %r12
	cvtsi2sdl	%edi, %xmm0
	mulsd	.LC2(%rip), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%r12)
	movl	28(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L10
.L22:
	testl	%eax, %eax
	jle	.L11
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movl	0(%rbp,%rbx,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 28(%rsp)
	jg	.L12
.L11:
	movq	1512(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$1528, %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
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	movl	%edi, (%r12)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leal	(%r10,%r11,2), %eax
	jmp	.L20
.L23:
	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:
```