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

```c
s[1<<17];k,A,B,M;main(m){for(scanf("%*d%d",&m);~scanf("%d%d",&A,&B);){for(M=1;B/M/M;M++)~-A/M<B/M?s[M]++,s[M+1]--:0;for(k=B/M;k;s[M=B/k--+1]--)s[M=fmax(~-A/k+1,M)]++;}for(;k++<m;)printf("%d ",*s+=s[k]);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%*d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	B(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	A(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	s(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	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	%r14, %rdx
	leaq	.LC1(%rip), %rdi
	movq	%r13, %rsi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movl	$1, M(%rip)
	movl	B(%rip), %ebx
	testl	%ebx, %ebx
	je	.L3
	movl	A(%rip), %eax
	leaq	4+s(%rip), %rsi
	movl	%ebx, %r15d
	movl	$1, %ecx
	leal	-1(%rax), %ebp
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ebp, %eax
	cltd
	idivl	%ecx
	addl	$1, %ecx
	cmpl	%r15d, %eax
	jge	.L4
	addl	$1, (%rsi)
	subl	$1, 4(%rsi)
.L4:
	movl	%ebx, %eax
	addq	$4, %rsi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %r15d
	idivl	%ecx
	testl	%eax, %eax
	jne	.L5
	movl	%ecx, M(%rip)
	movl	%r15d, k(%rip)
	testl	%r15d, %r15d
	je	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ebp, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cltd
	cvtsi2sdl	%ecx, %xmm1
	idivl	%r15d
	addl	$1, %eax
	cvtsi2sdl	%eax, %xmm0
	call	fmax@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	addl	$1, (%r12,%rax,4)
	movl	%ebx, %eax
	cltd
	idivl	%r15d
	leal	1(%rax), %ecx
	movslq	%ecx, %rax
	subl	$1, (%r12,%rax,4)
	subl	$1, %r15d
	jne	.L7
	movl	$0, k(%rip)
	movl	%ecx, M(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	movl	k(%rip), %edx
	leaq	s(%rip), %rbx
	leaq	.LC2(%rip), %rbp
	leal	1(%rdx), %eax
	movl	%eax, k(%rip)
	cmpl	12(%rsp), %edx
	jge	.L19
	.p2align 4,,10
	.p2align 3
.L9:
	cltq
	movq	%rbp, %rdi
	movl	(%rbx,%rax,4), %esi
	addl	(%rbx), %esi
	xorl	%eax, %eax
	movl	%esi, (%rbx)
	call	printf@PLT
	movl	k(%rip), %edx
	leal	1(%rdx), %eax
	movl	%eax, k(%rip)
	cmpl	12(%rsp), %edx
	jl	.L9
.L19:
	addq	$24, %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
.L3:
	.cfi_restore_state
	movl	$0, k(%rip)
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	M
	.bss
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	B
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 524288
s:
	.zero	524288
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%*d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	B(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	A(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	s(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	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	%r14, %rdx
	leaq	.LC1(%rip), %rdi
	movq	%r13, %rsi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movl	$1, M(%rip)
	movl	B(%rip), %ebx
	testl	%ebx, %ebx
	je	.L3
	movl	A(%rip), %eax
	leaq	4+s(%rip), %rsi
	movl	%ebx, %r15d
	movl	$1, %ecx
	leal	-1(%rax), %ebp
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ebp, %eax
	cltd
	idivl	%ecx
	addl	$1, %ecx
	cmpl	%r15d, %eax
	jge	.L4
	addl	$1, (%rsi)
	subl	$1, 4(%rsi)
.L4:
	movl	%ebx, %eax
	addq	$4, %rsi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %r15d
	idivl	%ecx
	testl	%eax, %eax
	jne	.L5
	movl	%ecx, M(%rip)
	movl	%r15d, k(%rip)
	testl	%r15d, %r15d
	je	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ebp, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cltd
	cvtsi2sdl	%ecx, %xmm1
	idivl	%r15d
	addl	$1, %eax
	cvtsi2sdl	%eax, %xmm0
	call	fmax@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	addl	$1, (%r12,%rax,4)
	movl	%ebx, %eax
	cltd
	idivl	%r15d
	leal	1(%rax), %ecx
	movslq	%ecx, %rax
	subl	$1, (%r12,%rax,4)
	subl	$1, %r15d
	jne	.L7
	movl	$0, k(%rip)
	movl	%ecx, M(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	movl	k(%rip), %edx
	leaq	s(%rip), %rbx
	leaq	.LC2(%rip), %rbp
	leal	1(%rdx), %eax
	movl	%eax, k(%rip)
	cmpl	12(%rsp), %edx
	jge	.L19
	.p2align 4,,10
	.p2align 3
.L9:
	cltq
	movq	%rbp, %rdi
	movl	(%rbx,%rax,4), %esi
	addl	(%rbx), %esi
	xorl	%eax, %eax
	movl	%esi, (%rbx)
	call	printf@PLT
	movl	k(%rip), %edx
	leal	1(%rdx), %eax
	movl	%eax, k(%rip)
	cmpl	12(%rsp), %edx
	jl	.L9
.L19:
	addq	$24, %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
.L3:
	.cfi_restore_state
	movl	$0, k(%rip)
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	M
	.bss
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	B
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 524288
s:
	.zero	524288
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%*d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	B(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	A(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	s(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	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	%r14, %rdx
	leaq	.LC1(%rip), %rdi
	movq	%r13, %rsi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movl	$1, M(%rip)
	movl	B(%rip), %ebx
	testl	%ebx, %ebx
	je	.L3
	movl	A(%rip), %eax
	leaq	4+s(%rip), %rsi
	movl	%ebx, %r15d
	movl	$1, %ecx
	leal	-1(%rax), %ebp
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ebp, %eax
	cltd
	idivl	%ecx
	addl	$1, %ecx
	cmpl	%r15d, %eax
	jge	.L4
	addl	$1, (%rsi)
	subl	$1, 4(%rsi)
.L4:
	movl	%ebx, %eax
	addq	$4, %rsi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %r15d
	idivl	%ecx
	testl	%eax, %eax
	jne	.L5
	movl	%ecx, M(%rip)
	movl	%r15d, k(%rip)
	testl	%r15d, %r15d
	je	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ebp, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cltd
	cvtsi2sdl	%ecx, %xmm1
	idivl	%r15d
	addl	$1, %eax
	cvtsi2sdl	%eax, %xmm0
	call	fmax@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	addl	$1, (%r12,%rax,4)
	movl	%ebx, %eax
	cltd
	idivl	%r15d
	leal	1(%rax), %ecx
	movslq	%ecx, %rax
	subl	$1, (%r12,%rax,4)
	subl	$1, %r15d
	jne	.L7
	movl	$0, k(%rip)
	movl	%ecx, M(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	movl	k(%rip), %edx
	leaq	s(%rip), %rbx
	leaq	.LC2(%rip), %rbp
	leal	1(%rdx), %eax
	movl	%eax, k(%rip)
	cmpl	12(%rsp), %edx
	jge	.L19
	.p2align 4,,10
	.p2align 3
.L9:
	cltq
	movq	%rbp, %rdi
	movl	(%rbx,%rax,4), %esi
	addl	(%rbx), %esi
	xorl	%eax, %eax
	movl	%esi, (%rbx)
	call	printf@PLT
	movl	k(%rip), %edx
	leal	1(%rdx), %eax
	movl	%eax, k(%rip)
	cmpl	12(%rsp), %edx
	jl	.L9
.L19:
	addq	$24, %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
.L3:
	.cfi_restore_state
	movl	$0, k(%rip)
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	M
	.bss
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	B
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 524288
s:
	.zero	524288
	.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:
```
```c
s[1<<17];k,A,B,M;main(m){for(scanf("%*d%d",&m);~scanf("%d%d",&A,&B);){for(M=1;B/M/M;M++)~-A/M<B/M?s[M]++,s[M+1]--:0;for(k=B/M;k;s[M=B/k--+1]--)s[M=fmax(~-A/k+1,M)]++;}for(;k++<m;)printf("%d ",*s+=s[k]);}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
s[1<<17];k,A,B,M;main(m){for(scanf("%*d%d",&m);~scanf("%d%d",&A,&B);){for(M=1;B/M/M;M++)~-A/M<B/M?s[M]++,s[M+1]--:0;for(k=B/M;k;s[M=B/k--+1]--)s[M=fmax(~-A/k+1,M)]++;}for(;k++<m;)printf("%d ",*s+=s[k]);}```

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.
Optimized Assembly Code:

7 9
1 9
5 9
5 7
5 9
1 1
6 8
3 4
 7 9
1 9
9 9
5 7
5 9
1 1
6 8
3 4
 7 11
1 9
5 9
5 7
5 9
1 1
6 8
3 4
 7 9
1 9
9 9
5 7
5 9
1 1
8 8
3 4
 7 9
1 6
5 13
5 7
5 9
1 1
6 8
3 4
 7 11
1 2
5 9
5 7
5 9
1 1
6 8
3 4
 7 9
1 9
9 9
5 5
5 9
1 1
8 8
3 4
 7 11
1 2
5 9
5 8
5 9
1 1
6 8
3 4
 7 11
1 2
5 9
5 8
5 9
1 1
7 8
3 4
 7 11
1 2
5 9
7 8
5 9
1 1
7 8
3 4

7 6 6 5 4 5 5 4 3  7 5 6 4 3 4 4 3 3  7 6 6 5 4 5 5 4 3 0 0  7 5 5 4 3 3 3 3 3  7 6 6 5 4 5 4 3 2  7 6 5 4 3 4 4 3 2 0 0  7 4 4 4 3 2 2 3 3  7 6 5 5 3 4 4 4 2 0 0  7 6 4 5 3 3 4 4 2 0 0  7 6 3 5 2 2 4 4 2 0 0 
Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
s[1<<17];k,A,B,M;main(m){for(scanf("%*d%d",&m);~scanf("%d%d",&A,&B);){for(M=1;B/M/M;M++)~-A/M<B/M?s[M]++,s[M+1]--:0;for(k=B/M;k;s[M=B/k--+1]--)s[M=fmax(~-A/k+1,M)]++;}for(;k++<m;)printf("%d ",*s+=s[k]);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%*d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	B(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	A(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	s(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	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	%r14, %rdx
	leaq	.LC1(%rip), %rdi
	movq	%r13, %rsi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movl	$1, M(%rip)
	movl	B(%rip), %ebx
	testl	%ebx, %ebx
	je	.L3
	movl	A(%rip), %eax
	leaq	4+s(%rip), %rsi
	movl	%ebx, %r15d
	movl	$1, %ecx
	leal	-1(%rax), %ebp
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ebp, %eax
	cltd
	idivl	%ecx
	addl	$1, %ecx
	cmpl	%r15d, %eax
	jge	.L4
	addl	$1, (%rsi)
	subl	$1, 4(%rsi)
.L4:
	movl	%ebx, %eax
	addq	$4, %rsi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %r15d
	idivl	%ecx
	testl	%eax, %eax
	jne	.L5
	movl	%ecx, M(%rip)
	movl	%r15d, k(%rip)
	testl	%r15d, %r15d
	je	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ebp, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cltd
	cvtsi2sdl	%ecx, %xmm1
	idivl	%r15d
	addl	$1, %eax
	cvtsi2sdl	%eax, %xmm0
	call	fmax@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	addl	$1, (%r12,%rax,4)
	movl	%ebx, %eax
	cltd
	idivl	%r15d
	leal	1(%rax), %ecx
	movslq	%ecx, %rax
	subl	$1, (%r12,%rax,4)
	subl	$1, %r15d
	jne	.L7
	movl	$0, k(%rip)
	movl	%ecx, M(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	movl	k(%rip), %edx
	leaq	s(%rip), %rbx
	leaq	.LC2(%rip), %rbp
	leal	1(%rdx), %eax
	movl	%eax, k(%rip)
	cmpl	12(%rsp), %edx
	jge	.L19
	.p2align 4,,10
	.p2align 3
.L9:
	cltq
	movq	%rbp, %rdi
	movl	(%rbx,%rax,4), %esi
	addl	(%rbx), %esi
	xorl	%eax, %eax
	movl	%esi, (%rbx)
	call	printf@PLT
	movl	k(%rip), %edx
	leal	1(%rdx), %eax
	movl	%eax, k(%rip)
	cmpl	12(%rsp), %edx
	jl	.L9
.L19:
	addq	$24, %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
.L3:
	.cfi_restore_state
	movl	$0, k(%rip)
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	M
	.bss
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	B
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 524288
s:
	.zero	524288
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%*d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d "
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	B(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	A(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	s(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	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	%r14, %rdx
	leaq	.LC1(%rip), %rdi
	movq	%r13, %rsi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movl	$1, M(%rip)
	movl	B(%rip), %ebx
	testl	%ebx, %ebx
	je	.L3
	movl	A(%rip), %eax
	leaq	4+s(%rip), %rsi
	movl	%ebx, %r15d
	movl	$1, %ecx
	leal	-1(%rax), %ebp
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%ebp, %eax
	cltd
	idivl	%ecx
	addl	$1, %ecx
	cmpl	%r15d, %eax
	jge	.L4
	addl	$1, (%rsi)
	subl	$1, 4(%rsi)
.L4:
	movl	%ebx, %eax
	addq	$4, %rsi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %r15d
	idivl	%ecx
	testl	%eax, %eax
	jne	.L5
	movl	%ecx, M(%rip)
	movl	%r15d, k(%rip)
	testl	%r15d, %r15d
	je	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ebp, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cltd
	cvtsi2sdl	%ecx, %xmm1
	idivl	%r15d
	addl	$1, %eax
	cvtsi2sdl	%eax, %xmm0
	call	fmax@PLT
	cvttsd2sil	%xmm0, %eax
	cltq
	addl	$1, (%r12,%rax,4)
	movl	%ebx, %eax
	cltd
	idivl	%r15d
	leal	1(%rax), %ecx
	movslq	%ecx, %rax
	subl	$1, (%r12,%rax,4)
	subl	$1, %r15d
	jne	.L7
	movl	$0, k(%rip)
	movl	%ecx, M(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	movl	k(%rip), %edx
	leaq	s(%rip), %rbx
	leaq	.LC2(%rip), %rbp
	leal	1(%rdx), %eax
	movl	%eax, k(%rip)
	cmpl	12(%rsp), %edx
	jge	.L19
	.p2align 4,,10
	.p2align 3
.L9:
	cltq
	movq	%rbp, %rdi
	movl	(%rbx,%rax,4), %esi
	addl	(%rbx), %esi
	xorl	%eax, %eax
	movl	%esi, (%rbx)
	call	printf@PLT
	movl	k(%rip), %edx
	leal	1(%rdx), %eax
	movl	%eax, k(%rip)
	cmpl	12(%rsp), %edx
	jl	.L9
.L19:
	addq	$24, %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
.L3:
	.cfi_restore_state
	movl	$0, k(%rip)
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	M
	.bss
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	B
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 524288
s:
	.zero	524288
	.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:
```