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[3];
	int i, j, temp = 0, count = 0;

	for(i = 0; i < 3; i++){
		scanf("%d", &a[i]);
	}

	for(i = 0; i < 2; i++){
		for(j = 1; j < 3; j++){
			
			if(a[i] < a[j]){
				temp = a[i];
				a[i] = a[j];
				a[j] = temp;	
			}
		}
	}

	count = a[0] - a[1];
	a[1] = a[0];
	a[2] = a[2] + count;

	while(a[2] < a[0]){
		a[2] = a[2] + 2;
		count++;
	}

	if(a[0] == a[2]){
		printf("%d\n", count);
		return 0;
	}else if(a[2] > a[0]){
		count = count + 1;
		printf("%d\n", count);
		return 0;
	}

}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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), %rbp
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %eax
	jle	.L2
	movq	%xmm1, 8(%rsp)
	xchgl	%eax, %edx
.L2:
	movl	16(%rsp), %ecx
	cmpl	%ecx, %edx
	jge	.L3
	movl	12(%rsp), %eax
	movl	%ecx, 8(%rsp)
	movl	%edx, %ecx
	movl	%eax, %esi
.L4:
	cmpl	%ecx, %esi
	movl	8(%rsp), %edi
	cmovl	%ecx, %eax
	cmovl	%esi, %ecx
	movd	%edi, %xmm0
	movl	%edi, %edx
	subl	%eax, %edx
	addl	%edx, %ecx
	movd	%ecx, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, 12(%rsp)
	cmpl	%ecx, %edi
	jle	.L6
	leal	-1(%rdi), %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	andl	$-2, %eax
	leal	2(%rcx,%rax), %ecx
	shrl	%esi
	movl	%ecx, 16(%rsp)
	leal	1(%rsi,%rdx), %edx
.L6:
	cmpl	%ecx, %edi
	je	.L11
	jl	.L13
.L8:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	movl	12(%rsp), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	jmp	.L4
.L13:
	addl	$1, %edx
.L11:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
.L14:
	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	"%d"
.LC1:
	.string	"%d\n"
	.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), %rbp
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %eax
	jle	.L2
	movq	%xmm1, 8(%rsp)
	xchgl	%eax, %edx
.L2:
	movl	16(%rsp), %ecx
	cmpl	%ecx, %edx
	jge	.L3
	movl	12(%rsp), %eax
	movl	%ecx, 8(%rsp)
	movl	%edx, %ecx
	movl	%eax, %esi
.L4:
	cmpl	%ecx, %esi
	movl	8(%rsp), %edi
	cmovl	%ecx, %eax
	cmovl	%esi, %ecx
	movd	%edi, %xmm0
	movl	%edi, %edx
	subl	%eax, %edx
	addl	%edx, %ecx
	movd	%ecx, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, 12(%rsp)
	cmpl	%ecx, %edi
	jle	.L6
	leal	-1(%rdi), %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	andl	$-2, %eax
	leal	2(%rcx,%rax), %ecx
	shrl	%esi
	movl	%ecx, 16(%rsp)
	leal	1(%rsi,%rdx), %edx
.L6:
	cmpl	%ecx, %edi
	je	.L11
	jl	.L13
.L8:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	movl	12(%rsp), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	jmp	.L4
.L13:
	addl	$1, %edx
.L11:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
.L14:
	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	"%d"
.LC1:
	.string	"%d\n"
	.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), %rbp
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %eax
	jle	.L2
	movq	%xmm1, 8(%rsp)
	xchgl	%eax, %edx
.L2:
	movl	16(%rsp), %ecx
	cmpl	%ecx, %edx
	jge	.L3
	movl	12(%rsp), %eax
	movl	%ecx, 8(%rsp)
	movl	%edx, %ecx
	movl	%eax, %esi
.L4:
	cmpl	%ecx, %esi
	movl	8(%rsp), %edi
	cmovl	%ecx, %eax
	cmovl	%esi, %ecx
	movd	%edi, %xmm0
	movl	%edi, %edx
	subl	%eax, %edx
	addl	%edx, %ecx
	movd	%ecx, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, 12(%rsp)
	cmpl	%ecx, %edi
	jle	.L6
	leal	-1(%rdi), %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	andl	$-2, %eax
	leal	2(%rcx,%rax), %ecx
	shrl	%esi
	movl	%ecx, 16(%rsp)
	leal	1(%rsi,%rdx), %edx
.L6:
	cmpl	%ecx, %edi
	je	.L11
	jl	.L13
.L8:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	movl	12(%rsp), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	jmp	.L4
.L13:
	addl	$1, %edx
.L11:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
.L14:
	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[3];
	int i, j, temp = 0, count = 0;

	for(i = 0; i < 3; i++){
		scanf("%d", &a[i]);
	}

	for(i = 0; i < 2; i++){
		for(j = 1; j < 3; j++){
			
			if(a[i] < a[j]){
				temp = a[i];
				a[i] = a[j];
				a[j] = temp;	
			}
		}
	}

	count = a[0] - a[1];
	a[1] = a[0];
	a[2] = a[2] + count;

	while(a[2] < a[0]){
		a[2] = a[2] + 2;
		count++;
	}

	if(a[0] == a[2]){
		printf("%d\n", count);
		return 0;
	}else if(a[2] > a[0]){
		count = count + 1;
		printf("%d\n", count);
		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[3];
	int i, j, temp = 0, count = 0;

	for(i = 0; i < 3; i++){
		scanf("%d", &a[i]);
	}

	for(i = 0; i < 2; i++){
		for(j = 1; j < 3; j++){
			
			if(a[i] < a[j]){
				temp = a[i];
				a[i] = a[j];
				a[j] = temp;	
			}
		}
	}

	count = a[0] - a[1];
	a[1] = a[0];
	a[2] = a[2] + count;

	while(a[2] < a[0]){
		a[2] = a[2] + 2;
		count++;
	}

	if(a[0] == a[2]){
		printf("%d\n", count);
		return 0;
	}else if(a[2] > a[0]){
		count = count + 1;
		printf("%d\n", count);
		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[3];
	int i, j, temp = 0, count = 0;

	for(i = 0; i < 3; i++){
		scanf("%d", &a[i]);
	}

	for(i = 0; i < 2; i++){
		for(j = 1; j < 3; j++){
			
			if(a[i] < a[j]){
				temp = a[i];
				a[i] = a[j];
				a[j] = temp;	
			}
		}
	}

	count = a[0] - a[1];
	a[1] = a[0];
	a[2] = a[2] + count;

	while(a[2] < a[0]){
		a[2] = a[2] + 2;
		count++;
	}

	if(a[0] == a[2]){
		printf("%d\n", count);
		return 0;
	}else if(a[2] > a[0]){
		count = count + 1;
		printf("%d\n", count);
		return 0;
	}

}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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), %rbp
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %eax
	jle	.L2
	movq	%xmm1, 8(%rsp)
	xchgl	%eax, %edx
.L2:
	movl	16(%rsp), %ecx
	cmpl	%ecx, %edx
	jge	.L3
	movl	12(%rsp), %eax
	movl	%ecx, 8(%rsp)
	movl	%edx, %ecx
	movl	%eax, %esi
.L4:
	cmpl	%ecx, %esi
	movl	8(%rsp), %edi
	cmovl	%ecx, %eax
	cmovl	%esi, %ecx
	movd	%edi, %xmm0
	movl	%edi, %edx
	subl	%eax, %edx
	addl	%edx, %ecx
	movd	%ecx, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, 12(%rsp)
	cmpl	%ecx, %edi
	jle	.L6
	leal	-1(%rdi), %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	andl	$-2, %eax
	leal	2(%rcx,%rax), %ecx
	shrl	%esi
	movl	%ecx, 16(%rsp)
	leal	1(%rsi,%rdx), %edx
.L6:
	cmpl	%ecx, %edi
	je	.L11
	jl	.L13
.L8:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	movl	12(%rsp), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	jmp	.L4
.L13:
	addl	$1, %edx
.L11:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
.L14:
	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	"%d"
.LC1:
	.string	"%d\n"
	.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), %rbp
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %edx
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%edx, %eax
	jle	.L2
	movq	%xmm1, 8(%rsp)
	xchgl	%eax, %edx
.L2:
	movl	16(%rsp), %ecx
	cmpl	%ecx, %edx
	jge	.L3
	movl	12(%rsp), %eax
	movl	%ecx, 8(%rsp)
	movl	%edx, %ecx
	movl	%eax, %esi
.L4:
	cmpl	%ecx, %esi
	movl	8(%rsp), %edi
	cmovl	%ecx, %eax
	cmovl	%esi, %ecx
	movd	%edi, %xmm0
	movl	%edi, %edx
	subl	%eax, %edx
	addl	%edx, %ecx
	movd	%ecx, %xmm3
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, 12(%rsp)
	cmpl	%ecx, %edi
	jle	.L6
	leal	-1(%rdi), %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	andl	$-2, %eax
	leal	2(%rcx,%rax), %ecx
	shrl	%esi
	movl	%ecx, 16(%rsp)
	leal	1(%rsi,%rdx), %edx
.L6:
	cmpl	%ecx, %edi
	je	.L11
	jl	.L13
.L8:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L3:
	.cfi_restore_state
	movl	12(%rsp), %esi
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	jmp	.L4
.L13:
	addl	$1, %edx
.L11:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
.L14:
	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:
```