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(){

	int W,H,N = 0;
	scanf("%d %d %d",&W,&H,&N);
	int genten[2] = {0,0};
	int kado[2] = {W,H};
	int S = 0;

	int WW[N],HH[N],NN[N];
	for(int i=0; i<N; i++){
		scanf("%d %d %d",&WW[i],&HH[i],&NN[i]);
	}

	for(int j=0; j<N; j++){
		if(NN[j]==1){
			if(genten[0] < WW[j]){
				genten [0] = WW[j];
			}
		}else if(NN[j]==2){
			if(kado[0] > WW[j]){
				kado[0]	= WW[j];
			}
		}else if(NN[j]==3){
			if(genten[1] < HH[j]){
				genten [1] = HH[j];
			}
		}else{
			if(kado[1] > HH[j]){
				kado[1]	= HH[j];
			}
		}
	}

	if((kado[0]-genten[0] > 0) &&  (kado[1]-genten[1] > 0 ) ){
		S = (kado[0]-genten[0])*(kado[1]-genten[1]);
	}else{
		S = 0;
	}

	printf("%d",S);

	return 0;

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -136(%rbp)
	leaq	-136(%rbp), %rax
	leaq	-140(%rbp), %rdx
	leaq	-144(%rbp), %rsi
	movq	%rax, %rcx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -72(%rbp)
	movl	$0, -68(%rbp)
	movl	-144(%rbp), %eax
	movl	%eax, -64(%rbp)
	movl	-140(%rbp), %eax
	movl	%eax, -60(%rbp)
	movl	$0, -132(%rbp)
	movl	-136(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -112(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -104(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L11
.L12:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rax, %rdx
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-112(%rbp), %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -128(%rbp)
.L11:
	movl	-136(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L12
	movl	$0, -124(%rbp)
	jmp	.L13
.L18:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jne	.L14
	movl	-72(%rbp), %ecx
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jge	.L15
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -72(%rbp)
	jmp	.L15
.L14:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$2, %eax
	jne	.L16
	movl	-64(%rbp), %ecx
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jle	.L15
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -64(%rbp)
	jmp	.L15
.L16:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$3, %eax
	jne	.L17
	movl	-68(%rbp), %ecx
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jge	.L15
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -68(%rbp)
	jmp	.L15
.L17:
	movl	-60(%rbp), %ecx
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jle	.L15
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -60(%rbp)
.L15:
	addl	$1, -124(%rbp)
.L13:
	movl	-136(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L18
	movl	-64(%rbp), %eax
	movl	-72(%rbp), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jle	.L19
	movl	-60(%rbp), %eax
	movl	-68(%rbp), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jle	.L19
	movl	-64(%rbp), %eax
	movl	-72(%rbp), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-60(%rbp), %eax
	movl	-68(%rbp), %ecx
	subl	%ecx, %eax
	imull	%edx, %eax
	movl	%eax, -132(%rbp)
	jmp	.L20
.L19:
	movl	$0, -132(%rbp)
.L20:
	movl	-132(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	"%d %d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$72, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movl	$0, -60(%rbp)
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %eax
	movq	%rsp, %rsi
	movl	%eax, -96(%rbp)
	movl	-64(%rbp), %eax
	movl	%eax, -92(%rbp)
	movslq	-60(%rbp), %rax
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L37:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L37
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L38
.L4:
	movq	%rax, %rdi
	movq	%rsp, -104(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L38:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L39
.L7:
	movq	%rsp, -112(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rsi
.L8:
	cmpq	%rsi, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L39:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L9:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L10
	orq	$0, -8(%rsp,%rdx)
.L10:
	movq	%rsp, %r12
	movq	%r12, -88(%rbp)
	testl	%ecx, %ecx
	jle	.L21
	movq	-104(%rbp), %r15
	movq	-112(%rbp), %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r12, %rcx
	movq	%r14, %rdx
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	addq	$4, %r15
	addq	$4, %r14
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addq	$4, %r12
	cmpl	%r13d, %eax
	jg	.L12
	testl	%eax, %eax
	jle	.L21
	movslq	%eax, %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	xorl	%edi, %edi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	$2, %ecx
	je	.L40
	movq	-112(%rbp), %rbx
	movl	(%rbx,%rax,4), %esi
	cmpl	$3, %ecx
	je	.L41
	movl	-92(%rbp), %ebx
	cmpl	%esi, %ebx
	cmovle	%ebx, %esi
	movl	%esi, -92(%rbp)
.L14:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L11
.L17:
	movq	-88(%rbp), %rbx
	movl	(%rbx,%rax,4), %ecx
	cmpl	$1, %ecx
	jne	.L13
	movq	-104(%rbp), %rsi
	movl	(%rsi,%rax,4), %ecx
	cmpl	%ecx, %edi
	cmovl	%ecx, %edi
	addq	$1, %rax
	cmpq	%rdx, %rax
	jne	.L17
.L11:
	movl	-96(%rbp), %r13d
	xorl	%edx, %edx
	subl	%edi, %r13d
	testl	%r13d, %r13d
	jle	.L18
	movl	-92(%rbp), %r12d
	subl	%r8d, %r12d
	testl	%r12d, %r12d
	jle	.L18
	movl	%r13d, %edx
	imull	%r12d, %edx
.L18:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L42
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L40:
	.cfi_restore_state
	movq	-104(%rbp), %rbx
	movl	-96(%rbp), %esi
	movl	(%rbx,%rax,4), %ecx
	cmpl	%ecx, %esi
	cmovle	%esi, %ecx
	movl	%ecx, -96(%rbp)
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L41:
	cmpl	%esi, %r8d
	cmovl	%esi, %r8d
	jmp	.L14
.L21:
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	jmp	.L11
.L42:
	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	"%d %d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$72, %rsp
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movl	$0, -60(%rbp)
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %eax
	movq	%rsp, %rsi
	movl	%eax, -96(%rbp)
	movl	-64(%rbp), %eax
	movl	%eax, -92(%rbp)
	movslq	-60(%rbp), %rax
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L37:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L37
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L38
.L4:
	movq	%rax, %rdi
	movq	%rsp, -104(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L38:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L39
.L7:
	movq	%rsp, -112(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rsi
.L8:
	cmpq	%rsi, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L39:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L9:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L10
	orq	$0, -8(%rsp,%rdx)
.L10:
	movq	%rsp, %r12
	movq	%r12, -88(%rbp)
	testl	%ecx, %ecx
	jle	.L21
	movq	-104(%rbp), %r15
	movq	-112(%rbp), %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r12, %rcx
	movq	%r14, %rdx
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	addq	$4, %r15
	addq	$4, %r14
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addq	$4, %r12
	cmpl	%r13d, %eax
	jg	.L12
	testl	%eax, %eax
	jle	.L21
	movslq	%eax, %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	xorl	%edi, %edi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	$2, %ecx
	je	.L40
	movq	-112(%rbp), %rbx
	movl	(%rbx,%rax,4), %esi
	cmpl	$3, %ecx
	je	.L41
	movl	-92(%rbp), %ebx
	cmpl	%esi, %ebx
	cmovle	%ebx, %esi
	movl	%esi, -92(%rbp)
.L14:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L11
.L17:
	movq	-88(%rbp), %rbx
	movl	(%rbx,%rax,4), %ecx
	cmpl	$1, %ecx
	jne	.L13
	movq	-104(%rbp), %rsi
	movl	(%rsi,%rax,4), %ecx
	cmpl	%ecx, %edi
	cmovl	%ecx, %edi
	addq	$1, %rax
	cmpq	%rdx, %rax
	jne	.L17
.L11:
	movl	-96(%rbp), %r13d
	xorl	%edx, %edx
	subl	%edi, %r13d
	testl	%r13d, %r13d
	jle	.L18
	movl	-92(%rbp), %r12d
	subl	%r8d, %r12d
	testl	%r12d, %r12d
	jle	.L18
	movl	%r13d, %edx
	imull	%r12d, %edx
.L18:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L42
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L40:
	.cfi_restore_state
	movq	-104(%rbp), %rbx
	movl	-96(%rbp), %esi
	movl	(%rbx,%rax,4), %ecx
	cmpl	%ecx, %esi
	cmovle	%esi, %ecx
	movl	%ecx, -96(%rbp)
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L41:
	cmpl	%esi, %r8d
	cmovl	%esi, %r8d
	jmp	.L14
.L21:
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	jmp	.L11
.L42:
	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(){

	int W,H,N = 0;
	scanf("%d %d %d",&W,&H,&N);
	int genten[2] = {0,0};
	int kado[2] = {W,H};
	int S = 0;

	int WW[N],HH[N],NN[N];
	for(int i=0; i<N; i++){
		scanf("%d %d %d",&WW[i],&HH[i],&NN[i]);
	}

	for(int j=0; j<N; j++){
		if(NN[j]==1){
			if(genten[0] < WW[j]){
				genten [0] = WW[j];
			}
		}else if(NN[j]==2){
			if(kado[0] > WW[j]){
				kado[0]	= WW[j];
			}
		}else if(NN[j]==3){
			if(genten[1] < HH[j]){
				genten [1] = HH[j];
			}
		}else{
			if(kado[1] > HH[j]){
				kado[1]	= HH[j];
			}
		}
	}

	if((kado[0]-genten[0] > 0) &&  (kado[1]-genten[1] > 0 ) ){
		S = (kado[0]-genten[0])*(kado[1]-genten[1]);
	}else{
		S = 0;
	}

	printf("%d",S);

	return 0;

}

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

```c
#include<stdio.h>

int main(){

	int W,H,N = 0;
	scanf("%d %d %d",&W,&H,&N);
	int genten[2] = {0,0};
	int kado[2] = {W,H};
	int S = 0;

	int WW[N],HH[N],NN[N];
	for(int i=0; i<N; i++){
		scanf("%d %d %d",&WW[i],&HH[i],&NN[i]);
	}

	for(int j=0; j<N; j++){
		if(NN[j]==1){
			if(genten[0] < WW[j]){
				genten [0] = WW[j];
			}
		}else if(NN[j]==2){
			if(kado[0] > WW[j]){
				kado[0]	= WW[j];
			}
		}else if(NN[j]==3){
			if(genten[1] < HH[j]){
				genten [1] = HH[j];
			}
		}else{
			if(kado[1] > HH[j]){
				kado[1]	= HH[j];
			}
		}
	}

	if((kado[0]-genten[0] > 0) &&  (kado[1]-genten[1] > 0 ) ){
		S = (kado[0]-genten[0])*(kado[1]-genten[1]);
	}else{
		S = 0;
	}

	printf("%d",S);

	return 0;

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -136(%rbp)
	leaq	-136(%rbp), %rax
	leaq	-140(%rbp), %rdx
	leaq	-144(%rbp), %rsi
	movq	%rax, %rcx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -72(%rbp)
	movl	$0, -68(%rbp)
	movl	-144(%rbp), %eax
	movl	%eax, -64(%rbp)
	movl	-140(%rbp), %eax
	movl	%eax, -60(%rbp)
	movl	$0, -132(%rbp)
	movl	-136(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -112(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -104(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L11
.L12:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rax, %rdx
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-112(%rbp), %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -128(%rbp)
.L11:
	movl	-136(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L12
	movl	$0, -124(%rbp)
	jmp	.L13
.L18:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jne	.L14
	movl	-72(%rbp), %ecx
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jge	.L15
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -72(%rbp)
	jmp	.L15
.L14:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$2, %eax
	jne	.L16
	movl	-64(%rbp), %ecx
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jle	.L15
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -64(%rbp)
	jmp	.L15
.L16:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$3, %eax
	jne	.L17
	movl	-68(%rbp), %ecx
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jge	.L15
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -68(%rbp)
	jmp	.L15
.L17:
	movl	-60(%rbp), %ecx
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jle	.L15
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -60(%rbp)
.L15:
	addl	$1, -124(%rbp)
.L13:
	movl	-136(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L18
	movl	-64(%rbp), %eax
	movl	-72(%rbp), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jle	.L19
	movl	-60(%rbp), %eax
	movl	-68(%rbp), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jle	.L19
	movl	-64(%rbp), %eax
	movl	-72(%rbp), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-60(%rbp), %eax
	movl	-68(%rbp), %ecx
	subl	%ecx, %eax
	imull	%edx, %eax
	movl	%eax, -132(%rbp)
	jmp	.L20
.L19:
	movl	$0, -132(%rbp)
.L20:
	movl	-132(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	"%d %d %d"
.LC1:
	.string	"%d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -136(%rbp)
	leaq	-136(%rbp), %rax
	leaq	-140(%rbp), %rdx
	leaq	-144(%rbp), %rsi
	movq	%rax, %rcx
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -72(%rbp)
	movl	$0, -68(%rbp)
	movl	-144(%rbp), %eax
	movl	%eax, -64(%rbp)
	movl	-140(%rbp), %eax
	movl	%eax, -60(%rbp)
	movl	$0, -132(%rbp)
	movl	-136(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -112(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -104(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L11
.L12:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rax, %rdx
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-112(%rbp), %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -128(%rbp)
.L11:
	movl	-136(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L12
	movl	$0, -124(%rbp)
	jmp	.L13
.L18:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$1, %eax
	jne	.L14
	movl	-72(%rbp), %ecx
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jge	.L15
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -72(%rbp)
	jmp	.L15
.L14:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$2, %eax
	jne	.L16
	movl	-64(%rbp), %ecx
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jle	.L15
	movq	-112(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -64(%rbp)
	jmp	.L15
.L16:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$3, %eax
	jne	.L17
	movl	-68(%rbp), %ecx
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jge	.L15
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -68(%rbp)
	jmp	.L15
.L17:
	movl	-60(%rbp), %ecx
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jle	.L15
	movq	-96(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, -60(%rbp)
.L15:
	addl	$1, -124(%rbp)
.L13:
	movl	-136(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L18
	movl	-64(%rbp), %eax
	movl	-72(%rbp), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jle	.L19
	movl	-60(%rbp), %eax
	movl	-68(%rbp), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jle	.L19
	movl	-64(%rbp), %eax
	movl	-72(%rbp), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-60(%rbp), %eax
	movl	-68(%rbp), %ecx
	subl	%ecx, %eax
	imull	%edx, %eax
	movl	%eax, -132(%rbp)
	jmp	.L20
.L19:
	movl	$0, -132(%rbp)
.L20:
	movl	-132(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
