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

int max(int x, int y);


int main()
{
    int a, b, c;
    int x, y;
    int minSum;
    int maxNumberOfAb;

    scanf("%d %d %d %d %d", &a, &b, &c, &x, &y);

    maxNumberOfAb = max(x, y) * 2;
    minSum = a * x + b * y + c * (x + y); // dummy
    for (int i = 0; i <= maxNumberOfAb; i++)
    {
	int needA = x - (int)floor(i / 2);
	int needB = y - (int)floor(i / 2);

	if (needA < 0)
	{
	    needA = 0;
	}
	if (needB < 0)
	{
	    needB = 0;
	}
	
	int sum = a * needA + b * needB + c * i;

	if (sum < minSum)
	{
	    minSum = sum;
	}
    }

    printf("%d\n", minSum);
    
    return 0;
}

int max(int x, int y)
{
    if (x > y)
    {
	return x;
    }
    else
    {
	return y;
    }
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d %d %d"
.LC1:
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	addl	%eax, %eax
	movl	%eax, -16(%rbp)
	movl	-52(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-48(%rbp), %edx
	movl	-36(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, %ecx
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L2
.L6:
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	cvttsd2sil	%xmm0, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	cvttsd2sil	%xmm0, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
	cmpl	$0, -24(%rbp)
	jns	.L3
	movl	$0, -24(%rbp)
.L3:
	cmpl	$0, -20(%rbp)
	jns	.L4
	movl	$0, -20(%rbp)
.L4:
	movl	-52(%rbp), %eax
	imull	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-48(%rbp), %eax
	imull	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	imull	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L5
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
.L5:
	addl	$1, -28(%rbp)
.L2:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L6
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L10
	movl	-4(%rbp), %eax
	jmp	.L11
.L10:
	movl	-8(%rbp), %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.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
.LC1:
	.string	"%d %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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC1(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	leaq	20(%rsp), %r9
	leaq	16(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ecx
	movl	16(%rsp), %esi
	movl	4(%rsp), %r8d
	movl	8(%rsp), %r10d
	cmpl	%esi, %ecx
	movl	%esi, %r9d
	movl	%esi, %edx
	movl	%ecx, %eax
	cmovge	%ecx, %r9d
	imull	%r10d, %eax
	movl	12(%rsp), %edi
	imull	%r8d, %edx
	addl	%eax, %edx
	leal	(%rcx,%rsi), %eax
	imull	%edi, %eax
	addl	%eax, %edx
	addl	%r9d, %r9d
	js	.L2
	leal	1(%r9), %ebp
	cmpl	$2, %r9d
	jle	.L8
	movd	%edx, %xmm5
	movd	%esi, %xmm6
	movd	%ecx, %xmm7
	movl	%ebp, %r11d
	pshufd	$0, %xmm5, %xmm2
	movd	%r8d, %xmm5
	shrl	$2, %r11d
	xorl	%eax, %eax
	pshufd	$0, %xmm6, %xmm13
	pshufd	$0, %xmm7, %xmm12
	movd	%r10d, %xmm6
	movdqa	.LC0(%rip), %xmm3
	pshufd	$0, %xmm5, %xmm7
	movd	%edi, %xmm5
	pshufd	$0, %xmm6, %xmm6
	movdqa	.LC2(%rip), %xmm11
	pshufd	$0, %xmm5, %xmm5
	movdqa	%xmm7, %xmm10
	movdqa	%xmm6, %xmm9
	movdqa	%xmm5, %xmm8
	psrlq	$32, %xmm10
	pxor	%xmm4, %xmm4
	psrlq	$32, %xmm9
	psrlq	$32, %xmm8
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm3, %xmm0
	movdqa	%xmm13, %xmm14
	addl	$1, %eax
	movdqa	%xmm0, %xmm1
	paddd	%xmm11, %xmm3
	psrad	$1, %xmm1
	psubd	%xmm1, %xmm14
	movdqa	%xmm14, %xmm15
	pcmpgtd	%xmm4, %xmm15
	pand	%xmm15, %xmm14
	movdqa	%xmm14, %xmm15
	psrlq	$32, %xmm14
	pmuludq	%xmm7, %xmm15
	pmuludq	%xmm10, %xmm14
	pshufd	$8, %xmm15, %xmm15
	pshufd	$8, %xmm14, %xmm14
	punpckldq	%xmm14, %xmm15
	movdqa	%xmm12, %xmm14
	psubd	%xmm1, %xmm14
	movdqa	%xmm14, %xmm1
	pcmpgtd	%xmm4, %xmm1
	pand	%xmm14, %xmm1
	movdqa	%xmm1, %xmm14
	psrlq	$32, %xmm1
	pmuludq	%xmm6, %xmm14
	pmuludq	%xmm9, %xmm1
	pshufd	$8, %xmm14, %xmm14
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm14
	movdqa	%xmm15, %xmm1
	paddd	%xmm14, %xmm1
	movdqa	%xmm0, %xmm14
	psrlq	$32, %xmm0
	pmuludq	%xmm5, %xmm14
	pmuludq	%xmm8, %xmm0
	pshufd	$8, %xmm14, %xmm14
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm14
	paddd	%xmm14, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm0, %xmm2
	cmpl	%eax, %r11d
	jne	.L4
	movdqa	%xmm2, %xmm1
	movl	%ebp, %ebx
	psrldq	$8, %xmm1
	andl	$-4, %ebx
	andl	$3, %ebp
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %edx
	je	.L2
.L3:
	movl	%ebx, %r12d
	movl	%edi, %r11d
	movl	%esi, %eax
	movl	$0, %ebp
	sarl	%r12d
	imull	%ebx, %r11d
	subl	%r12d, %eax
	cmovs	%ebp, %eax
	movl	%ecx, %ebp
	imull	%r8d, %eax
	subl	%r12d, %ebp
	movl	$0, %r12d
	cmovs	%r12d, %ebp
	imull	%r10d, %ebp
	addl	%ebp, %eax
	addl	%r11d, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	leal	1(%rbx), %eax
	cmpl	%eax, %r9d
	jl	.L2
	sarl	%eax
	addl	%edi, %r11d
	movl	$0, %ebp
	movl	%eax, %r12d
	movl	%esi, %eax
	subl	%r12d, %eax
	cmovs	%ebp, %eax
	movl	%ecx, %ebp
	imull	%r8d, %eax
	subl	%r12d, %ebp
	movl	$0, %r12d
	cmovs	%r12d, %ebp
	imull	%r10d, %ebp
	addl	%ebp, %eax
	addl	%r11d, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	addl	$2, %ebx
	cmpl	%ebx, %r9d
	jl	.L2
	sarl	%ebx
	movl	$0, %eax
	subl	%ebx, %ecx
	cmovs	%eax, %ecx
	imull	%r10d, %ecx
	subl	%ebx, %esi
	cmovs	%eax, %esi
	addl	%r11d, %edi
	imull	%r8d, %esi
	leal	(%rcx,%rsi), %eax
	addl	%edi, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
.L2:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	xorl	%ebx, %ebx
	jmp	.L3
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	max, .-max
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.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
.LC1:
	.string	"%d %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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC1(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	leaq	20(%rsp), %r9
	leaq	16(%rsp), %r8
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ecx
	movl	16(%rsp), %esi
	movl	4(%rsp), %r8d
	movl	8(%rsp), %r10d
	cmpl	%esi, %ecx
	movl	%esi, %r9d
	movl	%esi, %edx
	movl	%ecx, %eax
	cmovge	%ecx, %r9d
	imull	%r10d, %eax
	movl	12(%rsp), %edi
	imull	%r8d, %edx
	addl	%eax, %edx
	leal	(%rcx,%rsi), %eax
	imull	%edi, %eax
	addl	%eax, %edx
	addl	%r9d, %r9d
	js	.L2
	leal	1(%r9), %ebp
	cmpl	$2, %r9d
	jle	.L8
	movd	%edx, %xmm5
	movd	%esi, %xmm6
	movd	%ecx, %xmm7
	movl	%ebp, %r11d
	pshufd	$0, %xmm5, %xmm2
	movd	%r8d, %xmm5
	shrl	$2, %r11d
	xorl	%eax, %eax
	pshufd	$0, %xmm6, %xmm13
	pshufd	$0, %xmm7, %xmm12
	movd	%r10d, %xmm6
	movdqa	.LC0(%rip), %xmm3
	pshufd	$0, %xmm5, %xmm7
	movd	%edi, %xmm5
	pshufd	$0, %xmm6, %xmm6
	movdqa	.LC2(%rip), %xmm11
	pshufd	$0, %xmm5, %xmm5
	movdqa	%xmm7, %xmm10
	movdqa	%xmm6, %xmm9
	movdqa	%xmm5, %xmm8
	psrlq	$32, %xmm10
	pxor	%xmm4, %xmm4
	psrlq	$32, %xmm9
	psrlq	$32, %xmm8
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm3, %xmm0
	movdqa	%xmm13, %xmm14
	addl	$1, %eax
	movdqa	%xmm0, %xmm1
	paddd	%xmm11, %xmm3
	psrad	$1, %xmm1
	psubd	%xmm1, %xmm14
	movdqa	%xmm14, %xmm15
	pcmpgtd	%xmm4, %xmm15
	pand	%xmm15, %xmm14
	movdqa	%xmm14, %xmm15
	psrlq	$32, %xmm14
	pmuludq	%xmm7, %xmm15
	pmuludq	%xmm10, %xmm14
	pshufd	$8, %xmm15, %xmm15
	pshufd	$8, %xmm14, %xmm14
	punpckldq	%xmm14, %xmm15
	movdqa	%xmm12, %xmm14
	psubd	%xmm1, %xmm14
	movdqa	%xmm14, %xmm1
	pcmpgtd	%xmm4, %xmm1
	pand	%xmm14, %xmm1
	movdqa	%xmm1, %xmm14
	psrlq	$32, %xmm1
	pmuludq	%xmm6, %xmm14
	pmuludq	%xmm9, %xmm1
	pshufd	$8, %xmm14, %xmm14
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm14
	movdqa	%xmm15, %xmm1
	paddd	%xmm14, %xmm1
	movdqa	%xmm0, %xmm14
	psrlq	$32, %xmm0
	pmuludq	%xmm5, %xmm14
	pmuludq	%xmm8, %xmm0
	pshufd	$8, %xmm14, %xmm14
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm14
	paddd	%xmm14, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm0, %xmm2
	cmpl	%eax, %r11d
	jne	.L4
	movdqa	%xmm2, %xmm1
	movl	%ebp, %ebx
	psrldq	$8, %xmm1
	andl	$-4, %ebx
	andl	$3, %ebp
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %edx
	je	.L2
.L3:
	movl	%ebx, %r12d
	movl	%edi, %r11d
	movl	%esi, %eax
	movl	$0, %ebp
	sarl	%r12d
	imull	%ebx, %r11d
	subl	%r12d, %eax
	cmovs	%ebp, %eax
	movl	%ecx, %ebp
	imull	%r8d, %eax
	subl	%r12d, %ebp
	movl	$0, %r12d
	cmovs	%r12d, %ebp
	imull	%r10d, %ebp
	addl	%ebp, %eax
	addl	%r11d, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	leal	1(%rbx), %eax
	cmpl	%eax, %r9d
	jl	.L2
	sarl	%eax
	addl	%edi, %r11d
	movl	$0, %ebp
	movl	%eax, %r12d
	movl	%esi, %eax
	subl	%r12d, %eax
	cmovs	%ebp, %eax
	movl	%ecx, %ebp
	imull	%r8d, %eax
	subl	%r12d, %ebp
	movl	$0, %r12d
	cmovs	%r12d, %ebp
	imull	%r10d, %ebp
	addl	%ebp, %eax
	addl	%r11d, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	addl	$2, %ebx
	cmpl	%ebx, %r9d
	jl	.L2
	sarl	%ebx
	movl	$0, %eax
	subl	%ebx, %ecx
	cmovs	%eax, %ecx
	imull	%r10d, %ecx
	subl	%ebx, %esi
	cmovs	%eax, %esi
	addl	%r11d, %edi
	imull	%r8d, %esi
	leal	(%rcx,%rsi), %eax
	addl	%edi, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
.L2:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	xorl	%ebx, %ebx
	jmp	.L3
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	max, .-max
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.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>
#include <math.h>

int max(int x, int y);


int main()
{
    int a, b, c;
    int x, y;
    int minSum;
    int maxNumberOfAb;

    scanf("%d %d %d %d %d", &a, &b, &c, &x, &y);

    maxNumberOfAb = max(x, y) * 2;
    minSum = a * x + b * y + c * (x + y); // dummy
    for (int i = 0; i <= maxNumberOfAb; i++)
    {
	int needA = x - (int)floor(i / 2);
	int needB = y - (int)floor(i / 2);

	if (needA < 0)
	{
	    needA = 0;
	}
	if (needB < 0)
	{
	    needB = 0;
	}
	
	int sum = a * needA + b * needB + c * i;

	if (sum < minSum)
	{
	    minSum = sum;
	}
    }

    printf("%d\n", minSum);
    
    return 0;
}

int max(int x, int y)
{
    if (x > y)
    {
	return x;
    }
    else
    {
	return y;
    }
}

1500 2000 1600 3 2

7900

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

int max(int x, int y);


int main()
{
    int a, b, c;
    int x, y;
    int minSum;
    int maxNumberOfAb;

    scanf("%d %d %d %d %d", &a, &b, &c, &x, &y);

    maxNumberOfAb = max(x, y) * 2;
    minSum = a * x + b * y + c * (x + y); // dummy
    for (int i = 0; i <= maxNumberOfAb; i++)
    {
	int needA = x - (int)floor(i / 2);
	int needB = y - (int)floor(i / 2);

	if (needA < 0)
	{
	    needA = 0;
	}
	if (needB < 0)
	{
	    needB = 0;
	}
	
	int sum = a * needA + b * needB + c * i;

	if (sum < minSum)
	{
	    minSum = sum;
	}
    }

    printf("%d\n", minSum);
    
    return 0;
}

int max(int x, int y)
{
    if (x > y)
    {
	return x;
    }
    else
    {
	return y;
    }
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d %d %d"
.LC1:
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	addl	%eax, %eax
	movl	%eax, -16(%rbp)
	movl	-52(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-48(%rbp), %edx
	movl	-36(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, %ecx
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L2
.L6:
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	cvttsd2sil	%xmm0, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	cvttsd2sil	%xmm0, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
	cmpl	$0, -24(%rbp)
	jns	.L3
	movl	$0, -24(%rbp)
.L3:
	cmpl	$0, -20(%rbp)
	jns	.L4
	movl	$0, -20(%rbp)
.L4:
	movl	-52(%rbp), %eax
	imull	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-48(%rbp), %eax
	imull	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	imull	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L5
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
.L5:
	addl	$1, -28(%rbp)
.L2:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L6
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L10
	movl	-4(%rbp), %eax
	jmp	.L11
.L10:
	movl	-8(%rbp), %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.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 %d %d %d %d"
.LC1:
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-36(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rdi, %r9
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	addl	%eax, %eax
	movl	%eax, -16(%rbp)
	movl	-52(%rbp), %edx
	movl	-40(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-48(%rbp), %edx
	movl	-36(%rbp), %eax
	imull	%edx, %eax
	addl	%eax, %ecx
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L2
.L6:
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	cvttsd2sil	%xmm0, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -24(%rbp)
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	cvttsd2sil	%xmm0, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
	cmpl	$0, -24(%rbp)
	jns	.L3
	movl	$0, -24(%rbp)
.L3:
	cmpl	$0, -20(%rbp)
	jns	.L4
	movl	$0, -20(%rbp)
.L4:
	movl	-52(%rbp), %eax
	imull	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-48(%rbp), %eax
	imull	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	imull	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L5
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
.L5:
	addl	$1, -28(%rbp)
.L2:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L6
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L10
	movl	-4(%rbp), %eax
	jmp	.L11
.L10:
	movl	-8(%rbp), %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.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:
