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>
#define exchange(a,b) {typeof(a) __tmp=a;a=b;b=__tmp;}
 
 
char A[100001];
int B[100001];
 
 
int Partition(int A[], int p, int r) {
  int i,j;
  int x;

  x = A[r];
  i = p-1;
  for(j = p; j < r; ++j) {
    if(B[A[j]] <= B[x]) { // if(A[j] <= x) {
      i = i+1;
      exchange(A[i], A[j]);
    }
  }
  exchange(A[i+1], A[r]);
  return i+1;
}
 
void Quicksort(int A[], int p, int r) {
  int q;

  if(p < r) {
    q = Partition(A,p,r);
    Quicksort(A,p,q-1);
    Quicksort(A,q+1,r);
  }
}
 
int isStable(int A[], int n) {
  int i;

  for(i = 2; i <= n; ++i) {
    if(B[A[i-1]] == B[A[i]] && A[i-1] > A[i]) return 0;
  }
  return 1;
}
 
int main() {
  int i, n;
  int C[100001];

  scanf("%d", &n);
  for(i = 1; i <= n; ++i) {
    scanf(" %c %d", A+i,B+i);
    C[i] = i;
  }
  Quicksort(C,1,n);
  if(isStable(C,n)) printf("Stable\n");
  else printf("Not stable\n");
  for(i = 1; i <= n; ++i) {
    printf("%c %d\n", A[C[i]], B[C[i]]);
  }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 100001
A:
	.zero	100001
	.globl	B
	.align 32
	.type	B, @object
	.size	B, 400004
B:
	.zero	400004
	.text
	.globl	Partition
	.type	Partition, @function
Partition:
.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, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L2
.L4:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	B(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L3
	addl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L3:
	addl	$1, -16(%rbp)
.L2:
	movl	-16(%rbp), %eax
	cmpl	-48(%rbp), %eax
	jl	.L4
	movl	-20(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Partition, .-Partition
	.globl	Quicksort
	.type	Quicksort, @function
Quicksort:
.LFB1:
	.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	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L8
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Partition
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Quicksort
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Quicksort
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Quicksort, .-Quicksort
	.globl	isStable
	.type	isStable, @function
isStable:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$2, -4(%rbp)
	jmp	.L10
.L13:
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	B(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L11
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	$0, %eax
	jmp	.L12
.L11:
	addl	$1, -4(%rbp)
.L10:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L13
	movl	$1, %eax
.L12:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	isStable, .-isStable
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %c %d"
.LC2:
	.string	"Stable"
.LC3:
	.string	"Not stable"
.LC4:
	.string	"%c %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -400020(%rbp)
	jmp	.L15
.L16:
	movl	-400020(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	addq	%rax, %rdx
	movl	-400020(%rbp), %eax
	cltq
	leaq	A(%rip), %rcx
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400020(%rbp), %eax
	cltq
	movl	-400020(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400020(%rbp)
.L15:
	movl	-400024(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jle	.L16
	movl	-400024(%rbp), %edx
	leaq	-400016(%rbp), %rax
	movl	$1, %esi
	movq	%rax, %rdi
	call	Quicksort
	movl	-400024(%rbp), %edx
	leaq	-400016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	isStable
	testl	%eax, %eax
	je	.L17
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L18
.L17:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L18:
	movl	$1, -400020(%rbp)
	jmp	.L19
.L20:
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	A(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -400020(%rbp)
.L19:
	movl	-400024(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jle	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	Partition
	.type	Partition, @function
Partition:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edx, %rax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %r9
	leaq	(%rdi,%rax,4), %rbx
	leal	-1(%rsi), %edi
	movslq	(%rbx), %r8
	cmpl	%esi, %edx
	jle	.L5
	subl	%esi, %edx
	movslq	%esi, %r10
	leal	-1(%rdx), %eax
	leaq	(%r9,%r10,4), %rcx
	addq	%r10, %rax
	leaq	B(%rip), %rdx
	leaq	4(%r9,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	(%rcx), %rsi
	movl	(%rdx,%r8,4), %r11d
	movq	%rsi, %rax
	cmpl	%r11d, (%rdx,%rsi,4)
	jg	.L3
	addl	$1, %edi
	movslq	%edi, %rsi
	leaq	(%r9,%rsi,4), %rsi
	movl	(%rsi), %r11d
	movl	%eax, (%rsi)
	movl	%r11d, (%rcx)
.L3:
	addq	$4, %rcx
	cmpq	%rcx, %r10
	jne	.L4
	movl	(%rbx), %r8d
	leal	1(%rdi), %eax
.L2:
	movslq	%edi, %rdi
	leaq	4(%r9,%rdi,4), %rdx
	movl	(%rdx), %ecx
	movl	%r8d, (%rdx)
	movl	%ecx, (%rbx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movl	%esi, %eax
	jmp	.L2
	.cfi_endproc
.LFE23:
	.size	Partition, .-Partition
	.p2align 4
	.globl	Quicksort
	.type	Quicksort, @function
Quicksort:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edx
	jle	.L17
	movslq	%edx, %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%esi, %r8d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	(%rdi,%rax,4), %r14
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	B(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
.L13:
	movslq	(%r14), %rsi
	leal	-1(%r8), %r12d
	movslq	%r8d, %rax
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	(%rbx,%rax,4), %rcx
	movl	0(%rbp,%rsi,4), %edi
	movq	%rcx, %rdx
	cmpl	%edi, 0(%rbp,%rcx,4)
	jg	.L11
	addl	$1, %r12d
	movslq	%r12d, %rcx
	leaq	(%rbx,%rcx,4), %rcx
	movl	(%rcx), %edi
	movl	%edx, (%rcx)
	movl	%edi, (%rbx,%rax,4)
.L11:
	addq	$1, %rax
	cmpl	%eax, %r13d
	jg	.L12
	movslq	%r12d, %rax
	movl	(%r14), %ecx
	movl	%r8d, %esi
	movq	%rbx, %rdi
	leaq	4(%rbx,%rax,4), %rax
	movl	(%rax), %edx
	movl	%ecx, (%rax)
	movl	%edx, (%r14)
	movl	%r12d, %edx
	call	Quicksort
	leal	2(%r12), %r8d
	cmpl	%r13d, %r8d
	jl	.L13
	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
.L17:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	ret
	.cfi_endproc
.LFE24:
	.size	Quicksort, .-Quicksort
	.p2align 4
	.globl	isStable
	.type	isStable, @function
isStable:
.LFB25:
	.cfi_startproc
	endbr64
	cmpl	$1, %esi
	jle	.L24
	movslq	4(%rdi), %rcx
	movl	$2, %eax
	leaq	B(%rip), %r8
	movq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%r8,%rcx,4), %r9d
	movslq	(%rdi,%rax,4), %rcx
	movl	%edx, %r10d
	movq	%rcx, %rdx
	cmpl	%r9d, (%r8,%rcx,4)
	jne	.L26
	cmpl	%r10d, %ecx
	jl	.L25
.L26:
	addq	$1, %rax
	cmpl	%eax, %esi
	jge	.L23
.L24:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	isStable, .-isStable
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %c %d"
.LC2:
	.string	"%c %d\n"
.LC3:
	.string	"Stable"
.LC4:
	.string	"Not stable"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397360
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L32
	leaq	4+B(%rip), %r12
	movl	$1, %ebx
	leaq	A(%rip), %r13
	leaq	.LC1(%rip), %r14
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L33:
	movq	%r12, %rdx
	leaq	0(%r13,%rbx), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	movl	%ebx, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	addq	$4, %r12
	cmpl	%ebx, %edx
	jge	.L33
.L32:
	movl	$1, %esi
	movq	%rbp, %rdi
	call	Quicksort
	movl	12(%rsp), %r8d
	cmpl	$1, %r8d
	jle	.L34
	movslq	20(%rsp), %rcx
	movl	$2, %eax
	leaq	B(%rip), %rbx
	movq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L37:
	movl	(%rbx,%rcx,4), %esi
	movslq	0(%rbp,%rax,4), %rcx
	movl	%edx, %edi
	movq	%rcx, %rdx
	cmpl	%esi, (%rbx,%rcx,4)
	jne	.L43
	cmpl	%edi, %ecx
	jl	.L35
.L43:
	addq	$1, %rax
	cmpl	%eax, %r8d
	jge	.L37
.L34:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L40:
	movl	12(%rsp), %eax
	movl	$1, %r12d
	leaq	A(%rip), %r13
	leaq	B(%rip), %rbx
	leaq	.LC2(%rip), %r14
	testl	%eax, %eax
	jle	.L39
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	0(%rbp,%r12,4), %rax
	movq	%r14, %rsi
	movl	$1, %edi
	addq	$1, %r12
	movl	(%rbx,%rax,4), %ecx
	movsbl	0(%r13,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%r12d, 12(%rsp)
	jge	.L38
.L39:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L55
	addq	$400032, %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
.L35:
	.cfi_restore_state
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L40
.L55:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	B
	.bss
	.align 32
	.type	B, @object
	.size	B, 400004
B:
	.zero	400004
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 100001
A:
	.zero	100001
	.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	Partition
	.type	Partition, @function
Partition:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edx, %rax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %r9
	leaq	(%rdi,%rax,4), %rbx
	leal	-1(%rsi), %edi
	movslq	(%rbx), %r8
	cmpl	%esi, %edx
	jle	.L5
	subl	%esi, %edx
	movslq	%esi, %r10
	leal	-1(%rdx), %eax
	leaq	(%r9,%r10,4), %rcx
	addq	%r10, %rax
	leaq	B(%rip), %rdx
	leaq	4(%r9,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	(%rcx), %rsi
	movl	(%rdx,%r8,4), %r11d
	movq	%rsi, %rax
	cmpl	%r11d, (%rdx,%rsi,4)
	jg	.L3
	addl	$1, %edi
	movslq	%edi, %rsi
	leaq	(%r9,%rsi,4), %rsi
	movl	(%rsi), %r11d
	movl	%eax, (%rsi)
	movl	%r11d, (%rcx)
.L3:
	addq	$4, %rcx
	cmpq	%rcx, %r10
	jne	.L4
	movl	(%rbx), %r8d
	leal	1(%rdi), %eax
.L2:
	movslq	%edi, %rdi
	leaq	4(%r9,%rdi,4), %rdx
	movl	(%rdx), %ecx
	movl	%r8d, (%rdx)
	movl	%ecx, (%rbx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movl	%esi, %eax
	jmp	.L2
	.cfi_endproc
.LFE23:
	.size	Partition, .-Partition
	.p2align 4
	.globl	Quicksort
	.type	Quicksort, @function
Quicksort:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edx
	jle	.L17
	movslq	%edx, %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%esi, %r8d
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	(%rdi,%rax,4), %r14
	movl	%edx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	B(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdi, %rbx
.L13:
	movslq	(%r14), %rsi
	leal	-1(%r8), %r12d
	movslq	%r8d, %rax
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	(%rbx,%rax,4), %rcx
	movl	0(%rbp,%rsi,4), %edi
	movq	%rcx, %rdx
	cmpl	%edi, 0(%rbp,%rcx,4)
	jg	.L11
	addl	$1, %r12d
	movslq	%r12d, %rcx
	leaq	(%rbx,%rcx,4), %rcx
	movl	(%rcx), %edi
	movl	%edx, (%rcx)
	movl	%edi, (%rbx,%rax,4)
.L11:
	addq	$1, %rax
	cmpl	%eax, %r13d
	jg	.L12
	movslq	%r12d, %rax
	movl	(%r14), %ecx
	movl	%r8d, %esi
	movq	%rbx, %rdi
	leaq	4(%rbx,%rax,4), %rax
	movl	(%rax), %edx
	movl	%ecx, (%rax)
	movl	%edx, (%r14)
	movl	%r12d, %edx
	call	Quicksort
	leal	2(%r12), %r8d
	cmpl	%r13d, %r8d
	jl	.L13
	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
.L17:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	ret
	.cfi_endproc
.LFE24:
	.size	Quicksort, .-Quicksort
	.p2align 4
	.globl	isStable
	.type	isStable, @function
isStable:
.LFB25:
	.cfi_startproc
	endbr64
	cmpl	$1, %esi
	jle	.L24
	movslq	4(%rdi), %rcx
	movl	$2, %eax
	leaq	B(%rip), %r8
	movq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%r8,%rcx,4), %r9d
	movslq	(%rdi,%rax,4), %rcx
	movl	%edx, %r10d
	movq	%rcx, %rdx
	cmpl	%r9d, (%r8,%rcx,4)
	jne	.L26
	cmpl	%r10d, %ecx
	jl	.L25
.L26:
	addq	$1, %rax
	cmpl	%eax, %esi
	jge	.L23
.L24:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	isStable, .-isStable
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %c %d"
.LC2:
	.string	"%c %d\n"
.LC3:
	.string	"Stable"
.LC4:
	.string	"Not stable"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.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
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397360
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L32
	leaq	4+B(%rip), %r12
	movl	$1, %ebx
	leaq	A(%rip), %r13
	leaq	.LC1(%rip), %r14
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L33:
	movq	%r12, %rdx
	leaq	0(%r13,%rbx), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	movl	%ebx, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	addq	$4, %r12
	cmpl	%ebx, %edx
	jge	.L33
.L32:
	movl	$1, %esi
	movq	%rbp, %rdi
	call	Quicksort
	movl	12(%rsp), %r8d
	cmpl	$1, %r8d
	jle	.L34
	movslq	20(%rsp), %rcx
	movl	$2, %eax
	leaq	B(%rip), %rbx
	movq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L37:
	movl	(%rbx,%rcx,4), %esi
	movslq	0(%rbp,%rax,4), %rcx
	movl	%edx, %edi
	movq	%rcx, %rdx
	cmpl	%esi, (%rbx,%rcx,4)
	jne	.L43
	cmpl	%edi, %ecx
	jl	.L35
.L43:
	addq	$1, %rax
	cmpl	%eax, %r8d
	jge	.L37
.L34:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L40:
	movl	12(%rsp), %eax
	movl	$1, %r12d
	leaq	A(%rip), %r13
	leaq	B(%rip), %rbx
	leaq	.LC2(%rip), %r14
	testl	%eax, %eax
	jle	.L39
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	0(%rbp,%r12,4), %rax
	movq	%r14, %rsi
	movl	$1, %edi
	addq	$1, %r12
	movl	(%rbx,%rax,4), %ecx
	movsbl	0(%r13,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%r12d, 12(%rsp)
	jge	.L38
.L39:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L55
	addq	$400032, %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
.L35:
	.cfi_restore_state
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L40
.L55:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	B
	.bss
	.align 32
	.type	B, @object
	.size	B, 400004
B:
	.zero	400004
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 100001
A:
	.zero	100001
	.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>
#define exchange(a,b) {typeof(a) __tmp=a;a=b;b=__tmp;}
 
 
char A[100001];
int B[100001];
 
 
int Partition(int A[], int p, int r) {
  int i,j;
  int x;

  x = A[r];
  i = p-1;
  for(j = p; j < r; ++j) {
    if(B[A[j]] <= B[x]) { // if(A[j] <= x) {
      i = i+1;
      exchange(A[i], A[j]);
    }
  }
  exchange(A[i+1], A[r]);
  return i+1;
}
 
void Quicksort(int A[], int p, int r) {
  int q;

  if(p < r) {
    q = Partition(A,p,r);
    Quicksort(A,p,q-1);
    Quicksort(A,q+1,r);
  }
}
 
int isStable(int A[], int n) {
  int i;

  for(i = 2; i <= n; ++i) {
    if(B[A[i-1]] == B[A[i]] && A[i-1] > A[i]) return 0;
  }
  return 1;
}
 
int main() {
  int i, n;
  int C[100001];

  scanf("%d", &n);
  for(i = 1; i <= n; ++i) {
    scanf(" %c %d", A+i,B+i);
    C[i] = i;
  }
  Quicksort(C,1,n);
  if(isStable(C,n)) printf("Stable\n");
  else printf("Not stable\n");
  for(i = 1; i <= n; ++i) {
    printf("%c %d\n", A[C[i]], B[C[i]]);
  }
  return 0;
}

6
D 3
H 2
D 1
S 3
C 2
C 1
 6
D 3
H 2
D 1
S 3
C 2
C 2
 6
D 3
H 2
C 1
S 3
C 2
C 2
 6
D 5
H 2
C 1
S 3
C 2
C 2
 6
D 5
H 2
C 2
S 3
C 2
C 2
 6
D 5
H 0
C 2
S 3
C 2
C 1
 2
S 1
H 2
 6
D 3
H 2
D 1
S 3
D 2
C 0
 6
D 3
H 0
D 1
S 3
C 2
C 1
 6
D 3
H 3
D 1
S 3
C 2
C 2

Not stable
D 1
C 1
C 2
H 2
D 3
S 3
 Stable
D 1
H 2
C 2
C 2
D 3
S 3
 Stable
C 1
H 2
C 2
C 2
D 3
S 3
 Stable
C 1
H 2
C 2
C 2
S 3
D 5
 Stable
H 2
C 2
C 2
C 2
S 3
D 5
 Stable
H 0
C 1
C 2
C 2
S 3
D 5
 Stable
S 1
H 2
 Not stable
C 0
D 1
H 2
D 2
S 3
D 3
 Not stable
H 0
D 1
C 1
C 2
S 3
D 3
 Not stable
D 1
C 2
C 2
S 3
H 3
D 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>
#define exchange(a,b) {typeof(a) __tmp=a;a=b;b=__tmp;}
 
 
char A[100001];
int B[100001];
 
 
int Partition(int A[], int p, int r) {
  int i,j;
  int x;

  x = A[r];
  i = p-1;
  for(j = p; j < r; ++j) {
    if(B[A[j]] <= B[x]) { // if(A[j] <= x) {
      i = i+1;
      exchange(A[i], A[j]);
    }
  }
  exchange(A[i+1], A[r]);
  return i+1;
}
 
void Quicksort(int A[], int p, int r) {
  int q;

  if(p < r) {
    q = Partition(A,p,r);
    Quicksort(A,p,q-1);
    Quicksort(A,q+1,r);
  }
}
 
int isStable(int A[], int n) {
  int i;

  for(i = 2; i <= n; ++i) {
    if(B[A[i-1]] == B[A[i]] && A[i-1] > A[i]) return 0;
  }
  return 1;
}
 
int main() {
  int i, n;
  int C[100001];

  scanf("%d", &n);
  for(i = 1; i <= n; ++i) {
    scanf(" %c %d", A+i,B+i);
    C[i] = i;
  }
  Quicksort(C,1,n);
  if(isStable(C,n)) printf("Stable\n");
  else printf("Not stable\n");
  for(i = 1; i <= n; ++i) {
    printf("%c %d\n", A[C[i]], B[C[i]]);
  }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 100001
A:
	.zero	100001
	.globl	B
	.align 32
	.type	B, @object
	.size	B, 400004
B:
	.zero	400004
	.text
	.globl	Partition
	.type	Partition, @function
Partition:
.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, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L2
.L4:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	B(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L3
	addl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L3:
	addl	$1, -16(%rbp)
.L2:
	movl	-16(%rbp), %eax
	cmpl	-48(%rbp), %eax
	jl	.L4
	movl	-20(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Partition, .-Partition
	.globl	Quicksort
	.type	Quicksort, @function
Quicksort:
.LFB1:
	.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	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L8
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Partition
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Quicksort
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Quicksort
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Quicksort, .-Quicksort
	.globl	isStable
	.type	isStable, @function
isStable:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$2, -4(%rbp)
	jmp	.L10
.L13:
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	B(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L11
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	$0, %eax
	jmp	.L12
.L11:
	addl	$1, -4(%rbp)
.L10:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L13
	movl	$1, %eax
.L12:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	isStable, .-isStable
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %c %d"
.LC2:
	.string	"Stable"
.LC3:
	.string	"Not stable"
.LC4:
	.string	"%c %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -400020(%rbp)
	jmp	.L15
.L16:
	movl	-400020(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	addq	%rax, %rdx
	movl	-400020(%rbp), %eax
	cltq
	leaq	A(%rip), %rcx
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400020(%rbp), %eax
	cltq
	movl	-400020(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400020(%rbp)
.L15:
	movl	-400024(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jle	.L16
	movl	-400024(%rbp), %edx
	leaq	-400016(%rbp), %rax
	movl	$1, %esi
	movq	%rax, %rdi
	call	Quicksort
	movl	-400024(%rbp), %edx
	leaq	-400016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	isStable
	testl	%eax, %eax
	je	.L17
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L18
.L17:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L18:
	movl	$1, -400020(%rbp)
	jmp	.L19
.L20:
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	A(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -400020(%rbp)
.L19:
	movl	-400024(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jle	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 100001
A:
	.zero	100001
	.globl	B
	.align 32
	.type	B, @object
	.size	B, 400004
B:
	.zero	400004
	.text
	.globl	Partition
	.type	Partition, @function
Partition:
.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, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L2
.L4:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	B(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jg	.L3
	addl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L3:
	addl	$1, -16(%rbp)
.L2:
	movl	-16(%rbp), %eax
	cmpl	-48(%rbp), %eax
	jl	.L4
	movl	-20(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Partition, .-Partition
	.globl	Quicksort
	.type	Quicksort, @function
Quicksort:
.LFB1:
	.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	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L8
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Partition
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Quicksort
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Quicksort
.L8:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	Quicksort, .-Quicksort
	.globl	isStable
	.type	isStable, @function
isStable:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$2, -4(%rbp)
	jmp	.L10
.L13:
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	B(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L11
	movl	-4(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	$0, %eax
	jmp	.L12
.L11:
	addl	$1, -4(%rbp)
.L10:
	movl	-4(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L13
	movl	$1, %eax
.L12:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	isStable, .-isStable
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %c %d"
.LC2:
	.string	"Stable"
.LC3:
	.string	"Not stable"
.LC4:
	.string	"%c %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -400020(%rbp)
	jmp	.L15
.L16:
	movl	-400020(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	addq	%rax, %rdx
	movl	-400020(%rbp), %eax
	cltq
	leaq	A(%rip), %rcx
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400020(%rbp), %eax
	cltq
	movl	-400020(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400020(%rbp)
.L15:
	movl	-400024(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jle	.L16
	movl	-400024(%rbp), %edx
	leaq	-400016(%rbp), %rax
	movl	$1, %esi
	movq	%rax, %rdi
	call	Quicksort
	movl	-400024(%rbp), %edx
	leaq	-400016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	isStable
	testl	%eax, %eax
	je	.L17
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L18
.L17:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L18:
	movl	$1, -400020(%rbp)
	jmp	.L19
.L20:
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	B(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	A(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	movsbl	%al, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -400020(%rbp)
.L19:
	movl	-400024(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jle	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
