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>

typedef struct DATA Data;
struct DATA{
	int time;	//?????????
	int pc;	//PC????????????
	int student;	//??????????????????
	int s;	//?????°????????????1, ?????°??¢????????????0???
};

int main(int argc, char *argv){
	while( Main() == 0 );
	return 0;
}

int Main(){
	int N = 0, M = 0, r = 0, q = 0, ts = 0, te = 0, m = 0, time = 0, bt = 0, pcount = 0, i = 0, j = 0;	//PC?????°??°???????????°????????¨?¨??????°???????????°????????????????§???¨????????????????????????????????????????????????????????¨???????????????????????°??????????????????(??¬????????????????????°???????????????????????????-1)????????°??????????????????PC?????°??°???
	if( scanf("%d %d", &N, &M) != 2 ){ return -1; }
	if( N == 0 || M == 0 ){ return 1; }
	if( scanf("%d", &r) != 1 ){ return -1; }
	char pt[N];
	for( i = 0; i < N; i++ ){ pt[i] = 0; }
	Data data[r];
	//?????¨?¨?????????\??????
	for( i = 0; i < r; i++ ){
		if( scanf("%d %d %d %d", &data[i].time, &data[i].pc, &data[i].student, &data[i].s) != 4 ){ return -1; }
	}
	if( scanf("%d", &q) != 1 ){ return -1; }
	//???????????\?????¨?????????
	for( i = 0; i < q; i++ ){
		//????????????
		time = 0;
		bt = -1;
		pcount = 0;
		for( j = 0; j < N; j++ ){ pt[j] = 0; }
		//???????????\??????
		if( scanf("%d %d %d", &ts, &te, &m) != 3 ){ return -1; }
		//?????¨?¨??????¨?????§??????
		for( j = 0; j < r; j++ ){
			//????±??????\????????????????????????
			if( data[j].student != m ){ continue; }
			//?????°???????????????????????????
			if( data[j].s == 1 ){
				pcount++;
				//??¢?????????PC??§?????°?????????????????????????????????
				if( pcount > 1 ){ continue; }
				//??¬???????§??????????bt?????¬???????§?????????????????????????????§?????????????????????????
				if( data[j].time < ts ){
					bt = ts;
				}else if( data[j].time < te ){
					bt = data[j].time;
				}else{
					bt = -1;
//					j = r;	//??¬????????????????????°??????????????????????????§????????¨?¨?????????§?????????????????????
				}
			}
			//?????°??¢??????????????¨???????????????
			if( data[j].s == 0 ){
				pcount--;
				if( pcount > 0 ){ continue; }
				if( bt == -1 ){ continue; }	//?????????????????°????????????????????????
				//??¬???????§?????????????????????????????????¬?????????????????????????????¬????????????????????¬????????????????????§????????????????????????
				if( data[j].time >= te ){
					time += te - bt;
					bt = -1;
					break;	//????????\???????????¨?¨???????????±????????????¨???????????±?????????????????????
				}else if( data[j].time > ts ){
					time += data[j].time - bt;
					bt = -1;
				}else{
					bt = -1;
				}
			}
		}
		printf("%d\n", time);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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)
	movq	%rsi, -16(%rbp)
	nop
.L2:
	movl	$0, %eax
	call	Main
	testl	%eax, %eax
	je	.L2
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"%d %d %d"
.LC4:
	.string	"%d\n"
	.text
	.globl	Main
	.type	Main, @function
Main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$0, -128(%rbp)
	movl	$0, -124(%rbp)
	movl	$0, -120(%rbp)
	movl	$0, -116(%rbp)
	movl	$0, -112(%rbp)
	movl	$0, -108(%rbp)
	movl	$0, -104(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -92(%rbp)
	leaq	-132(%rbp), %rdx
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L5
	movl	$-1, %eax
	jmp	.L6
.L5:
	movl	-136(%rbp), %eax
	testl	%eax, %eax
	je	.L7
	movl	-132(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
.L7:
	movl	$1, %eax
	jmp	.L6
.L8:
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L9
	movl	$-1, %eax
	jmp	.L6
.L9:
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L13
.L14:
	movq	-80(%rbp), %rdx
	movl	-96(%rbp), %eax
	cltq
	movb	$0, (%rdx,%rax)
	addl	$1, -96(%rbp)
.L13:
	movl	-136(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L14
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L18
.L20:
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	leaq	12(%rax), %rsi
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rcx
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	movq	-64(%rbp), %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$4, %eax
	je	.L19
	movl	$-1, %eax
	jmp	.L6
.L19:
	addl	$1, -96(%rbp)
.L18:
	movl	-128(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L20
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L21
	movl	$-1, %eax
	jmp	.L6
.L21:
	movl	$0, -96(%rbp)
	jmp	.L22
.L39:
	movl	$0, -108(%rbp)
	movl	$-1, -104(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L23
.L24:
	movq	-80(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	movb	$0, (%rdx,%rax)
	addl	$1, -92(%rbp)
.L23:
	movl	-136(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L24
	leaq	-112(%rbp), %rcx
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L25
	movl	$-1, %eax
	jmp	.L6
.L25:
	movl	$0, -92(%rbp)
	jmp	.L26
.L38:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	addq	$8, %rax
	movl	(%rax), %edx
	movl	-112(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L42
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	addq	$12, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L29
	addl	$1, -100(%rbp)
	cmpl	$1, -100(%rbp)
	jg	.L43
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-120(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L31
	movl	-120(%rbp), %eax
	movl	%eax, -104(%rbp)
	jmp	.L29
.L31:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L32
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -104(%rbp)
	jmp	.L29
.L32:
	movl	$-1, -104(%rbp)
.L29:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	addq	$12, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L28
	subl	$1, -100(%rbp)
	cmpl	$0, -100(%rbp)
	jg	.L44
	cmpl	$-1, -104(%rbp)
	je	.L45
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L35
	movl	-116(%rbp), %eax
	subl	-104(%rbp), %eax
	addl	%eax, -108(%rbp)
	movl	$-1, -104(%rbp)
	jmp	.L36
.L35:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-120(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L37
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	subl	-104(%rbp), %eax
	addl	%eax, -108(%rbp)
	movl	$-1, -104(%rbp)
	jmp	.L28
.L37:
	movl	$-1, -104(%rbp)
	jmp	.L28
.L42:
	nop
	jmp	.L28
.L43:
	nop
	jmp	.L28
.L44:
	nop
	jmp	.L28
.L45:
	nop
.L28:
	addl	$1, -92(%rbp)
.L26:
	movl	-128(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L38
.L36:
	movl	-108(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -96(%rbp)
.L22:
	movl	-124(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L39
	movl	$0, %eax
.L6:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"%d %d %d"
.LC4:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	Main
	.type	Main, @function
Main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-80(%rbp), %rdx
	leaq	-84(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movl	$0, -84(%rbp)
	movl	$0, -80(%rbp)
	movl	$0, -76(%rbp)
	movl	$0, -72(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	movl	$0, -60(%rbp)
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L2
	movl	-84(%rbp), %ecx
	movl	$1, %eax
	testl	%ecx, %ecx
	je	.L1
	movl	-80(%rbp), %edx
	testl	%edx, %edx
	jne	.L48
	.p2align 4,,10
	.p2align 3
.L1:
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	jne	.L49
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	leaq	.LC1(%rip), %r14
	xorl	%eax, %eax
	leaq	-76(%rbp), %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L2
	movslq	-84(%rbp), %rdx
	movq	%rsp, %rdi
	leaq	15(%rdx), %rax
	movq	%rdx, %rcx
	movq	%rax, %rsi
	andq	$-4096, %rax
	subq	%rax, %rdi
	andq	$-16, %rsi
	cmpq	%rdi, %rsp
	je	.L5
.L50:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L50
.L5:
	andl	$4095, %esi
	subq	%rsi, %rsp
	testq	%rsi, %rsi
	je	.L6
	orq	$0, -8(%rsp,%rsi)
.L6:
	movq	%rsp, -104(%rbp)
	testl	%ecx, %ecx
	jle	.L13
	xorl	%esi, %esi
	movq	%rsp, %rdi
	call	memset@PLT
.L13:
	movslq	-76(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %rdx
	salq	$4, %rax
	movq	%rax, %rsi
	andq	$-4096, %rsi
	subq	%rsi, %rcx
	cmpq	%rcx, %rsp
	je	.L9
.L51:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L51
.L9:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L10
	orq	$0, -8(%rsp,%rax)
.L10:
	movq	%rsp, %r12
	xorl	%r15d, %r15d
	leaq	.LC2(%rip), %r13
	movq	%r12, %rbx
	testl	%edx, %edx
	jg	.L15
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L52:
	addl	$1, %r15d
	addq	$16, %rbx
	cmpl	%r15d, -76(%rbp)
	jle	.L12
.L15:
	xorl	%eax, %eax
	leaq	8(%rbx), %rcx
	leaq	4(%rbx), %rdx
	movq	%rbx, %rsi
	leaq	12(%rbx), %r8
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$4, %eax
	je	.L52
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$-1, %eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%eax, %eax
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L2
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jle	.L22
	xorl	%ebx, %ebx
	leaq	-60(%rbp), %r15
	leaq	-64(%rbp), %r14
	leaq	-68(%rbp), %r13
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	-84(%rbp), %rdx
	testl	%edx, %edx
	jle	.L24
	movq	-104(%rbp), %rdi
	xorl	%esi, %esi
	call	memset@PLT
.L24:
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L2
	movl	-76(%rbp), %edx
	testl	%edx, %edx
	jle	.L29
	salq	$4, %rdx
	movl	-60(%rbp), %edi
	movl	-64(%rbp), %r11d
	movq	%r12, %rax
	movl	-68(%rbp), %r9d
	addq	%r12, %rdx
	xorl	%esi, %esi
	movl	$-1, %r8d
	xorl	%r10d, %r10d
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	testl	%ecx, %ecx
	jne	.L18
	subl	$1, %esi
	testl	%esi, %esi
	jg	.L18
	cmpl	$-1, %r8d
	je	.L18
	movl	(%rax), %ecx
	cmpl	%r11d, %ecx
	jge	.L53
	cmpl	%r9d, %ecx
	jle	.L31
	subl	%r8d, %ecx
	movl	$-1, %r8d
	addl	%ecx, %r10d
	.p2align 4,,10
	.p2align 3
.L18:
	addq	$16, %rax
	cmpq	%rax, %rdx
	je	.L17
.L21:
	cmpl	%edi, 8(%rax)
	jne	.L18
	movl	12(%rax), %ecx
	cmpl	$1, %ecx
	jne	.L19
	addl	$1, %esi
	cmpl	$1, %esi
	jg	.L18
	movl	(%rax), %r8d
	cmpl	%r9d, %r8d
	jl	.L30
	cmpl	%r11d, %r8d
	movl	$-1, %ecx
	cmovge	%ecx, %r8d
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L21
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%r10d, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	addl	$1, %ebx
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	%ebx, -72(%rbp)
	jg	.L16
.L22:
	xorl	%eax, %eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%r9d, %r8d
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L31:
	movl	$-1, %r8d
	jmp	.L18
.L53:
	subl	%r8d, %r11d
	addl	%r11d, %r10d
	jmp	.L17
.L29:
	xorl	%r10d, %r10d
	jmp	.L17
.L49:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	Main, .-Main
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	.p2align 4,,10
	.p2align 3
.L55:
	xorl	%eax, %eax
	call	Main
	testl	%eax, %eax
	je	.L55
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"%d %d %d"
.LC4:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	Main
	.type	Main, @function
Main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-80(%rbp), %rdx
	leaq	-84(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movl	$0, -84(%rbp)
	movl	$0, -80(%rbp)
	movl	$0, -76(%rbp)
	movl	$0, -72(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	movl	$0, -60(%rbp)
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L2
	movl	-84(%rbp), %ecx
	movl	$1, %eax
	testl	%ecx, %ecx
	je	.L1
	movl	-80(%rbp), %edx
	testl	%edx, %edx
	jne	.L48
	.p2align 4,,10
	.p2align 3
.L1:
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	jne	.L49
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L48:
	.cfi_restore_state
	leaq	.LC1(%rip), %r14
	xorl	%eax, %eax
	leaq	-76(%rbp), %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L2
	movslq	-84(%rbp), %rdx
	movq	%rsp, %rdi
	leaq	15(%rdx), %rax
	movq	%rdx, %rcx
	movq	%rax, %rsi
	andq	$-4096, %rax
	subq	%rax, %rdi
	andq	$-16, %rsi
	cmpq	%rdi, %rsp
	je	.L5
.L50:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L50
.L5:
	andl	$4095, %esi
	subq	%rsi, %rsp
	testq	%rsi, %rsi
	je	.L6
	orq	$0, -8(%rsp,%rsi)
.L6:
	movq	%rsp, -104(%rbp)
	testl	%ecx, %ecx
	jle	.L13
	xorl	%esi, %esi
	movq	%rsp, %rdi
	call	memset@PLT
.L13:
	movslq	-76(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %rdx
	salq	$4, %rax
	movq	%rax, %rsi
	andq	$-4096, %rsi
	subq	%rsi, %rcx
	cmpq	%rcx, %rsp
	je	.L9
.L51:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L51
.L9:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L10
	orq	$0, -8(%rsp,%rax)
.L10:
	movq	%rsp, %r12
	xorl	%r15d, %r15d
	leaq	.LC2(%rip), %r13
	movq	%r12, %rbx
	testl	%edx, %edx
	jg	.L15
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L52:
	addl	$1, %r15d
	addq	$16, %rbx
	cmpl	%r15d, -76(%rbp)
	jle	.L12
.L15:
	xorl	%eax, %eax
	leaq	8(%rbx), %rcx
	leaq	4(%rbx), %rdx
	movq	%rbx, %rsi
	leaq	12(%rbx), %r8
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$4, %eax
	je	.L52
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$-1, %eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%eax, %eax
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L2
	movl	-72(%rbp), %eax
	testl	%eax, %eax
	jle	.L22
	xorl	%ebx, %ebx
	leaq	-60(%rbp), %r15
	leaq	-64(%rbp), %r14
	leaq	-68(%rbp), %r13
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	-84(%rbp), %rdx
	testl	%edx, %edx
	jle	.L24
	movq	-104(%rbp), %rdi
	xorl	%esi, %esi
	call	memset@PLT
.L24:
	xorl	%eax, %eax
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	leaq	.LC3(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L2
	movl	-76(%rbp), %edx
	testl	%edx, %edx
	jle	.L29
	salq	$4, %rdx
	movl	-60(%rbp), %edi
	movl	-64(%rbp), %r11d
	movq	%r12, %rax
	movl	-68(%rbp), %r9d
	addq	%r12, %rdx
	xorl	%esi, %esi
	movl	$-1, %r8d
	xorl	%r10d, %r10d
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L19:
	testl	%ecx, %ecx
	jne	.L18
	subl	$1, %esi
	testl	%esi, %esi
	jg	.L18
	cmpl	$-1, %r8d
	je	.L18
	movl	(%rax), %ecx
	cmpl	%r11d, %ecx
	jge	.L53
	cmpl	%r9d, %ecx
	jle	.L31
	subl	%r8d, %ecx
	movl	$-1, %r8d
	addl	%ecx, %r10d
	.p2align 4,,10
	.p2align 3
.L18:
	addq	$16, %rax
	cmpq	%rax, %rdx
	je	.L17
.L21:
	cmpl	%edi, 8(%rax)
	jne	.L18
	movl	12(%rax), %ecx
	cmpl	$1, %ecx
	jne	.L19
	addl	$1, %esi
	cmpl	$1, %esi
	jg	.L18
	movl	(%rax), %r8d
	cmpl	%r9d, %r8d
	jl	.L30
	cmpl	%r11d, %r8d
	movl	$-1, %ecx
	cmovge	%ecx, %r8d
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L21
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%r10d, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	addl	$1, %ebx
	movl	$1, %edi
	call	__printf_chk@PLT
	cmpl	%ebx, -72(%rbp)
	jg	.L16
.L22:
	xorl	%eax, %eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%r9d, %r8d
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L31:
	movl	$-1, %r8d
	jmp	.L18
.L53:
	subl	%r8d, %r11d
	addl	%r11d, %r10d
	jmp	.L17
.L29:
	xorl	%r10d, %r10d
	jmp	.L17
.L49:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	Main, .-Main
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	.p2align 4,,10
	.p2align 3
.L55:
	xorl	%eax, %eax
	call	Main
	testl	%eax, %eax
	je	.L55
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

/*
	
	
	
	?????°??°??????????????°???????????????????????????
*/

#include<stdio.h>

typedef struct DATA Data;
struct DATA{
	int time;	//?????????
	int pc;	//PC????????????
	int student;	//??????????????????
	int s;	//?????°????????????1, ?????°??¢????????????0???
};

int main(int argc, char *argv){
	while( Main() == 0 );
	return 0;
}

int Main(){
	int N = 0, M = 0, r = 0, q = 0, ts = 0, te = 0, m = 0, time = 0, bt = 0, pcount = 0, i = 0, j = 0;	//PC?????°??°???????????°????????¨?¨??????°???????????°????????????????§???¨????????????????????????????????????????????????????????¨???????????????????????°??????????????????(??¬????????????????????°???????????????????????????-1)????????°??????????????????PC?????°??°???
	if( scanf("%d %d", &N, &M) != 2 ){ return -1; }
	if( N == 0 || M == 0 ){ return 1; }
	if( scanf("%d", &r) != 1 ){ return -1; }
	char pt[N];
	for( i = 0; i < N; i++ ){ pt[i] = 0; }
	Data data[r];
	//?????¨?¨?????????\??????
	for( i = 0; i < r; i++ ){
		if( scanf("%d %d %d %d", &data[i].time, &data[i].pc, &data[i].student, &data[i].s) != 4 ){ return -1; }
	}
	if( scanf("%d", &q) != 1 ){ return -1; }
	//???????????\?????¨?????????
	for( i = 0; i < q; i++ ){
		//????????????
		time = 0;
		bt = -1;
		pcount = 0;
		for( j = 0; j < N; j++ ){ pt[j] = 0; }
		//???????????\??????
		if( scanf("%d %d %d", &ts, &te, &m) != 3 ){ return -1; }
		//?????¨?¨??????¨?????§??????
		for( j = 0; j < r; j++ ){
			//????±??????\????????????????????????
			if( data[j].student != m ){ continue; }
			//?????°???????????????????????????
			if( data[j].s == 1 ){
				pcount++;
				//??¢?????????PC??§?????°?????????????????????????????????
				if( pcount > 1 ){ continue; }
				//??¬???????§??????????bt?????¬???????§?????????????????????????????§?????????????????????????
				if( data[j].time < ts ){
					bt = ts;
				}else if( data[j].time < te ){
					bt = data[j].time;
				}else{
					bt = -1;
//					j = r;	//??¬????????????????????°??????????????????????????§????????¨?¨?????????§?????????????????????
				}
			}
			//?????°??¢??????????????¨???????????????
			if( data[j].s == 0 ){
				pcount--;
				if( pcount > 0 ){ continue; }
				if( bt == -1 ){ continue; }	//?????????????????°????????????????????????
				//??¬???????§?????????????????????????????????¬?????????????????????????????¬????????????????????¬????????????????????§????????????????????????
				if( data[j].time >= te ){
					time += te - bt;
					bt = -1;
					break;	//????????\???????????¨?¨???????????±????????????¨???????????±?????????????????????
				}else if( data[j].time > ts ){
					time += data[j].time - bt;
					bt = -1;
				}else{
					bt = -1;
				}
			}
		}
		printf("%d\n", time);
	}
	return 0;
}
4 2
10
775 1 1 1
780 4 2 1
790 2 1 1
800 2 1 0
810 3 1 1
820 1 1 0
825 3 1 0
860 1 1 1
870 4 2 0
880 1 1 0
1
780 870 1
13 15
12
540 12 13 1
600 12 13 0
650 13 15 1
660 12 15 1
665 11 13 1
670 13 15 0
675 11 13 0
680 12 15 0
1000 11 14 1
1060 12 14 1
1060 11 14 0
1080 12 14 0
3
540 700 13
600 1100 15
1000 1200 11
1 1
2
600 1 1 1
700 1 1 0
5
540 600 1
550 650 1
610 620 1
650 750 1
700 800 1
0 0
 4 2
10
775 1 1 1
780 4 2 1
790 2 1 1
800 2 1 0
810 3 1 1
820 1 1 0
825 3 1 0
860 1 1 1
870 4 2 0
880 1 1 0
1
91 870 1
13 15
12
540 12 13 1
600 12 13 0
650 13 15 1
660 12 15 1
665 11 13 1
670 13 15 0
675 11 13 0
680 12 15 0
1000 11 14 1
1060 12 14 1
1060 11 14 0
1080 12 14 0
3
540 700 13
600 1100 15
1000 1200 11
1 1
2
600 1 1 1
700 1 1 0
5
540 600 1
550 650 1
610 620 1
650 750 1
700 800 1
0 0
 4 2
10
775 1 1 1
780 4 2 1
790 2 1 1
800 2 1 0
810 3 1 1
820 1 1 0
825 3 1 0
860 1 1 1
870 4 2 0
880 1 1 0
1
91 870 1
13 15
12
540 12 13 1
600 12 13 0
650 13 15 1
660 12 15 1
665 11 13 1
670 13 15 0
675 11 13 0
680 12 15 0
1000 11 14 1
1060 12 14 1
1060 11 14 0
1080 12 14 0
3
540 700 13
600 1100 15
1000 1200 11
1 1
2
600 1 1 1
700 1 1 0
5
587 600 1
550 650 1
266 620 1
650 750 1
700 800 1
0 0
 6 2
10
775 1 1 1
780 4 2 1
790 2 1 1
800 2 1 0
810 3 1 1
820 1 1 0
825 3 1 0
860 1 1 1
870 4 2 0
880 1 1 0
1
780 870 1
13 15
12
540 12 13 1
556 12 13 0
650 13 15 1
660 12 15 1
665 11 13 1
670 13 15 0
675 11 13 0
680 12 15 0
1000 11 14 1
1060 12 14 1
1060 11 14 0
1080 12 14 0
3
540 700 13
600 1100 15
1000 1200 11
1 1
2
600 1 1 1
700 1 1 0
5
540 238 1
550 650 1
610 620 1
650 750 1
700 800 1
0 0
 4 2
10
775 1 1 1
780 4 2 1
790 2 1 1
800 2 1 0
810 3 1 1
820 1 1 0
825 3 1 0
860 1 1 1
870 4 2 0
880 1 1 0
1
780 870 1
13 15
12
540 12 13 1
600 12 13 0
650 13 15 1
660 12 15 1
665 11 13 1
670 13 15 0
675 11 13 0
680 12 15 0
1000 11 14 1
1060 12 14 1
1060 11 14 0
1080 12 14 0
3
540 700 13
983 1100 15
1000 1200 11
1 1
2
600 1 1 1
700 1 1 0
5
540 600 1
550 650 1
610 620 1
650 750 1
700 800 1
0 0
 6 2
10
775 1 1 1
780 4 2 1
790 2 1 1
800 2 1 0
810 3 1 1
820 1 1 0
825 3 1 0
860 1 1 1
870 4 2 0
880 1 1 0
1
780 870 1
13 15
12
540 12 13 1
600 12 13 0
650 13 15 1
660 12 15 1
665 11 13 1
670 13 15 0
675 11 13 0
680 12 15 0
1000 11 14 1
1060 12 14 1
1060 11 14 0
1080 12 14 0
3
540 700 13
600 1100 15
1000 1200 11
1 1
2
600 1 1 1
700 1 1 0
5
540 600 1
550 171 1
610 620 1
650 750 1
700 800 1
0 0
 4 2
10
775 1 1 1
780 4 2 1
790 2 1 1
800 2 1 0
810 3 1 1
820 1 1 0
825 3 1 0
860 1 1 1
870 4 2 0
880 1 1 0
1
91 870 1
13 15
12
540 12 13 1
600 12 13 0
650 13 15 1
660 12 15 1
665 11 13 1
670 13 15 0
675 11 13 0
680 12 15 0
1000 11 14 1
1060 12 14 1
1060 11 14 0
1080 12 14 0
3
540 700 13
600 1100 15
1000 1200 11
1 1
2
600 1 1 1
700 1 1 0
5
587 600 1
550 650 1
610 620 1
1045 750 1
700 800 1
0 0
 6 2
10
775 1 1 1
780 4 2 1
790 2 1 1
800 2 1 0
810 3 1 1
820 1 1 0
825 3 1 0
860 1 1 1
870 4 2 0
880 1 1 0
1
780 870 1
13 15
12
540 12 13 1
600 12 13 0
650 13 15 1
660 12 15 1
665 11 13 1
670 13 15 0
675 11 13 0
680 12 15 0
1000 11 14 1
1060 12 14 1
1060 11 14 0
1080 12 14 0
3
540 700 13
600 1100 15
1000 1200 11
1 1
2
600 1 1 1
700 1 1 0
5
540 238 1
606 650 1
610 620 1
650 937 1
700 800 1
0 0
 4 2
10
775 1 1 1
780 4 2 1
790 2 1 1
800 2 1 0
810 3 1 1
820 1 1 0
825 3 1 0
860 1 1 1
870 4 2 0
880 1 1 0
1
107 870 1
13 15
12
540 12 13 1
600 12 13 0
650 13 15 1
660 12 15 1
665 11 13 1
670 13 15 0
675 11 13 0
680 12 15 0
1000 11 14 1
1060 12 14 1
1060 11 14 0
1080 12 14 0
3
540 700 13
983 1100 15
1000 1200 11
1 1
2
600 1 1 1
700 1 1 0
5
540 600 1
550 650 1
610 620 1
650 1192 1
700 800 1
0 0
 4 2
10
775 1 1 1
780 4 2 1
790 2 1 1
800 2 1 0
810 3 1 1
820 1 1 0
825 3 1 0
860 1 1 1
870 4 2 0
880 1 1 0
1
156 870 1
13 15
12
540 12 13 1
600 12 13 0
650 13 15 1
660 12 15 1
665 11 13 1
670 13 15 0
675 11 13 0
680 12 15 0
1000 11 14 1
1060 12 14 1
1060 11 14 0
1080 12 14 0
3
540 700 13
600 1100 15
1000 1200 11
2 1
2
600 1 1 1
700 1 1 0
5
540 600 1
550 650 1
610 1178 1
650 750 1
700 800 1
0 0

55
70
30
0
0
50
10
50
0
 60
70
30
0
0
50
10
50
0
 60
70
30
0
0
50
20
50
0
 55
26
30
0
0
50
10
50
0
 55
70
0
0
0
50
10
50
0
 55
70
30
0
0
0
10
50
0
 60
70
30
0
0
50
10
0
0
 55
70
30
0
0
44
10
50
0
 60
70
0
0
0
50
10
50
0
 60
70
30
0
0
50
90
50
0

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>

typedef struct DATA Data;
struct DATA{
	int time;	//?????????
	int pc;	//PC????????????
	int student;	//??????????????????
	int s;	//?????°????????????1, ?????°??¢????????????0???
};

int main(int argc, char *argv){
	while( Main() == 0 );
	return 0;
}

int Main(){
	int N = 0, M = 0, r = 0, q = 0, ts = 0, te = 0, m = 0, time = 0, bt = 0, pcount = 0, i = 0, j = 0;	//PC?????°??°???????????°????????¨?¨??????°???????????°????????????????§???¨????????????????????????????????????????????????????????¨???????????????????????°??????????????????(??¬????????????????????°???????????????????????????-1)????????°??????????????????PC?????°??°???
	if( scanf("%d %d", &N, &M) != 2 ){ return -1; }
	if( N == 0 || M == 0 ){ return 1; }
	if( scanf("%d", &r) != 1 ){ return -1; }
	char pt[N];
	for( i = 0; i < N; i++ ){ pt[i] = 0; }
	Data data[r];
	//?????¨?¨?????????\??????
	for( i = 0; i < r; i++ ){
		if( scanf("%d %d %d %d", &data[i].time, &data[i].pc, &data[i].student, &data[i].s) != 4 ){ return -1; }
	}
	if( scanf("%d", &q) != 1 ){ return -1; }
	//???????????\?????¨?????????
	for( i = 0; i < q; i++ ){
		//????????????
		time = 0;
		bt = -1;
		pcount = 0;
		for( j = 0; j < N; j++ ){ pt[j] = 0; }
		//???????????\??????
		if( scanf("%d %d %d", &ts, &te, &m) != 3 ){ return -1; }
		//?????¨?¨??????¨?????§??????
		for( j = 0; j < r; j++ ){
			//????±??????\????????????????????????
			if( data[j].student != m ){ continue; }
			//?????°???????????????????????????
			if( data[j].s == 1 ){
				pcount++;
				//??¢?????????PC??§?????°?????????????????????????????????
				if( pcount > 1 ){ continue; }
				//??¬???????§??????????bt?????¬???????§?????????????????????????????§?????????????????????????
				if( data[j].time < ts ){
					bt = ts;
				}else if( data[j].time < te ){
					bt = data[j].time;
				}else{
					bt = -1;
//					j = r;	//??¬????????????????????°??????????????????????????§????????¨?¨?????????§?????????????????????
				}
			}
			//?????°??¢??????????????¨???????????????
			if( data[j].s == 0 ){
				pcount--;
				if( pcount > 0 ){ continue; }
				if( bt == -1 ){ continue; }	//?????????????????°????????????????????????
				//??¬???????§?????????????????????????????????¬?????????????????????????????¬????????????????????¬????????????????????§????????????????????????
				if( data[j].time >= te ){
					time += te - bt;
					bt = -1;
					break;	//????????\???????????¨?¨???????????±????????????¨???????????±?????????????????????
				}else if( data[j].time > ts ){
					time += data[j].time - bt;
					bt = -1;
				}else{
					bt = -1;
				}
			}
		}
		printf("%d\n", time);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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)
	movq	%rsi, -16(%rbp)
	nop
.L2:
	movl	$0, %eax
	call	Main
	testl	%eax, %eax
	je	.L2
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"%d %d %d"
.LC4:
	.string	"%d\n"
	.text
	.globl	Main
	.type	Main, @function
Main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$0, -128(%rbp)
	movl	$0, -124(%rbp)
	movl	$0, -120(%rbp)
	movl	$0, -116(%rbp)
	movl	$0, -112(%rbp)
	movl	$0, -108(%rbp)
	movl	$0, -104(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -92(%rbp)
	leaq	-132(%rbp), %rdx
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L5
	movl	$-1, %eax
	jmp	.L6
.L5:
	movl	-136(%rbp), %eax
	testl	%eax, %eax
	je	.L7
	movl	-132(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
.L7:
	movl	$1, %eax
	jmp	.L6
.L8:
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L9
	movl	$-1, %eax
	jmp	.L6
.L9:
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L13
.L14:
	movq	-80(%rbp), %rdx
	movl	-96(%rbp), %eax
	cltq
	movb	$0, (%rdx,%rax)
	addl	$1, -96(%rbp)
.L13:
	movl	-136(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L14
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L18
.L20:
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	leaq	12(%rax), %rsi
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rcx
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	movq	-64(%rbp), %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$4, %eax
	je	.L19
	movl	$-1, %eax
	jmp	.L6
.L19:
	addl	$1, -96(%rbp)
.L18:
	movl	-128(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L20
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L21
	movl	$-1, %eax
	jmp	.L6
.L21:
	movl	$0, -96(%rbp)
	jmp	.L22
.L39:
	movl	$0, -108(%rbp)
	movl	$-1, -104(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L23
.L24:
	movq	-80(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	movb	$0, (%rdx,%rax)
	addl	$1, -92(%rbp)
.L23:
	movl	-136(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L24
	leaq	-112(%rbp), %rcx
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L25
	movl	$-1, %eax
	jmp	.L6
.L25:
	movl	$0, -92(%rbp)
	jmp	.L26
.L38:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	addq	$8, %rax
	movl	(%rax), %edx
	movl	-112(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L42
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	addq	$12, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L29
	addl	$1, -100(%rbp)
	cmpl	$1, -100(%rbp)
	jg	.L43
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-120(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L31
	movl	-120(%rbp), %eax
	movl	%eax, -104(%rbp)
	jmp	.L29
.L31:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L32
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -104(%rbp)
	jmp	.L29
.L32:
	movl	$-1, -104(%rbp)
.L29:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	addq	$12, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L28
	subl	$1, -100(%rbp)
	cmpl	$0, -100(%rbp)
	jg	.L44
	cmpl	$-1, -104(%rbp)
	je	.L45
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L35
	movl	-116(%rbp), %eax
	subl	-104(%rbp), %eax
	addl	%eax, -108(%rbp)
	movl	$-1, -104(%rbp)
	jmp	.L36
.L35:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-120(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L37
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	subl	-104(%rbp), %eax
	addl	%eax, -108(%rbp)
	movl	$-1, -104(%rbp)
	jmp	.L28
.L37:
	movl	$-1, -104(%rbp)
	jmp	.L28
.L42:
	nop
	jmp	.L28
.L43:
	nop
	jmp	.L28
.L44:
	nop
	jmp	.L28
.L45:
	nop
.L28:
	addl	$1, -92(%rbp)
.L26:
	movl	-128(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L38
.L36:
	movl	-108(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -96(%rbp)
.L22:
	movl	-124(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L39
	movl	$0, %eax
.L6:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	main
	.type	main, @function
main:
.LFB0:
	.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)
	movq	%rsi, -16(%rbp)
	nop
.L2:
	movl	$0, %eax
	call	Main
	testl	%eax, %eax
	je	.L2
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %d %d %d"
.LC3:
	.string	"%d %d %d"
.LC4:
	.string	"%d\n"
	.text
	.globl	Main
	.type	Main, @function
Main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$0, -128(%rbp)
	movl	$0, -124(%rbp)
	movl	$0, -120(%rbp)
	movl	$0, -116(%rbp)
	movl	$0, -112(%rbp)
	movl	$0, -108(%rbp)
	movl	$0, -104(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -92(%rbp)
	leaq	-132(%rbp), %rdx
	leaq	-136(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L5
	movl	$-1, %eax
	jmp	.L6
.L5:
	movl	-136(%rbp), %eax
	testl	%eax, %eax
	je	.L7
	movl	-132(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
.L7:
	movl	$1, %eax
	jmp	.L6
.L8:
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L9
	movl	$-1, %eax
	jmp	.L6
.L9:
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L13
.L14:
	movq	-80(%rbp), %rdx
	movl	-96(%rbp), %eax
	cltq
	movb	$0, (%rdx,%rax)
	addl	$1, -96(%rbp)
.L13:
	movl	-136(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L14
	movl	-128(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -96(%rbp)
	jmp	.L18
.L20:
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	leaq	12(%rax), %rsi
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	leaq	8(%rax), %rcx
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	leaq	4(%rax), %rdx
	movl	-96(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	movq	-64(%rbp), %rax
	addq	%rdi, %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$4, %eax
	je	.L19
	movl	$-1, %eax
	jmp	.L6
.L19:
	addl	$1, -96(%rbp)
.L18:
	movl	-128(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L20
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L21
	movl	$-1, %eax
	jmp	.L6
.L21:
	movl	$0, -96(%rbp)
	jmp	.L22
.L39:
	movl	$0, -108(%rbp)
	movl	$-1, -104(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L23
.L24:
	movq	-80(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	movb	$0, (%rdx,%rax)
	addl	$1, -92(%rbp)
.L23:
	movl	-136(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L24
	leaq	-112(%rbp), %rcx
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L25
	movl	$-1, %eax
	jmp	.L6
.L25:
	movl	$0, -92(%rbp)
	jmp	.L26
.L38:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	addq	$8, %rax
	movl	(%rax), %edx
	movl	-112(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L42
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	addq	$12, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	jne	.L29
	addl	$1, -100(%rbp)
	cmpl	$1, -100(%rbp)
	jg	.L43
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-120(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L31
	movl	-120(%rbp), %eax
	movl	%eax, -104(%rbp)
	jmp	.L29
.L31:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L32
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -104(%rbp)
	jmp	.L29
.L32:
	movl	$-1, -104(%rbp)
.L29:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	addq	$12, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L28
	subl	$1, -100(%rbp)
	cmpl	$0, -100(%rbp)
	jg	.L44
	cmpl	$-1, -104(%rbp)
	je	.L45
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L35
	movl	-116(%rbp), %eax
	subl	-104(%rbp), %eax
	addl	%eax, -108(%rbp)
	movl	$-1, -104(%rbp)
	jmp	.L36
.L35:
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-120(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L37
	movq	-64(%rbp), %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	subl	-104(%rbp), %eax
	addl	%eax, -108(%rbp)
	movl	$-1, -104(%rbp)
	jmp	.L28
.L37:
	movl	$-1, -104(%rbp)
	jmp	.L28
.L42:
	nop
	jmp	.L28
.L43:
	nop
	jmp	.L28
.L44:
	nop
	jmp	.L28
.L45:
	nop
.L28:
	addl	$1, -92(%rbp)
.L26:
	movl	-128(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L38
.L36:
	movl	-108(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -96(%rbp)
.L22:
	movl	-124(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L39
	movl	$0, %eax
.L6:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L41
	call	__stack_chk_fail@PLT
.L41:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
