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 <stdlib.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define bit(n,m)(((n)>>(m))&1)

ll h,w;
char ss[20][20];
ll a[20];

void g(int s,int flag){
	if(s+1==(1<<w)){
		puts("YES");
		exit(0);
	}
	int i=0;
	while(bit(s,i))i++;
	if(flag){
		int b=1;
		rep(k,0,h)if(ss[k][i]!=ss[a[k]][i]){
			b=0;
			break;
		}
		if(b)g(s^(1<<i),0);
	}
	rep(j,i+1,w)if(!bit(s,j)){
		int b=1;
		rep(k,0,h)if(ss[k][i]!=ss[a[k]][j]){
			b=0;
			break;
		}
		if(b)g(s^(1<<i)^(1<<j),flag);
	}	
}

void f(int s,int flag){
	if(s+1==(1<<h))g(0,w%2);
	int i=0;
	while(bit(s,i))i++;
	if(flag){
		a[i]=i;
		f(s^(1<<i),0);
	}
	rep(j,i+1,h)if(!bit(s,j)){
		a[i]=j;
		a[j]=i;
		f(s^(1<<i)^(1<<j),flag);
	}
}

int main(){
	scanf("%lld%lld",&h,&w);
	rep(i,0,h)scanf(" %s",ss[i]);
	f(0,h%2);
	puts("NO");
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	h
	.bss
	.align 8
	.type	h, @object
	.size	h, 8
h:
	.zero	8
	.globl	w
	.align 8
	.type	w, @object
	.size	w, 8
w:
	.zero	8
	.globl	ss
	.align 32
	.type	ss, @object
	.size	ss, 400
ss:
	.zero	400
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 160
a:
	.zero	160
	.section	.rodata
.LC0:
	.string	"YES"
	.text
	.globl	g
	.type	g, @function
g:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -52(%rbp)
	movl	%esi, -56(%rbp)
	movl	-52(%rbp), %eax
	leal	1(%rax), %edx
	movq	w(%rip), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	cmpl	%eax, %edx
	jne	.L2
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %edi
	call	exit@PLT
.L2:
	movl	$0, -36(%rbp)
	jmp	.L3
.L4:
	addl	$1, -36(%rbp)
.L3:
	movl	-36(%rbp), %eax
	movl	-52(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L4
	cmpl	$0, -56(%rbp)
	je	.L5
	movl	$1, -32(%rbp)
	movq	$0, -24(%rbp)
	jmp	.L6
.L9:
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %ecx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rsi), %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %cl
	je	.L7
	movl	$0, -32(%rbp)
	jmp	.L8
.L7:
	addq	$1, -24(%rbp)
.L6:
	movq	h(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jl	.L9
.L8:
	cmpl	$0, -32(%rbp)
	je	.L5
	movl	-36(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-52(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	g
.L5:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	%rax, -16(%rbp)
	jmp	.L10
.L16:
	movq	-16(%rbp), %rax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	movl	%edx, %ecx
	sarl	%cl, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L11
	movl	$1, -28(%rbp)
	movq	$0, -8(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %ecx
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	-16(%rbp), %rdx
	addq	%rax, %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %cl
	je	.L13
	movl	$0, -28(%rbp)
	jmp	.L14
.L13:
	addq	$1, -8(%rbp)
.L12:
	movq	h(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L15
.L14:
	cmpl	$0, -28(%rbp)
	je	.L11
	movl	-36(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-52(%rbp), %eax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	xorl	%eax, %edx
	movl	-56(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	g
.L11:
	addq	$1, -16(%rbp)
.L10:
	movq	w(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L16
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	g, .-g
	.globl	f
	.type	f, @function
f:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	leal	1(%rax), %edx
	movq	h(%rip), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	cmpl	%eax, %edx
	jne	.L18
	movq	w(%rip), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movl	%eax, %esi
	movl	$0, %edi
	call	g
.L18:
	movl	$0, -12(%rbp)
	jmp	.L19
.L20:
	addl	$1, -12(%rbp)
.L19:
	movl	-12(%rbp), %eax
	movl	-20(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L20
	cmpl	$0, -24(%rbp)
	je	.L21
	movl	-12(%rbp), %eax
	cltq
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-20(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	f
.L21:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	%rax, -8(%rbp)
	jmp	.L22
.L24:
	movq	-8(%rbp), %rax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%edx, %ecx
	sarl	%cl, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L23
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	movq	-8(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-20(%rbp), %eax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	xorl	%eax, %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	f
.L23:
	addq	$1, -8(%rbp)
.L22:
	movq	h(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L24
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	f, .-f
	.section	.rodata
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	" %s"
.LC3:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	w(%rip), %rax
	movq	%rax, %rdx
	leaq	h(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -8(%rbp)
	jmp	.L26
.L27:
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	ss(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -8(%rbp)
.L26:
	movq	h(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L27
	movq	h(%rip), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movl	%eax, %esi
	movl	$0, %edi
	call	f
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"YES"
	.text
	.p2align 4
	.globl	g
	.type	g, @function
g:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$1, %eax
	leal	1(%rdi), %edx
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	movq	w(%rip), %rcx
	sall	%cl, %eax
	cmpl	%eax, %edx
	je	.L2
	movl	%edi, %ebp
	movl	%edi, %r12d
	movl	%esi, %r13d
	movl	$1, %ebx
	andl	$1, %ebp
	je	.L4
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%ebp, %ebx
	addl	$1, %ebp
	btl	%ebp, %r12d
	jc	.L3
	addl	$2, %ebx
	movslq	%ebx, %rbx
.L4:
	testl	%r13d, %r13d
	je	.L5
	movq	h(%rip), %r9
	testq	%r9, %r9
	jle	.L6
	movslq	%ebp, %rdi
	leaq	ss(%rip), %r8
	xorl	%eax, %eax
	leaq	(%r8,%rdi), %rdx
	leaq	a(%rip), %r10
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$1, %rax
	addq	$20, %rdx
	cmpq	%r9, %rax
	je	.L6
.L7:
	movq	(%r10,%rax,8), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%r8,%rsi,4), %rsi
	movzbl	(%rsi,%rdi), %esi
	cmpb	%sil, (%rdx)
	je	.L24
.L5:
	cmpq	%rcx, %rbx
	jge	.L1
	movl	%r12d, %r15d
	leaq	ss(%rip), %r14
	leaq	a(%rip), %r8
	btcl	%ebp, %r15d
	movslq	%ebp, %rbp
.L12:
	btl	%ebx, %r12d
	movl	%ebx, %r9d
	jnc	.L25
.L9:
	addq	$1, %rbx
	cmpq	%rcx, %rbx
	jl	.L12
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movq	h(%rip), %rdi
	testq	%rdi, %rdi
	jle	.L10
	leaq	(%r14,%rbp), %rsi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%r8,%rax,8), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%r14,%rdx,4), %rdx
	movzbl	(%rdx,%rbx), %edx
	cmpb	%dl, (%rsi)
	jne	.L9
	addq	$1, %rax
	addq	$20, %rsi
	cmpq	%rdi, %rax
	jne	.L11
.L10:
	movl	%r15d, %edi
	movl	%r13d, %esi
	btcl	%r9d, %edi
	call	g
	movq	w(%rip), %rcx
	leaq	a(%rip), %r8
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	xorl	%edi, %edi
	call	exit@PLT
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r12d, %edi
	xorl	%esi, %esi
	btcl	%ebp, %edi
	call	g
	movq	w(%rip), %rcx
	jmp	.L5
	.cfi_endproc
.LFE39:
	.size	g, .-g
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$1, %eax
	leal	1(%rdi), %edx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%esi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movq	h(%rip), %rcx
	sall	%cl, %eax
	cmpl	%eax, %edx
	je	.L42
	movl	%r12d, %ebx
	andl	$1, %ebx
	je	.L36
.L45:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%ebx, %ebp
	addl	$1, %ebx
	btl	%ebx, %r12d
	jc	.L29
	addl	$2, %ebp
	movslq	%ebp, %rbp
.L28:
	testl	%r13d, %r13d
	jne	.L43
.L30:
	movq	h(%rip), %rax
	movl	%r12d, %r15d
	leaq	a(%rip), %r14
	btcl	%ebx, %r15d
	cmpq	%rbp, %rax
	jle	.L26
.L35:
	btl	%ebp, %r12d
	jnc	.L44
	addq	$1, %rbp
	cmpq	%rax, %rbp
	jl	.L35
.L26:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	.cfi_restore_state
	movl	%r15d, %edi
	movslq	%ebx, %rax
	movl	%r13d, %esi
	btcl	%ebp, %edi
	movq	%rbp, (%r14,%rax,8)
	movq	%rax, (%r14,%rbp,8)
	addq	$1, %rbp
	call	f
	movq	h(%rip), %rax
	cmpq	%rax, %rbp
	jl	.L35
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L43:
	.cfi_restore_state
	movslq	%ebx, %rax
	leaq	a(%rip), %rdx
	movl	%r12d, %edi
	xorl	%esi, %esi
	movq	%rax, (%rdx,%rax,8)
	btcl	%ebx, %edi
	call	f
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L42:
	movq	w(%rip), %rax
	xorl	%edi, %edi
	movl	%r12d, %ebx
	movq	%rax, %rdx
	shrq	$63, %rdx
	leaq	(%rax,%rdx), %rsi
	andl	$1, %esi
	subl	%edx, %esi
	call	g
	andl	$1, %ebx
	jne	.L45
.L36:
	movl	$1, %ebp
	jmp	.L28
	.cfi_endproc
.LFE40:
	.size	f, .-f
	.section	.rodata.str1.1
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	" %s"
.LC3:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	w(%rip), %rdx
	leaq	h(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC1(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	movq	h(%rip), %rax
	testq	%rax, %rax
	jle	.L47
	leaq	ss(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L48:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	h(%rip), %rax
	addq	$20, %rbp
	cmpq	%rbx, %rax
	jg	.L48
.L47:
	movq	%rax, %rdx
	xorl	%edi, %edi
	shrq	$63, %rdx
	leaq	(%rax,%rdx), %rsi
	andl	$1, %esi
	subl	%edx, %esi
	call	f
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 160
a:
	.zero	160
	.globl	ss
	.align 32
	.type	ss, @object
	.size	ss, 400
ss:
	.zero	400
	.globl	w
	.align 8
	.type	w, @object
	.size	w, 8
w:
	.zero	8
	.globl	h
	.align 8
	.type	h, @object
	.size	h, 8
h:
	.zero	8
	.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	"YES"
	.text
	.p2align 4
	.globl	g
	.type	g, @function
g:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$1, %eax
	leal	1(%rdi), %edx
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	movq	w(%rip), %rcx
	sall	%cl, %eax
	cmpl	%eax, %edx
	je	.L2
	movl	%edi, %ebp
	movl	%edi, %r12d
	movl	%esi, %r13d
	movl	$1, %ebx
	andl	$1, %ebp
	je	.L4
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%ebp, %ebx
	addl	$1, %ebp
	btl	%ebp, %r12d
	jc	.L3
	addl	$2, %ebx
	movslq	%ebx, %rbx
.L4:
	testl	%r13d, %r13d
	je	.L5
	movq	h(%rip), %r9
	testq	%r9, %r9
	jle	.L6
	movslq	%ebp, %rdi
	leaq	ss(%rip), %r8
	xorl	%eax, %eax
	leaq	(%r8,%rdi), %rdx
	leaq	a(%rip), %r10
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$1, %rax
	addq	$20, %rdx
	cmpq	%r9, %rax
	je	.L6
.L7:
	movq	(%r10,%rax,8), %rsi
	leaq	(%rsi,%rsi,4), %rsi
	leaq	(%r8,%rsi,4), %rsi
	movzbl	(%rsi,%rdi), %esi
	cmpb	%sil, (%rdx)
	je	.L24
.L5:
	cmpq	%rcx, %rbx
	jge	.L1
	movl	%r12d, %r15d
	leaq	ss(%rip), %r14
	leaq	a(%rip), %r8
	btcl	%ebp, %r15d
	movslq	%ebp, %rbp
.L12:
	btl	%ebx, %r12d
	movl	%ebx, %r9d
	jnc	.L25
.L9:
	addq	$1, %rbx
	cmpq	%rcx, %rbx
	jl	.L12
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movq	h(%rip), %rdi
	testq	%rdi, %rdi
	jle	.L10
	leaq	(%r14,%rbp), %rsi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%r8,%rax,8), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%r14,%rdx,4), %rdx
	movzbl	(%rdx,%rbx), %edx
	cmpb	%dl, (%rsi)
	jne	.L9
	addq	$1, %rax
	addq	$20, %rsi
	cmpq	%rdi, %rax
	jne	.L11
.L10:
	movl	%r15d, %edi
	movl	%r13d, %esi
	btcl	%r9d, %edi
	call	g
	movq	w(%rip), %rcx
	leaq	a(%rip), %r8
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	xorl	%edi, %edi
	call	exit@PLT
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r12d, %edi
	xorl	%esi, %esi
	btcl	%ebp, %edi
	call	g
	movq	w(%rip), %rcx
	jmp	.L5
	.cfi_endproc
.LFE39:
	.size	g, .-g
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$1, %eax
	leal	1(%rdi), %edx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%esi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	movq	h(%rip), %rcx
	sall	%cl, %eax
	cmpl	%eax, %edx
	je	.L42
	movl	%r12d, %ebx
	andl	$1, %ebx
	je	.L36
.L45:
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%ebx, %ebp
	addl	$1, %ebx
	btl	%ebx, %r12d
	jc	.L29
	addl	$2, %ebp
	movslq	%ebp, %rbp
.L28:
	testl	%r13d, %r13d
	jne	.L43
.L30:
	movq	h(%rip), %rax
	movl	%r12d, %r15d
	leaq	a(%rip), %r14
	btcl	%ebx, %r15d
	cmpq	%rbp, %rax
	jle	.L26
.L35:
	btl	%ebp, %r12d
	jnc	.L44
	addq	$1, %rbp
	cmpq	%rax, %rbp
	jl	.L35
.L26:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	.cfi_restore_state
	movl	%r15d, %edi
	movslq	%ebx, %rax
	movl	%r13d, %esi
	btcl	%ebp, %edi
	movq	%rbp, (%r14,%rax,8)
	movq	%rax, (%r14,%rbp,8)
	addq	$1, %rbp
	call	f
	movq	h(%rip), %rax
	cmpq	%rax, %rbp
	jl	.L35
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L43:
	.cfi_restore_state
	movslq	%ebx, %rax
	leaq	a(%rip), %rdx
	movl	%r12d, %edi
	xorl	%esi, %esi
	movq	%rax, (%rdx,%rax,8)
	btcl	%ebx, %edi
	call	f
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L42:
	movq	w(%rip), %rax
	xorl	%edi, %edi
	movl	%r12d, %ebx
	movq	%rax, %rdx
	shrq	$63, %rdx
	leaq	(%rax,%rdx), %rsi
	andl	$1, %esi
	subl	%edx, %esi
	call	g
	andl	$1, %ebx
	jne	.L45
.L36:
	movl	$1, %ebp
	jmp	.L28
	.cfi_endproc
.LFE40:
	.size	f, .-f
	.section	.rodata.str1.1
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	" %s"
.LC3:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	w(%rip), %rdx
	leaq	h(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC1(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	movq	h(%rip), %rax
	testq	%rax, %rax
	jle	.L47
	leaq	ss(%rip), %rbp
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L48:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	h(%rip), %rax
	addq	$20, %rbp
	cmpq	%rbx, %rax
	jg	.L48
.L47:
	movq	%rax, %rdx
	xorl	%edi, %edi
	shrq	$63, %rdx
	leaq	(%rax,%rdx), %rsi
	andl	$1, %esi
	subl	%edx, %esi
	call	f
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 160
a:
	.zero	160
	.globl	ss
	.align 32
	.type	ss, @object
	.size	ss, 400
ss:
	.zero	400
	.globl	w
	.align 8
	.type	w, @object
	.size	w, 8
w:
	.zero	8
	.globl	h
	.align 8
	.type	h, @object
	.size	h, 8
h:
	.zero	8
	.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 <stdlib.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define bit(n,m)(((n)>>(m))&1)

ll h,w;
char ss[20][20];
ll a[20];

void g(int s,int flag){
	if(s+1==(1<<w)){
		puts("YES");
		exit(0);
	}
	int i=0;
	while(bit(s,i))i++;
	if(flag){
		int b=1;
		rep(k,0,h)if(ss[k][i]!=ss[a[k]][i]){
			b=0;
			break;
		}
		if(b)g(s^(1<<i),0);
	}
	rep(j,i+1,w)if(!bit(s,j)){
		int b=1;
		rep(k,0,h)if(ss[k][i]!=ss[a[k]][j]){
			b=0;
			break;
		}
		if(b)g(s^(1<<i)^(1<<j),flag);
	}	
}

void f(int s,int flag){
	if(s+1==(1<<h))g(0,w%2);
	int i=0;
	while(bit(s,i))i++;
	if(flag){
		a[i]=i;
		f(s^(1<<i),0);
	}
	rep(j,i+1,h)if(!bit(s,j)){
		a[i]=j;
		a[j]=i;
		f(s^(1<<i)^(1<<j),flag);
	}
}

int main(){
	scanf("%lld%lld",&h,&w);
	rep(i,0,h)scanf(" %s",ss[i]);
	f(0,h%2);
	puts("NO");
}

3 7
atcocer
regular
contest
 2 3
acr
car
 12 12
bimonigaloaf
faurwlkbleht
dexwimqxzxbb
lxdgyoifcxid
ydxilincfdgx
nfoabgilamoi
ibxbdqmzxxwe
pqirylfrcrnf
wtehfkllbura
yfrnpflcrirq
wvcclwgiubrk
lkbrwgwuiccv
 12 12
bimonigaloaf
faurwlkbleht
dexwimqxzxbb
lxdgyoifcxid
ydxilincfdgw
nfoabgilamoi
ibxbdqmzxxwe
pqirylfrcrnf
wtehfkllbura
yfrnpflcrirq
wvcclwgiubrk
lkbrwgwuiccv
 12 12
bimonigaloaf
faurwlkbleht
dexwimqxzxbb
lxdgyoifcxid
ydxilincfdgw
nfoabgilbmoi
ibxbdqmzxxwe
pqirylfrcrnf
wtehfkllbura
yfrnpflcrirq
wvcclwgiubrk
lkbrwgwuiccv
 12 12
bimonigaloaf
faurwlkbleht
dexwimqxzxbb
lxdgyoifcxid
ydxilincfdgw
nfoabgilbmoi
ibxbdqmzxxwe
pqirylfrcrnf
wtehfkllbura
qrirclfpnrfy
wvcclwgiubrk
lkbrwgwuiccv
 12 12
bimonigaloaf
faurwlkbleht
dexwimqxzxbb
lxdgyoifcxid
ydxilincfdgw
nfoabgilbmoi
ibxbdqmzxxwe
pqirylfrcrnf
wtehfkllbura
qrirclfpnrfy
wvcclwgiubqk
lkbrwgwuiccv
 12 12
bimonigaloaf
faurwlkbleht
dexwimqxzxbb
lxdgyoifcxid
ydxilincfdgw
nfobbgilbmoi
ibxbdqmzxxwe
pqirylfrcrnf
wtehfkllbura
qrirclfpnrfy
wvcclwgiubqk
lkbrwgwuiccv
 12 12
bimonigaloaf
faurwlkbleht
dexwimqxzxbb
lxdgyoifcxid
ydxilincfdgw
nfobbgilbmoi
ibxbdqmzxxwe
pqirylfrcrnf
wtehfkllbura
qrirclfpnrfy
wvcclwgiubqk
ukbrwgwliccv
 12 12
bimonigaloaf
faurwlkbleht
dexwimqxzxbb
lxdgyoifcxid
ydxilincfdgw
nfobbgilbmoi
ibxbdqmzxxwe
pqirylfrcrnf
arubllkfhetw
qrirclfpnrfy
wvcclwgiubqk
ukbrwgwliccv

NO
 YES
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO

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 <stdlib.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define bit(n,m)(((n)>>(m))&1)

ll h,w;
char ss[20][20];
ll a[20];

void g(int s,int flag){
	if(s+1==(1<<w)){
		puts("YES");
		exit(0);
	}
	int i=0;
	while(bit(s,i))i++;
	if(flag){
		int b=1;
		rep(k,0,h)if(ss[k][i]!=ss[a[k]][i]){
			b=0;
			break;
		}
		if(b)g(s^(1<<i),0);
	}
	rep(j,i+1,w)if(!bit(s,j)){
		int b=1;
		rep(k,0,h)if(ss[k][i]!=ss[a[k]][j]){
			b=0;
			break;
		}
		if(b)g(s^(1<<i)^(1<<j),flag);
	}	
}

void f(int s,int flag){
	if(s+1==(1<<h))g(0,w%2);
	int i=0;
	while(bit(s,i))i++;
	if(flag){
		a[i]=i;
		f(s^(1<<i),0);
	}
	rep(j,i+1,h)if(!bit(s,j)){
		a[i]=j;
		a[j]=i;
		f(s^(1<<i)^(1<<j),flag);
	}
}

int main(){
	scanf("%lld%lld",&h,&w);
	rep(i,0,h)scanf(" %s",ss[i]);
	f(0,h%2);
	puts("NO");
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	h
	.bss
	.align 8
	.type	h, @object
	.size	h, 8
h:
	.zero	8
	.globl	w
	.align 8
	.type	w, @object
	.size	w, 8
w:
	.zero	8
	.globl	ss
	.align 32
	.type	ss, @object
	.size	ss, 400
ss:
	.zero	400
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 160
a:
	.zero	160
	.section	.rodata
.LC0:
	.string	"YES"
	.text
	.globl	g
	.type	g, @function
g:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -52(%rbp)
	movl	%esi, -56(%rbp)
	movl	-52(%rbp), %eax
	leal	1(%rax), %edx
	movq	w(%rip), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	cmpl	%eax, %edx
	jne	.L2
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %edi
	call	exit@PLT
.L2:
	movl	$0, -36(%rbp)
	jmp	.L3
.L4:
	addl	$1, -36(%rbp)
.L3:
	movl	-36(%rbp), %eax
	movl	-52(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L4
	cmpl	$0, -56(%rbp)
	je	.L5
	movl	$1, -32(%rbp)
	movq	$0, -24(%rbp)
	jmp	.L6
.L9:
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %ecx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rsi), %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %cl
	je	.L7
	movl	$0, -32(%rbp)
	jmp	.L8
.L7:
	addq	$1, -24(%rbp)
.L6:
	movq	h(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jl	.L9
.L8:
	cmpl	$0, -32(%rbp)
	je	.L5
	movl	-36(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-52(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	g
.L5:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	%rax, -16(%rbp)
	jmp	.L10
.L16:
	movq	-16(%rbp), %rax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	movl	%edx, %ecx
	sarl	%cl, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L11
	movl	$1, -28(%rbp)
	movq	$0, -8(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %ecx
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	-16(%rbp), %rdx
	addq	%rax, %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %cl
	je	.L13
	movl	$0, -28(%rbp)
	jmp	.L14
.L13:
	addq	$1, -8(%rbp)
.L12:
	movq	h(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L15
.L14:
	cmpl	$0, -28(%rbp)
	je	.L11
	movl	-36(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-52(%rbp), %eax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	xorl	%eax, %edx
	movl	-56(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	g
.L11:
	addq	$1, -16(%rbp)
.L10:
	movq	w(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L16
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	g, .-g
	.globl	f
	.type	f, @function
f:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	leal	1(%rax), %edx
	movq	h(%rip), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	cmpl	%eax, %edx
	jne	.L18
	movq	w(%rip), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movl	%eax, %esi
	movl	$0, %edi
	call	g
.L18:
	movl	$0, -12(%rbp)
	jmp	.L19
.L20:
	addl	$1, -12(%rbp)
.L19:
	movl	-12(%rbp), %eax
	movl	-20(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L20
	cmpl	$0, -24(%rbp)
	je	.L21
	movl	-12(%rbp), %eax
	cltq
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-20(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	f
.L21:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	%rax, -8(%rbp)
	jmp	.L22
.L24:
	movq	-8(%rbp), %rax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%edx, %ecx
	sarl	%cl, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L23
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	movq	-8(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-20(%rbp), %eax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	xorl	%eax, %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	f
.L23:
	addq	$1, -8(%rbp)
.L22:
	movq	h(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L24
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	f, .-f
	.section	.rodata
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	" %s"
.LC3:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	w(%rip), %rax
	movq	%rax, %rdx
	leaq	h(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -8(%rbp)
	jmp	.L26
.L27:
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	ss(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -8(%rbp)
.L26:
	movq	h(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L27
	movq	h(%rip), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movl	%eax, %esi
	movl	$0, %edi
	call	f
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	h
	.bss
	.align 8
	.type	h, @object
	.size	h, 8
h:
	.zero	8
	.globl	w
	.align 8
	.type	w, @object
	.size	w, 8
w:
	.zero	8
	.globl	ss
	.align 32
	.type	ss, @object
	.size	ss, 400
ss:
	.zero	400
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 160
a:
	.zero	160
	.section	.rodata
.LC0:
	.string	"YES"
	.text
	.globl	g
	.type	g, @function
g:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movl	%edi, -52(%rbp)
	movl	%esi, -56(%rbp)
	movl	-52(%rbp), %eax
	leal	1(%rax), %edx
	movq	w(%rip), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	cmpl	%eax, %edx
	jne	.L2
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %edi
	call	exit@PLT
.L2:
	movl	$0, -36(%rbp)
	jmp	.L3
.L4:
	addl	$1, -36(%rbp)
.L3:
	movl	-36(%rbp), %eax
	movl	-52(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L4
	cmpl	$0, -56(%rbp)
	je	.L5
	movl	$1, -32(%rbp)
	movq	$0, -24(%rbp)
	jmp	.L6
.L9:
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %ecx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-36(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rsi), %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %cl
	je	.L7
	movl	$0, -32(%rbp)
	jmp	.L8
.L7:
	addq	$1, -24(%rbp)
.L6:
	movq	h(%rip), %rax
	cmpq	%rax, -24(%rbp)
	jl	.L9
.L8:
	cmpl	$0, -32(%rbp)
	je	.L5
	movl	-36(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-52(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	g
.L5:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	%rax, -16(%rbp)
	jmp	.L10
.L16:
	movq	-16(%rbp), %rax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	movl	%edx, %ecx
	sarl	%cl, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L11
	movl	$1, -28(%rbp)
	movq	$0, -8(%rbp)
	jmp	.L12
.L15:
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %ecx
	movq	-8(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	-16(%rbp), %rdx
	addq	%rax, %rdx
	leaq	ss(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %cl
	je	.L13
	movl	$0, -28(%rbp)
	jmp	.L14
.L13:
	addq	$1, -8(%rbp)
.L12:
	movq	h(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L15
.L14:
	cmpl	$0, -28(%rbp)
	je	.L11
	movl	-36(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-52(%rbp), %eax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	xorl	%eax, %edx
	movl	-56(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	g
.L11:
	addq	$1, -16(%rbp)
.L10:
	movq	w(%rip), %rax
	cmpq	%rax, -16(%rbp)
	jl	.L16
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	g, .-g
	.globl	f
	.type	f, @function
f:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	leal	1(%rax), %edx
	movq	h(%rip), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	cmpl	%eax, %edx
	jne	.L18
	movq	w(%rip), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movl	%eax, %esi
	movl	$0, %edi
	call	g
.L18:
	movl	$0, -12(%rbp)
	jmp	.L19
.L20:
	addl	$1, -12(%rbp)
.L19:
	movl	-12(%rbp), %eax
	movl	-20(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L20
	cmpl	$0, -24(%rbp)
	je	.L21
	movl	-12(%rbp), %eax
	cltq
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-20(%rbp), %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	f
.L21:
	movl	-12(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	%rax, -8(%rbp)
	jmp	.L22
.L24:
	movq	-8(%rbp), %rax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%edx, %ecx
	sarl	%cl, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L23
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	a(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	cltq
	movq	-8(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	xorl	-20(%rbp), %eax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	$1, %esi
	movl	%eax, %ecx
	sall	%cl, %esi
	movl	%esi, %eax
	xorl	%eax, %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	f
.L23:
	addq	$1, -8(%rbp)
.L22:
	movq	h(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L24
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	f, .-f
	.section	.rodata
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	" %s"
.LC3:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	w(%rip), %rax
	movq	%rax, %rdx
	leaq	h(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -8(%rbp)
	jmp	.L26
.L27:
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	ss(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -8(%rbp)
.L26:
	movq	h(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jl	.L27
	movq	h(%rip), %rax
	cqto
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movl	%eax, %esi
	movl	$0, %edi
	call	f
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
