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

typedef int32_t i32;
typedef int64_t i64;

typedef struct test {
  i32 b, l, u;
} test;

i64 eval (i32 x, test t) {
  return x <= t.b ? (i64) x * t.l : (i64) t.b * t.l + (i64) (x - t.b) * t.u;
}

typedef struct node_full {
  i64 val;
  i32 index;
} node;

int cmp_node (const void *a, const void *b) {
  i64 d = ((node *)a)->val - ((node *)b)->val;
  return d == 0 ? 0 : d > 0 ? -1 : 1;
}

#define MAX(a, b) ((a) > (b) ? (a) : (b))

i64 calc (i64 m, test *t, node *p, i32 n, i32 x) {
  if (m < x) {
    i64 sum = 0;
    i64 max = 0;
    for (i32 i = 0; i < n; ++i) {
      sum -= (i64) t[i].b * t[i].l;
      max = MAX(max, eval (m, t[i]));
    }
    return sum + max;
  }
  static uint8_t *used = NULL;
  if (used == NULL) {
    used = (uint8_t *) calloc (n, sizeof (uint8_t));
  }
  i64 sum = 0;
  for (i32 i = 0; i < n; ++i) {
    sum -= (i64) t[i].b * t[i].l;
    used[i] = 0;
  }
  i64 buf = 0;
  i32 swap = 0;
  for (i32 i = 0; m >= x; ++i, m -= x) {
    buf += p[i].val;
    used[p[i].index] = 1;
    swap = i + 1;
  }
  i64 max = buf;
  for (i32 i = 0; i < n; ++i) {
    if (used[i]) {
      max = MAX(max, buf - eval (x, t[i]) + eval (m, t[i]) + eval (x, t[p[swap].index]));
    } else {
      max = MAX(max, buf + eval (m, t[i]));
    }
  }
  return max + sum;
}

void run (void) {
  i32 n, x;
  scanf ("%" SCNi32 "%" SCNi32, &n, &x);
  test *t = (test *) calloc (n, sizeof (test));
  node *p = (node *) calloc (n, sizeof (node));
  for (i32 i = 0; i < n; ++i) {
    i32 b, l, u;
    scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &b, &l, &u);
    t[i] = (test) {b, l, u};
    p[i] = (node) {eval (x, t[i]), i};
  }
  qsort (p, n, sizeof (node), cmp_node);
  i64 left = -1;
  i64 right = (i64) x * n;
  while (right - left > 1) {
    i64 m = (left + right) / 2;
    if (calc (m, t, p, n, x) >= 0) {
      right = m;
    } else {
      left = m;
    }
  }
  printf ("%" PRIi64 "\n", right);
}

int main (void) {
  run();
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	eval
	.type	eval, @function
eval:
.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)
	movq	%rsi, %rcx
	movl	%edx, %eax
	movq	%rcx, -20(%rbp)
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L2
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	jmp	.L4
.L2:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	eval, .-eval
	.globl	cmp_node
	.type	cmp_node, @function
cmp_node:
.LFB7:
	.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	-24(%rbp), %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L6
	cmpq	$0, -8(%rbp)
	jle	.L7
	movl	$-1, %eax
	jmp	.L10
.L7:
	movl	$1, %eax
	jmp	.L10
.L6:
	movl	$0, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp_node, .-cmp_node
	.globl	calc
	.type	calc, @function
calc:
.LFB8:
	.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	$104, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -88(%rbp)
	movq	%rsi, -96(%rbp)
	movq	%rdx, -104(%rbp)
	movl	%ecx, -108(%rbp)
	movl	%r8d, -112(%rbp)
	movl	-112(%rbp), %eax
	cltq
	cmpq	%rax, -88(%rbp)
	jge	.L12
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L13
.L16:
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	cltq
	imulq	%rcx, %rax
	subq	%rax, -56(%rbp)
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	cmpq	%rax, -48(%rbp)
	jg	.L14
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	jmp	.L15
.L14:
	movq	-48(%rbp), %rax
.L15:
	movq	%rax, -48(%rbp)
	addl	$1, -76(%rbp)
.L13:
	movl	-76(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jl	.L16
	movq	-56(%rbp), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	jmp	.L17
.L12:
	movq	used.0(%rip), %rax
	testq	%rax, %rax
	jne	.L18
	movl	-108(%rbp), %eax
	cltq
	movl	$1, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, used.0(%rip)
.L18:
	movq	$0, -40(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L19
.L20:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	cltq
	imulq	%rcx, %rax
	subq	%rax, -40(%rbp)
	movq	used.0(%rip), %rdx
	movl	-72(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movb	$0, (%rax)
	addl	$1, -72(%rbp)
.L19:
	movl	-72(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jl	.L20
	movq	$0, -32(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L21
.L22:
	movl	-64(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, -32(%rbp)
	movq	used.0(%rip), %rdx
	movl	-64(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-104(%rbp), %rax
	addq	%rcx, %rax
	movl	8(%rax), %eax
	cltq
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-64(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -68(%rbp)
	addl	$1, -64(%rbp)
	movl	-112(%rbp), %eax
	cltq
	subq	%rax, -88(%rbp)
.L21:
	movl	-112(%rbp), %eax
	cltq
	cmpq	%rax, -88(%rbp)
	jge	.L22
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L23
.L30:
	movq	used.0(%rip), %rdx
	movl	-60(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L24
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, %rbx
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	addq	%rax, %rbx
	movl	-68(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	addq	%rbx, %rax
	cmpq	%rax, -24(%rbp)
	jg	.L25
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, %rbx
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	addq	%rax, %rbx
	movl	-68(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	addq	%rbx, %rax
	jmp	.L26
.L25:
	movq	-24(%rbp), %rax
.L26:
	movq	%rax, -24(%rbp)
	jmp	.L27
.L24:
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	movq	-32(%rbp), %rdx
	addq	%rdx, %rax
	cmpq	%rax, -24(%rbp)
	jg	.L28
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	movq	-32(%rbp), %rdx
	addq	%rdx, %rax
	jmp	.L29
.L28:
	movq	-24(%rbp), %rax
.L29:
	movq	%rax, -24(%rbp)
.L27:
	addl	$1, -60(%rbp)
.L23:
	movl	-60(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jl	.L30
	movq	-24(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	calc, .-calc
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"%li\n"
	.text
	.globl	run
	.type	run, @function
run:
.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	$104, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-96(%rbp), %rdx
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	cltq
	movl	$12, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -64(%rbp)
	movl	-100(%rbp), %eax
	cltq
	movl	$16, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -56(%rbp)
	movl	$0, -84(%rbp)
	jmp	.L32
.L33:
	leaq	-36(%rbp), %rcx
	leaq	-88(%rbp), %rdx
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movl	-92(%rbp), %esi
	movl	-88(%rbp), %ecx
	movl	-36(%rbp), %edx
	movl	%esi, (%rax)
	movl	%ecx, 4(%rax)
	movl	%edx, 8(%rax)
	movl	-84(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	-84(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movl	-96(%rbp), %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	movq	%rax, (%rbx)
	movl	-84(%rbp), %eax
	movl	%eax, 8(%rbx)
	addl	$1, -84(%rbp)
.L32:
	movl	-100(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jl	.L33
	movl	-100(%rbp), %eax
	movslq	%eax, %rsi
	movq	-56(%rbp), %rax
	leaq	cmp_node(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$-1, -80(%rbp)
	movl	-96(%rbp), %eax
	movslq	%eax, %rdx
	movl	-100(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -72(%rbp)
	jmp	.L34
.L36:
	movq	-80(%rbp), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -48(%rbp)
	movl	-96(%rbp), %edi
	movl	-100(%rbp), %ecx
	movq	-56(%rbp), %rdx
	movq	-64(%rbp), %rsi
	movq	-48(%rbp), %rax
	movl	%edi, %r8d
	movq	%rax, %rdi
	call	calc
	testq	%rax, %rax
	js	.L35
	movq	-48(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L34
.L35:
	movq	-48(%rbp), %rax
	movq	%rax, -80(%rbp)
.L34:
	movq	-72(%rbp), %rax
	subq	-80(%rbp), %rax
	cmpq	$1, %rax
	jg	.L36
	movq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.local	used.0
	.comm	used.0,8,8
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp_node
	.type	cmp_node, @function
cmp_node:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	(%rsi), %rax
	xorl	%r8d, %r8d
	testq	%rax, %rax
	je	.L1
	setle	%r8b
	movzbl	%r8b, %r8d
	leal	-1(%r8,%r8), %r8d
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	cmp_node, .-cmp_node
	.p2align 4
	.globl	eval
	.type	eval, @function
eval:
.LFB51:
	.cfi_startproc
	endbr64
	movslq	%esi, %rcx
	sarq	$32, %rsi
	cmpl	%ecx, %edi
	jg	.L8
	movslq	%edi, %rax
	imulq	%rsi, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	subl	%ecx, %edi
	imulq	%rsi, %rcx
	movslq	%edx, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	addq	%rcx, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	eval, .-eval
	.p2align 4
	.globl	calc
	.type	calc, @function
calc:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%ecx, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	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
	movslq	%r8d, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpq	%rdi, %rbp
	jg	.L41
	movq	used.0(%rip), %rdi
	movq	%rdx, %r9
	movq	%rbp, %r12
	testq	%rdi, %rdi
	je	.L42
.L18:
	testl	%r15d, %r15d
	jle	.L35
	movslq	%r15d, %r8
	movq	%rdi, %rdx
	leaq	4(%rbx), %rax
	xorl	%r13d, %r13d
	addq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	-4(%rax), %rcx
	movslq	(%rax), %rsi
	addq	$1, %rdx
	movb	$0, -1(%rdx)
	addq	$12, %rax
	imulq	%rsi, %rcx
	subq	%rcx, %r13
	cmpq	%r8, %rdx
	jne	.L20
.L19:
	movq	%r9, %rdx
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	8(%rdx), %rsi
	addq	(%rdx), %rax
	subq	%rbp, %r14
	addl	$1, %ecx
	movq	%rax, %r11
	addq	$16, %rdx
	movb	$1, (%rdi,%rsi)
	cmpq	%r14, %rbp
	jle	.L21
	testl	%r15d, %r15d
	jle	.L22
	movslq	%ecx, %rcx
	movslq	%r14d, %rdx
	movslq	%r15d, %r8
	movq	%r13, 8(%rsp)
	salq	$4, %rcx
	movq	%rdx, (%rsp)
	addq	%rdi, %r8
	leaq	(%r9,%rcx), %rsi
	movq	%rdx, %rcx
	movq	%rbx, %r9
	movq	%rsi, %r13
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L44:
	cmpl	%esi, %r12d
	jg	.L24
	movq	%rbp, %r15
	imulq	%r10, %r15
.L25:
	movq	%r11, %r14
	subq	%r15, %r14
	cmpl	%esi, %ecx
	jg	.L26
	movq	(%rsp), %rdx
	imulq	%r10, %rdx
.L27:
	movslq	8(%r13), %rsi
	addq	%r14, %rdx
	leaq	(%rsi,%rsi,2), %rsi
	leaq	(%rbx,%rsi,4), %r14
	movslq	(%r14), %rsi
	movslq	4(%r14), %r10
	cmpl	%r12d, %esi
	jl	.L28
	imulq	%rbp, %r10
.L29:
	addq	%r10, %rdx
	cmpq	%rdx, %rax
	cmovl	%rdx, %rax
	addq	$1, %rdi
	addq	$12, %r9
	cmpq	%r8, %rdi
	je	.L43
.L33:
	cmpb	$0, (%rdi)
	movslq	(%r9), %rsi
	movslq	8(%r9), %rdx
	movslq	4(%r9), %r10
	jne	.L44
	cmpl	%esi, %ecx
	jg	.L31
	imulq	(%rsp), %r10
.L32:
	addq	%r11, %r10
	cmpq	%r10, %rax
	cmovl	%r10, %rax
	addq	$1, %rdi
	addq	$12, %r9
	cmpq	%r8, %rdi
	jne	.L33
.L43:
	movq	8(%rsp), %r13
.L22:
	addq	%r13, %rax
.L10:
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	movl	%r12d, %r15d
	movslq	8(%r14), %r14
	subl	%esi, %r15d
	imulq	%r10, %rsi
	movslq	%r15d, %r15
	imulq	%r15, %r14
	leaq	(%r14,%rsi), %r10
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%ecx, %r15d
	subl	%esi, %r15d
	imulq	%r10, %rsi
	movslq	%r15d, %r15
	imulq	%r15, %rdx
	addq	%rsi, %rdx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%r12d, %r14d
	movslq	%edx, %r15
	subl	%esi, %r14d
	movslq	%r14d, %r14
	imulq	%r15, %r14
	movslq	%esi, %r15
	imulq	%r10, %r15
	addq	%r14, %r15
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L31:
	movl	%ecx, %r14d
	subl	%esi, %r14d
	imulq	%r10, %rsi
	movslq	%r14d, %r14
	imulq	%r14, %rdx
	leaq	(%rdx,%rsi), %r10
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L41:
	testl	%ecx, %ecx
	jle	.L34
	leal	-1(%r15), %eax
	movslq	%edi, %r10
	xorl	%r8d, %r8d
	leaq	(%rax,%rax,2), %rax
	movq	%r10, %rcx
	leaq	12(%rsi,%rax,4), %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	(%rbx), %rdx
	movslq	4(%rbx), %rsi
	movq	%rdx, %rdi
	imulq	%rsi, %rdx
	subq	%rdx, %rax
	cmpl	%ecx, %edi
	jl	.L13
	imulq	%r10, %rsi
	cmpq	%rsi, %r8
	cmovl	%rsi, %r8
	addq	$12, %rbx
	cmpq	%rbx, %r9
	jne	.L16
	addq	%r8, %rax
.L45:
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	movl	%ecx, %r11d
	movslq	8(%rbx), %rsi
	subl	%edi, %r11d
	movslq	%r11d, %rdi
	imulq	%rdi, %rsi
	addq	%rsi, %rdx
	cmpq	%rdx, %r8
	cmovl	%rdx, %r8
	addq	$12, %rbx
	cmpq	%rbx, %r9
	jne	.L16
	addq	%r8, %rax
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L42:
	movslq	%ecx, %rdi
	movl	$1, %esi
	movq	%rdx, (%rsp)
	call	calloc@PLT
	movq	(%rsp), %r9
	movq	%rax, used.0(%rip)
	movq	%rax, %rdi
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L35:
	xorl	%r13d, %r13d
	jmp	.L19
.L34:
	xorl	%eax, %eax
	jmp	.L10
	.cfi_endproc
.LFE53:
	.size	calc, .-calc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"%li\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB54:
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rdx
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %r12
	movl	$12, %esi
	movq	%r12, %rdi
	call	calloc@PLT
	movl	$16, %esi
	movq	%r12, %rdi
	movq	%rax, %rbp
	call	calloc@PLT
	movq	%rax, %rbx
	testl	%r12d, %r12d
	jle	.L47
	movq	%rax, %r13
	leaq	32(%rsp), %rax
	movq	%rbp, %r14
	xorl	%r12d, %r12d
	movq	%rax, 8(%rsp)
	leaq	28(%rsp), %rax
	leaq	36(%rsp), %r15
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L51:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rdx
	movslq	32(%rsp), %rcx
	movslq	36(%rsp), %rsi
	movslq	24(%rsp), %rax
	movd	%edx, %xmm0
	movd	%ecx, %xmm1
	punpckldq	%xmm1, %xmm0
	movl	%esi, 8(%r14)
	movq	%xmm0, (%r14)
	cmpl	%eax, %edx
	jl	.L48
	imulq	%rcx, %rax
	movl	%r12d, 8(%r13)
	addl	$1, %r12d
	addq	$12, %r14
	addq	$16, %r13
	movq	%rax, -16(%r13)
	movl	20(%rsp), %eax
	cmpl	%eax, %r12d
	jl	.L51
.L50:
	movslq	%eax, %r12
.L47:
	leaq	cmp_node(%rip), %rcx
	movl	$16, %edx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movslq	24(%rsp), %r13
	movslq	20(%rsp), %rax
	movq	%r13, %r8
	imulq	%rax, %r13
	movq	%rax, %rcx
	testq	%r13, %r13
	jle	.L59
	movq	$-1, %r14
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L61:
	movq	%r12, %rax
	subq	%r14, %rax
	cmpq	$1, %rax
	jle	.L52
	movq	%r12, %r13
.L54:
	movl	24(%rsp), %r8d
	movl	20(%rsp), %ecx
.L55:
	leaq	(%r14,%r13), %rax
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	movq	%rax, %r12
	shrq	$63, %r12
	addq	%rax, %r12
	sarq	%r12
	movq	%r12, %rdi
	movq	%r12, %r15
	call	calc
	testq	%rax, %rax
	jns	.L61
	movq	%r13, %rax
	subq	%r12, %rax
	cmpq	$1, %rax
	jle	.L59
	movq	%r12, %r14
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L48:
	subl	%edx, %eax
	imulq	%rcx, %rdx
	movl	%r12d, 8(%r13)
	addl	$1, %r12d
	cltq
	addq	$12, %r14
	addq	$16, %r13
	imulq	%rsi, %rax
	addq	%rdx, %rax
	movq	%rax, -16(%r13)
	movl	20(%rsp), %eax
	cmpl	%r12d, %eax
	jg	.L51
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L59:
	movq	%r13, %r15
.L52:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L62
	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
	ret
.L62:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.local	used.0
	.comm	used.0,8,8
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp_node
	.type	cmp_node, @function
cmp_node:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	(%rsi), %rax
	xorl	%r8d, %r8d
	testq	%rax, %rax
	je	.L1
	setle	%r8b
	movzbl	%r8b, %r8d
	leal	-1(%r8,%r8), %r8d
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	cmp_node, .-cmp_node
	.p2align 4
	.globl	eval
	.type	eval, @function
eval:
.LFB51:
	.cfi_startproc
	endbr64
	movslq	%esi, %rcx
	sarq	$32, %rsi
	cmpl	%ecx, %edi
	jg	.L8
	movslq	%edi, %rax
	imulq	%rsi, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	subl	%ecx, %edi
	imulq	%rsi, %rcx
	movslq	%edx, %rdx
	movslq	%edi, %rax
	imulq	%rdx, %rax
	addq	%rcx, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	eval, .-eval
	.p2align 4
	.globl	calc
	.type	calc, @function
calc:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	%ecx, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	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
	movslq	%r8d, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpq	%rdi, %rbp
	jg	.L41
	movq	used.0(%rip), %rdi
	movq	%rdx, %r9
	movq	%rbp, %r12
	testq	%rdi, %rdi
	je	.L42
.L18:
	testl	%r15d, %r15d
	jle	.L35
	movslq	%r15d, %r8
	movq	%rdi, %rdx
	leaq	4(%rbx), %rax
	xorl	%r13d, %r13d
	addq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L20:
	movslq	-4(%rax), %rcx
	movslq	(%rax), %rsi
	addq	$1, %rdx
	movb	$0, -1(%rdx)
	addq	$12, %rax
	imulq	%rsi, %rcx
	subq	%rcx, %r13
	cmpq	%r8, %rdx
	jne	.L20
.L19:
	movq	%r9, %rdx
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	8(%rdx), %rsi
	addq	(%rdx), %rax
	subq	%rbp, %r14
	addl	$1, %ecx
	movq	%rax, %r11
	addq	$16, %rdx
	movb	$1, (%rdi,%rsi)
	cmpq	%r14, %rbp
	jle	.L21
	testl	%r15d, %r15d
	jle	.L22
	movslq	%ecx, %rcx
	movslq	%r14d, %rdx
	movslq	%r15d, %r8
	movq	%r13, 8(%rsp)
	salq	$4, %rcx
	movq	%rdx, (%rsp)
	addq	%rdi, %r8
	leaq	(%r9,%rcx), %rsi
	movq	%rdx, %rcx
	movq	%rbx, %r9
	movq	%rsi, %r13
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L44:
	cmpl	%esi, %r12d
	jg	.L24
	movq	%rbp, %r15
	imulq	%r10, %r15
.L25:
	movq	%r11, %r14
	subq	%r15, %r14
	cmpl	%esi, %ecx
	jg	.L26
	movq	(%rsp), %rdx
	imulq	%r10, %rdx
.L27:
	movslq	8(%r13), %rsi
	addq	%r14, %rdx
	leaq	(%rsi,%rsi,2), %rsi
	leaq	(%rbx,%rsi,4), %r14
	movslq	(%r14), %rsi
	movslq	4(%r14), %r10
	cmpl	%r12d, %esi
	jl	.L28
	imulq	%rbp, %r10
.L29:
	addq	%r10, %rdx
	cmpq	%rdx, %rax
	cmovl	%rdx, %rax
	addq	$1, %rdi
	addq	$12, %r9
	cmpq	%r8, %rdi
	je	.L43
.L33:
	cmpb	$0, (%rdi)
	movslq	(%r9), %rsi
	movslq	8(%r9), %rdx
	movslq	4(%r9), %r10
	jne	.L44
	cmpl	%esi, %ecx
	jg	.L31
	imulq	(%rsp), %r10
.L32:
	addq	%r11, %r10
	cmpq	%r10, %rax
	cmovl	%r10, %rax
	addq	$1, %rdi
	addq	$12, %r9
	cmpq	%r8, %rdi
	jne	.L33
.L43:
	movq	8(%rsp), %r13
.L22:
	addq	%r13, %rax
.L10:
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	movl	%r12d, %r15d
	movslq	8(%r14), %r14
	subl	%esi, %r15d
	imulq	%r10, %rsi
	movslq	%r15d, %r15
	imulq	%r15, %r14
	leaq	(%r14,%rsi), %r10
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%ecx, %r15d
	subl	%esi, %r15d
	imulq	%r10, %rsi
	movslq	%r15d, %r15
	imulq	%r15, %rdx
	addq	%rsi, %rdx
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%r12d, %r14d
	movslq	%edx, %r15
	subl	%esi, %r14d
	movslq	%r14d, %r14
	imulq	%r15, %r14
	movslq	%esi, %r15
	imulq	%r10, %r15
	addq	%r14, %r15
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L31:
	movl	%ecx, %r14d
	subl	%esi, %r14d
	imulq	%r10, %rsi
	movslq	%r14d, %r14
	imulq	%r14, %rdx
	leaq	(%rdx,%rsi), %r10
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L41:
	testl	%ecx, %ecx
	jle	.L34
	leal	-1(%r15), %eax
	movslq	%edi, %r10
	xorl	%r8d, %r8d
	leaq	(%rax,%rax,2), %rax
	movq	%r10, %rcx
	leaq	12(%rsi,%rax,4), %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	(%rbx), %rdx
	movslq	4(%rbx), %rsi
	movq	%rdx, %rdi
	imulq	%rsi, %rdx
	subq	%rdx, %rax
	cmpl	%ecx, %edi
	jl	.L13
	imulq	%r10, %rsi
	cmpq	%rsi, %r8
	cmovl	%rsi, %r8
	addq	$12, %rbx
	cmpq	%rbx, %r9
	jne	.L16
	addq	%r8, %rax
.L45:
	addq	$24, %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
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	movl	%ecx, %r11d
	movslq	8(%rbx), %rsi
	subl	%edi, %r11d
	movslq	%r11d, %rdi
	imulq	%rdi, %rsi
	addq	%rsi, %rdx
	cmpq	%rdx, %r8
	cmovl	%rdx, %r8
	addq	$12, %rbx
	cmpq	%rbx, %r9
	jne	.L16
	addq	%r8, %rax
	jmp	.L45
	.p2align 4,,10
	.p2align 3
.L42:
	movslq	%ecx, %rdi
	movl	$1, %esi
	movq	%rdx, (%rsp)
	call	calloc@PLT
	movq	(%rsp), %r9
	movq	%rax, used.0(%rip)
	movq	%rax, %rdi
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L35:
	xorl	%r13d, %r13d
	jmp	.L19
.L34:
	xorl	%eax, %eax
	jmp	.L10
	.cfi_endproc
.LFE53:
	.size	calc, .-calc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"%li\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB54:
	.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	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rdx
	leaq	20(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	20(%rsp), %r12
	movl	$12, %esi
	movq	%r12, %rdi
	call	calloc@PLT
	movl	$16, %esi
	movq	%r12, %rdi
	movq	%rax, %rbp
	call	calloc@PLT
	movq	%rax, %rbx
	testl	%r12d, %r12d
	jle	.L47
	movq	%rax, %r13
	leaq	32(%rsp), %rax
	movq	%rbp, %r14
	xorl	%r12d, %r12d
	movq	%rax, 8(%rsp)
	leaq	28(%rsp), %rax
	leaq	36(%rsp), %r15
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L51:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rdx
	movslq	32(%rsp), %rcx
	movslq	36(%rsp), %rsi
	movslq	24(%rsp), %rax
	movd	%edx, %xmm0
	movd	%ecx, %xmm1
	punpckldq	%xmm1, %xmm0
	movl	%esi, 8(%r14)
	movq	%xmm0, (%r14)
	cmpl	%eax, %edx
	jl	.L48
	imulq	%rcx, %rax
	movl	%r12d, 8(%r13)
	addl	$1, %r12d
	addq	$12, %r14
	addq	$16, %r13
	movq	%rax, -16(%r13)
	movl	20(%rsp), %eax
	cmpl	%eax, %r12d
	jl	.L51
.L50:
	movslq	%eax, %r12
.L47:
	leaq	cmp_node(%rip), %rcx
	movl	$16, %edx
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movslq	24(%rsp), %r13
	movslq	20(%rsp), %rax
	movq	%r13, %r8
	imulq	%rax, %r13
	movq	%rax, %rcx
	testq	%r13, %r13
	jle	.L59
	movq	$-1, %r14
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L61:
	movq	%r12, %rax
	subq	%r14, %rax
	cmpq	$1, %rax
	jle	.L52
	movq	%r12, %r13
.L54:
	movl	24(%rsp), %r8d
	movl	20(%rsp), %ecx
.L55:
	leaq	(%r14,%r13), %rax
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	movq	%rax, %r12
	shrq	$63, %r12
	addq	%rax, %r12
	sarq	%r12
	movq	%r12, %rdi
	movq	%r12, %r15
	call	calc
	testq	%rax, %rax
	jns	.L61
	movq	%r13, %rax
	subq	%r12, %rax
	cmpq	$1, %rax
	jle	.L59
	movq	%r12, %r14
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L48:
	subl	%edx, %eax
	imulq	%rcx, %rdx
	movl	%r12d, 8(%r13)
	addl	$1, %r12d
	cltq
	addq	$12, %r14
	addq	$16, %r13
	imulq	%rsi, %rax
	addq	%rdx, %rax
	movq	%rax, -16(%r13)
	movl	20(%rsp), %eax
	cmpl	%r12d, %eax
	jg	.L51
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L59:
	movq	%r13, %r15
.L52:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L62
	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
	ret
.L62:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.local	used.0
	.comm	used.0,8,8
	.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>
#include<stdint.h>
#include<inttypes.h>
#include<string.h>

typedef int32_t i32;
typedef int64_t i64;

typedef struct test {
  i32 b, l, u;
} test;

i64 eval (i32 x, test t) {
  return x <= t.b ? (i64) x * t.l : (i64) t.b * t.l + (i64) (x - t.b) * t.u;
}

typedef struct node_full {
  i64 val;
  i32 index;
} node;

int cmp_node (const void *a, const void *b) {
  i64 d = ((node *)a)->val - ((node *)b)->val;
  return d == 0 ? 0 : d > 0 ? -1 : 1;
}

#define MAX(a, b) ((a) > (b) ? (a) : (b))

i64 calc (i64 m, test *t, node *p, i32 n, i32 x) {
  if (m < x) {
    i64 sum = 0;
    i64 max = 0;
    for (i32 i = 0; i < n; ++i) {
      sum -= (i64) t[i].b * t[i].l;
      max = MAX(max, eval (m, t[i]));
    }
    return sum + max;
  }
  static uint8_t *used = NULL;
  if (used == NULL) {
    used = (uint8_t *) calloc (n, sizeof (uint8_t));
  }
  i64 sum = 0;
  for (i32 i = 0; i < n; ++i) {
    sum -= (i64) t[i].b * t[i].l;
    used[i] = 0;
  }
  i64 buf = 0;
  i32 swap = 0;
  for (i32 i = 0; m >= x; ++i, m -= x) {
    buf += p[i].val;
    used[p[i].index] = 1;
    swap = i + 1;
  }
  i64 max = buf;
  for (i32 i = 0; i < n; ++i) {
    if (used[i]) {
      max = MAX(max, buf - eval (x, t[i]) + eval (m, t[i]) + eval (x, t[p[swap].index]));
    } else {
      max = MAX(max, buf + eval (m, t[i]));
    }
  }
  return max + sum;
}

void run (void) {
  i32 n, x;
  scanf ("%" SCNi32 "%" SCNi32, &n, &x);
  test *t = (test *) calloc (n, sizeof (test));
  node *p = (node *) calloc (n, sizeof (node));
  for (i32 i = 0; i < n; ++i) {
    i32 b, l, u;
    scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &b, &l, &u);
    t[i] = (test) {b, l, u};
    p[i] = (node) {eval (x, t[i]), i};
  }
  qsort (p, n, sizeof (node), cmp_node);
  i64 left = -1;
  i64 right = (i64) x * n;
  while (right - left > 1) {
    i64 m = (left + right) / 2;
    if (calc (m, t, p, n, x) >= 0) {
      right = m;
    } else {
      left = m;
    }
  }
  printf ("%" PRIi64 "\n", right);
}

int main (void) {
  run();
  return 0;
}

2 100
85 2 6
60 1 1
 10 1000
451 4593 6263
324 310 9662
378 1431 7068
71 1757 9218
204 3676 4328
840 6221 9080
684 1545 8511
709 5467 8674
862 6504 9835
283 4965 9980
 1 100000
31415 2718 1443
 2 100
85 2 11
60 1 1
 10 1000
451 4593 6263
324 310 9662
378 1431 7068
71 1757 9218
204 3676 4328
840 6221 9080
684 1545 8511
709 5467 8674
862 6504 9835
356 4965 9980
 10 1000
12 4593 6263
333 310 9662
378 1431 7068
71 1757 9218
204 3676 4328
840 6221 9080
684 1545 8511
709 5467 8674
862 6504 9835
356 4965 9980
 10 1000
12 4593 6263
333 310 9662
639 1431 7068
71 1757 9218
204 3676 4328
840 6221 9080
684 1545 8511
709 5467 8674
862 6504 9835
356 4965 9980
 10 1000
12 4593 6263
333 310 9662
639 1431 7068
71 1757 11462
204 3676 4328
840 6221 9080
684 1545 8511
709 5467 8674
862 6504 9835
356 4965 9980
 10 1000
12 4593 6263
333 310 9662
48 1431 7068
71 1757 11462
204 3676 4328
840 6221 9080
684 1545 8511
709 5467 8674
862 6504 9835
356 4965 9980
 10 1000
12 4593 6263
333 310 9662
48 1431 7068
71 1757 11462
80 3676 4328
840 6221 9080
684 1545 8511
709 5467 8674
862 6504 9835
356 4965 9980

95
 2540
 31415
 91
 2652
 2342
 2400
 2079
 1967
 1921

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

typedef int32_t i32;
typedef int64_t i64;

typedef struct test {
  i32 b, l, u;
} test;

i64 eval (i32 x, test t) {
  return x <= t.b ? (i64) x * t.l : (i64) t.b * t.l + (i64) (x - t.b) * t.u;
}

typedef struct node_full {
  i64 val;
  i32 index;
} node;

int cmp_node (const void *a, const void *b) {
  i64 d = ((node *)a)->val - ((node *)b)->val;
  return d == 0 ? 0 : d > 0 ? -1 : 1;
}

#define MAX(a, b) ((a) > (b) ? (a) : (b))

i64 calc (i64 m, test *t, node *p, i32 n, i32 x) {
  if (m < x) {
    i64 sum = 0;
    i64 max = 0;
    for (i32 i = 0; i < n; ++i) {
      sum -= (i64) t[i].b * t[i].l;
      max = MAX(max, eval (m, t[i]));
    }
    return sum + max;
  }
  static uint8_t *used = NULL;
  if (used == NULL) {
    used = (uint8_t *) calloc (n, sizeof (uint8_t));
  }
  i64 sum = 0;
  for (i32 i = 0; i < n; ++i) {
    sum -= (i64) t[i].b * t[i].l;
    used[i] = 0;
  }
  i64 buf = 0;
  i32 swap = 0;
  for (i32 i = 0; m >= x; ++i, m -= x) {
    buf += p[i].val;
    used[p[i].index] = 1;
    swap = i + 1;
  }
  i64 max = buf;
  for (i32 i = 0; i < n; ++i) {
    if (used[i]) {
      max = MAX(max, buf - eval (x, t[i]) + eval (m, t[i]) + eval (x, t[p[swap].index]));
    } else {
      max = MAX(max, buf + eval (m, t[i]));
    }
  }
  return max + sum;
}

void run (void) {
  i32 n, x;
  scanf ("%" SCNi32 "%" SCNi32, &n, &x);
  test *t = (test *) calloc (n, sizeof (test));
  node *p = (node *) calloc (n, sizeof (node));
  for (i32 i = 0; i < n; ++i) {
    i32 b, l, u;
    scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &b, &l, &u);
    t[i] = (test) {b, l, u};
    p[i] = (node) {eval (x, t[i]), i};
  }
  qsort (p, n, sizeof (node), cmp_node);
  i64 left = -1;
  i64 right = (i64) x * n;
  while (right - left > 1) {
    i64 m = (left + right) / 2;
    if (calc (m, t, p, n, x) >= 0) {
      right = m;
    } else {
      left = m;
    }
  }
  printf ("%" PRIi64 "\n", right);
}

int main (void) {
  run();
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	eval
	.type	eval, @function
eval:
.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)
	movq	%rsi, %rcx
	movl	%edx, %eax
	movq	%rcx, -20(%rbp)
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L2
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	jmp	.L4
.L2:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	eval, .-eval
	.globl	cmp_node
	.type	cmp_node, @function
cmp_node:
.LFB7:
	.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	-24(%rbp), %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L6
	cmpq	$0, -8(%rbp)
	jle	.L7
	movl	$-1, %eax
	jmp	.L10
.L7:
	movl	$1, %eax
	jmp	.L10
.L6:
	movl	$0, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp_node, .-cmp_node
	.globl	calc
	.type	calc, @function
calc:
.LFB8:
	.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	$104, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -88(%rbp)
	movq	%rsi, -96(%rbp)
	movq	%rdx, -104(%rbp)
	movl	%ecx, -108(%rbp)
	movl	%r8d, -112(%rbp)
	movl	-112(%rbp), %eax
	cltq
	cmpq	%rax, -88(%rbp)
	jge	.L12
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L13
.L16:
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	cltq
	imulq	%rcx, %rax
	subq	%rax, -56(%rbp)
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	cmpq	%rax, -48(%rbp)
	jg	.L14
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	jmp	.L15
.L14:
	movq	-48(%rbp), %rax
.L15:
	movq	%rax, -48(%rbp)
	addl	$1, -76(%rbp)
.L13:
	movl	-76(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jl	.L16
	movq	-56(%rbp), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	jmp	.L17
.L12:
	movq	used.0(%rip), %rax
	testq	%rax, %rax
	jne	.L18
	movl	-108(%rbp), %eax
	cltq
	movl	$1, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, used.0(%rip)
.L18:
	movq	$0, -40(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L19
.L20:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	cltq
	imulq	%rcx, %rax
	subq	%rax, -40(%rbp)
	movq	used.0(%rip), %rdx
	movl	-72(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movb	$0, (%rax)
	addl	$1, -72(%rbp)
.L19:
	movl	-72(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jl	.L20
	movq	$0, -32(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L21
.L22:
	movl	-64(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, -32(%rbp)
	movq	used.0(%rip), %rdx
	movl	-64(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-104(%rbp), %rax
	addq	%rcx, %rax
	movl	8(%rax), %eax
	cltq
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-64(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -68(%rbp)
	addl	$1, -64(%rbp)
	movl	-112(%rbp), %eax
	cltq
	subq	%rax, -88(%rbp)
.L21:
	movl	-112(%rbp), %eax
	cltq
	cmpq	%rax, -88(%rbp)
	jge	.L22
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L23
.L30:
	movq	used.0(%rip), %rdx
	movl	-60(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L24
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, %rbx
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	addq	%rax, %rbx
	movl	-68(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	addq	%rbx, %rax
	cmpq	%rax, -24(%rbp)
	jg	.L25
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, %rbx
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	addq	%rax, %rbx
	movl	-68(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	addq	%rbx, %rax
	jmp	.L26
.L25:
	movq	-24(%rbp), %rax
.L26:
	movq	%rax, -24(%rbp)
	jmp	.L27
.L24:
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	movq	-32(%rbp), %rdx
	addq	%rdx, %rax
	cmpq	%rax, -24(%rbp)
	jg	.L28
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	movq	-32(%rbp), %rdx
	addq	%rdx, %rax
	jmp	.L29
.L28:
	movq	-24(%rbp), %rax
.L29:
	movq	%rax, -24(%rbp)
.L27:
	addl	$1, -60(%rbp)
.L23:
	movl	-60(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jl	.L30
	movq	-24(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	calc, .-calc
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"%li\n"
	.text
	.globl	run
	.type	run, @function
run:
.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	$104, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-96(%rbp), %rdx
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	cltq
	movl	$12, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -64(%rbp)
	movl	-100(%rbp), %eax
	cltq
	movl	$16, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -56(%rbp)
	movl	$0, -84(%rbp)
	jmp	.L32
.L33:
	leaq	-36(%rbp), %rcx
	leaq	-88(%rbp), %rdx
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movl	-92(%rbp), %esi
	movl	-88(%rbp), %ecx
	movl	-36(%rbp), %edx
	movl	%esi, (%rax)
	movl	%ecx, 4(%rax)
	movl	%edx, 8(%rax)
	movl	-84(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	-84(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movl	-96(%rbp), %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	movq	%rax, (%rbx)
	movl	-84(%rbp), %eax
	movl	%eax, 8(%rbx)
	addl	$1, -84(%rbp)
.L32:
	movl	-100(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jl	.L33
	movl	-100(%rbp), %eax
	movslq	%eax, %rsi
	movq	-56(%rbp), %rax
	leaq	cmp_node(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$-1, -80(%rbp)
	movl	-96(%rbp), %eax
	movslq	%eax, %rdx
	movl	-100(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -72(%rbp)
	jmp	.L34
.L36:
	movq	-80(%rbp), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -48(%rbp)
	movl	-96(%rbp), %edi
	movl	-100(%rbp), %ecx
	movq	-56(%rbp), %rdx
	movq	-64(%rbp), %rsi
	movq	-48(%rbp), %rax
	movl	%edi, %r8d
	movq	%rax, %rdi
	call	calc
	testq	%rax, %rax
	js	.L35
	movq	-48(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L34
.L35:
	movq	-48(%rbp), %rax
	movq	%rax, -80(%rbp)
.L34:
	movq	-72(%rbp), %rax
	subq	-80(%rbp), %rax
	cmpq	$1, %rax
	jg	.L36
	movq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.local	used.0
	.comm	used.0,8,8
	.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	eval
	.type	eval, @function
eval:
.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)
	movq	%rsi, %rcx
	movl	%edx, %eax
	movq	%rcx, -20(%rbp)
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L2
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	jmp	.L4
.L2:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	eval, .-eval
	.globl	cmp_node
	.type	cmp_node, @function
cmp_node:
.LFB7:
	.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	-24(%rbp), %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	je	.L6
	cmpq	$0, -8(%rbp)
	jle	.L7
	movl	$-1, %eax
	jmp	.L10
.L7:
	movl	$1, %eax
	jmp	.L10
.L6:
	movl	$0, %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp_node, .-cmp_node
	.globl	calc
	.type	calc, @function
calc:
.LFB8:
	.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	$104, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -88(%rbp)
	movq	%rsi, -96(%rbp)
	movq	%rdx, -104(%rbp)
	movl	%ecx, -108(%rbp)
	movl	%r8d, -112(%rbp)
	movl	-112(%rbp), %eax
	cltq
	cmpq	%rax, -88(%rbp)
	jge	.L12
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movl	$0, -76(%rbp)
	jmp	.L13
.L16:
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	cltq
	imulq	%rcx, %rax
	subq	%rax, -56(%rbp)
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	cmpq	%rax, -48(%rbp)
	jg	.L14
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	jmp	.L15
.L14:
	movq	-48(%rbp), %rax
.L15:
	movq	%rax, -48(%rbp)
	addl	$1, -76(%rbp)
.L13:
	movl	-76(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jl	.L16
	movq	-56(%rbp), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	jmp	.L17
.L12:
	movq	used.0(%rip), %rax
	testq	%rax, %rax
	jne	.L18
	movl	-108(%rbp), %eax
	cltq
	movl	$1, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, used.0(%rip)
.L18:
	movq	$0, -40(%rbp)
	movl	$0, -72(%rbp)
	jmp	.L19
.L20:
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rcx
	movl	-72(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	cltq
	imulq	%rcx, %rax
	subq	%rax, -40(%rbp)
	movq	used.0(%rip), %rdx
	movl	-72(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movb	$0, (%rax)
	addl	$1, -72(%rbp)
.L19:
	movl	-72(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jl	.L20
	movq	$0, -32(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	jmp	.L21
.L22:
	movl	-64(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	addq	%rax, -32(%rbp)
	movq	used.0(%rip), %rdx
	movl	-64(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-104(%rbp), %rax
	addq	%rcx, %rax
	movl	8(%rax), %eax
	cltq
	addq	%rdx, %rax
	movb	$1, (%rax)
	movl	-64(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -68(%rbp)
	addl	$1, -64(%rbp)
	movl	-112(%rbp), %eax
	cltq
	subq	%rax, -88(%rbp)
.L21:
	movl	-112(%rbp), %eax
	cltq
	cmpq	%rax, -88(%rbp)
	jge	.L22
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L23
.L30:
	movq	used.0(%rip), %rdx
	movl	-60(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L24
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, %rbx
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	addq	%rax, %rbx
	movl	-68(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	addq	%rbx, %rax
	cmpq	%rax, -24(%rbp)
	jg	.L25
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	movq	%rax, %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, %rbx
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	addq	%rax, %rbx
	movl	-68(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-104(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	movl	-112(%rbp), %eax
	movq	%rcx, %rsi
	movl	%eax, %edi
	call	eval
	addq	%rbx, %rax
	jmp	.L26
.L25:
	movq	-24(%rbp), %rax
.L26:
	movq	%rax, -24(%rbp)
	jmp	.L27
.L24:
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	movq	-32(%rbp), %rdx
	addq	%rdx, %rax
	cmpq	%rax, -24(%rbp)
	jg	.L28
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	-88(%rbp), %rdx
	movl	%edx, %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	movq	-32(%rbp), %rdx
	addq	%rdx, %rax
	jmp	.L29
.L28:
	movq	-24(%rbp), %rax
.L29:
	movq	%rax, -24(%rbp)
.L27:
	addl	$1, -60(%rbp)
.L23:
	movl	-60(%rbp), %eax
	cmpl	-108(%rbp), %eax
	jl	.L30
	movq	-24(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	calc, .-calc
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"%li\n"
	.text
	.globl	run
	.type	run, @function
run:
.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	$104, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-96(%rbp), %rdx
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	cltq
	movl	$12, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -64(%rbp)
	movl	-100(%rbp), %eax
	cltq
	movl	$16, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -56(%rbp)
	movl	$0, -84(%rbp)
	jmp	.L32
.L33:
	leaq	-36(%rbp), %rcx
	leaq	-88(%rbp), %rdx
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movl	-92(%rbp), %esi
	movl	-88(%rbp), %ecx
	movl	-36(%rbp), %edx
	movl	%esi, (%rax)
	movl	%ecx, 4(%rax)
	movl	%edx, 8(%rax)
	movl	-84(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	-84(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movl	-96(%rbp), %ecx
	movq	(%rax), %rdx
	movl	8(%rax), %eax
	movq	%rdx, %rsi
	movl	%eax, %edx
	movl	%ecx, %edi
	call	eval
	movq	%rax, (%rbx)
	movl	-84(%rbp), %eax
	movl	%eax, 8(%rbx)
	addl	$1, -84(%rbp)
.L32:
	movl	-100(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jl	.L33
	movl	-100(%rbp), %eax
	movslq	%eax, %rsi
	movq	-56(%rbp), %rax
	leaq	cmp_node(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$-1, -80(%rbp)
	movl	-96(%rbp), %eax
	movslq	%eax, %rdx
	movl	-100(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	movq	%rax, -72(%rbp)
	jmp	.L34
.L36:
	movq	-80(%rbp), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -48(%rbp)
	movl	-96(%rbp), %edi
	movl	-100(%rbp), %ecx
	movq	-56(%rbp), %rdx
	movq	-64(%rbp), %rsi
	movq	-48(%rbp), %rax
	movl	%edi, %r8d
	movq	%rax, %rdi
	call	calc
	testq	%rax, %rax
	js	.L35
	movq	-48(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L34
.L35:
	movq	-48(%rbp), %rax
	movq	%rax, -80(%rbp)
.L34:
	movq	-72(%rbp), %rax
	subq	-80(%rbp), %rax
	cmpq	$1, %rax
	jg	.L36
	movq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	main, .-main
	.local	used.0
	.comm	used.0,8,8
	.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:
