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 <string.h>
#include <limits.h>

#define MAX 2000000
  
int Q[MAX] = {}; 
int heapSize=0;
 
int parent(int);
int left(int);
int right(int);
void maxHeapify(int);
int extractMax(void);
void insert(int);
void increaseKey(int, int);
  
// 
int main(void)
{
  char op[10];
  int val=0;

  while (1)
  {
    scanf("%s", op);
    if (strcmp(op, "insert") == 0)
    {
      scanf("%d", &val);
      insert(val);
    }
    else if (strcmp(op, "extract") == 0)
    {
      printf("%d\n", extractMax());
    }
    else if (strcmp(op, "end") == 0)
    {
      break;
    }
  }
  return 0;
}

int extractMax(void) {
  if(heapSize < 1){
    printf("heap size is 0!");
    return 0;
  }
  int max = Q[1];
  Q[1] = Q[heapSize];
  heapSize--;
  maxHeapify(1);
  return max;
}
 
void maxHeapify(int i)
{
  int largest=0, temp=0, l=0, r=0;
 
  l = left(i);
  r = right(i);
   
  if((heapSize >= l) && (Q[l] > Q[i])){
    largest = l;
  }
  else{
    largest = i;
  }
    
  if((heapSize >= r) && (Q[r] > Q[largest])){
    largest = r;
  }
 
  if (largest != i){
    temp = Q[i];
    Q[i] = Q[largest];
    Q[largest] = temp;
    maxHeapify(largest);
  } 
 
}

void insert(int key) {
  heapSize++;
  Q[heapSize] = INT_MIN;
  increaseKey(heapSize, key);
}

void increaseKey(int i, int key) {
  Q[i] = key;
  while(i > 1 && Q[parent(i)] < Q[i]){
    int tmp = Q[i];
    Q[i] = Q[parent(i)];
    Q[parent(i)] = tmp;
    i = parent(i);
  }
}

int parent(int i) {
  return (int)(i/2);
}

int left(int i)
{
  return (2*i);
}
  
int right(int i)
{
  return (2*i + 1);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	Q
	.bss
	.align 32
	.type	Q, @object
	.size	Q, 8000000
Q:
	.zero	8000000
	.globl	heapSize
	.align 4
	.type	heapSize, @object
	.size	heapSize, 4
heapSize:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"insert"
.LC2:
	.string	"%d"
.LC3:
	.string	"extract"
.LC4:
	.string	"%d\n"
.LC5:
	.string	"end"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
.L6:
	leaq	-18(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-18(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L2
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	insert
	jmp	.L6
.L2:
	leaq	-18(%rbp), %rax
	leaq	.LC3(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L4
	call	extractMax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L6
.L4:
	leaq	-18(%rbp), %rax
	leaq	.LC5(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L10
	jmp	.L6
.L10:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC6:
	.string	"heap size is 0!"
	.text
	.globl	extractMax
	.type	extractMax, @function
extractMax:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	heapSize(%rip), %eax
	testl	%eax, %eax
	jg	.L12
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L13
.L12:
	movl	4+Q(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	heapSize(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, 4+Q(%rip)
	movl	heapSize(%rip), %eax
	subl	$1, %eax
	movl	%eax, heapSize(%rip)
	movl	$1, %edi
	call	maxHeapify
	movl	-4(%rbp), %eax
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	extractMax, .-extractMax
	.globl	maxHeapify
	.type	maxHeapify, @function
maxHeapify:
.LFB2:
	.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
	movl	%edi, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	left
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	right
	movl	%eax, -4(%rbp)
	movl	heapSize(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L15
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L15
	movl	-8(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L16
.L15:
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
.L16:
	movl	heapSize(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L17
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	-4(%rbp), %eax
	movl	%eax, -16(%rbp)
.L17:
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	je	.L19
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Q(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	maxHeapify
.L19:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	maxHeapify, .-maxHeapify
	.globl	insert
	.type	insert, @function
insert:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	heapSize(%rip), %eax
	addl	$1, %eax
	movl	%eax, heapSize(%rip)
	movl	heapSize(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	$-2147483648, (%rdx,%rax)
	movl	heapSize(%rip), %eax
	movl	-4(%rbp), %edx
	movl	%edx, %esi
	movl	%eax, %edi
	call	increaseKey
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	insert, .-insert
	.globl	increaseKey
	.type	increaseKey, @function
increaseKey:
.LFB4:
	.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L22
.L24:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Q(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	movl	%eax, -20(%rbp)
.L22:
	cmpl	$1, -20(%rbp)
	jle	.L25
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L24
.L25:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	increaseKey, .-increaseKey
	.globl	parent
	.type	parent, @function
parent:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	parent, .-parent
	.globl	left
	.type	left, @function
left:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	left, .-left
	.globl	right
	.type	right, @function
right:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	right, .-right
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"insert"
.LC2:
	.string	"%d"
.LC3:
	.string	"extract"
.LC4:
	.string	"heap size is 0!"
.LC5:
	.string	"%d\n"
.LC6:
	.string	"end"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC4(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC5(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movabsq	$32760367481649253, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	Q(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movl	$0, 24(%rsp)
	leaq	30(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1702063721, (%r15)
	je	.L33
.L3:
	cmpq	%r12, (%r15)
	je	.L34
	cmpl	$6581861, (%r15)
	jne	.L2
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	cmpw	$29810, 4(%r15)
	jne	.L3
	cmpb	$0, 6(%r15)
	jne	.L3
	leaq	.LC2(%rip), %rdi
	leaq	24(%rsp), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	heapSize(%rip), %eax
	movl	24(%rsp), %edi
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	%eax, heapSize(%rip)
	movl	%edi, (%rbx,%rdx,4)
	cmpl	$1, %eax
	jg	.L6
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%ecx, (%rbx,%rdx,4)
	movl	%edi, (%rbx,%rsi,4)
	cmpl	$1, %eax
	je	.L2
.L6:
	movslq	%eax, %rdx
	sarl	%eax
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %ecx
	cmpl	%ecx, %edi
	jg	.L8
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L34:
	movl	heapSize(%rip), %edi
	xorl	%r8d, %r8d
	testl	%edi, %edi
	jle	.L36
	movslq	%edi, %rax
	subl	$1, %edi
	movl	4+Q(%rip), %r8d
	movl	(%rbx,%rax,4), %r9d
	movl	$1, %eax
	movl	%edi, heapSize(%rip)
	leal	(%rax,%rax), %edx
	movl	%r9d, 4+Q(%rip)
	leal	1(%rdx), %esi
	cmpl	%edx, %edi
	jl	.L14
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	%edx, %rcx
	movl	(%rbx,%rcx,4), %ecx
	cmpl	%ecx, %r9d
	jge	.L14
	cmpl	%esi, %edi
	jge	.L37
.L21:
	movl	%edx, %esi
.L15:
	cmpl	%esi, %eax
	je	.L13
	movl	%ecx, (%rbx,%rax,4)
	movslq	%esi, %rax
	movl	%r9d, (%rbx,%rax,4)
	movslq	%esi, %rax
	leal	(%rax,%rax), %edx
	leal	1(%rdx), %esi
	cmpl	%edx, %edi
	jge	.L38
.L14:
	cmpl	%esi, %edi
	jl	.L13
	movslq	%esi, %rdx
	movl	(%rbx,%rdx,4), %ecx
	cmpl	%ecx, %r9d
	jl	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%r8d, 12(%rsp)
	call	__printf_chk@PLT
	movl	12(%rsp), %r8d
	jmp	.L13
.L35:
	call	__stack_chk_fail@PLT
.L37:
	movslq	%esi, %r10
	movl	(%rbx,%r10,4), %r10d
	cmpl	%r10d, %ecx
	jge	.L21
	movl	%r10d, %ecx
	jmp	.L15
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.text
	.p2align 4
	.globl	extractMax
	.type	extractMax, @function
extractMax:
.LFB36:
	.cfi_startproc
	endbr64
	movl	heapSize(%rip), %r8d
	testl	%r8d, %r8d
	jle	.L51
	movslq	%r8d, %rax
	leaq	Q(%rip), %rsi
	subl	$1, %r8d
	movl	4+Q(%rip), %r10d
	movl	(%rsi,%rax,4), %r9d
	movl	$1, %eax
	movl	%r8d, heapSize(%rip)
	leal	(%rax,%rax), %ecx
	movl	%r9d, 4+Q(%rip)
	leal	1(%rcx), %edx
	cmpl	%ecx, %r8d
	jl	.L42
	.p2align 4,,10
	.p2align 3
.L53:
	movslq	%ecx, %rdi
	movl	(%rsi,%rdi,4), %edi
	cmpl	%edi, %r9d
	jge	.L42
	cmpl	%edx, %r8d
	jge	.L52
.L45:
	movl	%ecx, %edx
.L43:
	cmpl	%edx, %eax
	je	.L48
	movl	%edi, (%rsi,%rax,4)
	movslq	%edx, %rax
	movl	%r9d, (%rsi,%rax,4)
	movslq	%edx, %rax
	leal	(%rax,%rax), %ecx
	leal	1(%rcx), %edx
	cmpl	%ecx, %r8d
	jge	.L53
.L42:
	cmpl	%edx, %r8d
	jl	.L48
	movslq	%edx, %rcx
	movl	(%rsi,%rcx,4), %edi
	cmpl	%edi, %r9d
	jl	.L43
.L48:
	movl	%r10d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L51:
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
.L52:
	movslq	%edx, %r11
	movl	(%rsi,%r11,4), %r11d
	cmpl	%r11d, %edi
	jge	.L45
	movl	%r11d, %edi
	jmp	.L43
	.cfi_endproc
.LFE36:
	.size	extractMax, .-extractMax
	.p2align 4
	.globl	maxHeapify
	.type	maxHeapify, @function
maxHeapify:
.LFB37:
	.cfi_startproc
	endbr64
	movl	heapSize(%rip), %r9d
	leaq	Q(%rip), %rdx
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L61:
	movslq	%esi, %rcx
	movl	(%rdx,%rcx,4), %r8d
	movslq	%edi, %rcx
	movl	%r8d, %r10d
	cmpl	(%rdx,%rcx,4), %r8d
	jle	.L55
	cmpl	%eax, %r9d
	jge	.L60
	movl	%esi, %eax
.L56:
	cmpl	%edi, %eax
	je	.L54
	movl	(%rdx,%rcx,4), %esi
	movl	%r8d, (%rdx,%rcx,4)
	movslq	%eax, %rcx
	movl	%eax, %edi
	movl	%esi, (%rdx,%rcx,4)
.L58:
	leal	(%rdi,%rdi), %esi
	leal	1(%rsi), %eax
	cmpl	%esi, %r9d
	jge	.L61
.L55:
	cmpl	%eax, %r9d
	jl	.L54
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %r8d
	movslq	%edi, %rcx
	cmpl	%r8d, (%rdx,%rcx,4)
	jl	.L56
.L54:
	ret
.L60:
	movslq	%eax, %r8
	movl	(%rdx,%r8,4), %r8d
	cmpl	%r10d, %r8d
	jg	.L56
	movl	%r10d, %r8d
	movl	%esi, %eax
	jmp	.L56
	.cfi_endproc
.LFE37:
	.size	maxHeapify, .-maxHeapify
	.p2align 4
	.globl	insert
	.type	insert, @function
insert:
.LFB38:
	.cfi_startproc
	endbr64
	movl	heapSize(%rip), %eax
	leaq	Q(%rip), %rcx
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	%eax, heapSize(%rip)
	movl	%edi, (%rcx,%rdx,4)
	cmpl	$1, %eax
	jg	.L63
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L65:
	movl	%esi, (%rcx,%rdx,4)
	movl	%edi, (%rcx,%r8,4)
	cmpl	$1, %eax
	je	.L62
.L63:
	movslq	%eax, %rdx
	sarl	%eax
	movslq	%eax, %r8
	movl	(%rcx,%r8,4), %esi
	cmpl	%esi, %edi
	jg	.L65
.L62:
	ret
.L70:
	ret
	.cfi_endproc
.LFE38:
	.size	insert, .-insert
	.p2align 4
	.globl	increaseKey
	.type	increaseKey, @function
increaseKey:
.LFB39:
	.cfi_startproc
	endbr64
	leaq	Q(%rip), %rdx
	movslq	%edi, %rax
	movl	%esi, (%rdx,%rax,4)
	cmpl	$1, %edi
	jg	.L72
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L74:
	movl	%ecx, (%rdx,%rax,4)
	movl	%esi, (%rdx,%r8,4)
	cmpl	$1, %edi
	je	.L71
.L72:
	movslq	%edi, %rax
	sarl	%edi
	movslq	%edi, %r8
	movl	(%rdx,%r8,4), %ecx
	cmpl	%esi, %ecx
	jl	.L74
.L71:
	ret
.L79:
	ret
	.cfi_endproc
.LFE39:
	.size	increaseKey, .-increaseKey
	.p2align 4
	.globl	parent
	.type	parent, @function
parent:
.LFB40:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	ret
	.cfi_endproc
.LFE40:
	.size	parent, .-parent
	.p2align 4
	.globl	left
	.type	left, @function
left:
.LFB41:
	.cfi_startproc
	endbr64
	leal	(%rdi,%rdi), %eax
	ret
	.cfi_endproc
.LFE41:
	.size	left, .-left
	.p2align 4
	.globl	right
	.type	right, @function
right:
.LFB42:
	.cfi_startproc
	endbr64
	leal	1(%rdi,%rdi), %eax
	ret
	.cfi_endproc
.LFE42:
	.size	right, .-right
	.globl	heapSize
	.bss
	.align 4
	.type	heapSize, @object
	.size	heapSize, 4
heapSize:
	.zero	4
	.globl	Q
	.align 32
	.type	Q, @object
	.size	Q, 8000000
Q:
	.zero	8000000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"insert"
.LC2:
	.string	"%d"
.LC3:
	.string	"extract"
.LC4:
	.string	"heap size is 0!"
.LC5:
	.string	"%d\n"
.LC6:
	.string	"end"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC4(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC5(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movabsq	$32760367481649253, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	Q(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movl	$0, 24(%rsp)
	leaq	30(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1702063721, (%r15)
	je	.L33
.L3:
	cmpq	%r12, (%r15)
	je	.L34
	cmpl	$6581861, (%r15)
	jne	.L2
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L33:
	.cfi_restore_state
	cmpw	$29810, 4(%r15)
	jne	.L3
	cmpb	$0, 6(%r15)
	jne	.L3
	leaq	.LC2(%rip), %rdi
	leaq	24(%rsp), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	heapSize(%rip), %eax
	movl	24(%rsp), %edi
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	%eax, heapSize(%rip)
	movl	%edi, (%rbx,%rdx,4)
	cmpl	$1, %eax
	jg	.L6
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%ecx, (%rbx,%rdx,4)
	movl	%edi, (%rbx,%rsi,4)
	cmpl	$1, %eax
	je	.L2
.L6:
	movslq	%eax, %rdx
	sarl	%eax
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %ecx
	cmpl	%ecx, %edi
	jg	.L8
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L34:
	movl	heapSize(%rip), %edi
	xorl	%r8d, %r8d
	testl	%edi, %edi
	jle	.L36
	movslq	%edi, %rax
	subl	$1, %edi
	movl	4+Q(%rip), %r8d
	movl	(%rbx,%rax,4), %r9d
	movl	$1, %eax
	movl	%edi, heapSize(%rip)
	leal	(%rax,%rax), %edx
	movl	%r9d, 4+Q(%rip)
	leal	1(%rdx), %esi
	cmpl	%edx, %edi
	jl	.L14
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	%edx, %rcx
	movl	(%rbx,%rcx,4), %ecx
	cmpl	%ecx, %r9d
	jge	.L14
	cmpl	%esi, %edi
	jge	.L37
.L21:
	movl	%edx, %esi
.L15:
	cmpl	%esi, %eax
	je	.L13
	movl	%ecx, (%rbx,%rax,4)
	movslq	%esi, %rax
	movl	%r9d, (%rbx,%rax,4)
	movslq	%esi, %rax
	leal	(%rax,%rax), %edx
	leal	1(%rdx), %esi
	cmpl	%edx, %edi
	jge	.L38
.L14:
	cmpl	%esi, %edi
	jl	.L13
	movslq	%esi, %rdx
	movl	(%rbx,%rdx,4), %ecx
	cmpl	%ecx, %r9d
	jl	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%r8d, 12(%rsp)
	call	__printf_chk@PLT
	movl	12(%rsp), %r8d
	jmp	.L13
.L35:
	call	__stack_chk_fail@PLT
.L37:
	movslq	%esi, %r10
	movl	(%rbx,%r10,4), %r10d
	cmpl	%r10d, %ecx
	jge	.L21
	movl	%r10d, %ecx
	jmp	.L15
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.text
	.p2align 4
	.globl	extractMax
	.type	extractMax, @function
extractMax:
.LFB36:
	.cfi_startproc
	endbr64
	movl	heapSize(%rip), %r8d
	testl	%r8d, %r8d
	jle	.L51
	movslq	%r8d, %rax
	leaq	Q(%rip), %rsi
	subl	$1, %r8d
	movl	4+Q(%rip), %r10d
	movl	(%rsi,%rax,4), %r9d
	movl	$1, %eax
	movl	%r8d, heapSize(%rip)
	leal	(%rax,%rax), %ecx
	movl	%r9d, 4+Q(%rip)
	leal	1(%rcx), %edx
	cmpl	%ecx, %r8d
	jl	.L42
	.p2align 4,,10
	.p2align 3
.L53:
	movslq	%ecx, %rdi
	movl	(%rsi,%rdi,4), %edi
	cmpl	%edi, %r9d
	jge	.L42
	cmpl	%edx, %r8d
	jge	.L52
.L45:
	movl	%ecx, %edx
.L43:
	cmpl	%edx, %eax
	je	.L48
	movl	%edi, (%rsi,%rax,4)
	movslq	%edx, %rax
	movl	%r9d, (%rsi,%rax,4)
	movslq	%edx, %rax
	leal	(%rax,%rax), %ecx
	leal	1(%rcx), %edx
	cmpl	%ecx, %r8d
	jge	.L53
.L42:
	cmpl	%edx, %r8d
	jl	.L48
	movslq	%edx, %rcx
	movl	(%rsi,%rcx,4), %edi
	cmpl	%edi, %r9d
	jl	.L43
.L48:
	movl	%r10d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L51:
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
.L52:
	movslq	%edx, %r11
	movl	(%rsi,%r11,4), %r11d
	cmpl	%r11d, %edi
	jge	.L45
	movl	%r11d, %edi
	jmp	.L43
	.cfi_endproc
.LFE36:
	.size	extractMax, .-extractMax
	.p2align 4
	.globl	maxHeapify
	.type	maxHeapify, @function
maxHeapify:
.LFB37:
	.cfi_startproc
	endbr64
	movl	heapSize(%rip), %r9d
	leaq	Q(%rip), %rdx
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L61:
	movslq	%esi, %rcx
	movl	(%rdx,%rcx,4), %r8d
	movslq	%edi, %rcx
	movl	%r8d, %r10d
	cmpl	(%rdx,%rcx,4), %r8d
	jle	.L55
	cmpl	%eax, %r9d
	jge	.L60
	movl	%esi, %eax
.L56:
	cmpl	%edi, %eax
	je	.L54
	movl	(%rdx,%rcx,4), %esi
	movl	%r8d, (%rdx,%rcx,4)
	movslq	%eax, %rcx
	movl	%eax, %edi
	movl	%esi, (%rdx,%rcx,4)
.L58:
	leal	(%rdi,%rdi), %esi
	leal	1(%rsi), %eax
	cmpl	%esi, %r9d
	jge	.L61
.L55:
	cmpl	%eax, %r9d
	jl	.L54
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %r8d
	movslq	%edi, %rcx
	cmpl	%r8d, (%rdx,%rcx,4)
	jl	.L56
.L54:
	ret
.L60:
	movslq	%eax, %r8
	movl	(%rdx,%r8,4), %r8d
	cmpl	%r10d, %r8d
	jg	.L56
	movl	%r10d, %r8d
	movl	%esi, %eax
	jmp	.L56
	.cfi_endproc
.LFE37:
	.size	maxHeapify, .-maxHeapify
	.p2align 4
	.globl	insert
	.type	insert, @function
insert:
.LFB38:
	.cfi_startproc
	endbr64
	movl	heapSize(%rip), %eax
	leaq	Q(%rip), %rcx
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	%eax, heapSize(%rip)
	movl	%edi, (%rcx,%rdx,4)
	cmpl	$1, %eax
	jg	.L63
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L65:
	movl	%esi, (%rcx,%rdx,4)
	movl	%edi, (%rcx,%r8,4)
	cmpl	$1, %eax
	je	.L62
.L63:
	movslq	%eax, %rdx
	sarl	%eax
	movslq	%eax, %r8
	movl	(%rcx,%r8,4), %esi
	cmpl	%esi, %edi
	jg	.L65
.L62:
	ret
.L70:
	ret
	.cfi_endproc
.LFE38:
	.size	insert, .-insert
	.p2align 4
	.globl	increaseKey
	.type	increaseKey, @function
increaseKey:
.LFB39:
	.cfi_startproc
	endbr64
	leaq	Q(%rip), %rdx
	movslq	%edi, %rax
	movl	%esi, (%rdx,%rax,4)
	cmpl	$1, %edi
	jg	.L72
	jmp	.L79
	.p2align 4,,10
	.p2align 3
.L74:
	movl	%ecx, (%rdx,%rax,4)
	movl	%esi, (%rdx,%r8,4)
	cmpl	$1, %edi
	je	.L71
.L72:
	movslq	%edi, %rax
	sarl	%edi
	movslq	%edi, %r8
	movl	(%rdx,%r8,4), %ecx
	cmpl	%esi, %ecx
	jl	.L74
.L71:
	ret
.L79:
	ret
	.cfi_endproc
.LFE39:
	.size	increaseKey, .-increaseKey
	.p2align 4
	.globl	parent
	.type	parent, @function
parent:
.LFB40:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	ret
	.cfi_endproc
.LFE40:
	.size	parent, .-parent
	.p2align 4
	.globl	left
	.type	left, @function
left:
.LFB41:
	.cfi_startproc
	endbr64
	leal	(%rdi,%rdi), %eax
	ret
	.cfi_endproc
.LFE41:
	.size	left, .-left
	.p2align 4
	.globl	right
	.type	right, @function
right:
.LFB42:
	.cfi_startproc
	endbr64
	leal	1(%rdi,%rdi), %eax
	ret
	.cfi_endproc
.LFE42:
	.size	right, .-right
	.globl	heapSize
	.bss
	.align 4
	.type	heapSize, @object
	.size	heapSize, 4
heapSize:
	.zero	4
	.globl	Q
	.align 32
	.type	Q, @object
	.size	Q, 8000000
Q:
	.zero	8000000
	.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 <string.h>
#include <limits.h>

#define MAX 2000000
  
int Q[MAX] = {}; 
int heapSize=0;
 
int parent(int);
int left(int);
int right(int);
void maxHeapify(int);
int extractMax(void);
void insert(int);
void increaseKey(int, int);
  
// 
int main(void)
{
  char op[10];
  int val=0;

  while (1)
  {
    scanf("%s", op);
    if (strcmp(op, "insert") == 0)
    {
      scanf("%d", &val);
      insert(val);
    }
    else if (strcmp(op, "extract") == 0)
    {
      printf("%d\n", extractMax());
    }
    else if (strcmp(op, "end") == 0)
    {
      break;
    }
  }
  return 0;
}

int extractMax(void) {
  if(heapSize < 1){
    printf("heap size is 0!");
    return 0;
  }
  int max = Q[1];
  Q[1] = Q[heapSize];
  heapSize--;
  maxHeapify(1);
  return max;
}
 
void maxHeapify(int i)
{
  int largest=0, temp=0, l=0, r=0;
 
  l = left(i);
  r = right(i);
   
  if((heapSize >= l) && (Q[l] > Q[i])){
    largest = l;
  }
  else{
    largest = i;
  }
    
  if((heapSize >= r) && (Q[r] > Q[largest])){
    largest = r;
  }
 
  if (largest != i){
    temp = Q[i];
    Q[i] = Q[largest];
    Q[largest] = temp;
    maxHeapify(largest);
  } 
 
}

void insert(int key) {
  heapSize++;
  Q[heapSize] = INT_MIN;
  increaseKey(heapSize, key);
}

void increaseKey(int i, int key) {
  Q[i] = key;
  while(i > 1 && Q[parent(i)] < Q[i]){
    int tmp = Q[i];
    Q[i] = Q[parent(i)];
    Q[parent(i)] = tmp;
    i = parent(i);
  }
}

int parent(int i) {
  return (int)(i/2);
}

int left(int i)
{
  return (2*i);
}
  
int right(int i)
{
  return (2*i + 1);
}


insert 8
insert 1
extract
insert 10
extract
insert 11
extract
extract
end
 insert 9
insert 2
extract
insert 10
extract
insert 11
extract
extract
end
 insert 8
insert 2
extract
insert 16
extract
insert 11
extract
extract
end
 insert 8
insert 1
extract
insert 15
extract
insert 11
extract
extract
end
 insert 8
insert 0
extract
insert 10
extract
insert 11
extract
extract
end
 insert 8
insert 2
extract
insert 8
extract
insert 11
extract
extract
end
 insert 8
insert 2
extract
insert 4
extract
insert 11
extract
extract
end
 insert 8
insert 2
extract
insert 10
extract
insert 14
extract
extract
end
 insert 9
insert 2
extract
insert 4
extract
insert 11
extract
extract
end
 insert 8
insert 0
extract
insert 4
extract
insert 11
extract
extract
end

8
10
11
1
 9
10
11
2
 8
16
11
2
 8
15
11
1
 8
10
11
0
 8
8
11
2
 8
4
11
2
 8
10
14
2
 9
4
11
2
 8
4
11
0

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 <string.h>
#include <limits.h>

#define MAX 2000000
  
int Q[MAX] = {}; 
int heapSize=0;
 
int parent(int);
int left(int);
int right(int);
void maxHeapify(int);
int extractMax(void);
void insert(int);
void increaseKey(int, int);
  
// 
int main(void)
{
  char op[10];
  int val=0;

  while (1)
  {
    scanf("%s", op);
    if (strcmp(op, "insert") == 0)
    {
      scanf("%d", &val);
      insert(val);
    }
    else if (strcmp(op, "extract") == 0)
    {
      printf("%d\n", extractMax());
    }
    else if (strcmp(op, "end") == 0)
    {
      break;
    }
  }
  return 0;
}

int extractMax(void) {
  if(heapSize < 1){
    printf("heap size is 0!");
    return 0;
  }
  int max = Q[1];
  Q[1] = Q[heapSize];
  heapSize--;
  maxHeapify(1);
  return max;
}
 
void maxHeapify(int i)
{
  int largest=0, temp=0, l=0, r=0;
 
  l = left(i);
  r = right(i);
   
  if((heapSize >= l) && (Q[l] > Q[i])){
    largest = l;
  }
  else{
    largest = i;
  }
    
  if((heapSize >= r) && (Q[r] > Q[largest])){
    largest = r;
  }
 
  if (largest != i){
    temp = Q[i];
    Q[i] = Q[largest];
    Q[largest] = temp;
    maxHeapify(largest);
  } 
 
}

void insert(int key) {
  heapSize++;
  Q[heapSize] = INT_MIN;
  increaseKey(heapSize, key);
}

void increaseKey(int i, int key) {
  Q[i] = key;
  while(i > 1 && Q[parent(i)] < Q[i]){
    int tmp = Q[i];
    Q[i] = Q[parent(i)];
    Q[parent(i)] = tmp;
    i = parent(i);
  }
}

int parent(int i) {
  return (int)(i/2);
}

int left(int i)
{
  return (2*i);
}
  
int right(int i)
{
  return (2*i + 1);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	Q
	.bss
	.align 32
	.type	Q, @object
	.size	Q, 8000000
Q:
	.zero	8000000
	.globl	heapSize
	.align 4
	.type	heapSize, @object
	.size	heapSize, 4
heapSize:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"insert"
.LC2:
	.string	"%d"
.LC3:
	.string	"extract"
.LC4:
	.string	"%d\n"
.LC5:
	.string	"end"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
.L6:
	leaq	-18(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-18(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L2
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	insert
	jmp	.L6
.L2:
	leaq	-18(%rbp), %rax
	leaq	.LC3(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L4
	call	extractMax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L6
.L4:
	leaq	-18(%rbp), %rax
	leaq	.LC5(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L10
	jmp	.L6
.L10:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC6:
	.string	"heap size is 0!"
	.text
	.globl	extractMax
	.type	extractMax, @function
extractMax:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	heapSize(%rip), %eax
	testl	%eax, %eax
	jg	.L12
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L13
.L12:
	movl	4+Q(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	heapSize(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, 4+Q(%rip)
	movl	heapSize(%rip), %eax
	subl	$1, %eax
	movl	%eax, heapSize(%rip)
	movl	$1, %edi
	call	maxHeapify
	movl	-4(%rbp), %eax
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	extractMax, .-extractMax
	.globl	maxHeapify
	.type	maxHeapify, @function
maxHeapify:
.LFB2:
	.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
	movl	%edi, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	left
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	right
	movl	%eax, -4(%rbp)
	movl	heapSize(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L15
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L15
	movl	-8(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L16
.L15:
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
.L16:
	movl	heapSize(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L17
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	-4(%rbp), %eax
	movl	%eax, -16(%rbp)
.L17:
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	je	.L19
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Q(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	maxHeapify
.L19:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	maxHeapify, .-maxHeapify
	.globl	insert
	.type	insert, @function
insert:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	heapSize(%rip), %eax
	addl	$1, %eax
	movl	%eax, heapSize(%rip)
	movl	heapSize(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	$-2147483648, (%rdx,%rax)
	movl	heapSize(%rip), %eax
	movl	-4(%rbp), %edx
	movl	%edx, %esi
	movl	%eax, %edi
	call	increaseKey
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	insert, .-insert
	.globl	increaseKey
	.type	increaseKey, @function
increaseKey:
.LFB4:
	.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L22
.L24:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Q(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	movl	%eax, -20(%rbp)
.L22:
	cmpl	$1, -20(%rbp)
	jle	.L25
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L24
.L25:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	increaseKey, .-increaseKey
	.globl	parent
	.type	parent, @function
parent:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	parent, .-parent
	.globl	left
	.type	left, @function
left:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	left, .-left
	.globl	right
	.type	right, @function
right:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	right, .-right
	.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	Q
	.bss
	.align 32
	.type	Q, @object
	.size	Q, 8000000
Q:
	.zero	8000000
	.globl	heapSize
	.align 4
	.type	heapSize, @object
	.size	heapSize, 4
heapSize:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"insert"
.LC2:
	.string	"%d"
.LC3:
	.string	"extract"
.LC4:
	.string	"%d\n"
.LC5:
	.string	"end"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
.L6:
	leaq	-18(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-18(%rbp), %rax
	leaq	.LC1(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L2
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	movl	%eax, %edi
	call	insert
	jmp	.L6
.L2:
	leaq	-18(%rbp), %rax
	leaq	.LC3(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L4
	call	extractMax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L6
.L4:
	leaq	-18(%rbp), %rax
	leaq	.LC5(%rip), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L10
	jmp	.L6
.L10:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC6:
	.string	"heap size is 0!"
	.text
	.globl	extractMax
	.type	extractMax, @function
extractMax:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	heapSize(%rip), %eax
	testl	%eax, %eax
	jg	.L12
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L13
.L12:
	movl	4+Q(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	heapSize(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, 4+Q(%rip)
	movl	heapSize(%rip), %eax
	subl	$1, %eax
	movl	%eax, heapSize(%rip)
	movl	$1, %edi
	call	maxHeapify
	movl	-4(%rbp), %eax
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	extractMax, .-extractMax
	.globl	maxHeapify
	.type	maxHeapify, @function
maxHeapify:
.LFB2:
	.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
	movl	%edi, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	left
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	right
	movl	%eax, -4(%rbp)
	movl	heapSize(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L15
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L15
	movl	-8(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L16
.L15:
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
.L16:
	movl	heapSize(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L17
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	-4(%rbp), %eax
	movl	%eax, -16(%rbp)
.L17:
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	je	.L19
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Q(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-16(%rbp), %eax
	movl	%eax, %edi
	call	maxHeapify
.L19:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	maxHeapify, .-maxHeapify
	.globl	insert
	.type	insert, @function
insert:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	heapSize(%rip), %eax
	addl	$1, %eax
	movl	%eax, heapSize(%rip)
	movl	heapSize(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	$-2147483648, (%rdx,%rax)
	movl	heapSize(%rip), %eax
	movl	-4(%rbp), %edx
	movl	%edx, %esi
	movl	%eax, %edi
	call	increaseKey
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	insert, .-insert
	.globl	increaseKey
	.type	increaseKey, @function
increaseKey:
.LFB4:
	.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
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L22
.L24:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Q(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	movl	%eax, -20(%rbp)
.L22:
	cmpl	$1, -20(%rbp)
	jle	.L25
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	parent
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Q(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Q(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jl	.L24
.L25:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	increaseKey, .-increaseKey
	.globl	parent
	.type	parent, @function
parent:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	parent, .-parent
	.globl	left
	.type	left, @function
left:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	left, .-left
	.globl	right
	.type	right, @function
right:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	right, .-right
	.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:
