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 max(int a,int b){
  if(a > b){
    return a;
  }
  return b;
}

int main(void){
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);

  int ans = 0;
  int MAX = max(max(a,b),c);

  while(MAX-a >= 2){
    a += 2;
    ans++;
  }
  while(MAX-b >= 2){
    b += 2;
    ans++;
  }
  while(MAX-c >= 2){
    c += 2;
    ans++;
  }

  int cnt = 0;
  if(MAX == a) cnt++;
  if(MAX == b) cnt++;
  if(MAX == c) cnt++;

  if(cnt == 1) ans++;
  if(cnt == 2) ans += 2;

  printf("%d\n",ans);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	max
	.type	max, @function
max:
.LFB0:
	.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	.L2
	movl	-4(%rbp), %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rcx
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	movl	-40(%rbp), %ebx
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%ebx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -28(%rbp)
	jmp	.L5
.L6:
	movl	-48(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -48(%rbp)
	addl	$1, -36(%rbp)
.L5:
	movl	-48(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jg	.L6
	jmp	.L7
.L8:
	movl	-44(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -44(%rbp)
	addl	$1, -36(%rbp)
.L7:
	movl	-44(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jg	.L8
	jmp	.L9
.L10:
	movl	-40(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -40(%rbp)
	addl	$1, -36(%rbp)
.L9:
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jg	.L10
	movl	$0, -32(%rbp)
	movl	-48(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L11
	addl	$1, -32(%rbp)
.L11:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L12
	addl	$1, -32(%rbp)
.L12:
	movl	-40(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L13
	addl	$1, -32(%rbp)
.L13:
	cmpl	$1, -32(%rbp)
	jne	.L14
	addl	$1, -36(%rbp)
.L14:
	cmpl	$2, -32(%rbp)
	jne	.L15
	addl	$2, -36(%rbp)
.L15:
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d%d"
.LC7:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC1(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r9d
	movl	16(%rsp), %r8d
	movl	12(%rsp), %edi
	cmpl	%r8d, %r9d
	movl	%r8d, %esi
	cmovge	%r9d, %esi
	cmpl	%edi, %esi
	cmovl	%edi, %esi
	movl	%esi, %eax
	subl	%edi, %eax
	cmpl	$1, %eax
	jle	.L26
	leal	2(%rdi), %eax
	movl	%esi, %ecx
	subl	%eax, %ecx
	leal	-30(%rcx), %edx
	cmpl	$2147483616, %edx
	ja	.L27
	shrl	%ecx
	movd	%edi, %xmm2
	movdqa	.LC0(%rip), %xmm7
	xorl	%eax, %eax
	addl	$1, %ecx
	pshufd	$0, %xmm2, %xmm6
	movdqa	.LC3(%rip), %xmm5
	paddd	.LC2(%rip), %xmm6
	movl	%ecx, %edx
	movdqa	.LC4(%rip), %xmm4
	movdqa	.LC5(%rip), %xmm3
	movdqa	.LC6(%rip), %xmm2
	shrl	$2, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm7, %xmm1
	movdqa	%xmm6, %xmm0
	paddd	%xmm5, %xmm7
	addl	$1, %eax
	paddd	%xmm4, %xmm6
	paddd	%xmm3, %xmm0
	paddd	%xmm2, %xmm1
	cmpl	%edx, %eax
	jb	.L6
	movl	%ecx, %eax
	pshufd	$255, %xmm1, %xmm1
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %eax
	movd	%xmm1, %edx
	leal	(%rdi,%rax,2), %r10d
	movd	%xmm0, %edi
	cmpl	%eax, %ecx
	je	.L8
	leal	2(%r10), %edi
	movl	%esi, %ecx
	leal	1(%rax), %edx
	subl	%edi, %ecx
	subl	$1, %ecx
	jle	.L8
	leal	4(%r10), %edi
	movl	%esi, %ecx
	leal	2(%rax), %edx
	subl	%edi, %ecx
	subl	$1, %ecx
	jle	.L8
	leal	6(%r10), %edi
	leal	3(%rax), %edx
.L8:
	movl	%edi, 12(%rsp)
.L4:
	movl	%esi, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jle	.L9
	leal	2(%r8), %eax
	movl	%esi, %r10d
	subl	%eax, %r10d
	leal	-30(%r10), %ecx
	cmpl	$2147483616, %ecx
	ja	.L10
	shrl	%r10d
	movd	%r8d, %xmm3
	movd	%edx, %xmm4
	xorl	%eax, %eax
	addl	$1, %r10d
	pshufd	$0, %xmm3, %xmm7
	pshufd	$0, %xmm4, %xmm6
	movdqa	.LC3(%rip), %xmm5
	movl	%r10d, %ecx
	paddd	.LC2(%rip), %xmm7
	paddd	.LC0(%rip), %xmm6
	movdqa	.LC4(%rip), %xmm4
	movdqa	.LC5(%rip), %xmm3
	shrl	$2, %ecx
	movdqa	.LC6(%rip), %xmm2
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm6, %xmm1
	movdqa	%xmm7, %xmm0
	paddd	%xmm5, %xmm6
	addl	$1, %eax
	paddd	%xmm4, %xmm7
	paddd	%xmm3, %xmm0
	paddd	%xmm2, %xmm1
	cmpl	%eax, %ecx
	ja	.L11
	movl	%r10d, %r11d
	pshufd	$255, %xmm1, %xmm1
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %r11d
	leal	(%r8,%r11,2), %ebp
	leal	(%rdx,%r11), %ebx
	cmpl	%r11d, %r10d
	je	.L29
	leal	2(%rbp), %r8d
	movl	%esi, %eax
	leal	1(%rbx), %edx
	subl	%r8d, %eax
	subl	$1, %eax
	jle	.L13
	leal	4(%rbp), %r8d
	movl	%esi, %eax
	leal	2(%rbx), %edx
	subl	%r8d, %eax
	subl	$1, %eax
	jle	.L13
	leal	6(%rbp), %r8d
	leal	3(%rbx), %edx
.L13:
	movl	%r8d, 16(%rsp)
.L9:
	movl	%esi, %eax
	subl	%r9d, %eax
	cmpl	$1, %eax
	jle	.L14
	leal	2(%r9), %eax
	movl	%esi, %r10d
	subl	%eax, %r10d
	leal	-30(%r10), %ecx
	cmpl	$2147483616, %ecx
	ja	.L15
	shrl	%r10d
	movd	%r9d, %xmm5
	movd	%edx, %xmm2
	xorl	%eax, %eax
	addl	$1, %r10d
	pshufd	$0, %xmm5, %xmm7
	pshufd	$0, %xmm2, %xmm6
	movdqa	.LC3(%rip), %xmm5
	movl	%r10d, %ecx
	paddd	.LC2(%rip), %xmm7
	paddd	.LC0(%rip), %xmm6
	movdqa	.LC4(%rip), %xmm4
	movdqa	.LC5(%rip), %xmm3
	shrl	$2, %ecx
	movdqa	.LC6(%rip), %xmm2
	.p2align 4,,10
	.p2align 3
.L16:
	movdqa	%xmm6, %xmm1
	movdqa	%xmm7, %xmm0
	paddd	%xmm5, %xmm6
	addl	$1, %eax
	paddd	%xmm4, %xmm7
	paddd	%xmm3, %xmm0
	paddd	%xmm2, %xmm1
	cmpl	%eax, %ecx
	ja	.L16
	movl	%r10d, %r11d
	pshufd	$255, %xmm1, %xmm1
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %r11d
	leal	(%r9,%r11,2), %ebp
	leal	(%rdx,%r11), %ebx
	cmpl	%r11d, %r10d
	je	.L30
	leal	2(%rbp), %r9d
	movl	%esi, %eax
	leal	1(%rbx), %edx
	subl	%r9d, %eax
	subl	$1, %eax
	jle	.L18
	leal	4(%rbp), %r9d
	movl	%esi, %eax
	leal	2(%rbx), %edx
	subl	%r9d, %eax
	subl	$1, %eax
	jle	.L18
	leal	6(%rbp), %r9d
	leal	3(%rbx), %edx
.L18:
	movl	%r9d, 20(%rsp)
.L14:
	cmpl	%esi, %edi
	je	.L19
	cmpl	%r8d, %esi
	je	.L20
	cmpl	%r9d, %esi
	je	.L21
.L22:
	xorl	%eax, %eax
	leaq	.LC7(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L42:
	.cfi_restore_state
	addl	$2, %eax
.L10:
	movl	%esi, %ecx
	movl	%eax, %r8d
	addl	$1, %edx
	subl	%eax, %ecx
	cmpl	$1, %ecx
	jg	.L42
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L43:
	addl	$2, %eax
.L15:
	movl	%esi, %ecx
	movl	%eax, %r9d
	addl	$1, %edx
	subl	%eax, %ecx
	cmpl	$1, %ecx
	jg	.L43
	jmp	.L18
.L20:
	cmpl	%r9d, %esi
	je	.L24
.L21:
	addl	$1, %edx
	jmp	.L22
.L23:
	cmpl	%r9d, %edi
	je	.L22
.L24:
	addl	$2, %edx
	jmp	.L22
.L19:
	cmpl	%r8d, %edi
	je	.L23
	cmpl	%r9d, %edi
	jne	.L21
	jmp	.L24
.L30:
	movd	%xmm1, %edx
	movd	%xmm0, %r9d
	jmp	.L18
.L27:
	xorl	%edx, %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L44:
	addl	$2, %eax
.L5:
	movl	%esi, %ecx
	movl	%eax, %edi
	addl	$1, %edx
	subl	%eax, %ecx
	cmpl	$1, %ecx
	jg	.L44
	jmp	.L8
.L29:
	movd	%xmm1, %edx
	movd	%xmm0, %r8d
	jmp	.L13
.L26:
	xorl	%edx, %edx
	jmp	.L4
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	0
	.long	2
	.long	4
	.long	6
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	8
	.long	8
	.long	8
	.long	8
	.align 16
.LC5:
	.long	2
	.long	2
	.long	2
	.long	2
	.align 16
.LC6:
	.long	1
	.long	1
	.long	1
	.long	1
	.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
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d%d"
.LC7:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC1(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %r9d
	movl	16(%rsp), %r8d
	movl	12(%rsp), %edi
	cmpl	%r8d, %r9d
	movl	%r8d, %esi
	cmovge	%r9d, %esi
	cmpl	%edi, %esi
	cmovl	%edi, %esi
	movl	%esi, %eax
	subl	%edi, %eax
	cmpl	$1, %eax
	jle	.L26
	leal	2(%rdi), %eax
	movl	%esi, %ecx
	subl	%eax, %ecx
	leal	-30(%rcx), %edx
	cmpl	$2147483616, %edx
	ja	.L27
	shrl	%ecx
	movd	%edi, %xmm2
	movdqa	.LC0(%rip), %xmm7
	xorl	%eax, %eax
	addl	$1, %ecx
	pshufd	$0, %xmm2, %xmm6
	movdqa	.LC3(%rip), %xmm5
	paddd	.LC2(%rip), %xmm6
	movl	%ecx, %edx
	movdqa	.LC4(%rip), %xmm4
	movdqa	.LC5(%rip), %xmm3
	movdqa	.LC6(%rip), %xmm2
	shrl	$2, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm7, %xmm1
	movdqa	%xmm6, %xmm0
	paddd	%xmm5, %xmm7
	addl	$1, %eax
	paddd	%xmm4, %xmm6
	paddd	%xmm3, %xmm0
	paddd	%xmm2, %xmm1
	cmpl	%edx, %eax
	jb	.L6
	movl	%ecx, %eax
	pshufd	$255, %xmm1, %xmm1
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %eax
	movd	%xmm1, %edx
	leal	(%rdi,%rax,2), %r10d
	movd	%xmm0, %edi
	cmpl	%eax, %ecx
	je	.L8
	leal	2(%r10), %edi
	movl	%esi, %ecx
	leal	1(%rax), %edx
	subl	%edi, %ecx
	subl	$1, %ecx
	jle	.L8
	leal	4(%r10), %edi
	movl	%esi, %ecx
	leal	2(%rax), %edx
	subl	%edi, %ecx
	subl	$1, %ecx
	jle	.L8
	leal	6(%r10), %edi
	leal	3(%rax), %edx
.L8:
	movl	%edi, 12(%rsp)
.L4:
	movl	%esi, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jle	.L9
	leal	2(%r8), %eax
	movl	%esi, %r10d
	subl	%eax, %r10d
	leal	-30(%r10), %ecx
	cmpl	$2147483616, %ecx
	ja	.L10
	shrl	%r10d
	movd	%r8d, %xmm3
	movd	%edx, %xmm4
	xorl	%eax, %eax
	addl	$1, %r10d
	pshufd	$0, %xmm3, %xmm7
	pshufd	$0, %xmm4, %xmm6
	movdqa	.LC3(%rip), %xmm5
	movl	%r10d, %ecx
	paddd	.LC2(%rip), %xmm7
	paddd	.LC0(%rip), %xmm6
	movdqa	.LC4(%rip), %xmm4
	movdqa	.LC5(%rip), %xmm3
	shrl	$2, %ecx
	movdqa	.LC6(%rip), %xmm2
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm6, %xmm1
	movdqa	%xmm7, %xmm0
	paddd	%xmm5, %xmm6
	addl	$1, %eax
	paddd	%xmm4, %xmm7
	paddd	%xmm3, %xmm0
	paddd	%xmm2, %xmm1
	cmpl	%eax, %ecx
	ja	.L11
	movl	%r10d, %r11d
	pshufd	$255, %xmm1, %xmm1
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %r11d
	leal	(%r8,%r11,2), %ebp
	leal	(%rdx,%r11), %ebx
	cmpl	%r11d, %r10d
	je	.L29
	leal	2(%rbp), %r8d
	movl	%esi, %eax
	leal	1(%rbx), %edx
	subl	%r8d, %eax
	subl	$1, %eax
	jle	.L13
	leal	4(%rbp), %r8d
	movl	%esi, %eax
	leal	2(%rbx), %edx
	subl	%r8d, %eax
	subl	$1, %eax
	jle	.L13
	leal	6(%rbp), %r8d
	leal	3(%rbx), %edx
.L13:
	movl	%r8d, 16(%rsp)
.L9:
	movl	%esi, %eax
	subl	%r9d, %eax
	cmpl	$1, %eax
	jle	.L14
	leal	2(%r9), %eax
	movl	%esi, %r10d
	subl	%eax, %r10d
	leal	-30(%r10), %ecx
	cmpl	$2147483616, %ecx
	ja	.L15
	shrl	%r10d
	movd	%r9d, %xmm5
	movd	%edx, %xmm2
	xorl	%eax, %eax
	addl	$1, %r10d
	pshufd	$0, %xmm5, %xmm7
	pshufd	$0, %xmm2, %xmm6
	movdqa	.LC3(%rip), %xmm5
	movl	%r10d, %ecx
	paddd	.LC2(%rip), %xmm7
	paddd	.LC0(%rip), %xmm6
	movdqa	.LC4(%rip), %xmm4
	movdqa	.LC5(%rip), %xmm3
	shrl	$2, %ecx
	movdqa	.LC6(%rip), %xmm2
	.p2align 4,,10
	.p2align 3
.L16:
	movdqa	%xmm6, %xmm1
	movdqa	%xmm7, %xmm0
	paddd	%xmm5, %xmm6
	addl	$1, %eax
	paddd	%xmm4, %xmm7
	paddd	%xmm3, %xmm0
	paddd	%xmm2, %xmm1
	cmpl	%eax, %ecx
	ja	.L16
	movl	%r10d, %r11d
	pshufd	$255, %xmm1, %xmm1
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %r11d
	leal	(%r9,%r11,2), %ebp
	leal	(%rdx,%r11), %ebx
	cmpl	%r11d, %r10d
	je	.L30
	leal	2(%rbp), %r9d
	movl	%esi, %eax
	leal	1(%rbx), %edx
	subl	%r9d, %eax
	subl	$1, %eax
	jle	.L18
	leal	4(%rbp), %r9d
	movl	%esi, %eax
	leal	2(%rbx), %edx
	subl	%r9d, %eax
	subl	$1, %eax
	jle	.L18
	leal	6(%rbp), %r9d
	leal	3(%rbx), %edx
.L18:
	movl	%r9d, 20(%rsp)
.L14:
	cmpl	%esi, %edi
	je	.L19
	cmpl	%r8d, %esi
	je	.L20
	cmpl	%r9d, %esi
	je	.L21
.L22:
	xorl	%eax, %eax
	leaq	.LC7(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L42:
	.cfi_restore_state
	addl	$2, %eax
.L10:
	movl	%esi, %ecx
	movl	%eax, %r8d
	addl	$1, %edx
	subl	%eax, %ecx
	cmpl	$1, %ecx
	jg	.L42
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L43:
	addl	$2, %eax
.L15:
	movl	%esi, %ecx
	movl	%eax, %r9d
	addl	$1, %edx
	subl	%eax, %ecx
	cmpl	$1, %ecx
	jg	.L43
	jmp	.L18
.L20:
	cmpl	%r9d, %esi
	je	.L24
.L21:
	addl	$1, %edx
	jmp	.L22
.L23:
	cmpl	%r9d, %edi
	je	.L22
.L24:
	addl	$2, %edx
	jmp	.L22
.L19:
	cmpl	%r8d, %edi
	je	.L23
	cmpl	%r9d, %edi
	jne	.L21
	jmp	.L24
.L30:
	movd	%xmm1, %edx
	movd	%xmm0, %r9d
	jmp	.L18
.L27:
	xorl	%edx, %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L44:
	addl	$2, %eax
.L5:
	movl	%esi, %ecx
	movl	%eax, %edi
	addl	$1, %edx
	subl	%eax, %ecx
	cmpl	$1, %ecx
	jg	.L44
	jmp	.L8
.L29:
	movd	%xmm1, %edx
	movd	%xmm0, %r8d
	jmp	.L13
.L26:
	xorl	%edx, %edx
	jmp	.L4
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	0
	.long	2
	.long	4
	.long	6
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	8
	.long	8
	.long	8
	.long	8
	.align 16
.LC5:
	.long	2
	.long	2
	.long	2
	.long	2
	.align 16
.LC6:
	.long	1
	.long	1
	.long	1
	.long	1
	.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 max(int a,int b){
  if(a > b){
    return a;
  }
  return b;
}

int main(void){
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);

  int ans = 0;
  int MAX = max(max(a,b),c);

  while(MAX-a >= 2){
    a += 2;
    ans++;
  }
  while(MAX-b >= 2){
    b += 2;
    ans++;
  }
  while(MAX-c >= 2){
    c += 2;
    ans++;
  }

  int cnt = 0;
  if(MAX == a) cnt++;
  if(MAX == b) cnt++;
  if(MAX == c) cnt++;

  if(cnt == 1) ans++;
  if(cnt == 2) ans += 2;

  printf("%d\n",ans);

  return 0;
}
2 5 4

2

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 max(int a,int b){
  if(a > b){
    return a;
  }
  return b;
}

int main(void){
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);

  int ans = 0;
  int MAX = max(max(a,b),c);

  while(MAX-a >= 2){
    a += 2;
    ans++;
  }
  while(MAX-b >= 2){
    b += 2;
    ans++;
  }
  while(MAX-c >= 2){
    c += 2;
    ans++;
  }

  int cnt = 0;
  if(MAX == a) cnt++;
  if(MAX == b) cnt++;
  if(MAX == c) cnt++;

  if(cnt == 1) ans++;
  if(cnt == 2) ans += 2;

  printf("%d\n",ans);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	max
	.type	max, @function
max:
.LFB0:
	.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	.L2
	movl	-4(%rbp), %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rcx
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	movl	-40(%rbp), %ebx
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%ebx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -28(%rbp)
	jmp	.L5
.L6:
	movl	-48(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -48(%rbp)
	addl	$1, -36(%rbp)
.L5:
	movl	-48(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jg	.L6
	jmp	.L7
.L8:
	movl	-44(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -44(%rbp)
	addl	$1, -36(%rbp)
.L7:
	movl	-44(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jg	.L8
	jmp	.L9
.L10:
	movl	-40(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -40(%rbp)
	addl	$1, -36(%rbp)
.L9:
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jg	.L10
	movl	$0, -32(%rbp)
	movl	-48(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L11
	addl	$1, -32(%rbp)
.L11:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L12
	addl	$1, -32(%rbp)
.L12:
	movl	-40(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L13
	addl	$1, -32(%rbp)
.L13:
	cmpl	$1, -32(%rbp)
	jne	.L14
	addl	$1, -36(%rbp)
.L14:
	cmpl	$2, -32(%rbp)
	jne	.L15
	addl	$2, -36(%rbp)
.L15:
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.globl	max
	.type	max, @function
max:
.LFB0:
	.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	.L2
	movl	-4(%rbp), %eax
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rcx
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	movl	-40(%rbp), %ebx
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max
	movl	%ebx, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -28(%rbp)
	jmp	.L5
.L6:
	movl	-48(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -48(%rbp)
	addl	$1, -36(%rbp)
.L5:
	movl	-48(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jg	.L6
	jmp	.L7
.L8:
	movl	-44(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -44(%rbp)
	addl	$1, -36(%rbp)
.L7:
	movl	-44(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jg	.L8
	jmp	.L9
.L10:
	movl	-40(%rbp), %eax
	addl	$2, %eax
	movl	%eax, -40(%rbp)
	addl	$1, -36(%rbp)
.L9:
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jg	.L10
	movl	$0, -32(%rbp)
	movl	-48(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L11
	addl	$1, -32(%rbp)
.L11:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L12
	addl	$1, -32(%rbp)
.L12:
	movl	-40(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L13
	addl	$1, -32(%rbp)
.L13:
	cmpl	$1, -32(%rbp)
	jne	.L14
	addl	$1, -36(%rbp)
.L14:
	cmpl	$2, -32(%rbp)
	jne	.L15
	addl	$2, -36(%rbp)
.L15:
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
