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>
char m[11][10001];
char t[11][10001];
int R,C;
int count()
{
  int i,j,c,t=0;
  for(i=0;i<C;i++){
    c = 0;
    for(j=0;j<R;j++){
      if(m[j][i] == 0) c++;
    }
    if(R/2 >= c) t += R-c;
    else t += c;
  }
  return t;
}
int search(int n)
{
  int i,j;
  if(n==R) return count();
  i = search(n+1);
  memcpy(t[n],m[n],C);
  for(j=0;j<C;j++){
    m[n][j] = (m[n][j] == 1) ? 0 : 1;
  }
  j = search(n+1);
  memcpy(m[n],t[n],C);
  return i > j ? i : j;
}
int main()
{
  int i,j,k;
  for(;;){
    scanf("%d%d",&R,&C);
    if(R==0 && C==0) break;
    for(i=0;i<R;i++){
      for(j=0;j<C;j++){
	scanf("%d",&m[i][j]);
      }
      scanf("\n");
    }
    k = search(0);
    printf("%d\n",k);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 110011
m:
	.zero	110011
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 110011
t:
	.zero	110011
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	C
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.zero	4
	.text
	.globl	count
	.type	count, @function
count:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L2
.L8:
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L3
.L5:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L4
	addl	$1, -8(%rbp)
.L4:
	addl	$1, -12(%rbp)
.L3:
	movl	R(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	movl	R(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -8(%rbp)
	jg	.L6
	movl	R(%rip), %eax
	subl	-8(%rbp), %eax
	addl	%eax, -4(%rbp)
	jmp	.L7
.L6:
	movl	-8(%rbp), %eax
	addl	%eax, -4(%rbp)
.L7:
	addl	$1, -16(%rbp)
.L2:
	movl	C(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L8
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	count, .-count
	.globl	search
	.type	search, @function
search:
.LFB1:
	.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	R(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L11
	movl	$0, %eax
	call	count
	jmp	.L12
.L11:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	search
	movl	%eax, -4(%rbp)
	movl	C(%rip), %eax
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	m(%rip), %rcx
	leaq	(%rdx,%rcx), %rsi
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	t(%rip), %rcx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	memcpy@PLT
	movl	$0, -8(%rbp)
	jmp	.L13
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$1, %al
	setne	%al
	movl	%eax, %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rcx
	leaq	m(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -8(%rbp)
.L13:
	movl	C(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L14
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	search
	movl	%eax, -8(%rbp)
	movl	C(%rip), %eax
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	t(%rip), %rcx
	leaq	(%rdx,%rcx), %rsi
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	m(%rip), %rcx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	memcpy@PLT
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"\n"
.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	$16, %rsp
.L22:
	leaq	C(%rip), %rax
	movq	%rax, %rdx
	leaq	R(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	R(%rip), %eax
	testl	%eax, %eax
	jne	.L16
	movl	C(%rip), %eax
	testl	%eax, %eax
	je	.L25
.L16:
	movl	$0, -12(%rbp)
	jmp	.L18
.L21:
	movl	$0, -8(%rbp)
	jmp	.L19
.L20:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8(%rbp)
.L19:
	movl	C(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L20
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L18:
	movl	R(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L21
	movl	$0, %edi
	call	search
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L22
.L25:
	nop
	movl	$0, %eax
	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
	.type	search.part.0, @function
search.part.0:
.LFB38:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	m(%rip), %rcx
	leaq	t(%rip), %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movslq	%edi, %r14
	leal	1(%rdi), %r15d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	imulq	$10001, %r14, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	(%r12,%rcx), %r8
	addq	%rax, %r12
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	R(%rip), %ebx
	cmpl	%ebx, %r15d
	je	.L110
	movl	%r15d, %edi
	movq	%r8, (%rsp)
	call	search.part.0
	movslq	C(%rip), %r9
	movq	(%rsp), %rsi
	movq	%r12, %rdi
	movl	%eax, %ebp
	movq	%r9, %r13
	movq	%r9, %rdx
	movq	%r9, 8(%rsp)
	call	memcpy@PLT
	testl	%r13d, %r13d
	movq	(%rsp), %r8
	movq	8(%rsp), %r9
	jle	.L21
	movl	R(%rip), %ebx
	leaq	m(%rip), %rcx
.L43:
	testl	%r13d, %r13d
	movl	$1, %esi
	cmovg	%r13d, %esi
	cmpl	$15, %r13d
	jle	.L44
	movl	%esi, %edx
	movdqa	.LC0(%rip), %xmm1
	movq	%r8, %rax
	shrl	$4, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%r8,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L23:
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	pcmpeqb	%xmm1, %xmm0
	pandn	%xmm1, %xmm0
	movups	%xmm0, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L23
	movl	%esi, %eax
	andl	$-16, %eax
	andl	$15, %esi
	je	.L24
.L22:
	imulq	$10001, %r14, %rdx
	movslq	%eax, %rsi
	addq	%rcx, %rdx
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	1(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	2(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	3(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	4(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	5(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	6(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	7(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	8(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	9(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rsi, %rdx
	cmpb	$1, (%rdx)
	setne	(%rdx)
	leal	10(%rax), %edx
	cmpl	%edx, %r13d
	jle	.L24
	movslq	%edx, %rsi
	imulq	$10001, %r14, %rdx
	addq	%rcx, %rdx
	leaq	(%rdx,%rsi), %rcx
	cmpb	$1, (%rcx)
	setne	(%rcx)
	leal	11(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L24
	movslq	%ecx, %rcx
	addq	%rdx, %rcx
	cmpb	$1, (%rcx)
	setne	(%rcx)
	leal	12(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L24
	movslq	%ecx, %rcx
	addq	%rdx, %rcx
	cmpb	$1, (%rcx)
	setne	(%rcx)
	leal	13(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L24
	movslq	%ecx, %rcx
	addq	%rdx, %rcx
	cmpb	$1, (%rcx)
	setne	(%rcx)
	addl	$14, %eax
	cmpl	%eax, %r13d
	jle	.L24
	cltq
	addq	%rax, %rdx
	cmpb	$1, (%rdx)
	setne	(%rdx)
	.p2align 4,,10
	.p2align 3
.L24:
	cmpl	%ebx, %r15d
	je	.L111
.L41:
	movl	%r15d, %edi
	movq	%r8, (%rsp)
	call	search.part.0
	movslq	C(%rip), %r9
	movq	(%rsp), %r8
	movl	%eax, %r14d
.L38:
	movq	%r12, %rsi
	movq	%r9, %rdx
	movq	%r8, %rdi
	call	memcpy@PLT
	cmpl	%ebp, %r14d
	movl	%ebp, %eax
	cmovge	%r14d, %eax
	addq	$24, %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
.L110:
	.cfi_restore_state
	movslq	C(%rip), %r9
	movq	%r9, %r13
	testl	%r9d, %r9d
	jle	.L3
	movl	%r15d, %edi
	leal	-1(%r9), %eax
	leaq	1(%rcx), %r10
	movq	%rcx, %rdx
	shrl	$31, %edi
	addq	%rax, %r10
	xorl	%ebp, %ebp
	addl	%r15d, %edi
	sarl	%edi
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jle	.L20
	xorl	%eax, %eax
	cmpb	$0, (%rdx)
	sete	%al
	cmpl	$1, %ebx
	je	.L20
	cmpb	$1, 10001(%rdx)
	adcl	$0, %eax
	cmpl	$2, %ebx
	je	.L20
	cmpb	$1, 20002(%rdx)
	adcl	$0, %eax
	cmpl	$3, %ebx
	je	.L20
	cmpb	$1, 30003(%rdx)
	adcl	$0, %eax
	cmpl	$4, %ebx
	je	.L20
	cmpb	$1, 40004(%rdx)
	adcl	$0, %eax
	cmpl	$5, %ebx
	je	.L20
	cmpb	$1, 50005(%rdx)
	adcl	$0, %eax
	cmpl	$6, %ebx
	je	.L20
	cmpb	$1, 60006(%rdx)
	adcl	$0, %eax
	cmpl	$7, %ebx
	je	.L20
	cmpb	$1, 70007(%rdx)
	adcl	$0, %eax
	cmpl	$8, %ebx
	je	.L20
	cmpb	$1, 80008(%rdx)
	adcl	$0, %eax
	cmpl	$9, %ebx
	je	.L20
	cmpb	$1, 90009(%rdx)
	adcl	$0, %eax
	cmpl	$10, %ebx
	je	.L20
	cmpb	$1, 100010(%rdx)
	adcl	$0, %eax
.L20:
	movl	%ebx, %esi
	subl	%eax, %esi
	addl	%ebp, %esi
	addl	%eax, %ebp
	cmpl	%eax, %edi
	cmovge	%esi, %ebp
	addq	$1, %rdx
	cmpq	%r10, %rdx
	jne	.L4
	movq	%r9, %rdx
	movq	%r8, %rsi
	movq	%r12, %rdi
	movq	%r9, 8(%rsp)
	movq	%r8, (%rsp)
	call	memcpy@PLT
	movq	(%rsp), %r8
	movq	8(%rsp), %r9
	leaq	m(%rip), %rcx
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L111:
	movl	%ebx, %edi
	leaq	m(%rip), %rdx
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	shrl	$31, %edi
	addl	%ebx, %edi
	sarl	%edi
	.p2align 4,,10
	.p2align 3
.L42:
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jle	.L40
	xorl	%eax, %eax
	cmpb	$0, (%rdx)
	sete	%al
	cmpl	$1, %ebx
	je	.L40
	cmpb	$1, 10001(%rdx)
	adcl	$0, %eax
	cmpl	$2, %ebx
	je	.L40
	cmpb	$1, 20002(%rdx)
	adcl	$0, %eax
	cmpl	$3, %ebx
	je	.L40
	cmpb	$1, 30003(%rdx)
	adcl	$0, %eax
	cmpl	$4, %ebx
	je	.L40
	cmpb	$1, 40004(%rdx)
	adcl	$0, %eax
	cmpl	$5, %ebx
	je	.L40
	cmpb	$1, 50005(%rdx)
	adcl	$0, %eax
	cmpl	$6, %ebx
	je	.L40
	cmpb	$1, 60006(%rdx)
	adcl	$0, %eax
	cmpl	$7, %ebx
	je	.L40
	cmpb	$1, 70007(%rdx)
	adcl	$0, %eax
	cmpl	$8, %ebx
	je	.L40
	cmpb	$1, 80008(%rdx)
	adcl	$0, %eax
	cmpl	$9, %ebx
	je	.L40
	cmpb	$1, 90009(%rdx)
	adcl	$0, %eax
	cmpl	$10, %ebx
	je	.L40
	cmpb	$1, 100010(%rdx)
	adcl	$0, %eax
.L40:
	movl	%ebx, %ecx
	subl	%eax, %ecx
	addl	%r14d, %ecx
	addl	%eax, %r14d
	cmpl	%eax, %edi
	cmovge	%ecx, %r14d
	addl	$1, %esi
	addq	$1, %rdx
	cmpl	%r13d, %esi
	jl	.L42
	jmp	.L38
.L44:
	xorl	%eax, %eax
	jmp	.L22
.L21:
	cmpl	R(%rip), %r15d
	jne	.L41
	xorl	%r14d, %r14d
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r9, %rdx
	movq	%r8, %rsi
	movq	%r12, %rdi
	movq	%r9, 8(%rsp)
	movq	%r8, (%rsp)
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	call	memcpy@PLT
	movq	(%rsp), %r8
	movq	8(%rsp), %r9
	jmp	.L38
	.cfi_endproc
.LFE38:
	.size	search.part.0, .-search.part.0
	.p2align 4
	.globl	count
	.type	count, @function
count:
.LFB35:
	.cfi_startproc
	endbr64
	movl	C(%rip), %eax
	testl	%eax, %eax
	jle	.L130
	movl	R(%rip), %esi
	leaq	m(%rip), %rcx
	leal	-1(%rax), %r9d
	leaq	1(%rcx), %rax
	movl	%esi, %r8d
	addq	%rax, %r9
	xorl	%eax, %eax
	shrl	$31, %r8d
	addl	%esi, %r8d
	sarl	%r8d
	.p2align 4,,10
	.p2align 3
.L114:
	xorl	%edx, %edx
	testl	%esi, %esi
	jle	.L129
	xorl	%edx, %edx
	cmpb	$0, (%rcx)
	sete	%dl
	cmpl	$1, %esi
	je	.L129
	cmpb	$1, 10001(%rcx)
	adcl	$0, %edx
	cmpl	$2, %esi
	je	.L129
	cmpb	$1, 20002(%rcx)
	adcl	$0, %edx
	cmpl	$3, %esi
	je	.L129
	cmpb	$1, 30003(%rcx)
	adcl	$0, %edx
	cmpl	$4, %esi
	je	.L129
	cmpb	$1, 40004(%rcx)
	adcl	$0, %edx
	cmpl	$5, %esi
	je	.L129
	cmpb	$1, 50005(%rcx)
	adcl	$0, %edx
	cmpl	$6, %esi
	je	.L129
	cmpb	$1, 60006(%rcx)
	adcl	$0, %edx
	cmpl	$7, %esi
	je	.L129
	cmpb	$1, 70007(%rcx)
	adcl	$0, %edx
	cmpl	$8, %esi
	je	.L129
	cmpb	$1, 80008(%rcx)
	adcl	$0, %edx
	cmpl	$9, %esi
	je	.L129
	cmpb	$1, 90009(%rcx)
	adcl	$0, %edx
	cmpl	$10, %esi
	je	.L129
	cmpb	$1, 100010(%rcx)
	adcl	$0, %edx
.L129:
	movl	%esi, %edi
	subl	%edx, %edi
	addl	%eax, %edi
	addl	%edx, %eax
	cmpl	%edx, %r8d
	cmovge	%edi, %eax
	addq	$1, %rcx
	cmpq	%r9, %rcx
	jne	.L114
	ret
.L130:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	count, .-count
	.p2align 4
	.globl	search
	.type	search, @function
search:
.LFB36:
	.cfi_startproc
	endbr64
	cmpl	%edi, R(%rip)
	je	.L211
	jmp	search.part.0
	.p2align 4,,10
	.p2align 3
.L211:
	movl	C(%rip), %eax
	testl	%eax, %eax
	jle	.L180
	movl	%edi, %r8d
	leaq	m(%rip), %rcx
	leal	-1(%rax), %r9d
	shrl	$31, %r8d
	leaq	1(%rcx), %rax
	addl	%edi, %r8d
	addq	%rax, %r9
	xorl	%eax, %eax
	sarl	%r8d
	.p2align 4,,10
	.p2align 3
.L164:
	xorl	%edx, %edx
	testl	%edi, %edi
	jle	.L179
	xorl	%edx, %edx
	cmpb	$0, (%rcx)
	sete	%dl
	cmpl	$1, %edi
	je	.L179
	cmpb	$1, 10001(%rcx)
	adcl	$0, %edx
	cmpl	$2, %edi
	je	.L179
	cmpb	$1, 20002(%rcx)
	adcl	$0, %edx
	cmpl	$3, %edi
	je	.L179
	cmpb	$1, 30003(%rcx)
	adcl	$0, %edx
	cmpl	$4, %edi
	je	.L179
	cmpb	$1, 40004(%rcx)
	adcl	$0, %edx
	cmpl	$5, %edi
	je	.L179
	cmpb	$1, 50005(%rcx)
	adcl	$0, %edx
	cmpl	$6, %edi
	je	.L179
	cmpb	$1, 60006(%rcx)
	adcl	$0, %edx
	cmpl	$7, %edi
	je	.L179
	cmpb	$1, 70007(%rcx)
	adcl	$0, %edx
	cmpl	$8, %edi
	je	.L179
	cmpb	$1, 80008(%rcx)
	adcl	$0, %edx
	cmpl	$9, %edi
	je	.L179
	cmpb	$1, 90009(%rcx)
	adcl	$0, %edx
	cmpl	$10, %edi
	je	.L179
	cmpb	$1, 100010(%rcx)
	adcl	$0, %edx
.L179:
	movl	%edi, %esi
	subl	%edx, %esi
	addl	%eax, %esi
	addl	%edx, %eax
	cmpl	%edx, %r8d
	cmovge	%esi, %eax
	addq	$1, %rcx
	cmpq	%r9, %rcx
	jne	.L164
	ret
.L180:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	search, .-search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"\n"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC3(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	m(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	jmp	.L226
.L245:
	movl	C(%rip), %ecx
	testl	%ecx, %ecx
	je	.L244
.L215:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L226:
	leaq	C(%rip), %rdx
	leaq	R(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	R(%rip), %edx
	testl	%edx, %edx
	je	.L245
	jle	.L230
	leaq	m(%rip), %rbx
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L231:
	movl	C(%rip), %eax
	xorl	%r15d, %r15d
	testl	%eax, %eax
	jle	.L218
	.p2align 4,,10
	.p2align 3
.L216:
	leaq	(%rbx,%r15), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	cmpl	%r15d, C(%rip)
	jg	.L216
.L218:
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	addq	$10001, %rbx
	call	__isoc99_scanf@PLT
	movl	R(%rip), %edx
	cmpl	%r12d, %edx
	jg	.L231
	testl	%edx, %edx
	je	.L215
.L230:
	cmpl	$1, %edx
	je	.L246
	movl	$1, %edi
	leaq	t(%rip), %r15
	call	search.part.0
	movl	$110011, %ecx
	movq	%r13, %rsi
	movq	%r15, %rdi
	movslq	C(%rip), %r9
	movl	%eax, %ebx
	movq	%r9, %r12
	movq	%r9, %rdx
	movq	%r9, 8(%rsp)
	call	__memcpy_chk@PLT
	testl	%r12d, %r12d
	movq	8(%rsp), %r9
	jle	.L222
.L229:
	testl	%r12d, %r12d
	movl	$1, %ecx
	cmovg	%r12d, %ecx
	cmpl	$15, %r12d
	jle	.L233
	movl	%ecx, %edx
	leaq	m(%rip), %rax
	shrl	$4, %edx
	leaq	16(%rax), %rsi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L224:
	movdqa	(%rax), %xmm0
	addq	$16, %rax
	pcmpeqb	.LC0(%rip), %xmm0
	pandn	.LC0(%rip), %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L224
	movl	%ecx, %eax
	andl	$-16, %eax
	andl	$15, %ecx
	je	.L225
.L223:
	movslq	%eax, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	1(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	2(%rax), %edx
	cmpl	%r12d, %edx
	jge	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	3(%rax), %edx
	cmpl	%r12d, %edx
	jge	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	4(%rax), %edx
	cmpl	%r12d, %edx
	jge	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	5(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	6(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	7(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	8(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	9(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	10(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	11(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	12(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	13(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	addl	$14, %eax
	cmpl	%eax, %r12d
	jle	.L225
	cltq
	cmpb	$1, 0(%r13,%rax)
	setne	0(%r13,%rax)
.L225:
	cmpl	$1, R(%rip)
	je	.L227
.L228:
	movl	$1, %edi
	call	search.part.0
	movslq	C(%rip), %r9
	movl	%eax, %r12d
.L227:
	movq	%r9, %rdx
	movl	$110011, %ecx
	movq	%r15, %rsi
	movq	%r13, %rdi
	call	__memcpy_chk@PLT
	cmpl	%ebx, %r12d
	movl	%ebx, %edx
	cmovge	%r12d, %edx
	jmp	.L215
.L246:
	movslq	C(%rip), %r9
	movq	%r9, %r12
	testl	%r9d, %r9d
	jle	.L247
	leaq	t(%rip), %r15
	movq	%r9, %rdx
	movq	%r13, %rsi
	movl	%r12d, %ebx
	movl	$110011, %ecx
	movq	%r15, %rdi
	movq	%r9, 8(%rsp)
	call	__memcpy_chk@PLT
	movq	8(%rsp), %r9
	jmp	.L229
.L247:
	leaq	t(%rip), %r15
	movq	%r9, %rdx
	movq	%r13, %rsi
	xorl	%ebx, %ebx
	movl	$110011, %ecx
	movq	%r15, %rdi
	call	__memcpy_chk@PLT
.L222:
	cmpl	$1, R(%rip)
	jne	.L228
	movslq	C(%rip), %r9
	xorl	%r12d, %r12d
	jmp	.L227
.L244:
	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
.L233:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L223
	.cfi_endproc
.LFE37:
	.size	main, .-main
	.globl	C
	.bss
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 110011
t:
	.zero	110011
	.globl	m
	.align 32
	.type	m, @object
	.size	m, 110011
m:
	.zero	110011
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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
	.type	search.part.0, @function
search.part.0:
.LFB38:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	m(%rip), %rcx
	leaq	t(%rip), %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movslq	%edi, %r14
	leal	1(%rdi), %r15d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	imulq	$10001, %r14, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	(%r12,%rcx), %r8
	addq	%rax, %r12
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	R(%rip), %ebx
	cmpl	%ebx, %r15d
	je	.L110
	movl	%r15d, %edi
	movq	%r8, (%rsp)
	call	search.part.0
	movslq	C(%rip), %r9
	movq	(%rsp), %rsi
	movq	%r12, %rdi
	movl	%eax, %ebp
	movq	%r9, %r13
	movq	%r9, %rdx
	movq	%r9, 8(%rsp)
	call	memcpy@PLT
	testl	%r13d, %r13d
	movq	(%rsp), %r8
	movq	8(%rsp), %r9
	jle	.L21
	movl	R(%rip), %ebx
	leaq	m(%rip), %rcx
.L43:
	testl	%r13d, %r13d
	movl	$1, %esi
	cmovg	%r13d, %esi
	cmpl	$15, %r13d
	jle	.L44
	movl	%esi, %edx
	movdqa	.LC0(%rip), %xmm1
	movq	%r8, %rax
	shrl	$4, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%r8,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L23:
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	pcmpeqb	%xmm1, %xmm0
	pandn	%xmm1, %xmm0
	movups	%xmm0, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L23
	movl	%esi, %eax
	andl	$-16, %eax
	andl	$15, %esi
	je	.L24
.L22:
	imulq	$10001, %r14, %rdx
	movslq	%eax, %rsi
	addq	%rcx, %rdx
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	1(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	2(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	3(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	4(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	5(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	6(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	7(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	8(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rdx, %rsi
	cmpb	$1, (%rsi)
	setne	(%rsi)
	leal	9(%rax), %esi
	cmpl	%esi, %r13d
	jle	.L24
	movslq	%esi, %rsi
	addq	%rsi, %rdx
	cmpb	$1, (%rdx)
	setne	(%rdx)
	leal	10(%rax), %edx
	cmpl	%edx, %r13d
	jle	.L24
	movslq	%edx, %rsi
	imulq	$10001, %r14, %rdx
	addq	%rcx, %rdx
	leaq	(%rdx,%rsi), %rcx
	cmpb	$1, (%rcx)
	setne	(%rcx)
	leal	11(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L24
	movslq	%ecx, %rcx
	addq	%rdx, %rcx
	cmpb	$1, (%rcx)
	setne	(%rcx)
	leal	12(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L24
	movslq	%ecx, %rcx
	addq	%rdx, %rcx
	cmpb	$1, (%rcx)
	setne	(%rcx)
	leal	13(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L24
	movslq	%ecx, %rcx
	addq	%rdx, %rcx
	cmpb	$1, (%rcx)
	setne	(%rcx)
	addl	$14, %eax
	cmpl	%eax, %r13d
	jle	.L24
	cltq
	addq	%rax, %rdx
	cmpb	$1, (%rdx)
	setne	(%rdx)
	.p2align 4,,10
	.p2align 3
.L24:
	cmpl	%ebx, %r15d
	je	.L111
.L41:
	movl	%r15d, %edi
	movq	%r8, (%rsp)
	call	search.part.0
	movslq	C(%rip), %r9
	movq	(%rsp), %r8
	movl	%eax, %r14d
.L38:
	movq	%r12, %rsi
	movq	%r9, %rdx
	movq	%r8, %rdi
	call	memcpy@PLT
	cmpl	%ebp, %r14d
	movl	%ebp, %eax
	cmovge	%r14d, %eax
	addq	$24, %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
.L110:
	.cfi_restore_state
	movslq	C(%rip), %r9
	movq	%r9, %r13
	testl	%r9d, %r9d
	jle	.L3
	movl	%r15d, %edi
	leal	-1(%r9), %eax
	leaq	1(%rcx), %r10
	movq	%rcx, %rdx
	shrl	$31, %edi
	addq	%rax, %r10
	xorl	%ebp, %ebp
	addl	%r15d, %edi
	sarl	%edi
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jle	.L20
	xorl	%eax, %eax
	cmpb	$0, (%rdx)
	sete	%al
	cmpl	$1, %ebx
	je	.L20
	cmpb	$1, 10001(%rdx)
	adcl	$0, %eax
	cmpl	$2, %ebx
	je	.L20
	cmpb	$1, 20002(%rdx)
	adcl	$0, %eax
	cmpl	$3, %ebx
	je	.L20
	cmpb	$1, 30003(%rdx)
	adcl	$0, %eax
	cmpl	$4, %ebx
	je	.L20
	cmpb	$1, 40004(%rdx)
	adcl	$0, %eax
	cmpl	$5, %ebx
	je	.L20
	cmpb	$1, 50005(%rdx)
	adcl	$0, %eax
	cmpl	$6, %ebx
	je	.L20
	cmpb	$1, 60006(%rdx)
	adcl	$0, %eax
	cmpl	$7, %ebx
	je	.L20
	cmpb	$1, 70007(%rdx)
	adcl	$0, %eax
	cmpl	$8, %ebx
	je	.L20
	cmpb	$1, 80008(%rdx)
	adcl	$0, %eax
	cmpl	$9, %ebx
	je	.L20
	cmpb	$1, 90009(%rdx)
	adcl	$0, %eax
	cmpl	$10, %ebx
	je	.L20
	cmpb	$1, 100010(%rdx)
	adcl	$0, %eax
.L20:
	movl	%ebx, %esi
	subl	%eax, %esi
	addl	%ebp, %esi
	addl	%eax, %ebp
	cmpl	%eax, %edi
	cmovge	%esi, %ebp
	addq	$1, %rdx
	cmpq	%r10, %rdx
	jne	.L4
	movq	%r9, %rdx
	movq	%r8, %rsi
	movq	%r12, %rdi
	movq	%r9, 8(%rsp)
	movq	%r8, (%rsp)
	call	memcpy@PLT
	movq	(%rsp), %r8
	movq	8(%rsp), %r9
	leaq	m(%rip), %rcx
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L111:
	movl	%ebx, %edi
	leaq	m(%rip), %rdx
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	shrl	$31, %edi
	addl	%ebx, %edi
	sarl	%edi
	.p2align 4,,10
	.p2align 3
.L42:
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jle	.L40
	xorl	%eax, %eax
	cmpb	$0, (%rdx)
	sete	%al
	cmpl	$1, %ebx
	je	.L40
	cmpb	$1, 10001(%rdx)
	adcl	$0, %eax
	cmpl	$2, %ebx
	je	.L40
	cmpb	$1, 20002(%rdx)
	adcl	$0, %eax
	cmpl	$3, %ebx
	je	.L40
	cmpb	$1, 30003(%rdx)
	adcl	$0, %eax
	cmpl	$4, %ebx
	je	.L40
	cmpb	$1, 40004(%rdx)
	adcl	$0, %eax
	cmpl	$5, %ebx
	je	.L40
	cmpb	$1, 50005(%rdx)
	adcl	$0, %eax
	cmpl	$6, %ebx
	je	.L40
	cmpb	$1, 60006(%rdx)
	adcl	$0, %eax
	cmpl	$7, %ebx
	je	.L40
	cmpb	$1, 70007(%rdx)
	adcl	$0, %eax
	cmpl	$8, %ebx
	je	.L40
	cmpb	$1, 80008(%rdx)
	adcl	$0, %eax
	cmpl	$9, %ebx
	je	.L40
	cmpb	$1, 90009(%rdx)
	adcl	$0, %eax
	cmpl	$10, %ebx
	je	.L40
	cmpb	$1, 100010(%rdx)
	adcl	$0, %eax
.L40:
	movl	%ebx, %ecx
	subl	%eax, %ecx
	addl	%r14d, %ecx
	addl	%eax, %r14d
	cmpl	%eax, %edi
	cmovge	%ecx, %r14d
	addl	$1, %esi
	addq	$1, %rdx
	cmpl	%r13d, %esi
	jl	.L42
	jmp	.L38
.L44:
	xorl	%eax, %eax
	jmp	.L22
.L21:
	cmpl	R(%rip), %r15d
	jne	.L41
	xorl	%r14d, %r14d
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r9, %rdx
	movq	%r8, %rsi
	movq	%r12, %rdi
	movq	%r9, 8(%rsp)
	movq	%r8, (%rsp)
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	call	memcpy@PLT
	movq	(%rsp), %r8
	movq	8(%rsp), %r9
	jmp	.L38
	.cfi_endproc
.LFE38:
	.size	search.part.0, .-search.part.0
	.p2align 4
	.globl	count
	.type	count, @function
count:
.LFB35:
	.cfi_startproc
	endbr64
	movl	C(%rip), %eax
	testl	%eax, %eax
	jle	.L130
	movl	R(%rip), %esi
	leaq	m(%rip), %rcx
	leal	-1(%rax), %r9d
	leaq	1(%rcx), %rax
	movl	%esi, %r8d
	addq	%rax, %r9
	xorl	%eax, %eax
	shrl	$31, %r8d
	addl	%esi, %r8d
	sarl	%r8d
	.p2align 4,,10
	.p2align 3
.L114:
	xorl	%edx, %edx
	testl	%esi, %esi
	jle	.L129
	xorl	%edx, %edx
	cmpb	$0, (%rcx)
	sete	%dl
	cmpl	$1, %esi
	je	.L129
	cmpb	$1, 10001(%rcx)
	adcl	$0, %edx
	cmpl	$2, %esi
	je	.L129
	cmpb	$1, 20002(%rcx)
	adcl	$0, %edx
	cmpl	$3, %esi
	je	.L129
	cmpb	$1, 30003(%rcx)
	adcl	$0, %edx
	cmpl	$4, %esi
	je	.L129
	cmpb	$1, 40004(%rcx)
	adcl	$0, %edx
	cmpl	$5, %esi
	je	.L129
	cmpb	$1, 50005(%rcx)
	adcl	$0, %edx
	cmpl	$6, %esi
	je	.L129
	cmpb	$1, 60006(%rcx)
	adcl	$0, %edx
	cmpl	$7, %esi
	je	.L129
	cmpb	$1, 70007(%rcx)
	adcl	$0, %edx
	cmpl	$8, %esi
	je	.L129
	cmpb	$1, 80008(%rcx)
	adcl	$0, %edx
	cmpl	$9, %esi
	je	.L129
	cmpb	$1, 90009(%rcx)
	adcl	$0, %edx
	cmpl	$10, %esi
	je	.L129
	cmpb	$1, 100010(%rcx)
	adcl	$0, %edx
.L129:
	movl	%esi, %edi
	subl	%edx, %edi
	addl	%eax, %edi
	addl	%edx, %eax
	cmpl	%edx, %r8d
	cmovge	%edi, %eax
	addq	$1, %rcx
	cmpq	%r9, %rcx
	jne	.L114
	ret
.L130:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	count, .-count
	.p2align 4
	.globl	search
	.type	search, @function
search:
.LFB36:
	.cfi_startproc
	endbr64
	cmpl	%edi, R(%rip)
	je	.L211
	jmp	search.part.0
	.p2align 4,,10
	.p2align 3
.L211:
	movl	C(%rip), %eax
	testl	%eax, %eax
	jle	.L180
	movl	%edi, %r8d
	leaq	m(%rip), %rcx
	leal	-1(%rax), %r9d
	shrl	$31, %r8d
	leaq	1(%rcx), %rax
	addl	%edi, %r8d
	addq	%rax, %r9
	xorl	%eax, %eax
	sarl	%r8d
	.p2align 4,,10
	.p2align 3
.L164:
	xorl	%edx, %edx
	testl	%edi, %edi
	jle	.L179
	xorl	%edx, %edx
	cmpb	$0, (%rcx)
	sete	%dl
	cmpl	$1, %edi
	je	.L179
	cmpb	$1, 10001(%rcx)
	adcl	$0, %edx
	cmpl	$2, %edi
	je	.L179
	cmpb	$1, 20002(%rcx)
	adcl	$0, %edx
	cmpl	$3, %edi
	je	.L179
	cmpb	$1, 30003(%rcx)
	adcl	$0, %edx
	cmpl	$4, %edi
	je	.L179
	cmpb	$1, 40004(%rcx)
	adcl	$0, %edx
	cmpl	$5, %edi
	je	.L179
	cmpb	$1, 50005(%rcx)
	adcl	$0, %edx
	cmpl	$6, %edi
	je	.L179
	cmpb	$1, 60006(%rcx)
	adcl	$0, %edx
	cmpl	$7, %edi
	je	.L179
	cmpb	$1, 70007(%rcx)
	adcl	$0, %edx
	cmpl	$8, %edi
	je	.L179
	cmpb	$1, 80008(%rcx)
	adcl	$0, %edx
	cmpl	$9, %edi
	je	.L179
	cmpb	$1, 90009(%rcx)
	adcl	$0, %edx
	cmpl	$10, %edi
	je	.L179
	cmpb	$1, 100010(%rcx)
	adcl	$0, %edx
.L179:
	movl	%edi, %esi
	subl	%edx, %esi
	addl	%eax, %esi
	addl	%edx, %eax
	cmpl	%edx, %r8d
	cmovge	%esi, %eax
	addq	$1, %rcx
	cmpq	%r9, %rcx
	jne	.L164
	ret
.L180:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	search, .-search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"\n"
.LC4:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC3(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	m(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	jmp	.L226
.L245:
	movl	C(%rip), %ecx
	testl	%ecx, %ecx
	je	.L244
.L215:
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L226:
	leaq	C(%rip), %rdx
	leaq	R(%rip), %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	R(%rip), %edx
	testl	%edx, %edx
	je	.L245
	jle	.L230
	leaq	m(%rip), %rbx
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L231:
	movl	C(%rip), %eax
	xorl	%r15d, %r15d
	testl	%eax, %eax
	jle	.L218
	.p2align 4,,10
	.p2align 3
.L216:
	leaq	(%rbx,%r15), %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	cmpl	%r15d, C(%rip)
	jg	.L216
.L218:
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	addq	$10001, %rbx
	call	__isoc99_scanf@PLT
	movl	R(%rip), %edx
	cmpl	%r12d, %edx
	jg	.L231
	testl	%edx, %edx
	je	.L215
.L230:
	cmpl	$1, %edx
	je	.L246
	movl	$1, %edi
	leaq	t(%rip), %r15
	call	search.part.0
	movl	$110011, %ecx
	movq	%r13, %rsi
	movq	%r15, %rdi
	movslq	C(%rip), %r9
	movl	%eax, %ebx
	movq	%r9, %r12
	movq	%r9, %rdx
	movq	%r9, 8(%rsp)
	call	__memcpy_chk@PLT
	testl	%r12d, %r12d
	movq	8(%rsp), %r9
	jle	.L222
.L229:
	testl	%r12d, %r12d
	movl	$1, %ecx
	cmovg	%r12d, %ecx
	cmpl	$15, %r12d
	jle	.L233
	movl	%ecx, %edx
	leaq	m(%rip), %rax
	shrl	$4, %edx
	leaq	16(%rax), %rsi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L224:
	movdqa	(%rax), %xmm0
	addq	$16, %rax
	pcmpeqb	.LC0(%rip), %xmm0
	pandn	.LC0(%rip), %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L224
	movl	%ecx, %eax
	andl	$-16, %eax
	andl	$15, %ecx
	je	.L225
.L223:
	movslq	%eax, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	1(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	2(%rax), %edx
	cmpl	%r12d, %edx
	jge	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	3(%rax), %edx
	cmpl	%r12d, %edx
	jge	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	4(%rax), %edx
	cmpl	%r12d, %edx
	jge	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	5(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	6(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	7(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	8(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	9(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	10(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	11(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	12(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	leal	13(%rax), %edx
	cmpl	%edx, %r12d
	jle	.L225
	movslq	%edx, %rdx
	cmpb	$1, 0(%r13,%rdx)
	setne	0(%r13,%rdx)
	addl	$14, %eax
	cmpl	%eax, %r12d
	jle	.L225
	cltq
	cmpb	$1, 0(%r13,%rax)
	setne	0(%r13,%rax)
.L225:
	cmpl	$1, R(%rip)
	je	.L227
.L228:
	movl	$1, %edi
	call	search.part.0
	movslq	C(%rip), %r9
	movl	%eax, %r12d
.L227:
	movq	%r9, %rdx
	movl	$110011, %ecx
	movq	%r15, %rsi
	movq	%r13, %rdi
	call	__memcpy_chk@PLT
	cmpl	%ebx, %r12d
	movl	%ebx, %edx
	cmovge	%r12d, %edx
	jmp	.L215
.L246:
	movslq	C(%rip), %r9
	movq	%r9, %r12
	testl	%r9d, %r9d
	jle	.L247
	leaq	t(%rip), %r15
	movq	%r9, %rdx
	movq	%r13, %rsi
	movl	%r12d, %ebx
	movl	$110011, %ecx
	movq	%r15, %rdi
	movq	%r9, 8(%rsp)
	call	__memcpy_chk@PLT
	movq	8(%rsp), %r9
	jmp	.L229
.L247:
	leaq	t(%rip), %r15
	movq	%r9, %rdx
	movq	%r13, %rsi
	xorl	%ebx, %ebx
	movl	$110011, %ecx
	movq	%r15, %rdi
	call	__memcpy_chk@PLT
.L222:
	cmpl	$1, R(%rip)
	jne	.L228
	movslq	C(%rip), %r9
	xorl	%r12d, %r12d
	jmp	.L227
.L244:
	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
.L233:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L223
	.cfi_endproc
.LFE37:
	.size	main, .-main
	.globl	C
	.bss
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 110011
t:
	.zero	110011
	.globl	m
	.align 32
	.type	m, @object
	.size	m, 110011
m:
	.zero	110011
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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>
char m[11][10001];
char t[11][10001];
int R,C;
int count()
{
  int i,j,c,t=0;
  for(i=0;i<C;i++){
    c = 0;
    for(j=0;j<R;j++){
      if(m[j][i] == 0) c++;
    }
    if(R/2 >= c) t += R-c;
    else t += c;
  }
  return t;
}
int search(int n)
{
  int i,j;
  if(n==R) return count();
  i = search(n+1);
  memcpy(t[n],m[n],C);
  for(j=0;j<C;j++){
    m[n][j] = (m[n][j] == 1) ? 0 : 1;
  }
  j = search(n+1);
  memcpy(m[n],t[n],C);
  return i > j ? i : j;
}
int main()
{
  int i,j,k;
  for(;;){
    scanf("%d%d",&R,&C);
    if(R==0 && C==0) break;
    for(i=0;i<R;i++){
      for(j=0;j<C;j++){
	scanf("%d",&m[i][j]);
      }
      scanf("\n");
    }
    k = search(0);
    printf("%d\n",k);
  }
  return 0;
}
2 5
0 1 0 1 0
1 0 0 0 1
3 6
1 0 1 0 1 0
1 1 1 0 1 0
1 0 1 1 0 1
0 0
 2 5
0 1 1 1 0
1 0 0 0 1
3 6
1 0 0 0 1 0
1 1 1 0 1 0
1 0 1 1 0 1
0 0
 2 5
0 1 0 1 0
1 0 0 0 1
3 6
1 0 0 0 1 1
1 1 1 0 1 0
1 0 1 1 0 1
0 0
 2 5
1 1 1 1 0
1 0 0 1 1
3 6
1 0 0 0 1 0
0 1 1 0 1 0
1 0 1 1 0 1
0 0
 2 5
0 1 0 1 0
1 0 0 0 1
3 6
1 0 1 0 1 0
1 1 1 0 1 0
1 0 1 0 0 0
0 0
 2 5
0 1 0 1 0
1 0 0 0 1
3 6
1 0 1 0 1 0
1 0 1 0 1 0
1 0 1 0 0 0
0 0
 2 5
0 1 1 1 0
0 0 0 1 1
3 6
1 1 0 0 1 0
0 0 1 0 1 0
1 0 1 0 0 1
0 0
 2 5
1 1 1 1 0
0 0 0 0 1
3 6
1 0 0 0 0 1
0 1 1 0 1 0
1 0 1 1 0 1
0 0
 2 5
1 1 1 1 0
1 0 1 0 1
3 6
1 0 0 0 0 1
0 1 1 0 1 0
1 0 1 1 0 1
0 0
 2 5
1 1 1 1 0
0 0 0 0 1
3 6
1 0 0 0 1 0
0 1 1 0 1 1
1 0 1 1 0 1
0 0

9
15
 10
15
 9
14
 8
15
 9
16
 9
17
 8
14
 10
16
 8
16
 10
14

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>
char m[11][10001];
char t[11][10001];
int R,C;
int count()
{
  int i,j,c,t=0;
  for(i=0;i<C;i++){
    c = 0;
    for(j=0;j<R;j++){
      if(m[j][i] == 0) c++;
    }
    if(R/2 >= c) t += R-c;
    else t += c;
  }
  return t;
}
int search(int n)
{
  int i,j;
  if(n==R) return count();
  i = search(n+1);
  memcpy(t[n],m[n],C);
  for(j=0;j<C;j++){
    m[n][j] = (m[n][j] == 1) ? 0 : 1;
  }
  j = search(n+1);
  memcpy(m[n],t[n],C);
  return i > j ? i : j;
}
int main()
{
  int i,j,k;
  for(;;){
    scanf("%d%d",&R,&C);
    if(R==0 && C==0) break;
    for(i=0;i<R;i++){
      for(j=0;j<C;j++){
	scanf("%d",&m[i][j]);
      }
      scanf("\n");
    }
    k = search(0);
    printf("%d\n",k);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 110011
m:
	.zero	110011
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 110011
t:
	.zero	110011
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	C
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.zero	4
	.text
	.globl	count
	.type	count, @function
count:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L2
.L8:
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L3
.L5:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L4
	addl	$1, -8(%rbp)
.L4:
	addl	$1, -12(%rbp)
.L3:
	movl	R(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	movl	R(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -8(%rbp)
	jg	.L6
	movl	R(%rip), %eax
	subl	-8(%rbp), %eax
	addl	%eax, -4(%rbp)
	jmp	.L7
.L6:
	movl	-8(%rbp), %eax
	addl	%eax, -4(%rbp)
.L7:
	addl	$1, -16(%rbp)
.L2:
	movl	C(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L8
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	count, .-count
	.globl	search
	.type	search, @function
search:
.LFB1:
	.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	R(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L11
	movl	$0, %eax
	call	count
	jmp	.L12
.L11:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	search
	movl	%eax, -4(%rbp)
	movl	C(%rip), %eax
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	m(%rip), %rcx
	leaq	(%rdx,%rcx), %rsi
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	t(%rip), %rcx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	memcpy@PLT
	movl	$0, -8(%rbp)
	jmp	.L13
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$1, %al
	setne	%al
	movl	%eax, %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rcx
	leaq	m(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -8(%rbp)
.L13:
	movl	C(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L14
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	search
	movl	%eax, -8(%rbp)
	movl	C(%rip), %eax
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	t(%rip), %rcx
	leaq	(%rdx,%rcx), %rsi
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	m(%rip), %rcx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	memcpy@PLT
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"\n"
.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	$16, %rsp
.L22:
	leaq	C(%rip), %rax
	movq	%rax, %rdx
	leaq	R(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	R(%rip), %eax
	testl	%eax, %eax
	jne	.L16
	movl	C(%rip), %eax
	testl	%eax, %eax
	je	.L25
.L16:
	movl	$0, -12(%rbp)
	jmp	.L18
.L21:
	movl	$0, -8(%rbp)
	jmp	.L19
.L20:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8(%rbp)
.L19:
	movl	C(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L20
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L18:
	movl	R(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L21
	movl	$0, %edi
	call	search
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L22
.L25:
	nop
	movl	$0, %eax
	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	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 110011
m:
	.zero	110011
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 110011
t:
	.zero	110011
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	C
	.align 4
	.type	C, @object
	.size	C, 4
C:
	.zero	4
	.text
	.globl	count
	.type	count, @function
count:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L2
.L8:
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L3
.L5:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L4
	addl	$1, -8(%rbp)
.L4:
	addl	$1, -12(%rbp)
.L3:
	movl	R(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L5
	movl	R(%rip), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -8(%rbp)
	jg	.L6
	movl	R(%rip), %eax
	subl	-8(%rbp), %eax
	addl	%eax, -4(%rbp)
	jmp	.L7
.L6:
	movl	-8(%rbp), %eax
	addl	%eax, -4(%rbp)
.L7:
	addl	$1, -16(%rbp)
.L2:
	movl	C(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L8
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	count, .-count
	.globl	search
	.type	search, @function
search:
.LFB1:
	.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	R(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L11
	movl	$0, %eax
	call	count
	jmp	.L12
.L11:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	search
	movl	%eax, -4(%rbp)
	movl	C(%rip), %eax
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	m(%rip), %rcx
	leaq	(%rdx,%rcx), %rsi
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	t(%rip), %rcx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	memcpy@PLT
	movl	$0, -8(%rbp)
	jmp	.L13
.L14:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$1, %al
	setne	%al
	movl	%eax, %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rcx
	movl	-20(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rcx
	leaq	m(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -8(%rbp)
.L13:
	movl	C(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L14
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	search
	movl	%eax, -8(%rbp)
	movl	C(%rip), %eax
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	t(%rip), %rcx
	leaq	(%rdx,%rcx), %rsi
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10001, %rdx, %rdx
	leaq	m(%rip), %rcx
	addq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	memcpy@PLT
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	search, .-search
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"\n"
.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	$16, %rsp
.L22:
	leaq	C(%rip), %rax
	movq	%rax, %rdx
	leaq	R(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	R(%rip), %eax
	testl	%eax, %eax
	jne	.L16
	movl	C(%rip), %eax
	testl	%eax, %eax
	je	.L25
.L16:
	movl	$0, -12(%rbp)
	jmp	.L18
.L21:
	movl	$0, -8(%rbp)
	jmp	.L19
.L20:
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$10001, %rax, %rax
	addq	%rax, %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -8(%rbp)
.L19:
	movl	C(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L20
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L18:
	movl	R(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L21
	movl	$0, %edi
	call	search
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L22
.L25:
	nop
	movl	$0, %eax
	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:
