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) {

  long a,b,c;
  scanf("%ld %ld %ld", &a, &b, &c);
  long count = 0;
  long next_a,next_b,next_c;
  while (1) {
    if (a%2 != 0 || b%2 != 0 || c%2 != 0) {
      break;
    }
    if (a == b && b == c) {
      printf("-1\n");
      return 0;
    }
    count++;
    next_a = (b+c)/2;
    next_b = (c+a)/2;
    next_c = (a+b)/2;
    a = next_a;
    b = next_b;
    c = next_c;
  }
  printf("%ld\n", count);

  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"-1"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rcx
	testb	$1, %cl
	jne	.L12
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	testb	$1, %al
	jne	.L31
	cmpq	%rax, %rdi
	jne	.L7
	cmpq	%rdi, %rcx
	je	.L33
.L7:
	leaq	(%rdi,%rax), %rsi
	addq	%rcx, %rax
	addq	%rdi, %rcx
	addq	$1, %r8
	movq	%rsi, %rdx
	movl	$1, %r9d
	shrq	$63, %rdx
	addq	%rsi, %rdx
	movq	%rax, %rsi
	shrq	$63, %rsi
	sarq	%rdx
	addq	%rax, %rsi
	movq	%rcx, %rax
	movq	%rdx, %rbx
	shrq	$63, %rax
	sarq	%rsi
	addq	%rcx, %rax
	sarq	%rax
	testb	$1, %dl
	jne	.L34
	movq	%rsi, %rdi
	movq	%rbx, %rcx
.L10:
	testb	$1, %dil
	je	.L3
.L31:
	testb	%r9b, %r9b
	je	.L2
	movq	%rbx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rdi, 8(%rsp)
.L2:
	movq	%r8, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L34:
	.cfi_restore_state
	movq	%rdx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rsi, 8(%rsp)
	jmp	.L2
.L33:
	testb	%r9b, %r9b
	je	.L8
	movq	%rbx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rdi, 8(%rsp)
.L8:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L9
.L12:
	xorl	%r8d, %r8d
	jmp	.L2
.L35:
	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	"%ld %ld %ld"
.LC1:
	.string	"-1"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rcx
	testb	$1, %cl
	jne	.L12
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	testb	$1, %al
	jne	.L31
	cmpq	%rax, %rdi
	jne	.L7
	cmpq	%rdi, %rcx
	je	.L33
.L7:
	leaq	(%rdi,%rax), %rsi
	addq	%rcx, %rax
	addq	%rdi, %rcx
	addq	$1, %r8
	movq	%rsi, %rdx
	movl	$1, %r9d
	shrq	$63, %rdx
	addq	%rsi, %rdx
	movq	%rax, %rsi
	shrq	$63, %rsi
	sarq	%rdx
	addq	%rax, %rsi
	movq	%rcx, %rax
	movq	%rdx, %rbx
	shrq	$63, %rax
	sarq	%rsi
	addq	%rcx, %rax
	sarq	%rax
	testb	$1, %dl
	jne	.L34
	movq	%rsi, %rdi
	movq	%rbx, %rcx
.L10:
	testb	$1, %dil
	je	.L3
.L31:
	testb	%r9b, %r9b
	je	.L2
	movq	%rbx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rdi, 8(%rsp)
.L2:
	movq	%r8, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L34:
	.cfi_restore_state
	movq	%rdx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rsi, 8(%rsp)
	jmp	.L2
.L33:
	testb	%r9b, %r9b
	je	.L8
	movq	%rbx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rdi, 8(%rsp)
.L8:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L9
.L12:
	xorl	%r8d, %r8d
	jmp	.L2
.L35:
	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	"%ld %ld %ld"
.LC1:
	.string	"-1"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rcx
	testb	$1, %cl
	jne	.L12
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	testb	$1, %al
	jne	.L31
	cmpq	%rax, %rdi
	jne	.L7
	cmpq	%rdi, %rcx
	je	.L33
.L7:
	leaq	(%rdi,%rax), %rsi
	addq	%rcx, %rax
	addq	%rdi, %rcx
	addq	$1, %r8
	movq	%rsi, %rdx
	movl	$1, %r9d
	shrq	$63, %rdx
	addq	%rsi, %rdx
	movq	%rax, %rsi
	shrq	$63, %rsi
	sarq	%rdx
	addq	%rax, %rsi
	movq	%rcx, %rax
	movq	%rdx, %rbx
	shrq	$63, %rax
	sarq	%rsi
	addq	%rcx, %rax
	sarq	%rax
	testb	$1, %dl
	jne	.L34
	movq	%rsi, %rdi
	movq	%rbx, %rcx
.L10:
	testb	$1, %dil
	je	.L3
.L31:
	testb	%r9b, %r9b
	je	.L2
	movq	%rbx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rdi, 8(%rsp)
.L2:
	movq	%r8, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L34:
	.cfi_restore_state
	movq	%rdx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rsi, 8(%rsp)
	jmp	.L2
.L33:
	testb	%r9b, %r9b
	je	.L8
	movq	%rbx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rdi, 8(%rsp)
.L8:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L9
.L12:
	xorl	%r8d, %r8d
	jmp	.L2
.L35:
	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) {

  long a,b,c;
  scanf("%ld %ld %ld", &a, &b, &c);
  long count = 0;
  long next_a,next_b,next_c;
  while (1) {
    if (a%2 != 0 || b%2 != 0 || c%2 != 0) {
      break;
    }
    if (a == b && b == c) {
      printf("-1\n");
      return 0;
    }
    count++;
    next_a = (b+c)/2;
    next_b = (c+a)/2;
    next_c = (a+b)/2;
    a = next_a;
    b = next_b;
    c = next_c;
  }
  printf("%ld\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) {

  long a,b,c;
  scanf("%ld %ld %ld", &a, &b, &c);
  long count = 0;
  long next_a,next_b,next_c;
  while (1) {
    if (a%2 != 0 || b%2 != 0 || c%2 != 0) {
      break;
    }
    if (a == b && b == c) {
      printf("-1\n");
      return 0;
    }
    count++;
    next_a = (b+c)/2;
    next_b = (c+a)/2;
    next_c = (a+b)/2;
    a = next_a;
    b = next_b;
    c = next_c;
  }
  printf("%ld\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:

15 14 14
 454 414 846
 454 414 1200
 1390 18 4202
 0 0 0
 4 12 13
 15 14 7
 4 0 13
 15 17 7
 781 414 1200

0
 3
 1
 2
 -1
 0
 0
 0
 0
 0

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) {

  long a,b,c;
  scanf("%ld %ld %ld", &a, &b, &c);
  long count = 0;
  long next_a,next_b,next_c;
  while (1) {
    if (a%2 != 0 || b%2 != 0 || c%2 != 0) {
      break;
    }
    if (a == b && b == c) {
      printf("-1\n");
      return 0;
    }
    count++;
    next_a = (b+c)/2;
    next_b = (c+a)/2;
    next_c = (a+b)/2;
    a = next_a;
    b = next_b;
    c = next_c;
  }
  printf("%ld\n", count);

  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"-1"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rcx
	testb	$1, %cl
	jne	.L12
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	testb	$1, %al
	jne	.L31
	cmpq	%rax, %rdi
	jne	.L7
	cmpq	%rdi, %rcx
	je	.L33
.L7:
	leaq	(%rdi,%rax), %rsi
	addq	%rcx, %rax
	addq	%rdi, %rcx
	addq	$1, %r8
	movq	%rsi, %rdx
	movl	$1, %r9d
	shrq	$63, %rdx
	addq	%rsi, %rdx
	movq	%rax, %rsi
	shrq	$63, %rsi
	sarq	%rdx
	addq	%rax, %rsi
	movq	%rcx, %rax
	movq	%rdx, %rbx
	shrq	$63, %rax
	sarq	%rsi
	addq	%rcx, %rax
	sarq	%rax
	testb	$1, %dl
	jne	.L34
	movq	%rsi, %rdi
	movq	%rbx, %rcx
.L10:
	testb	$1, %dil
	je	.L3
.L31:
	testb	%r9b, %r9b
	je	.L2
	movq	%rbx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rdi, 8(%rsp)
.L2:
	movq	%r8, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L34:
	.cfi_restore_state
	movq	%rdx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rsi, 8(%rsp)
	jmp	.L2
.L33:
	testb	%r9b, %r9b
	je	.L8
	movq	%rbx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rdi, 8(%rsp)
.L8:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L9
.L12:
	xorl	%r8d, %r8d
	jmp	.L2
.L35:
	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	"%ld %ld %ld"
.LC1:
	.string	"-1"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rcx
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rcx
	testb	$1, %cl
	jne	.L12
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L3:
	testb	$1, %al
	jne	.L31
	cmpq	%rax, %rdi
	jne	.L7
	cmpq	%rdi, %rcx
	je	.L33
.L7:
	leaq	(%rdi,%rax), %rsi
	addq	%rcx, %rax
	addq	%rdi, %rcx
	addq	$1, %r8
	movq	%rsi, %rdx
	movl	$1, %r9d
	shrq	$63, %rdx
	addq	%rsi, %rdx
	movq	%rax, %rsi
	shrq	$63, %rsi
	sarq	%rdx
	addq	%rax, %rsi
	movq	%rcx, %rax
	movq	%rdx, %rbx
	shrq	$63, %rax
	sarq	%rsi
	addq	%rcx, %rax
	sarq	%rax
	testb	$1, %dl
	jne	.L34
	movq	%rsi, %rdi
	movq	%rbx, %rcx
.L10:
	testb	$1, %dil
	je	.L3
.L31:
	testb	%r9b, %r9b
	je	.L2
	movq	%rbx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rdi, 8(%rsp)
.L2:
	movq	%r8, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L34:
	.cfi_restore_state
	movq	%rdx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rsi, 8(%rsp)
	jmp	.L2
.L33:
	testb	%r9b, %r9b
	je	.L8
	movq	%rbx, (%rsp)
	movq	%rax, 16(%rsp)
	movq	%rdi, 8(%rsp)
.L8:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L9
.L12:
	xorl	%r8d, %r8d
	jmp	.L2
.L35:
	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:
```