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 a[60], b[60];
int main(void)
{
    while (1) {
        int n, p, k, i, res;
        scanf("%d%d", &n, &p);
        if (n==0 && p==0) break;
        for(i=0;i<n;++i) a[i]=b[i]=0;
        k=0;
        a[k]=p;
        while (1) {
            if (a[k]>0) {
                --a[k];
                ++b[k];
            }
            else {
                a[k]+=b[k];
                b[k]=0;
            }
            a[(k+1)%n]=a[k];
            a[k]=0;
            k=(k+1)%n;

            res=-1;
            for(i=0;i<n;++i) if (b[i]==p) res=i;
            if (res>=0) break;
        }
        printf("%d\n", res);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 240
a:
	.zero	240
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 240
b:
	.zero	240
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L14:
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	jmp	.L16
.L2:
	movl	$0, -16(%rbp)
	jmp	.L4
.L5:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L5
	movl	$0, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L13:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L7
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
.L7:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	-28(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	-28(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -20(%rbp)
	movl	$-1, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L9:
	addl	$1, -16(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	cmpl	$0, -12(%rbp)
	jns	.L18
	jmp	.L13
.L18:
	nop
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L16:
	call	__stack_chk_fail@PLT
.L15:
	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"
.LC1:
	.string	"%d\n"
	.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
	leaq	a(%rip), %r15
	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
	leaq	b(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %r12
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r13d
	movl	20(%rsp), %r14d
	testl	%r13d, %r13d
	jne	.L24
	testl	%r14d, %r14d
	je	.L25
.L4:
	xorl	%eax, %eax
	movl	%r14d, %ecx
	movl	%r14d, (%r15)
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %edx
	testl	%ecx, %ecx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L29:
	subl	$1, %ecx
	addl	$1, %edx
.L8:
	addl	$1, %eax
	movl	%edx, (%rbx,%rsi,4)
	cltd
	idivl	%r13d
	movslq	%edx, %rdi
	movl	%ecx, (%r15,%rdi,4)
	movl	$0, (%r15,%rsi,4)
	testl	%r13d, %r13d
	jle	.L9
	leaq	b(%rip), %rcx
	movl	$-1, %eax
	xorl	%r8d, %r8d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L27:
	cmpl	%esi, %r13d
	jle	.L26
.L14:
	addq	$4, %rcx
	movl	%esi, %r8d
.L12:
	leal	1(%r8), %esi
	cmpl	%r14d, (%rcx)
	jne	.L27
	cmpl	%esi, %r13d
	jle	.L15
	movl	%r8d, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L26:
	cmpl	$-1, %eax
	jne	.L28
.L9:
	movl	%edx, %eax
	movl	(%r15,%rdi,4), %ecx
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %edx
	testl	%ecx, %ecx
	jg	.L29
.L7:
	addl	%edx, %ecx
	xorl	%edx, %edx
	jmp	.L8
.L28:
	movl	%eax, %r8d
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L13
.L24:
	jle	.L4
	movslq	%r13d, %rdx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	salq	$2, %rdx
	movq	%rdx, 8(%rsp)
	call	memset@PLT
	movq	8(%rsp), %rdx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	memset@PLT
	jmp	.L4
.L25:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$40, %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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	b
	.bss
	.align 32
	.type	b, @object
	.size	b, 240
b:
	.zero	240
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 240
a:
	.zero	240
	.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\n"
	.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
	leaq	a(%rip), %r15
	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
	leaq	b(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %r12
	leaq	16(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r13d
	movl	20(%rsp), %r14d
	testl	%r13d, %r13d
	jne	.L24
	testl	%r14d, %r14d
	je	.L25
.L4:
	xorl	%eax, %eax
	movl	%r14d, %ecx
	movl	%r14d, (%r15)
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %edx
	testl	%ecx, %ecx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L29:
	subl	$1, %ecx
	addl	$1, %edx
.L8:
	addl	$1, %eax
	movl	%edx, (%rbx,%rsi,4)
	cltd
	idivl	%r13d
	movslq	%edx, %rdi
	movl	%ecx, (%r15,%rdi,4)
	movl	$0, (%r15,%rsi,4)
	testl	%r13d, %r13d
	jle	.L9
	leaq	b(%rip), %rcx
	movl	$-1, %eax
	xorl	%r8d, %r8d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L27:
	cmpl	%esi, %r13d
	jle	.L26
.L14:
	addq	$4, %rcx
	movl	%esi, %r8d
.L12:
	leal	1(%r8), %esi
	cmpl	%r14d, (%rcx)
	jne	.L27
	cmpl	%esi, %r13d
	jle	.L15
	movl	%r8d, %eax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L26:
	cmpl	$-1, %eax
	jne	.L28
.L9:
	movl	%edx, %eax
	movl	(%r15,%rdi,4), %ecx
	movslq	%eax, %rsi
	movl	(%rbx,%rsi,4), %edx
	testl	%ecx, %ecx
	jg	.L29
.L7:
	addl	%edx, %ecx
	xorl	%edx, %edx
	jmp	.L8
.L28:
	movl	%eax, %r8d
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L13
.L24:
	jle	.L4
	movslq	%r13d, %rdx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	salq	$2, %rdx
	movq	%rdx, 8(%rsp)
	call	memset@PLT
	movq	8(%rsp), %rdx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	memset@PLT
	jmp	.L4
.L25:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$40, %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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	b
	.bss
	.align 32
	.type	b, @object
	.size	b, 240
b:
	.zero	240
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 240
a:
	.zero	240
	.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 a[60], b[60];
int main(void)
{
    while (1) {
        int n, p, k, i, res;
        scanf("%d%d", &n, &p);
        if (n==0 && p==0) break;
        for(i=0;i<n;++i) a[i]=b[i]=0;
        k=0;
        a[k]=p;
        while (1) {
            if (a[k]>0) {
                --a[k];
                ++b[k];
            }
            else {
                a[k]+=b[k];
                b[k]=0;
            }
            a[(k+1)%n]=a[k];
            a[k]=0;
            k=(k+1)%n;

            res=-1;
            for(i=0;i<n;++i) if (b[i]==p) res=i;
            if (res>=0) break;
        }
        printf("%d\n", res);
    }
    return 0;
}
3 2
3 3
3 50
10 29
57 32
50 2
50 50
0 0
 3 2
3 3
4 50
10 29
57 32
50 2
50 50
0 0
 3 2
3 3
4 50
10 29
57 32
50 1
50 50
0 0
 3 3
3 3
3 50
10 29
31 32
50 2
50 50
0 0
 3 2
3 2
3 50
10 29
57 32
50 2
50 50
0 0
 3 2
3 3
4 50
10 29
57 4
50 1
50 50
0 0
 3 3
3 3
3 96
10 29
31 32
57 2
50 50
0 0

1
0
1
5
31
1
13
 1
0
3
5
31
1
13
 1
0
3
5
31
0
13
 0
0
1
5
30
1
13
 1
1
1
5
31
1
13
 1
0
3
5
3
0
13
 0
0
0
5
30
1
13

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 a[60], b[60];
int main(void)
{
    while (1) {
        int n, p, k, i, res;
        scanf("%d%d", &n, &p);
        if (n==0 && p==0) break;
        for(i=0;i<n;++i) a[i]=b[i]=0;
        k=0;
        a[k]=p;
        while (1) {
            if (a[k]>0) {
                --a[k];
                ++b[k];
            }
            else {
                a[k]+=b[k];
                b[k]=0;
            }
            a[(k+1)%n]=a[k];
            a[k]=0;
            k=(k+1)%n;

            res=-1;
            for(i=0;i<n;++i) if (b[i]==p) res=i;
            if (res>=0) break;
        }
        printf("%d\n", res);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 240
a:
	.zero	240
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 240
b:
	.zero	240
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L14:
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	jmp	.L16
.L2:
	movl	$0, -16(%rbp)
	jmp	.L4
.L5:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L5
	movl	$0, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L13:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L7
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
.L7:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	-28(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	-28(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -20(%rbp)
	movl	$-1, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L9:
	addl	$1, -16(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	cmpl	$0, -12(%rbp)
	jns	.L18
	jmp	.L13
.L18:
	nop
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L16:
	call	__stack_chk_fail@PLT
.L15:
	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	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 240
a:
	.zero	240
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 240
b:
	.zero	240
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L14:
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	jmp	.L16
.L2:
	movl	$0, -16(%rbp)
	jmp	.L4
.L5:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L4:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L5
	movl	$0, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L13:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	-1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L7
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	$0, (%rdx,%rax)
.L7:
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	-28(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	-28(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -20(%rbp)
	movl	$-1, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L9
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L9:
	addl	$1, -16(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L10
	cmpl	$0, -12(%rbp)
	jns	.L18
	jmp	.L13
.L18:
	nop
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L16:
	call	__stack_chk_fail@PLT
.L15:
	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:
