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>
int d[10000][1500]={0};
int main(){
  int n,m,i,j,s,t,k,a;
  while(scanf("%*d %d",&n),n){
    for(i=0;i<n;i++){
      for(j=500;j<=1270;j++)d[i][j]=0;
    }
    scanf("%d",&k);
    while(k--){
      scanf("%d %*d %d %d",&m,&i,&j);
      d[i][m]+=(j%2)*2-1;
    }
    scanf("%d",&k);
    while(k--){
      scanf("%d %d %d",&s,&t,&m);
      for(i=a=j=0;i<1300;i++){
	j+=d[m][i];//printf("%d ",j); 
	if(s<=i&&i<t&&j>0)a++;
      }
      printf("%d\n",a);
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 60000000
d:
	.zero	60000000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %*d %d %d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%*d %d"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L14:
	movl	$0, -32(%rbp)
	jmp	.L3
.L6:
	movl	$500, -28(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	$1270, %eax
	jle	.L5
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
.L3:
	movl	-32(%rbp), %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L6
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L7
.L8:
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	addl	%eax, %eax
	leal	-1(%rax), %esi
	movl	-32(%rbp), %eax
	movl	-36(%rbp), %edx
	addl	%esi, %ecx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L7:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L8
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L9
.L13:
	leaq	-36(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L10
.L12:
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-24(%rbp), %edx
	movl	-32(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L11
	movl	-32(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jle	.L11
	addl	$1, -12(%rbp)
.L11:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
.L10:
	movl	-32(%rbp), %eax
	cmpl	$1299, %eax
	jle	.L12
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L13
.L2:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %*d %d %d"
.LC3:
	.string	"%d %d %d"
.LC6:
	.string	"%d\n"
.LC7:
	.string	"%*d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC7(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L40
	movl	$0, 36(%rsp)
	jle	.L3
	leal	-1(%r8), %esi
	leaq	2000+d(%rip), %rdx
	imulq	$6000, %rsi, %rsi
	leaq	6000(%rdx), %rax
	addq	%rax, %rsi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	8(%rdx), %rdi
	movq	%rdx, %rcx
	movq	$0, (%rdx)
	addq	$6000, %rdx
	movq	$0, -2924(%rdx)
	andq	$-8, %rdi
	subq	%rdi, %rcx
	addl	$3084, %ecx
	shrl	$3, %ecx
	rep stosq
	cmpq	%rsi, %rdx
	jne	.L4
	movl	$1271, 40(%rsp)
	movl	%r8d, 36(%rsp)
.L3:
	leaq	52(%rsp), %rax
	leaq	.LC1(%rip), %r14
	movq	%rax, (%rsp)
	movq	%rax, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L8
	leaq	40(%rsp), %r13
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbx
	leaq	.LC2(%rip), %rbp
	leaq	d(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	36(%rsp), %rdx
	movslq	32(%rsp), %rax
	imulq	$1500, %rdx, %rdx
	addq	%rax, %rdx
	movl	40(%rsp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	andl	$1, %eax
	subl	%ecx, %eax
	movl	(%r15,%rdx,4), %ecx
	leal	-1(%rcx,%rax,2), %eax
	movl	%eax, (%r15,%rdx,4)
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L5
.L8:
	movq	(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	32(%rsp), %rbx
	leaq	d(%rip), %r15
	leaq	48(%rsp), %r14
	leaq	44(%rsp), %r13
	leaq	.LC3(%rip), %r12
	leaq	.LC6(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rcx
	movq	%r13, %rsi
	movq	%r14, %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	movslq	32(%rsp), %rcx
	movl	$0, 40(%rsp)
	movl	48(%rsp), %esi
	testl	%eax, %eax
	jle	.L19
	movl	$1300, %r8d
	cmpl	%r8d, %eax
	cmovle	%eax, %r8d
	imulq	$6000, %rcx, %rdx
	cmpl	$3, %eax
	jle	.L10
	movl	%r8d, %eax
	addq	%r15, %rdx
	movdqa	.LC0(%rip), %xmm2
	shrl	$2, %eax
	pxor	%xmm1, %xmm1
	leal	-1(%rax), %edi
	leaq	16(%rdx), %rax
	salq	$4, %rdi
	addq	%rax, %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L41:
	addq	$16, %rax
.L11:
	movdqa	%xmm2, %xmm0
	paddd	(%rdx), %xmm1
	movq	%rax, %rdx
	paddd	.LC4(%rip), %xmm2
	paddd	.LC5(%rip), %xmm0
	cmpq	%rax, %rdi
	jne	.L41
	pshufd	$255, %xmm0, %xmm0
	movl	%r8d, %edi
	movd	%xmm0, %eax
	movdqa	%xmm1, %xmm0
	andl	$-4, %edi
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %r8b
	je	.L12
	imulq	$1500, %rcx, %rax
	movslq	%edi, %r9
	addl	$1, %edi
	addq	%r9, %rax
	addl	(%r15,%rax,4), %edx
	cmpl	%r8d, %edi
	jge	.L20
.L17:
	imulq	$1500, %rcx, %r9
	movslq	%edi, %rax
	addq	%r9, %rax
	addl	(%r15,%rax,4), %edx
	leal	1(%rdi), %eax
	cmpl	%r8d, %eax
	jge	.L12
	cltq
	addq	%rax, %r9
	leal	2(%rdi), %eax
	addl	(%r15,%r9,4), %edx
.L12:
	cmpl	$1299, %eax
	jg	.L42
.L9:
	imulq	$6000, %rcx, %rcx
	cltq
	xorl	%r8d, %r8d
	addq	%r15, %rcx
	.p2align 4,,10
	.p2align 3
.L14:
	addl	(%rcx,%rax,4), %edx
	cmpl	%eax, %esi
	jle	.L13
	testl	%edx, %edx
	setg	%dil
	cmpb	$1, %dil
	sbbl	$-1, %r8d
.L13:
	addq	$1, %rax
	cmpl	$1299, %eax
	jle	.L14
.L15:
	movl	%edx, 40(%rsp)
	movq	%rbp, %rsi
	movl	%r8d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	movl	$1300, 36(%rsp)
	call	__printf_chk@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L6
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L42:
	xorl	%r8d, %r8d
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r15,%rdx), %edx
	cmpl	$1, %eax
	je	.L9
	movl	$1, %edi
	jmp	.L17
.L20:
	movl	%edi, %eax
	jmp	.L12
.L40:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$72, %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
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 60000000
d:
	.zero	60000000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC4:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC5:
	.long	1
	.long	1
	.long	1
	.long	1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%d %*d %d %d"
.LC3:
	.string	"%d %d %d"
.LC6:
	.string	"%d\n"
.LC7:
	.string	"%*d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rsi
	leaq	.LC7(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L40
	movl	$0, 36(%rsp)
	jle	.L3
	leal	-1(%r8), %esi
	leaq	2000+d(%rip), %rdx
	imulq	$6000, %rsi, %rsi
	leaq	6000(%rdx), %rax
	addq	%rax, %rsi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	8(%rdx), %rdi
	movq	%rdx, %rcx
	movq	$0, (%rdx)
	addq	$6000, %rdx
	movq	$0, -2924(%rdx)
	andq	$-8, %rdi
	subq	%rdi, %rcx
	addl	$3084, %ecx
	shrl	$3, %ecx
	rep stosq
	cmpq	%rsi, %rdx
	jne	.L4
	movl	$1271, 40(%rsp)
	movl	%r8d, 36(%rsp)
.L3:
	leaq	52(%rsp), %rax
	leaq	.LC1(%rip), %r14
	movq	%rax, (%rsp)
	movq	%rax, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L8
	leaq	40(%rsp), %r13
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbx
	leaq	.LC2(%rip), %rbp
	leaq	d(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	36(%rsp), %rdx
	movslq	32(%rsp), %rax
	imulq	$1500, %rdx, %rdx
	addq	%rax, %rdx
	movl	40(%rsp), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	andl	$1, %eax
	subl	%ecx, %eax
	movl	(%r15,%rdx,4), %ecx
	leal	-1(%rcx,%rax,2), %eax
	movl	%eax, (%r15,%rdx,4)
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L5
.L8:
	movq	(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	32(%rsp), %rbx
	leaq	d(%rip), %r15
	leaq	48(%rsp), %r14
	leaq	44(%rsp), %r13
	leaq	.LC3(%rip), %r12
	leaq	.LC6(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbx, %rcx
	movq	%r13, %rsi
	movq	%r14, %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	movslq	32(%rsp), %rcx
	movl	$0, 40(%rsp)
	movl	48(%rsp), %esi
	testl	%eax, %eax
	jle	.L19
	movl	$1300, %r8d
	cmpl	%r8d, %eax
	cmovle	%eax, %r8d
	imulq	$6000, %rcx, %rdx
	cmpl	$3, %eax
	jle	.L10
	movl	%r8d, %eax
	addq	%r15, %rdx
	movdqa	.LC0(%rip), %xmm2
	shrl	$2, %eax
	pxor	%xmm1, %xmm1
	leal	-1(%rax), %edi
	leaq	16(%rdx), %rax
	salq	$4, %rdi
	addq	%rax, %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L41:
	addq	$16, %rax
.L11:
	movdqa	%xmm2, %xmm0
	paddd	(%rdx), %xmm1
	movq	%rax, %rdx
	paddd	.LC4(%rip), %xmm2
	paddd	.LC5(%rip), %xmm0
	cmpq	%rax, %rdi
	jne	.L41
	pshufd	$255, %xmm0, %xmm0
	movl	%r8d, %edi
	movd	%xmm0, %eax
	movdqa	%xmm1, %xmm0
	andl	$-4, %edi
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %r8b
	je	.L12
	imulq	$1500, %rcx, %rax
	movslq	%edi, %r9
	addl	$1, %edi
	addq	%r9, %rax
	addl	(%r15,%rax,4), %edx
	cmpl	%r8d, %edi
	jge	.L20
.L17:
	imulq	$1500, %rcx, %r9
	movslq	%edi, %rax
	addq	%r9, %rax
	addl	(%r15,%rax,4), %edx
	leal	1(%rdi), %eax
	cmpl	%r8d, %eax
	jge	.L12
	cltq
	addq	%rax, %r9
	leal	2(%rdi), %eax
	addl	(%r15,%r9,4), %edx
.L12:
	cmpl	$1299, %eax
	jg	.L42
.L9:
	imulq	$6000, %rcx, %rcx
	cltq
	xorl	%r8d, %r8d
	addq	%r15, %rcx
	.p2align 4,,10
	.p2align 3
.L14:
	addl	(%rcx,%rax,4), %edx
	cmpl	%eax, %esi
	jle	.L13
	testl	%edx, %edx
	setg	%dil
	cmpb	$1, %dil
	sbbl	$-1, %r8d
.L13:
	addq	$1, %rax
	cmpl	$1299, %eax
	jle	.L14
.L15:
	movl	%edx, 40(%rsp)
	movq	%rbp, %rsi
	movl	%r8d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	movl	$1300, 36(%rsp)
	call	__printf_chk@PLT
	movl	52(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 52(%rsp)
	testl	%eax, %eax
	jne	.L6
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L42:
	xorl	%r8d, %r8d
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r15,%rdx), %edx
	cmpl	$1, %eax
	je	.L9
	movl	$1, %edi
	jmp	.L17
.L20:
	movl	%edi, %eax
	jmp	.L12
.L40:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$72, %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
.L43:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 60000000
d:
	.zero	60000000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC4:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC5:
	.long	1
	.long	1
	.long	1
	.long	1
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
int d[10000][1500]={0};
int main(){
  int n,m,i,j,s,t,k,a;
  while(scanf("%*d %d",&n),n){
    for(i=0;i<n;i++){
      for(j=500;j<=1270;j++)d[i][j]=0;
    }
    scanf("%d",&k);
    while(k--){
      scanf("%d %*d %d %d",&m,&i,&j);
      d[i][m]+=(j%2)*2-1;
    }
    scanf("%d",&k);
    while(k--){
      scanf("%d %d %d",&s,&t,&m);
      for(i=a=j=0;i<1300;i++){
	j+=d[m][i];//printf("%d ",j); 
	if(s<=i&&i<t&&j>0)a++;
      }
      printf("%d\n",a);
    }
  }
  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>
int d[10000][1500]={0};
int main(){
  int n,m,i,j,s,t,k,a;
  while(scanf("%*d %d",&n),n){
    for(i=0;i<n;i++){
      for(j=500;j<=1270;j++)d[i][j]=0;
    }
    scanf("%d",&k);
    while(k--){
      scanf("%d %*d %d %d",&m,&i,&j);
      d[i][m]+=(j%2)*2-1;
    }
    scanf("%d",&k);
    while(k--){
      scanf("%d %d %d",&s,&t,&m);
      for(i=a=j=0;i<1300;i++){
	j+=d[m][i];//printf("%d ",j); 
	if(s<=i&&i<t&&j>0)a++;
      }
      printf("%d\n",a);
    }
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 60000000
d:
	.zero	60000000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %*d %d %d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%*d %d"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L14:
	movl	$0, -32(%rbp)
	jmp	.L3
.L6:
	movl	$500, -28(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	$1270, %eax
	jle	.L5
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
.L3:
	movl	-32(%rbp), %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L6
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L7
.L8:
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	addl	%eax, %eax
	leal	-1(%rax), %esi
	movl	-32(%rbp), %eax
	movl	-36(%rbp), %edx
	addl	%esi, %ecx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L7:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L8
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L9
.L13:
	leaq	-36(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L10
.L12:
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-24(%rbp), %edx
	movl	-32(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L11
	movl	-32(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jle	.L11
	addl	$1, -12(%rbp)
.L11:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
.L10:
	movl	-32(%rbp), %eax
	cmpl	$1299, %eax
	jle	.L12
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L13
.L2:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 60000000
d:
	.zero	60000000
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %*d %d %d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"%*d %d"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L14:
	movl	$0, -32(%rbp)
	jmp	.L3
.L6:
	movl	$500, -28(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	$1270, %eax
	jle	.L5
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
.L3:
	movl	-32(%rbp), %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L6
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L7
.L8:
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	addl	%eax, %eax
	leal	-1(%rax), %esi
	movl	-32(%rbp), %eax
	movl	-36(%rbp), %edx
	addl	%esi, %ecx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L7:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L8
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L9
.L13:
	leaq	-36(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L10
.L12:
	movl	-36(%rbp), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$1500, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	movl	-24(%rbp), %edx
	movl	-32(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L11
	movl	-32(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jle	.L11
	addl	$1, -12(%rbp)
.L11:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
.L10:
	movl	-32(%rbp), %eax
	cmpl	$1299, %eax
	jle	.L12
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L13
.L2:
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
