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>
int main(void)
{
    int a,b,c,max=-1,ans,x,y;
    scanf("%i %i %i",&a,&b,&c);
    if(a>max){max=a;x=b;y=c;}
    if(b>max){max=b;x=a;y=c;}
    if(c>max){max=c;x=a;y=b;}
    x=max-x;
    y=max-y;
    if(x%2==0&&y%2==0)ans=x/2+y/2;
    else if(x%2==1&&y%2==1)ans=x/2+y/2+1;
    else
    {
        x++;
        if(x%2)ans=x/2+y/2+2;
        else
        ans=x/2+y/2+1;
    }
    printf("%i",ans);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i %i %i"
.LC1:
	.string	"%i"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%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	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	js	.L10
	movl	16(%rsp), %esi
	movl	20(%rsp), %edx
	movl	%ecx, %eax
	movl	%esi, %ebp
	movl	%edx, %ebx
.L2:
	cmpl	%eax, %esi
	jle	.L3
	movl	%edx, %ebx
	movl	%ecx, %ebp
	movl	%esi, %eax
.L3:
	cmpl	%edx, %eax
	jge	.L4
	movl	%esi, %ebx
	movl	%ecx, %ebp
	movl	%edx, %eax
.L4:
	movl	%eax, %ecx
	subl	%ebx, %eax
	subl	%ebp, %ecx
	movl	%eax, %esi
	movl	%ecx, %eax
	orl	%esi, %eax
	testb	$1, %al
	je	.L15
	movl	%ecx, %edx
	shrl	$31, %edx
	leal	(%rcx,%rdx), %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	je	.L16
.L7:
	addl	$1, %ecx
	movl	$2, %r8d
	movl	%ecx, %eax
	cltd
	idivl	%r8d
	movl	%eax, %edi
	movl	%esi, %eax
	cltd
	idivl	%r8d
	xorl	%edx, %edx
	addl	%edi, %eax
	andb	$1, %cl
	setne	%dl
	addl	%eax, %edx
	addl	$1, %edx
.L6:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	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
.L16:
	.cfi_restore_state
	movl	%esi, %eax
	movl	$2, %edi
	cltd
	idivl	%edi
	subl	$1, %edx
	jne	.L7
	movl	%esi, %eax
	sarl	%ecx
	sarl	%eax
	leal	1(%rcx,%rax), %edx
	jmp	.L6
.L10:
	movl	16(%rsp), %esi
	movl	20(%rsp), %edx
	orl	$-1, %eax
	jmp	.L2
.L15:
	movl	%ecx, %eax
	movl	$2, %edi
	cltd
	idivl	%edi
	movl	%eax, %ecx
	movl	%esi, %eax
	cltd
	idivl	%edi
	leal	(%rcx,%rax), %edx
	jmp	.L6
.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	"%i %i %i"
.LC1:
	.string	"%i"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%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	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	js	.L10
	movl	16(%rsp), %esi
	movl	20(%rsp), %edx
	movl	%ecx, %eax
	movl	%esi, %ebp
	movl	%edx, %ebx
.L2:
	cmpl	%eax, %esi
	jle	.L3
	movl	%edx, %ebx
	movl	%ecx, %ebp
	movl	%esi, %eax
.L3:
	cmpl	%edx, %eax
	jge	.L4
	movl	%esi, %ebx
	movl	%ecx, %ebp
	movl	%edx, %eax
.L4:
	movl	%eax, %ecx
	subl	%ebx, %eax
	subl	%ebp, %ecx
	movl	%eax, %esi
	movl	%ecx, %eax
	orl	%esi, %eax
	testb	$1, %al
	je	.L15
	movl	%ecx, %edx
	shrl	$31, %edx
	leal	(%rcx,%rdx), %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	je	.L16
.L7:
	addl	$1, %ecx
	movl	$2, %r8d
	movl	%ecx, %eax
	cltd
	idivl	%r8d
	movl	%eax, %edi
	movl	%esi, %eax
	cltd
	idivl	%r8d
	xorl	%edx, %edx
	addl	%edi, %eax
	andb	$1, %cl
	setne	%dl
	addl	%eax, %edx
	addl	$1, %edx
.L6:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	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
.L16:
	.cfi_restore_state
	movl	%esi, %eax
	movl	$2, %edi
	cltd
	idivl	%edi
	subl	$1, %edx
	jne	.L7
	movl	%esi, %eax
	sarl	%ecx
	sarl	%eax
	leal	1(%rcx,%rax), %edx
	jmp	.L6
.L10:
	movl	16(%rsp), %esi
	movl	20(%rsp), %edx
	orl	$-1, %eax
	jmp	.L2
.L15:
	movl	%ecx, %eax
	movl	$2, %edi
	cltd
	idivl	%edi
	movl	%eax, %ecx
	movl	%esi, %eax
	cltd
	idivl	%edi
	leal	(%rcx,%rax), %edx
	jmp	.L6
.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	"%i %i %i"
.LC1:
	.string	"%i"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%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	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	js	.L10
	movl	16(%rsp), %esi
	movl	20(%rsp), %edx
	movl	%ecx, %eax
	movl	%esi, %ebp
	movl	%edx, %ebx
.L2:
	cmpl	%eax, %esi
	jle	.L3
	movl	%edx, %ebx
	movl	%ecx, %ebp
	movl	%esi, %eax
.L3:
	cmpl	%edx, %eax
	jge	.L4
	movl	%esi, %ebx
	movl	%ecx, %ebp
	movl	%edx, %eax
.L4:
	movl	%eax, %ecx
	subl	%ebx, %eax
	subl	%ebp, %ecx
	movl	%eax, %esi
	movl	%ecx, %eax
	orl	%esi, %eax
	testb	$1, %al
	je	.L15
	movl	%ecx, %edx
	shrl	$31, %edx
	leal	(%rcx,%rdx), %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	je	.L16
.L7:
	addl	$1, %ecx
	movl	$2, %r8d
	movl	%ecx, %eax
	cltd
	idivl	%r8d
	movl	%eax, %edi
	movl	%esi, %eax
	cltd
	idivl	%r8d
	xorl	%edx, %edx
	addl	%edi, %eax
	andb	$1, %cl
	setne	%dl
	addl	%eax, %edx
	addl	$1, %edx
.L6:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	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
.L16:
	.cfi_restore_state
	movl	%esi, %eax
	movl	$2, %edi
	cltd
	idivl	%edi
	subl	$1, %edx
	jne	.L7
	movl	%esi, %eax
	sarl	%ecx
	sarl	%eax
	leal	1(%rcx,%rax), %edx
	jmp	.L6
.L10:
	movl	16(%rsp), %esi
	movl	20(%rsp), %edx
	orl	$-1, %eax
	jmp	.L2
.L15:
	movl	%ecx, %eax
	movl	$2, %edi
	cltd
	idivl	%edi
	movl	%eax, %ecx
	movl	%esi, %eax
	cltd
	idivl	%edi
	leal	(%rcx,%rax), %edx
	jmp	.L6
.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>
int main(void)
{
    int a,b,c,max=-1,ans,x,y;
    scanf("%i %i %i",&a,&b,&c);
    if(a>max){max=a;x=b;y=c;}
    if(b>max){max=b;x=a;y=c;}
    if(c>max){max=c;x=a;y=b;}
    x=max-x;
    y=max-y;
    if(x%2==0&&y%2==0)ans=x/2+y/2;
    else if(x%2==1&&y%2==1)ans=x/2+y/2+1;
    else
    {
        x++;
        if(x%2)ans=x/2+y/2+2;
        else
        ans=x/2+y/2+1;
    }
    printf("%i",ans);
    return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main(void)
{
    int a,b,c,max=-1,ans,x,y;
    scanf("%i %i %i",&a,&b,&c);
    if(a>max){max=a;x=b;y=c;}
    if(b>max){max=b;x=a;y=c;}
    if(c>max){max=c;x=a;y=b;}
    x=max-x;
    y=max-y;
    if(x%2==0&&y%2==0)ans=x/2+y/2;
    else if(x%2==1&&y%2==1)ans=x/2+y/2+1;
    else
    {
        x++;
        if(x%2)ans=x/2+y/2+2;
        else
        ans=x/2+y/2+1;
    }
    printf("%i",ans);
    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:

2 5 4

2
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>
int main(void)
{
    int a,b,c,max=-1,ans,x,y;
    scanf("%i %i %i",&a,&b,&c);
    if(a>max){max=a;x=b;y=c;}
    if(b>max){max=b;x=a;y=c;}
    if(c>max){max=c;x=a;y=b;}
    x=max-x;
    y=max-y;
    if(x%2==0&&y%2==0)ans=x/2+y/2;
    else if(x%2==1&&y%2==1)ans=x/2+y/2+1;
    else
    {
        x++;
        if(x%2)ans=x/2+y/2+2;
        else
        ans=x/2+y/2+1;
    }
    printf("%i",ans);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i %i %i"
.LC1:
	.string	"%i"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%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	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	js	.L10
	movl	16(%rsp), %esi
	movl	20(%rsp), %edx
	movl	%ecx, %eax
	movl	%esi, %ebp
	movl	%edx, %ebx
.L2:
	cmpl	%eax, %esi
	jle	.L3
	movl	%edx, %ebx
	movl	%ecx, %ebp
	movl	%esi, %eax
.L3:
	cmpl	%edx, %eax
	jge	.L4
	movl	%esi, %ebx
	movl	%ecx, %ebp
	movl	%edx, %eax
.L4:
	movl	%eax, %ecx
	subl	%ebx, %eax
	subl	%ebp, %ecx
	movl	%eax, %esi
	movl	%ecx, %eax
	orl	%esi, %eax
	testb	$1, %al
	je	.L15
	movl	%ecx, %edx
	shrl	$31, %edx
	leal	(%rcx,%rdx), %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	je	.L16
.L7:
	addl	$1, %ecx
	movl	$2, %r8d
	movl	%ecx, %eax
	cltd
	idivl	%r8d
	movl	%eax, %edi
	movl	%esi, %eax
	cltd
	idivl	%r8d
	xorl	%edx, %edx
	addl	%edi, %eax
	andb	$1, %cl
	setne	%dl
	addl	%eax, %edx
	addl	$1, %edx
.L6:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	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
.L16:
	.cfi_restore_state
	movl	%esi, %eax
	movl	$2, %edi
	cltd
	idivl	%edi
	subl	$1, %edx
	jne	.L7
	movl	%esi, %eax
	sarl	%ecx
	sarl	%eax
	leal	1(%rcx,%rax), %edx
	jmp	.L6
.L10:
	movl	16(%rsp), %esi
	movl	20(%rsp), %edx
	orl	$-1, %eax
	jmp	.L2
.L15:
	movl	%ecx, %eax
	movl	$2, %edi
	cltd
	idivl	%edi
	movl	%eax, %ecx
	movl	%esi, %eax
	cltd
	idivl	%edi
	leal	(%rcx,%rax), %edx
	jmp	.L6
.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	"%i %i %i"
.LC1:
	.string	"%i"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%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	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	js	.L10
	movl	16(%rsp), %esi
	movl	20(%rsp), %edx
	movl	%ecx, %eax
	movl	%esi, %ebp
	movl	%edx, %ebx
.L2:
	cmpl	%eax, %esi
	jle	.L3
	movl	%edx, %ebx
	movl	%ecx, %ebp
	movl	%esi, %eax
.L3:
	cmpl	%edx, %eax
	jge	.L4
	movl	%esi, %ebx
	movl	%ecx, %ebp
	movl	%edx, %eax
.L4:
	movl	%eax, %ecx
	subl	%ebx, %eax
	subl	%ebp, %ecx
	movl	%eax, %esi
	movl	%ecx, %eax
	orl	%esi, %eax
	testb	$1, %al
	je	.L15
	movl	%ecx, %edx
	shrl	$31, %edx
	leal	(%rcx,%rdx), %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	je	.L16
.L7:
	addl	$1, %ecx
	movl	$2, %r8d
	movl	%ecx, %eax
	cltd
	idivl	%r8d
	movl	%eax, %edi
	movl	%esi, %eax
	cltd
	idivl	%r8d
	xorl	%edx, %edx
	addl	%edi, %eax
	andb	$1, %cl
	setne	%dl
	addl	%eax, %edx
	addl	$1, %edx
.L6:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	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
.L16:
	.cfi_restore_state
	movl	%esi, %eax
	movl	$2, %edi
	cltd
	idivl	%edi
	subl	$1, %edx
	jne	.L7
	movl	%esi, %eax
	sarl	%ecx
	sarl	%eax
	leal	1(%rcx,%rax), %edx
	jmp	.L6
.L10:
	movl	16(%rsp), %esi
	movl	20(%rsp), %edx
	orl	$-1, %eax
	jmp	.L2
.L15:
	movl	%ecx, %eax
	movl	$2, %edi
	cltd
	idivl	%edi
	movl	%eax, %ecx
	movl	%esi, %eax
	cltd
	idivl	%edi
	leal	(%rcx,%rax), %edx
	jmp	.L6
.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:
```