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>
#include<string.h>
#include<stdbool.h>

int a[200001];
int rocker[200001];
int rocker_no[200001];
bool rocker_judge[200001];

int main()
{
    int n, d, c, j, r_num;
    long long k;
    
    scanf("%d %lld", &n, &k);

    for (int i = 1; i<=n; i++)
    {
        scanf("%d", &a[i]);
        rocker_judge[i] = true;
    }

    c = 1;
    j = 1;

    for (;rocker_judge[c] == true; j++)
    {
        rocker_judge[c] = false;
        rocker_no[c] = j;
        rocker[j] = c;
        c = a[c];
    }

    r_num = j - rocker_no[c]; 

    if ((k+1) <= rocker_no[c]){
        d = rocker[k+1];
    } else {
        d = rocker[((k - (rocker_no[c] - 1))%r_num) + rocker_no[c]];
    }

    printf("%d", d);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800004
a:
	.zero	800004
	.globl	rocker
	.align 32
	.type	rocker, @object
	.size	rocker, 800004
rocker:
	.zero	800004
	.globl	rocker_no
	.align 32
	.type	rocker_no, @object
	.size	rocker_no, 800004
rocker_no:
	.zero	800004
	.globl	rocker_judge
	.align 32
	.type	rocker_judge, @object
	.size	rocker_judge, 200001
rocker_judge:
	.zero	200001
	.section	.rodata
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%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
	leaq	-16(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -24(%rbp)
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	cltq
	leaq	rocker_judge(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -24(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L3
	movl	$1, -32(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	cltq
	leaq	rocker_judge(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rocker_no(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rocker(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	addl	$1, -28(%rbp)
.L4:
	movl	-32(%rbp), %eax
	cltq
	leaq	rocker_judge(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L5
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rocker_no(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rocker_no(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movq	-16(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	leaq	rocker(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -36(%rbp)
	jmp	.L7
.L6:
	movq	-16(%rbp), %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	rocker_no(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rocker_no(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	rocker(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -36(%rbp)
.L7:
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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 %lld"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	movl	$1, %ebx
	leaq	a(%rip), %r12
	leaq	rocker_judge(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx,4), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movb	$1, 0(%rbp,%rbx)
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jge	.L3
.L2:
	cmpb	$0, 1+rocker_judge(%rip)
	je	.L9
	movl	$1, %edx
	leaq	4+rocker(%rip), %rsi
	movl	$1, %ecx
	movl	$1, %eax
	leaq	a(%rip), %r12
	leaq	rocker_judge(%rip), %rbp
	leaq	rocker_no(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L5:
	movb	$0, 0(%rbp,%rax)
	addq	$4, %rsi
	movl	%edx, (%rdi,%rax,4)
	movslq	(%r12,%rax,4), %rax
	addl	$1, %edx
	movl	%ecx, -4(%rsi)
	cmpb	$0, 0(%rbp,%rax)
	movq	%rax, %rcx
	jne	.L5
.L4:
	movslq	(%rdi,%rax,4), %rsi
	movq	16(%rsp), %rax
	cmpq	%rax, %rsi
	jle	.L6
	leaq	rocker(%rip), %rdx
	movl	4(%rdx,%rax,4), %edx
.L7:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L6:
	.cfi_restore_state
	leal	-1(%rsi), %edi
	subl	%esi, %edx
	movslq	%edi, %rdi
	movslq	%edx, %rcx
	subq	%rdi, %rax
	cqto
	idivq	%rcx
	leaq	rocker(%rip), %rax
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %edx
	jmp	.L7
.L9:
	movl	$1, %edx
	movl	$1, %eax
	leaq	rocker_no(%rip), %rdi
	jmp	.L4
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	rocker_judge
	.bss
	.align 32
	.type	rocker_judge, @object
	.size	rocker_judge, 200001
rocker_judge:
	.zero	200001
	.globl	rocker_no
	.align 32
	.type	rocker_no, @object
	.size	rocker_no, 800004
rocker_no:
	.zero	800004
	.globl	rocker
	.align 32
	.type	rocker, @object
	.size	rocker, 800004
rocker:
	.zero	800004
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800004
a:
	.zero	800004
	.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 %lld"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	movl	$1, %ebx
	leaq	a(%rip), %r12
	leaq	rocker_judge(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx,4), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movb	$1, 0(%rbp,%rbx)
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jge	.L3
.L2:
	cmpb	$0, 1+rocker_judge(%rip)
	je	.L9
	movl	$1, %edx
	leaq	4+rocker(%rip), %rsi
	movl	$1, %ecx
	movl	$1, %eax
	leaq	a(%rip), %r12
	leaq	rocker_judge(%rip), %rbp
	leaq	rocker_no(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L5:
	movb	$0, 0(%rbp,%rax)
	addq	$4, %rsi
	movl	%edx, (%rdi,%rax,4)
	movslq	(%r12,%rax,4), %rax
	addl	$1, %edx
	movl	%ecx, -4(%rsi)
	cmpb	$0, 0(%rbp,%rax)
	movq	%rax, %rcx
	jne	.L5
.L4:
	movslq	(%rdi,%rax,4), %rsi
	movq	16(%rsp), %rax
	cmpq	%rax, %rsi
	jle	.L6
	leaq	rocker(%rip), %rdx
	movl	4(%rdx,%rax,4), %edx
.L7:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L6:
	.cfi_restore_state
	leal	-1(%rsi), %edi
	subl	%esi, %edx
	movslq	%edi, %rdi
	movslq	%edx, %rcx
	subq	%rdi, %rax
	cqto
	idivq	%rcx
	leaq	rocker(%rip), %rax
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %edx
	jmp	.L7
.L9:
	movl	$1, %edx
	movl	$1, %eax
	leaq	rocker_no(%rip), %rdi
	jmp	.L4
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	rocker_judge
	.bss
	.align 32
	.type	rocker_judge, @object
	.size	rocker_judge, 200001
rocker_judge:
	.zero	200001
	.globl	rocker_no
	.align 32
	.type	rocker_no, @object
	.size	rocker_no, 800004
rocker_no:
	.zero	800004
	.globl	rocker
	.align 32
	.type	rocker, @object
	.size	rocker, 800004
rocker:
	.zero	800004
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800004
a:
	.zero	800004
	.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>
#include<string.h>
#include<stdbool.h>

int a[200001];
int rocker[200001];
int rocker_no[200001];
bool rocker_judge[200001];

int main()
{
    int n, d, c, j, r_num;
    long long k;
    
    scanf("%d %lld", &n, &k);

    for (int i = 1; i<=n; i++)
    {
        scanf("%d", &a[i]);
        rocker_judge[i] = true;
    }

    c = 1;
    j = 1;

    for (;rocker_judge[c] == true; j++)
    {
        rocker_judge[c] = false;
        rocker_no[c] = j;
        rocker[j] = c;
        c = a[c];
    }

    r_num = j - rocker_no[c]; 

    if ((k+1) <= rocker_no[c]){
        d = rocker[k+1];
    } else {
        d = rocker[((k - (rocker_no[c] - 1))%r_num) + rocker_no[c]];
    }

    printf("%d", d);

    return 0;
}
6 727202214173249351
6 5 1 5 3 2
 4 9
3 2 4 1
 6 1007784494318310970
6 5 2 5 3 2
 6 237500909755776657
6 4 1 5 3 2
 6 727202214173249351
4 5 2 5 3 2
 6 165759462200935729
4 5 2 5 3 2
 6 727202214173249351
6 4 1 5 3 2
 4 0
3 2 4 1
 6 727202214173249351
6 4 1 1 3 2
 6 237500909755776657
2 4 1 5 3 2

6 1 3 4 5 2 3 1 4 4
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>
#include<string.h>
#include<stdbool.h>

int a[200001];
int rocker[200001];
int rocker_no[200001];
bool rocker_judge[200001];

int main()
{
    int n, d, c, j, r_num;
    long long k;
    
    scanf("%d %lld", &n, &k);

    for (int i = 1; i<=n; i++)
    {
        scanf("%d", &a[i]);
        rocker_judge[i] = true;
    }

    c = 1;
    j = 1;

    for (;rocker_judge[c] == true; j++)
    {
        rocker_judge[c] = false;
        rocker_no[c] = j;
        rocker[j] = c;
        c = a[c];
    }

    r_num = j - rocker_no[c]; 

    if ((k+1) <= rocker_no[c]){
        d = rocker[k+1];
    } else {
        d = rocker[((k - (rocker_no[c] - 1))%r_num) + rocker_no[c]];
    }

    printf("%d", d);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800004
a:
	.zero	800004
	.globl	rocker
	.align 32
	.type	rocker, @object
	.size	rocker, 800004
rocker:
	.zero	800004
	.globl	rocker_no
	.align 32
	.type	rocker_no, @object
	.size	rocker_no, 800004
rocker_no:
	.zero	800004
	.globl	rocker_judge
	.align 32
	.type	rocker_judge, @object
	.size	rocker_judge, 200001
rocker_judge:
	.zero	200001
	.section	.rodata
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%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
	leaq	-16(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -24(%rbp)
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	cltq
	leaq	rocker_judge(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -24(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L3
	movl	$1, -32(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	cltq
	leaq	rocker_judge(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rocker_no(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rocker(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	addl	$1, -28(%rbp)
.L4:
	movl	-32(%rbp), %eax
	cltq
	leaq	rocker_judge(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L5
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rocker_no(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rocker_no(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movq	-16(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	leaq	rocker(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -36(%rbp)
	jmp	.L7
.L6:
	movq	-16(%rbp), %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	rocker_no(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rocker_no(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	rocker(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -36(%rbp)
.L7:
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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, 800004
a:
	.zero	800004
	.globl	rocker
	.align 32
	.type	rocker, @object
	.size	rocker, 800004
rocker:
	.zero	800004
	.globl	rocker_no
	.align 32
	.type	rocker_no, @object
	.size	rocker_no, 800004
rocker_no:
	.zero	800004
	.globl	rocker_judge
	.align 32
	.type	rocker_judge, @object
	.size	rocker_judge, 200001
rocker_judge:
	.zero	200001
	.section	.rodata
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%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
	leaq	-16(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -24(%rbp)
	jmp	.L2
.L3:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	cltq
	leaq	rocker_judge(%rip), %rdx
	movb	$1, (%rax,%rdx)
	addl	$1, -24(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L3
	movl	$1, -32(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L4
.L5:
	movl	-32(%rbp), %eax
	cltq
	leaq	rocker_judge(%rip), %rdx
	movb	$0, (%rax,%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rocker_no(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	rocker(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -32(%rbp)
	addl	$1, -28(%rbp)
.L4:
	movl	-32(%rbp), %eax
	cltq
	leaq	rocker_judge(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	testb	%al, %al
	jne	.L5
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rocker_no(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rocker_no(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L6
	movq	-16(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	leaq	rocker(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -36(%rbp)
	jmp	.L7
.L6:
	movq	-16(%rbp), %rax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	rocker_no(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	subq	%rdx, %rax
	movl	-20(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	rocker_no(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	rocker(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -36(%rbp)
.L7:
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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:
