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>
#define min(X, Y) ((X) < (Y) ? (X) : (Y))

typedef long long ll;

ll main()
{
	ll q, h, s, d;
	ll n;
	ll two = 1e9;
	ll one = 1e9;

	scanf("%lld %lld %lld %lld", &q, &h, &s, &d);
	scanf("%lld", &n);

	two = min(d, min(s * 2, min(h * 4, q * 8)));
	one = min(s, min(h * 2, q * 4));

	printf("%lld\n", (n / 2 * two) + (n % 2 * one));

	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
	movq	8(%rsp), %rsi
	movq	16(%rsp), %r8
	movq	32(%rsp), %rcx
	leaq	0(,%rsi,4), %rdi
	leaq	0(,%rax,8), %rdx
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	movq	24(%rsp), %rdi
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	leaq	(%r8,%r8), %rdi
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	movq	%rcx, %rdi
	addq	%rsi, %rsi
	salq	$2, %rax
	shrq	$63, %rdi
	addq	%rcx, %rdi
	sarq	%rdi
	imulq	%rdi, %rdx
	cmpq	%rsi, %rax
	movl	$1, %edi
	cmovg	%rsi, %rax
	movq	%rcx, %rsi
	cmpq	%r8, %rax
	cmovg	%r8, %rax
	shrq	$63, %rsi
	addq	%rsi, %rcx
	andl	$1, %ecx
	subq	%rsi, %rcx
	leaq	.LC2(%rip), %rsi
	imulq	%rcx, %rax
	addq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.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:
```

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
	movq	8(%rsp), %rsi
	movq	16(%rsp), %r8
	movq	32(%rsp), %rcx
	leaq	0(,%rsi,4), %rdi
	leaq	0(,%rax,8), %rdx
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	movq	24(%rsp), %rdi
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	leaq	(%r8,%r8), %rdi
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	movq	%rcx, %rdi
	addq	%rsi, %rsi
	salq	$2, %rax
	shrq	$63, %rdi
	addq	%rcx, %rdi
	sarq	%rdi
	imulq	%rdi, %rdx
	cmpq	%rsi, %rax
	movl	$1, %edi
	cmovg	%rsi, %rax
	movq	%rcx, %rsi
	cmpq	%r8, %rax
	cmovg	%r8, %rax
	shrq	$63, %rsi
	addq	%rsi, %rcx
	andl	$1, %ecx
	subq	%rsi, %rcx
	leaq	.LC2(%rip), %rsi
	imulq	%rcx, %rax
	addq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.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
```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
	movq	8(%rsp), %rsi
	movq	16(%rsp), %r8
	movq	32(%rsp), %rcx
	leaq	0(,%rsi,4), %rdi
	leaq	0(,%rax,8), %rdx
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	movq	24(%rsp), %rdi
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	leaq	(%r8,%r8), %rdi
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	movq	%rcx, %rdi
	addq	%rsi, %rsi
	salq	$2, %rax
	shrq	$63, %rdi
	addq	%rcx, %rdi
	sarq	%rdi
	imulq	%rdi, %rdx
	cmpq	%rsi, %rax
	movl	$1, %edi
	cmovg	%rsi, %rax
	movq	%rcx, %rsi
	cmpq	%r8, %rax
	cmovg	%r8, %rax
	shrq	$63, %rsi
	addq	%rsi, %rcx
	andl	$1, %ecx
	subq	%rsi, %rcx
	leaq	.LC2(%rip), %rsi
	imulq	%rcx, %rax
	addq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.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:
```
```c
#include <stdio.h>
#define min(X, Y) ((X) < (Y) ? (X) : (Y))

typedef long long ll;

ll main()
{
	ll q, h, s, d;
	ll n;
	ll two = 1e9;
	ll one = 1e9;

	scanf("%lld %lld %lld %lld", &q, &h, &s, &d);
	scanf("%lld", &n);

	two = min(d, min(s * 2, min(h * 4, q * 8)));
	one = min(s, min(h * 2, q * 4));

	printf("%lld\n", (n / 2 * two) + (n % 2 * one));

	return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#define min(X, Y) ((X) < (Y) ? (X) : (Y))

typedef long long ll;

ll main()
{
	ll q, h, s, d;
	ll n;
	ll two = 1e9;
	ll one = 1e9;

	scanf("%lld %lld %lld %lld", &q, &h, &s, &d);
	scanf("%lld", &n);

	two = min(d, min(s * 2, min(h * 4, q * 8)));
	one = min(s, min(h * 2, q * 4));

	printf("%lld\n", (n / 2 * two) + (n % 2 * one));

	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
 -100
 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>
#define min(X, Y) ((X) < (Y) ? (X) : (Y))

typedef long long ll;

ll main()
{
	ll q, h, s, d;
	ll n;
	ll two = 1e9;
	ll one = 1e9;

	scanf("%lld %lld %lld %lld", &q, &h, &s, &d);
	scanf("%lld", &n);

	two = min(d, min(s * 2, min(h * 4, q * 8)));
	one = min(s, min(h * 2, q * 4));

	printf("%lld\n", (n / 2 * two) + (n % 2 * one));

	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
	movq	8(%rsp), %rsi
	movq	16(%rsp), %r8
	movq	32(%rsp), %rcx
	leaq	0(,%rsi,4), %rdi
	leaq	0(,%rax,8), %rdx
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	movq	24(%rsp), %rdi
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	leaq	(%r8,%r8), %rdi
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	movq	%rcx, %rdi
	addq	%rsi, %rsi
	salq	$2, %rax
	shrq	$63, %rdi
	addq	%rcx, %rdi
	sarq	%rdi
	imulq	%rdi, %rdx
	cmpq	%rsi, %rax
	movl	$1, %edi
	cmovg	%rsi, %rax
	movq	%rcx, %rsi
	cmpq	%r8, %rax
	cmovg	%r8, %rax
	shrq	$63, %rsi
	addq	%rsi, %rcx
	andl	$1, %ecx
	subq	%rsi, %rcx
	leaq	.LC2(%rip), %rsi
	imulq	%rcx, %rax
	addq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.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:
```

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
	movq	8(%rsp), %rsi
	movq	16(%rsp), %r8
	movq	32(%rsp), %rcx
	leaq	0(,%rsi,4), %rdi
	leaq	0(,%rax,8), %rdx
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	movq	24(%rsp), %rdi
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	leaq	(%r8,%r8), %rdi
	cmpq	%rdi, %rdx
	cmovg	%rdi, %rdx
	movq	%rcx, %rdi
	addq	%rsi, %rsi
	salq	$2, %rax
	shrq	$63, %rdi
	addq	%rcx, %rdi
	sarq	%rdi
	imulq	%rdi, %rdx
	cmpq	%rsi, %rax
	movl	$1, %edi
	cmovg	%rsi, %rax
	movq	%rcx, %rsi
	cmpq	%r8, %rax
	cmovg	%r8, %rax
	shrq	$63, %rsi
	addq	%rsi, %rcx
	andl	$1, %ecx
	subq	%rsi, %rcx
	leaq	.LC2(%rip), %rsi
	imulq	%rcx, %rax
	addq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	xorl	%eax, %eax
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.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:
```