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>

typedef struct{
  int v;
  int n;
}cand;

int c_cand(const void *a,const void *b){
  return (*(cand *)b).n-(*(cand *)a).n;
}
int main(){
  int i,j,k,n,m;
  cand c[100];
  do{
    scanf("%d %d",&n,&m);
    if(!n&&!m) break;
    for(i=0;i<m;i++){
      c[i].v=i+1;
      c[i].n=0;
    }
    for(i=0;i<n;i++){
      for(j=0;j<m-1;j++){
	scanf("%d ",&k);
	c[j].n+=k;
      }
      scanf("%d",&k);
      c[j].n+=k;
    }
    qsort(c,m,sizeof(cand),c_cand);
    for(i=0;i<m-1;i++) printf("%d ",c[i].v);
    printf("%d\n",c[i].v);
  }while(1);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c_cand
	.type	c_cand, @function
c_cand:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	c_cand, .-c_cand
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
.L14:
	leaq	-828(%rbp), %rdx
	leaq	-832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-832(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-828(%rbp), %eax
	testl	%eax, %eax
	je	.L18
.L4:
	movl	$0, -824(%rbp)
	jmp	.L6
.L7:
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,8)
	movl	-824(%rbp), %eax
	cltq
	movl	$0, -812(%rbp,%rax,8)
	addl	$1, -824(%rbp)
.L6:
	movl	-828(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L7
	movl	$0, -824(%rbp)
	jmp	.L8
.L11:
	movl	$0, -820(%rbp)
	jmp	.L9
.L10:
	leaq	-836(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-820(%rbp), %eax
	cltq
	movl	-812(%rbp,%rax,8), %edx
	movl	-836(%rbp), %eax
	addl	%eax, %edx
	movl	-820(%rbp), %eax
	cltq
	movl	%edx, -812(%rbp,%rax,8)
	addl	$1, -820(%rbp)
.L9:
	movl	-828(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -820(%rbp)
	jl	.L10
	leaq	-836(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-820(%rbp), %eax
	cltq
	movl	-812(%rbp,%rax,8), %edx
	movl	-836(%rbp), %eax
	addl	%eax, %edx
	movl	-820(%rbp), %eax
	cltq
	movl	%edx, -812(%rbp,%rax,8)
	addl	$1, -824(%rbp)
.L8:
	movl	-832(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L11
	movl	-828(%rbp), %esi
	leaq	-816(%rbp), %rax
	leaq	c_cand(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, -824(%rbp)
	jmp	.L12
.L13:
	movl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -824(%rbp)
.L12:
	movl	-828(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -824(%rbp)
	jl	.L13
	movl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	c_cand
	.type	c_cand, @function
c_cand:
.LFB23:
	.cfi_startproc
	endbr64
	movl	4(%rsi), %eax
	subl	4(%rdi), %eax
	ret
	.cfi_endproc
.LFE23:
	.size	c_cand, .-c_cand
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC4:
	.string	"%d "
.LC5:
	.string	"%d"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC5(%rip), %r14
	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
	leaq	.LC4(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$872, %rsp
	.cfi_def_cfa_offset 928
	movq	%fs:40, %rax
	movq	%rax, 856(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L21:
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %edi
	movl	44(%rsp), %esi
	testl	%edi, %edi
	je	.L4
	testl	%esi, %esi
	jle	.L34
.L5:
	testl	%esi, %esi
	movl	$1, %ecx
	cmovg	%esi, %ecx
	cmpl	$3, %esi
	jle	.L23
	movl	%ecx, %edx
	movdqa	.LC0(%rip), %xmm1
	leaq	48(%rsp), %rax
	shrl	$2, %edx
	movq	%rax, 8(%rsp)
	pxor	%xmm2, %xmm2
	subl	$1, %edx
	salq	$5, %rdx
	leaq	80(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm1, %xmm0
	paddd	.LC3(%rip), %xmm0
	addq	$32, %rax
	paddd	.LC2(%rip), %xmm1
	movdqa	%xmm0, %xmm3
	punpckhdq	%xmm2, %xmm0
	punpckldq	%xmm2, %xmm3
	movaps	%xmm0, -16(%rax)
	movaps	%xmm3, -32(%rax)
	cmpq	%rdx, %rax
	jne	.L10
	movl	%ecx, %edx
	andl	$-4, %edx
	andl	$3, %ecx
	je	.L6
.L9:
	movslq	%edx, %rcx
	leal	1(%rdx), %eax
	movl	%eax, 48(%rsp,%rcx,8)
	movl	$0, 52(%rsp,%rcx,8)
	cmpl	%esi, %eax
	jge	.L6
	cltq
	leal	2(%rdx), %ecx
	movl	%ecx, 48(%rsp,%rax,8)
	movl	$0, 52(%rsp,%rax,8)
	cmpl	%ecx, %esi
	jle	.L6
	movslq	%ecx, %rcx
	addl	$3, %edx
	movl	%edx, 48(%rsp,%rcx,8)
	movl	$0, 52(%rsp,%rcx,8)
.L6:
	xorl	%r13d, %r13d
	leaq	36(%rsp), %rbx
	testl	%edi, %edi
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	52(%rsp), %r12
	xorl	%r15d, %r15d
	cmpl	$1, %esi
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	addl	%eax, (%r12)
	addq	$8, %r12
	movl	44(%rsp), %eax
	subl	$1, %eax
	cmpl	%r15d, %eax
	jg	.L15
.L18:
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	%r15d, %rcx
	movl	36(%rsp), %eax
	movl	44(%rsp), %esi
	addl	%eax, 52(%rsp,%rcx,8)
	cmpl	%r13d, 40(%rsp)
	jg	.L13
.L14:
	movq	8(%rsp), %r12
	xorl	%eax, %eax
	leaq	c_cand(%rip), %rcx
	xorl	%ebx, %ebx
	movl	$8, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	cmpl	$1, 44(%rsp)
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%r12), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %ebx
	addq	$8, %r12
	call	__printf_chk@PLT
	movl	44(%rsp), %eax
	subl	$1, %eax
	cmpl	%ebx, %eax
	jg	.L20
.L19:
	movslq	%ebx, %rbx
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	48(%rsp,%rbx,8), %edx
	call	__printf_chk@PLT
	jmp	.L21
.L4:
	testl	%esi, %esi
	je	.L35
	jg	.L5
	leaq	48(%rsp), %rax
	movq	%rax, 8(%rsp)
	jmp	.L14
.L23:
	leaq	48(%rsp), %rax
	xorl	%edx, %edx
	movq	%rax, 8(%rsp)
	jmp	.L9
.L35:
	movq	856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$872, %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
.L34:
	.cfi_restore_state
	leaq	48(%rsp), %rax
	movq	%rax, 8(%rsp)
	jmp	.L6
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	c_cand
	.type	c_cand, @function
c_cand:
.LFB23:
	.cfi_startproc
	endbr64
	movl	4(%rsi), %eax
	subl	4(%rdi), %eax
	ret
	.cfi_endproc
.LFE23:
	.size	c_cand, .-c_cand
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC4:
	.string	"%d "
.LC5:
	.string	"%d"
.LC6:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC5(%rip), %r14
	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
	leaq	.LC4(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$872, %rsp
	.cfi_def_cfa_offset 928
	movq	%fs:40, %rax
	movq	%rax, 856(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L21:
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %edi
	movl	44(%rsp), %esi
	testl	%edi, %edi
	je	.L4
	testl	%esi, %esi
	jle	.L34
.L5:
	testl	%esi, %esi
	movl	$1, %ecx
	cmovg	%esi, %ecx
	cmpl	$3, %esi
	jle	.L23
	movl	%ecx, %edx
	movdqa	.LC0(%rip), %xmm1
	leaq	48(%rsp), %rax
	shrl	$2, %edx
	movq	%rax, 8(%rsp)
	pxor	%xmm2, %xmm2
	subl	$1, %edx
	salq	$5, %rdx
	leaq	80(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	movdqa	%xmm1, %xmm0
	paddd	.LC3(%rip), %xmm0
	addq	$32, %rax
	paddd	.LC2(%rip), %xmm1
	movdqa	%xmm0, %xmm3
	punpckhdq	%xmm2, %xmm0
	punpckldq	%xmm2, %xmm3
	movaps	%xmm0, -16(%rax)
	movaps	%xmm3, -32(%rax)
	cmpq	%rdx, %rax
	jne	.L10
	movl	%ecx, %edx
	andl	$-4, %edx
	andl	$3, %ecx
	je	.L6
.L9:
	movslq	%edx, %rcx
	leal	1(%rdx), %eax
	movl	%eax, 48(%rsp,%rcx,8)
	movl	$0, 52(%rsp,%rcx,8)
	cmpl	%esi, %eax
	jge	.L6
	cltq
	leal	2(%rdx), %ecx
	movl	%ecx, 48(%rsp,%rax,8)
	movl	$0, 52(%rsp,%rax,8)
	cmpl	%ecx, %esi
	jle	.L6
	movslq	%ecx, %rcx
	addl	$3, %edx
	movl	%edx, 48(%rsp,%rcx,8)
	movl	$0, 52(%rsp,%rcx,8)
.L6:
	xorl	%r13d, %r13d
	leaq	36(%rsp), %rbx
	testl	%edi, %edi
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	52(%rsp), %r12
	xorl	%r15d, %r15d
	cmpl	$1, %esi
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	addl	%eax, (%r12)
	addq	$8, %r12
	movl	44(%rsp), %eax
	subl	$1, %eax
	cmpl	%r15d, %eax
	jg	.L15
.L18:
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	%r15d, %rcx
	movl	36(%rsp), %eax
	movl	44(%rsp), %esi
	addl	%eax, 52(%rsp,%rcx,8)
	cmpl	%r13d, 40(%rsp)
	jg	.L13
.L14:
	movq	8(%rsp), %r12
	xorl	%eax, %eax
	leaq	c_cand(%rip), %rcx
	xorl	%ebx, %ebx
	movl	$8, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	cmpl	$1, 44(%rsp)
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%r12), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %ebx
	addq	$8, %r12
	call	__printf_chk@PLT
	movl	44(%rsp), %eax
	subl	$1, %eax
	cmpl	%ebx, %eax
	jg	.L20
.L19:
	movslq	%ebx, %rbx
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	48(%rsp,%rbx,8), %edx
	call	__printf_chk@PLT
	jmp	.L21
.L4:
	testl	%esi, %esi
	je	.L35
	jg	.L5
	leaq	48(%rsp), %rax
	movq	%rax, 8(%rsp)
	jmp	.L14
.L23:
	leaq	48(%rsp), %rax
	xorl	%edx, %edx
	movq	%rax, 8(%rsp)
	jmp	.L9
.L35:
	movq	856(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$872, %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
.L34:
	.cfi_restore_state
	leaq	48(%rsp), %rax
	movq	%rax, 8(%rsp)
	jmp	.L6
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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>

typedef struct{
  int v;
  int n;
}cand;

int c_cand(const void *a,const void *b){
  return (*(cand *)b).n-(*(cand *)a).n;
}
int main(){
  int i,j,k,n,m;
  cand c[100];
  do{
    scanf("%d %d",&n,&m);
    if(!n&&!m) break;
    for(i=0;i<m;i++){
      c[i].v=i+1;
      c[i].n=0;
    }
    for(i=0;i<n;i++){
      for(j=0;j<m-1;j++){
	scanf("%d ",&k);
	c[j].n+=k;
      }
      scanf("%d",&k);
      c[j].n+=k;
    }
    qsort(c,m,sizeof(cand),c_cand);
    for(i=0;i<m-1;i++) printf("%d ",c[i].v);
    printf("%d\n",c[i].v);
  }while(1);
  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>

typedef struct{
  int v;
  int n;
}cand;

int c_cand(const void *a,const void *b){
  return (*(cand *)b).n-(*(cand *)a).n;
}
int main(){
  int i,j,k,n,m;
  cand c[100];
  do{
    scanf("%d %d",&n,&m);
    if(!n&&!m) break;
    for(i=0;i<m;i++){
      c[i].v=i+1;
      c[i].n=0;
    }
    for(i=0;i<n;i++){
      for(j=0;j<m-1;j++){
	scanf("%d ",&k);
	c[j].n+=k;
      }
      scanf("%d",&k);
      c[j].n+=k;
    }
    qsort(c,m,sizeof(cand),c_cand);
    for(i=0;i<m-1;i++) printf("%d ",c[i].v);
    printf("%d\n",c[i].v);
  }while(1);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c_cand
	.type	c_cand, @function
c_cand:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	c_cand, .-c_cand
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
.L14:
	leaq	-828(%rbp), %rdx
	leaq	-832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-832(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-828(%rbp), %eax
	testl	%eax, %eax
	je	.L18
.L4:
	movl	$0, -824(%rbp)
	jmp	.L6
.L7:
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,8)
	movl	-824(%rbp), %eax
	cltq
	movl	$0, -812(%rbp,%rax,8)
	addl	$1, -824(%rbp)
.L6:
	movl	-828(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L7
	movl	$0, -824(%rbp)
	jmp	.L8
.L11:
	movl	$0, -820(%rbp)
	jmp	.L9
.L10:
	leaq	-836(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-820(%rbp), %eax
	cltq
	movl	-812(%rbp,%rax,8), %edx
	movl	-836(%rbp), %eax
	addl	%eax, %edx
	movl	-820(%rbp), %eax
	cltq
	movl	%edx, -812(%rbp,%rax,8)
	addl	$1, -820(%rbp)
.L9:
	movl	-828(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -820(%rbp)
	jl	.L10
	leaq	-836(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-820(%rbp), %eax
	cltq
	movl	-812(%rbp,%rax,8), %edx
	movl	-836(%rbp), %eax
	addl	%eax, %edx
	movl	-820(%rbp), %eax
	cltq
	movl	%edx, -812(%rbp,%rax,8)
	addl	$1, -824(%rbp)
.L8:
	movl	-832(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L11
	movl	-828(%rbp), %esi
	leaq	-816(%rbp), %rax
	leaq	c_cand(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, -824(%rbp)
	jmp	.L12
.L13:
	movl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -824(%rbp)
.L12:
	movl	-828(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -824(%rbp)
	jl	.L13
	movl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	c_cand
	.type	c_cand, @function
c_cand:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	4(%rax), %edx
	movq	-8(%rbp), %rax
	movl	4(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	c_cand, .-c_cand
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
.L14:
	leaq	-828(%rbp), %rdx
	leaq	-832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-832(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	-828(%rbp), %eax
	testl	%eax, %eax
	je	.L18
.L4:
	movl	$0, -824(%rbp)
	jmp	.L6
.L7:
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,8)
	movl	-824(%rbp), %eax
	cltq
	movl	$0, -812(%rbp,%rax,8)
	addl	$1, -824(%rbp)
.L6:
	movl	-828(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L7
	movl	$0, -824(%rbp)
	jmp	.L8
.L11:
	movl	$0, -820(%rbp)
	jmp	.L9
.L10:
	leaq	-836(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-820(%rbp), %eax
	cltq
	movl	-812(%rbp,%rax,8), %edx
	movl	-836(%rbp), %eax
	addl	%eax, %edx
	movl	-820(%rbp), %eax
	cltq
	movl	%edx, -812(%rbp,%rax,8)
	addl	$1, -820(%rbp)
.L9:
	movl	-828(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -820(%rbp)
	jl	.L10
	leaq	-836(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-820(%rbp), %eax
	cltq
	movl	-812(%rbp,%rax,8), %edx
	movl	-836(%rbp), %eax
	addl	%eax, %edx
	movl	-820(%rbp), %eax
	cltq
	movl	%edx, -812(%rbp,%rax,8)
	addl	$1, -824(%rbp)
.L8:
	movl	-832(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L11
	movl	-828(%rbp), %esi
	leaq	-816(%rbp), %rax
	leaq	c_cand(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, -824(%rbp)
	jmp	.L12
.L13:
	movl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -824(%rbp)
.L12:
	movl	-828(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -824(%rbp)
	jl	.L13
	movl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L18:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
