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 h, w, n;
	int x, y, a, tx, ty;

	scanf("%d%d%d", &w, &h, &n);

    x = y = 0;
	for(int i=0; i < n; i++) {
        scanf("%d%d%d", &tx, &ty, &a);
		switch(a) {
		case 1:   if(x < tx)  x = tx;     break;
		case 2:   if(w > tx)  w = tx;     break;
		case 3:   if(y < ty)  y = ty;     break;
		case 4:   if(h > ty)  h = ty;     break;
		default:  break;
		}
        if(x >= w || y >= h){
            printf("0");
            return 0;
        }
	}
    printf("%d", (w-x)*(h-y));

	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
	.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
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	xorl	%ebx, %ebx
	leaq	28(%rsp), %r15
	leaq	36(%rsp), %r14
	xorl	%ebp, %ebp
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %r13
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	$2, %eax
	jne	.L18
	movl	20(%rsp), %eax
	movl	32(%rsp), %edx
	cmpl	%edx, %eax
	jle	.L9
	movl	%edx, 20(%rsp)
	movl	%edx, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%eax, 12(%rsp)
	jge	.L10
.L21:
	cmpl	%ebp, 16(%rsp)
	jle	.L10
	addl	$1, %ebx
	cmpl	%ebx, 24(%rsp)
	jle	.L2
.L13:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	cmpl	$3, %eax
	je	.L3
	jg	.L4
	cmpl	$1, %eax
	jne	.L20
	movl	12(%rsp), %ecx
	movl	32(%rsp), %eax
	cmpl	%eax, %ecx
	cmovge	%ecx, %eax
	movl	%eax, 12(%rsp)
.L18:
	movl	20(%rsp), %eax
	cmpl	%eax, 12(%rsp)
	jl	.L21
.L10:
	movl	$48, %edi
	call	putchar@PLT
.L12:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	cmpl	$4, %eax
	jne	.L18
	movl	36(%rsp), %edx
	movl	20(%rsp), %eax
	cmpl	%edx, 16(%rsp)
	jle	.L9
	movl	%edx, 16(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L3:
	movl	36(%rsp), %eax
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	movl	20(%rsp), %eax
	jmp	.L9
.L15:
	movl	$0, 12(%rsp)
	xorl	%ebp, %ebp
.L2:
	movl	16(%rsp), %eax
	movl	20(%rsp), %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	subl	12(%rsp), %edx
	subl	%ebp, %eax
	imull	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L22:
	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"
	.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
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	xorl	%ebx, %ebx
	leaq	28(%rsp), %r15
	leaq	36(%rsp), %r14
	xorl	%ebp, %ebp
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %r13
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	$2, %eax
	jne	.L18
	movl	20(%rsp), %eax
	movl	32(%rsp), %edx
	cmpl	%edx, %eax
	jle	.L9
	movl	%edx, 20(%rsp)
	movl	%edx, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%eax, 12(%rsp)
	jge	.L10
.L21:
	cmpl	%ebp, 16(%rsp)
	jle	.L10
	addl	$1, %ebx
	cmpl	%ebx, 24(%rsp)
	jle	.L2
.L13:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	cmpl	$3, %eax
	je	.L3
	jg	.L4
	cmpl	$1, %eax
	jne	.L20
	movl	12(%rsp), %ecx
	movl	32(%rsp), %eax
	cmpl	%eax, %ecx
	cmovge	%ecx, %eax
	movl	%eax, 12(%rsp)
.L18:
	movl	20(%rsp), %eax
	cmpl	%eax, 12(%rsp)
	jl	.L21
.L10:
	movl	$48, %edi
	call	putchar@PLT
.L12:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	cmpl	$4, %eax
	jne	.L18
	movl	36(%rsp), %edx
	movl	20(%rsp), %eax
	cmpl	%edx, 16(%rsp)
	jle	.L9
	movl	%edx, 16(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L3:
	movl	36(%rsp), %eax
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	movl	20(%rsp), %eax
	jmp	.L9
.L15:
	movl	$0, 12(%rsp)
	xorl	%ebp, %ebp
.L2:
	movl	16(%rsp), %eax
	movl	20(%rsp), %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	subl	12(%rsp), %edx
	subl	%ebp, %eax
	imull	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L22:
	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"
	.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
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	xorl	%ebx, %ebx
	leaq	28(%rsp), %r15
	leaq	36(%rsp), %r14
	xorl	%ebp, %ebp
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %r13
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	$2, %eax
	jne	.L18
	movl	20(%rsp), %eax
	movl	32(%rsp), %edx
	cmpl	%edx, %eax
	jle	.L9
	movl	%edx, 20(%rsp)
	movl	%edx, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%eax, 12(%rsp)
	jge	.L10
.L21:
	cmpl	%ebp, 16(%rsp)
	jle	.L10
	addl	$1, %ebx
	cmpl	%ebx, 24(%rsp)
	jle	.L2
.L13:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	cmpl	$3, %eax
	je	.L3
	jg	.L4
	cmpl	$1, %eax
	jne	.L20
	movl	12(%rsp), %ecx
	movl	32(%rsp), %eax
	cmpl	%eax, %ecx
	cmovge	%ecx, %eax
	movl	%eax, 12(%rsp)
.L18:
	movl	20(%rsp), %eax
	cmpl	%eax, 12(%rsp)
	jl	.L21
.L10:
	movl	$48, %edi
	call	putchar@PLT
.L12:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	cmpl	$4, %eax
	jne	.L18
	movl	36(%rsp), %edx
	movl	20(%rsp), %eax
	cmpl	%edx, 16(%rsp)
	jle	.L9
	movl	%edx, 16(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L3:
	movl	36(%rsp), %eax
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	movl	20(%rsp), %eax
	jmp	.L9
.L15:
	movl	$0, 12(%rsp)
	xorl	%ebp, %ebp
.L2:
	movl	16(%rsp), %eax
	movl	20(%rsp), %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	subl	12(%rsp), %edx
	subl	%ebp, %eax
	imull	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L22:
	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 h, w, n;
	int x, y, a, tx, ty;

	scanf("%d%d%d", &w, &h, &n);

    x = y = 0;
	for(int i=0; i < n; i++) {
        scanf("%d%d%d", &tx, &ty, &a);
		switch(a) {
		case 1:   if(x < tx)  x = tx;     break;
		case 2:   if(w > tx)  w = tx;     break;
		case 3:   if(y < ty)  y = ty;     break;
		case 4:   if(h > ty)  h = ty;     break;
		default:  break;
		}
        if(x >= w || y >= h){
            printf("0");
            return 0;
        }
	}
    printf("%d", (w-x)*(h-y));

	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 h, w, n;
	int x, y, a, tx, ty;

	scanf("%d%d%d", &w, &h, &n);

    x = y = 0;
	for(int i=0; i < n; i++) {
        scanf("%d%d%d", &tx, &ty, &a);
		switch(a) {
		case 1:   if(x < tx)  x = tx;     break;
		case 2:   if(w > tx)  w = tx;     break;
		case 3:   if(y < ty)  y = ty;     break;
		case 4:   if(h > ty)  h = ty;     break;
		default:  break;
		}
        if(x >= w || y >= h){
            printf("0");
            return 0;
        }
	}
    printf("%d", (w-x)*(h-y));

	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:

5 4 3
2 1 1
3 6 4
1 4 2
 5 4 2
2 1 1
6 3 4
 5 4 2
2 1 2
6 3 4
 10 10 5
1 6 1
4 1 1
6 9 4
9 4 2
3 1 4
 5 4 1
2 1 2
6 3 4
 5 4 3
2 0 2
2 6 2
1 4 2
 10 10 5
1 14 1
4 1 1
6 4 4
9 0 2
3 2 4
 10 10 5
1 6 1
4 1 3
6 9 4
9 4 2
3 0 3
 5 1 3
2 0 2
2 11 2
2 4 2
 5 6 3
2 0 2
3 11 2
2 4 2

0 9 6 5 8 4 10 64 2 12
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 h, w, n;
	int x, y, a, tx, ty;

	scanf("%d%d%d", &w, &h, &n);

    x = y = 0;
	for(int i=0; i < n; i++) {
        scanf("%d%d%d", &tx, &ty, &a);
		switch(a) {
		case 1:   if(x < tx)  x = tx;     break;
		case 2:   if(w > tx)  w = tx;     break;
		case 3:   if(y < ty)  y = ty;     break;
		case 4:   if(h > ty)  h = ty;     break;
		default:  break;
		}
        if(x >= w || y >= h){
            printf("0");
            return 0;
        }
	}
    printf("%d", (w-x)*(h-y));

	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
	.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
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	xorl	%ebx, %ebx
	leaq	28(%rsp), %r15
	leaq	36(%rsp), %r14
	xorl	%ebp, %ebp
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %r13
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	$2, %eax
	jne	.L18
	movl	20(%rsp), %eax
	movl	32(%rsp), %edx
	cmpl	%edx, %eax
	jle	.L9
	movl	%edx, 20(%rsp)
	movl	%edx, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%eax, 12(%rsp)
	jge	.L10
.L21:
	cmpl	%ebp, 16(%rsp)
	jle	.L10
	addl	$1, %ebx
	cmpl	%ebx, 24(%rsp)
	jle	.L2
.L13:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	cmpl	$3, %eax
	je	.L3
	jg	.L4
	cmpl	$1, %eax
	jne	.L20
	movl	12(%rsp), %ecx
	movl	32(%rsp), %eax
	cmpl	%eax, %ecx
	cmovge	%ecx, %eax
	movl	%eax, 12(%rsp)
.L18:
	movl	20(%rsp), %eax
	cmpl	%eax, 12(%rsp)
	jl	.L21
.L10:
	movl	$48, %edi
	call	putchar@PLT
.L12:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	cmpl	$4, %eax
	jne	.L18
	movl	36(%rsp), %edx
	movl	20(%rsp), %eax
	cmpl	%edx, 16(%rsp)
	jle	.L9
	movl	%edx, 16(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L3:
	movl	36(%rsp), %eax
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	movl	20(%rsp), %eax
	jmp	.L9
.L15:
	movl	$0, 12(%rsp)
	xorl	%ebp, %ebp
.L2:
	movl	16(%rsp), %eax
	movl	20(%rsp), %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	subl	12(%rsp), %edx
	subl	%ebp, %eax
	imull	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L22:
	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"
	.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
	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
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rcx
	leaq	16(%rsp), %rdx
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	xorl	%ebx, %ebx
	leaq	28(%rsp), %r15
	leaq	36(%rsp), %r14
	xorl	%ebp, %ebp
	movl	$0, 12(%rsp)
	leaq	32(%rsp), %r13
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	$2, %eax
	jne	.L18
	movl	20(%rsp), %eax
	movl	32(%rsp), %edx
	cmpl	%edx, %eax
	jle	.L9
	movl	%edx, 20(%rsp)
	movl	%edx, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%eax, 12(%rsp)
	jge	.L10
.L21:
	cmpl	%ebp, 16(%rsp)
	jle	.L10
	addl	$1, %ebx
	cmpl	%ebx, 24(%rsp)
	jle	.L2
.L13:
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	cmpl	$3, %eax
	je	.L3
	jg	.L4
	cmpl	$1, %eax
	jne	.L20
	movl	12(%rsp), %ecx
	movl	32(%rsp), %eax
	cmpl	%eax, %ecx
	cmovge	%ecx, %eax
	movl	%eax, 12(%rsp)
.L18:
	movl	20(%rsp), %eax
	cmpl	%eax, 12(%rsp)
	jl	.L21
.L10:
	movl	$48, %edi
	call	putchar@PLT
.L12:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$56, %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
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	cmpl	$4, %eax
	jne	.L18
	movl	36(%rsp), %edx
	movl	20(%rsp), %eax
	cmpl	%edx, 16(%rsp)
	jle	.L9
	movl	%edx, 16(%rsp)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L3:
	movl	36(%rsp), %eax
	cmpl	%eax, %ebp
	cmovl	%eax, %ebp
	movl	20(%rsp), %eax
	jmp	.L9
.L15:
	movl	$0, 12(%rsp)
	xorl	%ebp, %ebp
.L2:
	movl	16(%rsp), %eax
	movl	20(%rsp), %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	subl	12(%rsp), %edx
	subl	%ebp, %eax
	imull	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L12
.L22:
	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:
```