Given the following C code and 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);
}```

Assembly Code:

```assembly
	.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:
```

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"
.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
```assembly
	.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:
```
```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);
}```
Given the following C 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);
}```

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
/*
  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);
}```

Assembly Code:

```assembly
	.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:
```

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"
.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:
```