Given the following C code and 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;
}```

Assembly Code:

```assembly
	.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:
```

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\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
```assembly
	.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:
```
```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;
}```
Given the following C 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;
}```

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:

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 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;
}```

Assembly Code:

```assembly
	.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:
```

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\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:
```