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

```c
#include<stdio.h>

int main(void){
	int n,m;
	while(1){
		scanf("%d %d",&n,&m);
		if(n==0 && m==0)break;
		int q[n][m],i,j=0;
		while(j<n){
			i=0;
			while(i<m){
				scanf("%d",&q[j][i]);
				i++;
			}
			j++;
		}
		int cnt[m];
		for(i=0;i<n;i++)for(j=0;j<m;j++){
			if(!i)cnt[j] = 0;
			cnt[j] += q[i][j];
		}
		int max,maxed[m];
		for(i=0;i<m;i++)maxed[i] = 0;
		for(i=0;i<m;i++){
			if(i)printf(" ");
			max = -1;
			for(j=0;j<m;j++){
				if(!maxed[j]){
					if(max == -1)max = j;
					else if(cnt[max] < cnt[j])max = j;
				}
			}
			printf("%d",max+1);
			maxed[max] = 1;
		}
		printf("\n");
	}
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$232, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
.L31:
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	%rbx, -264(%rbp)
	leaq	-128(%rbp), %rdx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-128(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	jmp	.L33
.L2:
	movl	-128(%rbp), %esi
	movl	-132(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	movslq	%esi, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%esi, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edi, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	-160(%rbp), %r8
	movq	-152(%rbp), %r9
	movq	%r9, %rdx
	movq	-176(%rbp), %r10
	movq	-168(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L4:
	cmpq	%rcx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L6
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L7
.L10:
	movl	$0, -124(%rbp)
	jmp	.L8
.L9:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-124(%rbp), %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -124(%rbp)
.L8:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L9
	addl	$1, -120(%rbp)
.L7:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L10
	movl	-128(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%edx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L11:
	cmpq	%rcx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L13
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L14
.L18:
	movl	$0, -120(%rbp)
	jmp	.L15
.L17:
	cmpl	$0, -124(%rbp)
	jne	.L16
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	$0, (%rdx,%rax,4)
.L16:
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %edi
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-96(%rbp), %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movl	-124(%rbp), %eax
	cltq
	imulq	%rsi, %rax
	addq	%rdx, %rax
	movl	(%rcx,%rax,4), %eax
	leal	(%rdi,%rax), %ecx
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	%ecx, (%rdx,%rax,4)
	addl	$1, -120(%rbp)
.L15:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L17
	addl	$1, -124(%rbp)
.L14:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L18
	movl	-128(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L19:
	cmpq	%rcx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L21
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L21:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L22
.L23:
	movq	-64(%rbp), %rdx
	movl	-124(%rbp), %eax
	cltq
	movl	$0, (%rdx,%rax,4)
	addl	$1, -124(%rbp)
.L22:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L23
	movl	$0, -124(%rbp)
	jmp	.L24
.L30:
	cmpl	$0, -124(%rbp)
	je	.L25
	movl	$32, %edi
	call	putchar@PLT
.L25:
	movl	$-1, -116(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L26
.L29:
	movq	-64(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L27
	cmpl	$-1, -116(%rbp)
	jne	.L28
	movl	-120(%rbp), %eax
	movl	%eax, -116(%rbp)
	jmp	.L27
.L28:
	movq	-80(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %ecx
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %eax
	cmpl	%eax, %ecx
	jge	.L27
	movl	-120(%rbp), %eax
	movl	%eax, -116(%rbp)
.L27:
	addl	$1, -120(%rbp)
.L26:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L29
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-64(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	movl	$1, (%rdx,%rax,4)
	addl	$1, -124(%rbp)
.L24:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L30
	movl	$10, %edi
	call	putchar@PLT
	movq	-264(%rbp), %rsp
	jmp	.L31
.L33:
	call	__stack_chk_fail@PLT
.L32:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC1(%rip), %r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-60(%rbp), %rax
	movq	%rax, -144(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, -136(%rbp)
	.p2align 4,,10
	.p2align 3
.L38:
	movq	-144(%rbp), %rdx
	movq	-136(%rbp), %rsi
	xorl	%eax, %eax
	movq	%rsp, -128(%rbp)
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %r9d
	testl	%r9d, %r9d
	jne	.L2
	movl	-60(%rbp), %ecx
	testl	%ecx, %ecx
	je	.L3
	movslq	%ecx, %rax
	movq	%rax, -112(%rbp)
.L4:
	movq	-112(%rbp), %rax
	movq	%rsp, %rdx
	leaq	15(,%rax,4), %rsi
	movq	%rsi, %rax
	movq	%rsi, -120(%rbp)
	andq	$-4096, %rsi
	subq	%rsi, %rdx
	andq	$-16, %rax
	cmpq	%rdx, %rsp
	je	.L46
.L96:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdx, %rsp
	jne	.L96
.L46:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L97
.L47:
	movq	%rsp, %r14
	.p2align 4,,10
	.p2align 3
.L19:
	movq	-120(%rbp), %rsi
	movq	%rsp, %rdx
	movq	%rsi, %rax
	andq	$-4096, %rsi
	subq	%rsi, %rdx
	andq	$-16, %rax
	cmpq	%rdx, %rsp
	je	.L35
.L98:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdx, %rsp
	jne	.L98
.L35:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L36
	orq	$0, -8(%rsp,%rax)
.L36:
	movq	%rsp, %r12
	testl	%ecx, %ecx
	jle	.L44
	movq	-112(%rbp), %rdx
	xorl	%esi, %esi
	movq	%r12, %rdi
	movl	%ecx, -72(%rbp)
	xorl	%ebx, %ebx
	salq	$2, %rdx
	call	memset@PLT
	movl	-72(%rbp), %ecx
	testl	%ecx, %ecx
	jle	.L59
	.p2align 4,,10
	.p2align 3
.L101:
	movslq	%ecx, %rdx
	xorl	%eax, %eax
	movl	$-1, %r15d
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L100:
	movslq	%r15d, %rcx
	movl	(%r14,%rax,4), %esi
	cmpl	%esi, (%r14,%rcx,4)
	cmovl	%eax, %r15d
.L41:
	addq	$1, %rax
	cmpq	%rax, %rdx
	je	.L99
.L42:
	movl	(%r12,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L41
	cmpl	$-1, %r15d
	jne	.L100
	movl	%eax, %r15d
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L42
	.p2align 4,,10
	.p2align 3
.L99:
	leal	1(%r15), %edx
.L40:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movslq	%r15d, %r15
	call	__printf_chk@PLT
	addl	$1, %ebx
	movl	$1, (%r12,%r15,4)
	cmpl	%ebx, -60(%rbp)
	jle	.L44
	movl	$32, %edi
	call	putchar@PLT
	movl	-60(%rbp), %ecx
	testl	%ecx, %ecx
	jg	.L101
.L59:
	xorl	%edx, %edx
	movl	$-1, %r15d
	jmp	.L40
.L53:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L54
	orq	$0, -8(%rsp,%rax)
.L54:
	movq	%rsp, %r14
	testl	%r9d, %r9d
	jg	.L51
	.p2align 4,,10
	.p2align 3
.L44:
	movl	$10, %edi
	call	putchar@PLT
	movq	-128(%rbp), %rsp
	jmp	.L38
.L2:
	movslq	-60(%rbp), %rsi
	movslq	%r9d, %rax
	imulq	%rsi, %rax
	movq	%rsi, -112(%rbp)
	movq	%rsi, %rcx
	leaq	0(,%rsi,4), %r12
	movq	%rsp, %rsi
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L6
.L102:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L102
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L7
	orq	$0, -8(%rsp,%rdx)
.L7:
	movq	%rsp, %rbx
	testl	%r9d, %r9d
	jle	.L4
	shrq	$2, %r12
	movq	%rbx, -80(%rbp)
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	movq	%r12, -72(%rbp)
	testl	%ecx, %ecx
	jle	.L103
	.p2align 4,,10
	.p2align 3
.L14:
	movq	-80(%rbp), %rax
	xorl	%ebx, %ebx
	leaq	(%rax,%r15,4), %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L9
	movl	-64(%rbp), %r9d
	addl	$1, %r14d
	cmpl	%r9d, %r14d
	jge	.L104
	addq	-72(%rbp), %r15
	testl	%ecx, %ecx
	jg	.L14
.L103:
	addl	$1, %r14d
	movq	-72(%rbp), %r12
	movq	-80(%rbp), %rbx
	cmpl	%r14d, %r9d
	jle	.L105
	movslq	%ecx, %rax
	movq	%rsp, %rdx
	leaq	15(,%rax,4), %rsi
	movq	%rax, -112(%rbp)
	movq	%rsi, -120(%rbp)
	movq	%rsi, %rax
	andq	$-4096, %rsi
	subq	%rsi, %rdx
	andq	$-16, %rax
	cmpq	%rdx, %rsp
	je	.L49
.L106:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdx, %rsp
	jne	.L106
.L49:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L50
	orq	$0, -8(%rsp,%rax)
.L50:
	movq	%rsp, %r14
.L51:
	leal	-1(%rcx), %eax
	movl	%ecx, %r11d
	movq	%r14, %rdi
	xorl	%r10d, %r10d
	movl	%eax, -72(%rbp)
	movq	%r12, %r14
	andl	$-4, %r11d
	xorl	%r15d, %r15d
	leaq	4(,%rax,4), %rax
	movq	%rax, -104(%rbp)
	movl	%ecx, %eax
	shrl	$2, %eax
	leal	-1(%rax), %r8d
	addq	$1, %r8
	salq	$4, %r8
	movq	%r8, %r12
	.p2align 4,,10
	.p2align 3
.L20:
	testl	%ecx, %ecx
	jle	.L33
	testl	%r15d, %r15d
	je	.L21
	cmpl	$2, -72(%rbp)
	jbe	.L57
	leaq	(%rbx,%r10,4), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L23:
	movdqu	(%rdi,%rax), %xmm0
	movdqu	(%rdx,%rax), %xmm2
	paddd	%xmm2, %xmm0
	movups	%xmm0, (%rdi,%rax)
	addq	$16, %rax
	cmpq	%rax, %r12
	jne	.L23
	cmpl	%r11d, %ecx
	je	.L33
	movl	%r11d, %edx
	movl	%r11d, %eax
.L22:
	movl	%ecx, %esi
	subl	%edx, %esi
	cmpl	$1, %esi
	je	.L25
	leaq	(%rdi,%rdx,4), %r8
	addq	%r10, %rdx
	movq	(%rbx,%rdx,4), %xmm0
	movq	(%r8), %xmm1
	movl	%esi, %edx
	andl	$-2, %edx
	paddd	%xmm1, %xmm0
	addl	%edx, %eax
	movq	%xmm0, (%r8)
	cmpl	%edx, %esi
	je	.L33
.L25:
	movslq	%r15d, %rdx
	cltq
	imulq	%r14, %rdx
	addq	%rax, %rdx
	movl	(%rbx,%rdx,4), %edx
	addl	%edx, (%rdi,%rax,4)
.L33:
	addl	$1, %r15d
	addq	%r14, %r10
	cmpl	%r9d, %r15d
	jne	.L20
	movq	%rdi, %r14
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L21:
	movq	-104(%rbp), %rdx
	xorl	%esi, %esi
	movl	%r11d, -88(%rbp)
	movq	%r10, -96(%rbp)
	movl	%r9d, -84(%rbp)
	movl	%ecx, -80(%rbp)
	call	memset@PLT
	cmpl	$2, -72(%rbp)
	movl	-80(%rbp), %ecx
	movl	-84(%rbp), %r9d
	movq	-96(%rbp), %r10
	movq	%rax, %rdi
	movl	-88(%rbp), %r11d
	jbe	.L58
	leaq	(%rbx,%r10,4), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L28:
	movdqu	(%rdx,%rax), %xmm3
	movups	%xmm3, (%rdi,%rax)
	addq	$16, %rax
	cmpq	%rax, %r12
	jne	.L28
	movl	%r11d, %eax
	cmpl	%r11d, %ecx
	je	.L33
.L27:
	movslq	%eax, %rsi
	leaq	(%rdi,%rsi,4), %rdx
	movl	(%rbx,%rsi,4), %esi
	movl	%esi, (%rdx)
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L33
	movslq	%esi, %rsi
	addl	$2, %eax
	movl	(%rbx,%rsi,4), %esi
	movl	%esi, 4(%rdx)
	cmpl	%ecx, %eax
	jge	.L33
	cltq
	movl	(%rbx,%rax,4), %eax
	movl	%eax, 8(%rdx)
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L104:
	movslq	%ecx, %rax
	movq	%rsp, %rdx
	movq	-72(%rbp), %r12
	movq	-80(%rbp), %rbx
	leaq	15(,%rax,4), %rsi
	movq	%rax, -112(%rbp)
	movq	%rsi, -120(%rbp)
	movq	%rsi, %rax
	andq	$-4096, %rsi
	andq	$-16, %rax
	subq	%rsi, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L57:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L22
.L58:
	xorl	%eax, %eax
	jmp	.L27
.L3:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L107
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L97:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rax)
	jmp	.L47
.L107:
	call	__stack_chk_fail@PLT
.L17:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L18
	orq	$0, -8(%rsp,%rax)
.L18:
	movq	%rsp, %r14
	testl	%r9d, %r9d
	jg	.L51
	jmp	.L19
.L105:
	movslq	%ecx, %rax
	movq	%rsp, %rdx
	leaq	15(,%rax,4), %rsi
	movq	%rax, -112(%rbp)
	movq	%rsi, -120(%rbp)
	movq	%rsi, %rax
	andq	$-4096, %rsi
	andq	$-16, %rax
	subq	%rsi, %rdx
.L52:
	cmpq	%rdx, %rsp
	je	.L53
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L52
	.cfi_endproc
.LFE23:
	.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC1(%rip), %r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-60(%rbp), %rax
	movq	%rax, -144(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, -136(%rbp)
	.p2align 4,,10
	.p2align 3
.L38:
	movq	-144(%rbp), %rdx
	movq	-136(%rbp), %rsi
	xorl	%eax, %eax
	movq	%rsp, -128(%rbp)
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %r9d
	testl	%r9d, %r9d
	jne	.L2
	movl	-60(%rbp), %ecx
	testl	%ecx, %ecx
	je	.L3
	movslq	%ecx, %rax
	movq	%rax, -112(%rbp)
.L4:
	movq	-112(%rbp), %rax
	movq	%rsp, %rdx
	leaq	15(,%rax,4), %rsi
	movq	%rsi, %rax
	movq	%rsi, -120(%rbp)
	andq	$-4096, %rsi
	subq	%rsi, %rdx
	andq	$-16, %rax
	cmpq	%rdx, %rsp
	je	.L46
.L96:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdx, %rsp
	jne	.L96
.L46:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	jne	.L97
.L47:
	movq	%rsp, %r14
	.p2align 4,,10
	.p2align 3
.L19:
	movq	-120(%rbp), %rsi
	movq	%rsp, %rdx
	movq	%rsi, %rax
	andq	$-4096, %rsi
	subq	%rsi, %rdx
	andq	$-16, %rax
	cmpq	%rdx, %rsp
	je	.L35
.L98:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdx, %rsp
	jne	.L98
.L35:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L36
	orq	$0, -8(%rsp,%rax)
.L36:
	movq	%rsp, %r12
	testl	%ecx, %ecx
	jle	.L44
	movq	-112(%rbp), %rdx
	xorl	%esi, %esi
	movq	%r12, %rdi
	movl	%ecx, -72(%rbp)
	xorl	%ebx, %ebx
	salq	$2, %rdx
	call	memset@PLT
	movl	-72(%rbp), %ecx
	testl	%ecx, %ecx
	jle	.L59
	.p2align 4,,10
	.p2align 3
.L101:
	movslq	%ecx, %rdx
	xorl	%eax, %eax
	movl	$-1, %r15d
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L100:
	movslq	%r15d, %rcx
	movl	(%r14,%rax,4), %esi
	cmpl	%esi, (%r14,%rcx,4)
	cmovl	%eax, %r15d
.L41:
	addq	$1, %rax
	cmpq	%rax, %rdx
	je	.L99
.L42:
	movl	(%r12,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L41
	cmpl	$-1, %r15d
	jne	.L100
	movl	%eax, %r15d
	addq	$1, %rax
	cmpq	%rax, %rdx
	jne	.L42
	.p2align 4,,10
	.p2align 3
.L99:
	leal	1(%r15), %edx
.L40:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movslq	%r15d, %r15
	call	__printf_chk@PLT
	addl	$1, %ebx
	movl	$1, (%r12,%r15,4)
	cmpl	%ebx, -60(%rbp)
	jle	.L44
	movl	$32, %edi
	call	putchar@PLT
	movl	-60(%rbp), %ecx
	testl	%ecx, %ecx
	jg	.L101
.L59:
	xorl	%edx, %edx
	movl	$-1, %r15d
	jmp	.L40
.L53:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L54
	orq	$0, -8(%rsp,%rax)
.L54:
	movq	%rsp, %r14
	testl	%r9d, %r9d
	jg	.L51
	.p2align 4,,10
	.p2align 3
.L44:
	movl	$10, %edi
	call	putchar@PLT
	movq	-128(%rbp), %rsp
	jmp	.L38
.L2:
	movslq	-60(%rbp), %rsi
	movslq	%r9d, %rax
	imulq	%rsi, %rax
	movq	%rsi, -112(%rbp)
	movq	%rsi, %rcx
	leaq	0(,%rsi,4), %r12
	movq	%rsp, %rsi
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L6
.L102:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L102
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L7
	orq	$0, -8(%rsp,%rdx)
.L7:
	movq	%rsp, %rbx
	testl	%r9d, %r9d
	jle	.L4
	shrq	$2, %r12
	movq	%rbx, -80(%rbp)
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	movq	%r12, -72(%rbp)
	testl	%ecx, %ecx
	jle	.L103
	.p2align 4,,10
	.p2align 3
.L14:
	movq	-80(%rbp), %rax
	xorl	%ebx, %ebx
	leaq	(%rax,%r15,4), %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L9
	movl	-64(%rbp), %r9d
	addl	$1, %r14d
	cmpl	%r9d, %r14d
	jge	.L104
	addq	-72(%rbp), %r15
	testl	%ecx, %ecx
	jg	.L14
.L103:
	addl	$1, %r14d
	movq	-72(%rbp), %r12
	movq	-80(%rbp), %rbx
	cmpl	%r14d, %r9d
	jle	.L105
	movslq	%ecx, %rax
	movq	%rsp, %rdx
	leaq	15(,%rax,4), %rsi
	movq	%rax, -112(%rbp)
	movq	%rsi, -120(%rbp)
	movq	%rsi, %rax
	andq	$-4096, %rsi
	subq	%rsi, %rdx
	andq	$-16, %rax
	cmpq	%rdx, %rsp
	je	.L49
.L106:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdx, %rsp
	jne	.L106
.L49:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L50
	orq	$0, -8(%rsp,%rax)
.L50:
	movq	%rsp, %r14
.L51:
	leal	-1(%rcx), %eax
	movl	%ecx, %r11d
	movq	%r14, %rdi
	xorl	%r10d, %r10d
	movl	%eax, -72(%rbp)
	movq	%r12, %r14
	andl	$-4, %r11d
	xorl	%r15d, %r15d
	leaq	4(,%rax,4), %rax
	movq	%rax, -104(%rbp)
	movl	%ecx, %eax
	shrl	$2, %eax
	leal	-1(%rax), %r8d
	addq	$1, %r8
	salq	$4, %r8
	movq	%r8, %r12
	.p2align 4,,10
	.p2align 3
.L20:
	testl	%ecx, %ecx
	jle	.L33
	testl	%r15d, %r15d
	je	.L21
	cmpl	$2, -72(%rbp)
	jbe	.L57
	leaq	(%rbx,%r10,4), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L23:
	movdqu	(%rdi,%rax), %xmm0
	movdqu	(%rdx,%rax), %xmm2
	paddd	%xmm2, %xmm0
	movups	%xmm0, (%rdi,%rax)
	addq	$16, %rax
	cmpq	%rax, %r12
	jne	.L23
	cmpl	%r11d, %ecx
	je	.L33
	movl	%r11d, %edx
	movl	%r11d, %eax
.L22:
	movl	%ecx, %esi
	subl	%edx, %esi
	cmpl	$1, %esi
	je	.L25
	leaq	(%rdi,%rdx,4), %r8
	addq	%r10, %rdx
	movq	(%rbx,%rdx,4), %xmm0
	movq	(%r8), %xmm1
	movl	%esi, %edx
	andl	$-2, %edx
	paddd	%xmm1, %xmm0
	addl	%edx, %eax
	movq	%xmm0, (%r8)
	cmpl	%edx, %esi
	je	.L33
.L25:
	movslq	%r15d, %rdx
	cltq
	imulq	%r14, %rdx
	addq	%rax, %rdx
	movl	(%rbx,%rdx,4), %edx
	addl	%edx, (%rdi,%rax,4)
.L33:
	addl	$1, %r15d
	addq	%r14, %r10
	cmpl	%r9d, %r15d
	jne	.L20
	movq	%rdi, %r14
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L21:
	movq	-104(%rbp), %rdx
	xorl	%esi, %esi
	movl	%r11d, -88(%rbp)
	movq	%r10, -96(%rbp)
	movl	%r9d, -84(%rbp)
	movl	%ecx, -80(%rbp)
	call	memset@PLT
	cmpl	$2, -72(%rbp)
	movl	-80(%rbp), %ecx
	movl	-84(%rbp), %r9d
	movq	-96(%rbp), %r10
	movq	%rax, %rdi
	movl	-88(%rbp), %r11d
	jbe	.L58
	leaq	(%rbx,%r10,4), %rdx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L28:
	movdqu	(%rdx,%rax), %xmm3
	movups	%xmm3, (%rdi,%rax)
	addq	$16, %rax
	cmpq	%rax, %r12
	jne	.L28
	movl	%r11d, %eax
	cmpl	%r11d, %ecx
	je	.L33
.L27:
	movslq	%eax, %rsi
	leaq	(%rdi,%rsi,4), %rdx
	movl	(%rbx,%rsi,4), %esi
	movl	%esi, (%rdx)
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L33
	movslq	%esi, %rsi
	addl	$2, %eax
	movl	(%rbx,%rsi,4), %esi
	movl	%esi, 4(%rdx)
	cmpl	%ecx, %eax
	jge	.L33
	cltq
	movl	(%rbx,%rax,4), %eax
	movl	%eax, 8(%rdx)
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L104:
	movslq	%ecx, %rax
	movq	%rsp, %rdx
	movq	-72(%rbp), %r12
	movq	-80(%rbp), %rbx
	leaq	15(,%rax,4), %rsi
	movq	%rax, -112(%rbp)
	movq	%rsi, -120(%rbp)
	movq	%rsi, %rax
	andq	$-4096, %rsi
	andq	$-16, %rax
	subq	%rsi, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L57:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L22
.L58:
	xorl	%eax, %eax
	jmp	.L27
.L3:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L107
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L97:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rax)
	jmp	.L47
.L107:
	call	__stack_chk_fail@PLT
.L17:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L18
	orq	$0, -8(%rsp,%rax)
.L18:
	movq	%rsp, %r14
	testl	%r9d, %r9d
	jg	.L51
	jmp	.L19
.L105:
	movslq	%ecx, %rax
	movq	%rsp, %rdx
	leaq	15(,%rax,4), %rsi
	movq	%rax, -112(%rbp)
	movq	%rsi, -120(%rbp)
	movq	%rsi, %rax
	andq	$-4096, %rsi
	andq	$-16, %rax
	subq	%rsi, %rdx
.L52:
	cmpq	%rdx, %rsp
	je	.L53
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L52
	.cfi_endproc
.LFE23:
	.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:

#include<stdio.h>

int main(void){
	int n,m;
	while(1){
		scanf("%d %d",&n,&m);
		if(n==0 && m==0)break;
		int q[n][m],i,j=0;
		while(j<n){
			i=0;
			while(i<m){
				scanf("%d",&q[j][i]);
				i++;
			}
			j++;
		}
		int cnt[m];
		for(i=0;i<n;i++)for(j=0;j<m;j++){
			if(!i)cnt[j] = 0;
			cnt[j] += q[i][j];
		}
		int max,maxed[m];
		for(i=0;i<m;i++)maxed[i] = 0;
		for(i=0;i<m;i++){
			if(i)printf(" ");
			max = -1;
			for(j=0;j<m;j++){
				if(!maxed[j]){
					if(max == -1)max = j;
					else if(cnt[max] < cnt[j])max = j;
				}
			}
			printf("%d",max+1);
			maxed[max] = 1;
		}
		printf("\n");
	}
}

4 6
1 0 1 0 1 1
1 2 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
4 6
1 0 1 0 1 1
1 1 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
0 0
 4 6
1 0 1 0 1 1
1 2 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
4 6
1 0 1 0 1 1
2 1 0 1 1 0
1 1 1 0 0 0
1 0 1 0 1 0
0 0
 4 6
1 0 1 0 1 1
1 1 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
4 6
0 0 1 0 1 1
1 1 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
0 0
 4 6
1 0 1 0 1 1
1 2 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
4 6
1 0 1 0 1 1
1 1 -1 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
0 0
 4 6
1 0 1 0 1 2
1 2 0 1 1 0
1 1 1 0 0 0
1 0 1 0 1 0
4 6
1 0 1 0 1 1
2 1 0 1 1 0
1 1 1 0 0 0
1 0 1 0 1 0
0 0
 4 6
1 0 1 0 1 1
1 1 0 1 0 0
1 0 1 0 0 0
1 0 1 0 1 0
4 6
0 0 1 0 1 1
1 1 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
0 0
 4 6
1 0 1 0 1 1
1 2 0 1 0 0
1 1 1 0 0 1
1 0 1 0 1 0
4 6
1 0 1 0 1 1
1 1 -1 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
0 0
 4 6
1 0 0 0 1 1
1 2 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
4 6
1 0 1 0 1 1
2 1 0 1 1 0
1 1 0 0 0 0
1 0 1 0 1 0
0 0
 4 6
1 0 1 0 1 2
1 0 0 1 1 0
1 1 1 0 0 0
1 0 1 0 1 0
4 6
1 0 1 0 1 1
2 1 0 1 1 0
1 1 1 0 0 0
1 0 1 0 1 0
0 0
 4 6
1 0 1 0 1 1
1 1 0 1 0 0
1 1 1 0 0 0
1 0 1 0 1 0
4 6
0 0 1 0 1 1
1 1 0 1 0 0
1 1 1 0 0 0
1 -1 1 0 1 0
0 0

1 2 3 5 4 6
1 3 2 5 4 6
 1 2 3 5 4 6
1 3 5 2 4 6
 1 3 2 5 4 6
1 3 2 5 4 6
 1 2 3 5 4 6
1 2 3 5 4 6
 1 2 3 5 6 4
1 3 5 2 4 6
 1 3 5 2 4 6
1 3 2 5 4 6
 1 2 3 5 6 4
1 2 3 5 4 6
 1 2 3 5 4 6
1 5 2 3 4 6
 1 3 5 6 2 4
1 3 5 2 4 6
 1 3 2 5 4 6
1 3 5 2 4 6

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

```c
#include<stdio.h>

int main(void){
	int n,m;
	while(1){
		scanf("%d %d",&n,&m);
		if(n==0 && m==0)break;
		int q[n][m],i,j=0;
		while(j<n){
			i=0;
			while(i<m){
				scanf("%d",&q[j][i]);
				i++;
			}
			j++;
		}
		int cnt[m];
		for(i=0;i<n;i++)for(j=0;j<m;j++){
			if(!i)cnt[j] = 0;
			cnt[j] += q[i][j];
		}
		int max,maxed[m];
		for(i=0;i<m;i++)maxed[i] = 0;
		for(i=0;i<m;i++){
			if(i)printf(" ");
			max = -1;
			for(j=0;j<m;j++){
				if(!maxed[j]){
					if(max == -1)max = j;
					else if(cnt[max] < cnt[j])max = j;
				}
			}
			printf("%d",max+1);
			maxed[max] = 1;
		}
		printf("\n");
	}
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$232, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
.L31:
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	%rbx, -264(%rbp)
	leaq	-128(%rbp), %rdx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-128(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	jmp	.L33
.L2:
	movl	-128(%rbp), %esi
	movl	-132(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	movslq	%esi, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%esi, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edi, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	-160(%rbp), %r8
	movq	-152(%rbp), %r9
	movq	%r9, %rdx
	movq	-176(%rbp), %r10
	movq	-168(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L4:
	cmpq	%rcx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L6
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L7
.L10:
	movl	$0, -124(%rbp)
	jmp	.L8
.L9:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-124(%rbp), %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -124(%rbp)
.L8:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L9
	addl	$1, -120(%rbp)
.L7:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L10
	movl	-128(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%edx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L11:
	cmpq	%rcx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L13
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L14
.L18:
	movl	$0, -120(%rbp)
	jmp	.L15
.L17:
	cmpl	$0, -124(%rbp)
	jne	.L16
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	$0, (%rdx,%rax,4)
.L16:
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %edi
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-96(%rbp), %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movl	-124(%rbp), %eax
	cltq
	imulq	%rsi, %rax
	addq	%rdx, %rax
	movl	(%rcx,%rax,4), %eax
	leal	(%rdi,%rax), %ecx
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	%ecx, (%rdx,%rax,4)
	addl	$1, -120(%rbp)
.L15:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L17
	addl	$1, -124(%rbp)
.L14:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L18
	movl	-128(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L19:
	cmpq	%rcx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L21
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L21:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L22
.L23:
	movq	-64(%rbp), %rdx
	movl	-124(%rbp), %eax
	cltq
	movl	$0, (%rdx,%rax,4)
	addl	$1, -124(%rbp)
.L22:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L23
	movl	$0, -124(%rbp)
	jmp	.L24
.L30:
	cmpl	$0, -124(%rbp)
	je	.L25
	movl	$32, %edi
	call	putchar@PLT
.L25:
	movl	$-1, -116(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L26
.L29:
	movq	-64(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L27
	cmpl	$-1, -116(%rbp)
	jne	.L28
	movl	-120(%rbp), %eax
	movl	%eax, -116(%rbp)
	jmp	.L27
.L28:
	movq	-80(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %ecx
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %eax
	cmpl	%eax, %ecx
	jge	.L27
	movl	-120(%rbp), %eax
	movl	%eax, -116(%rbp)
.L27:
	addl	$1, -120(%rbp)
.L26:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L29
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-64(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	movl	$1, (%rdx,%rax,4)
	addl	$1, -124(%rbp)
.L24:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L30
	movl	$10, %edi
	call	putchar@PLT
	movq	-264(%rbp), %rsp
	jmp	.L31
.L33:
	call	__stack_chk_fail@PLT
.L32:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
val
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$232, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
.L31:
	movq	%rsp, %rax
	movq	%rax, %rbx
	movq	%rbx, -264(%rbp)
	leaq	-128(%rbp), %rdx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-128(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	jmp	.L33
.L2:
	movl	-128(%rbp), %esi
	movl	-132(%rbp), %edi
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	movslq	%esi, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%esi, %rax
	leaq	0(,%rax,4), %rbx
	movslq	%edi, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%esi, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edi, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	-160(%rbp), %r8
	movq	-152(%rbp), %r9
	movq	%r9, %rdx
	movq	-176(%rbp), %r10
	movq	-168(%rbp), %r11
	imulq	%r10, %rdx
	movq	%r11, %rax
	imulq	%r8, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r8, %rax
	mulq	%r10
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rcx
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rcx
	movq	%rcx, %rdx
	movslq	%esi, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L4:
	cmpq	%rcx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L6
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L7
.L10:
	movl	$0, -124(%rbp)
	jmp	.L8
.L9:
	movq	%rbx, %rdx
	shrq	$2, %rdx
	movl	-124(%rbp), %eax
	movslq	%eax, %rcx
	movl	-120(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -124(%rbp)
.L8:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L9
	addl	$1, -120(%rbp)
.L7:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L10
	movl	-128(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%edx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L11:
	cmpq	%rcx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L13
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L14
.L18:
	movl	$0, -120(%rbp)
	jmp	.L15
.L17:
	cmpl	$0, -124(%rbp)
	jne	.L16
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	$0, (%rdx,%rax,4)
.L16:
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %edi
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-96(%rbp), %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movl	-124(%rbp), %eax
	cltq
	imulq	%rsi, %rax
	addq	%rdx, %rax
	movl	(%rcx,%rax,4), %eax
	leal	(%rdi,%rax), %ecx
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	%ecx, (%rdx,%rax,4)
	addl	$1, -120(%rbp)
.L15:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L17
	addl	$1, -124(%rbp)
.L14:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L18
	movl	-128(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L19:
	cmpq	%rcx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L21
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L21:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L22
.L23:
	movq	-64(%rbp), %rdx
	movl	-124(%rbp), %eax
	cltq
	movl	$0, (%rdx,%rax,4)
	addl	$1, -124(%rbp)
.L22:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L23
	movl	$0, -124(%rbp)
	jmp	.L24
.L30:
	cmpl	$0, -124(%rbp)
	je	.L25
	movl	$32, %edi
	call	putchar@PLT
.L25:
	movl	$-1, -116(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L26
.L29:
	movq	-64(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L27
	cmpl	$-1, -116(%rbp)
	jne	.L28
	movl	-120(%rbp), %eax
	movl	%eax, -116(%rbp)
	jmp	.L27
.L28:
	movq	-80(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %ecx
	movq	-80(%rbp), %rdx
	movl	-120(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %eax
	cmpl	%eax, %ecx
	jge	.L27
	movl	-120(%rbp), %eax
	movl	%eax, -116(%rbp)
.L27:
	addl	$1, -120(%rbp)
.L26:
	movl	-128(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L29
	movl	-116(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-64(%rbp), %rdx
	movl	-116(%rbp), %eax
	cltq
	movl	$1, (%rdx,%rax,4)
	addl	$1, -124(%rbp)
.L24:
	movl	-128(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L30
	movl	$10, %edi
	call	putchar@PLT
	movq	-264(%rbp), %rsp
	jmp	.L31
.L33:
	call	__stack_chk_fail@PLT
.L32:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
