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

```c
/*
  AOJ 2522
  Title:Register Phase
  @kankichi573
*/
#include <stdio.h>
#include <string.h>


char passwd[21];
main()
{
  int i,u,l,n,len,flag;
  char c;

  while(EOF!=scanf("%s",passwd))
    {
      if((len=strlen(passwd))>=6)
	{

	  u=l=n=0;
	  for(i=0;i<len;i++)
	  {
	    c=passwd[i];
	    if(isupper(c))
	      u=1;
	    if(islower(c))
	      l=1;
	    if(isdigit(c))
	      n=1;
	  }

	  flag=(u && l && n);
	}
      else
	flag=0;
      printf("%s\n",flag?"VALID":"INVALID");
    }
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	passwd
	.bss
	.align 16
	.type	passwd, @object
	.size	passwd, 21
passwd:
	.zero	21
	.section	.rodata
.LC0:
	.string	"VALID"
.LC1:
	.string	"INVALID"
.LC2:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	jmp	.L2
.L14:
	leaq	passwd(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	cmpl	$5, -4(%rbp)
	jle	.L3
	movl	$0, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L4
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	passwd(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -25(%rbp)
	movsbl	-25(%rbp), %eax
	movl	%eax, %edi
	call	isupper@PLT
	testl	%eax, %eax
	je	.L5
	movl	$1, -20(%rbp)
.L5:
	movsbl	-25(%rbp), %eax
	movl	%eax, %edi
	call	islower@PLT
	testl	%eax, %eax
	je	.L6
	movl	$1, -16(%rbp)
.L6:
	movsbl	-25(%rbp), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L7
	movl	$1, -12(%rbp)
.L7:
	addl	$1, -24(%rbp)
.L4:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L8
	cmpl	$0, -20(%rbp)
	je	.L9
	cmpl	$0, -16(%rbp)
	je	.L9
	cmpl	$0, -12(%rbp)
	je	.L9
	movl	$1, %eax
	jmp	.L10
.L9:
	movl	$0, %eax
.L10:
	movl	%eax, -8(%rbp)
	jmp	.L11
.L3:
	movl	$0, -8(%rbp)
.L11:
	cmpl	$0, -8(%rbp)
	je	.L12
	leaq	.LC0(%rip), %rax
	jmp	.L13
.L12:
	leaq	.LC1(%rip), %rax
.L13:
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	passwd(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"VALID"
.LC1:
	.string	"INVALID"
.LC2:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	passwd(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	call	puts@PLT
.L2:
	xorl	%eax, %eax
	movq	%r13, %rsi
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L18
	movq	%r13, %rdi
	call	strlen@PLT
	leaq	.LC1(%rip), %rdi
	cmpq	$5, %rax
	jbe	.L3
	movl	%eax, 12(%rsp)
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	0(%r13,%rbx), %r14d
	movl	%ecx, 8(%rsp)
	movl	%r14d, %edi
	call	isupper@PLT
	movl	%r14d, %edi
	testl	%eax, %eax
	cmovne	%ebp, %r12d
	call	islower@PLT
	movl	8(%rsp), %ecx
	leal	-48(%r14), %edx
	testl	%eax, %eax
	cmovne	%ebp, %r15d
	cmpl	$9, %edx
	cmovbe	%ebp, %ecx
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jg	.L7
	andl	%r15d, %r12d
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %rax
	andl	%ecx, %r12d
	andl	$1, %r12d
	cmove	%rax, %rdi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L18:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	passwd
	.bss
	.align 16
	.type	passwd, @object
	.size	passwd, 21
passwd:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"VALID"
.LC1:
	.string	"INVALID"
.LC2:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	passwd(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	call	puts@PLT
.L2:
	xorl	%eax, %eax
	movq	%r13, %rsi
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L18
	movq	%r13, %rdi
	call	strlen@PLT
	leaq	.LC1(%rip), %rdi
	cmpq	$5, %rax
	jbe	.L3
	movl	%eax, 12(%rsp)
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	0(%r13,%rbx), %r14d
	movl	%ecx, 8(%rsp)
	movl	%r14d, %edi
	call	isupper@PLT
	movl	%r14d, %edi
	testl	%eax, %eax
	cmovne	%ebp, %r12d
	call	islower@PLT
	movl	8(%rsp), %ecx
	leal	-48(%r14), %edx
	testl	%eax, %eax
	cmovne	%ebp, %r15d
	cmpl	$9, %edx
	cmovbe	%ebp, %ecx
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jg	.L7
	andl	%r15d, %r12d
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %rax
	andl	%ecx, %r12d
	andl	$1, %r12d
	cmove	%rax, %rdi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L18:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	passwd
	.bss
	.align 16
	.type	passwd, @object
	.size	passwd, 21
passwd:
	.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:

/*
  AOJ 2522
  Title:Register Phase
  @kankichi573
*/
#include <stdio.h>
#include <string.h>


char passwd[21];
main()
{
  int i,u,l,n,len,flag;
  char c;

  while(EOF!=scanf("%s",passwd))
    {
      if((len=strlen(passwd))>=6)
	{

	  u=l=n=0;
	  for(i=0;i<len;i++)
	  {
	    c=passwd[i];
	    if(isupper(c))
	      u=1;
	    if(islower(c))
	      l=1;
	    if(isdigit(c))
	      n=1;
	  }

	  flag=(u && l && n);
	}
      else
	flag=0;
      printf("%s\n",flag?"VALID":"INVALID");
    }
  return(0);
}
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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/*
  AOJ 2522
  Title:Register Phase
  @kankichi573
*/
#include <stdio.h>
#include <string.h>


char passwd[21];
main()
{
  int i,u,l,n,len,flag;
  char c;

  while(EOF!=scanf("%s",passwd))
    {
      if((len=strlen(passwd))>=6)
	{

	  u=l=n=0;
	  for(i=0;i<len;i++)
	  {
	    c=passwd[i];
	    if(isupper(c))
	      u=1;
	    if(islower(c))
	      l=1;
	    if(isdigit(c))
	      n=1;
	  }

	  flag=(u && l && n);
	}
      else
	flag=0;
      printf("%s\n",flag?"VALID":"INVALID");
    }
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	passwd
	.bss
	.align 16
	.type	passwd, @object
	.size	passwd, 21
passwd:
	.zero	21
	.section	.rodata
.LC0:
	.string	"VALID"
.LC1:
	.string	"INVALID"
.LC2:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	jmp	.L2
.L14:
	leaq	passwd(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	cmpl	$5, -4(%rbp)
	jle	.L3
	movl	$0, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L4
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	passwd(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -25(%rbp)
	movsbl	-25(%rbp), %eax
	movl	%eax, %edi
	call	isupper@PLT
	testl	%eax, %eax
	je	.L5
	movl	$1, -20(%rbp)
.L5:
	movsbl	-25(%rbp), %eax
	movl	%eax, %edi
	call	islower@PLT
	testl	%eax, %eax
	je	.L6
	movl	$1, -16(%rbp)
.L6:
	movsbl	-25(%rbp), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L7
	movl	$1, -12(%rbp)
.L7:
	addl	$1, -24(%rbp)
.L4:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L8
	cmpl	$0, -20(%rbp)
	je	.L9
	cmpl	$0, -16(%rbp)
	je	.L9
	cmpl	$0, -12(%rbp)
	je	.L9
	movl	$1, %eax
	jmp	.L10
.L9:
	movl	$0, %eax
.L10:
	movl	%eax, -8(%rbp)
	jmp	.L11
.L3:
	movl	$0, -8(%rbp)
.L11:
	cmpl	$0, -8(%rbp)
	je	.L12
	leaq	.LC0(%rip), %rax
	jmp	.L13
.L12:
	leaq	.LC1(%rip), %rax
.L13:
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	passwd(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
train
	.file	"temp.c"
	.text
	.globl	passwd
	.bss
	.align 16
	.type	passwd, @object
	.size	passwd, 21
passwd:
	.zero	21
	.section	.rodata
.LC0:
	.string	"VALID"
.LC1:
	.string	"INVALID"
.LC2:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	jmp	.L2
.L14:
	leaq	passwd(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -4(%rbp)
	cmpl	$5, -4(%rbp)
	jle	.L3
	movl	$0, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L4
.L8:
	movl	-24(%rbp), %eax
	cltq
	leaq	passwd(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movb	%al, -25(%rbp)
	movsbl	-25(%rbp), %eax
	movl	%eax, %edi
	call	isupper@PLT
	testl	%eax, %eax
	je	.L5
	movl	$1, -20(%rbp)
.L5:
	movsbl	-25(%rbp), %eax
	movl	%eax, %edi
	call	islower@PLT
	testl	%eax, %eax
	je	.L6
	movl	$1, -16(%rbp)
.L6:
	movsbl	-25(%rbp), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L7
	movl	$1, -12(%rbp)
.L7:
	addl	$1, -24(%rbp)
.L4:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L8
	cmpl	$0, -20(%rbp)
	je	.L9
	cmpl	$0, -16(%rbp)
	je	.L9
	cmpl	$0, -12(%rbp)
	je	.L9
	movl	$1, %eax
	jmp	.L10
.L9:
	movl	$0, %eax
.L10:
	movl	%eax, -8(%rbp)
	jmp	.L11
.L3:
	movl	$0, -8(%rbp)
.L11:
	cmpl	$0, -8(%rbp)
	je	.L12
	leaq	.LC0(%rip), %rax
	jmp	.L13
.L12:
	leaq	.LC1(%rip), %rax
.L13:
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	passwd(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
