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

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

void step(int **G, long **cost, char *flag, int u, long *d) {
  int i,j;
  long t = d[u];
  for (i = 0;; i++) {
    j = G[u][i];
    if(j == -1) break;
    if(d[j] == -1 || d[j] > t+cost[u][i]) {
      flag[j] = 1;
      d[j] = t+cost[u][i];
    }
  }
}

void solve(int **G, long **cost, int n, long *d) {
  int i,j;
  char *flag,*new_flag;
  flag = (char*)malloc(sizeof(char) * n);
  new_flag = (char*)malloc(sizeof(char) * n);
  flag[0] = 1;
  for (i = 1; i < n; i++) flag[i] = 0;
  while(1) {
    for (i = 0; i < n; i++) new_flag[i] = 0;
    for (i = 0; i < n; i++) 
      if(flag[i] == 1) step(G,cost,new_flag,i,d);
    j = 0;
    for (i = 0; i < n; i++) {
      j += new_flag[i];
      flag[i] = new_flag[i];
    }
    if(j == 0) break;
  }
    
  return;
}

void sort(long *A, int *B, int a, int b){
  if(b == a+1) return;
  int m = a+(b-a)/2;
  sort(A,B,a,m);
  sort(A,B,m,b);
  int i,j,t;
  long *newA;
  int *newB;
  newA = (long*)malloc(sizeof(long)*(b-a));
  newB = (int*)malloc(sizeof(int) * (b-a));
  if(b-a == 0) printf("a");
  i = 0;j = 0;t = 0;
  while(t < b-a) {
    if((a+i < m && A[a+i] < A[m+j]) || m+j == b) {
      newA[t] = A[a+i];
      newB[t] = B[a+i];
      i++;
    }
    else{
      newA[t] = A[m+j];
      newB[t] = B[m+j];
      j++;
    }
    t++;
  }
  for (i = 0; i < b-a; i++) {
    A[a+i] = newA[i];
    B[a+i] = newB[i];
  }
  free(newA);
  free(newB);
}

int main()
{
  int n;
  int i,j,u,k,v;
  int **G;
  long **cost,c;
  long *d;
  scanf("%d",&n);
  G = (int**)malloc(sizeof(int*) * n);
  cost = (long**)malloc(sizeof(long*) * n);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &u, &k);
    G[u] = (int*)malloc(sizeof(int) * (k+1));
    cost[u] = (long*)malloc(sizeof(long) * k);
    for (j = 0; j < k; j++) {
      scanf("%d %ld", &v, &c);
      G[u][j] = v;
      cost[u][j] = c;
    }
    if(k != 0)sort(cost[u],G[u],0,k);
    G[u][k] = -1;
  }
  d = (long*)malloc(sizeof(long) * n);
  d[0] = 0;
  for (i = 1; i < n; i++) {
    d[i] = -1;
  }
  solve(G,cost,n,d);
  for (i = 0; i < n; i++) {
    printf("%d %ld\n", i, d[i]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	step
	.type	step, @function
step:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movl	%ecx, -44(%rbp)
	movq	%r8, -56(%rbp)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	$0, -16(%rbp)
.L6:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	je	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	$-1, %rax
	je	.L4
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	cmpq	%rdx, %rax
	jle	.L5
.L4:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L5:
	addl	$1, -16(%rbp)
	jmp	.L6
.L8:
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	step, .-step
	.globl	solve
	.type	solve, @function
solve:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movq	%rcx, -64(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movb	$1, (%rax)
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	addl	$1, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L11
.L21:
	movl	$0, -24(%rbp)
	jmp	.L12
.L13:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	addl	$1, -24(%rbp)
.L12:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L13
	movl	$0, -24(%rbp)
	jmp	.L14
.L16:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$1, %al
	jne	.L15
	movq	-64(%rbp), %rdi
	movl	-24(%rbp), %ecx
	movq	-8(%rbp), %rdx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	step
.L15:
	addl	$1, -24(%rbp)
.L14:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L16
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L17
.L18:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	addl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	addl	$1, -24(%rbp)
.L17:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L18
	cmpl	$0, -20(%rbp)
	je	.L24
	jmp	.L21
.L24:
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	solve, .-solve
	.globl	sort
	.type	sort, @function
sort:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movl	%ecx, -56(%rbp)
	movl	-52(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -56(%rbp)
	je	.L37
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %ecx
	movl	-52(%rbp), %edx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort
	movl	-56(%rbp), %ecx
	movl	-20(%rbp), %edx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	-56(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jne	.L28
	movl	$97, %edi
	call	putchar@PLT
.L28:
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L29
.L34:
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L30
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %ecx
	movl	-28(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L31
.L30:
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -56(%rbp)
	jne	.L32
.L31:
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -32(%rbp)
	jmp	.L33
.L32:
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -28(%rbp)
.L33:
	addl	$1, -24(%rbp)
.L29:
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L34
	movl	$0, -32(%rbp)
	jmp	.L35
.L36:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	-52(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	-52(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -32(%rbp)
.L35:
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L36
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	jmp	.L25
.L37:
	nop
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sort, .-sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %ld"
.LC3:
	.string	"%d %ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	-80(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L39
.L43:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$2, %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movl	-72(%rbp), %eax
	cltq
	salq	$3, %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movl	$0, -60(%rbp)
	jmp	.L40
.L41:
	leaq	-56(%rbp), %rdx
	leaq	-68(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-68(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-56(%rbp), %rax
	movq	%rax, (%rdx)
	addl	$1, -60(%rbp)
.L40:
	movl	-72(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L41
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	je	.L42
	movl	-72(%rbp), %edx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rsi
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movl	%edx, %ecx
	movl	$0, %edx
	movq	%rax, %rdi
	call	sort
.L42:
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-72(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	addl	$1, -64(%rbp)
.L39:
	movl	-80(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L43
	movl	-80(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movq	$0, (%rax)
	movl	$1, -64(%rbp)
	jmp	.L44
.L45:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	$-1, (%rax)
	addl	$1, -64(%rbp)
.L44:
	movl	-80(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L45
	movl	-80(%rbp), %edx
	movq	-32(%rbp), %rcx
	movq	-40(%rbp), %rsi
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	solve
	movl	$0, -64(%rbp)
	jmp	.L46
.L47:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -64(%rbp)
.L46:
	movl	-80(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L47
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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
	.type	sort.part.0, @function
sort.part.0:
.LFB43:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%ecx, %r8d
	movq	%rsi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%ecx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%edx, %rbp
	subl	%ebp, %r8d
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	movl	%r8d, %r12d
	shrl	$31, %r12d
	addl	%r8d, %r12d
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	sarl	%r12d
	leal	0(%rbp,%r12), %r14d
	cmpl	$1, %r12d
	je	.L2
	movl	%r14d, %ecx
	movl	%ebp, %edx
	movl	%r8d, 8(%rsp)
	call	sort.part.0
	movl	8(%rsp), %r8d
.L2:
	leal	1(%r14), %eax
	cmpl	%eax, %r13d
	je	.L3
	movl	%r13d, %ecx
	movl	%r14d, %edx
	movq	%r15, %rsi
	movq	%rbx, %rdi
	movl	%r8d, 8(%rsp)
	call	sort.part.0
	movl	8(%rsp), %r8d
.L3:
	movslq	%r8d, %rdx
	movl	%r8d, 32(%rsp)
	leaq	0(,%rdx,8), %rdi
	movq	%rdx, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rdx
	movq	%rax, 16(%rsp)
	leaq	0(,%rdx,4), %rdi
	call	malloc@PLT
	cmpl	%ebp, %r13d
	movl	32(%rsp), %r8d
	movq	%rax, 24(%rsp)
	je	.L24
.L4:
	testl	%r8d, %r8d
	jle	.L13
	movq	16(%rsp), %rcx
	leal	-1(%r8), %eax
	movq	24(%rsp), %rsi
	xorl	%edi, %edi
	movq	%rax, 32(%rsp)
	movl	%r8d, %eax
	movq	%rax, 40(%rsp)
	leaq	(%rcx,%rax,8), %rax
	movq	%rcx, %rdx
	xorl	%ecx, %ecx
	movq	%rax, 8(%rsp)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	%r10d, %r8
	movslq	%eax, %r11
	movq	(%rbx,%r8,8), %r9
	cmpq	(%rbx,%r11,8), %r9
	jge	.L6
.L7:
	movl	(%r15,%r8,4), %eax
	movq	%r9, (%rdx)
	addl	$1, %ecx
	addq	$8, %rdx
	addq	$4, %rsi
	movl	%eax, -4(%rsi)
	cmpq	8(%rsp), %rdx
	je	.L25
.L10:
	leal	0(%rbp,%rcx), %r10d
	leal	(%r14,%rdi), %eax
	cmpl	%ecx, %r12d
	jg	.L26
.L6:
	cmpl	%eax, %r13d
	je	.L27
	cltq
	addl	$1, %edi
	addq	$8, %rdx
	addq	$4, %rsi
	movq	(%rbx,%rax,8), %r8
	movl	(%r15,%rax,4), %eax
	movq	%r8, -8(%rdx)
	movl	%eax, -4(%rsi)
	cmpq	8(%rsp), %rdx
	jne	.L10
.L25:
	movq	32(%rsp), %rax
	leaq	(%rbx,%rbp,8), %rdi
	leaq	(%r15,%rbp,4), %r12
	leaq	1(%rbp,%rax), %rax
	leaq	(%r15,%rax,4), %rdx
	cmpq	%rdx, %rdi
	jnb	.L16
	leaq	(%rbx,%rax,8), %rax
	cmpq	%rax, %r12
	jb	.L11
.L16:
	movq	40(%rsp), %rbx
	movq	16(%rsp), %rsi
	leaq	0(,%rbx,8), %rdx
	call	memcpy@PLT
	movq	24(%rsp), %rsi
	leaq	0(,%rbx,4), %rdx
	movq	%r12, %rdi
	call	memcpy@PLT
.L13:
	movq	16(%rsp), %rdi
	call	free@PLT
	movq	24(%rsp), %rdi
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movslq	%r10d, %r8
	movq	(%rbx,%r8,8), %r9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L24:
	movl	$97, %edi
	movl	%r8d, 8(%rsp)
	call	putchar@PLT
	movl	8(%rsp), %r8d
	jmp	.L4
.L11:
	movq	16(%rsp), %rcx
	movq	24(%rsp), %rsi
	xorl	%eax, %eax
	movq	40(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L14:
	movq	(%rcx,%rax,8), %rdx
	movq	%rdx, (%rdi,%rax,8)
	movl	(%rsi,%rax,4), %edx
	movl	%edx, (%r12,%rax,4)
	addq	$1, %rax
	cmpq	%r8, %rax
	jne	.L14
	jmp	.L13
	.cfi_endproc
.LFE43:
	.size	sort.part.0, .-sort.part.0
	.p2align 4
	.globl	step
	.type	step, @function
step:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	%ecx, %rcx
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	(%r8,%rcx,8), %r11
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdx, %rbx
	leaq	0(,%rcx,8), %rdx
	leaq	(%rdi,%rdx), %r12
	leaq	(%rsi,%rdx), %r10
	movq	(%r12), %r9
	movslq	(%r9), %rax
	cmpl	$-1, %eax
	je	.L28
	xorl	%edx, %edx
	movl	$4, %ecx
	.p2align 4,,10
	.p2align 3
.L33:
	leaq	(%r8,%rax,8), %rsi
	movq	(%rsi), %rdi
	cmpq	$-1, %rdi
	je	.L30
	movq	(%r10), %rbp
	movq	0(%rbp,%rdx), %r14
	addq	%r11, %r14
	cmpq	%r14, %rdi
	jle	.L31
.L30:
	movb	$1, (%rbx,%rax)
	movq	(%r10), %rax
	movq	(%r12), %r9
	movq	(%rax,%rdx), %rdi
	addq	%r11, %rdi
	movq	%rdi, (%rsi)
.L31:
	movslq	(%r9,%rcx), %rax
	addq	$8, %rdx
	addq	$4, %rcx
	cmpl	$-1, %eax
	jne	.L33
.L28:
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	step, .-step
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB40:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%edx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rcx, %r12
	movq	%r13, %r14
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, 8(%rsp)
	movq	%r13, %rdi
	movq	%rsi, 16(%rsp)
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movb	$1, 0(%rbp)
	movq	%rax, %rbx
	cmpl	$1, %r13d
	jle	.L75
	leal	-1(%r13), %edx
	leaq	1(%rbp), %rdi
	xorl	%esi, %esi
	movl	%edx, 24(%rsp)
	call	memset@PLT
.L45:
	movl	%r14d, %eax
	shrl	$4, %eax
	leal	-1(%rax), %r15d
	movl	%r14d, %eax
	andl	$-16, %eax
	addq	$1, %r15
	movl	%eax, 28(%rsp)
	salq	$4, %r15
	.p2align 4,,10
	.p2align 3
.L44:
	testl	%r14d, %r14d
	jle	.L42
	movl	24(%rsp), %r13d
	xorl	%esi, %esi
	movq	%rbx, %rdi
	leaq	1(%r13), %rdx
	call	memset@PLT
	xorl	%ecx, %ecx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L50:
	leaq	1(%rcx), %rax
	cmpq	%r13, %rcx
	je	.L76
.L58:
	movq	%rax, %rcx
.L48:
	cmpb	$1, 0(%rbp,%rcx)
	jne	.L50
	movq	8(%rsp), %rax
	movq	(%r12,%rcx,8), %r9
	movq	(%rax,%rcx,8), %r8
	movslq	(%r8), %rax
	cmpl	$-1, %eax
	je	.L50
	movq	16(%rsp), %rdi
	xorl	%edx, %edx
	movq	(%rdi,%rcx,8), %r10
	.p2align 4,,10
	.p2align 3
.L53:
	leaq	(%r12,%rax,8), %rsi
	movq	(%r10,%rdx,8), %r11
	movq	(%rsi), %rdi
	addq	%r9, %r11
	cmpq	$-1, %rdi
	je	.L51
	cmpq	%r11, %rdi
	jle	.L52
.L51:
	movb	$1, (%rbx,%rax)
	movq	%r11, (%rsi)
.L52:
	addq	$1, %rdx
	movslq	(%r8,%rdx,4), %rax
	cmpl	$-1, %eax
	jne	.L53
	leaq	1(%rcx), %rax
	cmpq	%r13, %rcx
	jne	.L58
	.p2align 4,,10
	.p2align 3
.L76:
	cmpl	$14, 24(%rsp)
	jbe	.L59
	pxor	%xmm0, %xmm0
	pxor	%xmm7, %xmm7
	pxor	%xmm6, %xmm6
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L55:
	movdqu	(%rbx,%rax), %xmm4
	movdqa	%xmm7, %xmm1
	movdqa	%xmm6, %xmm5
	pcmpgtb	%xmm4, %xmm1
	movdqa	%xmm4, %xmm3
	movdqa	%xmm4, %xmm2
	movups	%xmm4, 0(%rbp,%rax)
	addq	$16, %rax
	punpcklbw	%xmm1, %xmm3
	punpckhbw	%xmm1, %xmm2
	pcmpgtw	%xmm3, %xmm5
	movdqa	%xmm3, %xmm1
	punpcklwd	%xmm5, %xmm1
	punpckhwd	%xmm5, %xmm3
	paddd	%xmm1, %xmm0
	movdqa	%xmm6, %xmm1
	pcmpgtw	%xmm2, %xmm1
	paddd	%xmm3, %xmm0
	movdqa	%xmm2, %xmm3
	punpcklwd	%xmm1, %xmm3
	punpckhwd	%xmm1, %xmm2
	paddd	%xmm3, %xmm0
	paddd	%xmm2, %xmm0
	cmpq	%r15, %rax
	jne	.L55
	movdqa	%xmm0, %xmm1
	movl	28(%rsp), %edi
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r14d, %edi
	je	.L56
	movl	%edi, %edx
.L54:
	movslq	%edx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	1(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	2(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	3(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	4(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	5(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	6(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	7(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	8(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	9(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	10(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	11(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	12(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	13(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	addl	$14, %edx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	addl	%edi, %eax
	cmpl	%edx, %r14d
	jle	.L56
	movslq	%edx, %rdx
	movsbl	(%rbx,%rdx), %esi
	movb	%sil, 0(%rbp,%rdx)
	addl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L56:
	testl	%eax, %eax
	jne	.L44
.L42:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L59:
	.cfi_restore_state
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L54
.L75:
	leal	-1(%r13), %eax
	movl	%eax, 24(%rsp)
	jmp	.L45
	.cfi_endproc
.LFE40:
	.size	solve, .-solve
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB41:
	.cfi_startproc
	endbr64
	leal	1(%rdx), %eax
	cmpl	%ecx, %eax
	je	.L77
	jmp	sort.part.0
	.p2align 4,,10
	.p2align 3
.L77:
	ret
	.cfi_endproc
.LFE41:
	.size	sort, .-sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %ld"
.LC3:
	.string	"%d %ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %r13
	movq	%r13, %r14
	salq	$3, %r13
	movq	%r13, %rdi
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%rax, 8(%rsp)
	testl	%r14d, %r14d
	jle	.L80
	leaq	56(%rsp), %rax
	movl	$0, 20(%rsp)
	leaq	.LC2(%rip), %r14
	movq	%rax, 40(%rsp)
	leaq	52(%rsp), %rax
	movq	%rax, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L86:
	movq	32(%rsp), %rsi
	movq	40(%rsp), %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %r15d
	movslq	52(%rsp), %rbx
	leal	1(%r15), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movslq	%r15d, %rdi
	movq	%rax, 0(%rbp,%rbx,8)
	salq	$3, %rdi
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rcx
	testl	%r15d, %r15d
	movq	24(%rsp), %rsi
	movq	%rax, (%rcx,%rbx,8)
	jle	.L81
	xorl	%r12d, %r12d
	leaq	64(%rsp), %r13
	leaq	60(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L82:
	movq	%r13, %rdx
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	52(%rsp), %rax
	movl	60(%rsp), %edx
	movq	8(%rsp), %rcx
	movl	56(%rsp), %r15d
	movq	0(%rbp,%rax,8), %rsi
	movq	(%rcx,%rax,8), %rax
	movl	%edx, (%rsi,%r12,4)
	movq	64(%rsp), %rdx
	movq	%rdx, (%rax,%r12,8)
	addq	$1, %r12
	cmpl	%r12d, %r15d
	jg	.L82
.L81:
	cmpl	$1, %r15d
	jbe	.L83
	xorl	%edx, %edx
	movq	%rax, %rdi
	movl	%r15d, %ecx
	call	sort.part.0
	movslq	52(%rsp), %rax
	movslq	56(%rsp), %rdx
	addl	$1, 20(%rsp)
	movl	48(%rsp), %r13d
	movq	0(%rbp,%rax,8), %rax
	movl	$-1, (%rax,%rdx,4)
	movl	20(%rsp), %eax
	cmpl	%r13d, %eax
	jl	.L86
.L85:
	movslq	%r13d, %rdi
	salq	$3, %rdi
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %r14
	cmpl	$1, %r13d
	jle	.L99
	leal	-1(%r13), %edx
	leaq	8(%rax), %rdi
	movl	$255, %esi
	salq	$3, %rdx
	call	memset@PLT
	movq	8(%rsp), %rsi
	movq	%r14, %rcx
	movl	%r13d, %edx
	movq	%rbp, %rdi
	call	solve
.L88:
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L90:
	movq	(%r14,%rbx,8), %rcx
	movl	%ebx, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 48(%rsp)
	jg	.L90
.L89:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L100
	addq	$88, %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
.L83:
	.cfi_restore_state
	addl	$1, 20(%rsp)
	movl	48(%rsp), %r13d
	movslq	%r15d, %r8
	movl	20(%rsp), %eax
	movl	$-1, (%rsi,%r8,4)
	cmpl	%eax, %r13d
	jg	.L86
	jmp	.L85
.L80:
	movq	%r13, %rdi
	call	malloc@PLT
	movq	8(%rsp), %rsi
	movl	%r14d, %edx
	movq	%rbp, %rdi
	movq	$0, (%rax)
	movq	%rax, %rcx
	call	solve
	jmp	.L89
.L99:
	movq	8(%rsp), %rsi
	movl	%r13d, %edx
	movq	%rax, %rcx
	movq	%rbp, %rdi
	call	solve
	subl	$1, %r13d
	jne	.L89
	jmp	.L88
.L100:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.type	sort.part.0, @function
sort.part.0:
.LFB43:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%ecx, %r8d
	movq	%rsi, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%ecx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%edx, %rbp
	subl	%ebp, %r8d
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rdi, %rbx
	movl	%r8d, %r12d
	shrl	$31, %r12d
	addl	%r8d, %r12d
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	sarl	%r12d
	leal	0(%rbp,%r12), %r14d
	cmpl	$1, %r12d
	je	.L2
	movl	%r14d, %ecx
	movl	%ebp, %edx
	movl	%r8d, 8(%rsp)
	call	sort.part.0
	movl	8(%rsp), %r8d
.L2:
	leal	1(%r14), %eax
	cmpl	%eax, %r13d
	je	.L3
	movl	%r13d, %ecx
	movl	%r14d, %edx
	movq	%r15, %rsi
	movq	%rbx, %rdi
	movl	%r8d, 8(%rsp)
	call	sort.part.0
	movl	8(%rsp), %r8d
.L3:
	movslq	%r8d, %rdx
	movl	%r8d, 32(%rsp)
	leaq	0(,%rdx,8), %rdi
	movq	%rdx, 8(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rdx
	movq	%rax, 16(%rsp)
	leaq	0(,%rdx,4), %rdi
	call	malloc@PLT
	cmpl	%ebp, %r13d
	movl	32(%rsp), %r8d
	movq	%rax, 24(%rsp)
	je	.L24
.L4:
	testl	%r8d, %r8d
	jle	.L13
	movq	16(%rsp), %rcx
	leal	-1(%r8), %eax
	movq	24(%rsp), %rsi
	xorl	%edi, %edi
	movq	%rax, 32(%rsp)
	movl	%r8d, %eax
	movq	%rax, 40(%rsp)
	leaq	(%rcx,%rax,8), %rax
	movq	%rcx, %rdx
	xorl	%ecx, %ecx
	movq	%rax, 8(%rsp)
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	movslq	%r10d, %r8
	movslq	%eax, %r11
	movq	(%rbx,%r8,8), %r9
	cmpq	(%rbx,%r11,8), %r9
	jge	.L6
.L7:
	movl	(%r15,%r8,4), %eax
	movq	%r9, (%rdx)
	addl	$1, %ecx
	addq	$8, %rdx
	addq	$4, %rsi
	movl	%eax, -4(%rsi)
	cmpq	8(%rsp), %rdx
	je	.L25
.L10:
	leal	0(%rbp,%rcx), %r10d
	leal	(%r14,%rdi), %eax
	cmpl	%ecx, %r12d
	jg	.L26
.L6:
	cmpl	%eax, %r13d
	je	.L27
	cltq
	addl	$1, %edi
	addq	$8, %rdx
	addq	$4, %rsi
	movq	(%rbx,%rax,8), %r8
	movl	(%r15,%rax,4), %eax
	movq	%r8, -8(%rdx)
	movl	%eax, -4(%rsi)
	cmpq	8(%rsp), %rdx
	jne	.L10
.L25:
	movq	32(%rsp), %rax
	leaq	(%rbx,%rbp,8), %rdi
	leaq	(%r15,%rbp,4), %r12
	leaq	1(%rbp,%rax), %rax
	leaq	(%r15,%rax,4), %rdx
	cmpq	%rdx, %rdi
	jnb	.L16
	leaq	(%rbx,%rax,8), %rax
	cmpq	%rax, %r12
	jb	.L11
.L16:
	movq	40(%rsp), %rbx
	movq	16(%rsp), %rsi
	leaq	0(,%rbx,8), %rdx
	call	memcpy@PLT
	movq	24(%rsp), %rsi
	leaq	0(,%rbx,4), %rdx
	movq	%r12, %rdi
	call	memcpy@PLT
.L13:
	movq	16(%rsp), %rdi
	call	free@PLT
	movq	24(%rsp), %rdi
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movslq	%r10d, %r8
	movq	(%rbx,%r8,8), %r9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L24:
	movl	$97, %edi
	movl	%r8d, 8(%rsp)
	call	putchar@PLT
	movl	8(%rsp), %r8d
	jmp	.L4
.L11:
	movq	16(%rsp), %rcx
	movq	24(%rsp), %rsi
	xorl	%eax, %eax
	movq	40(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L14:
	movq	(%rcx,%rax,8), %rdx
	movq	%rdx, (%rdi,%rax,8)
	movl	(%rsi,%rax,4), %edx
	movl	%edx, (%r12,%rax,4)
	addq	$1, %rax
	cmpq	%r8, %rax
	jne	.L14
	jmp	.L13
	.cfi_endproc
.LFE43:
	.size	sort.part.0, .-sort.part.0
	.p2align 4
	.globl	step
	.type	step, @function
step:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	%ecx, %rcx
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	(%r8,%rcx,8), %r11
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdx, %rbx
	leaq	0(,%rcx,8), %rdx
	leaq	(%rdi,%rdx), %r12
	leaq	(%rsi,%rdx), %r10
	movq	(%r12), %r9
	movslq	(%r9), %rax
	cmpl	$-1, %eax
	je	.L28
	xorl	%edx, %edx
	movl	$4, %ecx
	.p2align 4,,10
	.p2align 3
.L33:
	leaq	(%r8,%rax,8), %rsi
	movq	(%rsi), %rdi
	cmpq	$-1, %rdi
	je	.L30
	movq	(%r10), %rbp
	movq	0(%rbp,%rdx), %r14
	addq	%r11, %r14
	cmpq	%r14, %rdi
	jle	.L31
.L30:
	movb	$1, (%rbx,%rax)
	movq	(%r10), %rax
	movq	(%r12), %r9
	movq	(%rax,%rdx), %rdi
	addq	%r11, %rdi
	movq	%rdi, (%rsi)
.L31:
	movslq	(%r9,%rcx), %rax
	addq	$8, %rdx
	addq	$4, %rcx
	cmpl	$-1, %eax
	jne	.L33
.L28:
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	step, .-step
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB40:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%edx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rcx, %r12
	movq	%r13, %r14
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rdi, 8(%rsp)
	movq	%r13, %rdi
	movq	%rsi, 16(%rsp)
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movb	$1, 0(%rbp)
	movq	%rax, %rbx
	cmpl	$1, %r13d
	jle	.L75
	leal	-1(%r13), %edx
	leaq	1(%rbp), %rdi
	xorl	%esi, %esi
	movl	%edx, 24(%rsp)
	call	memset@PLT
.L45:
	movl	%r14d, %eax
	shrl	$4, %eax
	leal	-1(%rax), %r15d
	movl	%r14d, %eax
	andl	$-16, %eax
	addq	$1, %r15
	movl	%eax, 28(%rsp)
	salq	$4, %r15
	.p2align 4,,10
	.p2align 3
.L44:
	testl	%r14d, %r14d
	jle	.L42
	movl	24(%rsp), %r13d
	xorl	%esi, %esi
	movq	%rbx, %rdi
	leaq	1(%r13), %rdx
	call	memset@PLT
	xorl	%ecx, %ecx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L50:
	leaq	1(%rcx), %rax
	cmpq	%r13, %rcx
	je	.L76
.L58:
	movq	%rax, %rcx
.L48:
	cmpb	$1, 0(%rbp,%rcx)
	jne	.L50
	movq	8(%rsp), %rax
	movq	(%r12,%rcx,8), %r9
	movq	(%rax,%rcx,8), %r8
	movslq	(%r8), %rax
	cmpl	$-1, %eax
	je	.L50
	movq	16(%rsp), %rdi
	xorl	%edx, %edx
	movq	(%rdi,%rcx,8), %r10
	.p2align 4,,10
	.p2align 3
.L53:
	leaq	(%r12,%rax,8), %rsi
	movq	(%r10,%rdx,8), %r11
	movq	(%rsi), %rdi
	addq	%r9, %r11
	cmpq	$-1, %rdi
	je	.L51
	cmpq	%r11, %rdi
	jle	.L52
.L51:
	movb	$1, (%rbx,%rax)
	movq	%r11, (%rsi)
.L52:
	addq	$1, %rdx
	movslq	(%r8,%rdx,4), %rax
	cmpl	$-1, %eax
	jne	.L53
	leaq	1(%rcx), %rax
	cmpq	%r13, %rcx
	jne	.L58
	.p2align 4,,10
	.p2align 3
.L76:
	cmpl	$14, 24(%rsp)
	jbe	.L59
	pxor	%xmm0, %xmm0
	pxor	%xmm7, %xmm7
	pxor	%xmm6, %xmm6
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L55:
	movdqu	(%rbx,%rax), %xmm4
	movdqa	%xmm7, %xmm1
	movdqa	%xmm6, %xmm5
	pcmpgtb	%xmm4, %xmm1
	movdqa	%xmm4, %xmm3
	movdqa	%xmm4, %xmm2
	movups	%xmm4, 0(%rbp,%rax)
	addq	$16, %rax
	punpcklbw	%xmm1, %xmm3
	punpckhbw	%xmm1, %xmm2
	pcmpgtw	%xmm3, %xmm5
	movdqa	%xmm3, %xmm1
	punpcklwd	%xmm5, %xmm1
	punpckhwd	%xmm5, %xmm3
	paddd	%xmm1, %xmm0
	movdqa	%xmm6, %xmm1
	pcmpgtw	%xmm2, %xmm1
	paddd	%xmm3, %xmm0
	movdqa	%xmm2, %xmm3
	punpcklwd	%xmm1, %xmm3
	punpckhwd	%xmm1, %xmm2
	paddd	%xmm3, %xmm0
	paddd	%xmm2, %xmm0
	cmpq	%r15, %rax
	jne	.L55
	movdqa	%xmm0, %xmm1
	movl	28(%rsp), %edi
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r14d, %edi
	je	.L56
	movl	%edi, %edx
.L54:
	movslq	%edx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	1(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	2(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	3(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	4(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	5(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	6(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	7(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	8(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	9(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	10(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	11(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	12(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	leal	13(%rdx), %ecx
	addl	%edi, %eax
	cmpl	%ecx, %r14d
	jle	.L56
	movslq	%ecx, %rcx
	addl	$14, %edx
	movsbl	(%rbx,%rcx), %edi
	movb	%dil, 0(%rbp,%rcx)
	addl	%edi, %eax
	cmpl	%edx, %r14d
	jle	.L56
	movslq	%edx, %rdx
	movsbl	(%rbx,%rdx), %esi
	movb	%sil, 0(%rbp,%rdx)
	addl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L56:
	testl	%eax, %eax
	jne	.L44
.L42:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L59:
	.cfi_restore_state
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L54
.L75:
	leal	-1(%r13), %eax
	movl	%eax, 24(%rsp)
	jmp	.L45
	.cfi_endproc
.LFE40:
	.size	solve, .-solve
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB41:
	.cfi_startproc
	endbr64
	leal	1(%rdx), %eax
	cmpl	%ecx, %eax
	je	.L77
	jmp	sort.part.0
	.p2align 4,,10
	.p2align 3
.L77:
	ret
	.cfi_endproc
.LFE41:
	.size	sort, .-sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %ld"
.LC3:
	.string	"%d %ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	48(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %r13
	movq	%r13, %r14
	salq	$3, %r13
	movq	%r13, %rdi
	call	malloc@PLT
	movq	%r13, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	%rax, 8(%rsp)
	testl	%r14d, %r14d
	jle	.L80
	leaq	56(%rsp), %rax
	movl	$0, 20(%rsp)
	leaq	.LC2(%rip), %r14
	movq	%rax, 40(%rsp)
	leaq	52(%rsp), %rax
	movq	%rax, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L86:
	movq	32(%rsp), %rsi
	movq	40(%rsp), %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %r15d
	movslq	52(%rsp), %rbx
	leal	1(%r15), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	call	malloc@PLT
	movslq	%r15d, %rdi
	movq	%rax, 0(%rbp,%rbx,8)
	salq	$3, %rdi
	movq	%rax, 24(%rsp)
	call	malloc@PLT
	movq	8(%rsp), %rcx
	testl	%r15d, %r15d
	movq	24(%rsp), %rsi
	movq	%rax, (%rcx,%rbx,8)
	jle	.L81
	xorl	%r12d, %r12d
	leaq	64(%rsp), %r13
	leaq	60(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L82:
	movq	%r13, %rdx
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	52(%rsp), %rax
	movl	60(%rsp), %edx
	movq	8(%rsp), %rcx
	movl	56(%rsp), %r15d
	movq	0(%rbp,%rax,8), %rsi
	movq	(%rcx,%rax,8), %rax
	movl	%edx, (%rsi,%r12,4)
	movq	64(%rsp), %rdx
	movq	%rdx, (%rax,%r12,8)
	addq	$1, %r12
	cmpl	%r12d, %r15d
	jg	.L82
.L81:
	cmpl	$1, %r15d
	jbe	.L83
	xorl	%edx, %edx
	movq	%rax, %rdi
	movl	%r15d, %ecx
	call	sort.part.0
	movslq	52(%rsp), %rax
	movslq	56(%rsp), %rdx
	addl	$1, 20(%rsp)
	movl	48(%rsp), %r13d
	movq	0(%rbp,%rax,8), %rax
	movl	$-1, (%rax,%rdx,4)
	movl	20(%rsp), %eax
	cmpl	%r13d, %eax
	jl	.L86
.L85:
	movslq	%r13d, %rdi
	salq	$3, %rdi
	call	malloc@PLT
	movq	$0, (%rax)
	movq	%rax, %r14
	cmpl	$1, %r13d
	jle	.L99
	leal	-1(%r13), %edx
	leaq	8(%rax), %rdi
	movl	$255, %esi
	salq	$3, %rdx
	call	memset@PLT
	movq	8(%rsp), %rsi
	movq	%r14, %rcx
	movl	%r13d, %edx
	movq	%rbp, %rdi
	call	solve
.L88:
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L90:
	movq	(%r14,%rbx,8), %rcx
	movl	%ebx, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 48(%rsp)
	jg	.L90
.L89:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L100
	addq	$88, %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
.L83:
	.cfi_restore_state
	addl	$1, 20(%rsp)
	movl	48(%rsp), %r13d
	movslq	%r15d, %r8
	movl	20(%rsp), %eax
	movl	$-1, (%rsi,%r8,4)
	cmpl	%eax, %r13d
	jg	.L86
	jmp	.L85
.L80:
	movq	%r13, %rdi
	call	malloc@PLT
	movq	8(%rsp), %rsi
	movl	%r14d, %edx
	movq	%rbp, %rdi
	movq	$0, (%rax)
	movq	%rax, %rcx
	call	solve
	jmp	.L89
.L99:
	movq	8(%rsp), %rsi
	movl	%r13d, %edx
	movq	%rax, %rcx
	movq	%rbp, %rdi
	call	solve
	subl	$1, %r13d
	jne	.L89
	jmp	.L88
.L100:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

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

void step(int **G, long **cost, char *flag, int u, long *d) {
  int i,j;
  long t = d[u];
  for (i = 0;; i++) {
    j = G[u][i];
    if(j == -1) break;
    if(d[j] == -1 || d[j] > t+cost[u][i]) {
      flag[j] = 1;
      d[j] = t+cost[u][i];
    }
  }
}

void solve(int **G, long **cost, int n, long *d) {
  int i,j;
  char *flag,*new_flag;
  flag = (char*)malloc(sizeof(char) * n);
  new_flag = (char*)malloc(sizeof(char) * n);
  flag[0] = 1;
  for (i = 1; i < n; i++) flag[i] = 0;
  while(1) {
    for (i = 0; i < n; i++) new_flag[i] = 0;
    for (i = 0; i < n; i++) 
      if(flag[i] == 1) step(G,cost,new_flag,i,d);
    j = 0;
    for (i = 0; i < n; i++) {
      j += new_flag[i];
      flag[i] = new_flag[i];
    }
    if(j == 0) break;
  }
    
  return;
}

void sort(long *A, int *B, int a, int b){
  if(b == a+1) return;
  int m = a+(b-a)/2;
  sort(A,B,a,m);
  sort(A,B,m,b);
  int i,j,t;
  long *newA;
  int *newB;
  newA = (long*)malloc(sizeof(long)*(b-a));
  newB = (int*)malloc(sizeof(int) * (b-a));
  if(b-a == 0) printf("a");
  i = 0;j = 0;t = 0;
  while(t < b-a) {
    if((a+i < m && A[a+i] < A[m+j]) || m+j == b) {
      newA[t] = A[a+i];
      newB[t] = B[a+i];
      i++;
    }
    else{
      newA[t] = A[m+j];
      newB[t] = B[m+j];
      j++;
    }
    t++;
  }
  for (i = 0; i < b-a; i++) {
    A[a+i] = newA[i];
    B[a+i] = newB[i];
  }
  free(newA);
  free(newB);
}

int main()
{
  int n;
  int i,j,u,k,v;
  int **G;
  long **cost,c;
  long *d;
  scanf("%d",&n);
  G = (int**)malloc(sizeof(int*) * n);
  cost = (long**)malloc(sizeof(long*) * n);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &u, &k);
    G[u] = (int*)malloc(sizeof(int) * (k+1));
    cost[u] = (long*)malloc(sizeof(long) * k);
    for (j = 0; j < k; j++) {
      scanf("%d %ld", &v, &c);
      G[u][j] = v;
      cost[u][j] = c;
    }
    if(k != 0)sort(cost[u],G[u],0,k);
    G[u][k] = -1;
  }
  d = (long*)malloc(sizeof(long) * n);
  d[0] = 0;
  for (i = 1; i < n; i++) {
    d[i] = -1;
  }
  solve(G,cost,n,d);
  for (i = 0; i < n; i++) {
    printf("%d %ld\n", i, d[i]);
  }
  return 0;
}
5
0 3 2 3 3 1 1 1
1 2 0 2 3 4
2 3 0 3 3 1 4 1
3 4 2 1 0 1 1 4 4 3
4 2 2 1 3 3
 5
0 3 2 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 3 1 4 1
3 4 2 1 0 1 1 1 4 3
4 2 2 1 3 3
 5
0 3 2 3 3 2 1 1
1 2 0 2 4 4
2 3 0 3 0 2 4 1
3 4 2 1 0 0 1 4 4 3
4 2 2 1 3 3
 5
0 3 2 3 3 1 1 1
1 2 0 2 0 4
2 3 0 3 0 1 4 1
3 4 2 0 0 1 1 4 4 3
4 2 2 1 3 3
 5
0 3 2 3 3 2 1 1
1 2 0 2 4 4
2 3 0 3 0 2 4 2
3 4 2 1 0 0 1 4 4 3
4 2 2 1 3 3
 5
0 3 1 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 2 1 4 1
3 4 2 0 0 1 1 1 4 3
4 2 2 1 3 3
 5
0 3 2 4 3 1 1 2
1 2 3 2 3 4
2 3 0 3 3 2 4 1
3 4 0 1 0 0 1 0 4 3
4 2 0 1 3 3
 5
0 3 2 3 3 1 2 2
1 2 0 2 3 4
2 3 0 3 3 2 4 1
3 4 2 1 0 1 1 4 4 3
4 2 2 1 3 3
 5
0 3 2 3 3 1 1 2
1 2 0 2 3 4
2 3 0 3 3 2 4 1
3 4 2 2 0 1 1 4 4 3
4 2 0 1 3 3
 5
0 3 2 4 3 1 1 2
1 2 3 3 3 4
2 3 0 3 3 2 4 1
3 4 0 1 0 -1 1 0 3 3
4 2 0 1 3 3

0 0
1 1
2 2
3 1
4 3
 0 0
1 2
2 2
3 1
4 3
 0 0
1 1
2 3
3 2
4 4
 0 0
1 1
2 1
3 1
4 2
 0 0
1 1
2 3
3 2
4 5
 0 0
1 2
2 1
3 1
4 2
 0 0
1 1
2 4
3 1
4 4
 0 0
1 5
2 2
3 1
4 3
 0 0
1 2
2 3
3 1
4 4
 0 0
1 1
2 4
3 1
4 5

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

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

void step(int **G, long **cost, char *flag, int u, long *d) {
  int i,j;
  long t = d[u];
  for (i = 0;; i++) {
    j = G[u][i];
    if(j == -1) break;
    if(d[j] == -1 || d[j] > t+cost[u][i]) {
      flag[j] = 1;
      d[j] = t+cost[u][i];
    }
  }
}

void solve(int **G, long **cost, int n, long *d) {
  int i,j;
  char *flag,*new_flag;
  flag = (char*)malloc(sizeof(char) * n);
  new_flag = (char*)malloc(sizeof(char) * n);
  flag[0] = 1;
  for (i = 1; i < n; i++) flag[i] = 0;
  while(1) {
    for (i = 0; i < n; i++) new_flag[i] = 0;
    for (i = 0; i < n; i++) 
      if(flag[i] == 1) step(G,cost,new_flag,i,d);
    j = 0;
    for (i = 0; i < n; i++) {
      j += new_flag[i];
      flag[i] = new_flag[i];
    }
    if(j == 0) break;
  }
    
  return;
}

void sort(long *A, int *B, int a, int b){
  if(b == a+1) return;
  int m = a+(b-a)/2;
  sort(A,B,a,m);
  sort(A,B,m,b);
  int i,j,t;
  long *newA;
  int *newB;
  newA = (long*)malloc(sizeof(long)*(b-a));
  newB = (int*)malloc(sizeof(int) * (b-a));
  if(b-a == 0) printf("a");
  i = 0;j = 0;t = 0;
  while(t < b-a) {
    if((a+i < m && A[a+i] < A[m+j]) || m+j == b) {
      newA[t] = A[a+i];
      newB[t] = B[a+i];
      i++;
    }
    else{
      newA[t] = A[m+j];
      newB[t] = B[m+j];
      j++;
    }
    t++;
  }
  for (i = 0; i < b-a; i++) {
    A[a+i] = newA[i];
    B[a+i] = newB[i];
  }
  free(newA);
  free(newB);
}

int main()
{
  int n;
  int i,j,u,k,v;
  int **G;
  long **cost,c;
  long *d;
  scanf("%d",&n);
  G = (int**)malloc(sizeof(int*) * n);
  cost = (long**)malloc(sizeof(long*) * n);
  for (i = 0; i < n; i++) {
    scanf("%d %d", &u, &k);
    G[u] = (int*)malloc(sizeof(int) * (k+1));
    cost[u] = (long*)malloc(sizeof(long) * k);
    for (j = 0; j < k; j++) {
      scanf("%d %ld", &v, &c);
      G[u][j] = v;
      cost[u][j] = c;
    }
    if(k != 0)sort(cost[u],G[u],0,k);
    G[u][k] = -1;
  }
  d = (long*)malloc(sizeof(long) * n);
  d[0] = 0;
  for (i = 1; i < n; i++) {
    d[i] = -1;
  }
  solve(G,cost,n,d);
  for (i = 0; i < n; i++) {
    printf("%d %ld\n", i, d[i]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	step
	.type	step, @function
step:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movl	%ecx, -44(%rbp)
	movq	%r8, -56(%rbp)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	$0, -16(%rbp)
.L6:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	je	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	$-1, %rax
	je	.L4
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	cmpq	%rdx, %rax
	jle	.L5
.L4:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L5:
	addl	$1, -16(%rbp)
	jmp	.L6
.L8:
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	step, .-step
	.globl	solve
	.type	solve, @function
solve:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movq	%rcx, -64(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movb	$1, (%rax)
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	addl	$1, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L11
.L21:
	movl	$0, -24(%rbp)
	jmp	.L12
.L13:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	addl	$1, -24(%rbp)
.L12:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L13
	movl	$0, -24(%rbp)
	jmp	.L14
.L16:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$1, %al
	jne	.L15
	movq	-64(%rbp), %rdi
	movl	-24(%rbp), %ecx
	movq	-8(%rbp), %rdx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	step
.L15:
	addl	$1, -24(%rbp)
.L14:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L16
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L17
.L18:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	addl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	addl	$1, -24(%rbp)
.L17:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L18
	cmpl	$0, -20(%rbp)
	je	.L24
	jmp	.L21
.L24:
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	solve, .-solve
	.globl	sort
	.type	sort, @function
sort:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movl	%ecx, -56(%rbp)
	movl	-52(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -56(%rbp)
	je	.L37
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %ecx
	movl	-52(%rbp), %edx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort
	movl	-56(%rbp), %ecx
	movl	-20(%rbp), %edx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	-56(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jne	.L28
	movl	$97, %edi
	call	putchar@PLT
.L28:
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L29
.L34:
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L30
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %ecx
	movl	-28(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L31
.L30:
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -56(%rbp)
	jne	.L32
.L31:
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -32(%rbp)
	jmp	.L33
.L32:
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -28(%rbp)
.L33:
	addl	$1, -24(%rbp)
.L29:
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L34
	movl	$0, -32(%rbp)
	jmp	.L35
.L36:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	-52(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	-52(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -32(%rbp)
.L35:
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L36
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	jmp	.L25
.L37:
	nop
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sort, .-sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %ld"
.LC3:
	.string	"%d %ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	-80(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L39
.L43:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$2, %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movl	-72(%rbp), %eax
	cltq
	salq	$3, %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movl	$0, -60(%rbp)
	jmp	.L40
.L41:
	leaq	-56(%rbp), %rdx
	leaq	-68(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-68(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-56(%rbp), %rax
	movq	%rax, (%rdx)
	addl	$1, -60(%rbp)
.L40:
	movl	-72(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L41
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	je	.L42
	movl	-72(%rbp), %edx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rsi
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movl	%edx, %ecx
	movl	$0, %edx
	movq	%rax, %rdi
	call	sort
.L42:
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-72(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	addl	$1, -64(%rbp)
.L39:
	movl	-80(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L43
	movl	-80(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movq	$0, (%rax)
	movl	$1, -64(%rbp)
	jmp	.L44
.L45:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	$-1, (%rax)
	addl	$1, -64(%rbp)
.L44:
	movl	-80(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L45
	movl	-80(%rbp), %edx
	movq	-32(%rbp), %rcx
	movq	-40(%rbp), %rsi
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	solve
	movl	$0, -64(%rbp)
	jmp	.L46
.L47:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -64(%rbp)
.L46:
	movl	-80(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L47
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	step
	.type	step, @function
step:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movl	%ecx, -44(%rbp)
	movq	%r8, -56(%rbp)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	$0, -16(%rbp)
.L6:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -12(%rbp)
	cmpl	$-1, -12(%rbp)
	je	.L8
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	$-1, %rax
	je	.L4
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-32(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	salq	$3, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	cmpq	%rdx, %rax
	jle	.L5
.L4:
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L5:
	addl	$1, -16(%rbp)
	jmp	.L6
.L8:
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	step, .-step
	.globl	solve
	.type	solve, @function
solve:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movq	%rcx, -64(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movb	$1, (%rax)
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	addl	$1, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L11
.L21:
	movl	$0, -24(%rbp)
	jmp	.L12
.L13:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movb	$0, (%rax)
	addl	$1, -24(%rbp)
.L12:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L13
	movl	$0, -24(%rbp)
	jmp	.L14
.L16:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$1, %al
	jne	.L15
	movq	-64(%rbp), %rdi
	movl	-24(%rbp), %ecx
	movq	-8(%rbp), %rdx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	step
.L15:
	addl	$1, -24(%rbp)
.L14:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L16
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L17
.L18:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	addl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movzbl	(%rax), %eax
	movb	%al, (%rdx)
	addl	$1, -24(%rbp)
.L17:
	movl	-24(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jl	.L18
	cmpl	$0, -20(%rbp)
	je	.L24
	jmp	.L21
.L24:
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	solve, .-solve
	.globl	sort
	.type	sort, @function
sort:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movl	%edx, -52(%rbp)
	movl	%ecx, -56(%rbp)
	movl	-52(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -56(%rbp)
	je	.L37
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %ecx
	movl	-52(%rbp), %edx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort
	movl	-56(%rbp), %ecx
	movl	-20(%rbp), %edx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	-56(%rbp), %eax
	cmpl	-52(%rbp), %eax
	jne	.L28
	movl	$97, %edi
	call	putchar@PLT
.L28:
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L29
.L34:
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jle	.L30
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %ecx
	movl	-28(%rbp), %eax
	addl	%ecx, %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jl	.L31
.L30:
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -56(%rbp)
	jne	.L32
.L31:
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-52(%rbp), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -32(%rbp)
	jmp	.L33
.L32:
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-8(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -28(%rbp)
.L33:
	addl	$1, -24(%rbp)
.L29:
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L34
	movl	$0, -32(%rbp)
	jmp	.L35
.L36:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	-52(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	-52(%rbp), %ecx
	movl	-32(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-48(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	addl	$1, -32(%rbp)
.L35:
	movl	-56(%rbp), %eax
	subl	-52(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L36
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	jmp	.L25
.L37:
	nop
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sort, .-sort
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %ld"
.LC3:
	.string	"%d %ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	-80(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L39
.L43:
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-72(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$2, %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-48(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movl	-72(%rbp), %eax
	cltq
	salq	$3, %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-40(%rbp), %rdx
	leaq	(%rcx,%rdx), %rbx
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, (%rbx)
	movl	$0, -60(%rbp)
	jmp	.L40
.L41:
	leaq	-56(%rbp), %rdx
	leaq	-68(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	movl	-68(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-60(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rax, %rdx
	movq	-56(%rbp), %rax
	movq	%rax, (%rdx)
	addl	$1, -60(%rbp)
.L40:
	movl	-72(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L41
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	je	.L42
	movl	-72(%rbp), %edx
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-48(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rsi
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-40(%rbp), %rax
	addq	%rcx, %rax
	movq	(%rax), %rax
	movl	%edx, %ecx
	movl	$0, %edx
	movq	%rax, %rdi
	call	sort
.L42:
	movl	-76(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-72(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	addl	$1, -64(%rbp)
.L39:
	movl	-80(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L43
	movl	-80(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rax
	movq	$0, (%rax)
	movl	$1, -64(%rbp)
	jmp	.L44
.L45:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	$-1, (%rax)
	addl	$1, -64(%rbp)
.L44:
	movl	-80(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L45
	movl	-80(%rbp), %edx
	movq	-32(%rbp), %rcx
	movq	-40(%rbp), %rsi
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	solve
	movl	$0, -64(%rbp)
	jmp	.L46
.L47:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-64(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -64(%rbp)
.L46:
	movl	-80(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jl	.L47
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L49
	call	__stack_chk_fail@PLT
.L49:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
