Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// 1の方を引く方針だけど、0を数える方がいい
#include<stdio.h>
typedef long long int ll;

int MAX(int a, int b){return a>b?a:b;}

int main(void){
    ll n,m;
    scanf("%lld%lld", &n,&m);

    ll ans = 0;

    if(n==1 && m==1){
        ans = 1;
    }else if(n==1 && m!=1){
        ans = m-2;
    }else if(n!=1 && m==1){
        ans = n-2;
    }else{
        ans = n*m;

        //両端は必ず1
        ans -= (n-2)*2+(m-2)*2+4;

        // //両端を覗く行、列数
        // ll space_line = n-2;
        // ll space_column = m-2;

        // これじゃ引く方逆や
        // if(space_line!=0 && space_column!=0){
        //     ans -= space_line * space_column;
        // }
    }

    printf("%lld\n", ans);
    // int map[n][m];
    // // 1:表 0:裏
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
    //         map[i][j] = 1;
    //     }
    // }

    // printf("\n");
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
    //         printf("%d ", map[i][j]);
    //     }
    //     printf("\n");
    // }

    // int dx[9] = {0, 1, 1, 1, 0, 0, -1, -1, -1};
    // int dy[9] = {0, 1, 0, -1, 1, -1, 1, 0, -1};

    // int tmpx,tmpy;
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
            
    //         for(int k=0; k<9; k++){
    //             tmpx = i+dx[k];
    //             tmpy = j+dy[k];

    //             if(0<=tmpx && tmpx<n && 0<=tmpy && tmpy<m){
    //                 map[tmpx][tmpy] = (map[tmpx][tmpy])^1;
    //             }
    //         }
    //     }
    // }

    // printf("\n");
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
    //         printf("%d ", map[i][j]);
    //     }
    //     printf("\n");
    // }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MAX, .-MAX
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	movq	-32(%rbp), %rax
	cmpq	$1, %rax
	jne	.L4
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L4
	movq	$1, -16(%rbp)
	jmp	.L5
.L4:
	movq	-32(%rbp), %rax
	cmpq	$1, %rax
	jne	.L6
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	je	.L6
	movq	-24(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -16(%rbp)
	jmp	.L5
.L6:
	movq	-32(%rbp), %rax
	cmpq	$1, %rax
	je	.L7
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L7
	movq	-32(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -16(%rbp)
	jmp	.L5
.L7:
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-24(%rbp), %rax
	subq	$2, %rax
	addq	%rdx, %rax
	addq	$2, %rax
	addq	%rax, %rax
	subq	%rax, -16(%rbp)
.L5:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovge	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	MAX, .-MAX
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	cmpq	$1, %rdx
	je	.L14
	movq	16(%rsp), %rax
	leaq	-2(%rdx), %r8
	cmpq	$1, %rax
	je	.L5
	imulq	%rax, %rdx
	addq	%r8, %rax
	addq	%rax, %rax
	subq	%rax, %rdx
	movq	%rdx, %r8
.L5:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	movq	16(%rsp), %r8
	cmpq	$1, %r8
	je	.L5
	subq	$2, %r8
	jmp	.L5
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovge	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	MAX, .-MAX
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	cmpq	$1, %rdx
	je	.L14
	movq	16(%rsp), %rax
	leaq	-2(%rdx), %r8
	cmpq	$1, %rax
	je	.L5
	imulq	%rax, %rdx
	addq	%r8, %rax
	addq	%rax, %rax
	subq	%rax, %rdx
	movq	%rdx, %r8
.L5:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	movq	16(%rsp), %r8
	cmpq	$1, %r8
	je	.L5
	subq	$2, %r8
	jmp	.L5
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

// 1の方を引く方針だけど、0を数える方がいい
#include<stdio.h>
typedef long long int ll;

int MAX(int a, int b){return a>b?a:b;}

int main(void){
    ll n,m;
    scanf("%lld%lld", &n,&m);

    ll ans = 0;

    if(n==1 && m==1){
        ans = 1;
    }else if(n==1 && m!=1){
        ans = m-2;
    }else if(n!=1 && m==1){
        ans = n-2;
    }else{
        ans = n*m;

        //両端は必ず1
        ans -= (n-2)*2+(m-2)*2+4;

        // //両端を覗く行、列数
        // ll space_line = n-2;
        // ll space_column = m-2;

        // これじゃ引く方逆や
        // if(space_line!=0 && space_column!=0){
        //     ans -= space_line * space_column;
        // }
    }

    printf("%lld\n", ans);
    // int map[n][m];
    // // 1:表 0:裏
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
    //         map[i][j] = 1;
    //     }
    // }

    // printf("\n");
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
    //         printf("%d ", map[i][j]);
    //     }
    //     printf("\n");
    // }

    // int dx[9] = {0, 1, 1, 1, 0, 0, -1, -1, -1};
    // int dy[9] = {0, 1, 0, -1, 1, -1, 1, 0, -1};

    // int tmpx,tmpy;
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
            
    //         for(int k=0; k<9; k++){
    //             tmpx = i+dx[k];
    //             tmpy = j+dy[k];

    //             if(0<=tmpx && tmpx<n && 0<=tmpy && tmpy<m){
    //                 map[tmpx][tmpy] = (map[tmpx][tmpy])^1;
    //             }
    //         }
    //     }
    // }

    // printf("\n");
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
    //         printf("%d ", map[i][j]);
    //     }
    //     printf("\n");
    // }

    return 0;
}
2 2

0

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// 1の方を引く方針だけど、0を数える方がいい
#include<stdio.h>
typedef long long int ll;

int MAX(int a, int b){return a>b?a:b;}

int main(void){
    ll n,m;
    scanf("%lld%lld", &n,&m);

    ll ans = 0;

    if(n==1 && m==1){
        ans = 1;
    }else if(n==1 && m!=1){
        ans = m-2;
    }else if(n!=1 && m==1){
        ans = n-2;
    }else{
        ans = n*m;

        //両端は必ず1
        ans -= (n-2)*2+(m-2)*2+4;

        // //両端を覗く行、列数
        // ll space_line = n-2;
        // ll space_column = m-2;

        // これじゃ引く方逆や
        // if(space_line!=0 && space_column!=0){
        //     ans -= space_line * space_column;
        // }
    }

    printf("%lld\n", ans);
    // int map[n][m];
    // // 1:表 0:裏
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
    //         map[i][j] = 1;
    //     }
    // }

    // printf("\n");
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
    //         printf("%d ", map[i][j]);
    //     }
    //     printf("\n");
    // }

    // int dx[9] = {0, 1, 1, 1, 0, 0, -1, -1, -1};
    // int dy[9] = {0, 1, 0, -1, 1, -1, 1, 0, -1};

    // int tmpx,tmpy;
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
            
    //         for(int k=0; k<9; k++){
    //             tmpx = i+dx[k];
    //             tmpy = j+dy[k];

    //             if(0<=tmpx && tmpx<n && 0<=tmpy && tmpy<m){
    //                 map[tmpx][tmpy] = (map[tmpx][tmpy])^1;
    //             }
    //         }
    //     }
    // }

    // printf("\n");
    // for(int i=0; i<n; i++){
    //     for(int j=0; j<m; j++){
    //         printf("%d ", map[i][j]);
    //     }
    //     printf("\n");
    // }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MAX, .-MAX
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	movq	-32(%rbp), %rax
	cmpq	$1, %rax
	jne	.L4
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L4
	movq	$1, -16(%rbp)
	jmp	.L5
.L4:
	movq	-32(%rbp), %rax
	cmpq	$1, %rax
	jne	.L6
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	je	.L6
	movq	-24(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -16(%rbp)
	jmp	.L5
.L6:
	movq	-32(%rbp), %rax
	cmpq	$1, %rax
	je	.L7
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L7
	movq	-32(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -16(%rbp)
	jmp	.L5
.L7:
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-24(%rbp), %rax
	subq	$2, %rax
	addq	%rdx, %rax
	addq	$2, %rax
	addq	%rax, %rax
	subq	%rax, -16(%rbp)
.L5:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MAX, .-MAX
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -16(%rbp)
	movq	-32(%rbp), %rax
	cmpq	$1, %rax
	jne	.L4
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L4
	movq	$1, -16(%rbp)
	jmp	.L5
.L4:
	movq	-32(%rbp), %rax
	cmpq	$1, %rax
	jne	.L6
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	je	.L6
	movq	-24(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -16(%rbp)
	jmp	.L5
.L6:
	movq	-32(%rbp), %rax
	cmpq	$1, %rax
	je	.L7
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L7
	movq	-32(%rbp), %rax
	subq	$2, %rax
	movq	%rax, -16(%rbp)
	jmp	.L5
.L7:
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-24(%rbp), %rax
	subq	$2, %rax
	addq	%rdx, %rax
	addq	$2, %rax
	addq	%rax, %rax
	subq	%rax, -16(%rbp)
.L5:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
