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

int nextplayer(char s[3][128], int p[3], int player, int *winner) {
	char temp;
	temp = s[player][p[player]];
	p[player] += 1;

	if(temp == '\n' || temp == '\0') {
		*winner = player;
	}
	if(temp == 'a') {
		return 0;
	} else if(temp == 'b') {
		return 1;
	} else {
		return 2;
	}
}

int main(void) {
	int p[3];
	int winner = -1;
	int player;
	char buf[128], *ch;
	char s[3][128];

	fgets(s[0], sizeof(buf), stdin);//a's card
	fgets(s[1], sizeof(buf), stdin);//b
	fgets(s[2], sizeof(buf), stdin);//c
	p[0] = 0;
	p[1] = 0;
	p[2] = 0;

	player = 0;
	while(winner == -1) {
		player = nextplayer(s, p, player, &winner);
	}

	if(winner == 0) {
		printf("A\n");
	} else if(winner == 1) {
		printf("B\n");
	} else {
		printf("C\n");
	}

	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	nextplayer
	.type	nextplayer, @function
nextplayer:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rsi, %r8
	movslq	%edx, %rsi
	leaq	(%r8,%rsi,4), %r8
	salq	$7, %rsi
	movl	(%r8), %eax
	addq	%rsi, %rdi
	movslq	%eax, %rsi
	addl	$1, %eax
	movzbl	(%rdi,%rsi), %esi
	movl	%eax, (%r8)
	cmpb	$10, %sil
	je	.L7
	testb	%sil, %sil
	je	.L7
.L2:
	xorl	%eax, %eax
	cmpb	$97, %sil
	je	.L1
	xorl	%eax, %eax
	cmpb	$98, %sil
	setne	%al
	addl	$1, %eax
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, (%rcx)
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	nextplayer, .-nextplayer
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$424, %rsp
	.cfi_def_cfa_offset 432
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	movq	%fs:40, %rax
	movq	%rax, 408(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	call	fgets@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	leaq	144(%rsp), %rdi
	call	fgets@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	leaq	272(%rsp), %rdi
	call	fgets@PLT
	movzbl	16(%rsp), %edx
	movq	$1, (%rsp)
	movl	$0, 8(%rsp)
	testb	%dl, %dl
	je	.L14
	cmpb	$10, %dl
	je	.L14
	movq	%rsp, %r10
	leaq	4(%rsp), %r9
	leaq	8(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	cmpb	$97, %dl
	je	.L22
	cmpb	$98, %dl
	je	.L23
	movq	%r8, %rax
	movl	$2, %esi
.L15:
	movslq	%esi, %rcx
	movl	(%rax), %eax
	movq	%rcx, %rdx
	salq	$7, %rdx
	leaq	416(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movslq	%eax, %rdi
	addl	$1, %eax
	movzbl	-400(%rdx,%rdi), %edx
	movl	%eax, (%rsp,%rcx,4)
	testb	%dl, %dl
	je	.L24
	cmpb	$10, %dl
	jne	.L16
.L24:
	testl	%esi, %esi
	je	.L14
	cmpl	$1, %esi
	je	.L28
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L19:
	movq	408(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	xorl	%eax, %eax
	addq	$424, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	movq	%r9, %rax
	movl	$1, %esi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r10, %rax
	xorl	%esi, %esi
	jmp	.L15
.L28:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L19
.L14:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L19
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	nextplayer
	.type	nextplayer, @function
nextplayer:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rsi, %r8
	movslq	%edx, %rsi
	leaq	(%r8,%rsi,4), %r8
	salq	$7, %rsi
	movl	(%r8), %eax
	addq	%rsi, %rdi
	movslq	%eax, %rsi
	addl	$1, %eax
	movzbl	(%rdi,%rsi), %esi
	movl	%eax, (%r8)
	cmpb	$10, %sil
	je	.L7
	testb	%sil, %sil
	je	.L7
.L2:
	xorl	%eax, %eax
	cmpb	$97, %sil
	je	.L1
	xorl	%eax, %eax
	cmpb	$98, %sil
	setne	%al
	addl	$1, %eax
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, (%rcx)
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	nextplayer, .-nextplayer
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$424, %rsp
	.cfi_def_cfa_offset 432
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	movq	%fs:40, %rax
	movq	%rax, 408(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	call	fgets@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	leaq	144(%rsp), %rdi
	call	fgets@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	leaq	272(%rsp), %rdi
	call	fgets@PLT
	movzbl	16(%rsp), %edx
	movq	$1, (%rsp)
	movl	$0, 8(%rsp)
	testb	%dl, %dl
	je	.L14
	cmpb	$10, %dl
	je	.L14
	movq	%rsp, %r10
	leaq	4(%rsp), %r9
	leaq	8(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	cmpb	$97, %dl
	je	.L22
	cmpb	$98, %dl
	je	.L23
	movq	%r8, %rax
	movl	$2, %esi
.L15:
	movslq	%esi, %rcx
	movl	(%rax), %eax
	movq	%rcx, %rdx
	salq	$7, %rdx
	leaq	416(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movslq	%eax, %rdi
	addl	$1, %eax
	movzbl	-400(%rdx,%rdi), %edx
	movl	%eax, (%rsp,%rcx,4)
	testb	%dl, %dl
	je	.L24
	cmpb	$10, %dl
	jne	.L16
.L24:
	testl	%esi, %esi
	je	.L14
	cmpl	$1, %esi
	je	.L28
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L19:
	movq	408(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	xorl	%eax, %eax
	addq	$424, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	movq	%r9, %rax
	movl	$1, %esi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r10, %rax
	xorl	%esi, %esi
	jmp	.L15
.L28:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L19
.L14:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L19
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	nextplayer
	.type	nextplayer, @function
nextplayer:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rsi, %r8
	movslq	%edx, %rsi
	leaq	(%r8,%rsi,4), %r8
	salq	$7, %rsi
	movl	(%r8), %eax
	addq	%rsi, %rdi
	movslq	%eax, %rsi
	addl	$1, %eax
	movzbl	(%rdi,%rsi), %esi
	movl	%eax, (%r8)
	cmpb	$10, %sil
	je	.L7
	testb	%sil, %sil
	je	.L7
.L2:
	xorl	%eax, %eax
	cmpb	$97, %sil
	je	.L1
	xorl	%eax, %eax
	cmpb	$98, %sil
	setne	%al
	addl	$1, %eax
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, (%rcx)
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	nextplayer, .-nextplayer
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$424, %rsp
	.cfi_def_cfa_offset 432
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	movq	%fs:40, %rax
	movq	%rax, 408(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	call	fgets@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	leaq	144(%rsp), %rdi
	call	fgets@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	leaq	272(%rsp), %rdi
	call	fgets@PLT
	movzbl	16(%rsp), %edx
	movq	$1, (%rsp)
	movl	$0, 8(%rsp)
	testb	%dl, %dl
	je	.L14
	cmpb	$10, %dl
	je	.L14
	movq	%rsp, %r10
	leaq	4(%rsp), %r9
	leaq	8(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	cmpb	$97, %dl
	je	.L22
	cmpb	$98, %dl
	je	.L23
	movq	%r8, %rax
	movl	$2, %esi
.L15:
	movslq	%esi, %rcx
	movl	(%rax), %eax
	movq	%rcx, %rdx
	salq	$7, %rdx
	leaq	416(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movslq	%eax, %rdi
	addl	$1, %eax
	movzbl	-400(%rdx,%rdi), %edx
	movl	%eax, (%rsp,%rcx,4)
	testb	%dl, %dl
	je	.L24
	cmpb	$10, %dl
	jne	.L16
.L24:
	testl	%esi, %esi
	je	.L14
	cmpl	$1, %esi
	je	.L28
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L19:
	movq	408(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	xorl	%eax, %eax
	addq	$424, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	movq	%r9, %rax
	movl	$1, %esi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r10, %rax
	xorl	%esi, %esi
	jmp	.L15
.L28:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L19
.L14:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L19
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```
```c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int nextplayer(char s[3][128], int p[3], int player, int *winner) {
	char temp;
	temp = s[player][p[player]];
	p[player] += 1;

	if(temp == '\n' || temp == '\0') {
		*winner = player;
	}
	if(temp == 'a') {
		return 0;
	} else if(temp == 'b') {
		return 1;
	} else {
		return 2;
	}
}

int main(void) {
	int p[3];
	int winner = -1;
	int player;
	char buf[128], *ch;
	char s[3][128];

	fgets(s[0], sizeof(buf), stdin);//a's card
	fgets(s[1], sizeof(buf), stdin);//b
	fgets(s[2], sizeof(buf), stdin);//c
	p[0] = 0;
	p[1] = 0;
	p[2] = 0;

	player = 0;
	while(winner == -1) {
		player = nextplayer(s, p, player, &winner);
	}

	if(winner == 0) {
		printf("A\n");
	} else if(winner == 1) {
		printf("B\n");
	} else {
		printf("C\n");
	}

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

```c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int nextplayer(char s[3][128], int p[3], int player, int *winner) {
	char temp;
	temp = s[player][p[player]];
	p[player] += 1;

	if(temp == '\n' || temp == '\0') {
		*winner = player;
	}
	if(temp == 'a') {
		return 0;
	} else if(temp == 'b') {
		return 1;
	} else {
		return 2;
	}
}

int main(void) {
	int p[3];
	int winner = -1;
	int player;
	char buf[128], *ch;
	char s[3][128];

	fgets(s[0], sizeof(buf), stdin);//a's card
	fgets(s[1], sizeof(buf), stdin);//b
	fgets(s[2], sizeof(buf), stdin);//c
	p[0] = 0;
	p[1] = 0;
	p[2] = 0;

	player = 0;
	while(winner == -1) {
		player = nextplayer(s, p, player, &winner);
	}

	if(winner == 0) {
		printf("A\n");
	} else if(winner == 1) {
		printf("B\n");
	} else {
		printf("C\n");
	}

	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:

abcb
aabb
bccc
 caa
accc
ca
 aaca
aabb
cccc
 abcb
bbaa
bccc
 aacb
bbaa
bccc
 aacb
bbaa
cccb
 aaca
bbaa
cccb
 aaca
aabb
cccb
 acaa
aabb
cccc
 acaa
abab
cccc

B
 A
 C
 B
 A
 A
 A
 A
 C
 C

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

int nextplayer(char s[3][128], int p[3], int player, int *winner) {
	char temp;
	temp = s[player][p[player]];
	p[player] += 1;

	if(temp == '\n' || temp == '\0') {
		*winner = player;
	}
	if(temp == 'a') {
		return 0;
	} else if(temp == 'b') {
		return 1;
	} else {
		return 2;
	}
}

int main(void) {
	int p[3];
	int winner = -1;
	int player;
	char buf[128], *ch;
	char s[3][128];

	fgets(s[0], sizeof(buf), stdin);//a's card
	fgets(s[1], sizeof(buf), stdin);//b
	fgets(s[2], sizeof(buf), stdin);//c
	p[0] = 0;
	p[1] = 0;
	p[2] = 0;

	player = 0;
	while(winner == -1) {
		player = nextplayer(s, p, player, &winner);
	}

	if(winner == 0) {
		printf("A\n");
	} else if(winner == 1) {
		printf("B\n");
	} else {
		printf("C\n");
	}

	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	nextplayer
	.type	nextplayer, @function
nextplayer:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rsi, %r8
	movslq	%edx, %rsi
	leaq	(%r8,%rsi,4), %r8
	salq	$7, %rsi
	movl	(%r8), %eax
	addq	%rsi, %rdi
	movslq	%eax, %rsi
	addl	$1, %eax
	movzbl	(%rdi,%rsi), %esi
	movl	%eax, (%r8)
	cmpb	$10, %sil
	je	.L7
	testb	%sil, %sil
	je	.L7
.L2:
	xorl	%eax, %eax
	cmpb	$97, %sil
	je	.L1
	xorl	%eax, %eax
	cmpb	$98, %sil
	setne	%al
	addl	$1, %eax
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, (%rcx)
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	nextplayer, .-nextplayer
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$424, %rsp
	.cfi_def_cfa_offset 432
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	movq	%fs:40, %rax
	movq	%rax, 408(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	call	fgets@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	leaq	144(%rsp), %rdi
	call	fgets@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	leaq	272(%rsp), %rdi
	call	fgets@PLT
	movzbl	16(%rsp), %edx
	movq	$1, (%rsp)
	movl	$0, 8(%rsp)
	testb	%dl, %dl
	je	.L14
	cmpb	$10, %dl
	je	.L14
	movq	%rsp, %r10
	leaq	4(%rsp), %r9
	leaq	8(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	cmpb	$97, %dl
	je	.L22
	cmpb	$98, %dl
	je	.L23
	movq	%r8, %rax
	movl	$2, %esi
.L15:
	movslq	%esi, %rcx
	movl	(%rax), %eax
	movq	%rcx, %rdx
	salq	$7, %rdx
	leaq	416(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movslq	%eax, %rdi
	addl	$1, %eax
	movzbl	-400(%rdx,%rdi), %edx
	movl	%eax, (%rsp,%rcx,4)
	testb	%dl, %dl
	je	.L24
	cmpb	$10, %dl
	jne	.L16
.L24:
	testl	%esi, %esi
	je	.L14
	cmpl	$1, %esi
	je	.L28
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L19:
	movq	408(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	xorl	%eax, %eax
	addq	$424, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	movq	%r9, %rax
	movl	$1, %esi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r10, %rax
	xorl	%esi, %esi
	jmp	.L15
.L28:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L19
.L14:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L19
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	nextplayer
	.type	nextplayer, @function
nextplayer:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rsi, %r8
	movslq	%edx, %rsi
	leaq	(%r8,%rsi,4), %r8
	salq	$7, %rsi
	movl	(%r8), %eax
	addq	%rsi, %rdi
	movslq	%eax, %rsi
	addl	$1, %eax
	movzbl	(%rdi,%rsi), %esi
	movl	%eax, (%r8)
	cmpb	$10, %sil
	je	.L7
	testb	%sil, %sil
	je	.L7
.L2:
	xorl	%eax, %eax
	cmpb	$97, %sil
	je	.L1
	xorl	%eax, %eax
	cmpb	$98, %sil
	setne	%al
	addl	$1, %eax
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edx, (%rcx)
	jmp	.L2
	.cfi_endproc
.LFE51:
	.size	nextplayer, .-nextplayer
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"A"
.LC1:
	.string	"B"
.LC2:
	.string	"C"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$424, %rsp
	.cfi_def_cfa_offset 432
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	movq	%fs:40, %rax
	movq	%rax, 408(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	call	fgets@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	leaq	144(%rsp), %rdi
	call	fgets@PLT
	movq	stdin(%rip), %rdx
	movl	$128, %esi
	leaq	272(%rsp), %rdi
	call	fgets@PLT
	movzbl	16(%rsp), %edx
	movq	$1, (%rsp)
	movl	$0, 8(%rsp)
	testb	%dl, %dl
	je	.L14
	cmpb	$10, %dl
	je	.L14
	movq	%rsp, %r10
	leaq	4(%rsp), %r9
	leaq	8(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	cmpb	$97, %dl
	je	.L22
	cmpb	$98, %dl
	je	.L23
	movq	%r8, %rax
	movl	$2, %esi
.L15:
	movslq	%esi, %rcx
	movl	(%rax), %eax
	movq	%rcx, %rdx
	salq	$7, %rdx
	leaq	416(%rdx), %rdi
	leaq	(%rsp,%rdi), %rdx
	movslq	%eax, %rdi
	addl	$1, %eax
	movzbl	-400(%rdx,%rdi), %edx
	movl	%eax, (%rsp,%rcx,4)
	testb	%dl, %dl
	je	.L24
	cmpb	$10, %dl
	jne	.L16
.L24:
	testl	%esi, %esi
	je	.L14
	cmpl	$1, %esi
	je	.L28
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L19:
	movq	408(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	xorl	%eax, %eax
	addq	$424, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	movq	%r9, %rax
	movl	$1, %esi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r10, %rax
	xorl	%esi, %esi
	jmp	.L15
.L28:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L19
.L14:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L19
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```