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>
#include <string.h>
#include <stdlib.h>

int i,j,k,h,r,mat[200][2][2],stk,ans;
int n,m;

int main(){
	while(scanf("%d",&n)*n){
		for(i=0;i<n;i++)scanf("%d %d",&mat[i][0][0],&mat[i][0][1]);
		mat[n][0][0]=9999;mat[n][0][1]=9999;
		scanf("%d",&m);
		for(i=0;i<m;i++)scanf("%d %d",&mat[i][1][0],&mat[i][1][1]);
		mat[m][1][0]=9999;mat[m][1][1]=9999;

		ans=n;h=0;r=0;
		for(i=0,j=0;j<m;j++){
			while(mat[j][1][0]>=mat[i][0][0] || mat[j][1][1]>=mat[i][0][1]){
				h=mat[i][0][0];r=mat[i][0][1];
				i++;
			}
			if(mat[j][1][0]>h && mat[j][1][1]>r){
				ans++;
				//printf("--%d %d\n",j,i);
				h=mat[j][1][0];r=mat[j][1][1];
			}
		}

		stk=m;h=0;r=0;
		for(i=0,j=0;i<n;i++){
			while(mat[i][0][0]>=mat[j][1][0] || mat[i][0][1]>=mat[j][1][1]){
				h=mat[j][1][0];r=mat[j][1][1];
				j++;
			}
			if(mat[i][0][0]>h && mat[i][0][1]>r){
				stk++;
				//printf("**%d %d\n",i,j);
				h=mat[i][0][0];r=mat[i][0][1];
			}
		}

		printf("%d\n",stk>ans?stk:ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	mat
	.align 32
	.type	mat, @object
	.size	mat, 3200
mat:
	.zero	3200
	.globl	stk
	.align 4
	.type	stk, @object
	.size	stk, 4
stk:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L2
.L17:
	movl	$0, i(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	leaq	4(%rax), %rdx
	leaq	mat(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	mat(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L4
	movl	n(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	movl	n(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L5
.L6:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	leaq	12(%rax), %rdx
	leaq	mat(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	leaq	8(%rax), %rcx
	leaq	mat(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	i(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jl	.L6
	movl	m(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	movl	m(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	movl	n(%rip), %eax
	movl	%eax, ans(%rip)
	movl	$0, h(%rip)
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	$0, j(%rip)
	jmp	.L7
.L9:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L8:
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L9
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	4+mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L9
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	r(%rip), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	ans(%rip), %eax
	addl	$1, %eax
	movl	%eax, ans(%rip)
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
.L10:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L7:
	movl	j(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jl	.L8
	movl	m(%rip), %eax
	movl	%eax, stk(%rip)
	movl	$0, h(%rip)
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	$0, j(%rip)
	jmp	.L12
.L14:
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L13:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	12+mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jle	.L15
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	r(%rip), %eax
	cmpl	%eax, %edx
	jle	.L15
	movl	stk(%rip), %eax
	addl	$1, %eax
	movl	%eax, stk(%rip)
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
.L15:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	movl	ans(%rip), %edx
	movl	stk(%rip), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	mat(%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	$24, %rsp
	.cfi_def_cfa_offset 80
.L2:
	leaq	n(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rdx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L43
	movl	$0, i(%rip)
	testl	%edx, %edx
	jle	.L3
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbx, %rdi
	salq	$4, %rax
	leaq	4(%r15,%rax), %rdx
	leaq	(%r15,%rax), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movslq	n(%rip), %rdx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L4
.L3:
	movq	.LC1(%rip), %rbp
	salq	$4, %rdx
	leaq	m(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	movq	%rbp, (%r15,%rdx)
	call	__isoc99_scanf@PLT
	movl	m(%rip), %r13d
	movl	$0, i(%rip)
	testl	%r13d, %r13d
	jle	.L5
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	cltq
	movq	%rbx, %rdi
	salq	$4, %rax
	leaq	12(%r15,%rax), %rdx
	leaq	8(%r15,%rax), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	m(%rip), %r13d
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%r13d, %eax
	jl	.L6
	movl	n(%rip), %r12d
	movslq	%r13d, %rax
	salq	$4, %rax
	movq	%rbp, 8(%r15,%rax)
	movl	%r12d, 8(%rsp)
	movl	%r12d, ans(%rip)
	testl	%r13d, %r13d
	jle	.L24
	leaq	8+mat(%rip), %r11
	leal	-1(%r13), %ebx
	xorl	%ebp, %ebp
	xorl	%edi, %edi
	salq	$4, %rbx
	leaq	16(%r11), %rax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	addq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%edi, %rdx
	movl	(%r11), %esi
	movl	4(%r11), %r10d
	movq	%rdx, %rax
	salq	$4, %rax
	leaq	4(%r15,%rax), %rax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rax), %r9d
	addq	$1, %rdx
	addq	$16, %rax
	movl	%ecx, %r8d
.L12:
	movl	-4(%rax), %ecx
	movl	%edx, %edi
	cmpl	%ecx, %esi
	jge	.L9
	cmpl	%r10d, (%rax)
	jle	.L9
	cmpl	%r8d, %esi
	jle	.L10
	cmpl	%r10d, %r9d
	jge	.L10
	addl	$1, %r12d
	movl	%r10d, %r9d
	movl	%esi, %r8d
	movl	$1, %ebp
.L10:
	addq	$16, %r11
	cmpq	%r11, %rbx
	jne	.L8
	movl	%r12d, 12(%rsp)
	testb	%bpl, %bpl
	je	.L24
	movl	%r12d, ans(%rip)
.L7:
	movl	8(%rsp), %eax
	movl	%r13d, stk(%rip)
	movl	$0, h(%rip)
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	$0, j(%rip)
	testl	%eax, %eax
	jle	.L26
	leal	-1(%rax), %r14d
	leaq	mat(%rip), %r12
	xorl	%ebx, %ebx
	xorl	%r8d, %r8d
	movl	%r13d, (%rsp)
	salq	$4, %r14
	leaq	16(%r12), %rax
	xorl	%r10d, %r10d
	movb	$0, 7(%rsp)
	addq	%rax, %r14
	xorl	%r11d, %r11d
	xorl	%r9d, %r9d
	movl	8+mat(%rip), %ecx
	movl	12+mat(%rip), %esi
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	%r8d, %rdx
	movl	(%r12), %edi
	movl	4(%r12), %ebp
	movq	%rdx, %rax
	salq	$4, %rax
	leaq	24(%r15,%rax), %rax
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L17:
	movl	4(%rax), %r9d
	movl	(%rax), %r8d
	movl	%esi, %r10d
	addq	$1, %rdx
	addq	$16, %rax
	movl	$1, %ebx
	movl	$1, %r11d
	movl	%r9d, %esi
	movl	%ecx, %r9d
	movl	%r8d, %ecx
.L20:
	movl	%edx, %r8d
	cmpl	%ecx, %edi
	jge	.L17
	cmpl	%ebp, %esi
	jle	.L17
	cmpl	%r9d, %edi
	jle	.L18
	cmpl	%ebp, %r10d
	jge	.L18
	addl	$1, (%rsp)
	movl	%ebp, %r10d
	movl	%edi, %r9d
	movl	$1, %r11d
	movb	$1, 7(%rsp)
.L18:
	addq	$16, %r12
	cmpq	%r14, %r12
	jne	.L16
	movl	8(%rsp), %eax
	cmpb	$0, 7(%rsp)
	movl	%eax, i(%rip)
	je	.L27
	movl	(%rsp), %eax
	movl	%eax, stk(%rip)
.L21:
	testb	%bl, %bl
	je	.L22
	movl	%r8d, j(%rip)
.L22:
	testb	%r11b, %r11b
	je	.L15
	movl	%r10d, r(%rip)
	movl	%r9d, h(%rip)
.L15:
	movl	12(%rsp), %eax
	movl	(%rsp), %edx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	cmpl	%edx, %eax
	cmovge	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L27:
	movl	%r13d, (%rsp)
	jmp	.L21
.L24:
	movl	8(%rsp), %eax
	movl	%eax, 12(%rsp)
	jmp	.L7
.L43:
	addq	$24, %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
.L26:
	.cfi_restore_state
	movl	%r13d, (%rsp)
	jmp	.L15
.L5:
	movslq	%r13d, %rax
	salq	$4, %rax
	movq	%rbp, 8(%r15,%rax)
	movl	n(%rip), %eax
	movl	%eax, 8(%rsp)
	movl	%eax, ans(%rip)
	movl	%eax, 12(%rsp)
	jmp	.L7
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	stk
	.align 4
	.type	stk, @object
	.size	stk, 4
stk:
	.zero	4
	.globl	mat
	.align 32
	.type	mat, @object
	.size	mat, 3200
mat:
	.zero	3200
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	9999
	.long	9999
	.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"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	mat(%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	$24, %rsp
	.cfi_def_cfa_offset 80
.L2:
	leaq	n(%rip), %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	n(%rip), %rdx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L43
	movl	$0, i(%rip)
	testl	%edx, %edx
	jle	.L3
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	movq	%rbx, %rdi
	salq	$4, %rax
	leaq	4(%r15,%rax), %rdx
	leaq	(%r15,%rax), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movslq	n(%rip), %rdx
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%edx, %eax
	jl	.L4
.L3:
	movq	.LC1(%rip), %rbp
	salq	$4, %rdx
	leaq	m(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	movq	%rbp, (%r15,%rdx)
	call	__isoc99_scanf@PLT
	movl	m(%rip), %r13d
	movl	$0, i(%rip)
	testl	%r13d, %r13d
	jle	.L5
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	cltq
	movq	%rbx, %rdi
	salq	$4, %rax
	leaq	12(%r15,%rax), %rdx
	leaq	8(%r15,%rax), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	movl	m(%rip), %r13d
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	%r13d, %eax
	jl	.L6
	movl	n(%rip), %r12d
	movslq	%r13d, %rax
	salq	$4, %rax
	movq	%rbp, 8(%r15,%rax)
	movl	%r12d, 8(%rsp)
	movl	%r12d, ans(%rip)
	testl	%r13d, %r13d
	jle	.L24
	leaq	8+mat(%rip), %r11
	leal	-1(%r13), %ebx
	xorl	%ebp, %ebp
	xorl	%edi, %edi
	salq	$4, %rbx
	leaq	16(%r11), %rax
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	addq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	movslq	%edi, %rdx
	movl	(%r11), %esi
	movl	4(%r11), %r10d
	movq	%rdx, %rax
	salq	$4, %rax
	leaq	4(%r15,%rax), %rax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rax), %r9d
	addq	$1, %rdx
	addq	$16, %rax
	movl	%ecx, %r8d
.L12:
	movl	-4(%rax), %ecx
	movl	%edx, %edi
	cmpl	%ecx, %esi
	jge	.L9
	cmpl	%r10d, (%rax)
	jle	.L9
	cmpl	%r8d, %esi
	jle	.L10
	cmpl	%r10d, %r9d
	jge	.L10
	addl	$1, %r12d
	movl	%r10d, %r9d
	movl	%esi, %r8d
	movl	$1, %ebp
.L10:
	addq	$16, %r11
	cmpq	%r11, %rbx
	jne	.L8
	movl	%r12d, 12(%rsp)
	testb	%bpl, %bpl
	je	.L24
	movl	%r12d, ans(%rip)
.L7:
	movl	8(%rsp), %eax
	movl	%r13d, stk(%rip)
	movl	$0, h(%rip)
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	$0, j(%rip)
	testl	%eax, %eax
	jle	.L26
	leal	-1(%rax), %r14d
	leaq	mat(%rip), %r12
	xorl	%ebx, %ebx
	xorl	%r8d, %r8d
	movl	%r13d, (%rsp)
	salq	$4, %r14
	leaq	16(%r12), %rax
	xorl	%r10d, %r10d
	movb	$0, 7(%rsp)
	addq	%rax, %r14
	xorl	%r11d, %r11d
	xorl	%r9d, %r9d
	movl	8+mat(%rip), %ecx
	movl	12+mat(%rip), %esi
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	%r8d, %rdx
	movl	(%r12), %edi
	movl	4(%r12), %ebp
	movq	%rdx, %rax
	salq	$4, %rax
	leaq	24(%r15,%rax), %rax
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L17:
	movl	4(%rax), %r9d
	movl	(%rax), %r8d
	movl	%esi, %r10d
	addq	$1, %rdx
	addq	$16, %rax
	movl	$1, %ebx
	movl	$1, %r11d
	movl	%r9d, %esi
	movl	%ecx, %r9d
	movl	%r8d, %ecx
.L20:
	movl	%edx, %r8d
	cmpl	%ecx, %edi
	jge	.L17
	cmpl	%ebp, %esi
	jle	.L17
	cmpl	%r9d, %edi
	jle	.L18
	cmpl	%ebp, %r10d
	jge	.L18
	addl	$1, (%rsp)
	movl	%ebp, %r10d
	movl	%edi, %r9d
	movl	$1, %r11d
	movb	$1, 7(%rsp)
.L18:
	addq	$16, %r12
	cmpq	%r14, %r12
	jne	.L16
	movl	8(%rsp), %eax
	cmpb	$0, 7(%rsp)
	movl	%eax, i(%rip)
	je	.L27
	movl	(%rsp), %eax
	movl	%eax, stk(%rip)
.L21:
	testb	%bl, %bl
	je	.L22
	movl	%r8d, j(%rip)
.L22:
	testb	%r11b, %r11b
	je	.L15
	movl	%r10d, r(%rip)
	movl	%r9d, h(%rip)
.L15:
	movl	12(%rsp), %eax
	movl	(%rsp), %edx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	cmpl	%edx, %eax
	cmovge	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L27:
	movl	%r13d, (%rsp)
	jmp	.L21
.L24:
	movl	8(%rsp), %eax
	movl	%eax, 12(%rsp)
	jmp	.L7
.L43:
	addq	$24, %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
.L26:
	.cfi_restore_state
	movl	%r13d, (%rsp)
	jmp	.L15
.L5:
	movslq	%r13d, %rax
	salq	$4, %rax
	movq	%rbp, 8(%r15,%rax)
	movl	n(%rip), %eax
	movl	%eax, 8(%rsp)
	movl	%eax, ans(%rip)
	movl	%eax, 12(%rsp)
	jmp	.L7
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	stk
	.align 4
	.type	stk, @object
	.size	stk, 4
stk:
	.zero	4
	.globl	mat
	.align 32
	.type	mat, @object
	.size	mat, 3200
mat:
	.zero	3200
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	9999
	.long	9999
	.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>
#include <string.h>
#include <stdlib.h>

int i,j,k,h,r,mat[200][2][2],stk,ans;
int n,m;

int main(){
	while(scanf("%d",&n)*n){
		for(i=0;i<n;i++)scanf("%d %d",&mat[i][0][0],&mat[i][0][1]);
		mat[n][0][0]=9999;mat[n][0][1]=9999;
		scanf("%d",&m);
		for(i=0;i<m;i++)scanf("%d %d",&mat[i][1][0],&mat[i][1][1]);
		mat[m][1][0]=9999;mat[m][1][1]=9999;

		ans=n;h=0;r=0;
		for(i=0,j=0;j<m;j++){
			while(mat[j][1][0]>=mat[i][0][0] || mat[j][1][1]>=mat[i][0][1]){
				h=mat[i][0][0];r=mat[i][0][1];
				i++;
			}
			if(mat[j][1][0]>h && mat[j][1][1]>r){
				ans++;
				//printf("--%d %d\n",j,i);
				h=mat[j][1][0];r=mat[j][1][1];
			}
		}

		stk=m;h=0;r=0;
		for(i=0,j=0;i<n;i++){
			while(mat[i][0][0]>=mat[j][1][0] || mat[i][0][1]>=mat[j][1][1]){
				h=mat[j][1][0];r=mat[j][1][1];
				j++;
			}
			if(mat[i][0][0]>h && mat[i][0][1]>r){
				stk++;
				//printf("**%d %d\n",i,j);
				h=mat[i][0][0];r=mat[i][0][1];
			}
		}

		printf("%d\n",stk>ans?stk:ans);
	}
	return 0;
}
6
1 1
4 3
6 5
8 6
10 10
14 14
5
2 1
5 4
6 6
9 8
15 10
4
1 1
4 3
6 5
8 6
3
2 2
5 4
6 6
4
1 1
4 3
6 5
8 6
4
10 10
12 11
18 15
24 20
0
 6
1 1
4 3
6 5
8 6
10 10
14 14
5
2 2
5 4
6 6
9 8
15 10
4
1 1
4 3
6 5
8 6
3
2 2
5 4
6 6
4
1 2
4 3
6 5
8 6
4
10 10
12 11
18 15
24 20
0
 6
1 1
4 3
6 5
8 6
10 10
14 14
5
2 2
5 4
6 6
9 8
15 10
4
1 1
4 3
6 5
8 6
3
4 2
5 4
6 6
4
1 1
4 3
6 5
8 6
4
10 10
12 11
18 15
24 20
0
 6
1 1
4 3
6 0
8 6
10 10
14 14
5
2 2
5 4
6 6
9 8
15 10
4
1 1
4 3
6 5
8 6
3
2 2
9 4
6 6
4
1 2
4 3
6 5
8 6
4
10 10
12 11
18 15
24 20
0
 6
1 1
4 3
6 0
8 6
10 10
14 14
5
2 2
5 4
6 6
9 10
15 10
4
1 1
4 3
6 5
12 6
3
2 2
9 4
9 6
4
1 2
4 3
6 5
8 6
4
10 10
12 11
18 15
24 20
0
 6
1 1
4 3
6 0
8 6
10 10
14 14
5
2 2
5 4
6 6
9 8
15 10
4
2 1
4 3
6 5
8 6
3
2 2
9 4
6 6
4
1 2
4 3
6 5
8 6
4
10 10
12 11
18 15
24 20
0
 6
1 1
4 3
6 0
8 6
10 10
14 14
5
2 2
5 4
6 6
9 10
15 10
4
1 1
4 3
6 5
12 6
3
1 2
9 4
9 6
4
1 2
4 3
6 5
8 6
4
10 10
12 11
18 15
24 20
0
 6
1 1
4 3
6 5
8 6
10 10
14 14
5
2 2
5 4
6 6
9 15
15 20
4
1 1
4 3
6 3
8 6
3
4 2
5 4
6 6
4
1 1
4 3
6 5
8 6
4
10 10
12 11
18 15
24 20
0
 6
0 1
4 3
6 5
8 6
10 10
14 14
5
2 1
5 5
6 6
9 8
15 10
4
1 1
4 3
6 5
8 6
3
2 2
5 4
6 6
4
1 1
4 3
6 5
8 6
4
10 10
12 11
18 15
24 20
0
 6
1 1
4 3
6 5
8 6
10 10
14 14
5
2 2
5 4
6 6
9 15
15 10
4
1 1
4 3
6 5
8 11
3
4 2
5 4
6 7
4
1 1
4 3
6 5
8 6
4
10 2
12 11
18 15
24 20
0

8
6
8
 9
6
8
 9
5
8
 8
5
8
 7
5
8
 8
4
8
 7
4
8
 9
4
8
 7
6
8
 8
5
7

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>
#include <string.h>
#include <stdlib.h>

int i,j,k,h,r,mat[200][2][2],stk,ans;
int n,m;

int main(){
	while(scanf("%d",&n)*n){
		for(i=0;i<n;i++)scanf("%d %d",&mat[i][0][0],&mat[i][0][1]);
		mat[n][0][0]=9999;mat[n][0][1]=9999;
		scanf("%d",&m);
		for(i=0;i<m;i++)scanf("%d %d",&mat[i][1][0],&mat[i][1][1]);
		mat[m][1][0]=9999;mat[m][1][1]=9999;

		ans=n;h=0;r=0;
		for(i=0,j=0;j<m;j++){
			while(mat[j][1][0]>=mat[i][0][0] || mat[j][1][1]>=mat[i][0][1]){
				h=mat[i][0][0];r=mat[i][0][1];
				i++;
			}
			if(mat[j][1][0]>h && mat[j][1][1]>r){
				ans++;
				//printf("--%d %d\n",j,i);
				h=mat[j][1][0];r=mat[j][1][1];
			}
		}

		stk=m;h=0;r=0;
		for(i=0,j=0;i<n;i++){
			while(mat[i][0][0]>=mat[j][1][0] || mat[i][0][1]>=mat[j][1][1]){
				h=mat[j][1][0];r=mat[j][1][1];
				j++;
			}
			if(mat[i][0][0]>h && mat[i][0][1]>r){
				stk++;
				//printf("**%d %d\n",i,j);
				h=mat[i][0][0];r=mat[i][0][1];
			}
		}

		printf("%d\n",stk>ans?stk:ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	mat
	.align 32
	.type	mat, @object
	.size	mat, 3200
mat:
	.zero	3200
	.globl	stk
	.align 4
	.type	stk, @object
	.size	stk, 4
stk:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L2
.L17:
	movl	$0, i(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	leaq	4(%rax), %rdx
	leaq	mat(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	mat(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L4
	movl	n(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	movl	n(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L5
.L6:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	leaq	12(%rax), %rdx
	leaq	mat(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	leaq	8(%rax), %rcx
	leaq	mat(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	i(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jl	.L6
	movl	m(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	movl	m(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	movl	n(%rip), %eax
	movl	%eax, ans(%rip)
	movl	$0, h(%rip)
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	$0, j(%rip)
	jmp	.L7
.L9:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L8:
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L9
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	4+mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L9
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	r(%rip), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	ans(%rip), %eax
	addl	$1, %eax
	movl	%eax, ans(%rip)
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
.L10:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L7:
	movl	j(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jl	.L8
	movl	m(%rip), %eax
	movl	%eax, stk(%rip)
	movl	$0, h(%rip)
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	$0, j(%rip)
	jmp	.L12
.L14:
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L13:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	12+mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jle	.L15
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	r(%rip), %eax
	cmpl	%eax, %edx
	jle	.L15
	movl	stk(%rip), %eax
	addl	$1, %eax
	movl	%eax, stk(%rip)
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
.L15:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	movl	ans(%rip), %edx
	movl	stk(%rip), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	mat
	.align 32
	.type	mat, @object
	.size	mat, 3200
mat:
	.zero	3200
	.globl	stk
	.align 4
	.type	stk, @object
	.size	stk, 4
stk:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	jmp	.L2
.L17:
	movl	$0, i(%rip)
	jmp	.L3
.L4:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	leaq	4(%rax), %rdx
	leaq	mat(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	mat(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L4
	movl	n(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	movl	n(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L5
.L6:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	leaq	12(%rax), %rdx
	leaq	mat(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	leaq	8(%rax), %rcx
	leaq	mat(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L5:
	movl	i(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jl	.L6
	movl	m(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	movl	m(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	$9999, (%rdx,%rax)
	movl	n(%rip), %eax
	movl	%eax, ans(%rip)
	movl	$0, h(%rip)
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	$0, j(%rip)
	jmp	.L7
.L9:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L8:
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L9
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	4+mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L9
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	r(%rip), %eax
	cmpl	%eax, %edx
	jle	.L10
	movl	ans(%rip), %eax
	addl	$1, %eax
	movl	%eax, ans(%rip)
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
.L10:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L7:
	movl	j(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	jl	.L8
	movl	m(%rip), %eax
	movl	%eax, stk(%rip)
	movl	$0, h(%rip)
	movl	$0, r(%rip)
	movl	$0, i(%rip)
	movl	$0, j(%rip)
	jmp	.L12
.L14:
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	12+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L13:
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	j(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	12+mat(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	h(%rip), %eax
	cmpl	%eax, %edx
	jle	.L15
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	r(%rip), %eax
	cmpl	%eax, %edx
	jle	.L15
	movl	stk(%rip), %eax
	addl	$1, %eax
	movl	%eax, stk(%rip)
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, h(%rip)
	movl	i(%rip), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	4+mat(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, r(%rip)
.L15:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L13
	movl	ans(%rip), %edx
	movl	stk(%rip), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
