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>

const int nMax = 367;

int main() {
  int n, x[nMax], y[nMax], b[nMax], p[nMax];
  int i, ans, normalTicket, setTicket;

  scanf("%d", &n);
  for(i=0; i<n; i++) {
    scanf("%d", &x[i]);
    scanf("%d", &y[i]);
    scanf("%d", &b[i]);
    scanf("%d", &p[i]);
  }

  for(i=0; i<n; i++) {
    if(b[i]>=5 && p[i]>=2) { // 割引条件に適合したものを買うならば一発で計算できる
      ans = (x[i]*b[i]+y[i]*p[i])*0.8;
    }
    else {
      normalTicket = x[i]*b[i]+y[i]*p[i]; // 単純に毎数分だけ買った値
 
     if(b[i]<5) {
	b[i] = 5;
      }
      if(p[i]<2) {
	p[i] = 2;
      }
      setTicket = (x[i]*b[i]+y[i]*p[i])*0.8;

      if(normalTicket < setTicket) {
	ans = normalTicket;
      }
      else {
	ans = setTicket;
      }
    }
    printf("%d\n", ans);
  }
return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	nMax
	.section	.rodata
	.align 4
	.type	nMax, @object
	.size	nMax, 4
nMax:
	.long	367
.LC0:
	.string	"%d"
.LC2:
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$144, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, %rcx
	movl	$0, %ebx
	movl	$367, %eax
	cltq
	movq	%rax, %rsi
	movl	$0, %edi
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, %r14
	movl	$0, %r15d
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -56(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, %r10
	movl	$0, %r11d
	movl	$367, %eax
	cltq
	movq	%rax, %r8
	movl	$0, %r9d
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -120(%rbp)
	jmp	.L14
.L15:
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -120(%rbp)
.L14:
	movl	-124(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L15
	movl	$0, -120(%rbp)
	jmp	.L16
.L22:
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$4, %eax
	jle	.L17
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jle	.L17
	movq	-96(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%ecx, %esi
	imull	%eax, %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	imull	%ecx, %eax
	addl	%esi, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC1(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -116(%rbp)
	jmp	.L18
.L17:
	movq	-96(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%ecx, %esi
	imull	%eax, %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	imull	%ecx, %eax
	addl	%esi, %eax
	movl	%eax, -112(%rbp)
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$4, %eax
	jg	.L19
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$5, (%rax,%rdx,4)
.L19:
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jg	.L20
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$2, (%rax,%rdx,4)
.L20:
	movq	-96(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%ecx, %esi
	imull	%eax, %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	imull	%ecx, %eax
	addl	%esi, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC1(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -108(%rbp)
	movl	-112(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jge	.L21
	movl	-112(%rbp), %eax
	movl	%eax, -116(%rbp)
	jmp	.L18
.L21:
	movl	-108(%rbp), %eax
	movl	%eax, -116(%rbp)
.L18:
	movl	-116(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -120(%rbp)
.L16:
	movl	-124(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L22
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.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"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	movq	%rsp, %rax
	cmpq	%rax, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rax, %rsp
	jne	.L28
.L3:
	subq	$1472, %rsp
	orq	$0, 1464(%rsp)
	movq	%rsp, -96(%rbp)
	movq	%rsp, %rax
.L5:
	cmpq	%rax, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	subq	$1472, %rsp
	orq	$0, 1464(%rsp)
	movq	%rsp, -104(%rbp)
	movq	%rsp, %rax
.L8:
	cmpq	%rax, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	subq	$1472, %rsp
	orq	$0, 1464(%rsp)
	movq	%rsp, %r15
	movq	%rsp, %rax
.L11:
	cmpq	%rax, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	subq	$1472, %rsp
	orq	$0, 1464(%rsp)
	leaq	.LC0(%rip), %rbx
	xorl	%eax, %eax
	movq	%rbx, %rdi
	leaq	-60(%rbp), %rsi
	movq	%rsp, -88(%rbp)
	call	__isoc99_scanf@PLT
	cmpl	$0, -60(%rbp)
	jle	.L16
	movq	-96(%rbp), %rcx
	movq	-104(%rbp), %r14
	movq	%r15, %r13
	xorl	%edx, %edx
	movq	-88(%rbp), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rcx, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	%edx, -76(%rbp)
	movq	%rcx, -72(%rbp)
	call	__isoc99_scanf@PLT
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %edx
	movq	-72(%rbp), %rcx
	addq	$4, %r14
	movl	-60(%rbp), %eax
	addq	$4, %r13
	addq	$4, %r12
	addl	$1, %edx
	addq	$4, %rcx
	cmpl	%edx, %eax
	jg	.L15
	testl	%eax, %eax
	jle	.L16
	xorl	%r12d, %r12d
	leaq	.LC2(%rip), %rbx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	$1, %edx
	jle	.L18
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%r8d, %xmm0
	mulsd	.LC1(%rip), %xmm0
	cvttsd2sil	%xmm0, %edx
.L19:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r12
	call	__printf_chk@PLT
	cmpl	%r12d, -60(%rbp)
	jle	.L16
.L20:
	movq	-104(%rbp), %rdi
	movq	-96(%rbp), %rax
	movq	-88(%rbp), %rdx
	movl	(%r15,%r12,4), %esi
	movl	(%rdi,%r12,4), %r9d
	movl	(%rax,%r12,4), %ecx
	movl	(%rdx,%r12,4), %edx
	movl	%esi, %eax
	movl	%r9d, %edi
	imull	%ecx, %eax
	imull	%edx, %edi
	leal	(%rax,%rdi), %r8d
	cmpl	$4, %esi
	jg	.L29
	movl	$5, (%r15,%r12,4)
	leal	(%rcx,%rcx,4), %eax
	cmpl	$1, %edx
	jle	.L18
.L21:
	addl	%edi, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC1(%rip), %xmm0
	cvttsd2sil	%xmm0, %edx
	cmpl	%r8d, %edx
	cmovg	%r8d, %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L18:
	movq	-88(%rbp), %rcx
	leal	(%r9,%r9), %edi
	movl	$2, (%rcx,%r12,4)
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L16:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	nMax
	.section	.rodata
	.align 4
	.type	nMax, @object
	.size	nMax, 4
nMax:
	.long	367
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.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"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	movq	%rsp, %rax
	cmpq	%rax, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rax, %rsp
	jne	.L28
.L3:
	subq	$1472, %rsp
	orq	$0, 1464(%rsp)
	movq	%rsp, -96(%rbp)
	movq	%rsp, %rax
.L5:
	cmpq	%rax, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	subq	$1472, %rsp
	orq	$0, 1464(%rsp)
	movq	%rsp, -104(%rbp)
	movq	%rsp, %rax
.L8:
	cmpq	%rax, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	subq	$1472, %rsp
	orq	$0, 1464(%rsp)
	movq	%rsp, %r15
	movq	%rsp, %rax
.L11:
	cmpq	%rax, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	subq	$1472, %rsp
	orq	$0, 1464(%rsp)
	leaq	.LC0(%rip), %rbx
	xorl	%eax, %eax
	movq	%rbx, %rdi
	leaq	-60(%rbp), %rsi
	movq	%rsp, -88(%rbp)
	call	__isoc99_scanf@PLT
	cmpl	$0, -60(%rbp)
	jle	.L16
	movq	-96(%rbp), %rcx
	movq	-104(%rbp), %r14
	movq	%r15, %r13
	xorl	%edx, %edx
	movq	-88(%rbp), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rcx, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	%edx, -76(%rbp)
	movq	%rcx, -72(%rbp)
	call	__isoc99_scanf@PLT
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %edx
	movq	-72(%rbp), %rcx
	addq	$4, %r14
	movl	-60(%rbp), %eax
	addq	$4, %r13
	addq	$4, %r12
	addl	$1, %edx
	addq	$4, %rcx
	cmpl	%edx, %eax
	jg	.L15
	testl	%eax, %eax
	jle	.L16
	xorl	%r12d, %r12d
	leaq	.LC2(%rip), %rbx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	$1, %edx
	jle	.L18
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%r8d, %xmm0
	mulsd	.LC1(%rip), %xmm0
	cvttsd2sil	%xmm0, %edx
.L19:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r12
	call	__printf_chk@PLT
	cmpl	%r12d, -60(%rbp)
	jle	.L16
.L20:
	movq	-104(%rbp), %rdi
	movq	-96(%rbp), %rax
	movq	-88(%rbp), %rdx
	movl	(%r15,%r12,4), %esi
	movl	(%rdi,%r12,4), %r9d
	movl	(%rax,%r12,4), %ecx
	movl	(%rdx,%r12,4), %edx
	movl	%esi, %eax
	movl	%r9d, %edi
	imull	%ecx, %eax
	imull	%edx, %edi
	leal	(%rax,%rdi), %r8d
	cmpl	$4, %esi
	jg	.L29
	movl	$5, (%r15,%r12,4)
	leal	(%rcx,%rcx,4), %eax
	cmpl	$1, %edx
	jle	.L18
.L21:
	addl	%edi, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	.LC1(%rip), %xmm0
	cvttsd2sil	%xmm0, %edx
	cmpl	%r8d, %edx
	cmovg	%r8d, %edx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L18:
	movq	-88(%rbp), %rcx
	leal	(%r9,%r9), %edi
	movl	$2, (%rcx,%r12,4)
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L16:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	nMax
	.section	.rodata
	.align 4
	.type	nMax, @object
	.size	nMax, 4
nMax:
	.long	367
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.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>

const int nMax = 367;

int main() {
  int n, x[nMax], y[nMax], b[nMax], p[nMax];
  int i, ans, normalTicket, setTicket;

  scanf("%d", &n);
  for(i=0; i<n; i++) {
    scanf("%d", &x[i]);
    scanf("%d", &y[i]);
    scanf("%d", &b[i]);
    scanf("%d", &p[i]);
  }

  for(i=0; i<n; i++) {
    if(b[i]>=5 && p[i]>=2) { // 割引条件に適合したものを買うならば一発で計算できる
      ans = (x[i]*b[i]+y[i]*p[i])*0.8;
    }
    else {
      normalTicket = x[i]*b[i]+y[i]*p[i]; // 単純に毎数分だけ買った値
 
     if(b[i]<5) {
	b[i] = 5;
      }
      if(p[i]<2) {
	p[i] = 2;
      }
      setTicket = (x[i]*b[i]+y[i]*p[i])*0.8;

      if(normalTicket < setTicket) {
	ans = normalTicket;
      }
      else {
	ans = setTicket;
      }
    }
    printf("%d\n", ans);
  }
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>

const int nMax = 367;

int main() {
  int n, x[nMax], y[nMax], b[nMax], p[nMax];
  int i, ans, normalTicket, setTicket;

  scanf("%d", &n);
  for(i=0; i<n; i++) {
    scanf("%d", &x[i]);
    scanf("%d", &y[i]);
    scanf("%d", &b[i]);
    scanf("%d", &p[i]);
  }

  for(i=0; i<n; i++) {
    if(b[i]>=5 && p[i]>=2) { // 割引条件に適合したものを買うならば一発で計算できる
      ans = (x[i]*b[i]+y[i]*p[i])*0.8;
    }
    else {
      normalTicket = x[i]*b[i]+y[i]*p[i]; // 単純に毎数分だけ買った値
 
     if(b[i]<5) {
	b[i] = 5;
      }
      if(p[i]<2) {
	p[i] = 2;
      }
      setTicket = (x[i]*b[i]+y[i]*p[i])*0.8;

      if(normalTicket < setTicket) {
	ans = normalTicket;
      }
      else {
	ans = setTicket;
      }
    }
    printf("%d\n", ans);
  }
return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	nMax
	.section	.rodata
	.align 4
	.type	nMax, @object
	.size	nMax, 4
nMax:
	.long	367
.LC0:
	.string	"%d"
.LC2:
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$144, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, %rcx
	movl	$0, %ebx
	movl	$367, %eax
	cltq
	movq	%rax, %rsi
	movl	$0, %edi
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, %r14
	movl	$0, %r15d
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -56(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, %r10
	movl	$0, %r11d
	movl	$367, %eax
	cltq
	movq	%rax, %r8
	movl	$0, %r9d
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -120(%rbp)
	jmp	.L14
.L15:
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -120(%rbp)
.L14:
	movl	-124(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L15
	movl	$0, -120(%rbp)
	jmp	.L16
.L22:
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$4, %eax
	jle	.L17
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jle	.L17
	movq	-96(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%ecx, %esi
	imull	%eax, %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	imull	%ecx, %eax
	addl	%esi, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC1(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -116(%rbp)
	jmp	.L18
.L17:
	movq	-96(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%ecx, %esi
	imull	%eax, %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	imull	%ecx, %eax
	addl	%esi, %eax
	movl	%eax, -112(%rbp)
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$4, %eax
	jg	.L19
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$5, (%rax,%rdx,4)
.L19:
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jg	.L20
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$2, (%rax,%rdx,4)
.L20:
	movq	-96(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%ecx, %esi
	imull	%eax, %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	imull	%ecx, %eax
	addl	%esi, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC1(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -108(%rbp)
	movl	-112(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jge	.L21
	movl	-112(%rbp), %eax
	movl	%eax, -116(%rbp)
	jmp	.L18
.L21:
	movl	-108(%rbp), %eax
	movl	%eax, -116(%rbp)
.L18:
	movl	-116(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -120(%rbp)
.L16:
	movl	-124(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L22
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.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
	.globl	nMax
	.section	.rodata
	.align 4
	.type	nMax, @object
	.size	nMax, 4
nMax:
	.long	367
.LC0:
	.string	"%d"
.LC2:
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$144, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, %rcx
	movl	$0, %ebx
	movl	$367, %eax
	cltq
	movq	%rax, %rsi
	movl	$0, %edi
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L2:
	cmpq	%rcx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L4
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, %r14
	movl	$0, %r15d
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$367, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -56(%rbp)
	movl	$367, %eax
	cltq
	movq	%rax, %r10
	movl	$0, %r11d
	movl	$367, %eax
	cltq
	movq	%rax, %r8
	movl	$0, %r9d
	movl	$367, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -120(%rbp)
	jmp	.L14
.L15:
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -120(%rbp)
.L14:
	movl	-124(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L15
	movl	$0, -120(%rbp)
	jmp	.L16
.L22:
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$4, %eax
	jle	.L17
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jle	.L17
	movq	-96(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%ecx, %esi
	imull	%eax, %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	imull	%ecx, %eax
	addl	%esi, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC1(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -116(%rbp)
	jmp	.L18
.L17:
	movq	-96(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%ecx, %esi
	imull	%eax, %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	imull	%ecx, %eax
	addl	%esi, %eax
	movl	%eax, -112(%rbp)
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$4, %eax
	jg	.L19
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$5, (%rax,%rdx,4)
.L19:
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jg	.L20
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	$2, (%rax,%rdx,4)
.L20:
	movq	-96(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%ecx, %esi
	imull	%eax, %esi
	movq	-80(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-48(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	imull	%ecx, %eax
	addl	%esi, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movsd	.LC1(%rip), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -108(%rbp)
	movl	-112(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jge	.L21
	movl	-112(%rbp), %eax
	movl	%eax, -116(%rbp)
	jmp	.L18
.L21:
	movl	-108(%rbp), %eax
	movl	%eax, -116(%rbp)
.L18:
	movl	-116(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -120(%rbp)
.L16:
	movl	-124(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L22
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.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:
