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,x,y,b,p,sum,i,sum1,sum2=0;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%d %d %d %d",&x,&y,&b,&p); 
    if(b>=5&&p>=2){
      sum = ((x*b+y*p)*8)/10;
    }else{
      
      sum1 = x*b+y*p;
      sum = sum1;
      if(sum1>((x*5+y*2)*8)/10){
	b = b-5;
	p = p-2;
	if(b<0){
	  b=0;
	}
	if(p<0){
	  p=0;
	}
	sum2 = ((x*b+y*p)*8)/10+((x*5+y*2)*8)/10;
      
    
       if(sum1>sum2){
	sum = sum2;
      }else{
	sum = sum1;
       }
      }
    }
    printf("%d\n",sum);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L8:
	leaq	-28(%rbp), %rsi
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	cmpl	$4, %eax
	jle	.L3
	movl	-28(%rbp), %eax
	cmpl	$1, %eax
	jle	.L3
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -24(%rbp)
	jmp	.L4
.L3:
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-40(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%eax, -12(%rbp)
	jle	.L4
	movl	-32(%rbp), %eax
	subl	$5, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jns	.L5
	movl	$0, -32(%rbp)
.L5:
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jns	.L6
	movl	$0, -28(%rbp)
.L6:
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-40(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L7
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L4
.L7:
	movl	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
.L4:
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -20(%rbp)
.L2:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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 %d"
.LC2:
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	xorl	%ebx, %ebx
	leaq	20(%rsp), %r15
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r13
	leaq	8(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	$1, %r11d
	jle	.L4
	imull	8(%rsp), %eax
	imull	12(%rsp), %r11d
	addl	%r11d, %eax
	sall	$3, %eax
	movslq	%eax, %r8
	sarl	$31, %eax
	imulq	$1717986919, %r8, %r8
	sarq	$34, %r8
	subl	%eax, %r8d
.L5:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	addl	$1, %ebx
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	%ebx, 4(%rsp)
	jle	.L10
.L2:
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	movl	20(%rsp), %r11d
	cmpl	$4, %eax
	jg	.L17
.L4:
	movl	8(%rsp), %edx
	movl	12(%rsp), %edi
	movl	%eax, %esi
	movl	%edi, %r9d
	imull	%edx, %esi
	leal	(%rdx,%rdx,4), %r10d
	addl	%edi, %edi
	imull	%r11d, %r9d
	leal	(%r10,%rdi), %edx
	sall	$3, %edx
	movslq	%edx, %rcx
	sarl	$31, %edx
	imulq	$1717986919, %rcx, %rcx
	leal	(%rsi,%r9), %r8d
	sarq	$34, %rcx
	subl	%edx, %ecx
	cmpl	%r8d, %ecx
	jge	.L5
	leal	-5(%rax), %edx
	subl	$2, %r11d
	movl	%edx, 16(%rsp)
	movl	%r11d, 20(%rsp)
	testl	%edx, %edx
	js	.L6
	movl	%esi, %eax
	subl	%r10d, %eax
	testl	%r11d, %r11d
	js	.L8
.L18:
	subl	%edi, %r9d
	addl	%r9d, %eax
.L9:
	sall	$3, %eax
	movslq	%eax, %rdx
	sarl	$31, %eax
	imulq	$1717986919, %rdx, %rdx
	sarq	$34, %rdx
	subl	%eax, %edx
	leal	(%rdx,%rcx), %eax
	cmpl	%eax, %r8d
	cmovg	%eax, %r8d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$0, 16(%rsp)
	xorl	%eax, %eax
	testl	%r11d, %r11d
	jns	.L18
.L8:
	movl	$0, 20(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$40, %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
.L19:
	.cfi_restore_state
	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 %d"
.LC2:
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	xorl	%ebx, %ebx
	leaq	20(%rsp), %r15
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %r13
	leaq	8(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	$1, %r11d
	jle	.L4
	imull	8(%rsp), %eax
	imull	12(%rsp), %r11d
	addl	%r11d, %eax
	sall	$3, %eax
	movslq	%eax, %r8
	sarl	$31, %eax
	imulq	$1717986919, %r8, %r8
	sarq	$34, %r8
	subl	%eax, %r8d
.L5:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	addl	$1, %ebx
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	%ebx, 4(%rsp)
	jle	.L10
.L2:
	movq	%r15, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	movl	20(%rsp), %r11d
	cmpl	$4, %eax
	jg	.L17
.L4:
	movl	8(%rsp), %edx
	movl	12(%rsp), %edi
	movl	%eax, %esi
	movl	%edi, %r9d
	imull	%edx, %esi
	leal	(%rdx,%rdx,4), %r10d
	addl	%edi, %edi
	imull	%r11d, %r9d
	leal	(%r10,%rdi), %edx
	sall	$3, %edx
	movslq	%edx, %rcx
	sarl	$31, %edx
	imulq	$1717986919, %rcx, %rcx
	leal	(%rsi,%r9), %r8d
	sarq	$34, %rcx
	subl	%edx, %ecx
	cmpl	%r8d, %ecx
	jge	.L5
	leal	-5(%rax), %edx
	subl	$2, %r11d
	movl	%edx, 16(%rsp)
	movl	%r11d, 20(%rsp)
	testl	%edx, %edx
	js	.L6
	movl	%esi, %eax
	subl	%r10d, %eax
	testl	%r11d, %r11d
	js	.L8
.L18:
	subl	%edi, %r9d
	addl	%r9d, %eax
.L9:
	sall	$3, %eax
	movslq	%eax, %rdx
	sarl	$31, %eax
	imulq	$1717986919, %rdx, %rdx
	sarq	$34, %rdx
	subl	%eax, %edx
	leal	(%rdx,%rcx), %eax
	cmpl	%eax, %r8d
	cmovg	%eax, %r8d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$0, 16(%rsp)
	xorl	%eax, %eax
	testl	%r11d, %r11d
	jns	.L18
.L8:
	movl	$0, 20(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$40, %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
.L19:
	.cfi_restore_state
	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>

int main (void){

  int n,x,y,b,p,sum,i,sum1,sum2=0;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%d %d %d %d",&x,&y,&b,&p); 
    if(b>=5&&p>=2){
      sum = ((x*b+y*p)*8)/10;
    }else{
      
      sum1 = x*b+y*p;
      sum = sum1;
      if(sum1>((x*5+y*2)*8)/10){
	b = b-5;
	p = p-2;
	if(b<0){
	  b=0;
	}
	if(p<0){
	  p=0;
	}
	sum2 = ((x*b+y*p)*8)/10+((x*5+y*2)*8)/10;
      
    
       if(sum1>sum2){
	sum = sum2;
      }else{
	sum = sum1;
       }
      }
    }
    printf("%d\n",sum);
  }
  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,x,y,b,p,sum,i,sum1,sum2=0;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%d %d %d %d",&x,&y,&b,&p); 
    if(b>=5&&p>=2){
      sum = ((x*b+y*p)*8)/10;
    }else{
      
      sum1 = x*b+y*p;
      sum = sum1;
      if(sum1>((x*5+y*2)*8)/10){
	b = b-5;
	p = p-2;
	if(b<0){
	  b=0;
	}
	if(p<0){
	  p=0;
	}
	sum2 = ((x*b+y*p)*8)/10+((x*5+y*2)*8)/10;
      
    
       if(sum1>sum2){
	sum = sum2;
      }else{
	sum = sum1;
       }
      }
    }
    printf("%d\n",sum);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L8:
	leaq	-28(%rbp), %rsi
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	cmpl	$4, %eax
	jle	.L3
	movl	-28(%rbp), %eax
	cmpl	$1, %eax
	jle	.L3
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -24(%rbp)
	jmp	.L4
.L3:
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-40(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%eax, -12(%rbp)
	jle	.L4
	movl	-32(%rbp), %eax
	subl	$5, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jns	.L5
	movl	$0, -32(%rbp)
.L5:
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jns	.L6
	movl	$0, -28(%rbp)
.L6:
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-40(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L7
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L4
.L7:
	movl	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
.L4:
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -20(%rbp)
.L2:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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 %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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L8:
	leaq	-28(%rbp), %rsi
	leaq	-32(%rbp), %rcx
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	cmpl	$4, %eax
	jle	.L3
	movl	-28(%rbp), %eax
	cmpl	$1, %eax
	jle	.L3
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -24(%rbp)
	jmp	.L4
.L3:
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-40(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%eax, -12(%rbp)
	jle	.L4
	movl	-32(%rbp), %eax
	subl	$5, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jns	.L5
	movl	$0, -32(%rbp)
.L5:
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jns	.L6
	movl	$0, -28(%rbp)
.L6:
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-40(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%eax, %edx
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	sall	$3, %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	addl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L7
	movl	-16(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L4
.L7:
	movl	-12(%rbp), %eax
	movl	%eax, -24(%rbp)
.L4:
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -20(%rbp)
.L2:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
