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 = 0, b = 0, c = 0,
        d = 0, e = 0, f = 0,
        g = 0, h = 0, M = 0;

    scanf("%d %d %d", &a, &b, &M);

    g = 2*M - b;
    h = 2*M - a;
    f = 3*M - g - h;
    c = 2*M - f;
    e = 3*M - c - h;
    d = 2*M - e;

    printf("%d %d %d\n", a, b, c);
    printf("%d %d %d\n", d, M, e);
    printf("%d %d %d\n", f, g, h);

    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movl	$0, 12(%rsp)
	leaq	12(%rsp), %rsi
	movl	$0, 16(%rsp)
	movl	$0, 20(%rsp)
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebx
	movl	16(%rsp), %ecx
	movq	%r15, %rsi
	movl	12(%rsp), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leal	(%rbx,%rbx), %ebp
	addl	%ebp, %ebx
	movl	%ebp, %r14d
	movl	%ebp, %r13d
	movl	%ebp, %r8d
	subl	%ecx, %r14d
	movl	%ebx, %r12d
	subl	%edx, %r13d
	subl	%r14d, %r12d
	subl	%r13d, %r12d
	subl	%r12d, %r8d
	subl	%r8d, %ebx
	call	__printf_chk@PLT
	subl	%r13d, %ebx
	movl	20(%rsp), %ecx
	movl	%ebp, %edx
	subl	%ebx, %edx
	movl	%ebx, %r8d
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	movl	%r13d, %r8d
	movl	%r14d, %ecx
	movl	%r12d, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	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 %d %d"
.LC1:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movl	$0, 12(%rsp)
	leaq	12(%rsp), %rsi
	movl	$0, 16(%rsp)
	movl	$0, 20(%rsp)
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebx
	movl	16(%rsp), %ecx
	movq	%r15, %rsi
	movl	12(%rsp), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leal	(%rbx,%rbx), %ebp
	addl	%ebp, %ebx
	movl	%ebp, %r14d
	movl	%ebp, %r13d
	movl	%ebp, %r8d
	subl	%ecx, %r14d
	movl	%ebx, %r12d
	subl	%edx, %r13d
	subl	%r14d, %r12d
	subl	%r13d, %r12d
	subl	%r12d, %r8d
	subl	%r8d, %ebx
	call	__printf_chk@PLT
	subl	%r13d, %ebx
	movl	20(%rsp), %ecx
	movl	%ebp, %edx
	subl	%ebx, %edx
	movl	%ebx, %r8d
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	movl	%r13d, %r8d
	movl	%r14d, %ecx
	movl	%r12d, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	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 %d %d"
.LC1:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movl	$0, 12(%rsp)
	leaq	12(%rsp), %rsi
	movl	$0, 16(%rsp)
	movl	$0, 20(%rsp)
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebx
	movl	16(%rsp), %ecx
	movq	%r15, %rsi
	movl	12(%rsp), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leal	(%rbx,%rbx), %ebp
	addl	%ebp, %ebx
	movl	%ebp, %r14d
	movl	%ebp, %r13d
	movl	%ebp, %r8d
	subl	%ecx, %r14d
	movl	%ebx, %r12d
	subl	%edx, %r13d
	subl	%r14d, %r12d
	subl	%r13d, %r12d
	subl	%r12d, %r8d
	subl	%r8d, %ebx
	call	__printf_chk@PLT
	subl	%r13d, %ebx
	movl	20(%rsp), %ecx
	movl	%ebp, %edx
	subl	%ebx, %edx
	movl	%ebx, %r8d
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	movl	%r13d, %r8d
	movl	%r14d, %ecx
	movl	%r12d, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	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 = 0, b = 0, c = 0,
        d = 0, e = 0, f = 0,
        g = 0, h = 0, M = 0;

    scanf("%d %d %d", &a, &b, &M);

    g = 2*M - b;
    h = 2*M - a;
    f = 3*M - g - h;
    c = 2*M - f;
    e = 3*M - c - h;
    d = 2*M - e;

    printf("%d %d %d\n", a, b, c);
    printf("%d %d %d\n", d, M, e);
    printf("%d %d %d\n", f, g, h);

    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 = 0, b = 0, c = 0,
        d = 0, e = 0, f = 0,
        g = 0, h = 0, M = 0;

    scanf("%d %d %d", &a, &b, &M);

    g = 2*M - b;
    h = 2*M - a;
    f = 3*M - g - h;
    c = 2*M - f;
    e = 3*M - c - h;
    d = 2*M - e;

    printf("%d %d %d\n", a, b, c);
    printf("%d %d %d\n", d, M, e);
    printf("%d %d %d\n", f, g, h);

    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:

8
0
5
 1
0
1
 8
-1
5
 1
0
2
 1
-1
1
 1
-1
2
 1
-1
4
 1
0
4
 1
1
2
 1
-2
2

8 0 7
4 5 6
3 10 2
 1 0 2
2 1 0
0 2 1
 8 -1 8
5 5 5
2 11 2
 1 0 5
6 2 -2
-1 4 3
 1 -1 3
3 1 -1
-1 3 1
 1 -1 6
7 2 -3
-2 5 3
 1 -1 12
15 4 -7
-4 9 7
 1 0 11
14 4 -6
-3 8 7
 1 1 4
5 2 -1
0 3 3
 1 -2 7
8 2 -4
-3 6 3

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 = 0, b = 0, c = 0,
        d = 0, e = 0, f = 0,
        g = 0, h = 0, M = 0;

    scanf("%d %d %d", &a, &b, &M);

    g = 2*M - b;
    h = 2*M - a;
    f = 3*M - g - h;
    c = 2*M - f;
    e = 3*M - c - h;
    d = 2*M - e;

    printf("%d %d %d\n", a, b, c);
    printf("%d %d %d\n", d, M, e);
    printf("%d %d %d\n", f, g, h);

    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movl	$0, 12(%rsp)
	leaq	12(%rsp), %rsi
	movl	$0, 16(%rsp)
	movl	$0, 20(%rsp)
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebx
	movl	16(%rsp), %ecx
	movq	%r15, %rsi
	movl	12(%rsp), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leal	(%rbx,%rbx), %ebp
	addl	%ebp, %ebx
	movl	%ebp, %r14d
	movl	%ebp, %r13d
	movl	%ebp, %r8d
	subl	%ecx, %r14d
	movl	%ebx, %r12d
	subl	%edx, %r13d
	subl	%r14d, %r12d
	subl	%r13d, %r12d
	subl	%r12d, %r8d
	subl	%r8d, %ebx
	call	__printf_chk@PLT
	subl	%r13d, %ebx
	movl	20(%rsp), %ecx
	movl	%ebp, %edx
	subl	%ebx, %edx
	movl	%ebx, %r8d
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	movl	%r13d, %r8d
	movl	%r14d, %ecx
	movl	%r12d, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	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 %d %d"
.LC1:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	movl	$0, 12(%rsp)
	leaq	12(%rsp), %rsi
	movl	$0, 16(%rsp)
	movl	$0, 20(%rsp)
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebx
	movl	16(%rsp), %ecx
	movq	%r15, %rsi
	movl	12(%rsp), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leal	(%rbx,%rbx), %ebp
	addl	%ebp, %ebx
	movl	%ebp, %r14d
	movl	%ebp, %r13d
	movl	%ebp, %r8d
	subl	%ecx, %r14d
	movl	%ebx, %r12d
	subl	%edx, %r13d
	subl	%r14d, %r12d
	subl	%r13d, %r12d
	subl	%r12d, %r8d
	subl	%r8d, %ebx
	call	__printf_chk@PLT
	subl	%r13d, %ebx
	movl	20(%rsp), %ecx
	movl	%ebp, %edx
	subl	%ebx, %edx
	movl	%ebx, %r8d
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	movl	%r13d, %r8d
	movl	%r14d, %ecx
	movl	%r12d, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	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:
```