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

```c
// AOJ 2669: A-Z Cat
// 2017.10.11 bal4u@uu

#include <stdio.h>
#include <string.h>

char s[22];
char ans[22];

int main()
{
	char *p, *q;

	scanf("%s", s); p = s, q = ans;
	while (*p) {
		if (*p == 'A') {
			p++; while (*p && *p != 'Z') p++;
			if (!*p) break;
			*q++ = 'A', *q++ = 'Z';
		}
		p++;
	}
	if (q == ans) puts("-1");
	else { *q = 0; puts(ans); }
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	s(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movzbl	s(%rip), %esi
	leaq	ans(%rip), %r8
	movq	%rbx, %rcx
	movq	%r8, %rdi
	testb	%sil, %sil
	jne	.L2
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	1(%rax), %esi
	leaq	1(%rax), %rcx
	testb	%sil, %sil
	je	.L8
.L2:
	movzbl	1(%rcx), %edx
	movq	%rcx, %rax
	cmpb	$65, %sil
	jne	.L4
	addq	$1, %rax
	cmpb	$90, %dl
	je	.L5
	testb	%dl, %dl
	je	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	1(%rax), %edx
	addq	$1, %rax
	testb	%dl, %dl
	je	.L8
	cmpb	$90, %dl
	jne	.L6
.L5:
	testb	%dl, %dl
	je	.L8
	movzbl	1(%rax), %esi
	movl	$23105, %edx
	addq	$2, %rdi
	leaq	1(%rax), %rcx
	movw	%dx, -2(%rdi)
	testb	%sil, %sil
	jne	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	cmpq	%r8, %rdi
	je	.L9
	movb	$0, (%rdi)
	movq	%r8, %rdi
	call	puts@PLT
.L3:
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	ans
	.bss
	.align 16
	.type	ans, @object
	.size	ans, 22
ans:
	.zero	22
	.globl	s
	.align 16
	.type	s, @object
	.size	s, 22
s:
	.zero	22
	.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	"%s"
.LC1:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	s(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movzbl	s(%rip), %esi
	leaq	ans(%rip), %r8
	movq	%rbx, %rcx
	movq	%r8, %rdi
	testb	%sil, %sil
	jne	.L2
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	1(%rax), %esi
	leaq	1(%rax), %rcx
	testb	%sil, %sil
	je	.L8
.L2:
	movzbl	1(%rcx), %edx
	movq	%rcx, %rax
	cmpb	$65, %sil
	jne	.L4
	addq	$1, %rax
	cmpb	$90, %dl
	je	.L5
	testb	%dl, %dl
	je	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	1(%rax), %edx
	addq	$1, %rax
	testb	%dl, %dl
	je	.L8
	cmpb	$90, %dl
	jne	.L6
.L5:
	testb	%dl, %dl
	je	.L8
	movzbl	1(%rax), %esi
	movl	$23105, %edx
	addq	$2, %rdi
	leaq	1(%rax), %rcx
	movw	%dx, -2(%rdi)
	testb	%sil, %sil
	jne	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	cmpq	%r8, %rdi
	je	.L9
	movb	$0, (%rdi)
	movq	%r8, %rdi
	call	puts@PLT
.L3:
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	ans
	.bss
	.align 16
	.type	ans, @object
	.size	ans, 22
ans:
	.zero	22
	.globl	s
	.align 16
	.type	s, @object
	.size	s, 22
s:
	.zero	22
	.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	"%s"
.LC1:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	s(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movzbl	s(%rip), %esi
	leaq	ans(%rip), %r8
	movq	%rbx, %rcx
	movq	%r8, %rdi
	testb	%sil, %sil
	jne	.L2
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	1(%rax), %esi
	leaq	1(%rax), %rcx
	testb	%sil, %sil
	je	.L8
.L2:
	movzbl	1(%rcx), %edx
	movq	%rcx, %rax
	cmpb	$65, %sil
	jne	.L4
	addq	$1, %rax
	cmpb	$90, %dl
	je	.L5
	testb	%dl, %dl
	je	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	1(%rax), %edx
	addq	$1, %rax
	testb	%dl, %dl
	je	.L8
	cmpb	$90, %dl
	jne	.L6
.L5:
	testb	%dl, %dl
	je	.L8
	movzbl	1(%rax), %esi
	movl	$23105, %edx
	addq	$2, %rdi
	leaq	1(%rax), %rcx
	movw	%dx, -2(%rdi)
	testb	%sil, %sil
	jne	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	cmpq	%r8, %rdi
	je	.L9
	movb	$0, (%rdi)
	movq	%r8, %rdi
	call	puts@PLT
.L3:
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	ans
	.bss
	.align 16
	.type	ans, @object
	.size	ans, 22
ans:
	.zero	22
	.globl	s
	.align 16
	.type	s, @object
	.size	s, 22
s:
	.zero	22
	.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
// AOJ 2669: A-Z Cat
// 2017.10.11 bal4u@uu

#include <stdio.h>
#include <string.h>

char s[22];
char ans[22];

int main()
{
	char *p, *q;

	scanf("%s", s); p = s, q = ans;
	while (*p) {
		if (*p == 'A') {
			p++; while (*p && *p != 'Z') p++;
			if (!*p) break;
			*q++ = 'A', *q++ = 'Z';
		}
		p++;
	}
	if (q == ans) puts("-1");
	else { *q = 0; puts(ans); }
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// AOJ 2669: A-Z Cat
// 2017.10.11 bal4u@uu

#include <stdio.h>
#include <string.h>

char s[22];
char ans[22];

int main()
{
	char *p, *q;

	scanf("%s", s); p = s, q = ans;
	while (*p) {
		if (*p == 'A') {
			p++; while (*p && *p != 'Z') p++;
			if (!*p) break;
			*q++ = 'A', *q++ = 'Z';
		}
		p++;
	}
	if (q == ans) puts("-1");
	else { *q = 0; puts(ans); }
	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:

AOZUNYANPERIPERO
 OREQIRMQEAYNUYOA
 OREPIREPNAYNUZOA
 OREPIRNPEAYNUZOA
 OREQIRNPEAYNUZOA
 OREQIRMPEAYNUZOA
 AOZUNYAEPMRIQERO
 OREQIRMQEAYNUZOA
 ORFQIRMQEAYNUYOA
 OREQIRNQEAYNUYOA

AZ
 -1
 AZ
 AZ
 AZ
 AZ
 AZ
 AZ
 -1
 -1

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

```c
// AOJ 2669: A-Z Cat
// 2017.10.11 bal4u@uu

#include <stdio.h>
#include <string.h>

char s[22];
char ans[22];

int main()
{
	char *p, *q;

	scanf("%s", s); p = s, q = ans;
	while (*p) {
		if (*p == 'A') {
			p++; while (*p && *p != 'Z') p++;
			if (!*p) break;
			*q++ = 'A', *q++ = 'Z';
		}
		p++;
	}
	if (q == ans) puts("-1");
	else { *q = 0; puts(ans); }
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	s(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movzbl	s(%rip), %esi
	leaq	ans(%rip), %r8
	movq	%rbx, %rcx
	movq	%r8, %rdi
	testb	%sil, %sil
	jne	.L2
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	1(%rax), %esi
	leaq	1(%rax), %rcx
	testb	%sil, %sil
	je	.L8
.L2:
	movzbl	1(%rcx), %edx
	movq	%rcx, %rax
	cmpb	$65, %sil
	jne	.L4
	addq	$1, %rax
	cmpb	$90, %dl
	je	.L5
	testb	%dl, %dl
	je	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	1(%rax), %edx
	addq	$1, %rax
	testb	%dl, %dl
	je	.L8
	cmpb	$90, %dl
	jne	.L6
.L5:
	testb	%dl, %dl
	je	.L8
	movzbl	1(%rax), %esi
	movl	$23105, %edx
	addq	$2, %rdi
	leaq	1(%rax), %rcx
	movw	%dx, -2(%rdi)
	testb	%sil, %sil
	jne	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	cmpq	%r8, %rdi
	je	.L9
	movb	$0, (%rdi)
	movq	%r8, %rdi
	call	puts@PLT
.L3:
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	ans
	.bss
	.align 16
	.type	ans, @object
	.size	ans, 22
ans:
	.zero	22
	.globl	s
	.align 16
	.type	s, @object
	.size	s, 22
s:
	.zero	22
	.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	"%s"
.LC1:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	s(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movzbl	s(%rip), %esi
	leaq	ans(%rip), %r8
	movq	%rbx, %rcx
	movq	%r8, %rdi
	testb	%sil, %sil
	jne	.L2
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movzbl	1(%rax), %esi
	leaq	1(%rax), %rcx
	testb	%sil, %sil
	je	.L8
.L2:
	movzbl	1(%rcx), %edx
	movq	%rcx, %rax
	cmpb	$65, %sil
	jne	.L4
	addq	$1, %rax
	cmpb	$90, %dl
	je	.L5
	testb	%dl, %dl
	je	.L8
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	1(%rax), %edx
	addq	$1, %rax
	testb	%dl, %dl
	je	.L8
	cmpb	$90, %dl
	jne	.L6
.L5:
	testb	%dl, %dl
	je	.L8
	movzbl	1(%rax), %esi
	movl	$23105, %edx
	addq	$2, %rdi
	leaq	1(%rax), %rcx
	movw	%dx, -2(%rdi)
	testb	%sil, %sil
	jne	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	cmpq	%r8, %rdi
	je	.L9
	movb	$0, (%rdi)
	movq	%r8, %rdi
	call	puts@PLT
.L3:
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	ans
	.bss
	.align 16
	.type	ans, @object
	.size	ans, 22
ans:
	.zero	22
	.globl	s
	.align 16
	.type	s, @object
	.size	s, 22
s:
	.zero	22
	.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:
```