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

```c
#include<stdio.h>
#include<stdlib.h>

int insertionSort(int *a, int n, int g){
	int cnt = 0, i, j, key;

	for(i = g; i < n; i++){
		key = a[i];
		j = i - g;
		while( j >= 0 && a[j] > key){
			a[j + g] = a[j];
			j -= g;
			cnt++;
		}
		a[j+g] = key;
	}

	return cnt;
}

 int shellSort(int *a, int n){
 	int cnt = 0;
 	int h = 1, m = 1, i;
 	int G[1000];

 	G[0] = 1;
 	i = 1;
 	while(h < n / 3){
		h = 3 * h + 1;
		G[i] = h;
		i++;
		m++;
 	}
 	printf("%d\n", m);

 	//G[] output
 	for(i = m - 1; i >= 0; i--){
 		printf("%d", G[i]);
 		(i != 0) ? printf(" ") : printf("\n");
 	}

 	for(i = m-1; i >= 0; i--)
 		cnt += insertionSort(a, n, G[i]);
 	
 	return cnt;
}


int main(){
	int n, i, cnt = 0;
	int *a;

	scanf("%d", &n);
	a = (int*)calloc(n, sizeof(int));
	for(i = 0; i < n; i++){
		scanf("%d", &a[i]);
	}
	cnt = shellSort(a, n);
	printf("%d\n", cnt);

	for(i = 0; i < n; i++)
		(i != n-1) ? printf("%d\n", a[i]): printf("%d", a[i]);

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$0, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-8(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-32(%rbp), %eax
	subl	%eax, -8(%rbp)
	addl	$1, -16(%rbp)
.L3:
	cmpl	$0, -8(%rbp)
	js	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L5
.L4:
	movl	-8(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L6
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	insertionSort, .-insertionSort
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
.LC2:
	.string	" "
.LC3:
	.string	"\n"
	.text
	.globl	shellSort
	.type	shellSort, @function
shellSort:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4048, %rsp
	movq	%rdi, -4040(%rbp)
	movl	%esi, -4044(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4032(%rbp)
	movl	$1, -4028(%rbp)
	movl	$1, -4024(%rbp)
	movl	$1, -4016(%rbp)
	movl	$1, -4020(%rbp)
	jmp	.L9
.L10:
	movl	-4028(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	addl	$1, %eax
	movl	%eax, -4028(%rbp)
	movl	-4020(%rbp), %eax
	cltq
	movl	-4028(%rbp), %edx
	movl	%edx, -4016(%rbp,%rax,4)
	addl	$1, -4020(%rbp)
	addl	$1, -4024(%rbp)
.L9:
	movl	-4044(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%eax, -4028(%rbp)
	jl	.L10
	movl	-4024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-4024(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4020(%rbp)
	jmp	.L11
.L14:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	cmpl	$0, -4020(%rbp)
	je	.L12
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	subl	$1, -4020(%rbp)
.L11:
	cmpl	$0, -4020(%rbp)
	jns	.L14
	movl	-4024(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4020(%rbp)
	jmp	.L15
.L16:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-4044(%rbp), %ecx
	movq	-4040(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	insertionSort
	addl	%eax, -4032(%rbp)
	subl	$1, -4020(%rbp)
.L15:
	cmpl	$0, -4020(%rbp)
	jns	.L16
	movl	-4032(%rbp), %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
.LFE7:
	.size	shellSort, .-shellSort
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -20(%rbp)
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L20
.L21:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L20:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movl	-28(%rbp), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	shellSort
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -24(%rbp)
	jmp	.L22
.L25:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -24(%rbp)
	je	.L23
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L24
.L23:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L24:
	addl	$1, -24(%rbp)
.L22:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edx
	jge	.L7
	movslq	%edx, %r9
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%esi, %r12d
	xorl	%r10d, %r10d
	salq	$2, %r9
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	subl	%edx, %r12d
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	(%rdi,%r9), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rax
	movl	(%rbx), %r11d
	movl	%ebp, %edi
	movq	%rbx, %rcx
	subq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movl	(%rax), %r8d
	movq	%rax, %rsi
	cmpl	%r11d, %r8d
	jle	.L14
	movl	%r8d, (%rcx)
	addl	$1, %r10d
	subq	%r9, %rcx
	subq	%r9, %rax
	subl	%edx, %edi
	jns	.L3
	addl	$1, %ebp
	movl	%r11d, (%rsi)
	addq	$4, %rbx
	cmpl	%r12d, %ebp
	jne	.L6
.L15:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r10d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movq	%rcx, %rsi
	addl	$1, %ebp
	addq	$4, %rbx
	movl	%r11d, (%rsi)
	cmpl	%r12d, %ebp
	jne	.L6
	jmp	.L15
.L7:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	insertionSort, .-insertionSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.p2align 4
	.globl	shellSort
	.type	shellSort, @function
shellSort:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rsi
	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
	movq	%rsi, %rbx
	imulq	$1431655766, %rsi, %rsi
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4096
	shrq	$32, %rsi
	movq	%rdi, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	movl	%ebx, %eax
	movl	$1, 16(%rsp)
	sarl	$31, %eax
	subl	%eax, %esi
	cmpl	$5, %ebx
	jle	.L29
	leaq	20(%rsp), %rcx
	movl	$1, %edx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L18:
	leal	1(%rax,%rax,2), %eax
	movslq	%edx, %r12
	addq	$4, %rcx
	addl	$1, %edx
	movl	%eax, -4(%rcx)
	cmpl	%eax, %esi
	jg	.L18
.L17:
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r12, %rbp
	leaq	.LC0(%rip), %rsi
	leaq	.LC1(%rip), %r14
	call	__printf_chk@PLT
	jmp	.L21
.L37:
	movl	$32, %edi
	subq	$1, %rbp
	call	putchar@PLT
	cmpl	$-1, %ebp
	je	.L36
.L21:
	movl	0(%r13,%rbp,4), %edx
	xorl	%eax, %eax
	movq	%r14, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	testl	%ebp, %ebp
	jne	.L37
	movl	$10, %edi
	subq	$1, %rbp
	call	putchar@PLT
	cmpl	$-1, %ebp
	jne	.L21
.L36:
	leaq	12(%rsp), %rax
	leaq	0(%r13,%r12,4), %r14
	xorl	%r15d, %r15d
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L27:
	movl	(%r14), %r8d
	cmpl	%ebx, %r8d
	jge	.L22
	movq	8(%rsp), %rax
	movslq	%r8d, %rdi
	movl	%ebx, %r13d
	xorl	%r12d, %r12d
	salq	$2, %rdi
	subl	%r8d, %r13d
	xorl	%r9d, %r9d
	leaq	(%rax,%rdi), %rbp
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%rbp, %rax
	movl	0(%rbp), %r10d
	movl	%r12d, %ecx
	movq	%rbp, %rdx
	subq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rax), %esi
	movq	%rax, %r11
	cmpl	%esi, %r10d
	jge	.L38
	movl	%esi, (%rdx)
	addl	$1, %r9d
	subq	%rdi, %rdx
	subq	%rdi, %rax
	subl	%r8d, %ecx
	jns	.L23
	addl	$1, %r12d
	movl	%r10d, (%r11)
	addq	$4, %rbp
	cmpl	%r12d, %r13d
	jne	.L26
.L40:
	addl	%r9d, %r15d
.L22:
	subq	$4, %r14
	cmpq	%r14, (%rsp)
	jne	.L27
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$4040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r15d, %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
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	movq	%rdx, %r11
	addl	$1, %r12d
	addq	$4, %rbp
	movl	%r10d, (%r11)
	cmpl	%r12d, %r13d
	jne	.L26
	jmp	.L40
.L29:
	xorl	%r12d, %r12d
	movl	$1, %edx
	jmp	.L17
.L39:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	shellSort, .-shellSort
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movl	$4, %esi
	movq	%rdi, %r14
	call	calloc@PLT
	movq	%rax, %rbp
	testl	%r14d, %r14d
	jle	.L42
	movq	%rax, %r13
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r14d
	addq	$4, %r13
	cmpl	%ebx, %r14d
	jg	.L43
.L42:
	movl	%r14d, %esi
	movq	%rbp, %rdi
	leaq	.LC0(%rip), %r13
	xorl	%ebx, %ebx
	call	shellSort
	movq	%r13, %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L47
	.p2align 4,,10
	.p2align 3
.L44:
	subl	$1, %eax
	movl	0(%rbp,%rbx,4), %edx
	movq	%r13, %rsi
	cmpl	%ebx, %eax
	jne	.L55
	movq	%r12, %rsi
.L55:
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	movl	4(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L44
.L47:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L56:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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
	.p2align 4
	.globl	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edx
	jge	.L7
	movslq	%edx, %r9
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	%esi, %r12d
	xorl	%r10d, %r10d
	salq	$2, %r9
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	subl	%edx, %r12d
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	(%rdi,%r9), %rbx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rax
	movl	(%rbx), %r11d
	movl	%ebp, %edi
	movq	%rbx, %rcx
	subq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movl	(%rax), %r8d
	movq	%rax, %rsi
	cmpl	%r11d, %r8d
	jle	.L14
	movl	%r8d, (%rcx)
	addl	$1, %r10d
	subq	%r9, %rcx
	subq	%r9, %rax
	subl	%edx, %edi
	jns	.L3
	addl	$1, %ebp
	movl	%r11d, (%rsi)
	addq	$4, %rbx
	cmpl	%r12d, %ebp
	jne	.L6
.L15:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r10d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movq	%rcx, %rsi
	addl	$1, %ebp
	addq	$4, %rbx
	movl	%r11d, (%rsi)
	cmpl	%r12d, %ebp
	jne	.L6
	jmp	.L15
.L7:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	insertionSort, .-insertionSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.p2align 4
	.globl	shellSort
	.type	shellSort, @function
shellSort:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%esi, %rsi
	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
	movq	%rsi, %rbx
	imulq	$1431655766, %rsi, %rsi
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4096
	shrq	$32, %rsi
	movq	%rdi, 8(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	movl	%ebx, %eax
	movl	$1, 16(%rsp)
	sarl	$31, %eax
	subl	%eax, %esi
	cmpl	$5, %ebx
	jle	.L29
	leaq	20(%rsp), %rcx
	movl	$1, %edx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L18:
	leal	1(%rax,%rax,2), %eax
	movslq	%edx, %r12
	addq	$4, %rcx
	addl	$1, %edx
	movl	%eax, -4(%rcx)
	cmpl	%eax, %esi
	jg	.L18
.L17:
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r12, %rbp
	leaq	.LC0(%rip), %rsi
	leaq	.LC1(%rip), %r14
	call	__printf_chk@PLT
	jmp	.L21
.L37:
	movl	$32, %edi
	subq	$1, %rbp
	call	putchar@PLT
	cmpl	$-1, %ebp
	je	.L36
.L21:
	movl	0(%r13,%rbp,4), %edx
	xorl	%eax, %eax
	movq	%r14, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	testl	%ebp, %ebp
	jne	.L37
	movl	$10, %edi
	subq	$1, %rbp
	call	putchar@PLT
	cmpl	$-1, %ebp
	jne	.L21
.L36:
	leaq	12(%rsp), %rax
	leaq	0(%r13,%r12,4), %r14
	xorl	%r15d, %r15d
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L27:
	movl	(%r14), %r8d
	cmpl	%ebx, %r8d
	jge	.L22
	movq	8(%rsp), %rax
	movslq	%r8d, %rdi
	movl	%ebx, %r13d
	xorl	%r12d, %r12d
	salq	$2, %rdi
	subl	%r8d, %r13d
	xorl	%r9d, %r9d
	leaq	(%rax,%rdi), %rbp
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%rbp, %rax
	movl	0(%rbp), %r10d
	movl	%r12d, %ecx
	movq	%rbp, %rdx
	subq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rax), %esi
	movq	%rax, %r11
	cmpl	%esi, %r10d
	jge	.L38
	movl	%esi, (%rdx)
	addl	$1, %r9d
	subq	%rdi, %rdx
	subq	%rdi, %rax
	subl	%r8d, %ecx
	jns	.L23
	addl	$1, %r12d
	movl	%r10d, (%r11)
	addq	$4, %rbp
	cmpl	%r12d, %r13d
	jne	.L26
.L40:
	addl	%r9d, %r15d
.L22:
	subq	$4, %r14
	cmpq	%r14, (%rsp)
	jne	.L27
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$4040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r15d, %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
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	movq	%rdx, %r11
	addl	$1, %r12d
	addq	$4, %rbp
	movl	%r10d, (%r11)
	cmpl	%r12d, %r13d
	jne	.L26
	jmp	.L40
.L29:
	xorl	%r12d, %r12d
	movl	$1, %edx
	jmp	.L17
.L39:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	shellSort, .-shellSort
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movl	$4, %esi
	movq	%rdi, %r14
	call	calloc@PLT
	movq	%rax, %rbp
	testl	%r14d, %r14d
	jle	.L42
	movq	%rax, %r13
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r14d
	addq	$4, %r13
	cmpl	%ebx, %r14d
	jg	.L43
.L42:
	movl	%r14d, %esi
	movq	%rbp, %rdi
	leaq	.LC0(%rip), %r13
	xorl	%ebx, %ebx
	call	shellSort
	movq	%r13, %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L47
	.p2align 4,,10
	.p2align 3
.L44:
	subl	$1, %eax
	movl	0(%rbp,%rbx,4), %edx
	movq	%r13, %rsi
	cmpl	%ebx, %eax
	jne	.L55
	movq	%r12, %rsi
.L55:
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	movl	4(%rsp), %eax
	cmpl	%ebx, %eax
	jg	.L44
.L47:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L56:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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>
#include<stdlib.h>

int insertionSort(int *a, int n, int g){
	int cnt = 0, i, j, key;

	for(i = g; i < n; i++){
		key = a[i];
		j = i - g;
		while( j >= 0 && a[j] > key){
			a[j + g] = a[j];
			j -= g;
			cnt++;
		}
		a[j+g] = key;
	}

	return cnt;
}

 int shellSort(int *a, int n){
 	int cnt = 0;
 	int h = 1, m = 1, i;
 	int G[1000];

 	G[0] = 1;
 	i = 1;
 	while(h < n / 3){
		h = 3 * h + 1;
		G[i] = h;
		i++;
		m++;
 	}
 	printf("%d\n", m);

 	//G[] output
 	for(i = m - 1; i >= 0; i--){
 		printf("%d", G[i]);
 		(i != 0) ? printf(" ") : printf("\n");
 	}

 	for(i = m-1; i >= 0; i--)
 		cnt += insertionSort(a, n, G[i]);
 	
 	return cnt;
}


int main(){
	int n, i, cnt = 0;
	int *a;

	scanf("%d", &n);
	a = (int*)calloc(n, sizeof(int));
	for(i = 0; i < n; i++){
		scanf("%d", &a[i]);
	}
	cnt = shellSort(a, n);
	printf("%d\n", cnt);

	for(i = 0; i < n; i++)
		(i != n-1) ? printf("%d\n", a[i]): printf("%d", a[i]);

	return 0;
}
5
5
1
4
5
2
 3
6
2
1
 5
6
1
4
5
2
 3
0
2
1
 5
6
1
4
9
2
 3
-1
2
1
 5
6
1
4
6
2
 3
0
2
0
 5
5
1
4
9
2
 3
0
1
0

1
1
5
1
2
4
5
5 1
1
3
1
2
6 1
1
6
1
2
4
5
6 1
1
1
0
1
2 1
1
5
1
2
4
6
9 1
1
1
-1
1
2 1
1
5
1
2
4
6
6 1
1
1
0
0
2 1
1
5
1
2
4
5
9 1
1
1
0
0
1
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>

int insertionSort(int *a, int n, int g){
	int cnt = 0, i, j, key;

	for(i = g; i < n; i++){
		key = a[i];
		j = i - g;
		while( j >= 0 && a[j] > key){
			a[j + g] = a[j];
			j -= g;
			cnt++;
		}
		a[j+g] = key;
	}

	return cnt;
}

 int shellSort(int *a, int n){
 	int cnt = 0;
 	int h = 1, m = 1, i;
 	int G[1000];

 	G[0] = 1;
 	i = 1;
 	while(h < n / 3){
		h = 3 * h + 1;
		G[i] = h;
		i++;
		m++;
 	}
 	printf("%d\n", m);

 	//G[] output
 	for(i = m - 1; i >= 0; i--){
 		printf("%d", G[i]);
 		(i != 0) ? printf(" ") : printf("\n");
 	}

 	for(i = m-1; i >= 0; i--)
 		cnt += insertionSort(a, n, G[i]);
 	
 	return cnt;
}


int main(){
	int n, i, cnt = 0;
	int *a;

	scanf("%d", &n);
	a = (int*)calloc(n, sizeof(int));
	for(i = 0; i < n; i++){
		scanf("%d", &a[i]);
	}
	cnt = shellSort(a, n);
	printf("%d\n", cnt);

	for(i = 0; i < n; i++)
		(i != n-1) ? printf("%d\n", a[i]): printf("%d", a[i]);

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$0, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-8(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-32(%rbp), %eax
	subl	%eax, -8(%rbp)
	addl	$1, -16(%rbp)
.L3:
	cmpl	$0, -8(%rbp)
	js	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L5
.L4:
	movl	-8(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L6
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	insertionSort, .-insertionSort
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
.LC2:
	.string	" "
.LC3:
	.string	"\n"
	.text
	.globl	shellSort
	.type	shellSort, @function
shellSort:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4048, %rsp
	movq	%rdi, -4040(%rbp)
	movl	%esi, -4044(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4032(%rbp)
	movl	$1, -4028(%rbp)
	movl	$1, -4024(%rbp)
	movl	$1, -4016(%rbp)
	movl	$1, -4020(%rbp)
	jmp	.L9
.L10:
	movl	-4028(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	addl	$1, %eax
	movl	%eax, -4028(%rbp)
	movl	-4020(%rbp), %eax
	cltq
	movl	-4028(%rbp), %edx
	movl	%edx, -4016(%rbp,%rax,4)
	addl	$1, -4020(%rbp)
	addl	$1, -4024(%rbp)
.L9:
	movl	-4044(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%eax, -4028(%rbp)
	jl	.L10
	movl	-4024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-4024(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4020(%rbp)
	jmp	.L11
.L14:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	cmpl	$0, -4020(%rbp)
	je	.L12
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	subl	$1, -4020(%rbp)
.L11:
	cmpl	$0, -4020(%rbp)
	jns	.L14
	movl	-4024(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4020(%rbp)
	jmp	.L15
.L16:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-4044(%rbp), %ecx
	movq	-4040(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	insertionSort
	addl	%eax, -4032(%rbp)
	subl	$1, -4020(%rbp)
.L15:
	cmpl	$0, -4020(%rbp)
	jns	.L16
	movl	-4032(%rbp), %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
.LFE7:
	.size	shellSort, .-shellSort
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -20(%rbp)
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L20
.L21:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L20:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movl	-28(%rbp), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	shellSort
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -24(%rbp)
	jmp	.L22
.L25:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -24(%rbp)
	je	.L23
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L24
.L23:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L24:
	addl	$1, -24(%rbp)
.L22:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$0, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-8(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-32(%rbp), %eax
	subl	%eax, -8(%rbp)
	addl	$1, -16(%rbp)
.L3:
	cmpl	$0, -8(%rbp)
	js	.L4
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L5
.L4:
	movl	-8(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L6
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	insertionSort, .-insertionSort
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
.LC2:
	.string	" "
.LC3:
	.string	"\n"
	.text
	.globl	shellSort
	.type	shellSort, @function
shellSort:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4048, %rsp
	movq	%rdi, -4040(%rbp)
	movl	%esi, -4044(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4032(%rbp)
	movl	$1, -4028(%rbp)
	movl	$1, -4024(%rbp)
	movl	$1, -4016(%rbp)
	movl	$1, -4020(%rbp)
	jmp	.L9
.L10:
	movl	-4028(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	addl	$1, %eax
	movl	%eax, -4028(%rbp)
	movl	-4020(%rbp), %eax
	cltq
	movl	-4028(%rbp), %edx
	movl	%edx, -4016(%rbp,%rax,4)
	addl	$1, -4020(%rbp)
	addl	$1, -4024(%rbp)
.L9:
	movl	-4044(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	cmpl	%eax, -4028(%rbp)
	jl	.L10
	movl	-4024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-4024(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4020(%rbp)
	jmp	.L11
.L14:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	cmpl	$0, -4020(%rbp)
	je	.L12
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L13:
	subl	$1, -4020(%rbp)
.L11:
	cmpl	$0, -4020(%rbp)
	jns	.L14
	movl	-4024(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4020(%rbp)
	jmp	.L15
.L16:
	movl	-4020(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-4044(%rbp), %ecx
	movq	-4040(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	insertionSort
	addl	%eax, -4032(%rbp)
	subl	$1, -4020(%rbp)
.L15:
	cmpl	$0, -4020(%rbp)
	jns	.L16
	movl	-4032(%rbp), %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
.LFE7:
	.size	shellSort, .-shellSort
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -20(%rbp)
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L20
.L21:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L20:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movl	-28(%rbp), %edx
	movq	-16(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	shellSort
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -24(%rbp)
	jmp	.L22
.L25:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -24(%rbp)
	je	.L23
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L24
.L23:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L24:
	addl	$1, -24(%rbp)
.L22:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
