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 a, n, m, i, Q[100], N[100], R[100], l, key, temp, O = 1;
    scanf("%d %d", &n, &m);
    while ( O ) {
        key = 0;
        for ( i = 0; i < m; i++ ) {
            Q[i] = 0;
            N[i] = i + 1;
            /*printf("N[%d]:%d\n", i, N[i]);*/
        }
        for ( i = 0; i < n; i++ ) {
            for ( l  = 0; l < m; l++ ) {
                scanf("%d", &a);
                Q[l] += a;
            }
        }
        /*printf("%d %d %d %d %d %d\n",Q[0], Q[1], Q[2], Q[3], Q[4], Q[5] );*/
        key = 1;
        /*for ( i = 0; i < m; i++ ) printf("%d ", N[i]); printf("\n");*/
        while ( key ) {
            key  = 0;
            for ( i = m - 1; i > 0; i-- ) {
                if ( Q[i] > Q[i - 1]) {
                    /*printf("before N[%d]:%d N[%d]:%d\n",i,  N[i], i-1, N[i-1]);*/
                    temp = Q[i];
                    Q[i] = Q[i - 1];
                    Q[i - 1] = temp;
                    temp = N[i];
                    N[i] = N[i - 1];
                    N[i - 1] = temp;
                    key++;
                    /*printf("after N[i]:%d N[i-1]:%d\n", N[i], N[i-1]);
                    printf("%d %d %d %d %d %d\n",Q[0], Q[1], Q[2], Q[3], Q[4], Q[5] );
                    for ( i = 0; i < m; i++ ) printf("%d ", N[i]); printf("\n\n");*/
                }
            }
        }
        /*printf("%d %d %d %d %d %da\n",Q[0], Q[1], Q[2], Q[3], Q[4], Q[5] );*/
        printf("%d", N[0]);
        for ( i = 1; i < m; i++ ) printf(" %d", N[i]); printf("\n");
        scanf("%d %d", &n, &m);
        if ( n == 0 && m == 0 ) O = 0;
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.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
	subq	$848, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -824(%rbp)
	leaq	-840(%rbp), %rdx
	leaq	-844(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L16:
	movl	$0, -828(%rbp)
	movl	$0, -836(%rbp)
	jmp	.L3
.L4:
	movl	-836(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	leal	1(%rax), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -836(%rbp)
.L3:
	movl	-840(%rbp), %eax
	cmpl	%eax, -836(%rbp)
	jl	.L4
	movl	$0, -836(%rbp)
	jmp	.L5
.L8:
	movl	$0, -832(%rbp)
	jmp	.L6
.L7:
	leaq	-848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-832(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-848(%rbp), %eax
	addl	%eax, %edx
	movl	-832(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	addl	$1, -832(%rbp)
.L6:
	movl	-840(%rbp), %eax
	cmpl	%eax, -832(%rbp)
	jl	.L7
	addl	$1, -836(%rbp)
.L5:
	movl	-844(%rbp), %eax
	cmpl	%eax, -836(%rbp)
	jl	.L8
	movl	$1, -828(%rbp)
	jmp	.L9
.L13:
	movl	$0, -828(%rbp)
	movl	-840(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -836(%rbp)
	jmp	.L10
.L12:
	movl	-836(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-836(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	%eax, -820(%rbp)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-820(%rbp), %edx
	movl	%edx, -816(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -820(%rbp)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-820(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -828(%rbp)
.L11:
	subl	$1, -836(%rbp)
.L10:
	cmpl	$0, -836(%rbp)
	jg	.L12
.L9:
	cmpl	$0, -828(%rbp)
	jne	.L13
	movl	-416(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -836(%rbp)
	jmp	.L14
.L15:
	movl	-836(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -836(%rbp)
.L14:
	movl	-840(%rbp), %eax
	cmpl	%eax, -836(%rbp)
	jl	.L15
	movl	$10, %edi
	call	putchar@PLT
	leaq	-840(%rbp), %rdx
	leaq	-844(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-844(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-840(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, -824(%rbp)
.L2:
	cmpl	$0, -824(%rbp)
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.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
.LC1:
	.string	"%d %d"
.LC4:
	.string	"%d"
.LC5:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC4(%rip), %rbx
	subq	$888, %rsp
	.cfi_def_cfa_offset 944
	movq	%fs:40, %rax
	movq	%rax, 872(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	leaq	60(%rsp), %rdx
	movq	%rax, 40(%rsp)
	movq	%rax, %rsi
	xorl	%eax, %eax
	leaq	464(%rsp), %r13
	movq	%rdx, 24(%rsp)
	leaq	52(%rsp), %rbp
	call	__isoc99_scanf@PLT
	leaq	64(%rsp), %rax
	movl	56(%rsp), %ecx
	movl	60(%rsp), %r8d
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	testl	%r8d, %r8d
	jle	.L19
	movl	%r8d, %edx
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	movl	%ecx, 36(%rsp)
	salq	$2, %rdx
	movl	%r8d, 16(%rsp)
	call	memset@PLT
	movl	16(%rsp), %r8d
	movl	36(%rsp), %ecx
	leal	-1(%r8), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%r8d, %edx
	movdqa	.LC0(%rip), %xmm1
	movq	%r13, %rax
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	480(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm1, %xmm0
	paddd	.LC3(%rip), %xmm0
	addq	$16, %rax
	paddd	.LC2(%rip), %xmm1
	movaps	%xmm0, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L4
	movl	%r8d, %eax
	andl	$-4, %eax
	testb	$3, %r8b
	je	.L19
.L3:
	leal	1(%rax), %edx
	movslq	%eax, %rsi
	movl	%edx, 464(%rsp,%rsi,4)
	cmpl	%r8d, %edx
	jge	.L19
	leal	2(%rax), %esi
	movslq	%edx, %rdx
	movl	%esi, 464(%rsp,%rdx,4)
	cmpl	%esi, %r8d
	jle	.L19
	movslq	%esi, %rsi
	addl	$3, %eax
	movl	%eax, 464(%rsp,%rsi,4)
.L19:
	xorl	%r12d, %r12d
	testl	%ecx, %ecx
	jle	.L7
	movq	%r13, 16(%rsp)
	movq	8(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L6:
	testl	%r8d, %r8d
	jle	.L35
	movq	%r15, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %r8d
	movl	52(%rsp), %eax
	addl	%eax, (%r14)
	addq	$4, %r14
	cmpl	%r13d, %r8d
	jg	.L8
	addl	$1, %r12d
	cmpl	%r12d, 56(%rsp)
	jg	.L6
.L35:
	movq	16(%rsp), %r13
.L7:
	movq	8(%rsp), %rcx
	movslq	%r8d, %rax
	salq	$2, %rax
	leaq	(%rcx,%rax), %r11
	movq	24(%rsp), %rcx
	leaq	0(%r13,%rax), %r10
	leaq	(%rcx,%rax), %r9
	leal	-2(%r8), %eax
	salq	$2, %rax
	subq	%rax, %r9
	.p2align 4,,10
	.p2align 3
.L15:
	cmpl	$1, %r8d
	jle	.L16
	movq	%r10, %rcx
	movq	%r11, %rdx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L11:
	movq	-8(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jle	.L14
	movq	%xmm1, -8(%rdx)
	addl	$1, %edi
	rolq	$32, -8(%rcx)
.L14:
	subq	$4, %rdx
	subq	$4, %rcx
	cmpq	%r9, %rdx
	jne	.L11
	testl	%edi, %edi
	jne	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	$1, %r15d
	movl	464(%rsp), %edx
	leaq	.LC5(%rip), %r12
	call	__printf_chk@PLT
	cmpl	$1, 60(%rsp)
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movl	0(%r13,%r15,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__printf_chk@PLT
	cmpl	%r15d, 60(%rsp)
	jg	.L12
.L13:
	movl	$10, %edi
	call	putchar@PLT
	movq	24(%rsp), %rdx
	xorl	%eax, %eax
	movq	40(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %ecx
	movl	60(%rsp), %r8d
	movl	%ecx, %eax
	orl	%r8d, %eax
	jne	.L2
	movq	872(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$888, %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
.L21:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L3
.L39:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC4:
	.string	"%d"
.LC5:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC4(%rip), %rbx
	subq	$888, %rsp
	.cfi_def_cfa_offset 944
	movq	%fs:40, %rax
	movq	%rax, 872(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	leaq	60(%rsp), %rdx
	movq	%rax, 40(%rsp)
	movq	%rax, %rsi
	xorl	%eax, %eax
	leaq	464(%rsp), %r13
	movq	%rdx, 24(%rsp)
	leaq	52(%rsp), %rbp
	call	__isoc99_scanf@PLT
	leaq	64(%rsp), %rax
	movl	56(%rsp), %ecx
	movl	60(%rsp), %r8d
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	testl	%r8d, %r8d
	jle	.L19
	movl	%r8d, %edx
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	movl	%ecx, 36(%rsp)
	salq	$2, %rdx
	movl	%r8d, 16(%rsp)
	call	memset@PLT
	movl	16(%rsp), %r8d
	movl	36(%rsp), %ecx
	leal	-1(%r8), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%r8d, %edx
	movdqa	.LC0(%rip), %xmm1
	movq	%r13, %rax
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	480(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm1, %xmm0
	paddd	.LC3(%rip), %xmm0
	addq	$16, %rax
	paddd	.LC2(%rip), %xmm1
	movaps	%xmm0, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L4
	movl	%r8d, %eax
	andl	$-4, %eax
	testb	$3, %r8b
	je	.L19
.L3:
	leal	1(%rax), %edx
	movslq	%eax, %rsi
	movl	%edx, 464(%rsp,%rsi,4)
	cmpl	%r8d, %edx
	jge	.L19
	leal	2(%rax), %esi
	movslq	%edx, %rdx
	movl	%esi, 464(%rsp,%rdx,4)
	cmpl	%esi, %r8d
	jle	.L19
	movslq	%esi, %rsi
	addl	$3, %eax
	movl	%eax, 464(%rsp,%rsi,4)
.L19:
	xorl	%r12d, %r12d
	testl	%ecx, %ecx
	jle	.L7
	movq	%r13, 16(%rsp)
	movq	8(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L6:
	testl	%r8d, %r8d
	jle	.L35
	movq	%r15, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	60(%rsp), %r8d
	movl	52(%rsp), %eax
	addl	%eax, (%r14)
	addq	$4, %r14
	cmpl	%r13d, %r8d
	jg	.L8
	addl	$1, %r12d
	cmpl	%r12d, 56(%rsp)
	jg	.L6
.L35:
	movq	16(%rsp), %r13
.L7:
	movq	8(%rsp), %rcx
	movslq	%r8d, %rax
	salq	$2, %rax
	leaq	(%rcx,%rax), %r11
	movq	24(%rsp), %rcx
	leaq	0(%r13,%rax), %r10
	leaq	(%rcx,%rax), %r9
	leal	-2(%r8), %eax
	salq	$2, %rax
	subq	%rax, %r9
	.p2align 4,,10
	.p2align 3
.L15:
	cmpl	$1, %r8d
	jle	.L16
	movq	%r10, %rcx
	movq	%r11, %rdx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L11:
	movq	-8(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %eax
	movd	%xmm2, %esi
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %esi
	jle	.L14
	movq	%xmm1, -8(%rdx)
	addl	$1, %edi
	rolq	$32, -8(%rcx)
.L14:
	subq	$4, %rdx
	subq	$4, %rcx
	cmpq	%r9, %rdx
	jne	.L11
	testl	%edi, %edi
	jne	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	movl	$1, %r15d
	movl	464(%rsp), %edx
	leaq	.LC5(%rip), %r12
	call	__printf_chk@PLT
	cmpl	$1, 60(%rsp)
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movl	0(%r13,%r15,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__printf_chk@PLT
	cmpl	%r15d, 60(%rsp)
	jg	.L12
.L13:
	movl	$10, %edi
	call	putchar@PLT
	movq	24(%rsp), %rdx
	xorl	%eax, %eax
	movq	40(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %ecx
	movl	60(%rsp), %r8d
	movl	%ecx, %eax
	orl	%r8d, %eax
	jne	.L2
	movq	872(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$888, %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
.L21:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L3
.L39:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	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>
int main(void){
    int a, n, m, i, Q[100], N[100], R[100], l, key, temp, O = 1;
    scanf("%d %d", &n, &m);
    while ( O ) {
        key = 0;
        for ( i = 0; i < m; i++ ) {
            Q[i] = 0;
            N[i] = i + 1;
            /*printf("N[%d]:%d\n", i, N[i]);*/
        }
        for ( i = 0; i < n; i++ ) {
            for ( l  = 0; l < m; l++ ) {
                scanf("%d", &a);
                Q[l] += a;
            }
        }
        /*printf("%d %d %d %d %d %d\n",Q[0], Q[1], Q[2], Q[3], Q[4], Q[5] );*/
        key = 1;
        /*for ( i = 0; i < m; i++ ) printf("%d ", N[i]); printf("\n");*/
        while ( key ) {
            key  = 0;
            for ( i = m - 1; i > 0; i-- ) {
                if ( Q[i] > Q[i - 1]) {
                    /*printf("before N[%d]:%d N[%d]:%d\n",i,  N[i], i-1, N[i-1]);*/
                    temp = Q[i];
                    Q[i] = Q[i - 1];
                    Q[i - 1] = temp;
                    temp = N[i];
                    N[i] = N[i - 1];
                    N[i - 1] = temp;
                    key++;
                    /*printf("after N[i]:%d N[i-1]:%d\n", N[i], N[i-1]);
                    printf("%d %d %d %d %d %d\n",Q[0], Q[1], Q[2], Q[3], Q[4], Q[5] );
                    for ( i = 0; i < m; i++ ) printf("%d ", N[i]); printf("\n\n");*/
                }
            }
        }
        /*printf("%d %d %d %d %d %da\n",Q[0], Q[1], Q[2], Q[3], Q[4], Q[5] );*/
        printf("%d", N[0]);
        for ( i = 1; i < m; i++ ) printf(" %d", N[i]); printf("\n");
        scanf("%d %d", &n, &m);
        if ( n == 0 && m == 0 ) O = 0;
    }
    return 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 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 a, n, m, i, Q[100], N[100], R[100], l, key, temp, O = 1;
    scanf("%d %d", &n, &m);
    while ( O ) {
        key = 0;
        for ( i = 0; i < m; i++ ) {
            Q[i] = 0;
            N[i] = i + 1;
            /*printf("N[%d]:%d\n", i, N[i]);*/
        }
        for ( i = 0; i < n; i++ ) {
            for ( l  = 0; l < m; l++ ) {
                scanf("%d", &a);
                Q[l] += a;
            }
        }
        /*printf("%d %d %d %d %d %d\n",Q[0], Q[1], Q[2], Q[3], Q[4], Q[5] );*/
        key = 1;
        /*for ( i = 0; i < m; i++ ) printf("%d ", N[i]); printf("\n");*/
        while ( key ) {
            key  = 0;
            for ( i = m - 1; i > 0; i-- ) {
                if ( Q[i] > Q[i - 1]) {
                    /*printf("before N[%d]:%d N[%d]:%d\n",i,  N[i], i-1, N[i-1]);*/
                    temp = Q[i];
                    Q[i] = Q[i - 1];
                    Q[i - 1] = temp;
                    temp = N[i];
                    N[i] = N[i - 1];
                    N[i - 1] = temp;
                    key++;
                    /*printf("after N[i]:%d N[i-1]:%d\n", N[i], N[i-1]);
                    printf("%d %d %d %d %d %d\n",Q[0], Q[1], Q[2], Q[3], Q[4], Q[5] );
                    for ( i = 0; i < m; i++ ) printf("%d ", N[i]); printf("\n\n");*/
                }
            }
        }
        /*printf("%d %d %d %d %d %da\n",Q[0], Q[1], Q[2], Q[3], Q[4], Q[5] );*/
        printf("%d", N[0]);
        for ( i = 1; i < m; i++ ) printf(" %d", N[i]); printf("\n");
        scanf("%d %d", &n, &m);
        if ( n == 0 && m == 0 ) O = 0;
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.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
	subq	$848, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -824(%rbp)
	leaq	-840(%rbp), %rdx
	leaq	-844(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L16:
	movl	$0, -828(%rbp)
	movl	$0, -836(%rbp)
	jmp	.L3
.L4:
	movl	-836(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	leal	1(%rax), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -836(%rbp)
.L3:
	movl	-840(%rbp), %eax
	cmpl	%eax, -836(%rbp)
	jl	.L4
	movl	$0, -836(%rbp)
	jmp	.L5
.L8:
	movl	$0, -832(%rbp)
	jmp	.L6
.L7:
	leaq	-848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-832(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-848(%rbp), %eax
	addl	%eax, %edx
	movl	-832(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	addl	$1, -832(%rbp)
.L6:
	movl	-840(%rbp), %eax
	cmpl	%eax, -832(%rbp)
	jl	.L7
	addl	$1, -836(%rbp)
.L5:
	movl	-844(%rbp), %eax
	cmpl	%eax, -836(%rbp)
	jl	.L8
	movl	$1, -828(%rbp)
	jmp	.L9
.L13:
	movl	$0, -828(%rbp)
	movl	-840(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -836(%rbp)
	jmp	.L10
.L12:
	movl	-836(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-836(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	%eax, -820(%rbp)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-820(%rbp), %edx
	movl	%edx, -816(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -820(%rbp)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-820(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -828(%rbp)
.L11:
	subl	$1, -836(%rbp)
.L10:
	cmpl	$0, -836(%rbp)
	jg	.L12
.L9:
	cmpl	$0, -828(%rbp)
	jne	.L13
	movl	-416(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -836(%rbp)
	jmp	.L14
.L15:
	movl	-836(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -836(%rbp)
.L14:
	movl	-840(%rbp), %eax
	cmpl	%eax, -836(%rbp)
	jl	.L15
	movl	$10, %edi
	call	putchar@PLT
	leaq	-840(%rbp), %rdx
	leaq	-844(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-844(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-840(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, -824(%rbp)
.L2:
	cmpl	$0, -824(%rbp)
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.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.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.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
	subq	$848, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -824(%rbp)
	leaq	-840(%rbp), %rdx
	leaq	-844(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L16:
	movl	$0, -828(%rbp)
	movl	$0, -836(%rbp)
	jmp	.L3
.L4:
	movl	-836(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	leal	1(%rax), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -836(%rbp)
.L3:
	movl	-840(%rbp), %eax
	cmpl	%eax, -836(%rbp)
	jl	.L4
	movl	$0, -836(%rbp)
	jmp	.L5
.L8:
	movl	$0, -832(%rbp)
	jmp	.L6
.L7:
	leaq	-848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-832(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-848(%rbp), %eax
	addl	%eax, %edx
	movl	-832(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	addl	$1, -832(%rbp)
.L6:
	movl	-840(%rbp), %eax
	cmpl	%eax, -832(%rbp)
	jl	.L7
	addl	$1, -836(%rbp)
.L5:
	movl	-844(%rbp), %eax
	cmpl	%eax, -836(%rbp)
	jl	.L8
	movl	$1, -828(%rbp)
	jmp	.L9
.L13:
	movl	$0, -828(%rbp)
	movl	-840(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -836(%rbp)
	jmp	.L10
.L12:
	movl	-836(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-836(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	%eax, -820(%rbp)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-820(%rbp), %edx
	movl	%edx, -816(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -820(%rbp)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-836(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-836(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-820(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -828(%rbp)
.L11:
	subl	$1, -836(%rbp)
.L10:
	cmpl	$0, -836(%rbp)
	jg	.L12
.L9:
	cmpl	$0, -828(%rbp)
	jne	.L13
	movl	-416(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -836(%rbp)
	jmp	.L14
.L15:
	movl	-836(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -836(%rbp)
.L14:
	movl	-840(%rbp), %eax
	cmpl	%eax, -836(%rbp)
	jl	.L15
	movl	$10, %edi
	call	putchar@PLT
	leaq	-840(%rbp), %rdx
	leaq	-844(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-844(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-840(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, -824(%rbp)
.L2:
	cmpl	$0, -824(%rbp)
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.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:
