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

```c
L,R,i,c[555][555],s;main(n){for(scanf("%*d%d%*d",&n);~scanf("%d%d",&L,&R);i++)for(s=0;i/n?R/L||!printf("%d\n",s):R<501;)i/n?s+=c[L++][R]:c[L][R++]++;}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	L
	.bss
	.align 4
	.type	L, @object
	.size	L, 4
L:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 1232100
c:
	.zero	1232100
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%*d%d%*d"
.LC1:
	.string	"%d\n"
.LC2:
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L2
.L11:
	movl	$0, s(%rip)
	jmp	.L3
.L10:
	movl	i(%rip), %eax
	movl	-4(%rbp), %edi
	cltd
	idivl	%edi
	testl	%eax, %eax
	je	.L4
	movl	L(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, L(%rip)
	movl	R(%rip), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$555, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	s(%rip), %eax
	addl	%edx, %eax
	movl	%eax, s(%rip)
	jmp	.L3
.L4:
	movl	L(%rip), %edx
	movl	R(%rip), %eax
	leal	1(%rax), %ecx
	movl	%ecx, R(%rip)
	movslq	%eax, %rsi
	movslq	%edx, %rcx
	imulq	$555, %rcx, %rcx
	addq	%rsi, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	c(%rip), %rcx
	movl	(%rsi,%rcx), %ecx
	addl	$1, %ecx
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$555, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L3:
	movl	i(%rip), %eax
	movl	-4(%rbp), %edi
	cltd
	idivl	%edi
	testl	%eax, %eax
	je	.L5
	movl	R(%rip), %eax
	movl	L(%rip), %edi
	cltd
	idivl	%edi
	testl	%eax, %eax
	jne	.L6
	movl	s(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	jne	.L7
.L6:
	movl	$1, %eax
	jmp	.L8
.L7:
	movl	$0, %eax
.L8:
	andl	$1, %eax
	jmp	.L9
.L5:
	movl	R(%rip), %eax
	cmpl	$500, %eax
	setle	%al
.L9:
	testb	%al, %al
	jne	.L10
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	leaq	R(%rip), %rax
	movq	%rax, %rdx
	leaq	L(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L11
	movl	$0, %eax
	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
.LC0:
	.string	"%*d%d%*d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB3:
	.section	.text.startup,"ax",@progbits
.LHOTB3:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	leaq	c(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	R(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	L(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movl	$0, s(%rip)
	movl	i(%rip), %edi
	movl	R(%rip), %ecx
.L3:
	movl	%edi, %eax
	movl	%edi, %esi
	cltd
	idivl	12(%rsp)
	testl	%eax, %eax
	je	.L7
.L24:
	movl	%ecx, %eax
	movl	L(%rip), %esi
	cltd
	idivl	%esi
	testl	%eax, %eax
	je	.L23
	movslq	%esi, %rax
	movslq	%ecx, %rdx
	imulq	$555, %rax, %rax
	addq	%rdx, %rax
	movl	(%r14,%rax,4), %r8d
.L11:
	movl	%edi, %eax
	addl	$1, %esi
	addl	%r8d, s(%rip)
	cltd
	movl	%esi, L(%rip)
	movl	%edi, %esi
	idivl	12(%rsp)
	testl	%eax, %eax
	jne	.L24
.L7:
	cmpl	$500, %ecx
	jg	.L10
	movslq	L(%rip), %rdx
	leal	1(%rcx), %eax
	movslq	%ecx, %rcx
	movl	%eax, R(%rip)
	imulq	$555, %rdx, %rdx
	addq	%rdx, %rcx
	addl	$1, (%r14,%rcx,4)
	cmpl	$500, %eax
	jle	.L5
.L10:
	addl	$1, %esi
	movl	%esi, i(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L23:
	movl	s(%rip), %esi
	movq	%rbx, %rdi
	call	printf@PLT
	testl	%eax, %eax
	jne	.L25
	movslq	L(%rip), %r9
	movslq	R(%rip), %rax
	movl	i(%rip), %edi
	movq	%r9, %rsi
	imulq	$555, %r9, %r9
	movq	%rax, %rcx
	addq	%rax, %r9
	movl	%edi, %eax
	cltd
	movl	(%r14,%r9,4), %r8d
	idivl	12(%rsp)
	testl	%eax, %eax
	jne	.L11
	addl	$1, %ecx
	addl	$1, %r8d
	movl	%ecx, R(%rip)
	movl	%r8d, (%r14,%r9,4)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L25:
	movl	i(%rip), %esi
	addl	$1, %esi
	movl	%esi, i(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB0:
.L5:
	.cfi_def_cfa_offset 64
	.cfi_offset 3, -48
	.cfi_offset 6, -40
	.cfi_offset 12, -32
	.cfi_offset 13, -24
	.cfi_offset 14, -16
	movslq	%eax, %rcx
	addl	$1, %eax
	addq	%rdx, %rcx
	addl	$1, (%r14,%rcx,4)
	cmpl	$501, %eax
	jne	.L5
	movl	$501, R(%rip)
	jmp	.L10
	.cfi_endproc
.LFE0:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE3:
	.section	.text.startup
.LHOTE3:
	.globl	s
	.bss
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 1232100
c:
	.zero	1232100
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	L
	.align 4
	.type	L, @object
	.size	L, 4
L:
	.zero	4
	.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%*d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB3:
	.section	.text.startup,"ax",@progbits
.LHOTB3:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	leaq	c(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	R(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	L(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movl	$0, s(%rip)
	movl	i(%rip), %edi
	movl	R(%rip), %ecx
.L3:
	movl	%edi, %eax
	movl	%edi, %esi
	cltd
	idivl	12(%rsp)
	testl	%eax, %eax
	je	.L7
.L24:
	movl	%ecx, %eax
	movl	L(%rip), %esi
	cltd
	idivl	%esi
	testl	%eax, %eax
	je	.L23
	movslq	%esi, %rax
	movslq	%ecx, %rdx
	imulq	$555, %rax, %rax
	addq	%rdx, %rax
	movl	(%r14,%rax,4), %r8d
.L11:
	movl	%edi, %eax
	addl	$1, %esi
	addl	%r8d, s(%rip)
	cltd
	movl	%esi, L(%rip)
	movl	%edi, %esi
	idivl	12(%rsp)
	testl	%eax, %eax
	jne	.L24
.L7:
	cmpl	$500, %ecx
	jg	.L10
	movslq	L(%rip), %rdx
	leal	1(%rcx), %eax
	movslq	%ecx, %rcx
	movl	%eax, R(%rip)
	imulq	$555, %rdx, %rdx
	addq	%rdx, %rcx
	addl	$1, (%r14,%rcx,4)
	cmpl	$500, %eax
	jle	.L5
.L10:
	addl	$1, %esi
	movl	%esi, i(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L23:
	movl	s(%rip), %esi
	movq	%rbx, %rdi
	call	printf@PLT
	testl	%eax, %eax
	jne	.L25
	movslq	L(%rip), %r9
	movslq	R(%rip), %rax
	movl	i(%rip), %edi
	movq	%r9, %rsi
	imulq	$555, %r9, %r9
	movq	%rax, %rcx
	addq	%rax, %r9
	movl	%edi, %eax
	cltd
	movl	(%r14,%r9,4), %r8d
	idivl	12(%rsp)
	testl	%eax, %eax
	jne	.L11
	addl	$1, %ecx
	addl	$1, %r8d
	movl	%ecx, R(%rip)
	movl	%r8d, (%r14,%r9,4)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L25:
	movl	i(%rip), %esi
	addl	$1, %esi
	movl	%esi, i(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB0:
.L5:
	.cfi_def_cfa_offset 64
	.cfi_offset 3, -48
	.cfi_offset 6, -40
	.cfi_offset 12, -32
	.cfi_offset 13, -24
	.cfi_offset 14, -16
	movslq	%eax, %rcx
	addl	$1, %eax
	addq	%rdx, %rcx
	addl	$1, (%r14,%rcx,4)
	cmpl	$501, %eax
	jne	.L5
	movl	$501, R(%rip)
	jmp	.L10
	.cfi_endproc
.LFE0:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE3:
	.section	.text.startup
.LHOTE3:
	.globl	s
	.bss
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 1232100
c:
	.zero	1232100
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	L
	.align 4
	.type	L, @object
	.size	L, 4
L:
	.zero	4
	.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:

L,R,i,c[555][555],s;main(n){for(scanf("%*d%d%*d",&n);~scanf("%d%d",&L,&R);i++)for(s=0;i/n?R/L||!printf("%d\n",s):R<501;)i/n?s+=c[L++][R]:c[L][R++]++;}
10 3 2
1 5
2 8
7 10
1 7
3 3
 10 3 2
1 10
2 8
7 10
1 7
3 10
 10 10 10
1 6
2 9
4 5
4 7
4 7
5 8
6 6
6 7
7 9
10 10
1 8
1 9
1 10
2 8
2 7
2 10
3 8
3 9
3 10
1 10
 10 3 2
1 5
2 8
7 10
1 2
3 3
 10 3 2
1 10
3 8
7 10
1 7
3 10
 10 3 2
1 10
5 8
7 10
1 10
3 10
 10 3 2
1 5
2 8
7 10
1 7
5 10
 10 10 10
1 6
2 9
4 5
4 7
4 7
5 8
6 6
6 7
7 9
10 10
1 8
1 9
1 10
2 8
2 7
2 10
3 8
3 9
3 10
2 10
 10 10 10
1 6
2 9
4 5
1 7
4 7
5 8
6 6
6 7
7 9
10 10
1 8
1 9
1 10
2 8
2 7
2 10
3 8
3 9
3 10
2 10
 10 3 1
1 5
2 8
0 10
1 2
3 3

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

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

```c
L,R,i,c[555][555],s;main(n){for(scanf("%*d%d%*d",&n);~scanf("%d%d",&L,&R);i++)for(s=0;i/n?R/L||!printf("%d\n",s):R<501;)i/n?s+=c[L++][R]:c[L][R++]++;}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	L
	.bss
	.align 4
	.type	L, @object
	.size	L, 4
L:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 1232100
c:
	.zero	1232100
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%*d%d%*d"
.LC1:
	.string	"%d\n"
.LC2:
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L2
.L11:
	movl	$0, s(%rip)
	jmp	.L3
.L10:
	movl	i(%rip), %eax
	movl	-4(%rbp), %edi
	cltd
	idivl	%edi
	testl	%eax, %eax
	je	.L4
	movl	L(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, L(%rip)
	movl	R(%rip), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$555, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	s(%rip), %eax
	addl	%edx, %eax
	movl	%eax, s(%rip)
	jmp	.L3
.L4:
	movl	L(%rip), %edx
	movl	R(%rip), %eax
	leal	1(%rax), %ecx
	movl	%ecx, R(%rip)
	movslq	%eax, %rsi
	movslq	%edx, %rcx
	imulq	$555, %rcx, %rcx
	addq	%rsi, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	c(%rip), %rcx
	movl	(%rsi,%rcx), %ecx
	addl	$1, %ecx
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$555, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L3:
	movl	i(%rip), %eax
	movl	-4(%rbp), %edi
	cltd
	idivl	%edi
	testl	%eax, %eax
	je	.L5
	movl	R(%rip), %eax
	movl	L(%rip), %edi
	cltd
	idivl	%edi
	testl	%eax, %eax
	jne	.L6
	movl	s(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	jne	.L7
.L6:
	movl	$1, %eax
	jmp	.L8
.L7:
	movl	$0, %eax
.L8:
	andl	$1, %eax
	jmp	.L9
.L5:
	movl	R(%rip), %eax
	cmpl	$500, %eax
	setle	%al
.L9:
	testb	%al, %al
	jne	.L10
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	leaq	R(%rip), %rax
	movq	%rax, %rdx
	leaq	L(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L11
	movl	$0, %eax
	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	L
	.bss
	.align 4
	.type	L, @object
	.size	L, 4
L:
	.zero	4
	.globl	R
	.align 4
	.type	R, @object
	.size	R, 4
R:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 1232100
c:
	.zero	1232100
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%*d%d%*d"
.LC1:
	.string	"%d\n"
.LC2:
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L2
.L11:
	movl	$0, s(%rip)
	jmp	.L3
.L10:
	movl	i(%rip), %eax
	movl	-4(%rbp), %edi
	cltd
	idivl	%edi
	testl	%eax, %eax
	je	.L4
	movl	L(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, L(%rip)
	movl	R(%rip), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$555, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	s(%rip), %eax
	addl	%edx, %eax
	movl	%eax, s(%rip)
	jmp	.L3
.L4:
	movl	L(%rip), %edx
	movl	R(%rip), %eax
	leal	1(%rax), %ecx
	movl	%ecx, R(%rip)
	movslq	%eax, %rsi
	movslq	%edx, %rcx
	imulq	$555, %rcx, %rcx
	addq	%rsi, %rcx
	leaq	0(,%rcx,4), %rsi
	leaq	c(%rip), %rcx
	movl	(%rsi,%rcx), %ecx
	addl	$1, %ecx
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$555, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L3:
	movl	i(%rip), %eax
	movl	-4(%rbp), %edi
	cltd
	idivl	%edi
	testl	%eax, %eax
	je	.L5
	movl	R(%rip), %eax
	movl	L(%rip), %edi
	cltd
	idivl	%edi
	testl	%eax, %eax
	jne	.L6
	movl	s(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	jne	.L7
.L6:
	movl	$1, %eax
	jmp	.L8
.L7:
	movl	$0, %eax
.L8:
	andl	$1, %eax
	jmp	.L9
.L5:
	movl	R(%rip), %eax
	cmpl	$500, %eax
	setle	%al
.L9:
	testb	%al, %al
	jne	.L10
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	leaq	R(%rip), %rax
	movq	%rax, %rdx
	leaq	L(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L11
	movl	$0, %eax
	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:
