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 <stdbool.h>

#define SIZE 36

typedef struct {
    char suit;
    int val;
} card;

void
selectionSort(card [], int);

void
bubbleSort(card [], int);

void
print(card [], int);

bool
compare(card [], card [], int);

int main(void)
{
    int n, i;
    card c1[SIZE], c2[SIZE];

    scanf("%d", &n);
    getchar();
    for (i = 0; i < n; i++) {
        scanf("%c %d", &c1[i].suit, &c1[i].val);
        c2[i] = c1[i];
        getchar();
    }

    bubbleSort(c1, n);
    selectionSort(c2, n);

    print(c1, n);
    printf("Stable\n");
    print(c2, n);
    printf("%s\n", compare(c1, c2, n) ? "Stable" : "Not stable");

    return 0;
}


void
bubbleSort(card arr[], int n)
{
    int i, j;
    card v;

    for (i = 0; i < n; i++)
        for (j = n - 1; j > i; j--)
            if (arr[j].val < arr[j - 1].val) {
                v = arr[j];
                arr[j] = arr[j - 1];
                arr[j - 1] = v;
            }
}


void
selectionSort(card arr[], int n)
{
    int i, j, min;
    card v;

    for (i = 0; i < n - 1; i++) {
        min = i;
        for (j = i + 1; j < n; j++)
            if (arr[j].val < arr[min].val) {
                min = j;
            }
        v = arr[i];
        arr[i] = arr[min];
        arr[min] = v;
    }
}


void
print(card arr[], int n)
{
    int i = 0;
    printf("%c%d", arr[i].suit, arr[i].val);
    for (i++ ; i < n; i++)
        printf(" %c%d", arr[i].suit, arr[i].val);
    putchar('\n');
}

bool
compare(card c1[], card c2[], int n)
{
    int i;
    for (i = 0; i < n; i++)
        if (c1[i].suit != c2[i].suit)
            return false;
    return true;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%c %d"
.LC2:
	.string	"Stable"
.LC3:
	.string	"Not stable"
	.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	$608, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-600(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	getchar@PLT
	movl	$0, -596(%rbp)
	jmp	.L2
.L3:
	leaq	-592(%rbp), %rdx
	movl	-596(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	leaq	-592(%rbp), %rcx
	movl	-596(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-596(%rbp), %eax
	cltq
	movl	-596(%rbp), %edx
	movslq	%edx, %rdx
	movq	-592(%rbp,%rdx,8), %rdx
	movq	%rdx, -304(%rbp,%rax,8)
	call	getchar@PLT
	addl	$1, -596(%rbp)
.L2:
	movl	-600(%rbp), %eax
	cmpl	%eax, -596(%rbp)
	jl	.L3
	movl	-600(%rbp), %edx
	leaq	-592(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	bubbleSort
	movl	-600(%rbp), %edx
	leaq	-304(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	selectionSort
	movl	-600(%rbp), %edx
	leaq	-592(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	print
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	-600(%rbp), %edx
	leaq	-304(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	print
	movl	-600(%rbp), %edx
	leaq	-304(%rbp), %rcx
	leaq	-592(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	compare
	testb	%al, %al
	je	.L4
	leaq	.LC2(%rip), %rax
	jmp	.L5
.L4:
	leaq	.LC3(%rip), %rax
.L5:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	bubbleSort
	.type	bubbleSort, @function
bubbleSort:
.LFB1:
	.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	$0, -16(%rbp)
	jmp	.L9
.L13:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L12:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rdx)
.L11:
	subl	$1, -12(%rbp)
.L10:
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L12
	addl	$1, -16(%rbp)
.L9:
	movl	-16(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L13
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bubbleSort, .-bubbleSort
	.globl	selectionSort
	.type	selectionSort, @function
selectionSort:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L15
.L19:
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	jmp	.L16
.L18:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L17:
	addl	$1, -16(%rbp)
.L16:
	movl	-16(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rdx)
	addl	$1, -20(%rbp)
.L15:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L19
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	selectionSort, .-selectionSort
	.section	.rodata
.LC4:
	.string	"%c%d"
.LC5:
	.string	" %c%d"
	.text
	.globl	print
	.type	print, @function
print:
.LFB3:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
	jmp	.L21
.L22:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L21:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L22
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	print, .-print
	.globl	compare
	.type	compare, @function
compare:
.LFB4:
	.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)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L24
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L25
	movl	$0, %eax
	jmp	.L26
.L25:
	addl	$1, -4(%rbp)
.L24:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L27
	movl	$1, %eax
.L26:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	compare, .-compare
	.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	bubbleSort
	.type	bubbleSort, @function
bubbleSort:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L1
	movl	%esi, %r9d
	subl	$1, %r9d
	je	.L1
	movslq	%esi, %rsi
	leaq	(%rdi,%rsi,8), %r10
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r10, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	-4(%rax), %ecx
	cmpl	-12(%rax), %ecx
	jge	.L7
	movq	-16(%rax), %r8
	movzbl	-8(%rax), %edi
	movl	%ecx, -12(%rax)
	movq	%r8, -8(%rax)
	movb	%dil, -16(%rax)
.L7:
	subl	$1, %edx
	subq	$8, %rax
	cmpl	%esi, %edx
	jg	.L4
	addl	$1, %esi
	cmpl	%r9d, %esi
	jl	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L1:
	ret
	.cfi_endproc
.LFE24:
	.size	bubbleSort, .-bubbleSort
	.p2align 4
	.globl	selectionSort
	.type	selectionSort, @function
selectionSort:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leal	-1(%rsi), %r13d
	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
	testl	%r13d, %r13d
	jle	.L16
	movq	%rdi, %rbx
	movl	%esi, %r8d
	movq	%rdi, %r11
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L21:
	movl	%r10d, %r9d
	addl	$1, %r10d
	movl	4(%r11), %ebp
	cmpl	%r10d, %r8d
	jle	.L23
	leaq	8(%r11), %r12
	movl	%ebp, %edi
	movl	%r10d, %edx
	movq	%r12, %rax
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L29:
	movslq	%r9d, %rcx
	addl	$1, %edx
	addq	$8, %rax
	leaq	(%rbx,%rcx,8), %rsi
	cmpl	%r8d, %edx
	je	.L18
.L20:
	movl	4(%rax), %ecx
	movq	%rax, %rsi
	cmpl	%edi, %ecx
	jge	.L29
	movl	%edx, %r9d
	addl	$1, %edx
	movl	%ecx, %edi
	addq	$8, %rax
	cmpl	%r8d, %edx
	jne	.L20
.L18:
	movzbl	(%r11), %eax
	movq	(%rsi), %rdx
	movq	%rdx, (%r11)
	movq	%r12, %r11
	movb	%al, (%rsi)
	movl	%ebp, 4(%rsi)
	cmpl	%r13d, %r10d
	jne	.L21
.L16:
	popq	%rbx
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	movq	%r11, %rsi
	leaq	8(%r11), %r12
	jmp	.L18
	.cfi_endproc
.LFE25:
	.size	selectionSort, .-selectionSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%c%d"
.LC1:
	.string	" %c%d"
	.text
	.p2align 4
	.globl	print
	.type	print, @function
print:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%eax, %eax
	movl	%esi, %r12d
	leaq	.LC0(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	4(%rdi), %ecx
	movsbl	(%rdi), %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	$1, %r12d
	jle	.L31
	leal	-2(%r12), %eax
	leaq	8(%rbp), %rbx
	leaq	16(%rbp,%rax,8), %r12
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L32:
	movl	4(%rbx), %ecx
	movsbl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$8, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L32
.L31:
	movq	stdout(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	putc@PLT
	.cfi_endproc
.LFE26:
	.size	print, .-print
	.section	.rodata.str1.1
.LC2:
	.string	"Not stable"
.LC3:
	.string	"Stable"
.LC4:
	.string	"%d"
.LC5:
	.string	"%c %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC4(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$608, %rsp
	.cfi_def_cfa_offset 656
	movq	%fs:40, %rax
	movq	%rax, 600(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r13
	leaq	304(%rsp), %r12
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jle	.L36
	movq	%r13, %rbx
	xorl	%ebp, %ebp
	leaq	.LC5(%rip), %r14
	leaq	304(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%rbx, %rsi
	leaq	4(%rbx), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rbx), %rax
	movq	stdin(%rip), %rdi
	addq	$8, %rbx
	movq	%rax, (%r12,%rbp,8)
	addq	$1, %rbp
	call	getc@PLT
	movl	12(%rsp), %esi
	cmpl	%ebp, %esi
	jg	.L37
.L36:
	movq	%r13, %rdi
	leaq	.LC3(%rip), %rbx
	call	bubbleSort
	movl	12(%rsp), %esi
	movq	%r12, %rdi
	call	selectionSort
	movl	12(%rsp), %esi
	movq	%r13, %rdi
	call	print
	movq	%rbx, %rdi
	call	puts@PLT
	movl	12(%rsp), %esi
	movq	%r12, %rdi
	call	print
	movslq	12(%rsp), %rdx
	movq	%rbx, %rdi
	testl	%edx, %edx
	jle	.L38
	xorl	%eax, %eax
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L49:
	addq	$1, %rax
	cmpq	%rax, %rdx
	je	.L48
.L39:
	movzbl	(%r12,%rax,8), %ecx
	cmpb	%cl, 0(%r13,%rax,8)
	je	.L49
	leaq	.LC2(%rip), %rdi
.L38:
	call	puts@PLT
	movq	600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	addq	$608, %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
.L48:
	.cfi_restore_state
	leaq	.LC3(%rip), %rdi
	jmp	.L38
.L50:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB27:
	.cfi_startproc
	endbr64
	testl	%edx, %edx
	jle	.L54
	movslq	%edx, %rdx
	xorl	%eax, %eax
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L57:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L54
.L53:
	movzbl	(%rsi,%rax,8), %ecx
	cmpb	%cl, (%rdi,%rax,8)
	je	.L57
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L54:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE27:
	.size	compare, .-compare
	.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	bubbleSort
	.type	bubbleSort, @function
bubbleSort:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L1
	movl	%esi, %r9d
	subl	$1, %r9d
	je	.L1
	movslq	%esi, %rsi
	leaq	(%rdi,%rsi,8), %r10
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r10, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	-4(%rax), %ecx
	cmpl	-12(%rax), %ecx
	jge	.L7
	movq	-16(%rax), %r8
	movzbl	-8(%rax), %edi
	movl	%ecx, -12(%rax)
	movq	%r8, -8(%rax)
	movb	%dil, -16(%rax)
.L7:
	subl	$1, %edx
	subq	$8, %rax
	cmpl	%esi, %edx
	jg	.L4
	addl	$1, %esi
	cmpl	%r9d, %esi
	jl	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L1:
	ret
	.cfi_endproc
.LFE24:
	.size	bubbleSort, .-bubbleSort
	.p2align 4
	.globl	selectionSort
	.type	selectionSort, @function
selectionSort:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leal	-1(%rsi), %r13d
	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
	testl	%r13d, %r13d
	jle	.L16
	movq	%rdi, %rbx
	movl	%esi, %r8d
	movq	%rdi, %r11
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L21:
	movl	%r10d, %r9d
	addl	$1, %r10d
	movl	4(%r11), %ebp
	cmpl	%r10d, %r8d
	jle	.L23
	leaq	8(%r11), %r12
	movl	%ebp, %edi
	movl	%r10d, %edx
	movq	%r12, %rax
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L29:
	movslq	%r9d, %rcx
	addl	$1, %edx
	addq	$8, %rax
	leaq	(%rbx,%rcx,8), %rsi
	cmpl	%r8d, %edx
	je	.L18
.L20:
	movl	4(%rax), %ecx
	movq	%rax, %rsi
	cmpl	%edi, %ecx
	jge	.L29
	movl	%edx, %r9d
	addl	$1, %edx
	movl	%ecx, %edi
	addq	$8, %rax
	cmpl	%r8d, %edx
	jne	.L20
.L18:
	movzbl	(%r11), %eax
	movq	(%rsi), %rdx
	movq	%rdx, (%r11)
	movq	%r12, %r11
	movb	%al, (%rsi)
	movl	%ebp, 4(%rsi)
	cmpl	%r13d, %r10d
	jne	.L21
.L16:
	popq	%rbx
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	movq	%r11, %rsi
	leaq	8(%r11), %r12
	jmp	.L18
	.cfi_endproc
.LFE25:
	.size	selectionSort, .-selectionSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%c%d"
.LC1:
	.string	" %c%d"
	.text
	.p2align 4
	.globl	print
	.type	print, @function
print:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xorl	%eax, %eax
	movl	%esi, %r12d
	leaq	.LC0(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	4(%rdi), %ecx
	movsbl	(%rdi), %edx
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	$1, %r12d
	jle	.L31
	leal	-2(%r12), %eax
	leaq	8(%rbp), %rbx
	leaq	16(%rbp,%rax,8), %r12
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L32:
	movl	4(%rbx), %ecx
	movsbl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$8, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L32
.L31:
	movq	stdout(%rip), %rsi
	popq	%rbx
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	putc@PLT
	.cfi_endproc
.LFE26:
	.size	print, .-print
	.section	.rodata.str1.1
.LC2:
	.string	"Not stable"
.LC3:
	.string	"Stable"
.LC4:
	.string	"%d"
.LC5:
	.string	"%c %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC4(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$608, %rsp
	.cfi_def_cfa_offset 656
	movq	%fs:40, %rax
	movq	%rax, 600(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r13
	leaq	304(%rsp), %r12
	call	__isoc99_scanf@PLT
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jle	.L36
	movq	%r13, %rbx
	xorl	%ebp, %ebp
	leaq	.LC5(%rip), %r14
	leaq	304(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%rbx, %rsi
	leaq	4(%rbx), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rbx), %rax
	movq	stdin(%rip), %rdi
	addq	$8, %rbx
	movq	%rax, (%r12,%rbp,8)
	addq	$1, %rbp
	call	getc@PLT
	movl	12(%rsp), %esi
	cmpl	%ebp, %esi
	jg	.L37
.L36:
	movq	%r13, %rdi
	leaq	.LC3(%rip), %rbx
	call	bubbleSort
	movl	12(%rsp), %esi
	movq	%r12, %rdi
	call	selectionSort
	movl	12(%rsp), %esi
	movq	%r13, %rdi
	call	print
	movq	%rbx, %rdi
	call	puts@PLT
	movl	12(%rsp), %esi
	movq	%r12, %rdi
	call	print
	movslq	12(%rsp), %rdx
	movq	%rbx, %rdi
	testl	%edx, %edx
	jle	.L38
	xorl	%eax, %eax
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L49:
	addq	$1, %rax
	cmpq	%rax, %rdx
	je	.L48
.L39:
	movzbl	(%r12,%rax,8), %ecx
	cmpb	%cl, 0(%r13,%rax,8)
	je	.L49
	leaq	.LC2(%rip), %rdi
.L38:
	call	puts@PLT
	movq	600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	addq	$608, %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
.L48:
	.cfi_restore_state
	leaq	.LC3(%rip), %rdi
	jmp	.L38
.L50:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB27:
	.cfi_startproc
	endbr64
	testl	%edx, %edx
	jle	.L54
	movslq	%edx, %rdx
	xorl	%eax, %eax
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L57:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L54
.L53:
	movzbl	(%rsi,%rax,8), %ecx
	cmpb	%cl, (%rdi,%rax,8)
	je	.L57
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L54:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE27:
	.size	compare, .-compare
	.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 <stdbool.h>

#define SIZE 36

typedef struct {
    char suit;
    int val;
} card;

void
selectionSort(card [], int);

void
bubbleSort(card [], int);

void
print(card [], int);

bool
compare(card [], card [], int);

int main(void)
{
    int n, i;
    card c1[SIZE], c2[SIZE];

    scanf("%d", &n);
    getchar();
    for (i = 0; i < n; i++) {
        scanf("%c %d", &c1[i].suit, &c1[i].val);
        c2[i] = c1[i];
        getchar();
    }

    bubbleSort(c1, n);
    selectionSort(c2, n);

    print(c1, n);
    printf("Stable\n");
    print(c2, n);
    printf("%s\n", compare(c1, c2, n) ? "Stable" : "Not stable");

    return 0;
}


void
bubbleSort(card arr[], int n)
{
    int i, j;
    card v;

    for (i = 0; i < n; i++)
        for (j = n - 1; j > i; j--)
            if (arr[j].val < arr[j - 1].val) {
                v = arr[j];
                arr[j] = arr[j - 1];
                arr[j - 1] = v;
            }
}


void
selectionSort(card arr[], int n)
{
    int i, j, min;
    card v;

    for (i = 0; i < n - 1; i++) {
        min = i;
        for (j = i + 1; j < n; j++)
            if (arr[j].val < arr[min].val) {
                min = j;
            }
        v = arr[i];
        arr[i] = arr[min];
        arr[min] = v;
    }
}


void
print(card arr[], int n)
{
    int i = 0;
    printf("%c%d", arr[i].suit, arr[i].val);
    for (i++ ; i < n; i++)
        printf(" %c%d", arr[i].suit, arr[i].val);
    putchar('\n');
}

bool
compare(card c1[], card c2[], int n)
{
    int i;
    for (i = 0; i < n; i++)
        if (c1[i].suit != c2[i].suit)
            return false;
    return true;
}

5
H4 B9 S4 D2 C3
 5
H4 C9 S4 D2 C2
 5
H4 B9 S4 E2 C3
 5
I4 C9 S4 D2 C2
 5
H3 B9 S4 E2 C3
 5
H3 B9 S4 E2 B3
 5
H3 B9 S4 E3 B3
 5
H3 A9 S4 E3 B3
 5
H4 C9 S4 C2 C3
 5
H4 B9 T4 D2 C3

D2 C3 H4 S4 B9
Stable
D2 C3 S4 H4 B9
Not stable
 D2 C2 H4 S4 C9
Stable
D2 C2 S4 H4 C9
Not stable
 E2 C3 H4 S4 B9
Stable
E2 C3 S4 H4 B9
Not stable
 D2 C2 I4 S4 C9
Stable
D2 C2 S4 I4 C9
Not stable
 E2 H3 C3 S4 B9
Stable
E2 H3 C3 S4 B9
Stable
 E2 H3 B3 S4 B9
Stable
E2 H3 B3 S4 B9
Stable
 H3 E3 B3 S4 B9
Stable
H3 E3 B3 S4 B9
Stable
 H3 E3 B3 S4 A9
Stable
H3 E3 B3 S4 A9
Stable
 C2 C3 H4 S4 C9
Stable
C2 C3 S4 H4 C9
Not stable
 D2 C3 H4 T4 B9
Stable
D2 C3 T4 H4 B9
Not stable

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 <stdbool.h>

#define SIZE 36

typedef struct {
    char suit;
    int val;
} card;

void
selectionSort(card [], int);

void
bubbleSort(card [], int);

void
print(card [], int);

bool
compare(card [], card [], int);

int main(void)
{
    int n, i;
    card c1[SIZE], c2[SIZE];

    scanf("%d", &n);
    getchar();
    for (i = 0; i < n; i++) {
        scanf("%c %d", &c1[i].suit, &c1[i].val);
        c2[i] = c1[i];
        getchar();
    }

    bubbleSort(c1, n);
    selectionSort(c2, n);

    print(c1, n);
    printf("Stable\n");
    print(c2, n);
    printf("%s\n", compare(c1, c2, n) ? "Stable" : "Not stable");

    return 0;
}


void
bubbleSort(card arr[], int n)
{
    int i, j;
    card v;

    for (i = 0; i < n; i++)
        for (j = n - 1; j > i; j--)
            if (arr[j].val < arr[j - 1].val) {
                v = arr[j];
                arr[j] = arr[j - 1];
                arr[j - 1] = v;
            }
}


void
selectionSort(card arr[], int n)
{
    int i, j, min;
    card v;

    for (i = 0; i < n - 1; i++) {
        min = i;
        for (j = i + 1; j < n; j++)
            if (arr[j].val < arr[min].val) {
                min = j;
            }
        v = arr[i];
        arr[i] = arr[min];
        arr[min] = v;
    }
}


void
print(card arr[], int n)
{
    int i = 0;
    printf("%c%d", arr[i].suit, arr[i].val);
    for (i++ ; i < n; i++)
        printf(" %c%d", arr[i].suit, arr[i].val);
    putchar('\n');
}

bool
compare(card c1[], card c2[], int n)
{
    int i;
    for (i = 0; i < n; i++)
        if (c1[i].suit != c2[i].suit)
            return false;
    return true;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%c %d"
.LC2:
	.string	"Stable"
.LC3:
	.string	"Not stable"
	.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	$608, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-600(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	getchar@PLT
	movl	$0, -596(%rbp)
	jmp	.L2
.L3:
	leaq	-592(%rbp), %rdx
	movl	-596(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	leaq	-592(%rbp), %rcx
	movl	-596(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-596(%rbp), %eax
	cltq
	movl	-596(%rbp), %edx
	movslq	%edx, %rdx
	movq	-592(%rbp,%rdx,8), %rdx
	movq	%rdx, -304(%rbp,%rax,8)
	call	getchar@PLT
	addl	$1, -596(%rbp)
.L2:
	movl	-600(%rbp), %eax
	cmpl	%eax, -596(%rbp)
	jl	.L3
	movl	-600(%rbp), %edx
	leaq	-592(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	bubbleSort
	movl	-600(%rbp), %edx
	leaq	-304(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	selectionSort
	movl	-600(%rbp), %edx
	leaq	-592(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	print
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	-600(%rbp), %edx
	leaq	-304(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	print
	movl	-600(%rbp), %edx
	leaq	-304(%rbp), %rcx
	leaq	-592(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	compare
	testb	%al, %al
	je	.L4
	leaq	.LC2(%rip), %rax
	jmp	.L5
.L4:
	leaq	.LC3(%rip), %rax
.L5:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	bubbleSort
	.type	bubbleSort, @function
bubbleSort:
.LFB1:
	.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	$0, -16(%rbp)
	jmp	.L9
.L13:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L12:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rdx)
.L11:
	subl	$1, -12(%rbp)
.L10:
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L12
	addl	$1, -16(%rbp)
.L9:
	movl	-16(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L13
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bubbleSort, .-bubbleSort
	.globl	selectionSort
	.type	selectionSort, @function
selectionSort:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L15
.L19:
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	jmp	.L16
.L18:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L17:
	addl	$1, -16(%rbp)
.L16:
	movl	-16(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rdx)
	addl	$1, -20(%rbp)
.L15:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L19
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	selectionSort, .-selectionSort
	.section	.rodata
.LC4:
	.string	"%c%d"
.LC5:
	.string	" %c%d"
	.text
	.globl	print
	.type	print, @function
print:
.LFB3:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
	jmp	.L21
.L22:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L21:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L22
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	print, .-print
	.globl	compare
	.type	compare, @function
compare:
.LFB4:
	.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)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L24
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L25
	movl	$0, %eax
	jmp	.L26
.L25:
	addl	$1, -4(%rbp)
.L24:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L27
	movl	$1, %eax
.L26:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	compare, .-compare
	.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"
.LC1:
	.string	"%c %d"
.LC2:
	.string	"Stable"
.LC3:
	.string	"Not stable"
	.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	$608, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-600(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	getchar@PLT
	movl	$0, -596(%rbp)
	jmp	.L2
.L3:
	leaq	-592(%rbp), %rdx
	movl	-596(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	leaq	-592(%rbp), %rcx
	movl	-596(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-596(%rbp), %eax
	cltq
	movl	-596(%rbp), %edx
	movslq	%edx, %rdx
	movq	-592(%rbp,%rdx,8), %rdx
	movq	%rdx, -304(%rbp,%rax,8)
	call	getchar@PLT
	addl	$1, -596(%rbp)
.L2:
	movl	-600(%rbp), %eax
	cmpl	%eax, -596(%rbp)
	jl	.L3
	movl	-600(%rbp), %edx
	leaq	-592(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	bubbleSort
	movl	-600(%rbp), %edx
	leaq	-304(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	selectionSort
	movl	-600(%rbp), %edx
	leaq	-592(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	print
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	-600(%rbp), %edx
	leaq	-304(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	print
	movl	-600(%rbp), %edx
	leaq	-304(%rbp), %rcx
	leaq	-592(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	compare
	testb	%al, %al
	je	.L4
	leaq	.LC2(%rip), %rax
	jmp	.L5
.L4:
	leaq	.LC3(%rip), %rax
.L5:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	bubbleSort
	.type	bubbleSort, @function
bubbleSort:
.LFB1:
	.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	$0, -16(%rbp)
	jmp	.L9
.L13:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L10
.L12:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	-8(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rdx)
.L11:
	subl	$1, -12(%rbp)
.L10:
	movl	-12(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jg	.L12
	addl	$1, -16(%rbp)
.L9:
	movl	-16(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L13
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bubbleSort, .-bubbleSort
	.globl	selectionSort
	.type	selectionSort, @function
selectionSort:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L15
.L19:
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -16(%rbp)
	jmp	.L16
.L18:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movl	4(%rax), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L17:
	addl	$1, -16(%rbp)
.L16:
	movl	-16(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L18
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rdx)
	addl	$1, -20(%rbp)
.L15:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -20(%rbp)
	jl	.L19
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	selectionSort, .-selectionSort
	.section	.rodata
.LC4:
	.string	"%c%d"
.LC5:
	.string	" %c%d"
	.text
	.globl	print
	.type	print, @function
print:
.LFB3:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
	jmp	.L21
.L22:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L21:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L22
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	print, .-print
	.globl	compare
	.type	compare, @function
compare:
.LFB4:
	.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)
	movq	%rsi, -32(%rbp)
	movl	%edx, -36(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L24
.L27:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-32(%rbp), %rax
	addq	%rcx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, %dl
	je	.L25
	movl	$0, %eax
	jmp	.L26
.L25:
	addl	$1, -4(%rbp)
.L24:
	movl	-4(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L27
	movl	$1, %eax
.L26:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	compare, .-compare
	.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:
