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<string.h>

int main(){
    char str[21];
    int num;
    int i;
    int ch[5]={0};

    gets(str);
    num = strlen(str);
    if(num>5) ch[0]=1;
    
    for(i=0;i<num;i++){
        if(str[i]>47 && str[i]<58){
            ch[1]=1;
        }
        else if(str[i]>64 && str[i]<91){
            ch[2]=1;
        }
        else if(str[i]>96 && str[i]<123){
            ch[3]=1;
        }
        else{
            ch[4]=-1;
        }
    }
    if(ch[0]==1 && ch[1]==1 && ch[2]==1 && ch[3]==1 && ch[4]!=-1){
        printf("VALID\n");
    }
    else{
        printf("INVALID\n"); 
    }

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"VALID"
.LC1:
	.string	"INVALID"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	call	gets@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	cmpq	$5, %rax
	seta	%bpl
	testq	%rax, %rax
	je	.L2
	subl	$1, %eax
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	1(%rsp,%rax), %rdi
	xorl	%r10d, %r10d
	xorl	%esi, %esi
	movl	$1, %ebx
	movl	$-1, %r11d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L23:
	leal	-65(%rax), %ecx
	cmpb	$25, %cl
	jbe	.L8
	subl	$97, %eax
	cmpb	$26, %al
	cmovnb	%r11d, %r9d
	cmovb	%ebx, %r8d
.L3:
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	je	.L22
.L4:
	movzbl	(%rdx), %eax
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L23
	addq	$1, %rdx
	movl	$1, %esi
	cmpq	%rdx, %rdi
	jne	.L4
.L22:
	andl	%r10d, %esi
	andl	%ebp, %esi
	testb	%r8b, %sil
	je	.L2
	addl	$1, %r9d
	jne	.L24
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	movl	$1, %r10d
	jmp	.L3
.L24:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"VALID"
.LC1:
	.string	"INVALID"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	call	gets@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	cmpq	$5, %rax
	seta	%bpl
	testq	%rax, %rax
	je	.L2
	subl	$1, %eax
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	1(%rsp,%rax), %rdi
	xorl	%r10d, %r10d
	xorl	%esi, %esi
	movl	$1, %ebx
	movl	$-1, %r11d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L23:
	leal	-65(%rax), %ecx
	cmpb	$25, %cl
	jbe	.L8
	subl	$97, %eax
	cmpb	$26, %al
	cmovnb	%r11d, %r9d
	cmovb	%ebx, %r8d
.L3:
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	je	.L22
.L4:
	movzbl	(%rdx), %eax
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L23
	addq	$1, %rdx
	movl	$1, %esi
	cmpq	%rdx, %rdi
	jne	.L4
.L22:
	andl	%r10d, %esi
	andl	%ebp, %esi
	testb	%r8b, %sil
	je	.L2
	addl	$1, %r9d
	jne	.L24
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	movl	$1, %r10d
	jmp	.L3
.L24:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"VALID"
.LC1:
	.string	"INVALID"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	call	gets@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	cmpq	$5, %rax
	seta	%bpl
	testq	%rax, %rax
	je	.L2
	subl	$1, %eax
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	1(%rsp,%rax), %rdi
	xorl	%r10d, %r10d
	xorl	%esi, %esi
	movl	$1, %ebx
	movl	$-1, %r11d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L23:
	leal	-65(%rax), %ecx
	cmpb	$25, %cl
	jbe	.L8
	subl	$97, %eax
	cmpb	$26, %al
	cmovnb	%r11d, %r9d
	cmovb	%ebx, %r8d
.L3:
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	je	.L22
.L4:
	movzbl	(%rdx), %eax
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L23
	addq	$1, %rdx
	movl	$1, %esi
	cmpq	%rdx, %rdi
	jne	.L4
.L22:
	andl	%r10d, %esi
	andl	%ebp, %esi
	testb	%r8b, %sil
	je	.L2
	addl	$1, %r9d
	jne	.L24
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	movl	$1, %r10d
	jmp	.L3
.L24:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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<string.h>

int main(){
    char str[21];
    int num;
    int i;
    int ch[5]={0};

    gets(str);
    num = strlen(str);
    if(num>5) ch[0]=1;
    
    for(i=0;i<num;i++){
        if(str[i]>47 && str[i]<58){
            ch[1]=1;
        }
        else if(str[i]>64 && str[i]<91){
            ch[2]=1;
        }
        else if(str[i]>96 && str[i]<123){
            ch[3]=1;
        }
        else{
            ch[4]=-1;
        }
    }
    if(ch[0]==1 && ch[1]==1 && ch[2]==1 && ch[3]==1 && ch[4]!=-1){
        printf("VALID\n");
    }
    else{
        printf("INVALID\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<string.h>

int main(){
    char str[21];
    int num;
    int i;
    int ch[5]={0};

    gets(str);
    num = strlen(str);
    if(num>5) ch[0]=1;
    
    for(i=0;i<num;i++){
        if(str[i]>47 && str[i]<58){
            ch[1]=1;
        }
        else if(str[i]>64 && str[i]<91){
            ch[2]=1;
        }
        else if(str[i]>96 && str[i]<123){
            ch[3]=1;
        }
        else{
            ch[4]=-1;
        }
    }
    if(ch[0]==1 && ch[1]==1 && ch[2]==1 && ch[3]==1 && ch[4]!=-1){
        printf("VALID\n");
    }
    else{
        printf("INVALID\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:

passxord
 parsxosd
 parsxpsd
 qarsxpsd
 qarxspsd
 dspsxraq
 qarxspsc
 cspsxraq
 capsxrsq
 capsxqsr

INVALID
 INVALID
 INVALID
 INVALID
 INVALID
 INVALID
 INVALID
 INVALID
 INVALID
 INVALID

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<string.h>

int main(){
    char str[21];
    int num;
    int i;
    int ch[5]={0};

    gets(str);
    num = strlen(str);
    if(num>5) ch[0]=1;
    
    for(i=0;i<num;i++){
        if(str[i]>47 && str[i]<58){
            ch[1]=1;
        }
        else if(str[i]>64 && str[i]<91){
            ch[2]=1;
        }
        else if(str[i]>96 && str[i]<123){
            ch[3]=1;
        }
        else{
            ch[4]=-1;
        }
    }
    if(ch[0]==1 && ch[1]==1 && ch[2]==1 && ch[3]==1 && ch[4]!=-1){
        printf("VALID\n");
    }
    else{
        printf("INVALID\n"); 
    }

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"VALID"
.LC1:
	.string	"INVALID"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	call	gets@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	cmpq	$5, %rax
	seta	%bpl
	testq	%rax, %rax
	je	.L2
	subl	$1, %eax
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	1(%rsp,%rax), %rdi
	xorl	%r10d, %r10d
	xorl	%esi, %esi
	movl	$1, %ebx
	movl	$-1, %r11d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L23:
	leal	-65(%rax), %ecx
	cmpb	$25, %cl
	jbe	.L8
	subl	$97, %eax
	cmpb	$26, %al
	cmovnb	%r11d, %r9d
	cmovb	%ebx, %r8d
.L3:
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	je	.L22
.L4:
	movzbl	(%rdx), %eax
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L23
	addq	$1, %rdx
	movl	$1, %esi
	cmpq	%rdx, %rdi
	jne	.L4
.L22:
	andl	%r10d, %esi
	andl	%ebp, %esi
	testb	%r8b, %sil
	je	.L2
	addl	$1, %r9d
	jne	.L24
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	movl	$1, %r10d
	jmp	.L3
.L24:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"VALID"
.LC1:
	.string	"INVALID"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$40, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rdi
	call	gets@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	cmpq	$5, %rax
	seta	%bpl
	testq	%rax, %rax
	je	.L2
	subl	$1, %eax
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	1(%rsp,%rax), %rdi
	xorl	%r10d, %r10d
	xorl	%esi, %esi
	movl	$1, %ebx
	movl	$-1, %r11d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L23:
	leal	-65(%rax), %ecx
	cmpb	$25, %cl
	jbe	.L8
	subl	$97, %eax
	cmpb	$26, %al
	cmovnb	%r11d, %r9d
	cmovb	%ebx, %r8d
.L3:
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	je	.L22
.L4:
	movzbl	(%rdx), %eax
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L23
	addq	$1, %rdx
	movl	$1, %esi
	cmpq	%rdx, %rdi
	jne	.L4
.L22:
	andl	%r10d, %esi
	andl	%ebp, %esi
	testb	%r8b, %sil
	je	.L2
	addl	$1, %r9d
	jne	.L24
.L2:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	movl	$1, %r10d
	jmp	.L3
.L24:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
	jmp	.L5
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:
```