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

```c
// AOJ 3024 RMQ 2
// 2019.4.2 bal4u

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

#define INF 0x7fffffff

#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
int in()
{
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void out(int n)
{
	int i;
	char ob[30];

	if (!n) pc('0');
	else {
		i = 0; while (n) ob[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(ob[i]);
	}
	pc('\n');
}


//// セグメント木
int seg[2][1 << 19]; int sz;

void segInit(int n) {
	sz = 1; while (sz < n) sz <<= 1;
	memset(seg, INF, sizeof(seg));
}

// k番目（0-index）の値を v に変更
void update(int id, int k, int v)
{
	int a, b;

	k += sz - 1;
//	if (seg[id][k] == v) return;
	seg[id][k] = v;
	while (k > 0) {
		k = (k - 1) >> 1;
		a = seg[id][(k << 1) + 1];
		b = seg[id][(k << 1) + 2];
		seg[id][k] = (a <= b)? a: b;
	}
}

// 空間 [a, b) 内の最小値
int getMin(int id, int a, int b, int k, int l, int r)
{
	int left, right;

	if (r <= a || b <= l) return INF;
	if (a <= l && r <= b) return seg[id][k];
	left = getMin(id, a, b, (k << 1) + 1, l, (l + r) >> 1);
	right = getMin(id, a, b, (k << 1) + 2, (l + r) >> 1, r);
	return left <= right ? left : right;
}


//// 本問題
typedef struct { int y, p, n; } T;  // 位置と更新前後の値
T memo[2][200005]; int len[2];

int main()
{
	int i, k, N, Q, x, y, z;
	int syn;

	N = in();
	segInit(N);            // セグメント木の初期化
	for (i = 0; i < N; i++) update(0, i, in());
	for (i = 0; i < N; i++) update(1, i, in());

	Q = in(), syn = 0;
	while (Q--) {
		x = in(), y = in()-1, z = in();      // 0-index
		if (x == 1 || x == 2) {
			x--;   // 0と1にする. 0->A, 1->B
			if (syn) {
				// 位置と更新前後の値を記録
				k = len[x]++;
				memo[x][k].y = y, memo[x][k].n = z;
				memo[x][k].p = seg[x][y+(sz-1)];     // 元の値は y+(sz-1) の位置にある
			}
			update(x, y, z);
		}
		else if (x == 3 || x == 4) out(getMin(x-3, y, z, 0, 0, sz));
		else {
			x -= 5;   // 0と1にする. 0->A, 1->B
			if (syn) {
				// 元に戻して、相手のしてきた変更を施し、相手と同じにする
				for (i = len[x] - 1; i >= 0; i--)   // 戻す作業
					update(x, memo[x][i].y, memo[x][i].p);
				for (i = 0; i < len[!x]; i++)       // 相手に同期
					update(x, memo[!x][i].y, memo[!x][i].n);
				len[0] = len[1] = 0;
			}
			else {
				memcpy(seg[x], seg[!x], sizeof(int)*sz*2);
				syn = 1;
			}
		}
	}
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.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
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	out
	.type	out, @function
out:
.LFB7:
	.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
	movl	%edi, -68(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	cmpl	$0, -68(%rbp)
	jne	.L5
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L6
.L5:
	movl	$0, -52(%rbp)
	jmp	.L7
.L8:
	movl	-68(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %ecx
	movl	-52(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -52(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -48(%rbp,%rax)
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
.L7:
	cmpl	$0, -68(%rbp)
	jne	.L8
	jmp	.L9
.L10:
	movl	-52(%rbp), %eax
	cltq
	movzbl	-48(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L9:
	movl	-52(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -52(%rbp)
	testl	%eax, %eax
	jne	.L10
.L6:
	movl	$10, %edi
	call	putchar_unlocked@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	out, .-out
	.globl	seg
	.bss
	.align 32
	.type	seg, @object
	.size	seg, 4194304
seg:
	.zero	4194304
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.text
	.globl	segInit
	.type	segInit, @function
segInit:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	$1, sz(%rip)
	jmp	.L13
.L14:
	movl	sz(%rip), %eax
	addl	%eax, %eax
	movl	%eax, sz(%rip)
.L13:
	movl	sz(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L14
	movl	$4194304, %edx
	movl	$2147483647, %esi
	leaq	seg(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	segInit, .-segInit
	.globl	update
	.type	update, @function
update:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	sz(%rip), %eax
	subl	$1, %eax
	addl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	seg(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L16
.L17:
	movl	-24(%rbp), %eax
	subl	$1, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	salq	$19, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	seg(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L16:
	cmpl	$0, -24(%rbp)
	jg	.L17
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	update, .-update
	.globl	getMin
	.type	getMin, @function
getMin:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	%r9d, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L19
	movl	-28(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L20
.L19:
	movl	$2147483647, %eax
	jmp	.L21
.L20:
	movl	-24(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L22
	movl	-40(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L22
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L21
.L22:
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %r8d
	movl	-32(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %ecx
	movl	-36(%rbp), %edi
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%r8d, %r9d
	movl	%edi, %r8d
	movl	%eax, %edi
	call	getMin
	movl	%eax, -8(%rbp)
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %r8d
	movl	-32(%rbp), %eax
	addl	%eax, %eax
	leal	2(%rax), %ecx
	movl	-40(%rbp), %edi
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%edi, %r9d
	movl	%eax, %edi
	call	getMin
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	getMin, .-getMin
	.globl	memo
	.bss
	.align 32
	.type	memo, @object
	.size	memo, 4800120
memo:
	.zero	4800120
	.globl	len
	.align 8
	.type	len, @object
	.size	len, 8
len:
	.zero	8
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.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	$0, %eax
	call	in
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	segInit
	movl	$0, -32(%rbp)
	jmp	.L24
.L25:
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	update
	addl	$1, -32(%rbp)
.L24:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L25
	movl	$0, -32(%rbp)
	jmp	.L26
.L27:
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	movl	$1, %edi
	call	update
	addl	$1, -32(%rbp)
.L26:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L27
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L28
.L39:
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	cmpl	$1, -16(%rbp)
	je	.L29
	cmpl	$2, -16(%rbp)
	jne	.L30
.L29:
	subl	$1, -16(%rbp)
	cmpl	$0, -24(%rbp)
	je	.L31
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	len(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	memo(%rip), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	8+memo(%rip), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	movl	sz(%rip), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$2400060, %rsi, %rcx
	addq	%rax, %rcx
	leaq	4+memo(%rip), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
.L31:
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %ecx
	movl	-16(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	update
	jmp	.L28
.L30:
	cmpl	$3, -16(%rbp)
	je	.L32
	cmpl	$4, -16(%rbp)
	jne	.L33
.L32:
	movl	sz(%rip), %ecx
	movl	-16(%rbp), %eax
	leal	-3(%rax), %edi
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%ecx, %r9d
	movl	$0, %r8d
	movl	$0, %ecx
	movl	%eax, %esi
	call	getMin
	movl	%eax, %edi
	call	out
	jmp	.L28
.L33:
	subl	$5, -16(%rbp)
	cmpl	$0, -24(%rbp)
	je	.L34
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	jmp	.L35
.L36:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	4+memo(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$2400060, %rsi, %rcx
	addq	%rax, %rcx
	leaq	memo(%rip), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-16(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	update
	subl	$1, -32(%rbp)
.L35:
	cmpl	$0, -32(%rbp)
	jns	.L36
	movl	$0, -32(%rbp)
	jmp	.L37
.L38:
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	8+memo(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	-32(%rbp), %ecx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$2400060, %rsi, %rcx
	addq	%rax, %rcx
	leaq	memo(%rip), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-16(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	update
	addl	$1, -32(%rbp)
.L37:
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L38
	movl	$0, 4+len(%rip)
	movl	4+len(%rip), %eax
	movl	%eax, len(%rip)
	jmp	.L28
.L34:
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	cltq
	salq	$21, %rax
	movq	%rax, %rcx
	leaq	seg(%rip), %rax
	addq	%rax, %rcx
	movl	-16(%rbp), %eax
	cltq
	salq	$21, %rax
	movq	%rax, %rsi
	leaq	seg(%rip), %rax
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	$1, -24(%rbp)
.L28:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -28(%rbp)
	testl	%eax, %eax
	jne	.L39
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	in
	.type	in, @function
in:
.LFB51:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L11
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L5:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L7:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L4
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
	.cfi_endproc
.LFE51:
	.size	in, .-in
	.p2align 4
	.globl	out
	.type	out, @function
out:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %edx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	movq	stdout(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	48(%rdi), %rcx
	movq	40(%rdi), %rax
	testl	%edx, %edx
	jne	.L22
	cmpq	%rcx, %rax
	jnb	.L27
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$48, (%rax)
.L15:
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L28
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$10, (%rax)
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	xorl	%ecx, %ecx
	movq	%rsp, %rbx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edx, %rax
	movl	%edx, %esi
	movslq	%ecx, %r8
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %edx
	addl	$48, %edx
	movb	%dl, (%rbx,%rcx)
	movl	%eax, %edx
	movq	%rcx, %rax
	addq	$1, %rcx
	testl	%edx, %edx
	jne	.L13
	leaq	-1(%rsp,%r8), %rbp
	addq	%r8, %rbx
	subq	%rax, %rbp
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L30:
	movq	stdout(%rip), %rdi
.L18:
	movzbl	(%rbx), %esi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L29
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%sil, (%rax)
.L17:
	subq	$1, %rbx
	cmpq	%rbx, %rbp
	jne	.L30
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L29:
	call	__overflow@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$48, %esi
	call	__overflow@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L28:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$10, %esi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	__overflow@PLT
.L26:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	out, .-out
	.p2align 4
	.globl	segInit
	.type	segInit, @function
segInit:
.LFB53:
	.cfi_startproc
	endbr64
	movl	$1, sz(%rip)
	cmpl	$1, %edi
	jle	.L32
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L33:
	addl	%eax, %eax
	cmpl	%edi, %eax
	jl	.L33
	movl	%eax, sz(%rip)
.L32:
	movl	$4194304, %edx
	movl	$2147483647, %esi
	leaq	seg(%rip), %rdi
	jmp	memset@PLT
	.cfi_endproc
.LFE53:
	.size	segInit, .-segInit
	.p2align 4
	.globl	update
	.type	update, @function
update:
.LFB54:
	.cfi_startproc
	endbr64
	movl	sz(%rip), %eax
	movslq	%edi, %rdi
	leaq	seg(%rip), %r8
	salq	$19, %rdi
	leal	-1(%rax,%rsi), %ecx
	movslq	%ecx, %rax
	addq	%rdi, %rax
	movl	%edx, (%r8,%rax,4)
	testl	%ecx, %ecx
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L37:
	leal	-1(%rcx), %eax
	movl	%eax, %edx
	movl	%eax, %ecx
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%ecx
	addl	$2, %edx
	addq	%rdi, %rax
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movl	(%r8,%rax,4), %eax
	addq	%rdi, %rsi
	addq	%rdi, %rdx
	movl	(%r8,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, (%r8,%rsi,4)
	testl	%ecx, %ecx
	jne	.L37
.L35:
	ret
	.cfi_endproc
.LFE54:
	.size	update, .-update
	.p2align 4
	.globl	getMin
	.type	getMin, @function
getMin:
.LFB55:
	.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
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	cmpl	%esi, %r9d
	jle	.L54
	movl	%edx, %r12d
	cmpl	%r8d, %edx
	jle	.L54
	cmpl	%r8d, %esi
	movslq	%edi, %rbp
	movl	%r9d, %ebx
	setle	%al
	cmpl	%edx, %r9d
	setle	%r10b
	testb	%al, %al
	je	.L41
	testb	%r10b, %r10b
	je	.L41
	movslq	%ecx, %rcx
	salq	$19, %rbp
	leaq	seg(%rip), %rax
	addq	%rcx, %rbp
	movl	(%rax,%rbp,4), %r13d
.L39:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r13d, %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
.L41:
	.cfi_restore_state
	addl	%ecx, %ecx
	leal	(%rbx,%r8), %r15d
	leal	2(%rcx), %edi
	sarl	%r15d
	leal	1(%rcx), %edx
	movl	%edi, 8(%rsp)
	cmpl	%r15d, %esi
	jge	.L55
	cmpl	%r15d, %r12d
	movl	%eax, %ecx
	setge	%r11b
	andb	%r11b, %cl
	je	.L43
	movslq	%ebp, %rax
	movslq	%edx, %rdx
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	seg(%rip), %rdx
	movl	(%rdx,%rax,4), %r13d
	cmpl	%r15d, %r12d
	je	.L39
.L45:
	movl	8(%rsp), %eax
	leal	(%rbx,%r15), %r14d
	sarl	%r14d
	addl	%eax, %eax
	leal	1(%rax), %edx
	addl	$2, %eax
	movl	%eax, 8(%rsp)
	cmpl	%r14d, %esi
	jge	.L57
	cmpl	%r14d, %r12d
	jl	.L51
	testb	%cl, %cl
	je	.L51
	movslq	%ebp, %rax
	movslq	%edx, %rdx
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	seg(%rip), %rdx
	movl	(%rdx,%rax,4), %r15d
	cmpl	%r14d, %r12d
	je	.L52
.L53:
	movl	8(%rsp), %r10d
	leal	(%rbx,%r14), %r11d
	movl	%r14d, %r8d
	movl	%r12d, %edx
	sarl	%r11d
	movl	%ebp, %edi
	movl	%esi, 8(%rsp)
	addl	%r10d, %r10d
	movl	%r11d, %r9d
	movl	%r11d, 12(%rsp)
	leal	1(%r10), %ecx
	movl	%r10d, 16(%rsp)
	call	getMin
	movl	16(%rsp), %r10d
	movl	8(%rsp), %esi
	movl	%ebp, %edi
	movl	12(%rsp), %r8d
	movl	%eax, %r14d
	movl	%ebx, %r9d
	movl	%r12d, %edx
	leal	2(%r10), %ecx
	call	getMin
	cmpl	%r14d, %r15d
	cmovle	%r15d, %r14d
	cmpl	%eax, %r14d
	cmovle	%r14d, %eax
	movl	%eax, %r15d
.L52:
	cmpl	%r15d, %r13d
	cmovg	%r15d, %r13d
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L54:
	movl	$2147483647, %r13d
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L43:
	leal	(%r8,%r15), %ecx
	addl	%edx, %edx
	sarl	%ecx
	leal	2(%rdx), %edi
	movl	%ecx, %r14d
	movl	%edi, 12(%rsp)
	leal	1(%rdx), %ecx
	cmpl	%r14d, %esi
	jge	.L56
	cmpl	%r14d, %r12d
	jl	.L47
	testb	%al, %al
	je	.L47
	movslq	%ebp, %rax
	movslq	%ecx, %rcx
	leaq	seg(%rip), %rdx
	salq	$19, %rax
	addq	%rcx, %rax
	movl	(%rdx,%rax,4), %r13d
	cmpl	%r14d, %r12d
	je	.L42
.L49:
	leal	(%r15,%r14), %eax
	movl	%r14d, %r8d
	movl	%r12d, %edx
	movl	%ebp, %edi
	sarl	%eax
	movb	%r10b, 24(%rsp)
	movl	%eax, %r11d
	movl	12(%rsp), %eax
	movl	%esi, 16(%rsp)
	movl	%r11d, %r9d
	movl	%r11d, 20(%rsp)
	addl	%eax, %eax
	leal	1(%rax), %ecx
	movl	%eax, 12(%rsp)
	call	getMin
	movl	16(%rsp), %esi
	movl	20(%rsp), %r8d
	movl	%ebp, %edi
	movl	%eax, %r14d
	movl	12(%rsp), %eax
	movl	%r15d, %r9d
	movl	%r12d, %edx
	movl	%esi, 12(%rsp)
	leal	2(%rax), %ecx
	call	getMin
	cmpl	%r13d, %r14d
	movl	12(%rsp), %esi
	movzbl	24(%rsp), %r10d
	cmovg	%r13d, %r14d
	cmpl	%eax, %r14d
	cmovle	%r14d, %eax
	movl	%eax, %r13d
.L42:
	cmpl	%r15d, %r12d
	jle	.L39
	cmpl	%r15d, %esi
	setle	%al
	movl	%eax, %ecx
	testb	%r10b, %r10b
	je	.L45
	testb	%al, %al
	je	.L45
	movslq	8(%rsp), %rax
	salq	$19, %rbp
	addq	%rax, %rbp
	leaq	seg(%rip), %rax
	movl	(%rax,%rbp,4), %eax
	cmpl	%eax, %r13d
	cmovg	%eax, %r13d
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L55:
	movl	$2147483647, %r13d
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L51:
	leal	(%r15,%r14), %eax
	movl	%r15d, %r8d
	movl	%ebp, %edi
	movb	%r10b, 24(%rsp)
	sarl	%eax
	movl	%esi, 16(%rsp)
	movl	%eax, %r11d
	leal	(%rdx,%rdx), %eax
	movl	%r12d, %edx
	movl	%r11d, %r9d
	leal	1(%rax), %ecx
	movl	%r11d, 20(%rsp)
	movl	%eax, 12(%rsp)
	call	getMin
	movl	16(%rsp), %esi
	movl	20(%rsp), %r8d
	movl	%ebp, %edi
	movl	%eax, %r15d
	movl	12(%rsp), %eax
	movl	%r14d, %r9d
	movl	%r12d, %edx
	movl	%esi, 12(%rsp)
	leal	2(%rax), %ecx
	call	getMin
	movl	12(%rsp), %esi
	movzbl	24(%rsp), %r10d
	cmpl	%eax, %r15d
	cmovg	%eax, %r15d
.L50:
	cmpl	%r14d, %r12d
	jle	.L52
	cmpl	%r14d, %esi
	jg	.L53
	testb	%r10b, %r10b
	je	.L53
	movslq	8(%rsp), %rax
	salq	$19, %rbp
	leaq	seg(%rip), %rdx
	addq	%rbp, %rax
	movl	(%rdx,%rax,4), %eax
	cmpl	%eax, %r15d
	cmovg	%eax, %r15d
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L47:
	leal	(%r8,%r14), %eax
	movl	%r12d, %edx
	movl	%ebp, %edi
	movb	%r10b, 31(%rsp)
	sarl	%eax
	movb	%r11b, 30(%rsp)
	movl	%eax, %r13d
	leal	(%rcx,%rcx), %eax
	movl	%esi, 24(%rsp)
	movl	%r13d, %r9d
	leal	1(%rax), %ecx
	movl	%eax, 16(%rsp)
	call	getMin
	movl	16(%rsp), %edx
	movl	24(%rsp), %esi
	movl	%r13d, %r8d
	movl	%ebp, %edi
	movl	%r14d, %r9d
	movl	%eax, 20(%rsp)
	leal	2(%rdx), %ecx
	movl	%r12d, %edx
	movl	%esi, 16(%rsp)
	call	getMin
	movl	20(%rsp), %edi
	movl	16(%rsp), %esi
	movzbl	30(%rsp), %r11d
	movzbl	31(%rsp), %r10d
	cmpl	%eax, %edi
	movl	%edi, %r13d
	cmovg	%eax, %r13d
.L46:
	cmpl	%r14d, %r12d
	jle	.L42
	cmpl	%r14d, %esi
	jg	.L49
	testb	%r11b, %r11b
	je	.L49
	movslq	12(%rsp), %rdx
	movslq	%ebp, %rax
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	seg(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	cmpl	%eax, %r13d
	cmovg	%eax, %r13d
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L57:
	movl	$2147483647, %r15d
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L56:
	movl	$2147483647, %r13d
	jmp	.L46
	.cfi_endproc
.LFE55:
	.size	getMin, .-getMin
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	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
	leaq	seg(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	in
	movl	%eax, %edi
	movl	%eax, %ebp
	call	segInit
	movq	stdin(%rip), %rdi
	testl	%ebp, %ebp
	jle	.L115
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L183
	.p2align 4,,10
	.p2align 3
.L99:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L100:
	xorl	%r13d, %r13d
	jmp	.L104
	.p2align 4,,10
	.p2align 3
.L101:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L103
.L102:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L104:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rcx, %rdx
	jb	.L101
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	cmpl	$47, %eax
	jg	.L102
	.p2align 4,,10
	.p2align 3
.L103:
	movl	sz(%rip), %eax
	leal	-1(%rbx,%rax), %ecx
	movslq	%ecx, %rax
	movl	%r13d, (%r12,%rax,4)
	testl	%ecx, %ecx
	jle	.L107
	.p2align 4,,10
	.p2align 3
.L105:
	leal	-1(%rcx), %eax
	movl	%eax, %edx
	movl	%eax, %ecx
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%ecx
	addl	$2, %edx
	movl	(%r12,%rax,4), %eax
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movl	(%r12,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, (%r12,%rsi,4)
	testl	%ecx, %ecx
	jne	.L105
.L107:
	leal	1(%rbx), %eax
	cmpl	%eax, %ebp
	je	.L184
	movl	%eax, %ebx
	movq	16(%rdi), %rcx
	movq	8(%rdi), %rax
	cmpq	%rcx, %rax
	jb	.L99
.L183:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L100
.L115:
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	leaq	seg(%rip), %rbx
	call	in
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L174
	.p2align 4,,10
	.p2align 3
.L151:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rdx
	cmpq	%rdx, %rax
	jnb	.L185
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rax), %eax
.L118:
	xorl	%r14d, %r14d
	jmp	.L122
	.p2align 4,,10
	.p2align 3
.L119:
	leaq	1(%rcx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L121
.L120:
	movq	%rsi, %rcx
.L122:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rdx, %rcx
	jb	.L119
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rdx
	cmpl	$47, %eax
	jg	.L120
	.p2align 4,,10
	.p2align 3
.L121:
	cmpq	%rsi, %rdx
	jbe	.L186
	leaq	1(%rsi), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rsi), %eax
.L124:
	xorl	%r13d, %r13d
	jmp	.L128
	.p2align 4,,10
	.p2align 3
.L125:
	leaq	1(%rcx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L127
.L126:
	movq	%rsi, %rcx
.L128:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rdx, %rcx
	jb	.L125
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rdx
	cmpl	$47, %eax
	jg	.L126
	.p2align 4,,10
	.p2align 3
.L127:
	subl	$1, %r13d
	cmpq	%rsi, %rdx
	jbe	.L187
	leaq	1(%rsi), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rsi), %eax
.L130:
	xorl	%r15d, %r15d
	jmp	.L134
	.p2align 4,,10
	.p2align 3
.L131:
	leaq	1(%rcx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L133
.L132:
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
.L134:
	leal	(%r15,%r15,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r15d
	cmpq	%rdx, %rcx
	jb	.L131
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L133
	movq	stdin(%rip), %rdi
	jmp	.L132
	.p2align 4,,10
	.p2align 3
.L133:
	leal	-1(%r14), %esi
	cmpl	$1, %esi
	jbe	.L188
	leal	-3(%r14), %edi
	cmpl	$1, %edi
	jbe	.L189
	movl	%r14d, %ecx
	subl	$5, %ecx
	sete	%r14b
	sete	%r11b
	movslq	%ecx, %rcx
	movzbl	%r14b, %r14d
	testl	%r12d, %r12d
	jne	.L190
	movslq	sz(%rip), %rdx
	movzbl	%r11b, %esi
	salq	$21, %rcx
	movl	$1, %r12d
	salq	$21, %rsi
	leaq	(%rbx,%rcx), %rdi
	salq	$3, %rdx
	leaq	(%rbx,%rsi), %rsi
	call	memcpy@PLT
.L137:
	subl	$1, %ebp
	jne	.L151
.L174:
	addq	$8, %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
.L188:
	.cfi_restore_state
	movl	sz(%rip), %ecx
	movslq	%esi, %rsi
	testl	%r12d, %r12d
	jne	.L175
	subl	$1, %ecx
.L136:
	addl	%r13d, %ecx
	salq	$19, %rsi
	movslq	%ecx, %rax
	addq	%rsi, %rax
	movl	%r15d, (%rbx,%rax,4)
	testl	%ecx, %ecx
	jle	.L137
	.p2align 4,,10
	.p2align 3
.L138:
	leal	-1(%rcx), %eax
	movl	%eax, %edx
	movl	%eax, %ecx
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%ecx
	addl	$2, %edx
	addq	%rsi, %rax
	movslq	%ecx, %rdi
	movslq	%edx, %rdx
	movl	(%rbx,%rax,4), %eax
	addq	%rsi, %rdi
	addq	%rsi, %rdx
	movl	(%rbx,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, (%rbx,%rdi,4)
	testl	%ecx, %ecx
	jne	.L138
	jmp	.L137
	.p2align 4,,10
	.p2align 3
.L175:
	leaq	len(%rip), %rdi
	subl	$1, %ecx
	movd	%r13d, %xmm0
	movslq	(%rdi,%rsi,4), %rax
	leaq	memo(%rip), %r11
	leal	1(%rax), %edx
	movl	%edx, (%rdi,%rsi,4)
	leaq	(%rax,%rax,2), %rdx
	imulq	$2400060, %rsi, %rax
	leaq	(%rax,%rdx,4), %rdi
	leal	(%rcx,%r13), %edx
	movq	%rsi, %rax
	movslq	%edx, %rdx
	salq	$19, %rax
	movl	%r15d, 8(%r11,%rdi)
	addq	%rdx, %rax
	movl	(%rbx,%rax,4), %eax
	movd	%eax, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%r11,%rdi)
	jmp	.L136
	.p2align 4,,10
	.p2align 3
.L190:
	leaq	len(%rip), %rax
	movslq	(%rax,%rcx,4), %rax
	movl	%eax, %r10d
	subl	$1, %r10d
	js	.L146
	imulq	$2400060, %rcx, %rdx
	leaq	(%rax,%rax,2), %rax
	movl	sz(%rip), %edi
	movq	%rcx, %r8
	salq	$19, %r8
	leal	-1(%rdi), %r13d
	leaq	(%rdx,%rax,4), %r9
	leaq	memo(%rip), %rax
	addq	%rax, %r9
	.p2align 4,,10
	.p2align 3
.L145:
	movl	-12(%r9), %esi
	movl	-8(%r9), %edx
	addl	%r13d, %esi
	movslq	%esi, %rax
	addq	%r8, %rax
	movl	%edx, (%rbx,%rax,4)
	testl	%esi, %esi
	jle	.L147
	.p2align 4,,10
	.p2align 3
.L144:
	leal	-1(%rsi), %eax
	movl	%eax, %edx
	movl	%eax, %esi
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%esi
	addl	$2, %edx
	addq	%r8, %rax
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movl	(%rbx,%rax,4), %eax
	addq	%r8, %rdi
	addq	%r8, %rdx
	movl	(%rbx,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, (%rbx,%rdi,4)
	testl	%esi, %esi
	jne	.L144
.L147:
	subl	$1, %r10d
	subq	$12, %r9
	cmpl	$-1, %r10d
	jne	.L145
.L146:
	leaq	len(%rip), %rax
	movl	(%rax,%r14,4), %esi
	testl	%esi, %esi
	jle	.L143
	movl	sz(%rip), %eax
	leaq	memo(%rip), %rdi
	salq	$19, %rcx
	leaq	12(%rdi), %rdx
	leal	-1(%rax), %r9d
	movzbl	%r11b, %eax
	imulq	$2400060, %rax, %rax
	leaq	(%rax,%rdi), %r8
	addq	%rdx, %rax
	leal	-1(%rsi), %edx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rax,%rdx,4), %r10
	.p2align 4,,10
	.p2align 3
.L149:
	movl	(%r8), %esi
	movl	8(%r8), %edx
	addl	%r9d, %esi
	movslq	%esi, %rax
	addq	%rcx, %rax
	movl	%edx, (%rbx,%rax,4)
	testl	%esi, %esi
	jle	.L150
	.p2align 4,,10
	.p2align 3
.L148:
	leal	-1(%rsi), %eax
	movl	%eax, %edx
	movl	%eax, %esi
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%esi
	addl	$2, %edx
	addq	%rcx, %rax
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movl	(%rbx,%rax,4), %eax
	addq	%rcx, %rdi
	addq	%rcx, %rdx
	movl	(%rbx,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, (%rbx,%rdi,4)
	testl	%esi, %esi
	jne	.L148
.L150:
	addq	$12, %r8
	cmpq	%r8, %r10
	jne	.L149
.L143:
	movq	$0, len(%rip)
	jmp	.L137
	.p2align 4,,10
	.p2align 3
.L189:
	movl	sz(%rip), %r9d
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	movl	%r15d, %edx
	movl	%r13d, %esi
	call	getMin
	movl	%eax, %edi
	call	out
	jmp	.L137
.L184:
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	xorl	%ebp, %ebp
	cmpq	%rcx, %rax
	jnb	.L191
	.p2align 4,,10
	.p2align 3
.L108:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L109:
	xorl	%r13d, %r13d
	jmp	.L113
	.p2align 4,,10
	.p2align 3
.L110:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L112
.L111:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L113:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rcx, %rdx
	jb	.L110
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L112
	movq	stdin(%rip), %rdi
	jmp	.L111
	.p2align 4,,10
	.p2align 3
.L112:
	movl	sz(%rip), %eax
	leal	-1(%rbp,%rax), %ecx
	movslq	%ecx, %rax
	movl	%r13d, 2097152(%r12,%rax,4)
	testl	%ecx, %ecx
	jle	.L116
	.p2align 4,,10
	.p2align 3
.L114:
	leal	-1(%rcx), %eax
	movl	%eax, %edx
	movl	%eax, %ecx
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%ecx
	addl	$2, %edx
	movl	2097152(%r12,%rax,4), %eax
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movl	2097152(%r12,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, 2097152(%r12,%rsi,4)
	testl	%ecx, %ecx
	jne	.L114
.L116:
	leal	1(%rbp), %eax
	cmpl	%ebx, %ebp
	je	.L115
	movq	stdin(%rip), %rdi
	movl	%eax, %ebp
	movq	16(%rdi), %rcx
	movq	8(%rdi), %rax
	cmpq	%rcx, %rax
	jb	.L108
.L191:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L109
.L185:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L118
.L187:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L130
.L186:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L124
	.cfi_endproc
.LFE56:
	.size	main, .-main
	.globl	len
	.bss
	.align 8
	.type	len, @object
	.size	len, 8
len:
	.zero	8
	.globl	memo
	.align 32
	.type	memo, @object
	.size	memo, 4800120
memo:
	.zero	4800120
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	seg
	.align 32
	.type	seg, @object
	.size	seg, 4194304
seg:
	.zero	4194304
	.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	in
	.type	in, @function
in:
.LFB51:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L11
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L5:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L7:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L4
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
	.cfi_endproc
.LFE51:
	.size	in, .-in
	.p2align 4
	.globl	out
	.type	out, @function
out:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edi, %edx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	movq	stdout(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	movq	48(%rdi), %rcx
	movq	40(%rdi), %rax
	testl	%edx, %edx
	jne	.L22
	cmpq	%rcx, %rax
	jnb	.L27
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$48, (%rax)
.L15:
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L28
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$10, (%rax)
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	xorl	%ecx, %ecx
	movq	%rsp, %rbx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edx, %rax
	movl	%edx, %esi
	movslq	%ecx, %r8
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	addl	%esi, %esi
	subl	%esi, %edx
	addl	$48, %edx
	movb	%dl, (%rbx,%rcx)
	movl	%eax, %edx
	movq	%rcx, %rax
	addq	$1, %rcx
	testl	%edx, %edx
	jne	.L13
	leaq	-1(%rsp,%r8), %rbp
	addq	%r8, %rbx
	subq	%rax, %rbp
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L30:
	movq	stdout(%rip), %rdi
.L18:
	movzbl	(%rbx), %esi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L29
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%sil, (%rax)
.L17:
	subq	$1, %rbx
	cmpq	%rbx, %rbp
	jne	.L30
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L29:
	call	__overflow@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L27:
	movl	$48, %esi
	call	__overflow@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L28:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	$10, %esi
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	__overflow@PLT
.L26:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	out, .-out
	.p2align 4
	.globl	segInit
	.type	segInit, @function
segInit:
.LFB53:
	.cfi_startproc
	endbr64
	movl	$1, sz(%rip)
	cmpl	$1, %edi
	jle	.L32
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L33:
	addl	%eax, %eax
	cmpl	%edi, %eax
	jl	.L33
	movl	%eax, sz(%rip)
.L32:
	movl	$4194304, %edx
	movl	$2147483647, %esi
	leaq	seg(%rip), %rdi
	jmp	memset@PLT
	.cfi_endproc
.LFE53:
	.size	segInit, .-segInit
	.p2align 4
	.globl	update
	.type	update, @function
update:
.LFB54:
	.cfi_startproc
	endbr64
	movl	sz(%rip), %eax
	movslq	%edi, %rdi
	leaq	seg(%rip), %r8
	salq	$19, %rdi
	leal	-1(%rax,%rsi), %ecx
	movslq	%ecx, %rax
	addq	%rdi, %rax
	movl	%edx, (%r8,%rax,4)
	testl	%ecx, %ecx
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L37:
	leal	-1(%rcx), %eax
	movl	%eax, %edx
	movl	%eax, %ecx
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%ecx
	addl	$2, %edx
	addq	%rdi, %rax
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movl	(%r8,%rax,4), %eax
	addq	%rdi, %rsi
	addq	%rdi, %rdx
	movl	(%r8,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, (%r8,%rsi,4)
	testl	%ecx, %ecx
	jne	.L37
.L35:
	ret
	.cfi_endproc
.LFE54:
	.size	update, .-update
	.p2align 4
	.globl	getMin
	.type	getMin, @function
getMin:
.LFB55:
	.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
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	cmpl	%esi, %r9d
	jle	.L54
	movl	%edx, %r12d
	cmpl	%r8d, %edx
	jle	.L54
	cmpl	%r8d, %esi
	movslq	%edi, %rbp
	movl	%r9d, %ebx
	setle	%al
	cmpl	%edx, %r9d
	setle	%r10b
	testb	%al, %al
	je	.L41
	testb	%r10b, %r10b
	je	.L41
	movslq	%ecx, %rcx
	salq	$19, %rbp
	leaq	seg(%rip), %rax
	addq	%rcx, %rbp
	movl	(%rax,%rbp,4), %r13d
.L39:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r13d, %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
.L41:
	.cfi_restore_state
	addl	%ecx, %ecx
	leal	(%rbx,%r8), %r15d
	leal	2(%rcx), %edi
	sarl	%r15d
	leal	1(%rcx), %edx
	movl	%edi, 8(%rsp)
	cmpl	%r15d, %esi
	jge	.L55
	cmpl	%r15d, %r12d
	movl	%eax, %ecx
	setge	%r11b
	andb	%r11b, %cl
	je	.L43
	movslq	%ebp, %rax
	movslq	%edx, %rdx
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	seg(%rip), %rdx
	movl	(%rdx,%rax,4), %r13d
	cmpl	%r15d, %r12d
	je	.L39
.L45:
	movl	8(%rsp), %eax
	leal	(%rbx,%r15), %r14d
	sarl	%r14d
	addl	%eax, %eax
	leal	1(%rax), %edx
	addl	$2, %eax
	movl	%eax, 8(%rsp)
	cmpl	%r14d, %esi
	jge	.L57
	cmpl	%r14d, %r12d
	jl	.L51
	testb	%cl, %cl
	je	.L51
	movslq	%ebp, %rax
	movslq	%edx, %rdx
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	seg(%rip), %rdx
	movl	(%rdx,%rax,4), %r15d
	cmpl	%r14d, %r12d
	je	.L52
.L53:
	movl	8(%rsp), %r10d
	leal	(%rbx,%r14), %r11d
	movl	%r14d, %r8d
	movl	%r12d, %edx
	sarl	%r11d
	movl	%ebp, %edi
	movl	%esi, 8(%rsp)
	addl	%r10d, %r10d
	movl	%r11d, %r9d
	movl	%r11d, 12(%rsp)
	leal	1(%r10), %ecx
	movl	%r10d, 16(%rsp)
	call	getMin
	movl	16(%rsp), %r10d
	movl	8(%rsp), %esi
	movl	%ebp, %edi
	movl	12(%rsp), %r8d
	movl	%eax, %r14d
	movl	%ebx, %r9d
	movl	%r12d, %edx
	leal	2(%r10), %ecx
	call	getMin
	cmpl	%r14d, %r15d
	cmovle	%r15d, %r14d
	cmpl	%eax, %r14d
	cmovle	%r14d, %eax
	movl	%eax, %r15d
.L52:
	cmpl	%r15d, %r13d
	cmovg	%r15d, %r13d
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L54:
	movl	$2147483647, %r13d
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L43:
	leal	(%r8,%r15), %ecx
	addl	%edx, %edx
	sarl	%ecx
	leal	2(%rdx), %edi
	movl	%ecx, %r14d
	movl	%edi, 12(%rsp)
	leal	1(%rdx), %ecx
	cmpl	%r14d, %esi
	jge	.L56
	cmpl	%r14d, %r12d
	jl	.L47
	testb	%al, %al
	je	.L47
	movslq	%ebp, %rax
	movslq	%ecx, %rcx
	leaq	seg(%rip), %rdx
	salq	$19, %rax
	addq	%rcx, %rax
	movl	(%rdx,%rax,4), %r13d
	cmpl	%r14d, %r12d
	je	.L42
.L49:
	leal	(%r15,%r14), %eax
	movl	%r14d, %r8d
	movl	%r12d, %edx
	movl	%ebp, %edi
	sarl	%eax
	movb	%r10b, 24(%rsp)
	movl	%eax, %r11d
	movl	12(%rsp), %eax
	movl	%esi, 16(%rsp)
	movl	%r11d, %r9d
	movl	%r11d, 20(%rsp)
	addl	%eax, %eax
	leal	1(%rax), %ecx
	movl	%eax, 12(%rsp)
	call	getMin
	movl	16(%rsp), %esi
	movl	20(%rsp), %r8d
	movl	%ebp, %edi
	movl	%eax, %r14d
	movl	12(%rsp), %eax
	movl	%r15d, %r9d
	movl	%r12d, %edx
	movl	%esi, 12(%rsp)
	leal	2(%rax), %ecx
	call	getMin
	cmpl	%r13d, %r14d
	movl	12(%rsp), %esi
	movzbl	24(%rsp), %r10d
	cmovg	%r13d, %r14d
	cmpl	%eax, %r14d
	cmovle	%r14d, %eax
	movl	%eax, %r13d
.L42:
	cmpl	%r15d, %r12d
	jle	.L39
	cmpl	%r15d, %esi
	setle	%al
	movl	%eax, %ecx
	testb	%r10b, %r10b
	je	.L45
	testb	%al, %al
	je	.L45
	movslq	8(%rsp), %rax
	salq	$19, %rbp
	addq	%rax, %rbp
	leaq	seg(%rip), %rax
	movl	(%rax,%rbp,4), %eax
	cmpl	%eax, %r13d
	cmovg	%eax, %r13d
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L55:
	movl	$2147483647, %r13d
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L51:
	leal	(%r15,%r14), %eax
	movl	%r15d, %r8d
	movl	%ebp, %edi
	movb	%r10b, 24(%rsp)
	sarl	%eax
	movl	%esi, 16(%rsp)
	movl	%eax, %r11d
	leal	(%rdx,%rdx), %eax
	movl	%r12d, %edx
	movl	%r11d, %r9d
	leal	1(%rax), %ecx
	movl	%r11d, 20(%rsp)
	movl	%eax, 12(%rsp)
	call	getMin
	movl	16(%rsp), %esi
	movl	20(%rsp), %r8d
	movl	%ebp, %edi
	movl	%eax, %r15d
	movl	12(%rsp), %eax
	movl	%r14d, %r9d
	movl	%r12d, %edx
	movl	%esi, 12(%rsp)
	leal	2(%rax), %ecx
	call	getMin
	movl	12(%rsp), %esi
	movzbl	24(%rsp), %r10d
	cmpl	%eax, %r15d
	cmovg	%eax, %r15d
.L50:
	cmpl	%r14d, %r12d
	jle	.L52
	cmpl	%r14d, %esi
	jg	.L53
	testb	%r10b, %r10b
	je	.L53
	movslq	8(%rsp), %rax
	salq	$19, %rbp
	leaq	seg(%rip), %rdx
	addq	%rbp, %rax
	movl	(%rdx,%rax,4), %eax
	cmpl	%eax, %r15d
	cmovg	%eax, %r15d
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L47:
	leal	(%r8,%r14), %eax
	movl	%r12d, %edx
	movl	%ebp, %edi
	movb	%r10b, 31(%rsp)
	sarl	%eax
	movb	%r11b, 30(%rsp)
	movl	%eax, %r13d
	leal	(%rcx,%rcx), %eax
	movl	%esi, 24(%rsp)
	movl	%r13d, %r9d
	leal	1(%rax), %ecx
	movl	%eax, 16(%rsp)
	call	getMin
	movl	16(%rsp), %edx
	movl	24(%rsp), %esi
	movl	%r13d, %r8d
	movl	%ebp, %edi
	movl	%r14d, %r9d
	movl	%eax, 20(%rsp)
	leal	2(%rdx), %ecx
	movl	%r12d, %edx
	movl	%esi, 16(%rsp)
	call	getMin
	movl	20(%rsp), %edi
	movl	16(%rsp), %esi
	movzbl	30(%rsp), %r11d
	movzbl	31(%rsp), %r10d
	cmpl	%eax, %edi
	movl	%edi, %r13d
	cmovg	%eax, %r13d
.L46:
	cmpl	%r14d, %r12d
	jle	.L42
	cmpl	%r14d, %esi
	jg	.L49
	testb	%r11b, %r11b
	je	.L49
	movslq	12(%rsp), %rdx
	movslq	%ebp, %rax
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	seg(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	cmpl	%eax, %r13d
	cmovg	%eax, %r13d
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L57:
	movl	$2147483647, %r15d
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L56:
	movl	$2147483647, %r13d
	jmp	.L46
	.cfi_endproc
.LFE55:
	.size	getMin, .-getMin
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	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
	leaq	seg(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	in
	movl	%eax, %edi
	movl	%eax, %ebp
	call	segInit
	movq	stdin(%rip), %rdi
	testl	%ebp, %ebp
	jle	.L115
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L183
	.p2align 4,,10
	.p2align 3
.L99:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L100:
	xorl	%r13d, %r13d
	jmp	.L104
	.p2align 4,,10
	.p2align 3
.L101:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L103
.L102:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L104:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rcx, %rdx
	jb	.L101
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	cmpl	$47, %eax
	jg	.L102
	.p2align 4,,10
	.p2align 3
.L103:
	movl	sz(%rip), %eax
	leal	-1(%rbx,%rax), %ecx
	movslq	%ecx, %rax
	movl	%r13d, (%r12,%rax,4)
	testl	%ecx, %ecx
	jle	.L107
	.p2align 4,,10
	.p2align 3
.L105:
	leal	-1(%rcx), %eax
	movl	%eax, %edx
	movl	%eax, %ecx
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%ecx
	addl	$2, %edx
	movl	(%r12,%rax,4), %eax
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movl	(%r12,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, (%r12,%rsi,4)
	testl	%ecx, %ecx
	jne	.L105
.L107:
	leal	1(%rbx), %eax
	cmpl	%eax, %ebp
	je	.L184
	movl	%eax, %ebx
	movq	16(%rdi), %rcx
	movq	8(%rdi), %rax
	cmpq	%rcx, %rax
	jb	.L99
.L183:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L100
.L115:
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	leaq	seg(%rip), %rbx
	call	in
	movl	%eax, %ebp
	testl	%eax, %eax
	je	.L174
	.p2align 4,,10
	.p2align 3
.L151:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rdx
	cmpq	%rdx, %rax
	jnb	.L185
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rax), %eax
.L118:
	xorl	%r14d, %r14d
	jmp	.L122
	.p2align 4,,10
	.p2align 3
.L119:
	leaq	1(%rcx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L121
.L120:
	movq	%rsi, %rcx
.L122:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rdx, %rcx
	jb	.L119
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rdx
	cmpl	$47, %eax
	jg	.L120
	.p2align 4,,10
	.p2align 3
.L121:
	cmpq	%rsi, %rdx
	jbe	.L186
	leaq	1(%rsi), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rsi), %eax
.L124:
	xorl	%r13d, %r13d
	jmp	.L128
	.p2align 4,,10
	.p2align 3
.L125:
	leaq	1(%rcx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L127
.L126:
	movq	%rsi, %rcx
.L128:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rdx, %rcx
	jb	.L125
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rdx
	cmpl	$47, %eax
	jg	.L126
	.p2align 4,,10
	.p2align 3
.L127:
	subl	$1, %r13d
	cmpq	%rsi, %rdx
	jbe	.L187
	leaq	1(%rsi), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rsi), %eax
.L130:
	xorl	%r15d, %r15d
	jmp	.L134
	.p2align 4,,10
	.p2align 3
.L131:
	leaq	1(%rcx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rcx), %eax
	cmpl	$47, %eax
	jle	.L133
.L132:
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
.L134:
	leal	(%r15,%r15,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r15d
	cmpq	%rdx, %rcx
	jb	.L131
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L133
	movq	stdin(%rip), %rdi
	jmp	.L132
	.p2align 4,,10
	.p2align 3
.L133:
	leal	-1(%r14), %esi
	cmpl	$1, %esi
	jbe	.L188
	leal	-3(%r14), %edi
	cmpl	$1, %edi
	jbe	.L189
	movl	%r14d, %ecx
	subl	$5, %ecx
	sete	%r14b
	sete	%r11b
	movslq	%ecx, %rcx
	movzbl	%r14b, %r14d
	testl	%r12d, %r12d
	jne	.L190
	movslq	sz(%rip), %rdx
	movzbl	%r11b, %esi
	salq	$21, %rcx
	movl	$1, %r12d
	salq	$21, %rsi
	leaq	(%rbx,%rcx), %rdi
	salq	$3, %rdx
	leaq	(%rbx,%rsi), %rsi
	call	memcpy@PLT
.L137:
	subl	$1, %ebp
	jne	.L151
.L174:
	addq	$8, %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
.L188:
	.cfi_restore_state
	movl	sz(%rip), %ecx
	movslq	%esi, %rsi
	testl	%r12d, %r12d
	jne	.L175
	subl	$1, %ecx
.L136:
	addl	%r13d, %ecx
	salq	$19, %rsi
	movslq	%ecx, %rax
	addq	%rsi, %rax
	movl	%r15d, (%rbx,%rax,4)
	testl	%ecx, %ecx
	jle	.L137
	.p2align 4,,10
	.p2align 3
.L138:
	leal	-1(%rcx), %eax
	movl	%eax, %edx
	movl	%eax, %ecx
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%ecx
	addl	$2, %edx
	addq	%rsi, %rax
	movslq	%ecx, %rdi
	movslq	%edx, %rdx
	movl	(%rbx,%rax,4), %eax
	addq	%rsi, %rdi
	addq	%rsi, %rdx
	movl	(%rbx,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, (%rbx,%rdi,4)
	testl	%ecx, %ecx
	jne	.L138
	jmp	.L137
	.p2align 4,,10
	.p2align 3
.L175:
	leaq	len(%rip), %rdi
	subl	$1, %ecx
	movd	%r13d, %xmm0
	movslq	(%rdi,%rsi,4), %rax
	leaq	memo(%rip), %r11
	leal	1(%rax), %edx
	movl	%edx, (%rdi,%rsi,4)
	leaq	(%rax,%rax,2), %rdx
	imulq	$2400060, %rsi, %rax
	leaq	(%rax,%rdx,4), %rdi
	leal	(%rcx,%r13), %edx
	movq	%rsi, %rax
	movslq	%edx, %rdx
	salq	$19, %rax
	movl	%r15d, 8(%r11,%rdi)
	addq	%rdx, %rax
	movl	(%rbx,%rax,4), %eax
	movd	%eax, %xmm1
	punpckldq	%xmm1, %xmm0
	movq	%xmm0, (%r11,%rdi)
	jmp	.L136
	.p2align 4,,10
	.p2align 3
.L190:
	leaq	len(%rip), %rax
	movslq	(%rax,%rcx,4), %rax
	movl	%eax, %r10d
	subl	$1, %r10d
	js	.L146
	imulq	$2400060, %rcx, %rdx
	leaq	(%rax,%rax,2), %rax
	movl	sz(%rip), %edi
	movq	%rcx, %r8
	salq	$19, %r8
	leal	-1(%rdi), %r13d
	leaq	(%rdx,%rax,4), %r9
	leaq	memo(%rip), %rax
	addq	%rax, %r9
	.p2align 4,,10
	.p2align 3
.L145:
	movl	-12(%r9), %esi
	movl	-8(%r9), %edx
	addl	%r13d, %esi
	movslq	%esi, %rax
	addq	%r8, %rax
	movl	%edx, (%rbx,%rax,4)
	testl	%esi, %esi
	jle	.L147
	.p2align 4,,10
	.p2align 3
.L144:
	leal	-1(%rsi), %eax
	movl	%eax, %edx
	movl	%eax, %esi
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%esi
	addl	$2, %edx
	addq	%r8, %rax
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movl	(%rbx,%rax,4), %eax
	addq	%r8, %rdi
	addq	%r8, %rdx
	movl	(%rbx,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, (%rbx,%rdi,4)
	testl	%esi, %esi
	jne	.L144
.L147:
	subl	$1, %r10d
	subq	$12, %r9
	cmpl	$-1, %r10d
	jne	.L145
.L146:
	leaq	len(%rip), %rax
	movl	(%rax,%r14,4), %esi
	testl	%esi, %esi
	jle	.L143
	movl	sz(%rip), %eax
	leaq	memo(%rip), %rdi
	salq	$19, %rcx
	leaq	12(%rdi), %rdx
	leal	-1(%rax), %r9d
	movzbl	%r11b, %eax
	imulq	$2400060, %rax, %rax
	leaq	(%rax,%rdi), %r8
	addq	%rdx, %rax
	leal	-1(%rsi), %edx
	leaq	(%rdx,%rdx,2), %rdx
	leaq	(%rax,%rdx,4), %r10
	.p2align 4,,10
	.p2align 3
.L149:
	movl	(%r8), %esi
	movl	8(%r8), %edx
	addl	%r9d, %esi
	movslq	%esi, %rax
	addq	%rcx, %rax
	movl	%edx, (%rbx,%rax,4)
	testl	%esi, %esi
	jle	.L150
	.p2align 4,,10
	.p2align 3
.L148:
	leal	-1(%rsi), %eax
	movl	%eax, %edx
	movl	%eax, %esi
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%esi
	addl	$2, %edx
	addq	%rcx, %rax
	movslq	%esi, %rdi
	movslq	%edx, %rdx
	movl	(%rbx,%rax,4), %eax
	addq	%rcx, %rdi
	addq	%rcx, %rdx
	movl	(%rbx,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, (%rbx,%rdi,4)
	testl	%esi, %esi
	jne	.L148
.L150:
	addq	$12, %r8
	cmpq	%r8, %r10
	jne	.L149
.L143:
	movq	$0, len(%rip)
	jmp	.L137
	.p2align 4,,10
	.p2align 3
.L189:
	movl	sz(%rip), %r9d
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	movl	%r15d, %edx
	movl	%r13d, %esi
	call	getMin
	movl	%eax, %edi
	call	out
	jmp	.L137
.L184:
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	xorl	%ebp, %ebp
	cmpq	%rcx, %rax
	jnb	.L191
	.p2align 4,,10
	.p2align 3
.L108:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L109:
	xorl	%r13d, %r13d
	jmp	.L113
	.p2align 4,,10
	.p2align 3
.L110:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L112
.L111:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L113:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rcx, %rdx
	jb	.L110
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L112
	movq	stdin(%rip), %rdi
	jmp	.L111
	.p2align 4,,10
	.p2align 3
.L112:
	movl	sz(%rip), %eax
	leal	-1(%rbp,%rax), %ecx
	movslq	%ecx, %rax
	movl	%r13d, 2097152(%r12,%rax,4)
	testl	%ecx, %ecx
	jle	.L116
	.p2align 4,,10
	.p2align 3
.L114:
	leal	-1(%rcx), %eax
	movl	%eax, %edx
	movl	%eax, %ecx
	orl	$1, %eax
	andl	$-2, %edx
	cltq
	sarl	%ecx
	addl	$2, %edx
	movl	2097152(%r12,%rax,4), %eax
	movslq	%ecx, %rsi
	movslq	%edx, %rdx
	movl	2097152(%r12,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, 2097152(%r12,%rsi,4)
	testl	%ecx, %ecx
	jne	.L114
.L116:
	leal	1(%rbp), %eax
	cmpl	%ebx, %ebp
	je	.L115
	movq	stdin(%rip), %rdi
	movl	%eax, %ebp
	movq	16(%rdi), %rcx
	movq	8(%rdi), %rax
	cmpq	%rcx, %rax
	jb	.L108
.L191:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L109
.L185:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L118
.L187:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L130
.L186:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	jmp	.L124
	.cfi_endproc
.LFE56:
	.size	main, .-main
	.globl	len
	.bss
	.align 8
	.type	len, @object
	.size	len, 8
len:
	.zero	8
	.globl	memo
	.align 32
	.type	memo, @object
	.size	memo, 4800120
memo:
	.zero	4800120
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.globl	seg
	.align 32
	.type	seg, @object
	.size	seg, 4194304
seg:
	.zero	4194304
	.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:

// AOJ 3024 RMQ 2
// 2019.4.2 bal4u

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

#define INF 0x7fffffff

#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
int in()
{
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void out(int n)
{
	int i;
	char ob[30];

	if (!n) pc('0');
	else {
		i = 0; while (n) ob[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(ob[i]);
	}
	pc('\n');
}


//// セグメント木
int seg[2][1 << 19]; int sz;

void segInit(int n) {
	sz = 1; while (sz < n) sz <<= 1;
	memset(seg, INF, sizeof(seg));
}

// k番目（0-index）の値を v に変更
void update(int id, int k, int v)
{
	int a, b;

	k += sz - 1;
//	if (seg[id][k] == v) return;
	seg[id][k] = v;
	while (k > 0) {
		k = (k - 1) >> 1;
		a = seg[id][(k << 1) + 1];
		b = seg[id][(k << 1) + 2];
		seg[id][k] = (a <= b)? a: b;
	}
}

// 空間 [a, b) 内の最小値
int getMin(int id, int a, int b, int k, int l, int r)
{
	int left, right;

	if (r <= a || b <= l) return INF;
	if (a <= l && r <= b) return seg[id][k];
	left = getMin(id, a, b, (k << 1) + 1, l, (l + r) >> 1);
	right = getMin(id, a, b, (k << 1) + 2, (l + r) >> 1, r);
	return left <= right ? left : right;
}


//// 本問題
typedef struct { int y, p, n; } T;  // 位置と更新前後の値
T memo[2][200005]; int len[2];

int main()
{
	int i, k, N, Q, x, y, z;
	int syn;

	N = in();
	segInit(N);            // セグメント木の初期化
	for (i = 0; i < N; i++) update(0, i, in());
	for (i = 0; i < N; i++) update(1, i, in());

	Q = in(), syn = 0;
	while (Q--) {
		x = in(), y = in()-1, z = in();      // 0-index
		if (x == 1 || x == 2) {
			x--;   // 0と1にする. 0->A, 1->B
			if (syn) {
				// 位置と更新前後の値を記録
				k = len[x]++;
				memo[x][k].y = y, memo[x][k].n = z;
				memo[x][k].p = seg[x][y+(sz-1)];     // 元の値は y+(sz-1) の位置にある
			}
			update(x, y, z);
		}
		else if (x == 3 || x == 4) out(getMin(x-3, y, z, 0, 0, sz));
		else {
			x -= 5;   // 0と1にする. 0->A, 1->B
			if (syn) {
				// 元に戻して、相手のしてきた変更を施し、相手と同じにする
				for (i = len[x] - 1; i >= 0; i--)   // 戻す作業
					update(x, memo[x][i].y, memo[x][i].p);
				for (i = 0; i < len[!x]; i++)       // 相手に同期
					update(x, memo[!x][i].y, memo[!x][i].n);
				len[0] = len[1] = 0;
			}
			else {
				memcpy(seg[x], seg[!x], sizeof(int)*sz*2);
				syn = 1;
			}
		}
	}
	return 0;
}


5
1 3 5 7 9
6 2 3 2 6
10
1 3 4
3 4 5
4 2 3
5 -1 -1
2 3 8
3 2 5
4 3 3
2 1 1
6 -1 -1
3 1 5
 5
1 3 5 7 9
6 2 3 2 6
10
1 3 4
3 4 5
4 2 3
5 -1 -1
2 3 16
3 2 5
4 3 3
1 1 1
6 -1 -1
3 1 5
 5
1 3 5 7 9
6 2 3 2 6
10
1 3 6
3 4 5
4 2 3
5 -1 -1
2 3 8
6 2 5
4 3 3
2 1 1
6 -1 -1
3 1 5
 5
1 3 5 7 9
6 2 4 2 6
10
1 3 4
3 4 5
4 2 3
5 -1 -1
2 3 8
3 2 5
4 3 3
1 1 1
6 -1 -1
3 1 5
 5
1 3 5 7 9
6 2 3 2 6
10
1 3 4
3 4 5
4 2 3
5 -1 -1
2 3 8
2 2 5
4 3 3
2 1 1
6 -1 -1
3 1 5
 5
1 3 5 7 9
6 2 3 2 6
6
1 3 6
3 4 5
4 2 3
5 -1 -1
2 3 8
3 2 5
4 3 3
2 1 1
6 -1 -1
3 1 5
 5
1 3 5 7 9
6 2 3 2 6
10
1 5 6
3 4 5
4 2 3
5 -1 -1
2 3 8
6 2 1
4 3 3
2 1 1
6 -1 0
3 1 5
 5
1 3 5 7 9
6 2 3 2 6
10
1 3 4
3 4 5
4 2 3
5 -1 -1
2 3 16
3 2 5
4 2 3
1 1 1
6 -1 -1
3 1 5
 5
1 3 5 7 1
6 2 3 2 6
10
1 3 6
3 4 5
4 2 3
5 -1 -1
2 3 8
6 2 5
4 3 3
2 1 1
6 -1 -1
3 1 5
 5
1 3 5 0 9
6 2 3 2 6
10
1 3 6
3 4 5
4 2 3
5 -1 -1
2 3 8
6 2 5
4 3 3
2 1 1
6 -1 0
3 1 5

7
2
2
8
2
 7
2
2
16
1
 7
2
3
2
 7
2
2
8
1
 7
2
8
2
 7
2
2
 6
2
3
2
 7
2
2
2
1
 1
2
3
2
 0
2
3
2

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

```c
// AOJ 3024 RMQ 2
// 2019.4.2 bal4u

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

#define INF 0x7fffffff

#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif
int in()
{
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void out(int n)
{
	int i;
	char ob[30];

	if (!n) pc('0');
	else {
		i = 0; while (n) ob[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(ob[i]);
	}
	pc('\n');
}


//// セグメント木
int seg[2][1 << 19]; int sz;

void segInit(int n) {
	sz = 1; while (sz < n) sz <<= 1;
	memset(seg, INF, sizeof(seg));
}

// k番目（0-index）の値を v に変更
void update(int id, int k, int v)
{
	int a, b;

	k += sz - 1;
//	if (seg[id][k] == v) return;
	seg[id][k] = v;
	while (k > 0) {
		k = (k - 1) >> 1;
		a = seg[id][(k << 1) + 1];
		b = seg[id][(k << 1) + 2];
		seg[id][k] = (a <= b)? a: b;
	}
}

// 空間 [a, b) 内の最小値
int getMin(int id, int a, int b, int k, int l, int r)
{
	int left, right;

	if (r <= a || b <= l) return INF;
	if (a <= l && r <= b) return seg[id][k];
	left = getMin(id, a, b, (k << 1) + 1, l, (l + r) >> 1);
	right = getMin(id, a, b, (k << 1) + 2, (l + r) >> 1, r);
	return left <= right ? left : right;
}


//// 本問題
typedef struct { int y, p, n; } T;  // 位置と更新前後の値
T memo[2][200005]; int len[2];

int main()
{
	int i, k, N, Q, x, y, z;
	int syn;

	N = in();
	segInit(N);            // セグメント木の初期化
	for (i = 0; i < N; i++) update(0, i, in());
	for (i = 0; i < N; i++) update(1, i, in());

	Q = in(), syn = 0;
	while (Q--) {
		x = in(), y = in()-1, z = in();      // 0-index
		if (x == 1 || x == 2) {
			x--;   // 0と1にする. 0->A, 1->B
			if (syn) {
				// 位置と更新前後の値を記録
				k = len[x]++;
				memo[x][k].y = y, memo[x][k].n = z;
				memo[x][k].p = seg[x][y+(sz-1)];     // 元の値は y+(sz-1) の位置にある
			}
			update(x, y, z);
		}
		else if (x == 3 || x == 4) out(getMin(x-3, y, z, 0, 0, sz));
		else {
			x -= 5;   // 0と1にする. 0->A, 1->B
			if (syn) {
				// 元に戻して、相手のしてきた変更を施し、相手と同じにする
				for (i = len[x] - 1; i >= 0; i--)   // 戻す作業
					update(x, memo[x][i].y, memo[x][i].p);
				for (i = 0; i < len[!x]; i++)       // 相手に同期
					update(x, memo[!x][i].y, memo[!x][i].n);
				len[0] = len[1] = 0;
			}
			else {
				memcpy(seg[x], seg[!x], sizeof(int)*sz*2);
				syn = 1;
			}
		}
	}
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.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
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	out
	.type	out, @function
out:
.LFB7:
	.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
	movl	%edi, -68(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	cmpl	$0, -68(%rbp)
	jne	.L5
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L6
.L5:
	movl	$0, -52(%rbp)
	jmp	.L7
.L8:
	movl	-68(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %ecx
	movl	-52(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -52(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -48(%rbp,%rax)
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
.L7:
	cmpl	$0, -68(%rbp)
	jne	.L8
	jmp	.L9
.L10:
	movl	-52(%rbp), %eax
	cltq
	movzbl	-48(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L9:
	movl	-52(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -52(%rbp)
	testl	%eax, %eax
	jne	.L10
.L6:
	movl	$10, %edi
	call	putchar_unlocked@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	out, .-out
	.globl	seg
	.bss
	.align 32
	.type	seg, @object
	.size	seg, 4194304
seg:
	.zero	4194304
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.text
	.globl	segInit
	.type	segInit, @function
segInit:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	$1, sz(%rip)
	jmp	.L13
.L14:
	movl	sz(%rip), %eax
	addl	%eax, %eax
	movl	%eax, sz(%rip)
.L13:
	movl	sz(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L14
	movl	$4194304, %edx
	movl	$2147483647, %esi
	leaq	seg(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	segInit, .-segInit
	.globl	update
	.type	update, @function
update:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	sz(%rip), %eax
	subl	$1, %eax
	addl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	seg(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L16
.L17:
	movl	-24(%rbp), %eax
	subl	$1, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	salq	$19, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	seg(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L16:
	cmpl	$0, -24(%rbp)
	jg	.L17
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	update, .-update
	.globl	getMin
	.type	getMin, @function
getMin:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	%r9d, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L19
	movl	-28(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L20
.L19:
	movl	$2147483647, %eax
	jmp	.L21
.L20:
	movl	-24(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L22
	movl	-40(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L22
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L21
.L22:
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %r8d
	movl	-32(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %ecx
	movl	-36(%rbp), %edi
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%r8d, %r9d
	movl	%edi, %r8d
	movl	%eax, %edi
	call	getMin
	movl	%eax, -8(%rbp)
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %r8d
	movl	-32(%rbp), %eax
	addl	%eax, %eax
	leal	2(%rax), %ecx
	movl	-40(%rbp), %edi
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%edi, %r9d
	movl	%eax, %edi
	call	getMin
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	getMin, .-getMin
	.globl	memo
	.bss
	.align 32
	.type	memo, @object
	.size	memo, 4800120
memo:
	.zero	4800120
	.globl	len
	.align 8
	.type	len, @object
	.size	len, 8
len:
	.zero	8
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.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	$0, %eax
	call	in
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	segInit
	movl	$0, -32(%rbp)
	jmp	.L24
.L25:
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	update
	addl	$1, -32(%rbp)
.L24:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L25
	movl	$0, -32(%rbp)
	jmp	.L26
.L27:
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	movl	$1, %edi
	call	update
	addl	$1, -32(%rbp)
.L26:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L27
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L28
.L39:
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	cmpl	$1, -16(%rbp)
	je	.L29
	cmpl	$2, -16(%rbp)
	jne	.L30
.L29:
	subl	$1, -16(%rbp)
	cmpl	$0, -24(%rbp)
	je	.L31
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	len(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	memo(%rip), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	8+memo(%rip), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	movl	sz(%rip), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$2400060, %rsi, %rcx
	addq	%rax, %rcx
	leaq	4+memo(%rip), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
.L31:
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %ecx
	movl	-16(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	update
	jmp	.L28
.L30:
	cmpl	$3, -16(%rbp)
	je	.L32
	cmpl	$4, -16(%rbp)
	jne	.L33
.L32:
	movl	sz(%rip), %ecx
	movl	-16(%rbp), %eax
	leal	-3(%rax), %edi
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%ecx, %r9d
	movl	$0, %r8d
	movl	$0, %ecx
	movl	%eax, %esi
	call	getMin
	movl	%eax, %edi
	call	out
	jmp	.L28
.L33:
	subl	$5, -16(%rbp)
	cmpl	$0, -24(%rbp)
	je	.L34
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	jmp	.L35
.L36:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	4+memo(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$2400060, %rsi, %rcx
	addq	%rax, %rcx
	leaq	memo(%rip), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-16(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	update
	subl	$1, -32(%rbp)
.L35:
	cmpl	$0, -32(%rbp)
	jns	.L36
	movl	$0, -32(%rbp)
	jmp	.L37
.L38:
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	8+memo(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	-32(%rbp), %ecx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$2400060, %rsi, %rcx
	addq	%rax, %rcx
	leaq	memo(%rip), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-16(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	update
	addl	$1, -32(%rbp)
.L37:
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L38
	movl	$0, 4+len(%rip)
	movl	4+len(%rip), %eax
	movl	%eax, len(%rip)
	jmp	.L28
.L34:
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	cltq
	salq	$21, %rax
	movq	%rax, %rcx
	leaq	seg(%rip), %rax
	addq	%rax, %rcx
	movl	-16(%rbp), %eax
	cltq
	salq	$21, %rax
	movq	%rax, %rsi
	leaq	seg(%rip), %rax
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	$1, -24(%rbp)
.L28:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -28(%rbp)
	testl	%eax, %eax
	jne	.L39
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	in
	.type	in, @function
in:
.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
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	out
	.type	out, @function
out:
.LFB7:
	.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
	movl	%edi, -68(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	cmpl	$0, -68(%rbp)
	jne	.L5
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L6
.L5:
	movl	$0, -52(%rbp)
	jmp	.L7
.L8:
	movl	-68(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %ecx
	movl	-52(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -52(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -48(%rbp,%rax)
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
.L7:
	cmpl	$0, -68(%rbp)
	jne	.L8
	jmp	.L9
.L10:
	movl	-52(%rbp), %eax
	cltq
	movzbl	-48(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L9:
	movl	-52(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -52(%rbp)
	testl	%eax, %eax
	jne	.L10
.L6:
	movl	$10, %edi
	call	putchar_unlocked@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	out, .-out
	.globl	seg
	.bss
	.align 32
	.type	seg, @object
	.size	seg, 4194304
seg:
	.zero	4194304
	.globl	sz
	.align 4
	.type	sz, @object
	.size	sz, 4
sz:
	.zero	4
	.text
	.globl	segInit
	.type	segInit, @function
segInit:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	$1, sz(%rip)
	jmp	.L13
.L14:
	movl	sz(%rip), %eax
	addl	%eax, %eax
	movl	%eax, sz(%rip)
.L13:
	movl	sz(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jg	.L14
	movl	$4194304, %edx
	movl	$2147483647, %esi
	leaq	seg(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	segInit, .-segInit
	.globl	update
	.type	update, @function
update:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	sz(%rip), %eax
	subl	$1, %eax
	addl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	seg(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	jmp	.L16
.L17:
	movl	-24(%rbp), %eax
	subl	$1, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	salq	$19, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	seg(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L16:
	cmpl	$0, -24(%rbp)
	jg	.L17
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	update, .-update
	.globl	getMin
	.type	getMin, @function
getMin:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	%r8d, -36(%rbp)
	movl	%r9d, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L19
	movl	-28(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L20
.L19:
	movl	$2147483647, %eax
	jmp	.L21
.L20:
	movl	-24(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jg	.L22
	movl	-40(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L22
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L21
.L22:
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %r8d
	movl	-32(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %ecx
	movl	-36(%rbp), %edi
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%r8d, %r9d
	movl	%edi, %r8d
	movl	%eax, %edi
	call	getMin
	movl	%eax, -8(%rbp)
	movl	-36(%rbp), %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %r8d
	movl	-32(%rbp), %eax
	addl	%eax, %eax
	leal	2(%rax), %ecx
	movl	-40(%rbp), %edi
	movl	-28(%rbp), %edx
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %eax
	movl	%edi, %r9d
	movl	%eax, %edi
	call	getMin
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	getMin, .-getMin
	.globl	memo
	.bss
	.align 32
	.type	memo, @object
	.size	memo, 4800120
memo:
	.zero	4800120
	.globl	len
	.align 8
	.type	len, @object
	.size	len, 8
len:
	.zero	8
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.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	$0, %eax
	call	in
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	segInit
	movl	$0, -32(%rbp)
	jmp	.L24
.L25:
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	update
	addl	$1, -32(%rbp)
.L24:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L25
	movl	$0, -32(%rbp)
	jmp	.L26
.L27:
	movl	$0, %eax
	call	in
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movl	%eax, %esi
	movl	$1, %edi
	call	update
	addl	$1, -32(%rbp)
.L26:
	movl	-32(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L27
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L28
.L39:
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	cmpl	$1, -16(%rbp)
	je	.L29
	cmpl	$2, -16(%rbp)
	jne	.L30
.L29:
	subl	$1, -16(%rbp)
	cmpl	$0, -24(%rbp)
	je	.L31
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %edx
	movl	-16(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	len(%rip), %rcx
	movl	%edx, (%rsi,%rcx)
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	memo(%rip), %rax
	addq	%rax, %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	8+memo(%rip), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	movl	sz(%rip), %eax
	leal	-1(%rax), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	salq	$19, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	seg(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$2400060, %rsi, %rcx
	addq	%rax, %rcx
	leaq	4+memo(%rip), %rax
	addq	%rcx, %rax
	movl	%edx, (%rax)
.L31:
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %ecx
	movl	-16(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	update
	jmp	.L28
.L30:
	cmpl	$3, -16(%rbp)
	je	.L32
	cmpl	$4, -16(%rbp)
	jne	.L33
.L32:
	movl	sz(%rip), %ecx
	movl	-16(%rbp), %eax
	leal	-3(%rax), %edi
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%ecx, %r9d
	movl	$0, %r8d
	movl	$0, %ecx
	movl	%eax, %esi
	call	getMin
	movl	%eax, %edi
	call	out
	jmp	.L28
.L33:
	subl	$5, -16(%rbp)
	cmpl	$0, -24(%rbp)
	je	.L34
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	jmp	.L35
.L36:
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	4+memo(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$2400060, %rsi, %rcx
	addq	%rax, %rcx
	leaq	memo(%rip), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-16(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	update
	subl	$1, -32(%rbp)
.L35:
	cmpl	$0, -32(%rbp)
	jns	.L36
	movl	$0, -32(%rbp)
	jmp	.L37
.L38:
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	movslq	%eax, %rcx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	imulq	$2400060, %rcx, %rdx
	addq	%rax, %rdx
	leaq	8+memo(%rip), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	movl	-32(%rbp), %ecx
	movslq	%ecx, %rcx
	movslq	%eax, %rsi
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$2, %rax
	imulq	$2400060, %rsi, %rcx
	addq	%rax, %rcx
	leaq	memo(%rip), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-16(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	update
	addl	$1, -32(%rbp)
.L37:
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	len(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L38
	movl	$0, 4+len(%rip)
	movl	4+len(%rip), %eax
	movl	%eax, len(%rip)
	jmp	.L28
.L34:
	movl	sz(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	cmpl	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	cltq
	salq	$21, %rax
	movq	%rax, %rcx
	leaq	seg(%rip), %rax
	addq	%rax, %rcx
	movl	-16(%rbp), %eax
	cltq
	salq	$21, %rax
	movq	%rax, %rsi
	leaq	seg(%rip), %rax
	addq	%rsi, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	$1, -24(%rbp)
.L28:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -28(%rbp)
	testl	%eax, %eax
	jne	.L39
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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:
