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>

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

    if (3 <= n && 3 <= m)
        printf("%lld\n", (n - 2) * (m - 2));
    else if (n == 2 || m == 2)
        printf("0\n");
    else if (n == 1) {
        switch (m) {
            case 1 : printf("1\n"); break;
            case 2 : printf("0\n"); break;
            case 3 : printf("1\n"); break;
            default : printf("%lld\n", m - 2); break;
        }
    }
    else {
        switch (n) {
            case 1 : printf("1\n"); break;
            case 2 : printf("0\n"); break;
            case 3 : printf("1\n"); break;
            default : printf("%lld\n", n - 2); break;
        }
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"0"
.LC3:
	.string	"1"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rax
	cmpq	$2, %rax
	jle	.L2
	movq	-16(%rbp), %rax
	cmpq	$2, %rax
	jle	.L2
	movq	-24(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-16(%rbp), %rax
	subq	$2, %rax
	imulq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	cmpq	$2, %rax
	je	.L4
	movq	-16(%rbp), %rax
	cmpq	$2, %rax
	jne	.L5
.L4:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L5:
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L6
	movq	-16(%rbp), %rax
	cmpq	$3, %rax
	je	.L7
	cmpq	$3, %rax
	jg	.L8
	cmpq	$1, %rax
	je	.L9
	cmpq	$2, %rax
	je	.L10
	jmp	.L8
.L9:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L10:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L7:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L8:
	movq	-16(%rbp), %rax
	subq	$2, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L3
.L6:
	movq	-24(%rbp), %rax
	cmpq	$3, %rax
	je	.L12
	cmpq	$3, %rax
	jg	.L13
	cmpq	$1, %rax
	je	.L14
	cmpq	$2, %rax
	je	.L15
	jmp	.L13
.L14:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L15:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L12:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L13:
	movq	-24(%rbp), %rax
	subq	$2, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
.L3:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"%lld%lld"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"0"
.LC3:
	.string	"1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	$2, %rdx
	jle	.L2
	movq	16(%rsp), %rax
	cmpq	$2, %rax
	jg	.L25
	je	.L5
	cmpq	$3, %rdx
	je	.L9
.L7:
	subq	$2, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L2:
	je	.L5
	movq	16(%rsp), %rax
	cmpq	$2, %rax
	je	.L5
	cmpq	$1, %rdx
	jne	.L7
	movq	%rax, %rdx
	andq	$-3, %rdx
	subq	$1, %rdx
	je	.L9
	leaq	-2(%rax), %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L4:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L25:
	.cfi_restore_state
	subq	$2, %rax
	subq	$2, %rdx
	movl	$1, %edi
	imulq	%rax, %rdx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L9:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L4
.L26:
	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	"%lld%lld"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"0"
.LC3:
	.string	"1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	$2, %rdx
	jle	.L2
	movq	16(%rsp), %rax
	cmpq	$2, %rax
	jg	.L25
	je	.L5
	cmpq	$3, %rdx
	je	.L9
.L7:
	subq	$2, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L2:
	je	.L5
	movq	16(%rsp), %rax
	cmpq	$2, %rax
	je	.L5
	cmpq	$1, %rdx
	jne	.L7
	movq	%rax, %rdx
	andq	$-3, %rdx
	subq	$1, %rdx
	je	.L9
	leaq	-2(%rax), %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L5:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L4:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L25:
	.cfi_restore_state
	subq	$2, %rax
	subq	$2, %rdx
	movl	$1, %edi
	imulq	%rax, %rdx
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L9:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	jmp	.L4
.L26:
	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>

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

    if (3 <= n && 3 <= m)
        printf("%lld\n", (n - 2) * (m - 2));
    else if (n == 2 || m == 2)
        printf("0\n");
    else if (n == 1) {
        switch (m) {
            case 1 : printf("1\n"); break;
            case 2 : printf("0\n"); break;
            case 3 : printf("1\n"); break;
            default : printf("%lld\n", m - 2); break;
        }
    }
    else {
        switch (n) {
            case 1 : printf("1\n"); break;
            case 2 : printf("0\n"); break;
            case 3 : printf("1\n"); break;
            default : printf("%lld\n", n - 2); break;
        }
    }

    return 0;
}
1 2
 582 1592
 0 0
 582 932
 0 -1
 1018 932
 1018 374
 527 374
 358 374
 592 374

0
 922200
 -2
 539400
 -2
 944880
 377952
 195300
 132432
 219480

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>

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

    if (3 <= n && 3 <= m)
        printf("%lld\n", (n - 2) * (m - 2));
    else if (n == 2 || m == 2)
        printf("0\n");
    else if (n == 1) {
        switch (m) {
            case 1 : printf("1\n"); break;
            case 2 : printf("0\n"); break;
            case 3 : printf("1\n"); break;
            default : printf("%lld\n", m - 2); break;
        }
    }
    else {
        switch (n) {
            case 1 : printf("1\n"); break;
            case 2 : printf("0\n"); break;
            case 3 : printf("1\n"); break;
            default : printf("%lld\n", n - 2); break;
        }
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"0"
.LC3:
	.string	"1"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rax
	cmpq	$2, %rax
	jle	.L2
	movq	-16(%rbp), %rax
	cmpq	$2, %rax
	jle	.L2
	movq	-24(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-16(%rbp), %rax
	subq	$2, %rax
	imulq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	cmpq	$2, %rax
	je	.L4
	movq	-16(%rbp), %rax
	cmpq	$2, %rax
	jne	.L5
.L4:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L5:
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L6
	movq	-16(%rbp), %rax
	cmpq	$3, %rax
	je	.L7
	cmpq	$3, %rax
	jg	.L8
	cmpq	$1, %rax
	je	.L9
	cmpq	$2, %rax
	je	.L10
	jmp	.L8
.L9:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L10:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L7:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L8:
	movq	-16(%rbp), %rax
	subq	$2, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L3
.L6:
	movq	-24(%rbp), %rax
	cmpq	$3, %rax
	je	.L12
	cmpq	$3, %rax
	jg	.L13
	cmpq	$1, %rax
	je	.L14
	cmpq	$2, %rax
	je	.L15
	jmp	.L13
.L14:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L15:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L12:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L13:
	movq	-24(%rbp), %rax
	subq	$2, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
.L3:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"%lld%lld"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"0"
.LC3:
	.string	"1"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rax
	cmpq	$2, %rax
	jle	.L2
	movq	-16(%rbp), %rax
	cmpq	$2, %rax
	jle	.L2
	movq	-24(%rbp), %rax
	leaq	-2(%rax), %rdx
	movq	-16(%rbp), %rax
	subq	$2, %rax
	imulq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L3
.L2:
	movq	-24(%rbp), %rax
	cmpq	$2, %rax
	je	.L4
	movq	-16(%rbp), %rax
	cmpq	$2, %rax
	jne	.L5
.L4:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L5:
	movq	-24(%rbp), %rax
	cmpq	$1, %rax
	jne	.L6
	movq	-16(%rbp), %rax
	cmpq	$3, %rax
	je	.L7
	cmpq	$3, %rax
	jg	.L8
	cmpq	$1, %rax
	je	.L9
	cmpq	$2, %rax
	je	.L10
	jmp	.L8
.L9:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L10:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L7:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L8:
	movq	-16(%rbp), %rax
	subq	$2, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L3
.L6:
	movq	-24(%rbp), %rax
	cmpq	$3, %rax
	je	.L12
	cmpq	$3, %rax
	jg	.L13
	cmpq	$1, %rax
	je	.L14
	cmpq	$2, %rax
	je	.L15
	jmp	.L13
.L14:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L15:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L12:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L3
.L13:
	movq	-24(%rbp), %rax
	subq	$2, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
.L3:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
