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

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
  scanf("%d %d %d", a1, a2, a3);
  return 0;
}

enum type {
    COMMAND_UPDATE,
    COMMAND_FIND
};

#define NUM2_MAX (1<<17)
#define QUERY_MAX 100000
#include <limits.h>

struct range {
    int start;
    int end;
};

struct pair {
    int val;
    int time;
};
#define ROOT_NODE 1

int is_contain(struct range this, struct range box) {
    return box.start <= this.start && this.end <= box.end;
}

int is_overlap(struct range r1, struct range r2) {
    return r1.end > r2.start && r2.end > r1.start;
}

void update_range(struct pair *seg, struct range r, struct pair val, int node, struct range nr) {
    if(!is_overlap(r, nr)) return;
    if(is_contain(nr, r)) {
        seg[node] = val;
#ifdef DEBUG
        printf("update: %d -> (%d, %d)\n", node, val.val, val.time);
#endif
        return;
    }
    struct range left = { nr.start, (nr.start + nr.end) / 2 };
    struct range right = { (nr.start + nr.end) / 2, nr.end };
    update_range(seg, r, val, node*2, left);
    update_range(seg, r, val, node*2+1, right);
    return;
}

struct pair find(struct pair *seg, int num2, int idx) {
    int node = num2 + idx;
    struct pair ans = seg[node];
    while((node = node/2)) {
        struct pair this = seg[node];
        ans = ans.time > this.time ? ans : this;
    }
    return ans;
}

int main(void) {
    int num, qs;
    get_int2(&num, &qs);
    int i;
    int num2 = 1;
    while(num > num2) num2 *= 2;
    // initialization
    static struct pair seg[NUM2_MAX*2];
    for(i = ROOT_NODE; i < num2*2; i++) seg[i] = (struct pair){.val = INT_MAX, .time = -1};
    struct range whole = {0, num2};
    static int ans[QUERY_MAX];
    int aidx = 0;
    int t;
    for(t = 0; t < qs; t++) {
        int type = get_int();
        switch(type) {
            case COMMAND_UPDATE:
                {
                    int start, end;
                    int val;
                    get_int3(&start, &end, &val);
                    end++;
                    struct range r = {start, end};
                    struct pair np = {val, t};
                    update_range(seg, r, np, ROOT_NODE, whole);
                }
                break;
            case COMMAND_FIND:
                {
                    int idx = get_int();
                    struct pair p = find(seg, num2, idx);
                    ans[aidx++] = p.val;
                }
                break;
            default:
                break;
        }
    }

    for(i = 0; i < aidx; i++) {
        printf("%d\n", ans[i]);
    }
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC2:
	.string	"%d %d %d"
	.text
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB8:
	.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	get_int3, .-get_int3
	.globl	is_contain
	.type	is_contain, @function
is_contain:
.LFB9:
	.cfi_startproc
	endbr64
	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)
	movl	-16(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-4(%rbp), %edx
	movl	-12(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	$1, %eax
	jmp	.L11
.L9:
	movl	$0, %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	is_contain, .-is_contain
	.globl	is_overlap
	.type	is_overlap, @function
is_overlap:
.LFB10:
	.cfi_startproc
	endbr64
	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)
	movl	-4(%rbp), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	$1, %eax
	jmp	.L15
.L13:
	movl	$0, %eax
.L15:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	is_overlap, .-is_overlap
	.globl	update_range
	.type	update_range, @function
update_range:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movl	%ecx, -44(%rbp)
	movq	%r8, -52(%rbp)
	movq	-52(%rbp), %rdx
	movq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	is_overlap
	testl	%eax, %eax
	je	.L21
	movq	-32(%rbp), %rdx
	movq	-52(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	is_contain
	testl	%eax, %eax
	je	.L19
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	%rax, (%rdx)
	jmp	.L16
.L19:
	movl	-52(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-52(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-52(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -8(%rbp)
	movl	-48(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-44(%rbp), %eax
	leal	(%rax,%rax), %ecx
	movq	-16(%rbp), %rdi
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	update_range
	movl	-44(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdi
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	update_range
	jmp	.L16
.L21:
	nop
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	update_range, .-update_range
	.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
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L23
.L26:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L23
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L23:
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L26
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	find, .-find
	.section	.rodata
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	$1, -52(%rbp)
	jmp	.L29
.L30:
	sall	-52(%rbp)
.L29:
	movl	-76(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L30
	movl	$1, -56(%rbp)
	jmp	.L31
.L32:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	seg.1(%rip), %rax
	movl	$2147483647, (%rdx,%rax)
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+seg.1(%rip), %rax
	movl	$-1, (%rdx,%rax)
	addl	$1, -56(%rbp)
.L31:
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -56(%rbp)
	jl	.L32
	movl	$0, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L33
.L38:
	call	get_int
	movl	%eax, -40(%rbp)
	cmpl	$0, -40(%rbp)
	je	.L34
	cmpl	$1, -40(%rbp)
	je	.L35
	jmp	.L37
.L34:
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rcx
	leaq	-68(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	get_int3
	movl	-64(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -64(%rbp)
	movl	-68(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-64(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -12(%rbp)
	movq	-32(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rcx, %r8
	movl	$1, %ecx
	movq	%rax, %rsi
	leaq	seg.1(%rip), %rax
	movq	%rax, %rdi
	call	update_range
	jmp	.L37
.L35:
	call	get_int
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %edx
	movl	-52(%rbp), %eax
	movl	%eax, %esi
	leaq	seg.1(%rip), %rax
	movq	%rax, %rdi
	call	find
	movq	%rax, -16(%rbp)
	movl	-48(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -48(%rbp)
	movl	-16(%rbp), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ans.0(%rip), %rax
	movl	%edx, (%rcx,%rax)
	nop
.L37:
	addl	$1, -44(%rbp)
.L33:
	movl	-72(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L38
	movl	$0, -56(%rbp)
	jmp	.L39
.L40:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -56(%rbp)
.L39:
	movl	-56(%rbp), %eax
	cmpl	-48(%rbp), %eax
	jl	.L40
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	seg.1
	.comm	seg.1,2097152,32
	.local	ans.0
	.comm	ans.0,400000,32
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movq	8(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L5
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	get_int, .-get_int
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
	.text
	.p2align 4
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rsi, %rdx
	xorl	%eax, %eax
	movq	%rdi, %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE52:
	.size	get_int2, .-get_int2
	.section	.rodata.str1.1
.LC2:
	.string	"%d %d %d"
	.text
	.p2align 4
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB53:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rdx, %rcx
	xorl	%eax, %eax
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	get_int3, .-get_int3
	.p2align 4
	.globl	is_contain
	.type	is_contain, @function
is_contain:
.LFB54:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	cmpl	%edi, %esi
	jg	.L10
	sarq	$32, %rdi
	sarq	$32, %rsi
	xorl	%eax, %eax
	cmpl	%esi, %edi
	setle	%al
.L10:
	ret
	.cfi_endproc
.LFE54:
	.size	is_contain, .-is_contain
	.p2align 4
	.globl	is_overlap
	.type	is_overlap, @function
is_overlap:
.LFB55:
	.cfi_startproc
	endbr64
	movq	%rdi, %rdx
	xorl	%eax, %eax
	sarq	$32, %rdx
	cmpl	%esi, %edx
	jle	.L13
	sarq	$32, %rsi
	xorl	%eax, %eax
	cmpl	%edi, %esi
	setg	%al
.L13:
	ret
	.cfi_endproc
.LFE55:
	.size	is_overlap, .-is_overlap
	.p2align 4
	.globl	update_range
	.type	update_range, @function
update_range:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	movq	%r8, %rbx
	sarq	$32, %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rsi, (%rsp)
	movl	(%rsp), %r13d
	movl	4(%rsp), %r14d
	cmpl	%ebx, %r13d
	jge	.L16
	cmpl	%r8d, %r14d
	jg	.L47
.L16:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L47:
	.cfi_restore_state
	cmpl	%r14d, %ebx
	movq	%rdx, %r12
	setle	%al
	cmpl	%r13d, %r8d
	setge	%sil
	testb	%al, %al
	je	.L26
	testb	%sil, %sil
	jne	.L18
.L26:
	leal	(%r8,%rbx), %edx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	leal	(%rcx,%rcx), %edx
	sarl	%r15d
	leal	1(%rdx), %ebp
	cmpl	%r13d, %r15d
	jle	.L20
	cmpl	%r14d, %r15d
	jg	.L27
	testb	%sil, %sil
	jne	.L21
.L27:
	leal	(%r15,%r8), %edx
	movd	%r8d, %xmm0
	movq	(%rsp), %rsi
	sall	$2, %ecx
	movl	%edx, %r10d
	movb	%al, 31(%rsp)
	shrl	$31, %r10d
	movl	%ecx, 24(%rsp)
	addl	%edx, %r10d
	movq	%r15, %rdx
	movq	%rdi, 8(%rsp)
	sarl	%r10d
	salq	$32, %rdx
	movd	%r10d, %xmm2
	orq	%rdx, %r10
	movq	%r12, %rdx
	punpckldq	%xmm2, %xmm0
	movq	%r10, 16(%rsp)
	movq	%xmm0, %r8
	call	update_range
	movl	24(%rsp), %ecx
	movq	(%rsp), %rsi
	movq	%r12, %rdx
	movq	8(%rsp), %rdi
	movq	16(%rsp), %r8
	addl	$1, %ecx
	call	update_range
	movq	8(%rsp), %rdi
	movzbl	31(%rsp), %eax
.L20:
	cmpl	%r14d, %r15d
	jge	.L16
	cmpl	%r13d, %r15d
	jl	.L23
	testb	%al, %al
	jne	.L48
.L23:
	leal	(%r15,%rbx), %edx
	movq	(%rsp), %rsi
	movd	%ebx, %xmm3
	addl	%ebp, %ebp
	movl	%edx, %eax
	movl	%r15d, %r8d
	movl	%ebp, %ecx
	movq	%rdi, 8(%rsp)
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movq	%rax, %rdx
	movd	%eax, %xmm1
	salq	$32, %rdx
	punpckldq	%xmm3, %xmm1
	orq	%rdx, %r8
	movq	%r12, %rdx
	movq	%xmm1, %rbx
	call	update_range
	movq	(%rsp), %rsi
	leal	1(%rbp), %ecx
	movq	%rbx, %r8
	movq	8(%rsp), %rdi
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r12, %rdx
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	update_range
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movslq	%ecx, %rcx
	movq	%rdx, (%rdi,%rcx,8)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%edx, %rdx
	movq	%r12, (%rdi,%rdx,8)
	cmpl	%r14d, %r15d
	jge	.L16
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L48:
	movslq	%ebp, %r9
	movq	%r12, (%rdi,%r9,8)
	jmp	.L16
	.cfi_endproc
.LFE56:
	.size	update_range, .-update_range
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB57:
	.cfi_startproc
	endbr64
	addl	%edx, %esi
	movq	%rdi, %r8
	movslq	%esi, %rax
	leaq	(%rdi,%rax,8), %rdx
	movl	(%rdx), %eax
	movl	4(%rdx), %edi
	movl	%esi, %edx
	shrl	$31, %edx
	addl	%esi, %edx
	sarl	%edx
	je	.L50
	.p2align 4,,10
	.p2align 3
.L52:
	movslq	%edx, %rcx
	leaq	(%r8,%rcx,8), %rsi
	movl	4(%rsi), %ecx
	cmpl	%ecx, %edi
	jg	.L51
	movl	(%rsi), %eax
	movl	%ecx, %edi
.L51:
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	jne	.L52
.L50:
	salq	$32, %rdi
	orq	%rdi, %rax
	ret
	.cfi_endproc
.LFE57:
	.size	find, .-find
	.section	.rodata.str1.1
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%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
	movl	$1, %ebx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	136(%rsp), %rdx
	leaq	132(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	132(%rsp), %eax
	cmpl	$1, %eax
	jle	.L95
	.p2align 4,,10
	.p2align 3
.L59:
	movl	%ebx, %ebp
	addl	%ebx, %ebx
	cmpl	%eax, %ebx
	jl	.L59
	leal	0(,%rbp,4), %eax
	movdqa	.LC3(%rip), %xmm0
	cmpl	$1, %eax
	leal	-1(%rax), %ecx
	movl	$1, %eax
	cmovle	%eax, %ecx
	leaq	8+seg.1(%rip), %rax
	leaq	16(%rax), %rsi
	movl	%ecx, %edx
	shrl	%edx
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L60:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L60
	movl	%ecx, %eax
	orl	$1, %eax
	andl	$1, %ecx
	je	.L61
.L58:
	movq	.LC4(%rip), %rcx
	cltq
	leaq	seg.1(%rip), %rdx
	movq	%rcx, (%rdx,%rax,8)
.L61:
	movl	136(%rsp), %eax
	testl	%eax, %eax
	jle	.L92
	movl	%ebx, %eax
	movl	%ebx, %edi
	movd	%ebp, %xmm6
	xorl	%r12d, %r12d
	sarl	$2, %eax
	sarl	$3, %edi
	xorl	%r15d, %r15d
	leaq	.LC0(%rip), %r14
	leal	(%rax,%rbp), %edx
	movd	%eax, %xmm1
	movl	%eax, 20(%rsp)
	movd	%edi, %xmm3
	movl	%edx, %eax
	movl	%edi, 48(%rsp)
	punpckldq	%xmm1, %xmm3
	movdqa	%xmm1, %xmm5
	shrl	$31, %eax
	movq	%xmm3, 24(%rsp)
	movd	%ebp, %xmm3
	leaq	148(%rsp), %r13
	addl	%edx, %eax
	leal	0(%rbp,%rbx), %edx
	sarl	%eax
	movd	%eax, %xmm0
	movd	%eax, %xmm4
	movl	%edx, %eax
	shrl	$31, %eax
	punpckldq	%xmm3, %xmm4
	punpckldq	%xmm0, %xmm5
	addl	%edx, %eax
	movq	%xmm4, 40(%rsp)
	sarl	%eax
	movq	%xmm5, 32(%rsp)
	movd	%ebx, %xmm5
	leal	0(%rbp,%rax), %edx
	movl	%eax, %edi
	movl	%eax, 8(%rsp)
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	leal	(%rdi,%rbx), %edx
	sarl	%eax
	movd	%eax, %xmm4
	movl	%eax, 112(%rsp)
	movl	%edx, %eax
	shrl	$31, %eax
	punpckldq	%xmm4, %xmm6
	addl	%edx, %eax
	movq	%xmm6, 56(%rsp)
	sarl	%eax
	movd	%eax, %xmm7
	salq	$32, %rax
	movq	%rax, 72(%rsp)
	punpckldq	%xmm5, %xmm7
	movq	%xmm7, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L91:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	148(%rsp), %eax
	testl	%eax, %eax
	je	.L63
	cmpl	$1, %eax
	jne	.L65
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	148(%rsp), %edx
	leaq	seg.1(%rip), %rsi
	addl	%ebx, %edx
	movslq	%edx, %rax
	leaq	(%rsi,%rax,8), %rax
	movl	(%rax), %edi
	movl	4(%rax), %ecx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	je	.L88
	.p2align 4,,10
	.p2align 3
.L90:
	movslq	%eax, %rdx
	leaq	(%rsi,%rdx,8), %r8
	movl	4(%r8), %edx
	cmpl	%ecx, %edx
	jl	.L89
	movl	(%r8), %edi
	movl	%edx, %ecx
.L89:
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jne	.L90
.L88:
	movslq	%r15d, %rdx
	leaq	ans.0(%rip), %rax
	addl	$1, %r15d
	movl	%edi, (%rax,%rdx,4)
.L65:
	addl	$1, %r12d
	cmpl	%r12d, 136(%rsp)
	jg	.L91
	testl	%r15d, %r15d
	je	.L92
	leaq	ans.0(%rip), %rbx
	leal	-1(%r15), %edx
	leaq	4(%rbx), %rax
	leaq	.LC5(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L93:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L93
.L92:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L142
	addq	$168, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L63:
	.cfi_restore_state
	leaq	144(%rsp), %rdx
	movq	%r13, %rcx
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	leaq	140(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	144(%rsp), %eax
	leal	1(%rax), %r11d
	movl	140(%rsp), %eax
	movd	%r11d, %xmm2
	movd	%eax, %xmm0
	punpckldq	%xmm2, %xmm0
	cmpl	%ebx, %eax
	jge	.L65
	testl	%r11d, %r11d
	jle	.L65
	movl	148(%rsp), %r9d
	cmpl	%ebx, %r11d
	movd	%r12d, %xmm6
	setge	%r10b
	testl	%eax, %eax
	movd	%r9d, %xmm1
	setle	%dl
	punpckldq	%xmm6, %xmm1
	testb	%r10b, %r10b
	je	.L96
	testb	%dl, %dl
	jne	.L67
.L96:
	cmpl	%ebp, %eax
	jge	.L69
	cmpl	%ebp, %r11d
	setge	80(%rsp)
	movzbl	80(%rsp), %ecx
	andb	%dl, %cl
	jne	.L70
	movl	20(%rsp), %ecx
	movq	%xmm0, %rsi
	cmpl	%ecx, %eax
	jge	.L71
	cmpl	%ecx, %r11d
	jl	.L97
	testb	%dl, %dl
	jne	.L72
.L97:
	movq	48(%rsp), %r8
	movq	%xmm1, %rdx
	movl	%eax, 104(%rsp)
	movl	$8, %ecx
	leaq	seg.1(%rip), %rdi
	movb	%r10b, 120(%rsp)
	salq	$32, %r8
	movl	%r9d, 116(%rsp)
	movq	%rsi, 88(%rsp)
	movq	%xmm1, 96(%rsp)
	call	update_range
	movq	24(%rsp), %r8
	movq	96(%rsp), %rdx
	movl	$9, %ecx
	movq	88(%rsp), %rsi
	leaq	seg.1(%rip), %rdi
	call	update_range
	movl	104(%rsp), %eax
	movl	116(%rsp), %r9d
	movzbl	120(%rsp), %r10d
.L71:
	movq	%r11, %rdx
	movl	20(%rsp), %edi
	movl	%eax, %esi
	salq	$32, %rdx
	orq	%rdx, %rsi
	cmpl	%edi, %r11d
	jle	.L69
	cmpl	%edi, %eax
	jg	.L74
	cmpb	$0, 80(%rsp)
	jne	.L143
.L74:
	movq	%r12, %rcx
	movl	%r9d, %edx
	movq	32(%rsp), %r8
	movb	%r10b, 116(%rsp)
	salq	$32, %rcx
	leaq	seg.1(%rip), %rdi
	movl	%eax, 104(%rsp)
	orq	%rcx, %rdx
	movl	$10, %ecx
	movl	%r9d, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rsi, 80(%rsp)
	call	update_range
	movq	40(%rsp), %r8
	movq	88(%rsp), %rdx
	movl	$11, %ecx
	movq	80(%rsp), %rsi
	leaq	seg.1(%rip), %rdi
	call	update_range
	movl	96(%rsp), %r9d
	movl	104(%rsp), %eax
	movzbl	116(%rsp), %r10d
.L69:
	cmpl	%ebp, %r11d
	jle	.L65
	cmpl	%ebp, %eax
	setle	%dl
	movl	%edx, %ecx
	testb	%r10b, %r10b
	je	.L77
	testb	%dl, %dl
	jne	.L80
.L77:
	movq	%r11, %rdx
	movl	%eax, %edi
	movl	%r11d, %esi
	salq	$32, %rdx
	movq	%rdi, 80(%rsp)
	orq	%rdx, %rdi
	movq	%rsi, 88(%rsp)
	movq	%rdi, %rsi
	movl	8(%rsp), %edi
	cmpl	%edi, %eax
	jge	.L82
	cmpl	%edi, %r11d
	jl	.L98
	testb	%cl, %cl
	jne	.L83
.L98:
	movq	8(%rsp), %rdx
	movl	112(%rsp), %ecx
	movl	%eax, 120(%rsp)
	movq	%r12, %rax
	salq	$32, %rax
	movq	56(%rsp), %r8
	movb	%r10b, 127(%rsp)
	leaq	seg.1(%rip), %rdi
	salq	$32, %rdx
	movl	%r9d, 116(%rsp)
	orq	%rdx, %rcx
	movl	%r9d, %edx
	movq	%rsi, 96(%rsp)
	orq	%rax, %rdx
	movq	%rcx, 88(%rsp)
	movl	$12, %ecx
	movq	%rdx, 104(%rsp)
	call	update_range
	movq	88(%rsp), %r8
	movq	104(%rsp), %rdx
	movl	$13, %ecx
	movq	96(%rsp), %rsi
	leaq	seg.1(%rip), %rdi
	call	update_range
	movl	116(%rsp), %r9d
	movl	120(%rsp), %eax
	movzbl	127(%rsp), %r10d
.L82:
	movl	8(%rsp), %ecx
	movl	%r11d, %esi
	salq	$32, %rsi
	orq	80(%rsp), %rsi
	cmpl	%ecx, %r11d
	jle	.L65
	cmpl	%ecx, %eax
	jg	.L85
	testb	%r10b, %r10b
	jne	.L144
.L85:
	movq	%r12, %rax
	movl	8(%rsp), %r8d
	movl	$14, %ecx
	orq	72(%rsp), %r8
	salq	$32, %rax
	leaq	seg.1(%rip), %rdi
	movq	%rsi, 80(%rsp)
	orq	%rax, %r9
	movq	%r9, %rdx
	movq	%r9, %r11
	call	update_range
	movq	64(%rsp), %r8
	movq	80(%rsp), %rsi
	movq	%r11, %rdx
	movl	$15, %ecx
	leaq	seg.1(%rip), %rdi
	call	update_range
	jmp	.L65
.L67:
	movl	%r9d, 8+seg.1(%rip)
	movl	%r12d, 12+seg.1(%rip)
	jmp	.L65
.L95:
	xorl	%ebp, %ebp
	movl	$1, %eax
	jmp	.L58
.L80:
	movl	%r9d, 24+seg.1(%rip)
	movl	%r12d, 28+seg.1(%rip)
	jmp	.L65
.L70:
	movl	%r9d, 16+seg.1(%rip)
	movl	%r12d, 20+seg.1(%rip)
	cmpl	%ebp, %r11d
	jg	.L77
	jmp	.L65
.L83:
	movq	80(%rsp), %rsi
	movl	%r9d, 48+seg.1(%rip)
	movl	%r12d, 52+seg.1(%rip)
	orq	%rdx, %rsi
	cmpl	8(%rsp), %r11d
	jg	.L85
	jmp	.L65
.L144:
	movl	%r9d, 56+seg.1(%rip)
	movl	%r12d, 60+seg.1(%rip)
	jmp	.L65
.L72:
	movq	%r11, %rdx
	movl	%eax, %esi
	movl	%r9d, 32+seg.1(%rip)
	salq	$32, %rdx
	movl	%r12d, 36+seg.1(%rip)
	orq	%rdx, %rsi
	cmpl	20(%rsp), %r11d
	jg	.L74
	jmp	.L69
.L143:
	movl	%r9d, 40+seg.1(%rip)
	movl	%r12d, 44+seg.1(%rip)
	jmp	.L69
.L142:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.local	ans.0
	.comm	ans.0,400000,32
	.local	seg.1
	.comm	seg.1,2097152,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC3:
	.long	2147483647
	.long	-1
	.long	2147483647
	.long	-1
	.set	.LC4,.LC3
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movq	8(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L5
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	get_int, .-get_int
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
	.text
	.p2align 4
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rsi, %rdx
	xorl	%eax, %eax
	movq	%rdi, %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE52:
	.size	get_int2, .-get_int2
	.section	.rodata.str1.1
.LC2:
	.string	"%d %d %d"
	.text
	.p2align 4
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB53:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rdx, %rcx
	xorl	%eax, %eax
	movq	%rsi, %rdx
	movq	%rdi, %rsi
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE53:
	.size	get_int3, .-get_int3
	.p2align 4
	.globl	is_contain
	.type	is_contain, @function
is_contain:
.LFB54:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	cmpl	%edi, %esi
	jg	.L10
	sarq	$32, %rdi
	sarq	$32, %rsi
	xorl	%eax, %eax
	cmpl	%esi, %edi
	setle	%al
.L10:
	ret
	.cfi_endproc
.LFE54:
	.size	is_contain, .-is_contain
	.p2align 4
	.globl	is_overlap
	.type	is_overlap, @function
is_overlap:
.LFB55:
	.cfi_startproc
	endbr64
	movq	%rdi, %rdx
	xorl	%eax, %eax
	sarq	$32, %rdx
	cmpl	%esi, %edx
	jle	.L13
	sarq	$32, %rsi
	xorl	%eax, %eax
	cmpl	%edi, %esi
	setg	%al
.L13:
	ret
	.cfi_endproc
.LFE55:
	.size	is_overlap, .-is_overlap
	.p2align 4
	.globl	update_range
	.type	update_range, @function
update_range:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	movq	%r8, %rbx
	sarq	$32, %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%rsi, (%rsp)
	movl	(%rsp), %r13d
	movl	4(%rsp), %r14d
	cmpl	%ebx, %r13d
	jge	.L16
	cmpl	%r8d, %r14d
	jg	.L47
.L16:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L47:
	.cfi_restore_state
	cmpl	%r14d, %ebx
	movq	%rdx, %r12
	setle	%al
	cmpl	%r13d, %r8d
	setge	%sil
	testb	%al, %al
	je	.L26
	testb	%sil, %sil
	jne	.L18
.L26:
	leal	(%r8,%rbx), %edx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	leal	(%rcx,%rcx), %edx
	sarl	%r15d
	leal	1(%rdx), %ebp
	cmpl	%r13d, %r15d
	jle	.L20
	cmpl	%r14d, %r15d
	jg	.L27
	testb	%sil, %sil
	jne	.L21
.L27:
	leal	(%r15,%r8), %edx
	movd	%r8d, %xmm0
	movq	(%rsp), %rsi
	sall	$2, %ecx
	movl	%edx, %r10d
	movb	%al, 31(%rsp)
	shrl	$31, %r10d
	movl	%ecx, 24(%rsp)
	addl	%edx, %r10d
	movq	%r15, %rdx
	movq	%rdi, 8(%rsp)
	sarl	%r10d
	salq	$32, %rdx
	movd	%r10d, %xmm2
	orq	%rdx, %r10
	movq	%r12, %rdx
	punpckldq	%xmm2, %xmm0
	movq	%r10, 16(%rsp)
	movq	%xmm0, %r8
	call	update_range
	movl	24(%rsp), %ecx
	movq	(%rsp), %rsi
	movq	%r12, %rdx
	movq	8(%rsp), %rdi
	movq	16(%rsp), %r8
	addl	$1, %ecx
	call	update_range
	movq	8(%rsp), %rdi
	movzbl	31(%rsp), %eax
.L20:
	cmpl	%r14d, %r15d
	jge	.L16
	cmpl	%r13d, %r15d
	jl	.L23
	testb	%al, %al
	jne	.L48
.L23:
	leal	(%r15,%rbx), %edx
	movq	(%rsp), %rsi
	movd	%ebx, %xmm3
	addl	%ebp, %ebp
	movl	%edx, %eax
	movl	%r15d, %r8d
	movl	%ebp, %ecx
	movq	%rdi, 8(%rsp)
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movq	%rax, %rdx
	movd	%eax, %xmm1
	salq	$32, %rdx
	punpckldq	%xmm3, %xmm1
	orq	%rdx, %r8
	movq	%r12, %rdx
	movq	%xmm1, %rbx
	call	update_range
	movq	(%rsp), %rsi
	leal	1(%rbp), %ecx
	movq	%rbx, %r8
	movq	8(%rsp), %rdi
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r12, %rdx
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	update_range
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movslq	%ecx, %rcx
	movq	%rdx, (%rdi,%rcx,8)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%edx, %rdx
	movq	%r12, (%rdi,%rdx,8)
	cmpl	%r14d, %r15d
	jge	.L16
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L48:
	movslq	%ebp, %r9
	movq	%r12, (%rdi,%r9,8)
	jmp	.L16
	.cfi_endproc
.LFE56:
	.size	update_range, .-update_range
	.p2align 4
	.globl	find
	.type	find, @function
find:
.LFB57:
	.cfi_startproc
	endbr64
	addl	%edx, %esi
	movq	%rdi, %r8
	movslq	%esi, %rax
	leaq	(%rdi,%rax,8), %rdx
	movl	(%rdx), %eax
	movl	4(%rdx), %edi
	movl	%esi, %edx
	shrl	$31, %edx
	addl	%esi, %edx
	sarl	%edx
	je	.L50
	.p2align 4,,10
	.p2align 3
.L52:
	movslq	%edx, %rcx
	leaq	(%r8,%rcx,8), %rsi
	movl	4(%rsi), %ecx
	cmpl	%ecx, %edi
	jg	.L51
	movl	(%rsi), %eax
	movl	%ecx, %edi
.L51:
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	jne	.L52
.L50:
	salq	$32, %rdi
	orq	%rdi, %rax
	ret
	.cfi_endproc
.LFE57:
	.size	find, .-find
	.section	.rodata.str1.1
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB58:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%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
	movl	$1, %ebx
	subq	$168, %rsp
	.cfi_def_cfa_offset 224
	movq	%fs:40, %rax
	movq	%rax, 152(%rsp)
	xorl	%eax, %eax
	leaq	136(%rsp), %rdx
	leaq	132(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	132(%rsp), %eax
	cmpl	$1, %eax
	jle	.L95
	.p2align 4,,10
	.p2align 3
.L59:
	movl	%ebx, %ebp
	addl	%ebx, %ebx
	cmpl	%eax, %ebx
	jl	.L59
	leal	0(,%rbp,4), %eax
	movdqa	.LC3(%rip), %xmm0
	cmpl	$1, %eax
	leal	-1(%rax), %ecx
	movl	$1, %eax
	cmovle	%eax, %ecx
	leaq	8+seg.1(%rip), %rax
	leaq	16(%rax), %rsi
	movl	%ecx, %edx
	shrl	%edx
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L60:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L60
	movl	%ecx, %eax
	orl	$1, %eax
	andl	$1, %ecx
	je	.L61
.L58:
	movq	.LC4(%rip), %rcx
	cltq
	leaq	seg.1(%rip), %rdx
	movq	%rcx, (%rdx,%rax,8)
.L61:
	movl	136(%rsp), %eax
	testl	%eax, %eax
	jle	.L92
	movl	%ebx, %eax
	movl	%ebx, %edi
	movd	%ebp, %xmm6
	xorl	%r12d, %r12d
	sarl	$2, %eax
	sarl	$3, %edi
	xorl	%r15d, %r15d
	leaq	.LC0(%rip), %r14
	leal	(%rax,%rbp), %edx
	movd	%eax, %xmm1
	movl	%eax, 20(%rsp)
	movd	%edi, %xmm3
	movl	%edx, %eax
	movl	%edi, 48(%rsp)
	punpckldq	%xmm1, %xmm3
	movdqa	%xmm1, %xmm5
	shrl	$31, %eax
	movq	%xmm3, 24(%rsp)
	movd	%ebp, %xmm3
	leaq	148(%rsp), %r13
	addl	%edx, %eax
	leal	0(%rbp,%rbx), %edx
	sarl	%eax
	movd	%eax, %xmm0
	movd	%eax, %xmm4
	movl	%edx, %eax
	shrl	$31, %eax
	punpckldq	%xmm3, %xmm4
	punpckldq	%xmm0, %xmm5
	addl	%edx, %eax
	movq	%xmm4, 40(%rsp)
	sarl	%eax
	movq	%xmm5, 32(%rsp)
	movd	%ebx, %xmm5
	leal	0(%rbp,%rax), %edx
	movl	%eax, %edi
	movl	%eax, 8(%rsp)
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	leal	(%rdi,%rbx), %edx
	sarl	%eax
	movd	%eax, %xmm4
	movl	%eax, 112(%rsp)
	movl	%edx, %eax
	shrl	$31, %eax
	punpckldq	%xmm4, %xmm6
	addl	%edx, %eax
	movq	%xmm6, 56(%rsp)
	sarl	%eax
	movd	%eax, %xmm7
	salq	$32, %rax
	movq	%rax, 72(%rsp)
	punpckldq	%xmm5, %xmm7
	movq	%xmm7, 64(%rsp)
	.p2align 4,,10
	.p2align 3
.L91:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	148(%rsp), %eax
	testl	%eax, %eax
	je	.L63
	cmpl	$1, %eax
	jne	.L65
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	148(%rsp), %edx
	leaq	seg.1(%rip), %rsi
	addl	%ebx, %edx
	movslq	%edx, %rax
	leaq	(%rsi,%rax,8), %rax
	movl	(%rax), %edi
	movl	4(%rax), %ecx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	je	.L88
	.p2align 4,,10
	.p2align 3
.L90:
	movslq	%eax, %rdx
	leaq	(%rsi,%rdx,8), %r8
	movl	4(%r8), %edx
	cmpl	%ecx, %edx
	jl	.L89
	movl	(%r8), %edi
	movl	%edx, %ecx
.L89:
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	jne	.L90
.L88:
	movslq	%r15d, %rdx
	leaq	ans.0(%rip), %rax
	addl	$1, %r15d
	movl	%edi, (%rax,%rdx,4)
.L65:
	addl	$1, %r12d
	cmpl	%r12d, 136(%rsp)
	jg	.L91
	testl	%r15d, %r15d
	je	.L92
	leaq	ans.0(%rip), %rbx
	leal	-1(%r15), %edx
	leaq	4(%rbx), %rax
	leaq	.LC5(%rip), %rbp
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L93:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L93
.L92:
	movq	152(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L142
	addq	$168, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L63:
	.cfi_restore_state
	leaq	144(%rsp), %rdx
	movq	%r13, %rcx
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	leaq	140(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	144(%rsp), %eax
	leal	1(%rax), %r11d
	movl	140(%rsp), %eax
	movd	%r11d, %xmm2
	movd	%eax, %xmm0
	punpckldq	%xmm2, %xmm0
	cmpl	%ebx, %eax
	jge	.L65
	testl	%r11d, %r11d
	jle	.L65
	movl	148(%rsp), %r9d
	cmpl	%ebx, %r11d
	movd	%r12d, %xmm6
	setge	%r10b
	testl	%eax, %eax
	movd	%r9d, %xmm1
	setle	%dl
	punpckldq	%xmm6, %xmm1
	testb	%r10b, %r10b
	je	.L96
	testb	%dl, %dl
	jne	.L67
.L96:
	cmpl	%ebp, %eax
	jge	.L69
	cmpl	%ebp, %r11d
	setge	80(%rsp)
	movzbl	80(%rsp), %ecx
	andb	%dl, %cl
	jne	.L70
	movl	20(%rsp), %ecx
	movq	%xmm0, %rsi
	cmpl	%ecx, %eax
	jge	.L71
	cmpl	%ecx, %r11d
	jl	.L97
	testb	%dl, %dl
	jne	.L72
.L97:
	movq	48(%rsp), %r8
	movq	%xmm1, %rdx
	movl	%eax, 104(%rsp)
	movl	$8, %ecx
	leaq	seg.1(%rip), %rdi
	movb	%r10b, 120(%rsp)
	salq	$32, %r8
	movl	%r9d, 116(%rsp)
	movq	%rsi, 88(%rsp)
	movq	%xmm1, 96(%rsp)
	call	update_range
	movq	24(%rsp), %r8
	movq	96(%rsp), %rdx
	movl	$9, %ecx
	movq	88(%rsp), %rsi
	leaq	seg.1(%rip), %rdi
	call	update_range
	movl	104(%rsp), %eax
	movl	116(%rsp), %r9d
	movzbl	120(%rsp), %r10d
.L71:
	movq	%r11, %rdx
	movl	20(%rsp), %edi
	movl	%eax, %esi
	salq	$32, %rdx
	orq	%rdx, %rsi
	cmpl	%edi, %r11d
	jle	.L69
	cmpl	%edi, %eax
	jg	.L74
	cmpb	$0, 80(%rsp)
	jne	.L143
.L74:
	movq	%r12, %rcx
	movl	%r9d, %edx
	movq	32(%rsp), %r8
	movb	%r10b, 116(%rsp)
	salq	$32, %rcx
	leaq	seg.1(%rip), %rdi
	movl	%eax, 104(%rsp)
	orq	%rcx, %rdx
	movl	$10, %ecx
	movl	%r9d, 96(%rsp)
	movq	%rdx, 88(%rsp)
	movq	%rsi, 80(%rsp)
	call	update_range
	movq	40(%rsp), %r8
	movq	88(%rsp), %rdx
	movl	$11, %ecx
	movq	80(%rsp), %rsi
	leaq	seg.1(%rip), %rdi
	call	update_range
	movl	96(%rsp), %r9d
	movl	104(%rsp), %eax
	movzbl	116(%rsp), %r10d
.L69:
	cmpl	%ebp, %r11d
	jle	.L65
	cmpl	%ebp, %eax
	setle	%dl
	movl	%edx, %ecx
	testb	%r10b, %r10b
	je	.L77
	testb	%dl, %dl
	jne	.L80
.L77:
	movq	%r11, %rdx
	movl	%eax, %edi
	movl	%r11d, %esi
	salq	$32, %rdx
	movq	%rdi, 80(%rsp)
	orq	%rdx, %rdi
	movq	%rsi, 88(%rsp)
	movq	%rdi, %rsi
	movl	8(%rsp), %edi
	cmpl	%edi, %eax
	jge	.L82
	cmpl	%edi, %r11d
	jl	.L98
	testb	%cl, %cl
	jne	.L83
.L98:
	movq	8(%rsp), %rdx
	movl	112(%rsp), %ecx
	movl	%eax, 120(%rsp)
	movq	%r12, %rax
	salq	$32, %rax
	movq	56(%rsp), %r8
	movb	%r10b, 127(%rsp)
	leaq	seg.1(%rip), %rdi
	salq	$32, %rdx
	movl	%r9d, 116(%rsp)
	orq	%rdx, %rcx
	movl	%r9d, %edx
	movq	%rsi, 96(%rsp)
	orq	%rax, %rdx
	movq	%rcx, 88(%rsp)
	movl	$12, %ecx
	movq	%rdx, 104(%rsp)
	call	update_range
	movq	88(%rsp), %r8
	movq	104(%rsp), %rdx
	movl	$13, %ecx
	movq	96(%rsp), %rsi
	leaq	seg.1(%rip), %rdi
	call	update_range
	movl	116(%rsp), %r9d
	movl	120(%rsp), %eax
	movzbl	127(%rsp), %r10d
.L82:
	movl	8(%rsp), %ecx
	movl	%r11d, %esi
	salq	$32, %rsi
	orq	80(%rsp), %rsi
	cmpl	%ecx, %r11d
	jle	.L65
	cmpl	%ecx, %eax
	jg	.L85
	testb	%r10b, %r10b
	jne	.L144
.L85:
	movq	%r12, %rax
	movl	8(%rsp), %r8d
	movl	$14, %ecx
	orq	72(%rsp), %r8
	salq	$32, %rax
	leaq	seg.1(%rip), %rdi
	movq	%rsi, 80(%rsp)
	orq	%rax, %r9
	movq	%r9, %rdx
	movq	%r9, %r11
	call	update_range
	movq	64(%rsp), %r8
	movq	80(%rsp), %rsi
	movq	%r11, %rdx
	movl	$15, %ecx
	leaq	seg.1(%rip), %rdi
	call	update_range
	jmp	.L65
.L67:
	movl	%r9d, 8+seg.1(%rip)
	movl	%r12d, 12+seg.1(%rip)
	jmp	.L65
.L95:
	xorl	%ebp, %ebp
	movl	$1, %eax
	jmp	.L58
.L80:
	movl	%r9d, 24+seg.1(%rip)
	movl	%r12d, 28+seg.1(%rip)
	jmp	.L65
.L70:
	movl	%r9d, 16+seg.1(%rip)
	movl	%r12d, 20+seg.1(%rip)
	cmpl	%ebp, %r11d
	jg	.L77
	jmp	.L65
.L83:
	movq	80(%rsp), %rsi
	movl	%r9d, 48+seg.1(%rip)
	movl	%r12d, 52+seg.1(%rip)
	orq	%rdx, %rsi
	cmpl	8(%rsp), %r11d
	jg	.L85
	jmp	.L65
.L144:
	movl	%r9d, 56+seg.1(%rip)
	movl	%r12d, 60+seg.1(%rip)
	jmp	.L65
.L72:
	movq	%r11, %rdx
	movl	%eax, %esi
	movl	%r9d, 32+seg.1(%rip)
	salq	$32, %rdx
	movl	%r12d, 36+seg.1(%rip)
	orq	%rdx, %rsi
	cmpl	20(%rsp), %r11d
	jg	.L74
	jmp	.L69
.L143:
	movl	%r9d, 40+seg.1(%rip)
	movl	%r12d, 44+seg.1(%rip)
	jmp	.L69
.L142:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE58:
	.size	main, .-main
	.local	ans.0
	.comm	ans.0,400000,32
	.local	seg.1
	.comm	seg.1,2097152,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC3:
	.long	2147483647
	.long	-1
	.long	2147483647
	.long	-1
	.set	.LC4,.LC3
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
  scanf("%d %d %d", a1, a2, a3);
  return 0;
}

enum type {
    COMMAND_UPDATE,
    COMMAND_FIND
};

#define NUM2_MAX (1<<17)
#define QUERY_MAX 100000
#include <limits.h>

struct range {
    int start;
    int end;
};

struct pair {
    int val;
    int time;
};
#define ROOT_NODE 1

int is_contain(struct range this, struct range box) {
    return box.start <= this.start && this.end <= box.end;
}

int is_overlap(struct range r1, struct range r2) {
    return r1.end > r2.start && r2.end > r1.start;
}

void update_range(struct pair *seg, struct range r, struct pair val, int node, struct range nr) {
    if(!is_overlap(r, nr)) return;
    if(is_contain(nr, r)) {
        seg[node] = val;
#ifdef DEBUG
        printf("update: %d -> (%d, %d)\n", node, val.val, val.time);
#endif
        return;
    }
    struct range left = { nr.start, (nr.start + nr.end) / 2 };
    struct range right = { (nr.start + nr.end) / 2, nr.end };
    update_range(seg, r, val, node*2, left);
    update_range(seg, r, val, node*2+1, right);
    return;
}

struct pair find(struct pair *seg, int num2, int idx) {
    int node = num2 + idx;
    struct pair ans = seg[node];
    while((node = node/2)) {
        struct pair this = seg[node];
        ans = ans.time > this.time ? ans : this;
    }
    return ans;
}

int main(void) {
    int num, qs;
    get_int2(&num, &qs);
    int i;
    int num2 = 1;
    while(num > num2) num2 *= 2;
    // initialization
    static struct pair seg[NUM2_MAX*2];
    for(i = ROOT_NODE; i < num2*2; i++) seg[i] = (struct pair){.val = INT_MAX, .time = -1};
    struct range whole = {0, num2};
    static int ans[QUERY_MAX];
    int aidx = 0;
    int t;
    for(t = 0; t < qs; t++) {
        int type = get_int();
        switch(type) {
            case COMMAND_UPDATE:
                {
                    int start, end;
                    int val;
                    get_int3(&start, &end, &val);
                    end++;
                    struct range r = {start, end};
                    struct pair np = {val, t};
                    update_range(seg, r, np, ROOT_NODE, whole);
                }
                break;
            case COMMAND_FIND:
                {
                    int idx = get_int();
                    struct pair p = find(seg, num2, idx);
                    ans[aidx++] = p.val;
                }
                break;
            default:
                break;
        }
    }

    for(i = 0; i < aidx; i++) {
        printf("%d\n", ans[i]);
    }
    return 0;
}

3 5
0 0 1 1
0 1 2 3
0 0 2 2
1 0
1 1
 2 3
1 0
0 0 0 5
1 0
 3 5
0 0 1 1
0 1 2 3
0 0 2 2
1 0
0 1
 2 3
1 0
0 0 0 5
1 1
 3 5
1 0 1 1
0 1 2 3
0 0 2 2
1 0
1 1
 2 1
1 0
0 0 0 5
1 1
 3 5
1 1 1 2
0 1 2 3
-1 0 2 2
0 0
0 1
 9 5
1 0 1 1
1 1 4 3
0 0 2 2
0 1
1 1
 9 5
0 0 1 1
1 0 4 3
0 0 2 2
0 1
1 1
 3 5
0 0 1 1
0 1 2 3
0 2 2 2
1 0
1 0

2
2
 2147483647
5
 2
 2147483647
2147483647
 2147483647
2147483647
2
 2147483647
 2147483647
2147483647
 2147483647
2147483647
2147483647
 1
 1
1

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

```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int(void) {
  int num;
  scanf("%d", &num);
  return num;
}

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

int get_int3(int *a1, int *a2, int *a3) {
  scanf("%d %d %d", a1, a2, a3);
  return 0;
}

enum type {
    COMMAND_UPDATE,
    COMMAND_FIND
};

#define NUM2_MAX (1<<17)
#define QUERY_MAX 100000
#include <limits.h>

struct range {
    int start;
    int end;
};

struct pair {
    int val;
    int time;
};
#define ROOT_NODE 1

int is_contain(struct range this, struct range box) {
    return box.start <= this.start && this.end <= box.end;
}

int is_overlap(struct range r1, struct range r2) {
    return r1.end > r2.start && r2.end > r1.start;
}

void update_range(struct pair *seg, struct range r, struct pair val, int node, struct range nr) {
    if(!is_overlap(r, nr)) return;
    if(is_contain(nr, r)) {
        seg[node] = val;
#ifdef DEBUG
        printf("update: %d -> (%d, %d)\n", node, val.val, val.time);
#endif
        return;
    }
    struct range left = { nr.start, (nr.start + nr.end) / 2 };
    struct range right = { (nr.start + nr.end) / 2, nr.end };
    update_range(seg, r, val, node*2, left);
    update_range(seg, r, val, node*2+1, right);
    return;
}

struct pair find(struct pair *seg, int num2, int idx) {
    int node = num2 + idx;
    struct pair ans = seg[node];
    while((node = node/2)) {
        struct pair this = seg[node];
        ans = ans.time > this.time ? ans : this;
    }
    return ans;
}

int main(void) {
    int num, qs;
    get_int2(&num, &qs);
    int i;
    int num2 = 1;
    while(num > num2) num2 *= 2;
    // initialization
    static struct pair seg[NUM2_MAX*2];
    for(i = ROOT_NODE; i < num2*2; i++) seg[i] = (struct pair){.val = INT_MAX, .time = -1};
    struct range whole = {0, num2};
    static int ans[QUERY_MAX];
    int aidx = 0;
    int t;
    for(t = 0; t < qs; t++) {
        int type = get_int();
        switch(type) {
            case COMMAND_UPDATE:
                {
                    int start, end;
                    int val;
                    get_int3(&start, &end, &val);
                    end++;
                    struct range r = {start, end};
                    struct pair np = {val, t};
                    update_range(seg, r, np, ROOT_NODE, whole);
                }
                break;
            case COMMAND_FIND:
                {
                    int idx = get_int();
                    struct pair p = find(seg, num2, idx);
                    ans[aidx++] = p.val;
                }
                break;
            default:
                break;
        }
    }

    for(i = 0; i < aidx; i++) {
        printf("%d\n", ans[i]);
    }
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC2:
	.string	"%d %d %d"
	.text
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB8:
	.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	get_int3, .-get_int3
	.globl	is_contain
	.type	is_contain, @function
is_contain:
.LFB9:
	.cfi_startproc
	endbr64
	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)
	movl	-16(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-4(%rbp), %edx
	movl	-12(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	$1, %eax
	jmp	.L11
.L9:
	movl	$0, %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	is_contain, .-is_contain
	.globl	is_overlap
	.type	is_overlap, @function
is_overlap:
.LFB10:
	.cfi_startproc
	endbr64
	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)
	movl	-4(%rbp), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	$1, %eax
	jmp	.L15
.L13:
	movl	$0, %eax
.L15:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	is_overlap, .-is_overlap
	.globl	update_range
	.type	update_range, @function
update_range:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movl	%ecx, -44(%rbp)
	movq	%r8, -52(%rbp)
	movq	-52(%rbp), %rdx
	movq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	is_overlap
	testl	%eax, %eax
	je	.L21
	movq	-32(%rbp), %rdx
	movq	-52(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	is_contain
	testl	%eax, %eax
	je	.L19
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	%rax, (%rdx)
	jmp	.L16
.L19:
	movl	-52(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-52(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-52(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -8(%rbp)
	movl	-48(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-44(%rbp), %eax
	leal	(%rax,%rax), %ecx
	movq	-16(%rbp), %rdi
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	update_range
	movl	-44(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdi
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	update_range
	jmp	.L16
.L21:
	nop
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	update_range, .-update_range
	.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
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L23
.L26:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L23
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L23:
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L26
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	find, .-find
	.section	.rodata
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	$1, -52(%rbp)
	jmp	.L29
.L30:
	sall	-52(%rbp)
.L29:
	movl	-76(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L30
	movl	$1, -56(%rbp)
	jmp	.L31
.L32:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	seg.1(%rip), %rax
	movl	$2147483647, (%rdx,%rax)
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+seg.1(%rip), %rax
	movl	$-1, (%rdx,%rax)
	addl	$1, -56(%rbp)
.L31:
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -56(%rbp)
	jl	.L32
	movl	$0, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L33
.L38:
	call	get_int
	movl	%eax, -40(%rbp)
	cmpl	$0, -40(%rbp)
	je	.L34
	cmpl	$1, -40(%rbp)
	je	.L35
	jmp	.L37
.L34:
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rcx
	leaq	-68(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	get_int3
	movl	-64(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -64(%rbp)
	movl	-68(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-64(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -12(%rbp)
	movq	-32(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rcx, %r8
	movl	$1, %ecx
	movq	%rax, %rsi
	leaq	seg.1(%rip), %rax
	movq	%rax, %rdi
	call	update_range
	jmp	.L37
.L35:
	call	get_int
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %edx
	movl	-52(%rbp), %eax
	movl	%eax, %esi
	leaq	seg.1(%rip), %rax
	movq	%rax, %rdi
	call	find
	movq	%rax, -16(%rbp)
	movl	-48(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -48(%rbp)
	movl	-16(%rbp), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ans.0(%rip), %rax
	movl	%edx, (%rcx,%rax)
	nop
.L37:
	addl	$1, -44(%rbp)
.L33:
	movl	-72(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L38
	movl	$0, -56(%rbp)
	jmp	.L39
.L40:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -56(%rbp)
.L39:
	movl	-56(%rbp), %eax
	cmpl	-48(%rbp), %eax
	jl	.L40
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	seg.1
	.comm	seg.1,2097152,32
	.local	ans.0
	.comm	ans.0,400000,32
	.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
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	get_int
	.type	get_int, @function
get_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	get_int, .-get_int
	.section	.rodata
.LC1:
	.string	"%d %d"
	.text
	.globl	get_int2
	.type	get_int2, @function
get_int2:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	get_int2, .-get_int2
	.section	.rodata
.LC2:
	.string	"%d %d %d"
	.text
	.globl	get_int3
	.type	get_int3, @function
get_int3:
.LFB8:
	.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, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-24(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	get_int3, .-get_int3
	.globl	is_contain
	.type	is_contain, @function
is_contain:
.LFB9:
	.cfi_startproc
	endbr64
	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)
	movl	-16(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-4(%rbp), %edx
	movl	-12(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	$1, %eax
	jmp	.L11
.L9:
	movl	$0, %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	is_contain, .-is_contain
	.globl	is_overlap
	.type	is_overlap, @function
is_overlap:
.LFB10:
	.cfi_startproc
	endbr64
	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)
	movl	-4(%rbp), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L13
	movl	$1, %eax
	jmp	.L15
.L13:
	movl	$0, %eax
.L15:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	is_overlap, .-is_overlap
	.globl	update_range
	.type	update_range, @function
update_range:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movl	%ecx, -44(%rbp)
	movq	%r8, -52(%rbp)
	movq	-52(%rbp), %rdx
	movq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	is_overlap
	testl	%eax, %eax
	je	.L21
	movq	-32(%rbp), %rdx
	movq	-52(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	is_contain
	testl	%eax, %eax
	je	.L19
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	%rax, (%rdx)
	jmp	.L16
.L19:
	movl	-52(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-52(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -12(%rbp)
	movl	-52(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -8(%rbp)
	movl	-48(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-44(%rbp), %eax
	leal	(%rax,%rax), %ecx
	movq	-16(%rbp), %rdi
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	update_range
	movl	-44(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %ecx
	movq	-8(%rbp), %rdi
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rsi
	movq	-24(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	update_range
	jmp	.L16
.L21:
	nop
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	update_range, .-update_range
	.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
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movl	-44(%rbp), %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	jmp	.L23
.L26:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	-12(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L23
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L23:
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L26
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	find, .-find
	.section	.rodata
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	get_int2
	movl	$1, -52(%rbp)
	jmp	.L29
.L30:
	sall	-52(%rbp)
.L29:
	movl	-76(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L30
	movl	$1, -56(%rbp)
	jmp	.L31
.L32:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	seg.1(%rip), %rax
	movl	$2147483647, (%rdx,%rax)
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+seg.1(%rip), %rax
	movl	$-1, (%rdx,%rax)
	addl	$1, -56(%rbp)
.L31:
	movl	-52(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -56(%rbp)
	jl	.L32
	movl	$0, -32(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L33
.L38:
	call	get_int
	movl	%eax, -40(%rbp)
	cmpl	$0, -40(%rbp)
	je	.L34
	cmpl	$1, -40(%rbp)
	je	.L35
	jmp	.L37
.L34:
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rcx
	leaq	-68(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	get_int3
	movl	-64(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -64(%rbp)
	movl	-68(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-64(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-60(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -12(%rbp)
	movq	-32(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rcx, %r8
	movl	$1, %ecx
	movq	%rax, %rsi
	leaq	seg.1(%rip), %rax
	movq	%rax, %rdi
	call	update_range
	jmp	.L37
.L35:
	call	get_int
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %edx
	movl	-52(%rbp), %eax
	movl	%eax, %esi
	leaq	seg.1(%rip), %rax
	movq	%rax, %rdi
	call	find
	movq	%rax, -16(%rbp)
	movl	-48(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -48(%rbp)
	movl	-16(%rbp), %edx
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ans.0(%rip), %rax
	movl	%edx, (%rcx,%rax)
	nop
.L37:
	addl	$1, -44(%rbp)
.L33:
	movl	-72(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L38
	movl	$0, -56(%rbp)
	jmp	.L39
.L40:
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans.0(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -56(%rbp)
.L39:
	movl	-56(%rbp), %eax
	cmpl	-48(%rbp), %eax
	jl	.L40
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	main, .-main
	.local	seg.1
	.comm	seg.1,2097152,32
	.local	ans.0
	.comm	ans.0,400000,32
	.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:
