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 <inttypes.h>

/*
うーん、わからん。
まーいっぱいぶん回せば、ビット的に考えてどっかで止まるんじゃね？知らんけど。
*/

int main(void) {
	uint64_t A, B, C;
	int mareitaso = 0;
	if (scanf("%" SCNu64 "%" SCNu64 "%" SCNu64, &A, &B, &C) != 3) return 1;
	while (A % 2 == 0 && B % 2 == 0 && C % 2 == 0 && mareitaso < 1000000) {
		uint64_t na, nb, nc;
		na = B / 2 + C / 2;
		nb = A / 2 + C / 2;
		nc = A / 2 + B / 2;
		A = na;
		B = nb;
		C = nc;
		mareitaso++;
#if 0
		printf("%" PRIu64 " %" PRIu64 " %" PRIu64 "\n", A, B, C);
#endif
	}
	printf("%d\n", A % 2 != 0 || B % 2 != 0 || C % 2 != 0 ? mareitaso : -1);
	return 0;
}

/*

A                          B                          C
      B/2   +C/2    A/2         +C/2    A/2   +B/2
A/2  +B/4   +C/4    A/4   +B/2  +C/4    A/4   +B/4   +C/2
A/4  +B*3/8 +C*3/8  A*3/8 +B/4  +C*3/8  A*3/8 +B*3/8 +C/4
A*3/8+B*5/16+C*5/16 A*5/16+B*3/8+C*5/16 A*5/16+B*5/16+C*3/8

*/
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lu%lu%lu"
.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
	movl	$0, -60(%rbp)
	leaq	-40(%rbp), %rcx
	leaq	-48(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L4
	movl	$1, %eax
	jmp	.L10
.L6:
	movq	-48(%rbp), %rax
	shrq	%rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	shrq	%rax
	addq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	shrq	%rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	shrq	%rax
	addq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-56(%rbp), %rax
	shrq	%rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	shrq	%rax
	addq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -56(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, -40(%rbp)
	addl	$1, -60(%rbp)
.L4:
	movq	-56(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L5
	movq	-48(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L5
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L5
	cmpl	$999999, -60(%rbp)
	jle	.L6
.L5:
	movq	-56(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L7
	movq	-48(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L7
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L8
.L7:
	movl	-60(%rbp), %eax
	jmp	.L9
.L8:
	movl	$-1, %eax
.L9:
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L10:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lu%lu%lu"
.LC1:
	.string	"%d\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
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$3, %r8d
	jne	.L1
	movq	(%rsp), %rdx
	testb	$1, %dl
	jne	.L15
	movq	16(%rsp), %rdi
	movq	8(%rsp), %rcx
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	movq	%rdi, %rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	testb	$1, %al
	jne	.L27
	cmpl	$1000000, %r8d
	je	.L27
	shrq	%rcx
	shrq	%rax
	addl	$1, %r8d
	movq	%rcx, %rsi
	leaq	(%rcx,%rax), %rbx
	shrq	%rdx
	leaq	(%rax,%rdx), %rcx
	leaq	(%rsi,%rdx), %rax
	movl	$1, %esi
	testb	$1, %bl
	jne	.L30
	movq	%rbx, %rdx
.L4:
	testb	$1, %cl
	je	.L5
	testb	%sil, %sil
	je	.L3
.L30:
	movq	%rax, 16(%rsp)
	movq	%rcx, 8(%rsp)
	movq	%rbx, (%rsp)
.L3:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
.L1:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L33
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	testb	%sil, %sil
	je	.L9
	movq	%rax, 16(%rsp)
	movq	%rax, %rdi
	movq	%rcx, 8(%rsp)
	movq	%rbx, (%rsp)
.L9:
	andb	$1, %dil
	movl	$-1, %eax
	cmove	%eax, %r8d
	jmp	.L3
.L15:
	xorl	%r8d, %r8d
	jmp	.L3
.L33:
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lu%lu%lu"
.LC1:
	.string	"%d\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
	movl	%eax, %r8d
	movl	$1, %eax
	cmpl	$3, %r8d
	jne	.L1
	movq	(%rsp), %rdx
	testb	$1, %dl
	jne	.L15
	movq	16(%rsp), %rdi
	movq	8(%rsp), %rcx
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	movq	%rdi, %rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	testb	$1, %al
	jne	.L27
	cmpl	$1000000, %r8d
	je	.L27
	shrq	%rcx
	shrq	%rax
	addl	$1, %r8d
	movq	%rcx, %rsi
	leaq	(%rcx,%rax), %rbx
	shrq	%rdx
	leaq	(%rax,%rdx), %rcx
	leaq	(%rsi,%rdx), %rax
	movl	$1, %esi
	testb	$1, %bl
	jne	.L30
	movq	%rbx, %rdx
.L4:
	testb	$1, %cl
	je	.L5
	testb	%sil, %sil
	je	.L3
.L30:
	movq	%rax, 16(%rsp)
	movq	%rcx, 8(%rsp)
	movq	%rbx, (%rsp)
.L3:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
.L1:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L33
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	testb	%sil, %sil
	je	.L9
	movq	%rax, 16(%rsp)
	movq	%rax, %rdi
	movq	%rcx, 8(%rsp)
	movq	%rbx, (%rsp)
.L9:
	andb	$1, %dil
	movl	$-1, %eax
	cmove	%eax, %r8d
	jmp	.L3
.L15:
	xorl	%r8d, %r8d
	jmp	.L3
.L33:
	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:

#include <stdio.h>
#include <inttypes.h>

/*
うーん、わからん。
まーいっぱいぶん回せば、ビット的に考えてどっかで止まるんじゃね？知らんけど。
*/

int main(void) {
	uint64_t A, B, C;
	int mareitaso = 0;
	if (scanf("%" SCNu64 "%" SCNu64 "%" SCNu64, &A, &B, &C) != 3) return 1;
	while (A % 2 == 0 && B % 2 == 0 && C % 2 == 0 && mareitaso < 1000000) {
		uint64_t na, nb, nc;
		na = B / 2 + C / 2;
		nb = A / 2 + C / 2;
		nc = A / 2 + B / 2;
		A = na;
		B = nb;
		C = nc;
		mareitaso++;
#if 0
		printf("%" PRIu64 " %" PRIu64 " %" PRIu64 "\n", A, B, C);
#endif
	}
	printf("%d\n", A % 2 != 0 || B % 2 != 0 || C % 2 != 0 ? mareitaso : -1);
	return 0;
}

/*

A                          B                          C
      B/2   +C/2    A/2         +C/2    A/2   +B/2
A/2  +B/4   +C/4    A/4   +B/2  +C/4    A/4   +B/4   +C/2
A/4  +B*3/8 +C*3/8  A*3/8 +B/4  +C*3/8  A*3/8 +B*3/8 +C/4
A*3/8+B*5/16+C*5/16 A*5/16+B*3/8+C*5/16 A*5/16+B*5/16+C*3/8

*/

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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <inttypes.h>

/*
うーん、わからん。
まーいっぱいぶん回せば、ビット的に考えてどっかで止まるんじゃね？知らんけど。
*/

int main(void) {
	uint64_t A, B, C;
	int mareitaso = 0;
	if (scanf("%" SCNu64 "%" SCNu64 "%" SCNu64, &A, &B, &C) != 3) return 1;
	while (A % 2 == 0 && B % 2 == 0 && C % 2 == 0 && mareitaso < 1000000) {
		uint64_t na, nb, nc;
		na = B / 2 + C / 2;
		nb = A / 2 + C / 2;
		nc = A / 2 + B / 2;
		A = na;
		B = nb;
		C = nc;
		mareitaso++;
#if 0
		printf("%" PRIu64 " %" PRIu64 " %" PRIu64 "\n", A, B, C);
#endif
	}
	printf("%d\n", A % 2 != 0 || B % 2 != 0 || C % 2 != 0 ? mareitaso : -1);
	return 0;
}

/*

A                          B                          C
      B/2   +C/2    A/2         +C/2    A/2   +B/2
A/2  +B/4   +C/4    A/4   +B/2  +C/4    A/4   +B/4   +C/2
A/4  +B*3/8 +C*3/8  A*3/8 +B/4  +C*3/8  A*3/8 +B*3/8 +C/4
A*3/8+B*5/16+C*5/16 A*5/16+B*3/8+C*5/16 A*5/16+B*5/16+C*3/8

*/
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lu%lu%lu"
.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
	movl	$0, -60(%rbp)
	leaq	-40(%rbp), %rcx
	leaq	-48(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L4
	movl	$1, %eax
	jmp	.L10
.L6:
	movq	-48(%rbp), %rax
	shrq	%rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	shrq	%rax
	addq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	shrq	%rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	shrq	%rax
	addq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-56(%rbp), %rax
	shrq	%rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	shrq	%rax
	addq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -56(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, -40(%rbp)
	addl	$1, -60(%rbp)
.L4:
	movq	-56(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L5
	movq	-48(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L5
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L5
	cmpl	$999999, -60(%rbp)
	jle	.L6
.L5:
	movq	-56(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L7
	movq	-48(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L7
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L8
.L7:
	movl	-60(%rbp), %eax
	jmp	.L9
.L8:
	movl	$-1, %eax
.L9:
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L10:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%lu%lu%lu"
.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
	movl	$0, -60(%rbp)
	leaq	-40(%rbp), %rcx
	leaq	-48(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L4
	movl	$1, %eax
	jmp	.L10
.L6:
	movq	-48(%rbp), %rax
	shrq	%rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	shrq	%rax
	addq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	-56(%rbp), %rax
	shrq	%rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	shrq	%rax
	addq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-56(%rbp), %rax
	shrq	%rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	shrq	%rax
	addq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -56(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, -40(%rbp)
	addl	$1, -60(%rbp)
.L4:
	movq	-56(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L5
	movq	-48(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L5
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L5
	cmpl	$999999, -60(%rbp)
	jle	.L6
.L5:
	movq	-56(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L7
	movq	-48(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L7
	movq	-40(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L8
.L7:
	movl	-60(%rbp), %eax
	jmp	.L9
.L8:
	movl	$-1, %eax
.L9:
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L10:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
