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>

char str[21];
char az[21];
char*sp,*azp;
short i;

int main(void){
scanf("%s",str);
sp = str;
azp = az;
while(*sp){
if(i){
if(*sp == 'Z'){
	i = 0;
	*azp = 'A';
	azp++;
	*azp = 'Z';
	azp++;
}
}else
if(*sp == 'A')i = 1;
sp++;
}
if(*az)printf("%s\n",az);
else printf("-1\n");
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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	str(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movzbl	str(%rip), %edx
	leaq	az(%rip), %rdi
	movq	%rbx, %rax
	movq	%rbx, sp(%rip)
	movq	%rdi, azp(%rip)
	testb	%dl, %dl
	jne	.L2
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$90, %dl
	jne	.L6
	movq	azp(%rip), %rax
	xorl	%edx, %edx
	movw	%dx, i(%rip)
	movb	$65, (%rax)
	movq	azp(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, azp(%rip)
	movb	$90, 1(%rax)
	movq	sp(%rip), %rcx
	addq	$1, azp(%rip)
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rcx), %rax
	movq	%rax, sp(%rip)
	movzbl	1(%rcx), %edx
	testb	%dl, %dl
	je	.L7
.L2:
	cmpw	$0, i(%rip)
	movq	%rax, %rcx
	jne	.L19
	cmpb	$65, %dl
	jne	.L6
	movl	$1, %eax
	movw	%ax, i(%rip)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$0, az(%rip)
	jne	.L17
	leaq	.LC1(%rip), %rdi
.L17:
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	i
	.bss
	.align 2
	.type	i, @object
	.size	i, 2
i:
	.zero	2
	.globl	azp
	.align 8
	.type	azp, @object
	.size	azp, 8
azp:
	.zero	8
	.globl	sp
	.align 8
	.type	sp, @object
	.size	sp, 8
sp:
	.zero	8
	.globl	az
	.align 16
	.type	az, @object
	.size	az, 21
az:
	.zero	21
	.globl	str
	.align 16
	.type	str, @object
	.size	str, 21
str:
	.zero	21
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	str(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movzbl	str(%rip), %edx
	leaq	az(%rip), %rdi
	movq	%rbx, %rax
	movq	%rbx, sp(%rip)
	movq	%rdi, azp(%rip)
	testb	%dl, %dl
	jne	.L2
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$90, %dl
	jne	.L6
	movq	azp(%rip), %rax
	xorl	%edx, %edx
	movw	%dx, i(%rip)
	movb	$65, (%rax)
	movq	azp(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, azp(%rip)
	movb	$90, 1(%rax)
	movq	sp(%rip), %rcx
	addq	$1, azp(%rip)
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rcx), %rax
	movq	%rax, sp(%rip)
	movzbl	1(%rcx), %edx
	testb	%dl, %dl
	je	.L7
.L2:
	cmpw	$0, i(%rip)
	movq	%rax, %rcx
	jne	.L19
	cmpb	$65, %dl
	jne	.L6
	movl	$1, %eax
	movw	%ax, i(%rip)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$0, az(%rip)
	jne	.L17
	leaq	.LC1(%rip), %rdi
.L17:
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	i
	.bss
	.align 2
	.type	i, @object
	.size	i, 2
i:
	.zero	2
	.globl	azp
	.align 8
	.type	azp, @object
	.size	azp, 8
azp:
	.zero	8
	.globl	sp
	.align 8
	.type	sp, @object
	.size	sp, 8
sp:
	.zero	8
	.globl	az
	.align 16
	.type	az, @object
	.size	az, 21
az:
	.zero	21
	.globl	str
	.align 16
	.type	str, @object
	.size	str, 21
str:
	.zero	21
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	str(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movzbl	str(%rip), %edx
	leaq	az(%rip), %rdi
	movq	%rbx, %rax
	movq	%rbx, sp(%rip)
	movq	%rdi, azp(%rip)
	testb	%dl, %dl
	jne	.L2
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$90, %dl
	jne	.L6
	movq	azp(%rip), %rax
	xorl	%edx, %edx
	movw	%dx, i(%rip)
	movb	$65, (%rax)
	movq	azp(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, azp(%rip)
	movb	$90, 1(%rax)
	movq	sp(%rip), %rcx
	addq	$1, azp(%rip)
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rcx), %rax
	movq	%rax, sp(%rip)
	movzbl	1(%rcx), %edx
	testb	%dl, %dl
	je	.L7
.L2:
	cmpw	$0, i(%rip)
	movq	%rax, %rcx
	jne	.L19
	cmpb	$65, %dl
	jne	.L6
	movl	$1, %eax
	movw	%ax, i(%rip)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$0, az(%rip)
	jne	.L17
	leaq	.LC1(%rip), %rdi
.L17:
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	i
	.bss
	.align 2
	.type	i, @object
	.size	i, 2
i:
	.zero	2
	.globl	azp
	.align 8
	.type	azp, @object
	.size	azp, 8
azp:
	.zero	8
	.globl	sp
	.align 8
	.type	sp, @object
	.size	sp, 8
sp:
	.zero	8
	.globl	az
	.align 16
	.type	az, @object
	.size	az, 21
az:
	.zero	21
	.globl	str
	.align 16
	.type	str, @object
	.size	str, 21
str:
	.zero	21
	.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>

char str[21];
char az[21];
char*sp,*azp;
short i;

int main(void){
scanf("%s",str);
sp = str;
azp = az;
while(*sp){
if(i){
if(*sp == 'Z'){
	i = 0;
	*azp = 'A';
	azp++;
	*azp = 'Z';
	azp++;
}
}else
if(*sp == 'A')i = 1;
sp++;
}
if(*az)printf("%s\n",az);
else printf("-1\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>

char str[21];
char az[21];
char*sp,*azp;
short i;

int main(void){
scanf("%s",str);
sp = str;
azp = az;
while(*sp){
if(i){
if(*sp == 'Z'){
	i = 0;
	*azp = 'A';
	azp++;
	*azp = 'Z';
	azp++;
}
}else
if(*sp == 'A')i = 1;
sp++;
}
if(*az)printf("%s\n",az);
else printf("-1\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:

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

char str[21];
char az[21];
char*sp,*azp;
short i;

int main(void){
scanf("%s",str);
sp = str;
azp = az;
while(*sp){
if(i){
if(*sp == 'Z'){
	i = 0;
	*azp = 'A';
	azp++;
	*azp = 'Z';
	azp++;
}
}else
if(*sp == 'A')i = 1;
sp++;
}
if(*az)printf("%s\n",az);
else printf("-1\n");
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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	str(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movzbl	str(%rip), %edx
	leaq	az(%rip), %rdi
	movq	%rbx, %rax
	movq	%rbx, sp(%rip)
	movq	%rdi, azp(%rip)
	testb	%dl, %dl
	jne	.L2
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$90, %dl
	jne	.L6
	movq	azp(%rip), %rax
	xorl	%edx, %edx
	movw	%dx, i(%rip)
	movb	$65, (%rax)
	movq	azp(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, azp(%rip)
	movb	$90, 1(%rax)
	movq	sp(%rip), %rcx
	addq	$1, azp(%rip)
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rcx), %rax
	movq	%rax, sp(%rip)
	movzbl	1(%rcx), %edx
	testb	%dl, %dl
	je	.L7
.L2:
	cmpw	$0, i(%rip)
	movq	%rax, %rcx
	jne	.L19
	cmpb	$65, %dl
	jne	.L6
	movl	$1, %eax
	movw	%ax, i(%rip)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$0, az(%rip)
	jne	.L17
	leaq	.LC1(%rip), %rdi
.L17:
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	i
	.bss
	.align 2
	.type	i, @object
	.size	i, 2
i:
	.zero	2
	.globl	azp
	.align 8
	.type	azp, @object
	.size	azp, 8
azp:
	.zero	8
	.globl	sp
	.align 8
	.type	sp, @object
	.size	sp, 8
sp:
	.zero	8
	.globl	az
	.align 16
	.type	az, @object
	.size	az, 21
az:
	.zero	21
	.globl	str
	.align 16
	.type	str, @object
	.size	str, 21
str:
	.zero	21
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	str(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movzbl	str(%rip), %edx
	leaq	az(%rip), %rdi
	movq	%rbx, %rax
	movq	%rbx, sp(%rip)
	movq	%rdi, azp(%rip)
	testb	%dl, %dl
	jne	.L2
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$90, %dl
	jne	.L6
	movq	azp(%rip), %rax
	xorl	%edx, %edx
	movw	%dx, i(%rip)
	movb	$65, (%rax)
	movq	azp(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, azp(%rip)
	movb	$90, 1(%rax)
	movq	sp(%rip), %rcx
	addq	$1, azp(%rip)
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rcx), %rax
	movq	%rax, sp(%rip)
	movzbl	1(%rcx), %edx
	testb	%dl, %dl
	je	.L7
.L2:
	cmpw	$0, i(%rip)
	movq	%rax, %rcx
	jne	.L19
	cmpb	$65, %dl
	jne	.L6
	movl	$1, %eax
	movw	%ax, i(%rip)
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	$0, az(%rip)
	jne	.L17
	leaq	.LC1(%rip), %rdi
.L17:
	call	puts@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	i
	.bss
	.align 2
	.type	i, @object
	.size	i, 2
i:
	.zero	2
	.globl	azp
	.align 8
	.type	azp, @object
	.size	azp, 8
azp:
	.zero	8
	.globl	sp
	.align 8
	.type	sp, @object
	.size	sp, 8
sp:
	.zero	8
	.globl	az
	.align 16
	.type	az, @object
	.size	az, 21
az:
	.zero	21
	.globl	str
	.align 16
	.type	str, @object
	.size	str, 21
str:
	.zero	21
	.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:
```