Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define HEIGHT_MAX 10
#define WIDTH_MAX 1000
#define BUF_SIZE (WIDTH_MAX+50)

// size: specify sizeof(str)
int get_str(char *str, int size) {
    if(!fgets(str, size, stdin)) return -1;
    return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return -1;
  sscanf(line, "%d %d %d", a1, a2, a3);
#else
#error
#endif
  return 0;
}

#define min(a,b) ((a) > (b) ? (b) : (a))

int main(void) {
    int height, width, ulimit;
    int i, j;
    static char map[HEIGHT_MAX][WIDTH_MAX];

    get_int3(&height, &width, &ulimit);
    
    for(i = 0; i < height; i++) {
        char buf[BUF_SIZE];
        get_str(buf, BUF_SIZE);
        for(j = 0; j < width; j++) {
            map[i][j] = (buf[j] - '0');
        }
    }
    int pat, bit;
    int ans = (WIDTH_MAX+HEIGHT_MAX);
    for(pat = 0; pat <(1<<height); pat+=2) {
        int res = __builtin_popcount(pat);
        if(res >= ans) continue;
        int sum[11] = {0};
        int group[11] = {0};
        int idx = 1;
        int wid;
        int moved = 0;
        // create groups
        for(bit = 0; bit <= height; bit++) {
            if(pat & (1<<bit)) group[idx++] = bit;
        }
        group[idx++] = height;
#ifdef DEBUG
        for(i = 0; i < idx; i++) printf("%d ", group[i]);
#endif

        // pat = 0: [0, 5]
        for(wid = 0; wid < width;) {
            int flag = 1;
            int new[11] = {0};
            for(i = 0; i < idx-1; i++) {
                for(bit = group[i]; bit < group[i+1]; bit++) {
                    new[i] += map[bit][wid];
                }
#ifdef DEBUG
                for(j = 0; j < idx-1; j++) { printf("(%d+%d) vs %d\n", new[i], sum[i], ulimit); }
#endif
                // must split
                if(sum[i] + new[i] > ulimit) { flag = 0; break; }
            }
#ifdef DEBUG
            printf("flag: %d ", flag);
#endif
            if(!flag) {
                if(!moved) { break; }
                res++;
                moved = 0;
                for(i = 0; i < idx-1; i++) sum[i] = 0;
            } else {
                moved = 1;
                wid++;
                for(i = 0; i < idx-1; i++) sum[i] += new[i];
            }
        }
#ifdef DEBUG
        printf("[pat: %d] possible?: %d ans: %d\n", pat, moved, res);
#endif
        if(!moved) continue;
        ans = min(ans, res);
    }
    printf("%d\n", ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	get_str
	.type	get_str, @function
get_str:
.LFB6:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	stdin(%rip), %rdx
	movl	-12(%rbp), %ecx
	movq	-8(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_str, .-get_str
	.section	.rodata
.LC0:
	.string	"%d %d %d"
	.text
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1104, %rsp
	movq	%rdi, -1080(%rbp)
	movq	%rsi, -1088(%rbp)
	movq	%rdx, -1096(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-1072(%rbp), %rax
	movl	$1050, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L5
	movl	$-1, %eax
	jmp	.L7
.L5:
	movq	-1096(%rbp), %rsi
	movq	-1088(%rbp), %rcx
	movq	-1080(%rbp), %rdx
	leaq	-1072(%rbp), %rax
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, %eax
.L7:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_int3, .-get_int3
	.globl	__popcountdi2
	.section	.rodata
.LC1:
	.string	"%d\n"
	.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	$1280, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1260(%rbp), %rdx
	leaq	-1264(%rbp), %rcx
	leaq	-1268(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	get_int3
	movl	$0, -1256(%rbp)
	jmp	.L10
.L13:
	leaq	-1072(%rbp), %rax
	movl	$1050, %esi
	movq	%rax, %rdi
	call	get_str
	movl	$0, -1252(%rbp)
	jmp	.L11
.L12:
	movl	-1252(%rbp), %eax
	cltq
	movzbl	-1072(%rbp,%rax), %eax
	subl	$48, %eax
	movl	%eax, %edx
	movl	-1252(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1256(%rbp), %eax
	cltq
	imulq	$1000, %rax, %rax
	addq	%rax, %rcx
	leaq	map.0(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -1252(%rbp)
.L11:
	movl	-1264(%rbp), %eax
	cmpl	%eax, -1252(%rbp)
	jl	.L12
	addl	$1, -1256(%rbp)
.L10:
	movl	-1268(%rbp), %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L13
	movl	$1010, -1240(%rbp)
	movl	$0, -1248(%rbp)
	jmp	.L14
.L38:
	movl	-1248(%rbp), %eax
	movl	%eax, %eax
	movq	%rax, %rdi
	call	__popcountdi2@PLT
	movl	%eax, -1236(%rbp)
	movl	-1236(%rbp), %eax
	cmpl	-1240(%rbp), %eax
	jge	.L41
	movq	$0, -1216(%rbp)
	movq	$0, -1208(%rbp)
	movq	$0, -1200(%rbp)
	movq	$0, -1192(%rbp)
	movq	$0, -1184(%rbp)
	movl	$0, -1176(%rbp)
	movq	$0, -1168(%rbp)
	movq	$0, -1160(%rbp)
	movq	$0, -1152(%rbp)
	movq	$0, -1144(%rbp)
	movq	$0, -1136(%rbp)
	movl	$0, -1128(%rbp)
	movl	$1, -1232(%rbp)
	movl	$0, -1224(%rbp)
	movl	$0, -1244(%rbp)
	jmp	.L17
.L19:
	movl	-1244(%rbp), %eax
	movl	-1248(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L18
	movl	-1232(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1232(%rbp)
	cltq
	movl	-1244(%rbp), %edx
	movl	%edx, -1168(%rbp,%rax,4)
.L18:
	addl	$1, -1244(%rbp)
.L17:
	movl	-1268(%rbp), %eax
	cmpl	%eax, -1244(%rbp)
	jle	.L19
	movl	-1232(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1232(%rbp)
	movl	-1268(%rbp), %edx
	cltq
	movl	%edx, -1168(%rbp,%rax,4)
	movl	$0, -1228(%rbp)
	jmp	.L20
.L35:
	movl	$1, -1220(%rbp)
	movq	$0, -1120(%rbp)
	movq	$0, -1112(%rbp)
	movq	$0, -1104(%rbp)
	movq	$0, -1096(%rbp)
	movq	$0, -1088(%rbp)
	movl	$0, -1080(%rbp)
	movl	$0, -1256(%rbp)
	jmp	.L21
.L26:
	movl	-1256(%rbp), %eax
	cltq
	movl	-1168(%rbp,%rax,4), %eax
	movl	%eax, -1244(%rbp)
	jmp	.L22
.L23:
	movl	-1256(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %edx
	movl	-1228(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1244(%rbp), %eax
	cltq
	imulq	$1000, %rax, %rax
	addq	%rax, %rcx
	leaq	map.0(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	addl	%eax, %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	%edx, -1120(%rbp,%rax,4)
	addl	$1, -1244(%rbp)
.L22:
	movl	-1256(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1168(%rbp,%rax,4), %eax
	cmpl	%eax, -1244(%rbp)
	jl	.L23
	movl	-1256(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-1260(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L24
	movl	$0, -1220(%rbp)
	jmp	.L25
.L24:
	addl	$1, -1256(%rbp)
.L21:
	movl	-1232(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L26
.L25:
	cmpl	$0, -1220(%rbp)
	jne	.L27
	cmpl	$0, -1224(%rbp)
	je	.L42
	addl	$1, -1236(%rbp)
	movl	$0, -1224(%rbp)
	movl	$0, -1256(%rbp)
	jmp	.L30
.L31:
	movl	-1256(%rbp), %eax
	cltq
	movl	$0, -1216(%rbp,%rax,4)
	addl	$1, -1256(%rbp)
.L30:
	movl	-1232(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L31
	jmp	.L20
.L27:
	movl	$1, -1224(%rbp)
	addl	$1, -1228(%rbp)
	movl	$0, -1256(%rbp)
	jmp	.L33
.L34:
	movl	-1256(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	%edx, -1216(%rbp,%rax,4)
	addl	$1, -1256(%rbp)
.L33:
	movl	-1232(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L34
.L20:
	movl	-1264(%rbp), %eax
	cmpl	%eax, -1228(%rbp)
	jl	.L35
	jmp	.L29
.L42:
	nop
.L29:
	cmpl	$0, -1224(%rbp)
	je	.L43
	movl	-1240(%rbp), %edx
	movl	-1236(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -1240(%rbp)
	jmp	.L37
.L41:
	nop
	jmp	.L37
.L43:
	nop
.L37:
	addl	$2, -1248(%rbp)
.L14:
	movl	-1268(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -1248(%rbp)
	jl	.L38
	movl	-1240(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.local	map.0
	.comm	map.0,10000,32
	.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	get_str
	.type	get_str, @function
get_str:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	stdin(%rip), %rcx
	movl	%esi, %edx
	movq	$-1, %rsi
	call	__fgets_chk@PLT
	cmpq	$1, %rax
	sbbl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	get_str, .-get_str
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
	.text
	.p2align 4
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rsi, %r13
	movl	$1050, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdx, %rbx
	subq	$1080, %rsp
	.cfi_def_cfa_offset 1120
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 1064(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L7
	movq	%rbx, %r8
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rdi
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	xorl	%eax, %eax
.L4:
	movq	1064(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L9
	addq	$1080, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	movl	$-1, %eax
	jmp	.L4
.L9:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	get_int3, .-get_int3
	.globl	__popcountdi2
	.section	.rodata.str1.1
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.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
	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	$1304, %rsp
	.cfi_def_cfa_offset 1360
	movq	%fs:40, %rax
	movq	%rax, 1288(%rsp)
	xorl	%eax, %eax
	leaq	76(%rsp), %rdx
	leaq	72(%rsp), %rsi
	leaq	68(%rsp), %rdi
	call	get_int3
	movl	68(%rsp), %eax
	movl	%eax, 56(%rsp)
	testl	%eax, %eax
	jle	.L11
	movq	.LC2(%rip), %r14
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	leaq	224(%rsp), %r13
	leaq	map.0(%rip), %r12
.L13:
	movq	stdin(%rip), %rdx
	movl	$1050, %esi
	movq	%r13, %rdi
	call	fgets@PLT
	movl	72(%rsp), %ecx
	movdqa	.LC1(%rip), %xmm1
	testl	%ecx, %ecx
	jle	.L17
	leal	-1(%rcx), %eax
	cmpl	$14, %eax
	jbe	.L46
	movl	%ecx, %edx
	leaq	(%r12,%rbx), %rsi
	xorl	%eax, %eax
	shrl	$4, %edx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L15:
	movdqa	0(%r13,%rax), %xmm0
	paddb	%xmm1, %xmm0
	movups	%xmm0, (%rsi,%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L15
	movl	%ecx, %edx
	andl	$-16, %edx
	movl	%edx, %eax
	cmpl	%edx, %ecx
	je	.L17
.L14:
	movl	%ecx, %esi
	subl	%edx, %esi
	leal	-1(%rsi), %edi
	cmpl	$6, %edi
	jbe	.L19
	movq	224(%rsp,%rdx), %xmm0
	movq	%r14, %xmm2
	leaq	(%r12,%rbx), %rdi
	paddb	%xmm2, %xmm0
	movq	%xmm0, (%rdi,%rdx)
	movl	%esi, %edx
	andl	$-8, %edx
	addl	%edx, %eax
	cmpl	%edx, %esi
	je	.L17
.L19:
	movslq	%ebp, %rdx
	movslq	%eax, %rdi
	imulq	$1000, %rdx, %rdx
	movzbl	224(%rsp,%rdi), %esi
	subl	$48, %esi
	addq	%r12, %rdx
	movb	%sil, (%rdx,%rdi)
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L17
	movslq	%esi, %rsi
	movzbl	224(%rsp,%rsi), %edi
	subl	$48, %edi
	movb	%dil, (%rdx,%rsi)
	leal	2(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L17
	movslq	%esi, %rsi
	movzbl	224(%rsp,%rsi), %edi
	subl	$48, %edi
	movb	%dil, (%rdx,%rsi)
	leal	3(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L17
	movslq	%esi, %rsi
	movzbl	224(%rsp,%rsi), %edi
	subl	$48, %edi
	movb	%dil, (%rdx,%rsi)
	leal	4(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L17
	movslq	%esi, %rsi
	movzbl	224(%rsp,%rsi), %edi
	subl	$48, %edi
	movb	%dil, (%rdx,%rsi)
	leal	5(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L17
	movslq	%esi, %rsi
	addl	$6, %eax
	movzbl	224(%rsp,%rsi), %edi
	subl	$48, %edi
	movb	%dil, (%rdx,%rsi)
	cmpl	%eax, %ecx
	jle	.L17
	cltq
	movzbl	224(%rsp,%rax), %edi
	leal	-48(%rdi), %ecx
	movb	%cl, (%rdx,%rax)
.L17:
	movl	68(%rsp), %eax
	addl	$1, %ebp
	addq	$1000, %rbx
	cmpl	%ebp, %eax
	jg	.L13
	movl	%eax, 56(%rsp)
.L11:
	movzbl	56(%rsp), %ecx
	movl	$1, %eax
	sall	%cl, %eax
	movl	%eax, 60(%rsp)
	testl	%eax, %eax
	jle	.L47
	movl	$0, 24(%rsp)
	leaq	map.0(%rip), %r14
	movl	$1010, 32(%rsp)
	movl	$0, 28(%rsp)
	jmp	.L40
.L39:
	addl	$2, 28(%rsp)
	movl	28(%rsp), %eax
	cmpl	%eax, 60(%rsp)
	jle	.L21
.L69:
	movl	%eax, %edi
	call	__popcountdi2@PLT
	movl	%eax, 24(%rsp)
.L40:
	movl	32(%rsp), %ebx
	cmpl	%ebx, 24(%rsp)
	jge	.L39
	movl	56(%rsp), %eax
	pxor	%xmm0, %xmm0
	movq	$0, 112(%rsp)
	movl	$1, %r13d
	movl	$0, 120(%rsp)
	movq	$0, 160(%rsp)
	movl	$0, 168(%rsp)
	movaps	%xmm0, 80(%rsp)
	movaps	%xmm0, 96(%rsp)
	movaps	%xmm0, 128(%rsp)
	movaps	%xmm0, 144(%rsp)
	testl	%eax, %eax
	js	.L23
	movl	28(%rsp), %ecx
	leal	1(%rax), %edx
	xorl	%eax, %eax
.L25:
	btl	%eax, %ecx
	jnc	.L24
	movslq	%r13d, %rsi
	addl	$1, %r13d
	movl	%eax, 128(%rsp,%rsi,4)
.L24:
	addl	$1, %eax
	cmpl	%eax, %edx
	jne	.L25
.L23:
	movl	56(%rsp), %ebx
	movslq	%r13d, %rax
	movl	%ebx, 128(%rsp,%rax,4)
	movl	72(%rsp), %eax
	movl	%eax, 4(%rsp)
	testl	%eax, %eax
	jle	.L39
	movl	76(%rsp), %ebx
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	leaq	80(%rsp), %r9
	leaq	176(%rsp), %rax
	movq	%rax, 8(%rsp)
	leal	-1(%r13), %eax
	movl	%eax, 36(%rsp)
	leaq	180(%rsp,%rax,4), %rbp
	movl	%r13d, %eax
	shrl	$2, %eax
	movl	%eax, 44(%rsp)
	movl	%r13d, %eax
	andl	$-4, %eax
	movl	%eax, 40(%rsp)
	movl	%r13d, %eax
	salq	$2, %rax
	movq	%rax, 48(%rsp)
	leaq	132(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L36:
	pxor	%xmm0, %xmm0
	movq	16(%rsp), %r10
	movq	8(%rsp), %r8
	xorl	%eax, %eax
	movaps	%xmm0, 176(%rsp)
	movq	%r9, %r11
	movslq	%r12d, %rdi
	movq	$0, 208(%rsp)
	movl	$0, 216(%rsp)
	movaps	%xmm0, 192(%rsp)
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L68:
	movl	(%r8), %eax
.L30:
	movl	-4(%r10), %edx
	movl	(%r10), %ecx
	cmpl	%ecx, %edx
	jge	.L26
	movslq	%edx, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	1(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	2(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	3(%rdx), %esi
	cmpl	%ecx, %esi
	jge	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	4(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	5(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	6(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	7(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	8(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	addl	$9, %edx
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	cmpl	%edx, %ecx
	jle	.L27
	movslq	%edx, %rdx
	imulq	$1000, %rdx, %rdx
	addq	%r14, %rdx
	movsbl	(%rdx,%rdi), %edx
	addl	%edx, %eax
.L27:
	movl	%eax, (%r8)
.L26:
	addl	(%r11), %eax
	cmpl	%ebx, %eax
	jg	.L28
	addq	$4, %r8
	addq	$4, %r11
	addq	$4, %r10
	cmpq	%rbp, %r8
	jne	.L68
	addl	$1, %r12d
	cmpl	$2, 36(%rsp)
	jbe	.L49
	movdqa	80(%rsp), %xmm0
	cmpl	$1, 44(%rsp)
	paddd	176(%rsp), %xmm0
	movaps	%xmm0, 80(%rsp)
	jbe	.L35
	movdqa	96(%rsp), %xmm0
	paddd	192(%rsp), %xmm0
	movaps	%xmm0, 96(%rsp)
.L35:
	movl	40(%rsp), %eax
	movl	%eax, %edx
	cmpl	%r13d, %eax
	je	.L32
.L43:
	movl	%r13d, %ecx
	subl	%edx, %ecx
	cmpl	$1, %ecx
	je	.L33
	salq	$2, %rdx
	movq	176(%rsp,%rdx), %xmm1
	leaq	(%r9,%rdx), %rsi
	movl	%ecx, %edx
	movq	(%rsi), %xmm0
	andl	$-2, %edx
	addl	%edx, %eax
	paddd	%xmm1, %xmm0
	movq	%xmm0, (%rsi)
	cmpl	%edx, %ecx
	je	.L32
.L33:
	cltq
	movl	176(%rsp,%rax,4), %edx
	addl	%edx, 80(%rsp,%rax,4)
.L32:
	movl	$1, %r15d
.L31:
	cmpl	4(%rsp), %r12d
	jl	.L36
	movl	32(%rsp), %ebx
	movl	24(%rsp), %eax
	cmpl	%eax, %ebx
	cmovle	%ebx, %eax
	testl	%r15d, %r15d
	cmove	%ebx, %eax
	addl	$2, 28(%rsp)
	movl	%eax, 32(%rsp)
	movl	28(%rsp), %eax
	cmpl	%eax, 60(%rsp)
	jg	.L69
.L21:
	movl	32(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	1288(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L70
	addq	$1304, %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
.L28:
	.cfi_restore_state
	testl	%r15d, %r15d
	je	.L39
	movq	48(%rsp), %rdx
	movq	%r9, %rdi
	xorl	%esi, %esi
	addl	$1, 24(%rsp)
	xorl	%r15d, %r15d
	call	memset@PLT
	movq	%rax, %r9
	jmp	.L31
.L49:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L43
.L46:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L14
.L47:
	movl	$1010, 32(%rsp)
	jmp	.L21
.L70:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.local	map.0
	.comm	map.0,10000,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.set	.LC2,.LC1
	.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	get_str
	.type	get_str, @function
get_str:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	stdin(%rip), %rcx
	movl	%esi, %edx
	movq	$-1, %rsi
	call	__fgets_chk@PLT
	cmpq	$1, %rax
	sbbl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	get_str, .-get_str
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
	.text
	.p2align 4
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movq	%rsi, %r13
	movl	$1050, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdx, %rbx
	subq	$1080, %rsp
	.cfi_def_cfa_offset 1120
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 1064(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	movq	%rbp, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L7
	movq	%rbx, %r8
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rdi
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	call	__isoc99_sscanf@PLT
	xorl	%eax, %eax
.L4:
	movq	1064(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L9
	addq	$1080, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	movl	$-1, %eax
	jmp	.L4
.L9:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	get_int3, .-get_int3
	.globl	__popcountdi2
	.section	.rodata.str1.1
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.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
	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	$1304, %rsp
	.cfi_def_cfa_offset 1360
	movq	%fs:40, %rax
	movq	%rax, 1288(%rsp)
	xorl	%eax, %eax
	leaq	76(%rsp), %rdx
	leaq	72(%rsp), %rsi
	leaq	68(%rsp), %rdi
	call	get_int3
	movl	68(%rsp), %eax
	movl	%eax, 56(%rsp)
	testl	%eax, %eax
	jle	.L11
	movq	.LC2(%rip), %r14
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	leaq	224(%rsp), %r13
	leaq	map.0(%rip), %r12
.L13:
	movq	stdin(%rip), %rdx
	movl	$1050, %esi
	movq	%r13, %rdi
	call	fgets@PLT
	movl	72(%rsp), %ecx
	movdqa	.LC1(%rip), %xmm1
	testl	%ecx, %ecx
	jle	.L17
	leal	-1(%rcx), %eax
	cmpl	$14, %eax
	jbe	.L46
	movl	%ecx, %edx
	leaq	(%r12,%rbx), %rsi
	xorl	%eax, %eax
	shrl	$4, %edx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L15:
	movdqa	0(%r13,%rax), %xmm0
	paddb	%xmm1, %xmm0
	movups	%xmm0, (%rsi,%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L15
	movl	%ecx, %edx
	andl	$-16, %edx
	movl	%edx, %eax
	cmpl	%edx, %ecx
	je	.L17
.L14:
	movl	%ecx, %esi
	subl	%edx, %esi
	leal	-1(%rsi), %edi
	cmpl	$6, %edi
	jbe	.L19
	movq	224(%rsp,%rdx), %xmm0
	movq	%r14, %xmm2
	leaq	(%r12,%rbx), %rdi
	paddb	%xmm2, %xmm0
	movq	%xmm0, (%rdi,%rdx)
	movl	%esi, %edx
	andl	$-8, %edx
	addl	%edx, %eax
	cmpl	%edx, %esi
	je	.L17
.L19:
	movslq	%ebp, %rdx
	movslq	%eax, %rdi
	imulq	$1000, %rdx, %rdx
	movzbl	224(%rsp,%rdi), %esi
	subl	$48, %esi
	addq	%r12, %rdx
	movb	%sil, (%rdx,%rdi)
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L17
	movslq	%esi, %rsi
	movzbl	224(%rsp,%rsi), %edi
	subl	$48, %edi
	movb	%dil, (%rdx,%rsi)
	leal	2(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L17
	movslq	%esi, %rsi
	movzbl	224(%rsp,%rsi), %edi
	subl	$48, %edi
	movb	%dil, (%rdx,%rsi)
	leal	3(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L17
	movslq	%esi, %rsi
	movzbl	224(%rsp,%rsi), %edi
	subl	$48, %edi
	movb	%dil, (%rdx,%rsi)
	leal	4(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L17
	movslq	%esi, %rsi
	movzbl	224(%rsp,%rsi), %edi
	subl	$48, %edi
	movb	%dil, (%rdx,%rsi)
	leal	5(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L17
	movslq	%esi, %rsi
	addl	$6, %eax
	movzbl	224(%rsp,%rsi), %edi
	subl	$48, %edi
	movb	%dil, (%rdx,%rsi)
	cmpl	%eax, %ecx
	jle	.L17
	cltq
	movzbl	224(%rsp,%rax), %edi
	leal	-48(%rdi), %ecx
	movb	%cl, (%rdx,%rax)
.L17:
	movl	68(%rsp), %eax
	addl	$1, %ebp
	addq	$1000, %rbx
	cmpl	%ebp, %eax
	jg	.L13
	movl	%eax, 56(%rsp)
.L11:
	movzbl	56(%rsp), %ecx
	movl	$1, %eax
	sall	%cl, %eax
	movl	%eax, 60(%rsp)
	testl	%eax, %eax
	jle	.L47
	movl	$0, 24(%rsp)
	leaq	map.0(%rip), %r14
	movl	$1010, 32(%rsp)
	movl	$0, 28(%rsp)
	jmp	.L40
.L39:
	addl	$2, 28(%rsp)
	movl	28(%rsp), %eax
	cmpl	%eax, 60(%rsp)
	jle	.L21
.L69:
	movl	%eax, %edi
	call	__popcountdi2@PLT
	movl	%eax, 24(%rsp)
.L40:
	movl	32(%rsp), %ebx
	cmpl	%ebx, 24(%rsp)
	jge	.L39
	movl	56(%rsp), %eax
	pxor	%xmm0, %xmm0
	movq	$0, 112(%rsp)
	movl	$1, %r13d
	movl	$0, 120(%rsp)
	movq	$0, 160(%rsp)
	movl	$0, 168(%rsp)
	movaps	%xmm0, 80(%rsp)
	movaps	%xmm0, 96(%rsp)
	movaps	%xmm0, 128(%rsp)
	movaps	%xmm0, 144(%rsp)
	testl	%eax, %eax
	js	.L23
	movl	28(%rsp), %ecx
	leal	1(%rax), %edx
	xorl	%eax, %eax
.L25:
	btl	%eax, %ecx
	jnc	.L24
	movslq	%r13d, %rsi
	addl	$1, %r13d
	movl	%eax, 128(%rsp,%rsi,4)
.L24:
	addl	$1, %eax
	cmpl	%eax, %edx
	jne	.L25
.L23:
	movl	56(%rsp), %ebx
	movslq	%r13d, %rax
	movl	%ebx, 128(%rsp,%rax,4)
	movl	72(%rsp), %eax
	movl	%eax, 4(%rsp)
	testl	%eax, %eax
	jle	.L39
	movl	76(%rsp), %ebx
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	leaq	80(%rsp), %r9
	leaq	176(%rsp), %rax
	movq	%rax, 8(%rsp)
	leal	-1(%r13), %eax
	movl	%eax, 36(%rsp)
	leaq	180(%rsp,%rax,4), %rbp
	movl	%r13d, %eax
	shrl	$2, %eax
	movl	%eax, 44(%rsp)
	movl	%r13d, %eax
	andl	$-4, %eax
	movl	%eax, 40(%rsp)
	movl	%r13d, %eax
	salq	$2, %rax
	movq	%rax, 48(%rsp)
	leaq	132(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L36:
	pxor	%xmm0, %xmm0
	movq	16(%rsp), %r10
	movq	8(%rsp), %r8
	xorl	%eax, %eax
	movaps	%xmm0, 176(%rsp)
	movq	%r9, %r11
	movslq	%r12d, %rdi
	movq	$0, 208(%rsp)
	movl	$0, 216(%rsp)
	movaps	%xmm0, 192(%rsp)
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L68:
	movl	(%r8), %eax
.L30:
	movl	-4(%r10), %edx
	movl	(%r10), %ecx
	cmpl	%ecx, %edx
	jge	.L26
	movslq	%edx, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	1(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	2(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	3(%rdx), %esi
	cmpl	%ecx, %esi
	jge	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	4(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	5(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	6(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	7(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	leal	8(%rdx), %esi
	cmpl	%esi, %ecx
	jle	.L27
	movslq	%esi, %rsi
	addl	$9, %edx
	imulq	$1000, %rsi, %rsi
	addq	%r14, %rsi
	movsbl	(%rsi,%rdi), %esi
	addl	%esi, %eax
	cmpl	%edx, %ecx
	jle	.L27
	movslq	%edx, %rdx
	imulq	$1000, %rdx, %rdx
	addq	%r14, %rdx
	movsbl	(%rdx,%rdi), %edx
	addl	%edx, %eax
.L27:
	movl	%eax, (%r8)
.L26:
	addl	(%r11), %eax
	cmpl	%ebx, %eax
	jg	.L28
	addq	$4, %r8
	addq	$4, %r11
	addq	$4, %r10
	cmpq	%rbp, %r8
	jne	.L68
	addl	$1, %r12d
	cmpl	$2, 36(%rsp)
	jbe	.L49
	movdqa	80(%rsp), %xmm0
	cmpl	$1, 44(%rsp)
	paddd	176(%rsp), %xmm0
	movaps	%xmm0, 80(%rsp)
	jbe	.L35
	movdqa	96(%rsp), %xmm0
	paddd	192(%rsp), %xmm0
	movaps	%xmm0, 96(%rsp)
.L35:
	movl	40(%rsp), %eax
	movl	%eax, %edx
	cmpl	%r13d, %eax
	je	.L32
.L43:
	movl	%r13d, %ecx
	subl	%edx, %ecx
	cmpl	$1, %ecx
	je	.L33
	salq	$2, %rdx
	movq	176(%rsp,%rdx), %xmm1
	leaq	(%r9,%rdx), %rsi
	movl	%ecx, %edx
	movq	(%rsi), %xmm0
	andl	$-2, %edx
	addl	%edx, %eax
	paddd	%xmm1, %xmm0
	movq	%xmm0, (%rsi)
	cmpl	%edx, %ecx
	je	.L32
.L33:
	cltq
	movl	176(%rsp,%rax,4), %edx
	addl	%edx, 80(%rsp,%rax,4)
.L32:
	movl	$1, %r15d
.L31:
	cmpl	4(%rsp), %r12d
	jl	.L36
	movl	32(%rsp), %ebx
	movl	24(%rsp), %eax
	cmpl	%eax, %ebx
	cmovle	%ebx, %eax
	testl	%r15d, %r15d
	cmove	%ebx, %eax
	addl	$2, 28(%rsp)
	movl	%eax, 32(%rsp)
	movl	28(%rsp), %eax
	cmpl	%eax, 60(%rsp)
	jg	.L69
.L21:
	movl	32(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	1288(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L70
	addq	$1304, %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
.L28:
	.cfi_restore_state
	testl	%r15d, %r15d
	je	.L39
	movq	48(%rsp), %rdx
	movq	%r9, %rdi
	xorl	%esi, %esi
	addl	$1, 24(%rsp)
	xorl	%r15d, %r15d
	call	memset@PLT
	movq	%rax, %r9
	jmp	.L31
.L49:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L43
.L46:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L14
.L47:
	movl	$1010, 32(%rsp)
	jmp	.L21
.L70:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.local	map.0
	.comm	map.0,10000,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.byte	-48
	.set	.LC2,.LC1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define HEIGHT_MAX 10
#define WIDTH_MAX 1000
#define BUF_SIZE (WIDTH_MAX+50)

// size: specify sizeof(str)
int get_str(char *str, int size) {
    if(!fgets(str, size, stdin)) return -1;
    return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return -1;
  sscanf(line, "%d %d %d", a1, a2, a3);
#else
#error
#endif
  return 0;
}

#define min(a,b) ((a) > (b) ? (b) : (a))

int main(void) {
    int height, width, ulimit;
    int i, j;
    static char map[HEIGHT_MAX][WIDTH_MAX];

    get_int3(&height, &width, &ulimit);
    
    for(i = 0; i < height; i++) {
        char buf[BUF_SIZE];
        get_str(buf, BUF_SIZE);
        for(j = 0; j < width; j++) {
            map[i][j] = (buf[j] - '0');
        }
    }
    int pat, bit;
    int ans = (WIDTH_MAX+HEIGHT_MAX);
    for(pat = 0; pat <(1<<height); pat+=2) {
        int res = __builtin_popcount(pat);
        if(res >= ans) continue;
        int sum[11] = {0};
        int group[11] = {0};
        int idx = 1;
        int wid;
        int moved = 0;
        // create groups
        for(bit = 0; bit <= height; bit++) {
            if(pat & (1<<bit)) group[idx++] = bit;
        }
        group[idx++] = height;
#ifdef DEBUG
        for(i = 0; i < idx; i++) printf("%d ", group[i]);
#endif

        // pat = 0: [0, 5]
        for(wid = 0; wid < width;) {
            int flag = 1;
            int new[11] = {0};
            for(i = 0; i < idx-1; i++) {
                for(bit = group[i]; bit < group[i+1]; bit++) {
                    new[i] += map[bit][wid];
                }
#ifdef DEBUG
                for(j = 0; j < idx-1; j++) { printf("(%d+%d) vs %d\n", new[i], sum[i], ulimit); }
#endif
                // must split
                if(sum[i] + new[i] > ulimit) { flag = 0; break; }
            }
#ifdef DEBUG
            printf("flag: %d ", flag);
#endif
            if(!flag) {
                if(!moved) { break; }
                res++;
                moved = 0;
                for(i = 0; i < idx-1; i++) sum[i] = 0;
            } else {
                moved = 1;
                wid++;
                for(i = 0; i < idx-1; i++) sum[i] += new[i];
            }
        }
#ifdef DEBUG
        printf("[pat: %d] possible?: %d ans: %d\n", pat, moved, res);
#endif
        if(!moved) continue;
        ans = min(ans, res);
    }
    printf("%d\n", ans);
    return 0;
}
4 10 4
1110010010
1000101110
0011101001
1101000011
 3 5 8
11100
10101
00111
 4 10 3
1110010010
1000101110
0011101101
1101000011
 3 5 8
11100
00101
00111
 4 10 3
1110010010
1000101110
0011101111
1101000011
 4 2 2
1110010010
1100101011
0011100111
1101000111
 4 10 2
1010110011
1001101011
0011101111
1001000111
 3 5 4
11100
10001
00110
 4 10 4
1110010010
1000101110
0011101101
1101000011
 3 5 8
11100
10111
00111

3
 1
 4
 0
 5
 2
 6
 1
 3
 1

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define HEIGHT_MAX 10
#define WIDTH_MAX 1000
#define BUF_SIZE (WIDTH_MAX+50)

// size: specify sizeof(str)
int get_str(char *str, int size) {
    if(!fgets(str, size, stdin)) return -1;
    return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return -1;
  sscanf(line, "%d %d %d", a1, a2, a3);
#else
#error
#endif
  return 0;
}

#define min(a,b) ((a) > (b) ? (b) : (a))

int main(void) {
    int height, width, ulimit;
    int i, j;
    static char map[HEIGHT_MAX][WIDTH_MAX];

    get_int3(&height, &width, &ulimit);
    
    for(i = 0; i < height; i++) {
        char buf[BUF_SIZE];
        get_str(buf, BUF_SIZE);
        for(j = 0; j < width; j++) {
            map[i][j] = (buf[j] - '0');
        }
    }
    int pat, bit;
    int ans = (WIDTH_MAX+HEIGHT_MAX);
    for(pat = 0; pat <(1<<height); pat+=2) {
        int res = __builtin_popcount(pat);
        if(res >= ans) continue;
        int sum[11] = {0};
        int group[11] = {0};
        int idx = 1;
        int wid;
        int moved = 0;
        // create groups
        for(bit = 0; bit <= height; bit++) {
            if(pat & (1<<bit)) group[idx++] = bit;
        }
        group[idx++] = height;
#ifdef DEBUG
        for(i = 0; i < idx; i++) printf("%d ", group[i]);
#endif

        // pat = 0: [0, 5]
        for(wid = 0; wid < width;) {
            int flag = 1;
            int new[11] = {0};
            for(i = 0; i < idx-1; i++) {
                for(bit = group[i]; bit < group[i+1]; bit++) {
                    new[i] += map[bit][wid];
                }
#ifdef DEBUG
                for(j = 0; j < idx-1; j++) { printf("(%d+%d) vs %d\n", new[i], sum[i], ulimit); }
#endif
                // must split
                if(sum[i] + new[i] > ulimit) { flag = 0; break; }
            }
#ifdef DEBUG
            printf("flag: %d ", flag);
#endif
            if(!flag) {
                if(!moved) { break; }
                res++;
                moved = 0;
                for(i = 0; i < idx-1; i++) sum[i] = 0;
            } else {
                moved = 1;
                wid++;
                for(i = 0; i < idx-1; i++) sum[i] += new[i];
            }
        }
#ifdef DEBUG
        printf("[pat: %d] possible?: %d ans: %d\n", pat, moved, res);
#endif
        if(!moved) continue;
        ans = min(ans, res);
    }
    printf("%d\n", ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	get_str
	.type	get_str, @function
get_str:
.LFB6:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	stdin(%rip), %rdx
	movl	-12(%rbp), %ecx
	movq	-8(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_str, .-get_str
	.section	.rodata
.LC0:
	.string	"%d %d %d"
	.text
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1104, %rsp
	movq	%rdi, -1080(%rbp)
	movq	%rsi, -1088(%rbp)
	movq	%rdx, -1096(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-1072(%rbp), %rax
	movl	$1050, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L5
	movl	$-1, %eax
	jmp	.L7
.L5:
	movq	-1096(%rbp), %rsi
	movq	-1088(%rbp), %rcx
	movq	-1080(%rbp), %rdx
	leaq	-1072(%rbp), %rax
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, %eax
.L7:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_int3, .-get_int3
	.globl	__popcountdi2
	.section	.rodata
.LC1:
	.string	"%d\n"
	.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	$1280, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1260(%rbp), %rdx
	leaq	-1264(%rbp), %rcx
	leaq	-1268(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	get_int3
	movl	$0, -1256(%rbp)
	jmp	.L10
.L13:
	leaq	-1072(%rbp), %rax
	movl	$1050, %esi
	movq	%rax, %rdi
	call	get_str
	movl	$0, -1252(%rbp)
	jmp	.L11
.L12:
	movl	-1252(%rbp), %eax
	cltq
	movzbl	-1072(%rbp,%rax), %eax
	subl	$48, %eax
	movl	%eax, %edx
	movl	-1252(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1256(%rbp), %eax
	cltq
	imulq	$1000, %rax, %rax
	addq	%rax, %rcx
	leaq	map.0(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -1252(%rbp)
.L11:
	movl	-1264(%rbp), %eax
	cmpl	%eax, -1252(%rbp)
	jl	.L12
	addl	$1, -1256(%rbp)
.L10:
	movl	-1268(%rbp), %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L13
	movl	$1010, -1240(%rbp)
	movl	$0, -1248(%rbp)
	jmp	.L14
.L38:
	movl	-1248(%rbp), %eax
	movl	%eax, %eax
	movq	%rax, %rdi
	call	__popcountdi2@PLT
	movl	%eax, -1236(%rbp)
	movl	-1236(%rbp), %eax
	cmpl	-1240(%rbp), %eax
	jge	.L41
	movq	$0, -1216(%rbp)
	movq	$0, -1208(%rbp)
	movq	$0, -1200(%rbp)
	movq	$0, -1192(%rbp)
	movq	$0, -1184(%rbp)
	movl	$0, -1176(%rbp)
	movq	$0, -1168(%rbp)
	movq	$0, -1160(%rbp)
	movq	$0, -1152(%rbp)
	movq	$0, -1144(%rbp)
	movq	$0, -1136(%rbp)
	movl	$0, -1128(%rbp)
	movl	$1, -1232(%rbp)
	movl	$0, -1224(%rbp)
	movl	$0, -1244(%rbp)
	jmp	.L17
.L19:
	movl	-1244(%rbp), %eax
	movl	-1248(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L18
	movl	-1232(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1232(%rbp)
	cltq
	movl	-1244(%rbp), %edx
	movl	%edx, -1168(%rbp,%rax,4)
.L18:
	addl	$1, -1244(%rbp)
.L17:
	movl	-1268(%rbp), %eax
	cmpl	%eax, -1244(%rbp)
	jle	.L19
	movl	-1232(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1232(%rbp)
	movl	-1268(%rbp), %edx
	cltq
	movl	%edx, -1168(%rbp,%rax,4)
	movl	$0, -1228(%rbp)
	jmp	.L20
.L35:
	movl	$1, -1220(%rbp)
	movq	$0, -1120(%rbp)
	movq	$0, -1112(%rbp)
	movq	$0, -1104(%rbp)
	movq	$0, -1096(%rbp)
	movq	$0, -1088(%rbp)
	movl	$0, -1080(%rbp)
	movl	$0, -1256(%rbp)
	jmp	.L21
.L26:
	movl	-1256(%rbp), %eax
	cltq
	movl	-1168(%rbp,%rax,4), %eax
	movl	%eax, -1244(%rbp)
	jmp	.L22
.L23:
	movl	-1256(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %edx
	movl	-1228(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1244(%rbp), %eax
	cltq
	imulq	$1000, %rax, %rax
	addq	%rax, %rcx
	leaq	map.0(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	addl	%eax, %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	%edx, -1120(%rbp,%rax,4)
	addl	$1, -1244(%rbp)
.L22:
	movl	-1256(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1168(%rbp,%rax,4), %eax
	cmpl	%eax, -1244(%rbp)
	jl	.L23
	movl	-1256(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-1260(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L24
	movl	$0, -1220(%rbp)
	jmp	.L25
.L24:
	addl	$1, -1256(%rbp)
.L21:
	movl	-1232(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L26
.L25:
	cmpl	$0, -1220(%rbp)
	jne	.L27
	cmpl	$0, -1224(%rbp)
	je	.L42
	addl	$1, -1236(%rbp)
	movl	$0, -1224(%rbp)
	movl	$0, -1256(%rbp)
	jmp	.L30
.L31:
	movl	-1256(%rbp), %eax
	cltq
	movl	$0, -1216(%rbp,%rax,4)
	addl	$1, -1256(%rbp)
.L30:
	movl	-1232(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L31
	jmp	.L20
.L27:
	movl	$1, -1224(%rbp)
	addl	$1, -1228(%rbp)
	movl	$0, -1256(%rbp)
	jmp	.L33
.L34:
	movl	-1256(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	%edx, -1216(%rbp,%rax,4)
	addl	$1, -1256(%rbp)
.L33:
	movl	-1232(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L34
.L20:
	movl	-1264(%rbp), %eax
	cmpl	%eax, -1228(%rbp)
	jl	.L35
	jmp	.L29
.L42:
	nop
.L29:
	cmpl	$0, -1224(%rbp)
	je	.L43
	movl	-1240(%rbp), %edx
	movl	-1236(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -1240(%rbp)
	jmp	.L37
.L41:
	nop
	jmp	.L37
.L43:
	nop
.L37:
	addl	$2, -1248(%rbp)
.L14:
	movl	-1268(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -1248(%rbp)
	jl	.L38
	movl	-1240(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.local	map.0
	.comm	map.0,10000,32
	.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	get_str
	.type	get_str, @function
get_str:
.LFB6:
	.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
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	stdin(%rip), %rdx
	movl	-12(%rbp), %ecx
	movq	-8(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_str, .-get_str
	.section	.rodata
.LC0:
	.string	"%d %d %d"
	.text
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1104, %rsp
	movq	%rdi, -1080(%rbp)
	movq	%rsi, -1088(%rbp)
	movq	%rdx, -1096(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rdx
	leaq	-1072(%rbp), %rax
	movl	$1050, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	jne	.L5
	movl	$-1, %eax
	jmp	.L7
.L5:
	movq	-1096(%rbp), %rsi
	movq	-1088(%rbp), %rcx
	movq	-1080(%rbp), %rdx
	leaq	-1072(%rbp), %rax
	movq	%rsi, %r8
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_sscanf@PLT
	movl	$0, %eax
.L7:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_int3, .-get_int3
	.globl	__popcountdi2
	.section	.rodata
.LC1:
	.string	"%d\n"
	.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	$1280, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1260(%rbp), %rdx
	leaq	-1264(%rbp), %rcx
	leaq	-1268(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	get_int3
	movl	$0, -1256(%rbp)
	jmp	.L10
.L13:
	leaq	-1072(%rbp), %rax
	movl	$1050, %esi
	movq	%rax, %rdi
	call	get_str
	movl	$0, -1252(%rbp)
	jmp	.L11
.L12:
	movl	-1252(%rbp), %eax
	cltq
	movzbl	-1072(%rbp,%rax), %eax
	subl	$48, %eax
	movl	%eax, %edx
	movl	-1252(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1256(%rbp), %eax
	cltq
	imulq	$1000, %rax, %rax
	addq	%rax, %rcx
	leaq	map.0(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	addl	$1, -1252(%rbp)
.L11:
	movl	-1264(%rbp), %eax
	cmpl	%eax, -1252(%rbp)
	jl	.L12
	addl	$1, -1256(%rbp)
.L10:
	movl	-1268(%rbp), %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L13
	movl	$1010, -1240(%rbp)
	movl	$0, -1248(%rbp)
	jmp	.L14
.L38:
	movl	-1248(%rbp), %eax
	movl	%eax, %eax
	movq	%rax, %rdi
	call	__popcountdi2@PLT
	movl	%eax, -1236(%rbp)
	movl	-1236(%rbp), %eax
	cmpl	-1240(%rbp), %eax
	jge	.L41
	movq	$0, -1216(%rbp)
	movq	$0, -1208(%rbp)
	movq	$0, -1200(%rbp)
	movq	$0, -1192(%rbp)
	movq	$0, -1184(%rbp)
	movl	$0, -1176(%rbp)
	movq	$0, -1168(%rbp)
	movq	$0, -1160(%rbp)
	movq	$0, -1152(%rbp)
	movq	$0, -1144(%rbp)
	movq	$0, -1136(%rbp)
	movl	$0, -1128(%rbp)
	movl	$1, -1232(%rbp)
	movl	$0, -1224(%rbp)
	movl	$0, -1244(%rbp)
	jmp	.L17
.L19:
	movl	-1244(%rbp), %eax
	movl	-1248(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L18
	movl	-1232(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1232(%rbp)
	cltq
	movl	-1244(%rbp), %edx
	movl	%edx, -1168(%rbp,%rax,4)
.L18:
	addl	$1, -1244(%rbp)
.L17:
	movl	-1268(%rbp), %eax
	cmpl	%eax, -1244(%rbp)
	jle	.L19
	movl	-1232(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1232(%rbp)
	movl	-1268(%rbp), %edx
	cltq
	movl	%edx, -1168(%rbp,%rax,4)
	movl	$0, -1228(%rbp)
	jmp	.L20
.L35:
	movl	$1, -1220(%rbp)
	movq	$0, -1120(%rbp)
	movq	$0, -1112(%rbp)
	movq	$0, -1104(%rbp)
	movq	$0, -1096(%rbp)
	movq	$0, -1088(%rbp)
	movl	$0, -1080(%rbp)
	movl	$0, -1256(%rbp)
	jmp	.L21
.L26:
	movl	-1256(%rbp), %eax
	cltq
	movl	-1168(%rbp,%rax,4), %eax
	movl	%eax, -1244(%rbp)
	jmp	.L22
.L23:
	movl	-1256(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %edx
	movl	-1228(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1244(%rbp), %eax
	cltq
	imulq	$1000, %rax, %rax
	addq	%rax, %rcx
	leaq	map.0(%rip), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	addl	%eax, %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	%edx, -1120(%rbp,%rax,4)
	addl	$1, -1244(%rbp)
.L22:
	movl	-1256(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1168(%rbp,%rax,4), %eax
	cmpl	%eax, -1244(%rbp)
	jl	.L23
	movl	-1256(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-1260(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L24
	movl	$0, -1220(%rbp)
	jmp	.L25
.L24:
	addl	$1, -1256(%rbp)
.L21:
	movl	-1232(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L26
.L25:
	cmpl	$0, -1220(%rbp)
	jne	.L27
	cmpl	$0, -1224(%rbp)
	je	.L42
	addl	$1, -1236(%rbp)
	movl	$0, -1224(%rbp)
	movl	$0, -1256(%rbp)
	jmp	.L30
.L31:
	movl	-1256(%rbp), %eax
	cltq
	movl	$0, -1216(%rbp,%rax,4)
	addl	$1, -1256(%rbp)
.L30:
	movl	-1232(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L31
	jmp	.L20
.L27:
	movl	$1, -1224(%rbp)
	addl	$1, -1228(%rbp)
	movl	$0, -1256(%rbp)
	jmp	.L33
.L34:
	movl	-1256(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-1256(%rbp), %eax
	cltq
	movl	%edx, -1216(%rbp,%rax,4)
	addl	$1, -1256(%rbp)
.L33:
	movl	-1232(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1256(%rbp)
	jl	.L34
.L20:
	movl	-1264(%rbp), %eax
	cmpl	%eax, -1228(%rbp)
	jl	.L35
	jmp	.L29
.L42:
	nop
.L29:
	cmpl	$0, -1224(%rbp)
	je	.L43
	movl	-1240(%rbp), %edx
	movl	-1236(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -1240(%rbp)
	jmp	.L37
.L41:
	nop
	jmp	.L37
.L43:
	nop
.L37:
	addl	$2, -1248(%rbp)
.L14:
	movl	-1268(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -1248(%rbp)
	jl	.L38
	movl	-1240(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.local	map.0
	.comm	map.0,10000,32
	.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:
