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 n,m,i,j,k,l,x,y,p,r,t=0,h[20],w[20],q[1<<16],d[1<<16]={1};
int MIN(int a,int b){return a<b?a:b;}
int MAX(int a,int b){return a<b?b:a;}
int main(){
	char s[20],c[5]={"RGB"};
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d %d",&h[i],&w[i]);
	for(i=0;i<16;i++)scanf(" %c",&s[i]);
	q[t=0]=0;
	for(r=1;r-t;t++){
		for(i=0;i<n;i++){
			for(j=0;j<3;j++){
				for(k=-h[i]+1;k<4;k++){
					for(l=-w[i]+1;l<4;l++){
						m=q[t];
						for(y=MAX(0,k);y<MIN(4,k+h[i]);y++){
							for(x=MAX(0,l);x<MIN(4,l+w[i]);x++){
								//if(k+y<0||3<k+y||l+x<0||3<l+x)continue;
								p=(y)*4+x;
								if(s[p]==c[j])m|= (1<<p);
								else          m&=~(1<<p);
							}
						}//f(m);
						if(d[m]==0)d[q[r++]=m]=d[q[t]]+1;
					}
				}//printf("\n%d\n\n",r);
			}
		}//printf("\n\n%d ",r);
		//f(q[t]);
	}
	//for(i=0;i<(1<<16);i++)printf("%d\n",d[i]);
	printf("%d\n",d[(1<<16)-1]-1);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.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	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 80
h:
	.zero	80
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 80
w:
	.zero	80
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 262144
q:
	.zero	262144
	.globl	d
	.data
	.align 32
	.type	d, @object
	.size	d, 262144
d:
	.long	1
	.zero	262140
	.text
	.globl	MIN
	.type	MIN, @function
MIN:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MIN, .-MIN
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	MAX, .-MAX
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	" %c"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$4343634, -37(%rbp)
	movb	$0, -33(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L6
.L7:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	$0, i(%rip)
	jmp	.L8
.L9:
	movl	i(%rip), %eax
	leaq	-32(%rbp), %rdx
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L8:
	movl	i(%rip), %eax
	cmpl	$15, %eax
	jle	.L9
	movl	$0, t(%rip)
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$1, r(%rip)
	jmp	.L10
.L26:
	movl	$0, i(%rip)
	jmp	.L11
.L25:
	movl	$0, j(%rip)
	jmp	.L12
.L24:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, k(%rip)
	jmp	.L13
.L23:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, l(%rip)
	jmp	.L14
.L22:
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, m(%rip)
	movl	k(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	MAX
	movl	%eax, y(%rip)
	jmp	.L15
.L20:
	movl	l(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	MAX
	movl	%eax, x(%rip)
	jmp	.L16
.L19:
	movl	y(%rip), %eax
	leal	0(,%rax,4), %edx
	movl	x(%rip), %eax
	addl	%edx, %eax
	movl	%eax, p(%rip)
	movl	p(%rip), %eax
	cltq
	movzbl	-32(%rbp,%rax), %edx
	movl	j(%rip), %eax
	cltq
	movzbl	-37(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L17
	movl	p(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	m(%rip), %eax
	orl	%edx, %eax
	movl	%eax, m(%rip)
	jmp	.L18
.L17:
	movl	p(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	notl	%eax
	movl	%eax, %edx
	movl	m(%rip), %eax
	andl	%edx, %eax
	movl	%eax, m(%rip)
.L18:
	movl	x(%rip), %eax
	addl	$1, %eax
	movl	%eax, x(%rip)
.L16:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	l(%rip), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	movl	$4, %edi
	call	MIN
	movl	x(%rip), %edx
	cmpl	%edx, %eax
	jg	.L19
	movl	y(%rip), %eax
	addl	$1, %eax
	movl	%eax, y(%rip)
.L15:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	k(%rip), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	movl	$4, %edi
	call	MIN
	movl	y(%rip), %edx
	cmpl	%edx, %eax
	jg	.L20
	movl	m(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L21
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	r(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, r(%rip)
	movl	m(%rip), %edx
	movslq	%eax, %rsi
	leaq	0(,%rsi,4), %rdi
	leaq	q(%rip), %rsi
	movl	%edx, (%rdi,%rsi)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L21:
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
.L14:
	movl	l(%rip), %eax
	cmpl	$3, %eax
	jle	.L22
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L13:
	movl	k(%rip), %eax
	cmpl	$3, %eax
	jle	.L23
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L12:
	movl	j(%rip), %eax
	cmpl	$2, %eax
	jle	.L24
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L25
	movl	t(%rip), %eax
	addl	$1, %eax
	movl	%eax, t(%rip)
.L10:
	movl	r(%rip), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	jne	.L26
	movl	262140+d(%rip), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	MIN
	.type	MIN, @function
MIN:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	MIN, .-MIN
	.p2align 4
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	MAX, .-MAX
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	" %c"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	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
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	w(%rip), %rbx
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movb	$0, 175(%rsp)
	movl	$4343634, 171(%rsp)
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r8d
	xorl	%eax, %eax
	movl	$0, i(%rip)
	testl	%r8d, %r8d
	jle	.L7
.L5:
	cltq
	leaq	h(%rip), %rsi
	movq	%rbp, %rdi
	salq	$2, %rax
	addq	%rax, %rsi
	leaq	(%rbx,%rax), %rdx
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	n(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L5
.L7:
	movl	$0, i(%rip)
	xorl	%eax, %eax
	leaq	176(%rsp), %rbp
	leaq	.LC2(%rip), %rbx
.L6:
	cltq
	movq	%rbx, %rdi
	leaq	0(%rbp,%rax), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	$15, %eax
	jle	.L6
	movl	n(%rip), %eax
	movb	$0, 52(%rsp)
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	movb	$0, 98(%rsp)
	leaq	q(%rip), %rbx
	xorl	%esi, %esi
	movl	m(%rip), %r13d
	leal	-1(%rax), %edx
	movl	%eax, 116(%rsp)
	leaq	4+h(%rip), %rax
	leaq	(%rax,%rdx,4), %rax
	movq	%rbx, 32(%rsp)
	xorl	%edx, %edx
	movl	$1, %ebx
	movq	%rax, 136(%rsp)
	leaq	d(%rip), %rbp
	movl	$0, q(%rip)
	movl	$1, r(%rip)
	movl	$1, 12(%rsp)
	movl	$0, 92(%rsp)
	movb	%r9b, 99(%rsp)
	movl	%r15d, %r9d
	movl	%r12d, %r15d
.L68:
	movl	116(%rsp), %edi
	testl	%edi, %edi
	jle	.L81
	leaq	w(%rip), %rax
	movl	%r13d, %r12d
	movl	%r14d, %r13d
	movl	%r15d, %r14d
	movq	%rax, 104(%rsp)
	leaq	h(%rip), %rax
	movl	16(%rsp), %r15d
	movq	%rax, 72(%rsp)
	leaq	171(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	174(%rsp), %rax
	movq	%rax, 152(%rsp)
.L67:
	movq	72(%rsp), %rax
	movl	%ebx, %edi
	movq	144(%rsp), %r11
	movl	(%rax), %eax
	subl	%eax, %edi
	movl	%eax, 132(%rsp)
	movl	%edi, 100(%rsp)
.L66:
	movl	100(%rsp), %eax
	cmpl	$3, %eax
	jg	.L82
	movq	104(%rsp), %rdi
	movl	%ebx, %edx
	movl	%eax, 68(%rsp)
	movl	(%rdi), %edi
	subl	%edi, %edx
	movl	%edi, 48(%rsp)
	movl	%edx, 112(%rsp)
.L65:
	movl	112(%rsp), %r14d
	cmpl	$3, %r14d
	jg	.L10
	movl	68(%rsp), %esi
	xorl	%eax, %eax
	testl	%esi, %esi
	cmovns	%esi, %eax
	movl	%eax, %edi
	movl	%eax, 28(%rsp)
	movl	132(%rsp), %eax
	leal	0(,%rdi,4), %r8d
	addl	%esi, %eax
	leal	7(%r8), %edx
	leal	4(%r8), %r10d
	movl	%eax, %esi
	movl	$4, %eax
	movl	%edx, 40(%rsp)
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	movl	%edi, %eax
	leal	1(%rdi), %edi
	movl	%edi, 56(%rsp)
	leal	2(%rax), %edi
	addl	$3, %eax
	movl	%eax, 64(%rsp)
	leal	12(%r8), %eax
	movl	%eax, 20(%rsp)
	leal	11(%r8), %eax
	movl	%eax, %ecx
	movl	%eax, 44(%rsp)
	movl	%ebx, %eax
	sall	%cl, %eax
	movl	%edx, %ecx
	movl	%edi, 60(%rsp)
	leal	8(%r8), %edi
	movl	%eax, 120(%rsp)
	notl	%eax
	movl	%eax, 84(%rsp)
	movl	%ebx, %eax
	sall	%cl, %eax
	movl	%edi, 16(%rsp)
	leal	3(%r8), %edi
	movl	%eax, 124(%rsp)
	notl	%eax
	movl	%edi, %ecx
	movl	%eax, 88(%rsp)
	movl	%ebx, %eax
	sall	%cl, %eax
	movl	%edi, 24(%rsp)
	movzbl	99(%rsp), %ecx
	movl	%eax, 128(%rsp)
	notl	%eax
	movl	%eax, 80(%rsp)
	jmp	.L64
.L110:
	notl	%r15d
	andl	%r15d, %r12d
.L24:
	leal	2(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L15
	addl	%r8d, %ecx
	movl	%ebx, %r15d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L120
	notl	%r15d
	andl	%r15d, %r12d
.L23:
	leal	3(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L15
	movslq	24(%rsp), %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L20
	andl	80(%rsp), %r12d
.L15:
	leal	-1(%r8,%r13), %r9d
	cmpl	56(%rsp), %esi
	jle	.L88
	leal	(%rax,%r10), %ecx
	movl	%ebx, %r15d
	movzbl	(%r11), %r9d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L26
	notl	%r15d
	andl	%r15d, %r12d
.L27:
	cmpl	%edx, %r13d
	jle	.L28
	leal	(%r10,%rdx), %ecx
	movl	%ebx, %r15d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L121
	notl	%r15d
	andl	%r15d, %r12d
.L37:
	leal	2(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L28
	addl	%r10d, %ecx
	movl	%ebx, %r15d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L122
	notl	%r15d
	andl	%r15d, %r12d
.L36:
	leal	3(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L28
	movslq	40(%rsp), %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L33
	andl	88(%rsp), %r12d
.L28:
	movl	24(%rsp), %ecx
	leal	(%rcx,%r13), %r9d
	cmpl	60(%rsp), %esi
	jle	.L88
	movl	16(%rsp), %ecx
	movl	%ebx, %r15d
	movzbl	(%r11), %r9d
	addl	%eax, %ecx
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L40
	notl	%r15d
	andl	%r15d, %r12d
.L41:
	cmpl	%edx, %r13d
	jle	.L42
	movl	16(%rsp), %ecx
	movl	%ebx, %r15d
	addl	%edx, %ecx
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L123
	notl	%r15d
	andl	%r15d, %r12d
.L51:
	leal	2(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L42
	addl	16(%rsp), %ecx
	movl	%ebx, %r15d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L124
	notl	%r15d
	andl	%r15d, %r12d
.L50:
	leal	3(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L42
	movslq	44(%rsp), %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L47
	andl	84(%rsp), %r12d
.L42:
	movl	40(%rsp), %ecx
	leal	(%rcx,%r13), %r9d
	cmpl	64(%rsp), %esi
	jle	.L88
	movl	20(%rsp), %ecx
	movl	%ebx, %r15d
	movzbl	(%r11), %r9d
	addl	%eax, %ecx
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L52
	notl	%r15d
	andl	%r15d, %r12d
.L53:
	cmpl	%r13d, %edx
	jge	.L54
	movl	20(%rsp), %ecx
	movl	%ebx, %r15d
	addl	%edx, %ecx
	movslq	%ecx, %rdx
	sall	%cl, %r15d
	cmpb	176(%rsp,%rdx), %r9b
	je	.L55
	notl	%r15d
	andl	%r15d, %r12d
.L56:
	leal	2(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L54
	addl	20(%rsp), %ecx
	movl	%ebx, %edx
	sall	%cl, %edx
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L57
	notl	%edx
	andl	%edx, %r12d
.L58:
	addl	$3, %eax
	cmpl	%r13d, %eax
	jge	.L54
	cmpb	191(%rsp), %r9b
	je	.L125
	andl	$-32769, %r12d
.L54:
	movl	44(%rsp), %eax
	movb	$1, 98(%rsp)
	leal	(%rax,%r13), %r9d
.L25:
	movl	%esi, %r15d
	movl	$1, %ecx
.L11:
	movslq	%r12d, %rax
	movl	0(%rbp,%rax,4), %edx
	testl	%edx, %edx
	jne	.L63
	movl	0(%rbp,%rdi,4), %edx
	movslq	12(%rsp), %rdi
	movl	%edx, 52(%rsp)
	leaq	q(%rip), %rdx
	movl	%r12d, (%rdx,%rdi,4)
	movl	52(%rsp), %edx
	movl	12(%rsp), %edi
	movb	$1, 52(%rsp)
	addl	$1, %edx
	movl	%edx, 0(%rbp,%rax,4)
	leal	1(%rdi), %eax
	movl	%eax, 12(%rsp)
.L63:
	addl	$1, %r14d
	cmpl	$4, %r14d
	je	.L126
.L64:
	movq	32(%rsp), %rax
	movslq	(%rax), %rdi
	cmpl	%esi, 28(%rsp)
	jge	.L84
	movl	48(%rsp), %edx
	xorl	%eax, %eax
	testl	%r14d, %r14d
	cmovns	%r14d, %eax
	leal	(%r14,%rdx), %r13d
	movl	$4, %edx
	cmpl	%edx, %r13d
	cmovg	%edx, %r13d
	cmpl	%r13d, %eax
	jge	.L12
	leal	(%rax,%r8), %ecx
	movl	%ebx, %r15d
	movl	%edi, %r12d
	movzbl	(%r11), %r9d
	sall	%cl, %r15d
	movslq	%ecx, %rdx
	orl	%r15d, %r12d
	cmpb	176(%rsp,%rdx), %r9b
	je	.L14
	notl	%r15d
	andl	%edi, %r15d
	movl	%r15d, %r12d
.L14:
	leal	1(%rax), %edx
	cmpl	%edx, %r13d
	jle	.L15
	leal	(%r8,%rdx), %ecx
	movl	%ebx, %r15d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	jne	.L110
	orl	%r15d, %r12d
	jmp	.L24
.L26:
	orl	%r15d, %r12d
	jmp	.L27
.L88:
	movb	$1, 98(%rsp)
	jmp	.L25
.L121:
	orl	%r15d, %r12d
	jmp	.L37
.L40:
	orl	%r15d, %r12d
	jmp	.L41
.L120:
	orl	%r15d, %r12d
	jmp	.L23
.L20:
	orl	128(%rsp), %r12d
	jmp	.L15
.L122:
	orl	%r15d, %r12d
	jmp	.L36
.L52:
	orl	%r15d, %r12d
	jmp	.L53
.L123:
	orl	%r15d, %r12d
	jmp	.L51
.L124:
	orl	%r15d, %r12d
	jmp	.L50
.L33:
	orl	124(%rsp), %r12d
	jmp	.L28
.L55:
	orl	%r15d, %r12d
	jmp	.L56
.L57:
	orl	%edx, %r12d
	jmp	.L58
.L47:
	orl	120(%rsp), %r12d
	jmp	.L42
.L125:
	orl	$32768, %r12d
	jmp	.L54
.L126:
	movb	%cl, 99(%rsp)
	movl	$1, %esi
.L10:
	addl	$1, 68(%rsp)
	movl	68(%rsp), %eax
	cmpl	$4, %eax
	jne	.L65
	movl	$1, %ecx
.L9:
	addq	$1, %r11
	cmpq	152(%rsp), %r11
	jne	.L66
	addq	$4, 72(%rsp)
	movq	72(%rsp), %rax
	addq	$4, 104(%rsp)
	cmpq	136(%rsp), %rax
	jne	.L67
	movl	%r15d, 16(%rsp)
	movl	116(%rsp), %eax
	movl	%r14d, %r15d
	movl	$1, %edx
	movl	%r13d, %r14d
	movl	%r12d, %r13d
	jmp	.L8
.L84:
	movl	28(%rsp), %r15d
	movl	%edi, %r12d
	jmp	.L11
.L12:
	movl	56(%rsp), %edx
	movl	%eax, %r13d
	movl	%edi, %r12d
	cmpl	%edx, %esi
	cmovle	%eax, %r13d
	cmovle	%edi, %r12d
	jmp	.L25
.L82:
	movl	%eax, 68(%rsp)
	jmp	.L9
.L81:
	xorl	%eax, %eax
.L8:
	addl	$1, 92(%rsp)
	movl	92(%rsp), %edi
	addq	$4, 32(%rsp)
	cmpl	12(%rsp), %edi
	jne	.L68
	movl	%eax, i(%rip)
	movl	12(%rsp), %eax
	movl	%r15d, %r12d
	movl	%r9d, %r15d
	movzbl	99(%rsp), %r9d
	movl	%eax, t(%rip)
	testb	%dl, %dl
	je	.L69
	movl	$3, j(%rip)
	movl	68(%rsp), %eax
	movl	%eax, k(%rip)
.L69:
	testb	%cl, %cl
	je	.L70
	movl	%r12d, l(%rip)
.L70:
	cmpb	$0, 52(%rsp)
	je	.L71
	movl	12(%rsp), %eax
	movl	%eax, r(%rip)
.L71:
	testb	%sil, %sil
	je	.L72
	movl	16(%rsp), %eax
	movl	%eax, y(%rip)
	testb	%r9b, %r9b
	je	.L78
	movl	%r14d, x(%rip)
.L78:
	movl	%r13d, m(%rip)
.L76:
	cmpb	$0, 98(%rsp)
	je	.L74
	movl	%r15d, p(%rip)
.L74:
	movl	262140+d(%rip), %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	leal	-1(%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L127
	addq	$216, %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
.L72:
	.cfi_restore_state
	testb	%r9b, %r9b
	je	.L76
	movl	%r14d, x(%rip)
	jmp	.L76
.L127:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	d
	.data
	.align 32
	.type	d, @object
	.size	d, 262144
d:
	.long	1
	.zero	262140
	.globl	q
	.bss
	.align 32
	.type	q, @object
	.size	q, 262144
q:
	.zero	262144
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 80
w:
	.zero	80
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 80
h:
	.zero	80
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.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
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	MIN
	.type	MIN, @function
MIN:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	movl	%edi, %eax
	cmovle	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	MIN, .-MIN
	.p2align 4
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	MAX, .-MAX
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	" %c"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	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
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	w(%rip), %rbx
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movb	$0, 175(%rsp)
	movl	$4343634, 171(%rsp)
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r8d
	xorl	%eax, %eax
	movl	$0, i(%rip)
	testl	%r8d, %r8d
	jle	.L7
.L5:
	cltq
	leaq	h(%rip), %rsi
	movq	%rbp, %rdi
	salq	$2, %rax
	addq	%rax, %rsi
	leaq	(%rbx,%rax), %rdx
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	n(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L5
.L7:
	movl	$0, i(%rip)
	xorl	%eax, %eax
	leaq	176(%rsp), %rbp
	leaq	.LC2(%rip), %rbx
.L6:
	cltq
	movq	%rbx, %rdi
	leaq	0(%rbp,%rax), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	cmpl	$15, %eax
	jle	.L6
	movl	n(%rip), %eax
	movb	$0, 52(%rsp)
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	movb	$0, 98(%rsp)
	leaq	q(%rip), %rbx
	xorl	%esi, %esi
	movl	m(%rip), %r13d
	leal	-1(%rax), %edx
	movl	%eax, 116(%rsp)
	leaq	4+h(%rip), %rax
	leaq	(%rax,%rdx,4), %rax
	movq	%rbx, 32(%rsp)
	xorl	%edx, %edx
	movl	$1, %ebx
	movq	%rax, 136(%rsp)
	leaq	d(%rip), %rbp
	movl	$0, q(%rip)
	movl	$1, r(%rip)
	movl	$1, 12(%rsp)
	movl	$0, 92(%rsp)
	movb	%r9b, 99(%rsp)
	movl	%r15d, %r9d
	movl	%r12d, %r15d
.L68:
	movl	116(%rsp), %edi
	testl	%edi, %edi
	jle	.L81
	leaq	w(%rip), %rax
	movl	%r13d, %r12d
	movl	%r14d, %r13d
	movl	%r15d, %r14d
	movq	%rax, 104(%rsp)
	leaq	h(%rip), %rax
	movl	16(%rsp), %r15d
	movq	%rax, 72(%rsp)
	leaq	171(%rsp), %rax
	movq	%rax, 144(%rsp)
	leaq	174(%rsp), %rax
	movq	%rax, 152(%rsp)
.L67:
	movq	72(%rsp), %rax
	movl	%ebx, %edi
	movq	144(%rsp), %r11
	movl	(%rax), %eax
	subl	%eax, %edi
	movl	%eax, 132(%rsp)
	movl	%edi, 100(%rsp)
.L66:
	movl	100(%rsp), %eax
	cmpl	$3, %eax
	jg	.L82
	movq	104(%rsp), %rdi
	movl	%ebx, %edx
	movl	%eax, 68(%rsp)
	movl	(%rdi), %edi
	subl	%edi, %edx
	movl	%edi, 48(%rsp)
	movl	%edx, 112(%rsp)
.L65:
	movl	112(%rsp), %r14d
	cmpl	$3, %r14d
	jg	.L10
	movl	68(%rsp), %esi
	xorl	%eax, %eax
	testl	%esi, %esi
	cmovns	%esi, %eax
	movl	%eax, %edi
	movl	%eax, 28(%rsp)
	movl	132(%rsp), %eax
	leal	0(,%rdi,4), %r8d
	addl	%esi, %eax
	leal	7(%r8), %edx
	leal	4(%r8), %r10d
	movl	%eax, %esi
	movl	$4, %eax
	movl	%edx, 40(%rsp)
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	movl	%edi, %eax
	leal	1(%rdi), %edi
	movl	%edi, 56(%rsp)
	leal	2(%rax), %edi
	addl	$3, %eax
	movl	%eax, 64(%rsp)
	leal	12(%r8), %eax
	movl	%eax, 20(%rsp)
	leal	11(%r8), %eax
	movl	%eax, %ecx
	movl	%eax, 44(%rsp)
	movl	%ebx, %eax
	sall	%cl, %eax
	movl	%edx, %ecx
	movl	%edi, 60(%rsp)
	leal	8(%r8), %edi
	movl	%eax, 120(%rsp)
	notl	%eax
	movl	%eax, 84(%rsp)
	movl	%ebx, %eax
	sall	%cl, %eax
	movl	%edi, 16(%rsp)
	leal	3(%r8), %edi
	movl	%eax, 124(%rsp)
	notl	%eax
	movl	%edi, %ecx
	movl	%eax, 88(%rsp)
	movl	%ebx, %eax
	sall	%cl, %eax
	movl	%edi, 24(%rsp)
	movzbl	99(%rsp), %ecx
	movl	%eax, 128(%rsp)
	notl	%eax
	movl	%eax, 80(%rsp)
	jmp	.L64
.L110:
	notl	%r15d
	andl	%r15d, %r12d
.L24:
	leal	2(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L15
	addl	%r8d, %ecx
	movl	%ebx, %r15d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L120
	notl	%r15d
	andl	%r15d, %r12d
.L23:
	leal	3(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L15
	movslq	24(%rsp), %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L20
	andl	80(%rsp), %r12d
.L15:
	leal	-1(%r8,%r13), %r9d
	cmpl	56(%rsp), %esi
	jle	.L88
	leal	(%rax,%r10), %ecx
	movl	%ebx, %r15d
	movzbl	(%r11), %r9d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L26
	notl	%r15d
	andl	%r15d, %r12d
.L27:
	cmpl	%edx, %r13d
	jle	.L28
	leal	(%r10,%rdx), %ecx
	movl	%ebx, %r15d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L121
	notl	%r15d
	andl	%r15d, %r12d
.L37:
	leal	2(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L28
	addl	%r10d, %ecx
	movl	%ebx, %r15d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L122
	notl	%r15d
	andl	%r15d, %r12d
.L36:
	leal	3(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L28
	movslq	40(%rsp), %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L33
	andl	88(%rsp), %r12d
.L28:
	movl	24(%rsp), %ecx
	leal	(%rcx,%r13), %r9d
	cmpl	60(%rsp), %esi
	jle	.L88
	movl	16(%rsp), %ecx
	movl	%ebx, %r15d
	movzbl	(%r11), %r9d
	addl	%eax, %ecx
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L40
	notl	%r15d
	andl	%r15d, %r12d
.L41:
	cmpl	%edx, %r13d
	jle	.L42
	movl	16(%rsp), %ecx
	movl	%ebx, %r15d
	addl	%edx, %ecx
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L123
	notl	%r15d
	andl	%r15d, %r12d
.L51:
	leal	2(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L42
	addl	16(%rsp), %ecx
	movl	%ebx, %r15d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L124
	notl	%r15d
	andl	%r15d, %r12d
.L50:
	leal	3(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L42
	movslq	44(%rsp), %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L47
	andl	84(%rsp), %r12d
.L42:
	movl	40(%rsp), %ecx
	leal	(%rcx,%r13), %r9d
	cmpl	64(%rsp), %esi
	jle	.L88
	movl	20(%rsp), %ecx
	movl	%ebx, %r15d
	movzbl	(%r11), %r9d
	addl	%eax, %ecx
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L52
	notl	%r15d
	andl	%r15d, %r12d
.L53:
	cmpl	%r13d, %edx
	jge	.L54
	movl	20(%rsp), %ecx
	movl	%ebx, %r15d
	addl	%edx, %ecx
	movslq	%ecx, %rdx
	sall	%cl, %r15d
	cmpb	176(%rsp,%rdx), %r9b
	je	.L55
	notl	%r15d
	andl	%r15d, %r12d
.L56:
	leal	2(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L54
	addl	20(%rsp), %ecx
	movl	%ebx, %edx
	sall	%cl, %edx
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	je	.L57
	notl	%edx
	andl	%edx, %r12d
.L58:
	addl	$3, %eax
	cmpl	%r13d, %eax
	jge	.L54
	cmpb	191(%rsp), %r9b
	je	.L125
	andl	$-32769, %r12d
.L54:
	movl	44(%rsp), %eax
	movb	$1, 98(%rsp)
	leal	(%rax,%r13), %r9d
.L25:
	movl	%esi, %r15d
	movl	$1, %ecx
.L11:
	movslq	%r12d, %rax
	movl	0(%rbp,%rax,4), %edx
	testl	%edx, %edx
	jne	.L63
	movl	0(%rbp,%rdi,4), %edx
	movslq	12(%rsp), %rdi
	movl	%edx, 52(%rsp)
	leaq	q(%rip), %rdx
	movl	%r12d, (%rdx,%rdi,4)
	movl	52(%rsp), %edx
	movl	12(%rsp), %edi
	movb	$1, 52(%rsp)
	addl	$1, %edx
	movl	%edx, 0(%rbp,%rax,4)
	leal	1(%rdi), %eax
	movl	%eax, 12(%rsp)
.L63:
	addl	$1, %r14d
	cmpl	$4, %r14d
	je	.L126
.L64:
	movq	32(%rsp), %rax
	movslq	(%rax), %rdi
	cmpl	%esi, 28(%rsp)
	jge	.L84
	movl	48(%rsp), %edx
	xorl	%eax, %eax
	testl	%r14d, %r14d
	cmovns	%r14d, %eax
	leal	(%r14,%rdx), %r13d
	movl	$4, %edx
	cmpl	%edx, %r13d
	cmovg	%edx, %r13d
	cmpl	%r13d, %eax
	jge	.L12
	leal	(%rax,%r8), %ecx
	movl	%ebx, %r15d
	movl	%edi, %r12d
	movzbl	(%r11), %r9d
	sall	%cl, %r15d
	movslq	%ecx, %rdx
	orl	%r15d, %r12d
	cmpb	176(%rsp,%rdx), %r9b
	je	.L14
	notl	%r15d
	andl	%edi, %r15d
	movl	%r15d, %r12d
.L14:
	leal	1(%rax), %edx
	cmpl	%edx, %r13d
	jle	.L15
	leal	(%r8,%rdx), %ecx
	movl	%ebx, %r15d
	sall	%cl, %r15d
	movslq	%ecx, %rcx
	cmpb	176(%rsp,%rcx), %r9b
	jne	.L110
	orl	%r15d, %r12d
	jmp	.L24
.L26:
	orl	%r15d, %r12d
	jmp	.L27
.L88:
	movb	$1, 98(%rsp)
	jmp	.L25
.L121:
	orl	%r15d, %r12d
	jmp	.L37
.L40:
	orl	%r15d, %r12d
	jmp	.L41
.L120:
	orl	%r15d, %r12d
	jmp	.L23
.L20:
	orl	128(%rsp), %r12d
	jmp	.L15
.L122:
	orl	%r15d, %r12d
	jmp	.L36
.L52:
	orl	%r15d, %r12d
	jmp	.L53
.L123:
	orl	%r15d, %r12d
	jmp	.L51
.L124:
	orl	%r15d, %r12d
	jmp	.L50
.L33:
	orl	124(%rsp), %r12d
	jmp	.L28
.L55:
	orl	%r15d, %r12d
	jmp	.L56
.L57:
	orl	%edx, %r12d
	jmp	.L58
.L47:
	orl	120(%rsp), %r12d
	jmp	.L42
.L125:
	orl	$32768, %r12d
	jmp	.L54
.L126:
	movb	%cl, 99(%rsp)
	movl	$1, %esi
.L10:
	addl	$1, 68(%rsp)
	movl	68(%rsp), %eax
	cmpl	$4, %eax
	jne	.L65
	movl	$1, %ecx
.L9:
	addq	$1, %r11
	cmpq	152(%rsp), %r11
	jne	.L66
	addq	$4, 72(%rsp)
	movq	72(%rsp), %rax
	addq	$4, 104(%rsp)
	cmpq	136(%rsp), %rax
	jne	.L67
	movl	%r15d, 16(%rsp)
	movl	116(%rsp), %eax
	movl	%r14d, %r15d
	movl	$1, %edx
	movl	%r13d, %r14d
	movl	%r12d, %r13d
	jmp	.L8
.L84:
	movl	28(%rsp), %r15d
	movl	%edi, %r12d
	jmp	.L11
.L12:
	movl	56(%rsp), %edx
	movl	%eax, %r13d
	movl	%edi, %r12d
	cmpl	%edx, %esi
	cmovle	%eax, %r13d
	cmovle	%edi, %r12d
	jmp	.L25
.L82:
	movl	%eax, 68(%rsp)
	jmp	.L9
.L81:
	xorl	%eax, %eax
.L8:
	addl	$1, 92(%rsp)
	movl	92(%rsp), %edi
	addq	$4, 32(%rsp)
	cmpl	12(%rsp), %edi
	jne	.L68
	movl	%eax, i(%rip)
	movl	12(%rsp), %eax
	movl	%r15d, %r12d
	movl	%r9d, %r15d
	movzbl	99(%rsp), %r9d
	movl	%eax, t(%rip)
	testb	%dl, %dl
	je	.L69
	movl	$3, j(%rip)
	movl	68(%rsp), %eax
	movl	%eax, k(%rip)
.L69:
	testb	%cl, %cl
	je	.L70
	movl	%r12d, l(%rip)
.L70:
	cmpb	$0, 52(%rsp)
	je	.L71
	movl	12(%rsp), %eax
	movl	%eax, r(%rip)
.L71:
	testb	%sil, %sil
	je	.L72
	movl	16(%rsp), %eax
	movl	%eax, y(%rip)
	testb	%r9b, %r9b
	je	.L78
	movl	%r14d, x(%rip)
.L78:
	movl	%r13d, m(%rip)
.L76:
	cmpb	$0, 98(%rsp)
	je	.L74
	movl	%r15d, p(%rip)
.L74:
	movl	262140+d(%rip), %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	leal	-1(%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L127
	addq	$216, %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
.L72:
	.cfi_restore_state
	testb	%r9b, %r9b
	je	.L76
	movl	%r14d, x(%rip)
	jmp	.L76
.L127:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	d
	.data
	.align 32
	.type	d, @object
	.size	d, 262144
d:
	.long	1
	.zero	262140
	.globl	q
	.bss
	.align 32
	.type	q, @object
	.size	q, 262144
q:
	.zero	262144
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 80
w:
	.zero	80
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 80
h:
	.zero	80
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.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
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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 n,m,i,j,k,l,x,y,p,r,t=0,h[20],w[20],q[1<<16],d[1<<16]={1};
int MIN(int a,int b){return a<b?a:b;}
int MAX(int a,int b){return a<b?b:a;}
int main(){
	char s[20],c[5]={"RGB"};
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d %d",&h[i],&w[i]);
	for(i=0;i<16;i++)scanf(" %c",&s[i]);
	q[t=0]=0;
	for(r=1;r-t;t++){
		for(i=0;i<n;i++){
			for(j=0;j<3;j++){
				for(k=-h[i]+1;k<4;k++){
					for(l=-w[i]+1;l<4;l++){
						m=q[t];
						for(y=MAX(0,k);y<MIN(4,k+h[i]);y++){
							for(x=MAX(0,l);x<MIN(4,l+w[i]);x++){
								//if(k+y<0||3<k+y||l+x<0||3<l+x)continue;
								p=(y)*4+x;
								if(s[p]==c[j])m|= (1<<p);
								else          m&=~(1<<p);
							}
						}//f(m);
						if(d[m]==0)d[q[r++]=m]=d[q[t]]+1;
					}
				}//printf("\n%d\n\n",r);
			}
		}//printf("\n\n%d ",r);
		//f(q[t]);
	}
	//for(i=0;i<(1<<16);i++)printf("%d\n",d[i]);
	printf("%d\n",d[(1<<16)-1]-1);
	return 0;
}

1
2 3
RRGG
GGRB
BRRR
BRRR
 2
4 5
1 1
RRRR
RRGR
RBRR
RRRR
 2
4 5
2 1
RRRR
RRGR
RBRR
RRRR
 1
2 1
RRGG
GGRB
BRRR
BRRR
 1
2 1
GGRR
GGRB
BRRR
BRRR
 1
1 1
GGRR
GGRB
BRRR
BRRR
 1
2 3
RRGG
GGRB
BRRR
RRBR
 2
1 3
1 1
RRRR
RRGR
RBRR
RRRR
 2
4 4
2 1
RRRR
RGRR
RBRR
RRRR
 1
2 1
RRGG
GGRB
RRRB
BRRR

6
 3
 5
 12
 9
 16
 8
 10
 4
 13

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 n,m,i,j,k,l,x,y,p,r,t=0,h[20],w[20],q[1<<16],d[1<<16]={1};
int MIN(int a,int b){return a<b?a:b;}
int MAX(int a,int b){return a<b?b:a;}
int main(){
	char s[20],c[5]={"RGB"};
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d %d",&h[i],&w[i]);
	for(i=0;i<16;i++)scanf(" %c",&s[i]);
	q[t=0]=0;
	for(r=1;r-t;t++){
		for(i=0;i<n;i++){
			for(j=0;j<3;j++){
				for(k=-h[i]+1;k<4;k++){
					for(l=-w[i]+1;l<4;l++){
						m=q[t];
						for(y=MAX(0,k);y<MIN(4,k+h[i]);y++){
							for(x=MAX(0,l);x<MIN(4,l+w[i]);x++){
								//if(k+y<0||3<k+y||l+x<0||3<l+x)continue;
								p=(y)*4+x;
								if(s[p]==c[j])m|= (1<<p);
								else          m&=~(1<<p);
							}
						}//f(m);
						if(d[m]==0)d[q[r++]=m]=d[q[t]]+1;
					}
				}//printf("\n%d\n\n",r);
			}
		}//printf("\n\n%d ",r);
		//f(q[t]);
	}
	//for(i=0;i<(1<<16);i++)printf("%d\n",d[i]);
	printf("%d\n",d[(1<<16)-1]-1);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.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	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 80
h:
	.zero	80
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 80
w:
	.zero	80
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 262144
q:
	.zero	262144
	.globl	d
	.data
	.align 32
	.type	d, @object
	.size	d, 262144
d:
	.long	1
	.zero	262140
	.text
	.globl	MIN
	.type	MIN, @function
MIN:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MIN, .-MIN
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	MAX, .-MAX
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	" %c"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$4343634, -37(%rbp)
	movb	$0, -33(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L6
.L7:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	$0, i(%rip)
	jmp	.L8
.L9:
	movl	i(%rip), %eax
	leaq	-32(%rbp), %rdx
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L8:
	movl	i(%rip), %eax
	cmpl	$15, %eax
	jle	.L9
	movl	$0, t(%rip)
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$1, r(%rip)
	jmp	.L10
.L26:
	movl	$0, i(%rip)
	jmp	.L11
.L25:
	movl	$0, j(%rip)
	jmp	.L12
.L24:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, k(%rip)
	jmp	.L13
.L23:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, l(%rip)
	jmp	.L14
.L22:
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, m(%rip)
	movl	k(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	MAX
	movl	%eax, y(%rip)
	jmp	.L15
.L20:
	movl	l(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	MAX
	movl	%eax, x(%rip)
	jmp	.L16
.L19:
	movl	y(%rip), %eax
	leal	0(,%rax,4), %edx
	movl	x(%rip), %eax
	addl	%edx, %eax
	movl	%eax, p(%rip)
	movl	p(%rip), %eax
	cltq
	movzbl	-32(%rbp,%rax), %edx
	movl	j(%rip), %eax
	cltq
	movzbl	-37(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L17
	movl	p(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	m(%rip), %eax
	orl	%edx, %eax
	movl	%eax, m(%rip)
	jmp	.L18
.L17:
	movl	p(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	notl	%eax
	movl	%eax, %edx
	movl	m(%rip), %eax
	andl	%edx, %eax
	movl	%eax, m(%rip)
.L18:
	movl	x(%rip), %eax
	addl	$1, %eax
	movl	%eax, x(%rip)
.L16:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	l(%rip), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	movl	$4, %edi
	call	MIN
	movl	x(%rip), %edx
	cmpl	%edx, %eax
	jg	.L19
	movl	y(%rip), %eax
	addl	$1, %eax
	movl	%eax, y(%rip)
.L15:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	k(%rip), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	movl	$4, %edi
	call	MIN
	movl	y(%rip), %edx
	cmpl	%edx, %eax
	jg	.L20
	movl	m(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L21
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	r(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, r(%rip)
	movl	m(%rip), %edx
	movslq	%eax, %rsi
	leaq	0(,%rsi,4), %rdi
	leaq	q(%rip), %rsi
	movl	%edx, (%rdi,%rsi)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L21:
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
.L14:
	movl	l(%rip), %eax
	cmpl	$3, %eax
	jle	.L22
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L13:
	movl	k(%rip), %eax
	cmpl	$3, %eax
	jle	.L23
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L12:
	movl	j(%rip), %eax
	cmpl	$2, %eax
	jle	.L24
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L25
	movl	t(%rip), %eax
	addl	$1, %eax
	movl	%eax, t(%rip)
.L10:
	movl	r(%rip), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	jne	.L26
	movl	262140+d(%rip), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.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	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	r
	.align 4
	.type	r, @object
	.size	r, 4
r:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 80
h:
	.zero	80
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 80
w:
	.zero	80
	.globl	q
	.align 32
	.type	q, @object
	.size	q, 262144
q:
	.zero	262144
	.globl	d
	.data
	.align 32
	.type	d, @object
	.size	d, 262144
d:
	.long	1
	.zero	262140
	.text
	.globl	MIN
	.type	MIN, @function
MIN:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	MIN, .-MIN
	.globl	MAX
	.type	MAX, @function
MAX:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	MAX, .-MAX
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	" %c"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$4343634, -37(%rbp)
	movb	$0, -33(%rbp)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L6
.L7:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	addq	%rax, %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L7
	movl	$0, i(%rip)
	jmp	.L8
.L9:
	movl	i(%rip), %eax
	leaq	-32(%rbp), %rdx
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L8:
	movl	i(%rip), %eax
	cmpl	$15, %eax
	jle	.L9
	movl	$0, t(%rip)
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	$1, r(%rip)
	jmp	.L10
.L26:
	movl	$0, i(%rip)
	jmp	.L11
.L25:
	movl	$0, j(%rip)
	jmp	.L12
.L24:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, k(%rip)
	jmp	.L13
.L23:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	$1, %eax
	subl	%edx, %eax
	movl	%eax, l(%rip)
	jmp	.L14
.L22:
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, m(%rip)
	movl	k(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	MAX
	movl	%eax, y(%rip)
	jmp	.L15
.L20:
	movl	l(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	MAX
	movl	%eax, x(%rip)
	jmp	.L16
.L19:
	movl	y(%rip), %eax
	leal	0(,%rax,4), %edx
	movl	x(%rip), %eax
	addl	%edx, %eax
	movl	%eax, p(%rip)
	movl	p(%rip), %eax
	cltq
	movzbl	-32(%rbp,%rax), %edx
	movl	j(%rip), %eax
	cltq
	movzbl	-37(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L17
	movl	p(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	m(%rip), %eax
	orl	%edx, %eax
	movl	%eax, m(%rip)
	jmp	.L18
.L17:
	movl	p(%rip), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	notl	%eax
	movl	%eax, %edx
	movl	m(%rip), %eax
	andl	%edx, %eax
	movl	%eax, m(%rip)
.L18:
	movl	x(%rip), %eax
	addl	$1, %eax
	movl	%eax, x(%rip)
.L16:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	l(%rip), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	movl	$4, %edi
	call	MIN
	movl	x(%rip), %edx
	cmpl	%edx, %eax
	jg	.L19
	movl	y(%rip), %eax
	addl	$1, %eax
	movl	%eax, y(%rip)
.L15:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	k(%rip), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	movl	$4, %edi
	call	MIN
	movl	y(%rip), %edx
	cmpl	%edx, %eax
	jg	.L20
	movl	m(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L21
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	r(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, r(%rip)
	movl	m(%rip), %edx
	movslq	%eax, %rsi
	leaq	0(,%rsi,4), %rdi
	leaq	q(%rip), %rsi
	movl	%edx, (%rdi,%rsi)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	q(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L21:
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
.L14:
	movl	l(%rip), %eax
	cmpl	$3, %eax
	jle	.L22
	movl	k(%rip), %eax
	addl	$1, %eax
	movl	%eax, k(%rip)
.L13:
	movl	k(%rip), %eax
	cmpl	$3, %eax
	jle	.L23
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
.L12:
	movl	j(%rip), %eax
	cmpl	$2, %eax
	jle	.L24
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L11:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L25
	movl	t(%rip), %eax
	addl	$1, %eax
	movl	%eax, t(%rip)
.L10:
	movl	r(%rip), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	jne	.L26
	movl	262140+d(%rip), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
