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>

typedef int32_t i32;
typedef int64_t i64;

typedef struct add_max_node {
  i64 add;
  i64 max;
} add_max_node;

typedef struct RMQandRAQ {
  add_max_node *a;
  i32 bit;
  i32 size;
} RMQandRAQ;

RMQandRAQ* new_RMQandRAQ (const i32 n) {
  i32 k = 0;
  while ((1 << k) < n) ++k;
  RMQandRAQ *s = (RMQandRAQ *) calloc (1, sizeof (RMQandRAQ));
  s->a = (add_max_node *) calloc (2 << k, sizeof (add_max_node));
  s->bit = k;
  s->size = 1 << k;
  return s;
}

static inline i64 max (i64 a, i64 b) {
  return a > b ? a : b;
}

static inline i64 eval (RMQandRAQ *s, i32 k) {
  return s->a[k].add + s->a[k].max;
}

void propagate (RMQandRAQ *s, i32 x) {
  x += s->size;
  for (i32 bit = s->bit; bit > 0; bit--) {
    i32 k = x >> bit;
    s->a[2 * k].add += s->a[k].add;
    s->a[2 * k + 1].add += s->a[k].add;
    s->a[k].add = 0;
    s->a[k].max = max (eval (s, 2 * k), eval (s, 2 * k + 1));
  }
}

void save (RMQandRAQ *s, i32 x) {
  for (i32 k = (x + s->size) >> 1; k >= 1; k >>= 1) {
    s->a[k].max = max (eval (s, 2 * k), eval (s, 2 * k + 1));
  }
}

void add (RMQandRAQ *s, i32 l, i32 r, i64 v) {
  for (i32 x = l + s->size, y = r + s->size; x < y; x >>= 1, y >>= 1) {
    if (x & 1) s->a[x++].add += v;
    if (y & 1) s->a[--y].add += v;
  }
  save (s, l);
  save (s, r - 1);
}

i64 find (RMQandRAQ *s, i32 l, i32 r) {
  propagate (s, l);
  propagate (s, r - 1);
  i64 ans = 0;
  for (l += s->size, r += s->size; l < r; l >>= 1, r >>= 1) {
    if (l & 1) ans = max (ans, eval (s, l++));
    if (r & 1) ans = max (ans, eval (s, --r));
  }
  return ans;
}

typedef struct node {
  i32 l, v, next;
} node;

void run (void) {
  i32 n, m;
  scanf ("%" SCNi32 "%" SCNi32, &n, &m);
  node *a = (node *) calloc (m + 1, sizeof (node));
  i32 *start = (i32 *) calloc (n + 1, sizeof (i32));
  for (i32 i = 1; i <= m; ++i) {
    i32 l, r, v;
    scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &l, &r, &v);
    a[i] = (node) {l, v, start[r]};
    start[r] = i;
  }
  RMQandRAQ *s = new_RMQandRAQ (n + 1);
  for (i32 i = 1; i <= n; ++i) {
    i64 v = find (s, 0, i);
    add (s, i, i + 1, v);
    for (i32 p = start[i]; p; p = a[p].next) {
      add (s, a[p].l, i + 1, a[p].v);
    }
  }
  printf ("%" PRIi64 "\n", find (s, 0, n + 1));
}

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

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	new_RMQandRAQ
	.type	new_RMQandRAQ, @function
new_RMQandRAQ:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L3
	movl	$16, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	$2, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cltq
	movl	$16, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, 8(%rax)
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movq	-8(%rbp), %rax
	movl	%edx, 12(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new_RMQandRAQ, .-new_RMQandRAQ
	.type	max, @function
max:
.LFB7:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	max, .-max
	.type	eval, @function
eval:
.LFB8:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rcx, %rax
	movq	8(%rax), %rax
	addq	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	eval, .-eval
	.globl	propagate
	.type	propagate, @function
propagate:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	-40(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, -44(%rbp)
	movq	-40(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	movl	-44(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -20(%rbp)
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rsi
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	salq	$4, %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rsi
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %r12
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	leaq	(%rcx,%rax), %rbx
	movq	%r12, %rsi
	movq	%rdx, %rdi
	call	max
	movq	%rax, 8(%rbx)
	subl	$1, -24(%rbp)
.L10:
	cmpl	$0, -24(%rbp)
	jg	.L11
	nop
	nop
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	propagate, .-propagate
	.globl	save
	.type	save, @function
save:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	-40(%rbp), %rax
	movl	12(%rax), %edx
	movl	-44(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L14:
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %r12
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	leaq	(%rcx,%rax), %rbx
	movq	%r12, %rsi
	movq	%rdx, %rdi
	call	max
	movq	%rax, 8(%rbx)
	sarl	-20(%rbp)
.L13:
	cmpl	$0, -20(%rbp)
	jg	.L14
	nop
	nop
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	save, .-save
	.globl	add
	.type	add, @function
add:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movq	%rcx, -40(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	jmp	.L16
.L19:
	movl	-8(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L17
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	movslq	%eax, %rdx
	salq	$4, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-24(%rbp), %rdx
	movq	(%rdx), %rdx
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L17:
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L18
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	subl	$1, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	salq	$4, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-24(%rbp), %rdx
	movq	(%rdx), %rdx
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L18:
	sarl	-8(%rbp)
	sarl	-4(%rbp)
.L16:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L19
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	save
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	save
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	add, .-add
	.globl	find
	.type	find, @function
find:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	propagate
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	propagate
	movq	$0, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, -28(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, -32(%rbp)
	jmp	.L21
.L24:
	movl	-28(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L22
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	movq	-24(%rbp), %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	max
	movq	%rax, -8(%rbp)
.L22:
	movl	-32(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L23
	subl	$1, -32(%rbp)
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	max
	movq	%rax, -8(%rbp)
.L23:
	sarl	-28(%rbp)
	sarl	-32(%rbp)
.L21:
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L24
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	find, .-find
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"%li\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rdx
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$12, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -56(%rbp)
	movl	-84(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -48(%rbp)
	movl	$1, -68(%rbp)
	jmp	.L27
.L28:
	leaq	-20(%rbp), %rcx
	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	-68(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-76(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-72(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rdi
	movq	-48(%rbp), %rdx
	addq	%rdi, %rdx
	movl	(%rdx), %edx
	movl	%esi, (%rax)
	movl	%ecx, 4(%rax)
	movl	%edx, 8(%rax)
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-68(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -68(%rbp)
.L27:
	movl	-80(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jle	.L28
	movl	-84(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	new_RMQandRAQ
	movq	%rax, -40(%rbp)
	movl	$1, -64(%rbp)
	jmp	.L29
.L32:
	movl	-64(%rbp), %edx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -32(%rbp)
	movl	-64(%rbp), %eax
	leal	1(%rax), %edi
	movq	-32(%rbp), %rdx
	movl	-64(%rbp), %esi
	movq	-40(%rbp), %rax
	movq	%rdx, %rcx
	movl	%edi, %edx
	movq	%rax, %rdi
	call	add
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	jmp	.L30
.L31:
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movslq	%eax, %rdx
	movl	-64(%rbp), %eax
	leal	1(%rax), %edi
	movl	-60(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	movq	-56(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %esi
	movq	-40(%rbp), %rax
	movq	%rdx, %rcx
	movl	%edi, %edx
	movq	%rax, %rdi
	call	add
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movl	%eax, -60(%rbp)
.L30:
	cmpl	$0, -60(%rbp)
	jne	.L31
	addl	$1, -64(%rbp)
.L29:
	movl	-84(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jle	.L32
	movl	-84(%rbp), %eax
	leal	1(%rax), %edx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB14:
	.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
.LFE14:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	new_RMQandRAQ
	.type	new_RMQandRAQ, @function
new_RMQandRAQ:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	cmpl	$1, %edi
	jle	.L4
	xorl	%ecx, %ecx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %ecx
	movl	%eax, %ebx
	sall	%cl, %ebx
	cmpl	%edi, %ebx
	jl	.L3
	movl	$2, %ebp
	sall	%cl, %ebp
	movslq	%ebp, %rbp
.L2:
	movl	$16, %esi
	movl	$1, %edi
	movl	%ecx, 12(%rsp)
	call	calloc@PLT
	movq	%rbp, %rdi
	movl	$16, %esi
	movq	%rax, %r12
	call	calloc@PLT
	movl	12(%rsp), %ecx
	movl	%ebx, 12(%r12)
	movq	%rax, (%r12)
	movq	%r12, %rax
	movl	%ecx, 8(%r12)
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	movl	$2, %ebp
	xorl	%ecx, %ecx
	movl	$1, %ebx
	jmp	.L2
	.cfi_endproc
.LFE39:
	.size	new_RMQandRAQ, .-new_RMQandRAQ
	.p2align 4
	.globl	propagate
	.type	propagate, @function
propagate:
.LFB42:
	.cfi_startproc
	endbr64
	movl	8(%rdi), %ecx
	addl	12(%rdi), %esi
	movl	%esi, %r9d
	testl	%ecx, %ecx
	jle	.L8
	movq	(%rdi), %r8
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r9d, %edx
	sarl	%cl, %edx
	leal	(%rdx,%rdx), %eax
	movslq	%edx, %rdx
	cltq
	salq	$4, %rdx
	movq	%rax, %rdi
	addq	$1, %rax
	addq	%r8, %rdx
	salq	$4, %rdi
	salq	$4, %rax
	movq	(%rdx), %rsi
	addq	%r8, %rdi
	addq	%r8, %rax
	addq	%rsi, (%rdi)
	movq	(%rdx), %rsi
	addq	%rsi, (%rax)
	movq	8(%rdi), %rsi
	movq	$0, (%rdx)
	addq	(%rdi), %rsi
	movq	8(%rax), %rdi
	addq	(%rax), %rdi
	cmpq	%rdi, %rsi
	cmovl	%rdi, %rsi
	movq	%rsi, 8(%rdx)
	subl	$1, %ecx
	jne	.L10
.L8:
	ret
	.cfi_endproc
.LFE42:
	.size	propagate, .-propagate
	.p2align 4
	.globl	save
	.type	save, @function
save:
.LFB43:
	.cfi_startproc
	endbr64
	addl	12(%rdi), %esi
	sarl	%esi
	testl	%esi, %esi
	jle	.L12
	movq	(%rdi), %rdi
	.p2align 4,,10
	.p2align 3
.L14:
	leal	(%rsi,%rsi), %eax
	movslq	%esi, %r8
	leal	1(%rax), %edx
	cltq
	salq	$4, %r8
	salq	$4, %rax
	movslq	%edx, %rdx
	addq	%rdi, %rax
	salq	$4, %rdx
	movq	8(%rax), %rcx
	addq	%rdi, %rdx
	addq	(%rax), %rcx
	movq	%rcx, %rax
	movq	8(%rdx), %rcx
	addq	(%rdx), %rcx
	cmpq	%rcx, %rax
	cmovl	%rcx, %rax
	sarl	%esi
	movq	%rax, 8(%rdi,%r8)
	jne	.L14
.L12:
	ret
	.cfi_endproc
.LFE43:
	.size	save, .-save
	.p2align 4
	.globl	add
	.type	add, @function
add:
.LFB44:
	.cfi_startproc
	endbr64
	movl	12(%rdi), %r9d
	movq	%rcx, %r10
	movl	%edx, %r8d
	leal	(%r9,%rsi), %ecx
	leal	(%r9,%rdx), %eax
	cmpl	%edx, %esi
	jge	.L17
	movl	%ecx, %edx
	.p2align 4,,10
	.p2align 3
.L21:
	testb	$1, %dl
	je	.L18
	movslq	%edx, %rsi
	addl	$1, %edx
	salq	$4, %rsi
	addq	(%rdi), %rsi
	addq	%r10, (%rsi)
.L18:
	testb	$1, %al
	je	.L19
	subl	$1, %eax
	sarl	%edx
	movslq	%eax, %rsi
	sarl	%eax
	salq	$4, %rsi
	addq	(%rdi), %rsi
	addq	%r10, (%rsi)
	cmpl	%eax, %edx
	jl	.L21
.L17:
	sarl	%ecx
	testl	%ecx, %ecx
	jle	.L22
	movq	(%rdi), %rsi
	.p2align 4,,10
	.p2align 3
.L23:
	leal	(%rcx,%rcx), %eax
	movslq	%ecx, %r11
	leal	1(%rax), %edx
	cltq
	salq	$4, %r11
	movslq	%edx, %rdx
	salq	$4, %rax
	salq	$4, %rdx
	addq	%rsi, %rax
	addq	%rsi, %rdx
	movq	8(%rdx), %r10
	addq	(%rdx), %r10
	movq	%r10, %rdx
	movq	8(%rax), %r10
	addq	(%rax), %r10
	cmpq	%r10, %rdx
	cmovl	%r10, %rdx
	sarl	%ecx
	movq	%rdx, 8(%rsi,%r11)
	jne	.L23
.L22:
	leal	-1(%r9,%r8), %esi
	sarl	%esi
	testl	%esi, %esi
	jle	.L16
	movq	(%rdi), %rdi
	.p2align 4,,10
	.p2align 3
.L25:
	leal	(%rsi,%rsi), %eax
	movslq	%esi, %r8
	leal	1(%rax), %edx
	cltq
	salq	$4, %r8
	movslq	%edx, %rdx
	salq	$4, %rax
	salq	$4, %rdx
	addq	%rdi, %rax
	addq	%rdi, %rdx
	movq	8(%rdx), %rcx
	addq	(%rdx), %rcx
	movq	%rcx, %rdx
	movq	8(%rax), %rcx
	addq	(%rax), %rcx
	cmpq	%rcx, %rdx
	cmovl	%rcx, %rdx
	sarl	%esi
	movq	%rdx, 8(%rdi,%r8)
	jne	.L25
.L16:
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	sarl	%edx
	sarl	%eax
	cmpl	%eax, %edx
	jl	.L21
	jmp	.L17
	.cfi_endproc
.LFE44:
	.size	add, .-add
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB45:
	.cfi_startproc
	endbr64
	movq	%rdi, %r9
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%edx, %r11d
	movl	%esi, %r10d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	8(%r9), %r8d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	12(%rdi), %edi
	leal	(%rsi,%rdi), %edx
	testl	%r8d, %r8d
	jle	.L38
	movq	(%r9), %rsi
	movl	%r8d, %ecx
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%edx, %ebx
	sarl	%cl, %ebx
	leal	(%rbx,%rbx), %eax
	movslq	%ebx, %rbx
	cltq
	salq	$4, %rbx
	movq	%rax, %rbp
	addq	$1, %rax
	addq	%rsi, %rbx
	salq	$4, %rbp
	salq	$4, %rax
	movq	(%rbx), %r14
	addq	%rsi, %rax
	addq	%rsi, %rbp
	addq	%r14, 0(%rbp)
	movq	(%rbx), %r14
	addq	%r14, (%rax)
	movq	$0, (%rbx)
	movq	(%rax), %r14
	addq	8(%rax), %r14
	movq	%r14, %rax
	movq	0(%rbp), %r14
	addq	8(%rbp), %r14
	cmpq	%r14, %rax
	cmovl	%r14, %rax
	movq	%rax, 8(%rbx)
	subl	$1, %ecx
	jne	.L35
	leal	-1(%rdi,%r11), %ebx
	.p2align 4,,10
	.p2align 3
.L37:
	movl	%r8d, %ecx
	movl	%ebx, %eax
	sarl	%cl, %eax
	movslq	%eax, %rcx
	leal	(%rcx,%rcx), %eax
	salq	$4, %rcx
	cltq
	addq	%rsi, %rcx
	movq	%rax, %rbp
	addq	$1, %rax
	movq	(%rcx), %r14
	salq	$4, %rbp
	salq	$4, %rax
	addq	%rsi, %rax
	addq	%rsi, %rbp
	addq	%r14, 0(%rbp)
	movq	(%rcx), %r14
	addq	%r14, (%rax)
	movq	$0, (%rcx)
	movq	(%rax), %r14
	addq	8(%rax), %r14
	movq	%r14, %rax
	movq	0(%rbp), %r14
	addq	8(%rbp), %r14
	cmpq	%r14, %rax
	cmovl	%r14, %rax
	movq	%rax, 8(%rcx)
	subl	$1, %r8d
	jne	.L37
.L38:
	addl	%r11d, %edi
	xorl	%r8d, %r8d
	cmpl	%r11d, %r10d
	jge	.L31
	.p2align 4,,10
	.p2align 3
.L33:
	testb	$1, %dl
	je	.L39
	movslq	%edx, %rax
	salq	$4, %rax
	addq	(%r9), %rax
	movq	8(%rax), %rcx
	addq	(%rax), %rcx
	cmpq	%rcx, %r8
	cmovl	%rcx, %r8
	addl	$1, %edx
.L39:
	testb	$1, %dil
	je	.L40
	subl	$1, %edi
	movslq	%edi, %rax
	salq	$4, %rax
	addq	(%r9), %rax
	movq	8(%rax), %rcx
	addq	(%rax), %rcx
	cmpq	%rcx, %r8
	cmovl	%rcx, %r8
	sarl	%edx
	sarl	%edi
	cmpl	%edi, %edx
	jl	.L33
.L31:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movq	%r8, %rax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L40:
	.cfi_restore_state
	sarl	%edx
	sarl	%edi
	cmpl	%edi, %edx
	jl	.L33
	popq	%rbx
	.cfi_def_cfa_offset 24
	movq	%r8, %rax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE45:
	.size	find, .-find
	.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:
.LFB46:
	.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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rdx
	leaq	36(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %ebp
	movl	$12, %esi
	leal	1(%rbp), %edi
	movslq	%edi, %rdi
	call	calloc@PLT
	movl	36(%rsp), %ebx
	movl	$4, %esi
	movq	%rax, %r13
	leal	1(%rbx), %eax
	movslq	%eax, %rdi
	movl	%eax, 8(%rsp)
	call	calloc@PLT
	movq	%rax, 16(%rsp)
	testl	%ebp, %ebp
	jle	.L52
	leaq	12(%r13), %rbx
	movq	%r13, 8(%rsp)
	movl	$1, %r14d
	leaq	52(%rsp), %r15
	movq	%rbx, %r13
	leaq	48(%rsp), %r12
	leaq	44(%rsp), %rbp
	movq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L53:
	movq	%r12, %rdx
	movq	%r15, %rcx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	addq	$12, %r13
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %rax
	movd	44(%rsp), %xmm0
	movd	52(%rsp), %xmm1
	leaq	(%rbx,%rax,4), %rax
	movl	(%rax), %edx
	punpckldq	%xmm1, %xmm0
	movl	%r14d, (%rax)
	addl	$1, %r14d
	movq	%xmm0, -12(%r13)
	movl	%edx, -4(%r13)
	cmpl	%r14d, 40(%rsp)
	jge	.L53
	movl	36(%rsp), %ebx
	movq	8(%rsp), %r13
	leal	1(%rbx), %eax
	movl	%eax, 8(%rsp)
.L52:
	testl	%ebx, %ebx
	jle	.L54
	xorl	%ecx, %ecx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L55:
	addl	$1, %ecx
	movl	%eax, %ebp
	sall	%cl, %ebp
	cmpl	%ebx, %ebp
	jle	.L55
	movl	$16, %esi
	movl	$1, %edi
	movl	%ecx, 28(%rsp)
	movl	$1, %r12d
	call	calloc@PLT
	movl	28(%rsp), %ecx
	movl	$16, %esi
	movq	%rax, %r15
	movl	$2, %eax
	sall	%cl, %eax
	movslq	%eax, %rdi
	call	calloc@PLT
	movl	28(%rsp), %ecx
	movd	%ebp, %xmm2
	movq	16(%rsp), %r14
	movq	%rax, (%r15)
	movq	%rax, %rbx
	leal	-1(%rbp), %eax
	movl	%r12d, %ebp
	movd	%ecx, %xmm0
	movl	%eax, 16(%rsp)
	addq	$4, %r14
	movd	%xmm2, %r12d
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, 8(%r15)
	.p2align 4,,10
	.p2align 3
.L58:
	movl	%ebp, %edx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	find
	movl	%ebp, %esi
	addl	$1, %ebp
	movq	%r15, %rdi
	movq	%rax, %rcx
	movl	%ebp, %edx
	call	add
	movl	16(%rsp), %ecx
	movslq	(%r14), %rax
	leal	(%r12,%rbp), %r10d
	leal	(%rcx,%rbp), %r9d
	sarl	%r9d
	testl	%eax, %eax
	je	.L70
	.p2align 4,,10
	.p2align 3
.L69:
	leaq	(%rax,%rax,2), %rax
	movl	%r10d, %edx
	leaq	0(%r13,%rax,4), %rcx
	movl	(%rcx), %edi
	movslq	4(%rcx), %r8
	leal	(%rdi,%r12), %esi
	movl	%esi, %eax
	cmpl	%edi, %ebp
	jle	.L66
	.p2align 4,,10
	.p2align 3
.L60:
	testb	$1, %al
	je	.L63
	movslq	%eax, %rdi
	addl	$1, %eax
	salq	$4, %rdi
	addq	%r8, (%rbx,%rdi)
.L63:
	testb	$1, %dl
	je	.L64
	subl	$1, %edx
	sarl	%eax
	movslq	%edx, %rdi
	sarl	%edx
	salq	$4, %rdi
	addq	%r8, (%rbx,%rdi)
	cmpl	%eax, %edx
	jg	.L60
.L66:
	sarl	%esi
	testl	%esi, %esi
	jle	.L62
	.p2align 4,,10
	.p2align 3
.L61:
	leal	(%rsi,%rsi), %eax
	movslq	%esi, %rdi
	leal	1(%rax), %r8d
	cltq
	salq	$4, %rdi
	movslq	%r8d, %r8
	salq	$4, %rax
	salq	$4, %r8
	addq	%rbx, %rax
	addq	%rbx, %r8
	movq	8(%r8), %rdx
	addq	(%r8), %rdx
	movq	8(%rax), %r8
	addq	(%rax), %r8
	cmpq	%r8, %rdx
	cmovl	%r8, %rdx
	sarl	%esi
	movq	%rdx, 8(%rbx,%rdi)
	jne	.L61
.L62:
	movl	%r9d, %esi
	testl	%r9d, %r9d
	jle	.L68
	.p2align 4,,10
	.p2align 3
.L67:
	leal	(%rsi,%rsi), %eax
	movslq	%esi, %rdi
	leal	1(%rax), %r8d
	cltq
	salq	$4, %rdi
	movslq	%r8d, %r8
	salq	$4, %rax
	salq	$4, %r8
	addq	%rbx, %rax
	addq	%rbx, %r8
	movq	8(%r8), %rdx
	addq	(%r8), %rdx
	movq	8(%rax), %r8
	addq	(%rax), %r8
	cmpq	%r8, %rdx
	cmovl	%r8, %rdx
	sarl	%esi
	movq	%rdx, 8(%rbx,%rdi)
	jne	.L67
.L68:
	movslq	8(%rcx), %rax
	testl	%eax, %eax
	jne	.L69
.L70:
	addq	$4, %r14
	cmpl	8(%rsp), %ebp
	jne	.L58
.L59:
	movl	8(%rsp), %edx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	find
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L93
	addq	$72, %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
.L64:
	.cfi_restore_state
	sarl	%eax
	sarl	%edx
	cmpl	%edx, %eax
	jl	.L60
	jmp	.L66
.L54:
	movl	$16, %esi
	movl	$1, %edi
	call	calloc@PLT
	movl	$16, %esi
	movl	$2, %edi
	movq	%rax, %r15
	call	calloc@PLT
	movq	%rax, (%r15)
	movq	.LC3(%rip), %rax
	movq	%rax, 8(%r15)
	jmp	.L59
.L93:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE46:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB47:
	.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
.LFE47:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1
	.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	new_RMQandRAQ
	.type	new_RMQandRAQ, @function
new_RMQandRAQ:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	cmpl	$1, %edi
	jle	.L4
	xorl	%ecx, %ecx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %ecx
	movl	%eax, %ebx
	sall	%cl, %ebx
	cmpl	%edi, %ebx
	jl	.L3
	movl	$2, %ebp
	sall	%cl, %ebp
	movslq	%ebp, %rbp
.L2:
	movl	$16, %esi
	movl	$1, %edi
	movl	%ecx, 12(%rsp)
	call	calloc@PLT
	movq	%rbp, %rdi
	movl	$16, %esi
	movq	%rax, %r12
	call	calloc@PLT
	movl	12(%rsp), %ecx
	movl	%ebx, 12(%r12)
	movq	%rax, (%r12)
	movq	%r12, %rax
	movl	%ecx, 8(%r12)
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	movl	$2, %ebp
	xorl	%ecx, %ecx
	movl	$1, %ebx
	jmp	.L2
	.cfi_endproc
.LFE39:
	.size	new_RMQandRAQ, .-new_RMQandRAQ
	.p2align 4
	.globl	propagate
	.type	propagate, @function
propagate:
.LFB42:
	.cfi_startproc
	endbr64
	movl	8(%rdi), %ecx
	addl	12(%rdi), %esi
	movl	%esi, %r9d
	testl	%ecx, %ecx
	jle	.L8
	movq	(%rdi), %r8
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r9d, %edx
	sarl	%cl, %edx
	leal	(%rdx,%rdx), %eax
	movslq	%edx, %rdx
	cltq
	salq	$4, %rdx
	movq	%rax, %rdi
	addq	$1, %rax
	addq	%r8, %rdx
	salq	$4, %rdi
	salq	$4, %rax
	movq	(%rdx), %rsi
	addq	%r8, %rdi
	addq	%r8, %rax
	addq	%rsi, (%rdi)
	movq	(%rdx), %rsi
	addq	%rsi, (%rax)
	movq	8(%rdi), %rsi
	movq	$0, (%rdx)
	addq	(%rdi), %rsi
	movq	8(%rax), %rdi
	addq	(%rax), %rdi
	cmpq	%rdi, %rsi
	cmovl	%rdi, %rsi
	movq	%rsi, 8(%rdx)
	subl	$1, %ecx
	jne	.L10
.L8:
	ret
	.cfi_endproc
.LFE42:
	.size	propagate, .-propagate
	.p2align 4
	.globl	save
	.type	save, @function
save:
.LFB43:
	.cfi_startproc
	endbr64
	addl	12(%rdi), %esi
	sarl	%esi
	testl	%esi, %esi
	jle	.L12
	movq	(%rdi), %rdi
	.p2align 4,,10
	.p2align 3
.L14:
	leal	(%rsi,%rsi), %eax
	movslq	%esi, %r8
	leal	1(%rax), %edx
	cltq
	salq	$4, %r8
	salq	$4, %rax
	movslq	%edx, %rdx
	addq	%rdi, %rax
	salq	$4, %rdx
	movq	8(%rax), %rcx
	addq	%rdi, %rdx
	addq	(%rax), %rcx
	movq	%rcx, %rax
	movq	8(%rdx), %rcx
	addq	(%rdx), %rcx
	cmpq	%rcx, %rax
	cmovl	%rcx, %rax
	sarl	%esi
	movq	%rax, 8(%rdi,%r8)
	jne	.L14
.L12:
	ret
	.cfi_endproc
.LFE43:
	.size	save, .-save
	.p2align 4
	.globl	add
	.type	add, @function
add:
.LFB44:
	.cfi_startproc
	endbr64
	movl	12(%rdi), %r9d
	movq	%rcx, %r10
	movl	%edx, %r8d
	leal	(%r9,%rsi), %ecx
	leal	(%r9,%rdx), %eax
	cmpl	%edx, %esi
	jge	.L17
	movl	%ecx, %edx
	.p2align 4,,10
	.p2align 3
.L21:
	testb	$1, %dl
	je	.L18
	movslq	%edx, %rsi
	addl	$1, %edx
	salq	$4, %rsi
	addq	(%rdi), %rsi
	addq	%r10, (%rsi)
.L18:
	testb	$1, %al
	je	.L19
	subl	$1, %eax
	sarl	%edx
	movslq	%eax, %rsi
	sarl	%eax
	salq	$4, %rsi
	addq	(%rdi), %rsi
	addq	%r10, (%rsi)
	cmpl	%eax, %edx
	jl	.L21
.L17:
	sarl	%ecx
	testl	%ecx, %ecx
	jle	.L22
	movq	(%rdi), %rsi
	.p2align 4,,10
	.p2align 3
.L23:
	leal	(%rcx,%rcx), %eax
	movslq	%ecx, %r11
	leal	1(%rax), %edx
	cltq
	salq	$4, %r11
	movslq	%edx, %rdx
	salq	$4, %rax
	salq	$4, %rdx
	addq	%rsi, %rax
	addq	%rsi, %rdx
	movq	8(%rdx), %r10
	addq	(%rdx), %r10
	movq	%r10, %rdx
	movq	8(%rax), %r10
	addq	(%rax), %r10
	cmpq	%r10, %rdx
	cmovl	%r10, %rdx
	sarl	%ecx
	movq	%rdx, 8(%rsi,%r11)
	jne	.L23
.L22:
	leal	-1(%r9,%r8), %esi
	sarl	%esi
	testl	%esi, %esi
	jle	.L16
	movq	(%rdi), %rdi
	.p2align 4,,10
	.p2align 3
.L25:
	leal	(%rsi,%rsi), %eax
	movslq	%esi, %r8
	leal	1(%rax), %edx
	cltq
	salq	$4, %r8
	movslq	%edx, %rdx
	salq	$4, %rax
	salq	$4, %rdx
	addq	%rdi, %rax
	addq	%rdi, %rdx
	movq	8(%rdx), %rcx
	addq	(%rdx), %rcx
	movq	%rcx, %rdx
	movq	8(%rax), %rcx
	addq	(%rax), %rcx
	cmpq	%rcx, %rdx
	cmovl	%rcx, %rdx
	sarl	%esi
	movq	%rdx, 8(%rdi,%r8)
	jne	.L25
.L16:
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	sarl	%edx
	sarl	%eax
	cmpl	%eax, %edx
	jl	.L21
	jmp	.L17
	.cfi_endproc
.LFE44:
	.size	add, .-add
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB45:
	.cfi_startproc
	endbr64
	movq	%rdi, %r9
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%edx, %r11d
	movl	%esi, %r10d
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	8(%r9), %r8d
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	12(%rdi), %edi
	leal	(%rsi,%rdi), %edx
	testl	%r8d, %r8d
	jle	.L38
	movq	(%r9), %rsi
	movl	%r8d, %ecx
	.p2align 4,,10
	.p2align 3
.L35:
	movl	%edx, %ebx
	sarl	%cl, %ebx
	leal	(%rbx,%rbx), %eax
	movslq	%ebx, %rbx
	cltq
	salq	$4, %rbx
	movq	%rax, %rbp
	addq	$1, %rax
	addq	%rsi, %rbx
	salq	$4, %rbp
	salq	$4, %rax
	movq	(%rbx), %r14
	addq	%rsi, %rax
	addq	%rsi, %rbp
	addq	%r14, 0(%rbp)
	movq	(%rbx), %r14
	addq	%r14, (%rax)
	movq	$0, (%rbx)
	movq	(%rax), %r14
	addq	8(%rax), %r14
	movq	%r14, %rax
	movq	0(%rbp), %r14
	addq	8(%rbp), %r14
	cmpq	%r14, %rax
	cmovl	%r14, %rax
	movq	%rax, 8(%rbx)
	subl	$1, %ecx
	jne	.L35
	leal	-1(%rdi,%r11), %ebx
	.p2align 4,,10
	.p2align 3
.L37:
	movl	%r8d, %ecx
	movl	%ebx, %eax
	sarl	%cl, %eax
	movslq	%eax, %rcx
	leal	(%rcx,%rcx), %eax
	salq	$4, %rcx
	cltq
	addq	%rsi, %rcx
	movq	%rax, %rbp
	addq	$1, %rax
	movq	(%rcx), %r14
	salq	$4, %rbp
	salq	$4, %rax
	addq	%rsi, %rax
	addq	%rsi, %rbp
	addq	%r14, 0(%rbp)
	movq	(%rcx), %r14
	addq	%r14, (%rax)
	movq	$0, (%rcx)
	movq	(%rax), %r14
	addq	8(%rax), %r14
	movq	%r14, %rax
	movq	0(%rbp), %r14
	addq	8(%rbp), %r14
	cmpq	%r14, %rax
	cmovl	%r14, %rax
	movq	%rax, 8(%rcx)
	subl	$1, %r8d
	jne	.L37
.L38:
	addl	%r11d, %edi
	xorl	%r8d, %r8d
	cmpl	%r11d, %r10d
	jge	.L31
	.p2align 4,,10
	.p2align 3
.L33:
	testb	$1, %dl
	je	.L39
	movslq	%edx, %rax
	salq	$4, %rax
	addq	(%r9), %rax
	movq	8(%rax), %rcx
	addq	(%rax), %rcx
	cmpq	%rcx, %r8
	cmovl	%rcx, %r8
	addl	$1, %edx
.L39:
	testb	$1, %dil
	je	.L40
	subl	$1, %edi
	movslq	%edi, %rax
	salq	$4, %rax
	addq	(%r9), %rax
	movq	8(%rax), %rcx
	addq	(%rax), %rcx
	cmpq	%rcx, %r8
	cmovl	%rcx, %r8
	sarl	%edx
	sarl	%edi
	cmpl	%edi, %edx
	jl	.L33
.L31:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movq	%r8, %rax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L40:
	.cfi_restore_state
	sarl	%edx
	sarl	%edi
	cmpl	%edi, %edx
	jl	.L33
	popq	%rbx
	.cfi_def_cfa_offset 24
	movq	%r8, %rax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE45:
	.size	find, .-find
	.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:
.LFB46:
	.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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	40(%rsp), %rdx
	leaq	36(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %ebp
	movl	$12, %esi
	leal	1(%rbp), %edi
	movslq	%edi, %rdi
	call	calloc@PLT
	movl	36(%rsp), %ebx
	movl	$4, %esi
	movq	%rax, %r13
	leal	1(%rbx), %eax
	movslq	%eax, %rdi
	movl	%eax, 8(%rsp)
	call	calloc@PLT
	movq	%rax, 16(%rsp)
	testl	%ebp, %ebp
	jle	.L52
	leaq	12(%r13), %rbx
	movq	%r13, 8(%rsp)
	movl	$1, %r14d
	leaq	52(%rsp), %r15
	movq	%rbx, %r13
	leaq	48(%rsp), %r12
	leaq	44(%rsp), %rbp
	movq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L53:
	movq	%r12, %rdx
	movq	%r15, %rcx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	addq	$12, %r13
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %rax
	movd	44(%rsp), %xmm0
	movd	52(%rsp), %xmm1
	leaq	(%rbx,%rax,4), %rax
	movl	(%rax), %edx
	punpckldq	%xmm1, %xmm0
	movl	%r14d, (%rax)
	addl	$1, %r14d
	movq	%xmm0, -12(%r13)
	movl	%edx, -4(%r13)
	cmpl	%r14d, 40(%rsp)
	jge	.L53
	movl	36(%rsp), %ebx
	movq	8(%rsp), %r13
	leal	1(%rbx), %eax
	movl	%eax, 8(%rsp)
.L52:
	testl	%ebx, %ebx
	jle	.L54
	xorl	%ecx, %ecx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L55:
	addl	$1, %ecx
	movl	%eax, %ebp
	sall	%cl, %ebp
	cmpl	%ebx, %ebp
	jle	.L55
	movl	$16, %esi
	movl	$1, %edi
	movl	%ecx, 28(%rsp)
	movl	$1, %r12d
	call	calloc@PLT
	movl	28(%rsp), %ecx
	movl	$16, %esi
	movq	%rax, %r15
	movl	$2, %eax
	sall	%cl, %eax
	movslq	%eax, %rdi
	call	calloc@PLT
	movl	28(%rsp), %ecx
	movd	%ebp, %xmm2
	movq	16(%rsp), %r14
	movq	%rax, (%r15)
	movq	%rax, %rbx
	leal	-1(%rbp), %eax
	movl	%r12d, %ebp
	movd	%ecx, %xmm0
	movl	%eax, 16(%rsp)
	addq	$4, %r14
	movd	%xmm2, %r12d
	punpckldq	%xmm2, %xmm0
	movq	%xmm0, 8(%r15)
	.p2align 4,,10
	.p2align 3
.L58:
	movl	%ebp, %edx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	find
	movl	%ebp, %esi
	addl	$1, %ebp
	movq	%r15, %rdi
	movq	%rax, %rcx
	movl	%ebp, %edx
	call	add
	movl	16(%rsp), %ecx
	movslq	(%r14), %rax
	leal	(%r12,%rbp), %r10d
	leal	(%rcx,%rbp), %r9d
	sarl	%r9d
	testl	%eax, %eax
	je	.L70
	.p2align 4,,10
	.p2align 3
.L69:
	leaq	(%rax,%rax,2), %rax
	movl	%r10d, %edx
	leaq	0(%r13,%rax,4), %rcx
	movl	(%rcx), %edi
	movslq	4(%rcx), %r8
	leal	(%rdi,%r12), %esi
	movl	%esi, %eax
	cmpl	%edi, %ebp
	jle	.L66
	.p2align 4,,10
	.p2align 3
.L60:
	testb	$1, %al
	je	.L63
	movslq	%eax, %rdi
	addl	$1, %eax
	salq	$4, %rdi
	addq	%r8, (%rbx,%rdi)
.L63:
	testb	$1, %dl
	je	.L64
	subl	$1, %edx
	sarl	%eax
	movslq	%edx, %rdi
	sarl	%edx
	salq	$4, %rdi
	addq	%r8, (%rbx,%rdi)
	cmpl	%eax, %edx
	jg	.L60
.L66:
	sarl	%esi
	testl	%esi, %esi
	jle	.L62
	.p2align 4,,10
	.p2align 3
.L61:
	leal	(%rsi,%rsi), %eax
	movslq	%esi, %rdi
	leal	1(%rax), %r8d
	cltq
	salq	$4, %rdi
	movslq	%r8d, %r8
	salq	$4, %rax
	salq	$4, %r8
	addq	%rbx, %rax
	addq	%rbx, %r8
	movq	8(%r8), %rdx
	addq	(%r8), %rdx
	movq	8(%rax), %r8
	addq	(%rax), %r8
	cmpq	%r8, %rdx
	cmovl	%r8, %rdx
	sarl	%esi
	movq	%rdx, 8(%rbx,%rdi)
	jne	.L61
.L62:
	movl	%r9d, %esi
	testl	%r9d, %r9d
	jle	.L68
	.p2align 4,,10
	.p2align 3
.L67:
	leal	(%rsi,%rsi), %eax
	movslq	%esi, %rdi
	leal	1(%rax), %r8d
	cltq
	salq	$4, %rdi
	movslq	%r8d, %r8
	salq	$4, %rax
	salq	$4, %r8
	addq	%rbx, %rax
	addq	%rbx, %r8
	movq	8(%r8), %rdx
	addq	(%r8), %rdx
	movq	8(%rax), %r8
	addq	(%rax), %r8
	cmpq	%r8, %rdx
	cmovl	%r8, %rdx
	sarl	%esi
	movq	%rdx, 8(%rbx,%rdi)
	jne	.L67
.L68:
	movslq	8(%rcx), %rax
	testl	%eax, %eax
	jne	.L69
.L70:
	addq	$4, %r14
	cmpl	8(%rsp), %ebp
	jne	.L58
.L59:
	movl	8(%rsp), %edx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	find
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L93
	addq	$72, %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
.L64:
	.cfi_restore_state
	sarl	%eax
	sarl	%edx
	cmpl	%edx, %eax
	jl	.L60
	jmp	.L66
.L54:
	movl	$16, %esi
	movl	$1, %edi
	call	calloc@PLT
	movl	$16, %esi
	movl	$2, %edi
	movq	%rax, %r15
	call	calloc@PLT
	movq	%rax, (%r15)
	movq	.LC3(%rip), %rax
	movq	%rax, 8(%r15)
	jmp	.L59
.L93:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE46:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB47:
	.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
.LFE47:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1
	.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>

typedef int32_t i32;
typedef int64_t i64;

typedef struct add_max_node {
  i64 add;
  i64 max;
} add_max_node;

typedef struct RMQandRAQ {
  add_max_node *a;
  i32 bit;
  i32 size;
} RMQandRAQ;

RMQandRAQ* new_RMQandRAQ (const i32 n) {
  i32 k = 0;
  while ((1 << k) < n) ++k;
  RMQandRAQ *s = (RMQandRAQ *) calloc (1, sizeof (RMQandRAQ));
  s->a = (add_max_node *) calloc (2 << k, sizeof (add_max_node));
  s->bit = k;
  s->size = 1 << k;
  return s;
}

static inline i64 max (i64 a, i64 b) {
  return a > b ? a : b;
}

static inline i64 eval (RMQandRAQ *s, i32 k) {
  return s->a[k].add + s->a[k].max;
}

void propagate (RMQandRAQ *s, i32 x) {
  x += s->size;
  for (i32 bit = s->bit; bit > 0; bit--) {
    i32 k = x >> bit;
    s->a[2 * k].add += s->a[k].add;
    s->a[2 * k + 1].add += s->a[k].add;
    s->a[k].add = 0;
    s->a[k].max = max (eval (s, 2 * k), eval (s, 2 * k + 1));
  }
}

void save (RMQandRAQ *s, i32 x) {
  for (i32 k = (x + s->size) >> 1; k >= 1; k >>= 1) {
    s->a[k].max = max (eval (s, 2 * k), eval (s, 2 * k + 1));
  }
}

void add (RMQandRAQ *s, i32 l, i32 r, i64 v) {
  for (i32 x = l + s->size, y = r + s->size; x < y; x >>= 1, y >>= 1) {
    if (x & 1) s->a[x++].add += v;
    if (y & 1) s->a[--y].add += v;
  }
  save (s, l);
  save (s, r - 1);
}

i64 find (RMQandRAQ *s, i32 l, i32 r) {
  propagate (s, l);
  propagate (s, r - 1);
  i64 ans = 0;
  for (l += s->size, r += s->size; l < r; l >>= 1, r >>= 1) {
    if (l & 1) ans = max (ans, eval (s, l++));
    if (r & 1) ans = max (ans, eval (s, --r));
  }
  return ans;
}

typedef struct node {
  i32 l, v, next;
} node;

void run (void) {
  i32 n, m;
  scanf ("%" SCNi32 "%" SCNi32, &n, &m);
  node *a = (node *) calloc (m + 1, sizeof (node));
  i32 *start = (i32 *) calloc (n + 1, sizeof (i32));
  for (i32 i = 1; i <= m; ++i) {
    i32 l, r, v;
    scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &l, &r, &v);
    a[i] = (node) {l, v, start[r]};
    start[r] = i;
  }
  RMQandRAQ *s = new_RMQandRAQ (n + 1);
  for (i32 i = 1; i <= n; ++i) {
    i64 v = find (s, 0, i);
    add (s, i, i + 1, v);
    for (i32 p = start[i]; p; p = a[p].next) {
      add (s, a[p].l, i + 1, a[p].v);
    }
  }
  printf ("%" PRIi64 "\n", find (s, 0, n + 1));
}

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

5 3
1 3 10
2 4 -10
3 5 10

20

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>

typedef int32_t i32;
typedef int64_t i64;

typedef struct add_max_node {
  i64 add;
  i64 max;
} add_max_node;

typedef struct RMQandRAQ {
  add_max_node *a;
  i32 bit;
  i32 size;
} RMQandRAQ;

RMQandRAQ* new_RMQandRAQ (const i32 n) {
  i32 k = 0;
  while ((1 << k) < n) ++k;
  RMQandRAQ *s = (RMQandRAQ *) calloc (1, sizeof (RMQandRAQ));
  s->a = (add_max_node *) calloc (2 << k, sizeof (add_max_node));
  s->bit = k;
  s->size = 1 << k;
  return s;
}

static inline i64 max (i64 a, i64 b) {
  return a > b ? a : b;
}

static inline i64 eval (RMQandRAQ *s, i32 k) {
  return s->a[k].add + s->a[k].max;
}

void propagate (RMQandRAQ *s, i32 x) {
  x += s->size;
  for (i32 bit = s->bit; bit > 0; bit--) {
    i32 k = x >> bit;
    s->a[2 * k].add += s->a[k].add;
    s->a[2 * k + 1].add += s->a[k].add;
    s->a[k].add = 0;
    s->a[k].max = max (eval (s, 2 * k), eval (s, 2 * k + 1));
  }
}

void save (RMQandRAQ *s, i32 x) {
  for (i32 k = (x + s->size) >> 1; k >= 1; k >>= 1) {
    s->a[k].max = max (eval (s, 2 * k), eval (s, 2 * k + 1));
  }
}

void add (RMQandRAQ *s, i32 l, i32 r, i64 v) {
  for (i32 x = l + s->size, y = r + s->size; x < y; x >>= 1, y >>= 1) {
    if (x & 1) s->a[x++].add += v;
    if (y & 1) s->a[--y].add += v;
  }
  save (s, l);
  save (s, r - 1);
}

i64 find (RMQandRAQ *s, i32 l, i32 r) {
  propagate (s, l);
  propagate (s, r - 1);
  i64 ans = 0;
  for (l += s->size, r += s->size; l < r; l >>= 1, r >>= 1) {
    if (l & 1) ans = max (ans, eval (s, l++));
    if (r & 1) ans = max (ans, eval (s, --r));
  }
  return ans;
}

typedef struct node {
  i32 l, v, next;
} node;

void run (void) {
  i32 n, m;
  scanf ("%" SCNi32 "%" SCNi32, &n, &m);
  node *a = (node *) calloc (m + 1, sizeof (node));
  i32 *start = (i32 *) calloc (n + 1, sizeof (i32));
  for (i32 i = 1; i <= m; ++i) {
    i32 l, r, v;
    scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &l, &r, &v);
    a[i] = (node) {l, v, start[r]};
    start[r] = i;
  }
  RMQandRAQ *s = new_RMQandRAQ (n + 1);
  for (i32 i = 1; i <= n; ++i) {
    i64 v = find (s, 0, i);
    add (s, i, i + 1, v);
    for (i32 p = start[i]; p; p = a[p].next) {
      add (s, a[p].l, i + 1, a[p].v);
    }
  }
  printf ("%" PRIi64 "\n", find (s, 0, n + 1));
}

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

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	new_RMQandRAQ
	.type	new_RMQandRAQ, @function
new_RMQandRAQ:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L3
	movl	$16, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	$2, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cltq
	movl	$16, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, 8(%rax)
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movq	-8(%rbp), %rax
	movl	%edx, 12(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new_RMQandRAQ, .-new_RMQandRAQ
	.type	max, @function
max:
.LFB7:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	max, .-max
	.type	eval, @function
eval:
.LFB8:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rcx, %rax
	movq	8(%rax), %rax
	addq	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	eval, .-eval
	.globl	propagate
	.type	propagate, @function
propagate:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	-40(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, -44(%rbp)
	movq	-40(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	movl	-44(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -20(%rbp)
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rsi
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	salq	$4, %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rsi
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %r12
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	leaq	(%rcx,%rax), %rbx
	movq	%r12, %rsi
	movq	%rdx, %rdi
	call	max
	movq	%rax, 8(%rbx)
	subl	$1, -24(%rbp)
.L10:
	cmpl	$0, -24(%rbp)
	jg	.L11
	nop
	nop
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	propagate, .-propagate
	.globl	save
	.type	save, @function
save:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	-40(%rbp), %rax
	movl	12(%rax), %edx
	movl	-44(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L14:
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %r12
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	leaq	(%rcx,%rax), %rbx
	movq	%r12, %rsi
	movq	%rdx, %rdi
	call	max
	movq	%rax, 8(%rbx)
	sarl	-20(%rbp)
.L13:
	cmpl	$0, -20(%rbp)
	jg	.L14
	nop
	nop
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	save, .-save
	.globl	add
	.type	add, @function
add:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movq	%rcx, -40(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	jmp	.L16
.L19:
	movl	-8(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L17
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	movslq	%eax, %rdx
	salq	$4, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-24(%rbp), %rdx
	movq	(%rdx), %rdx
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L17:
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L18
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	subl	$1, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	salq	$4, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-24(%rbp), %rdx
	movq	(%rdx), %rdx
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L18:
	sarl	-8(%rbp)
	sarl	-4(%rbp)
.L16:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L19
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	save
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	save
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	add, .-add
	.globl	find
	.type	find, @function
find:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	propagate
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	propagate
	movq	$0, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, -28(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, -32(%rbp)
	jmp	.L21
.L24:
	movl	-28(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L22
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	movq	-24(%rbp), %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	max
	movq	%rax, -8(%rbp)
.L22:
	movl	-32(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L23
	subl	$1, -32(%rbp)
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	max
	movq	%rax, -8(%rbp)
.L23:
	sarl	-28(%rbp)
	sarl	-32(%rbp)
.L21:
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L24
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	find, .-find
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"%li\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rdx
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$12, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -56(%rbp)
	movl	-84(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -48(%rbp)
	movl	$1, -68(%rbp)
	jmp	.L27
.L28:
	leaq	-20(%rbp), %rcx
	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	-68(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-76(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-72(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rdi
	movq	-48(%rbp), %rdx
	addq	%rdi, %rdx
	movl	(%rdx), %edx
	movl	%esi, (%rax)
	movl	%ecx, 4(%rax)
	movl	%edx, 8(%rax)
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-68(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -68(%rbp)
.L27:
	movl	-80(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jle	.L28
	movl	-84(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	new_RMQandRAQ
	movq	%rax, -40(%rbp)
	movl	$1, -64(%rbp)
	jmp	.L29
.L32:
	movl	-64(%rbp), %edx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -32(%rbp)
	movl	-64(%rbp), %eax
	leal	1(%rax), %edi
	movq	-32(%rbp), %rdx
	movl	-64(%rbp), %esi
	movq	-40(%rbp), %rax
	movq	%rdx, %rcx
	movl	%edi, %edx
	movq	%rax, %rdi
	call	add
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	jmp	.L30
.L31:
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movslq	%eax, %rdx
	movl	-64(%rbp), %eax
	leal	1(%rax), %edi
	movl	-60(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	movq	-56(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %esi
	movq	-40(%rbp), %rax
	movq	%rdx, %rcx
	movl	%edi, %edx
	movq	%rax, %rdi
	call	add
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movl	%eax, -60(%rbp)
.L30:
	cmpl	$0, -60(%rbp)
	jne	.L31
	addl	$1, -64(%rbp)
.L29:
	movl	-84(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jle	.L32
	movl	-84(%rbp), %eax
	leal	1(%rax), %edx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB14:
	.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
.LFE14:
	.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	new_RMQandRAQ
	.type	new_RMQandRAQ, @function
new_RMQandRAQ:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	addl	$1, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L3
	movl	$16, %esi
	movl	$1, %edi
	call	calloc@PLT
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	$2, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cltq
	movl	$16, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-8(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, 8(%rax)
	movl	-12(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movq	-8(%rbp), %rax
	movl	%edx, 12(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new_RMQandRAQ, .-new_RMQandRAQ
	.type	max, @function
max:
.LFB7:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	max, .-max
	.type	eval, @function
eval:
.LFB8:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rcx, %rax
	movq	8(%rax), %rax
	addq	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	eval, .-eval
	.globl	propagate
	.type	propagate, @function
propagate:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	-40(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, -44(%rbp)
	movq	-40(%rbp), %rax
	movl	8(%rax), %eax
	movl	%eax, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	movl	-44(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -20(%rbp)
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rsi
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	salq	$4, %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rsi
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movq	-40(%rbp), %rax
	movq	(%rax), %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	$0, (%rax)
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %r12
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	leaq	(%rcx,%rax), %rbx
	movq	%r12, %rsi
	movq	%rdx, %rdi
	call	max
	movq	%rax, 8(%rbx)
	subl	$1, -24(%rbp)
.L10:
	cmpl	$0, -24(%rbp)
	jg	.L11
	nop
	nop
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	propagate, .-propagate
	.globl	save
	.type	save, @function
save:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movq	-40(%rbp), %rax
	movl	12(%rax), %edx
	movl	-44(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L14:
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %r12
	movl	-20(%rbp), %eax
	leal	(%rax,%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	(%rax), %rcx
	movl	-20(%rbp), %eax
	cltq
	salq	$4, %rax
	leaq	(%rcx,%rax), %rbx
	movq	%r12, %rsi
	movq	%rdx, %rdi
	call	max
	movq	%rax, 8(%rbx)
	sarl	-20(%rbp)
.L13:
	cmpl	$0, -20(%rbp)
	jg	.L14
	nop
	nop
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	save, .-save
	.globl	add
	.type	add, @function
add:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movq	%rcx, -40(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	jmp	.L16
.L19:
	movl	-8(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L17
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	movslq	%eax, %rdx
	salq	$4, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-24(%rbp), %rdx
	movq	(%rdx), %rdx
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L17:
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L18
	movq	-24(%rbp), %rax
	movq	(%rax), %rcx
	subl	$1, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	salq	$4, %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rcx
	movq	-24(%rbp), %rdx
	movq	(%rdx), %rdx
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
.L18:
	sarl	-8(%rbp)
	sarl	-4(%rbp)
.L16:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L19
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	save
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	save
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	add, .-add
	.globl	find
	.type	find, @function
find:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	propagate
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	propagate
	movq	$0, -8(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, -28(%rbp)
	movq	-24(%rbp), %rax
	movl	12(%rax), %eax
	addl	%eax, -32(%rbp)
	jmp	.L21
.L24:
	movl	-28(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L22
	movl	-28(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -28(%rbp)
	movq	-24(%rbp), %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	max
	movq	%rax, -8(%rbp)
.L22:
	movl	-32(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L23
	subl	$1, -32(%rbp)
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	eval
	movq	%rax, %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	max
	movq	%rax, -8(%rbp)
.L23:
	sarl	-28(%rbp)
	sarl	-32(%rbp)
.L21:
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jl	.L24
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	find, .-find
	.section	.rodata
.LC0:
	.string	"%i%i"
.LC1:
	.string	"%i%i%i"
.LC2:
	.string	"%li\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rdx
	leaq	-84(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$12, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -56(%rbp)
	movl	-84(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	$4, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -48(%rbp)
	movl	$1, -68(%rbp)
	jmp	.L27
.L28:
	leaq	-20(%rbp), %rcx
	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	-68(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-76(%rbp), %esi
	movl	-20(%rbp), %ecx
	movl	-72(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rdi
	movq	-48(%rbp), %rdx
	addq	%rdi, %rdx
	movl	(%rdx), %edx
	movl	%esi, (%rax)
	movl	%ecx, 4(%rax)
	movl	%edx, 8(%rax)
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-68(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -68(%rbp)
.L27:
	movl	-80(%rbp), %eax
	cmpl	%eax, -68(%rbp)
	jle	.L28
	movl	-84(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	new_RMQandRAQ
	movq	%rax, -40(%rbp)
	movl	$1, -64(%rbp)
	jmp	.L29
.L32:
	movl	-64(%rbp), %edx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, -32(%rbp)
	movl	-64(%rbp), %eax
	leal	1(%rax), %edi
	movq	-32(%rbp), %rdx
	movl	-64(%rbp), %esi
	movq	-40(%rbp), %rax
	movq	%rdx, %rcx
	movl	%edi, %edx
	movq	%rax, %rdi
	call	add
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	jmp	.L30
.L31:
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	4(%rax), %eax
	movslq	%eax, %rdx
	movl	-64(%rbp), %eax
	leal	1(%rax), %edi
	movl	-60(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	movq	%rax, %rcx
	movq	-56(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %esi
	movq	-40(%rbp), %rax
	movq	%rdx, %rcx
	movl	%edi, %edx
	movq	%rax, %rdi
	call	add
	movl	-60(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	movq	%rax, %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	8(%rax), %eax
	movl	%eax, -60(%rbp)
.L30:
	cmpl	$0, -60(%rbp)
	jne	.L31
	addl	$1, -64(%rbp)
.L29:
	movl	-84(%rbp), %eax
	cmpl	%eax, -64(%rbp)
	jle	.L32
	movl	-84(%rbp), %eax
	leal	1(%rax), %edx
	movq	-40(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	find
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB14:
	.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
.LFE14:
	.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:
