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>
#include<math.h>

int main(){
  long long q,h,s,d;
  scanf("%lld%lld%lld%lld",&q,&h,&s,&d);
  long long n;
  scanf("%lld",&n);
  long long min1=0;
  if(4*q<=2*h&&4*q<=s){
    min1=4*q;
  }
  else if(2*h<=4*q&&2*h<=s){
    min1=2*h;
  }
  else{
    min1=s;
  }

  if(n%2==0){
    if(2*min1<=d){
      printf("%lld\n",n*min1);
    }
    else{
      printf("%lld\n",d*n/2);
    }
  }
  else{
    if(2*min1<=d){
      printf("%lld\n",min1*n);
    }
    else{
      printf("%lld\n",min1+d*(n-1)/2);
    }
  }
  
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld%lld%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	24(%rsp), %r8
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rax
	leaq	0(,%rax,4), %rcx
	movq	8(%rsp), %rax
	addq	%rax, %rax
	cmpq	%rax, %rcx
	jle	.L13
	movq	%rax, %rcx
.L13:
	cmpq	16(%rsp), %rcx
	jg	.L16
.L3:
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	leaq	(%rcx,%rcx), %rax
	testb	$1, %dl
	jne	.L5
	cmpq	%rax, %rsi
	jl	.L6
.L14:
	imulq	%rcx, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	movq	16(%rsp), %rcx
	jmp	.L3
.L5:
	cmpq	%rax, %rsi
	jge	.L14
	leaq	-1(%rdx), %rax
	movl	$1, %edi
	imulq	%rsi, %rax
	movl	$2, %esi
	cqto
	idivq	%rsi
	leaq	.LC2(%rip), %rsi
	leaq	(%rax,%rcx), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L6:
	movq	%rdx, %rax
	movl	$2, %ecx
	movl	$1, %edi
	imulq	%rsi, %rax
	leaq	.LC2(%rip), %rsi
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L17:
	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:
```

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	"%lld%lld%lld%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	24(%rsp), %r8
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rax
	leaq	0(,%rax,4), %rcx
	movq	8(%rsp), %rax
	addq	%rax, %rax
	cmpq	%rax, %rcx
	jle	.L13
	movq	%rax, %rcx
.L13:
	cmpq	16(%rsp), %rcx
	jg	.L16
.L3:
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	leaq	(%rcx,%rcx), %rax
	testb	$1, %dl
	jne	.L5
	cmpq	%rax, %rsi
	jl	.L6
.L14:
	imulq	%rcx, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	movq	16(%rsp), %rcx
	jmp	.L3
.L5:
	cmpq	%rax, %rsi
	jge	.L14
	leaq	-1(%rdx), %rax
	movl	$1, %edi
	imulq	%rsi, %rax
	movl	$2, %esi
	cqto
	idivq	%rsi
	leaq	.LC2(%rip), %rsi
	leaq	(%rax,%rcx), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L6:
	movq	%rdx, %rax
	movl	$2, %ecx
	movl	$1, %edi
	imulq	%rsi, %rax
	leaq	.LC2(%rip), %rsi
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L17:
	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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld%lld%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	24(%rsp), %r8
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rax
	leaq	0(,%rax,4), %rcx
	movq	8(%rsp), %rax
	addq	%rax, %rax
	cmpq	%rax, %rcx
	jle	.L13
	movq	%rax, %rcx
.L13:
	cmpq	16(%rsp), %rcx
	jg	.L16
.L3:
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	leaq	(%rcx,%rcx), %rax
	testb	$1, %dl
	jne	.L5
	cmpq	%rax, %rsi
	jl	.L6
.L14:
	imulq	%rcx, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	movq	16(%rsp), %rcx
	jmp	.L3
.L5:
	cmpq	%rax, %rsi
	jge	.L14
	leaq	-1(%rdx), %rax
	movl	$1, %edi
	imulq	%rsi, %rax
	movl	$2, %esi
	cqto
	idivq	%rsi
	leaq	.LC2(%rip), %rsi
	leaq	(%rax,%rcx), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L6:
	movq	%rdx, %rax
	movl	$2, %ecx
	movl	$1, %edi
	imulq	%rsi, %rax
	leaq	.LC2(%rip), %rsi
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L17:
	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:
```
```c
#include<stdio.h>
#include<math.h>

int main(){
  long long q,h,s,d;
  scanf("%lld%lld%lld%lld",&q,&h,&s,&d);
  long long n;
  scanf("%lld",&n);
  long long min1=0;
  if(4*q<=2*h&&4*q<=s){
    min1=4*q;
  }
  else if(2*h<=4*q&&2*h<=s){
    min1=2*h;
  }
  else{
    min1=s;
  }

  if(n%2==0){
    if(2*min1<=d){
      printf("%lld\n",n*min1);
    }
    else{
      printf("%lld\n",d*n/2);
    }
  }
  else{
    if(2*min1<=d){
      printf("%lld\n",min1*n);
    }
    else{
      printf("%lld\n",min1+d*(n-1)/2);
    }
  }
  
  return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<math.h>

int main(){
  long long q,h,s,d;
  scanf("%lld%lld%lld%lld",&q,&h,&s,&d);
  long long n;
  scanf("%lld",&n);
  long long min1=0;
  if(4*q<=2*h&&4*q<=s){
    min1=4*q;
  }
  else if(2*h<=4*q&&2*h<=s){
    min1=2*h;
  }
  else{
    min1=s;
  }

  if(n%2==0){
    if(2*min1<=d){
      printf("%lld\n",n*min1);
    }
    else{
      printf("%lld\n",d*n/2);
    }
  }
  else{
    if(2*min1<=d){
      printf("%lld\n",min1*n);
    }
    else{
      printf("%lld\n",min1+d*(n-1)/2);
    }
  }
  
  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:

10 100 1010 10000
1
 20 30 70 129
3
 10000 1001 100 10
1
 12345678 87654321 12345678 87654321
226515686
 20 30 70 83
3
 10000 1001 100 10
0
 12345678 87654321 12873114 87654321
226515686
 20 30 70 63
3
 10000 1001 100 10
-1
 1103255 87654321 12873114 87654321
226515686

40
 180
 100
 2796489721305108
 143
 0
 2915962248666204
 123
 90
 999618252631720

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>
#include<math.h>

int main(){
  long long q,h,s,d;
  scanf("%lld%lld%lld%lld",&q,&h,&s,&d);
  long long n;
  scanf("%lld",&n);
  long long min1=0;
  if(4*q<=2*h&&4*q<=s){
    min1=4*q;
  }
  else if(2*h<=4*q&&2*h<=s){
    min1=2*h;
  }
  else{
    min1=s;
  }

  if(n%2==0){
    if(2*min1<=d){
      printf("%lld\n",n*min1);
    }
    else{
      printf("%lld\n",d*n/2);
    }
  }
  else{
    if(2*min1<=d){
      printf("%lld\n",min1*n);
    }
    else{
      printf("%lld\n",min1+d*(n-1)/2);
    }
  }
  
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld%lld%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	24(%rsp), %r8
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rax
	leaq	0(,%rax,4), %rcx
	movq	8(%rsp), %rax
	addq	%rax, %rax
	cmpq	%rax, %rcx
	jle	.L13
	movq	%rax, %rcx
.L13:
	cmpq	16(%rsp), %rcx
	jg	.L16
.L3:
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	leaq	(%rcx,%rcx), %rax
	testb	$1, %dl
	jne	.L5
	cmpq	%rax, %rsi
	jl	.L6
.L14:
	imulq	%rcx, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	movq	16(%rsp), %rcx
	jmp	.L3
.L5:
	cmpq	%rax, %rsi
	jge	.L14
	leaq	-1(%rdx), %rax
	movl	$1, %edi
	imulq	%rsi, %rax
	movl	$2, %esi
	cqto
	idivq	%rsi
	leaq	.LC2(%rip), %rsi
	leaq	(%rax,%rcx), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L6:
	movq	%rdx, %rax
	movl	$2, %ecx
	movl	$1, %edi
	imulq	%rsi, %rax
	leaq	.LC2(%rip), %rsi
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L17:
	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:
```

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	"%lld%lld%lld%lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$56, %rsp
	.cfi_def_cfa_offset 64
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	24(%rsp), %r8
	call	__isoc99_scanf@PLT
	leaq	32(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rax
	leaq	0(,%rax,4), %rcx
	movq	8(%rsp), %rax
	addq	%rax, %rax
	cmpq	%rax, %rcx
	jle	.L13
	movq	%rax, %rcx
.L13:
	cmpq	16(%rsp), %rcx
	jg	.L16
.L3:
	movq	32(%rsp), %rdx
	movq	24(%rsp), %rsi
	leaq	(%rcx,%rcx), %rax
	testb	$1, %dl
	jne	.L5
	cmpq	%rax, %rsi
	jl	.L6
.L14:
	imulq	%rcx, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	movq	16(%rsp), %rcx
	jmp	.L3
.L5:
	cmpq	%rax, %rsi
	jge	.L14
	leaq	-1(%rdx), %rax
	movl	$1, %edi
	imulq	%rsi, %rax
	movl	$2, %esi
	cqto
	idivq	%rsi
	leaq	.LC2(%rip), %rsi
	leaq	(%rax,%rcx), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L6:
	movq	%rdx, %rax
	movl	$2, %ecx
	movl	$1, %edi
	imulq	%rsi, %rax
	leaq	.LC2(%rip), %rsi
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L17:
	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:
```