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[100010];
void dfs(int n){
	int t=a[n];
	while(a[t]!=-1){
		int temp=a[t];
		a[t]=-1;
		t=temp;
	}
	return;
}
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",a+i);
	if(n==k){
		int x=a[1]-1;
		int flag=1;
		for(int i=1;i<=n;i++)flag&=(a[i]-i+n)%n==x;
		puts(flag?"Yes":"No");
	}else{
		int cnt=0;
		for(int i=1;i<=n;i++)if(a[i]!=-1)dfs(i),cnt++;
		puts((n-cnt)%2&&k%2?"No":"Yes");
	}
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	a(%rip), %rsi
	movslq	%edi, %rdi
	movslq	(%rsi,%rdi,4), %rax
	movl	(%rsi,%rax,4), %edx
	cmpl	$-1, %edx
	jne	.L3
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %edx
.L3:
	movl	$-1, (%rsi,%rax,4)
	movslq	%edx, %rax
	movl	(%rsi,%rax,4), %ecx
	movslq	%edx, %rax
	cmpl	$-1, %ecx
	jne	.L4
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Yes"
.LC1:
	.string	"No"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L11
	leaq	4+a(%rip), %rbp
	movl	$1, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jge	.L12
	movl	4(%rsp), %r10d
	cmpl	%r10d, %esi
	je	.L13
	testl	%esi, %esi
	jle	.L44
	leaq	4+a(%rip), %rdi
	leal	-1(%rsi), %eax
	xorl	%r9d, %r9d
	leaq	4(%rdi), %rdx
	leaq	-4(%rdi), %rcx
	leaq	(%rdx,%rax,4), %r8
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$4, %rdi
	cmpq	%rdi, %r8
	je	.L15
.L25:
	movslq	(%rdi), %rax
	cmpl	$-1, %eax
	je	.L22
	movl	(%rcx,%rax,4), %edx
	cmpl	$-1, %edx
	je	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%edx, %rdx
	movl	$-1, (%rcx,%rax,4)
	movq	%rdx, %rax
	movl	(%rcx,%rdx,4), %edx
	cmpl	$-1, %edx
	jne	.L24
.L23:
	addq	$4, %rdi
	addl	$1, %r9d
	cmpq	%rdi, %r8
	jne	.L25
.L15:
	subl	%r9d, %esi
	leaq	.LC0(%rip), %rdi
	andb	$1, %sil
	jne	.L45
.L26:
	call	puts@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L45:
	.cfi_restore_state
	andb	$1, %r10b
	leaq	.LC1(%rip), %rax
	cmovne	%rax, %rdi
	jmp	.L26
.L13:
	movl	4+a(%rip), %eax
	leal	-1(%rax), %r8d
	testl	%esi, %esi
	jle	.L20
	leal	1(%rsi), %r10d
	movl	$1, %ecx
	movl	$1, %edi
	leaq	a(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r9,%rcx,4), %eax
	addl	%esi, %eax
	subl	%ecx, %eax
	cltd
	idivl	%esi
	xorl	%eax, %eax
	cmpl	%r8d, %edx
	sete	%al
	addq	$1, %rcx
	andl	%eax, %edi
	cmpq	%rcx, %r10
	jne	.L17
	testl	%edi, %edi
	jne	.L20
	leaq	.LC1(%rip), %rdi
	jmp	.L26
.L20:
	leaq	.LC0(%rip), %rdi
	jmp	.L26
.L11:
	movl	4(%rsp), %r10d
	cmpl	%esi, %r10d
	je	.L20
.L44:
	xorl	%r9d, %r9d
	jmp	.L15
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400040
a:
	.zero	400040
	.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
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	a(%rip), %rsi
	movslq	%edi, %rdi
	movslq	(%rsi,%rdi,4), %rax
	movl	(%rsi,%rax,4), %edx
	cmpl	$-1, %edx
	jne	.L3
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %edx
.L3:
	movl	$-1, (%rsi,%rax,4)
	movslq	%edx, %rax
	movl	(%rsi,%rax,4), %ecx
	movslq	%edx, %rax
	cmpl	$-1, %ecx
	jne	.L4
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Yes"
.LC1:
	.string	"No"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L11
	leaq	4+a(%rip), %rbp
	movl	$1, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jge	.L12
	movl	4(%rsp), %r10d
	cmpl	%r10d, %esi
	je	.L13
	testl	%esi, %esi
	jle	.L44
	leaq	4+a(%rip), %rdi
	leal	-1(%rsi), %eax
	xorl	%r9d, %r9d
	leaq	4(%rdi), %rdx
	leaq	-4(%rdi), %rcx
	leaq	(%rdx,%rax,4), %r8
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$4, %rdi
	cmpq	%rdi, %r8
	je	.L15
.L25:
	movslq	(%rdi), %rax
	cmpl	$-1, %eax
	je	.L22
	movl	(%rcx,%rax,4), %edx
	cmpl	$-1, %edx
	je	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%edx, %rdx
	movl	$-1, (%rcx,%rax,4)
	movq	%rdx, %rax
	movl	(%rcx,%rdx,4), %edx
	cmpl	$-1, %edx
	jne	.L24
.L23:
	addq	$4, %rdi
	addl	$1, %r9d
	cmpq	%rdi, %r8
	jne	.L25
.L15:
	subl	%r9d, %esi
	leaq	.LC0(%rip), %rdi
	andb	$1, %sil
	jne	.L45
.L26:
	call	puts@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L45:
	.cfi_restore_state
	andb	$1, %r10b
	leaq	.LC1(%rip), %rax
	cmovne	%rax, %rdi
	jmp	.L26
.L13:
	movl	4+a(%rip), %eax
	leal	-1(%rax), %r8d
	testl	%esi, %esi
	jle	.L20
	leal	1(%rsi), %r10d
	movl	$1, %ecx
	movl	$1, %edi
	leaq	a(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r9,%rcx,4), %eax
	addl	%esi, %eax
	subl	%ecx, %eax
	cltd
	idivl	%esi
	xorl	%eax, %eax
	cmpl	%r8d, %edx
	sete	%al
	addq	$1, %rcx
	andl	%eax, %edi
	cmpq	%rcx, %r10
	jne	.L17
	testl	%edi, %edi
	jne	.L20
	leaq	.LC1(%rip), %rdi
	jmp	.L26
.L20:
	leaq	.LC0(%rip), %rdi
	jmp	.L26
.L11:
	movl	4(%rsp), %r10d
	cmpl	%esi, %r10d
	je	.L20
.L44:
	xorl	%r9d, %r9d
	jmp	.L15
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400040
a:
	.zero	400040
	.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
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	a(%rip), %rsi
	movslq	%edi, %rdi
	movslq	(%rsi,%rdi,4), %rax
	movl	(%rsi,%rax,4), %edx
	cmpl	$-1, %edx
	jne	.L3
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %edx
.L3:
	movl	$-1, (%rsi,%rax,4)
	movslq	%edx, %rax
	movl	(%rsi,%rax,4), %ecx
	movslq	%edx, %rax
	cmpl	$-1, %ecx
	jne	.L4
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Yes"
.LC1:
	.string	"No"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L11
	leaq	4+a(%rip), %rbp
	movl	$1, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jge	.L12
	movl	4(%rsp), %r10d
	cmpl	%r10d, %esi
	je	.L13
	testl	%esi, %esi
	jle	.L44
	leaq	4+a(%rip), %rdi
	leal	-1(%rsi), %eax
	xorl	%r9d, %r9d
	leaq	4(%rdi), %rdx
	leaq	-4(%rdi), %rcx
	leaq	(%rdx,%rax,4), %r8
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$4, %rdi
	cmpq	%rdi, %r8
	je	.L15
.L25:
	movslq	(%rdi), %rax
	cmpl	$-1, %eax
	je	.L22
	movl	(%rcx,%rax,4), %edx
	cmpl	$-1, %edx
	je	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%edx, %rdx
	movl	$-1, (%rcx,%rax,4)
	movq	%rdx, %rax
	movl	(%rcx,%rdx,4), %edx
	cmpl	$-1, %edx
	jne	.L24
.L23:
	addq	$4, %rdi
	addl	$1, %r9d
	cmpq	%rdi, %r8
	jne	.L25
.L15:
	subl	%r9d, %esi
	leaq	.LC0(%rip), %rdi
	andb	$1, %sil
	jne	.L45
.L26:
	call	puts@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L45:
	.cfi_restore_state
	andb	$1, %r10b
	leaq	.LC1(%rip), %rax
	cmovne	%rax, %rdi
	jmp	.L26
.L13:
	movl	4+a(%rip), %eax
	leal	-1(%rax), %r8d
	testl	%esi, %esi
	jle	.L20
	leal	1(%rsi), %r10d
	movl	$1, %ecx
	movl	$1, %edi
	leaq	a(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r9,%rcx,4), %eax
	addl	%esi, %eax
	subl	%ecx, %eax
	cltd
	idivl	%esi
	xorl	%eax, %eax
	cmpl	%r8d, %edx
	sete	%al
	addq	$1, %rcx
	andl	%eax, %edi
	cmpq	%rcx, %r10
	jne	.L17
	testl	%edi, %edi
	jne	.L20
	leaq	.LC1(%rip), %rdi
	jmp	.L26
.L20:
	leaq	.LC0(%rip), %rdi
	jmp	.L26
.L11:
	movl	4(%rsp), %r10d
	cmpl	%esi, %r10d
	je	.L20
.L44:
	xorl	%r9d, %r9d
	jmp	.L15
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400040
a:
	.zero	400040
	.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[100010];
void dfs(int n){
	int t=a[n];
	while(a[t]!=-1){
		int temp=a[t];
		a[t]=-1;
		t=temp;
	}
	return;
}
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",a+i);
	if(n==k){
		int x=a[1]-1;
		int flag=1;
		for(int i=1;i<=n;i++)flag&=(a[i]-i+n)%n==x;
		puts(flag?"Yes":"No");
	}else{
		int cnt=0;
		for(int i=1;i<=n;i++)if(a[i]!=-1)dfs(i),cnt++;
		puts((n-cnt)%2&&k%2?"No":"Yes");
	}
}

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

```c
#include<stdio.h>

int a[100010];
void dfs(int n){
	int t=a[n];
	while(a[t]!=-1){
		int temp=a[t];
		a[t]=-1;
		t=temp;
	}
	return;
}
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",a+i);
	if(n==k){
		int x=a[1]-1;
		int flag=1;
		for(int i=1;i<=n;i++)flag&=(a[i]-i+n)%n==x;
		puts(flag?"Yes":"No");
	}else{
		int cnt=0;
		for(int i=1;i<=n;i++)if(a[i]!=-1)dfs(i),cnt++;
		puts((n-cnt)%2&&k%2?"No":"Yes");
	}
}

```

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
1 2 5
 3 1
3 2 1
 0 3
2 3 1
 0 4
2 3 1
 0 3
3 3 1
 3 2
2 2 3
 3 2
2 2 5
 0 3
4 3 1
 0 4
3 3 1
 0 3
3 0 1

Yes
 No
 Yes
 Yes
 Yes
 Yes
 Yes
 Yes
 Yes
 Yes

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[100010];
void dfs(int n){
	int t=a[n];
	while(a[t]!=-1){
		int temp=a[t];
		a[t]=-1;
		t=temp;
	}
	return;
}
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;i++)scanf("%d",a+i);
	if(n==k){
		int x=a[1]-1;
		int flag=1;
		for(int i=1;i<=n;i++)flag&=(a[i]-i+n)%n==x;
		puts(flag?"Yes":"No");
	}else{
		int cnt=0;
		for(int i=1;i<=n;i++)if(a[i]!=-1)dfs(i),cnt++;
		puts((n-cnt)%2&&k%2?"No":"Yes");
	}
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	a(%rip), %rsi
	movslq	%edi, %rdi
	movslq	(%rsi,%rdi,4), %rax
	movl	(%rsi,%rax,4), %edx
	cmpl	$-1, %edx
	jne	.L3
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %edx
.L3:
	movl	$-1, (%rsi,%rax,4)
	movslq	%edx, %rax
	movl	(%rsi,%rax,4), %ecx
	movslq	%edx, %rax
	cmpl	$-1, %ecx
	jne	.L4
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Yes"
.LC1:
	.string	"No"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L11
	leaq	4+a(%rip), %rbp
	movl	$1, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jge	.L12
	movl	4(%rsp), %r10d
	cmpl	%r10d, %esi
	je	.L13
	testl	%esi, %esi
	jle	.L44
	leaq	4+a(%rip), %rdi
	leal	-1(%rsi), %eax
	xorl	%r9d, %r9d
	leaq	4(%rdi), %rdx
	leaq	-4(%rdi), %rcx
	leaq	(%rdx,%rax,4), %r8
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$4, %rdi
	cmpq	%rdi, %r8
	je	.L15
.L25:
	movslq	(%rdi), %rax
	cmpl	$-1, %eax
	je	.L22
	movl	(%rcx,%rax,4), %edx
	cmpl	$-1, %edx
	je	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%edx, %rdx
	movl	$-1, (%rcx,%rax,4)
	movq	%rdx, %rax
	movl	(%rcx,%rdx,4), %edx
	cmpl	$-1, %edx
	jne	.L24
.L23:
	addq	$4, %rdi
	addl	$1, %r9d
	cmpq	%rdi, %r8
	jne	.L25
.L15:
	subl	%r9d, %esi
	leaq	.LC0(%rip), %rdi
	andb	$1, %sil
	jne	.L45
.L26:
	call	puts@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L45:
	.cfi_restore_state
	andb	$1, %r10b
	leaq	.LC1(%rip), %rax
	cmovne	%rax, %rdi
	jmp	.L26
.L13:
	movl	4+a(%rip), %eax
	leal	-1(%rax), %r8d
	testl	%esi, %esi
	jle	.L20
	leal	1(%rsi), %r10d
	movl	$1, %ecx
	movl	$1, %edi
	leaq	a(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r9,%rcx,4), %eax
	addl	%esi, %eax
	subl	%ecx, %eax
	cltd
	idivl	%esi
	xorl	%eax, %eax
	cmpl	%r8d, %edx
	sete	%al
	addq	$1, %rcx
	andl	%eax, %edi
	cmpq	%rcx, %r10
	jne	.L17
	testl	%edi, %edi
	jne	.L20
	leaq	.LC1(%rip), %rdi
	jmp	.L26
.L20:
	leaq	.LC0(%rip), %rdi
	jmp	.L26
.L11:
	movl	4(%rsp), %r10d
	cmpl	%esi, %r10d
	je	.L20
.L44:
	xorl	%r9d, %r9d
	jmp	.L15
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400040
a:
	.zero	400040
	.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
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	a(%rip), %rsi
	movslq	%edi, %rdi
	movslq	(%rsi,%rdi,4), %rax
	movl	(%rsi,%rax,4), %edx
	cmpl	$-1, %edx
	jne	.L3
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %edx
.L3:
	movl	$-1, (%rsi,%rax,4)
	movslq	%edx, %rax
	movl	(%rsi,%rax,4), %ecx
	movslq	%edx, %rax
	cmpl	$-1, %ecx
	jne	.L4
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	ret
	.cfi_endproc
.LFE23:
	.size	dfs, .-dfs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Yes"
.LC1:
	.string	"No"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC2(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	jle	.L11
	leaq	4+a(%rip), %rbp
	movl	$1, %ebx
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jge	.L12
	movl	4(%rsp), %r10d
	cmpl	%r10d, %esi
	je	.L13
	testl	%esi, %esi
	jle	.L44
	leaq	4+a(%rip), %rdi
	leal	-1(%rsi), %eax
	xorl	%r9d, %r9d
	leaq	4(%rdi), %rdx
	leaq	-4(%rdi), %rcx
	leaq	(%rdx,%rax,4), %r8
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$4, %rdi
	cmpq	%rdi, %r8
	je	.L15
.L25:
	movslq	(%rdi), %rax
	cmpl	$-1, %eax
	je	.L22
	movl	(%rcx,%rax,4), %edx
	cmpl	$-1, %edx
	je	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	%edx, %rdx
	movl	$-1, (%rcx,%rax,4)
	movq	%rdx, %rax
	movl	(%rcx,%rdx,4), %edx
	cmpl	$-1, %edx
	jne	.L24
.L23:
	addq	$4, %rdi
	addl	$1, %r9d
	cmpq	%rdi, %r8
	jne	.L25
.L15:
	subl	%r9d, %esi
	leaq	.LC0(%rip), %rdi
	andb	$1, %sil
	jne	.L45
.L26:
	call	puts@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L45:
	.cfi_restore_state
	andb	$1, %r10b
	leaq	.LC1(%rip), %rax
	cmovne	%rax, %rdi
	jmp	.L26
.L13:
	movl	4+a(%rip), %eax
	leal	-1(%rax), %r8d
	testl	%esi, %esi
	jle	.L20
	leal	1(%rsi), %r10d
	movl	$1, %ecx
	movl	$1, %edi
	leaq	a(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%r9,%rcx,4), %eax
	addl	%esi, %eax
	subl	%ecx, %eax
	cltd
	idivl	%esi
	xorl	%eax, %eax
	cmpl	%r8d, %edx
	sete	%al
	addq	$1, %rcx
	andl	%eax, %edi
	cmpq	%rcx, %r10
	jne	.L17
	testl	%edi, %edi
	jne	.L20
	leaq	.LC1(%rip), %rdi
	jmp	.L26
.L20:
	leaq	.LC0(%rip), %rdi
	jmp	.L26
.L11:
	movl	4(%rsp), %r10d
	cmpl	%esi, %r10d
	je	.L20
.L44:
	xorl	%r9d, %r9d
	jmp	.L15
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400040
a:
	.zero	400040
	.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:
```