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(){
int a[101],b,c,i,j,d;
scanf("%d %d\n",&b,&c);
for(i=0;i<b;i++){
scanf("%d\n",&a[i]);
}
for(i=1;i<c+1;i++){
for(j=0;j<b-1;j++){
if(a[j]%i>a[j+1]%i){
d=a[j];
a[j]=a[j+1];
a[j+1]=d;
}
}
}
for(i=0;i<b;i++){
printf("%d\n",a[i]);
}
return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d\n"
	.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	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-432(%rbp), %rdx
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -428(%rbp)
	jmp	.L2
.L3:
	leaq	-416(%rbp), %rdx
	movl	-428(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -428(%rbp)
.L2:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L3
	movl	$1, -428(%rbp)
	jmp	.L4
.L8:
	movl	$0, -424(%rbp)
	jmp	.L5
.L7:
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cltd
	idivl	-428(%rbp)
	movl	%edx, %ecx
	movl	-424(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cltd
	idivl	-428(%rbp)
	movl	%edx, %eax
	cmpl	%eax, %ecx
	jle	.L6
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-424(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-424(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-424(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
.L6:
	addl	$1, -424(%rbp)
.L5:
	movl	-436(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -424(%rbp)
	jl	.L7
	addl	$1, -428(%rbp)
.L4:
	movl	-432(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jle	.L8
	movl	$0, -428(%rbp)
	jmp	.L9
.L10:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -428(%rbp)
.L9:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbx
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	addq	$4, %r13
	cmpl	%r12d, %r9d
	jg	.L3
	movl	12(%rsp), %r10d
	testl	%r10d, %r10d
	jle	.L4
	cmpl	$1, %r9d
	jle	.L4
	leal	-2(%r9), %eax
	movl	$1, %esi
	leaq	20(%rsp,%rax,4), %r8
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rcx), %eax
	movq	(%rcx), %xmm0
	cltd
	pshufd	$0xe5, %xmm0, %xmm2
	pshufd	$225, %xmm0, %xmm1
	idivl	%esi
	movd	%xmm2, %eax
	movl	%edx, %edi
	cltd
	idivl	%esi
	cmpl	%edx, %edi
	jle	.L7
	movq	%xmm1, (%rcx)
.L7:
	addq	$4, %rcx
	cmpq	%r8, %rcx
	jne	.L8
	addl	$1, %esi
	cmpl	%r10d, %esi
	jle	.L6
.L4:
	testl	%r9d, %r9d
	jle	.L2
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L9:
	movl	0(%rbp,%r12,4), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r12
	call	__printf_chk@PLT
	cmpl	%r12d, 8(%rsp)
	jg	.L9
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L19:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.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\n"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbx
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r9d
	addq	$4, %r13
	cmpl	%r12d, %r9d
	jg	.L3
	movl	12(%rsp), %r10d
	testl	%r10d, %r10d
	jle	.L4
	cmpl	$1, %r9d
	jle	.L4
	leal	-2(%r9), %eax
	movl	$1, %esi
	leaq	20(%rsp,%rax,4), %r8
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rcx), %eax
	movq	(%rcx), %xmm0
	cltd
	pshufd	$0xe5, %xmm0, %xmm2
	pshufd	$225, %xmm0, %xmm1
	idivl	%esi
	movd	%xmm2, %eax
	movl	%edx, %edi
	cltd
	idivl	%esi
	cmpl	%edx, %edi
	jle	.L7
	movq	%xmm1, (%rcx)
.L7:
	addq	$4, %rcx
	cmpq	%r8, %rcx
	jne	.L8
	addl	$1, %esi
	cmpl	%r10d, %esi
	jle	.L6
.L4:
	testl	%r9d, %r9d
	jle	.L2
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L9:
	movl	0(%rbp,%r12,4), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r12
	call	__printf_chk@PLT
	cmpl	%r12d, 8(%rsp)
	jg	.L9
.L2:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L19:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.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(){
int a[101],b,c,i,j,d;
scanf("%d %d\n",&b,&c);
for(i=0;i<b;i++){
scanf("%d\n",&a[i]);
}
for(i=1;i<c+1;i++){
for(j=0;j<b-1;j++){
if(a[j]%i>a[j+1]%i){
d=a[j];
a[j]=a[j+1];
a[j+1]=d;
}
}
}
for(i=0;i<b;i++){
printf("%d\n",a[i]);
}
return 0;
}


6 4
3
2
11
3
1
5
 6 4
3
0
11
3
1
5
 1 4
3
0
11
3
1
5
 1 8
5
0
4
2
2
9
 6 4
3
2
8
0
1
5
 6 4
3
2
11
0
1
5
 6 4
3
0
11
3
0
5
 2 4
3
0
11
3
1
5
 1 4
2
0
11
2
2
9
 6 4
3
2
4
0
1
5

2
3
1
3
5
11
 0
3
1
3
5
11
 3
 5
 0
2
1
8
5
3
 0
2
1
3
5
11
 0
0
3
3
5
11
 0
3
 2
 4
0
1
2
5
3

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(){
int a[101],b,c,i,j,d;
scanf("%d %d\n",&b,&c);
for(i=0;i<b;i++){
scanf("%d\n",&a[i]);
}
for(i=1;i<c+1;i++){
for(j=0;j<b-1;j++){
if(a[j]%i>a[j+1]%i){
d=a[j];
a[j]=a[j+1];
a[j+1]=d;
}
}
}
for(i=0;i<b;i++){
printf("%d\n",a[i]);
}
return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d\n"
	.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	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-432(%rbp), %rdx
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -428(%rbp)
	jmp	.L2
.L3:
	leaq	-416(%rbp), %rdx
	movl	-428(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -428(%rbp)
.L2:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L3
	movl	$1, -428(%rbp)
	jmp	.L4
.L8:
	movl	$0, -424(%rbp)
	jmp	.L5
.L7:
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cltd
	idivl	-428(%rbp)
	movl	%edx, %ecx
	movl	-424(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cltd
	idivl	-428(%rbp)
	movl	%edx, %eax
	cmpl	%eax, %ecx
	jle	.L6
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-424(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-424(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-424(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
.L6:
	addl	$1, -424(%rbp)
.L5:
	movl	-436(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -424(%rbp)
	jl	.L7
	addl	$1, -428(%rbp)
.L4:
	movl	-432(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jle	.L8
	movl	$0, -428(%rbp)
	jmp	.L9
.L10:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -428(%rbp)
.L9:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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\n"
.LC1:
	.string	"%d\n"
	.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	$448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-432(%rbp), %rdx
	leaq	-436(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -428(%rbp)
	jmp	.L2
.L3:
	leaq	-416(%rbp), %rdx
	movl	-428(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -428(%rbp)
.L2:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L3
	movl	$1, -428(%rbp)
	jmp	.L4
.L8:
	movl	$0, -424(%rbp)
	jmp	.L5
.L7:
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cltd
	idivl	-428(%rbp)
	movl	%edx, %ecx
	movl	-424(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cltd
	idivl	-428(%rbp)
	movl	%edx, %eax
	cmpl	%eax, %ecx
	jle	.L6
	movl	-424(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -420(%rbp)
	movl	-424(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-424(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	movl	-424(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-420(%rbp), %edx
	movl	%edx, -416(%rbp,%rax,4)
.L6:
	addl	$1, -424(%rbp)
.L5:
	movl	-436(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -424(%rbp)
	jl	.L7
	addl	$1, -428(%rbp)
.L4:
	movl	-432(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jle	.L8
	movl	$0, -428(%rbp)
	jmp	.L9
.L10:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -428(%rbp)
.L9:
	movl	-436(%rbp), %eax
	cmpl	%eax, -428(%rbp)
	jl	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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:
