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

```c
#include<stdio.h>
#define MAX 301

int main()
{
  char array[MAX]={'\0'};
  int i,j;
  int count[4]={0};
  int temp;

  scanf("%s",&array);

  for( i=0; i<MAX; i++ ){
    if( array[i]=='K' ) count[0]++;
    if( array[i]=='U' ) count[1]++;
    if( array[i]=='P' ) count[2]++;
    if( array[i]=='C' ) count[3]++;
  }

  for( i=0; i<4; i++ ){
    for( j=2; j>=i; j-- ){
      if( count[j]<count[j+1] ){
	temp=count[j];
	count[j]=count[j+1];
	count[j+1]=temp;
      }
    }
  }
  printf("%d\n",count[3]);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.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	$352, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -320(%rbp)
	movq	$0, -312(%rbp)
	leaq	-304(%rbp), %rdx
	movl	$0, %eax
	movl	$35, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movb	%al, (%rdx)
	addq	$1, %rdx
	movq	$0, -336(%rbp)
	movq	$0, -328(%rbp)
	leaq	-320(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -348(%rbp)
	jmp	.L2
.L7:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$75, %al
	jne	.L3
	movl	-336(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -336(%rbp)
.L3:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$85, %al
	jne	.L4
	movl	-332(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -332(%rbp)
.L4:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$80, %al
	jne	.L5
	movl	-328(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -328(%rbp)
.L5:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$67, %al
	jne	.L6
	movl	-324(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -324(%rbp)
.L6:
	addl	$1, -348(%rbp)
.L2:
	cmpl	$300, -348(%rbp)
	jle	.L7
	movl	$0, -348(%rbp)
	jmp	.L8
.L12:
	movl	$2, -344(%rbp)
	jmp	.L9
.L11:
	movl	-344(%rbp), %eax
	cltq
	movl	-336(%rbp,%rax,4), %edx
	movl	-344(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-336(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-344(%rbp), %eax
	cltq
	movl	-336(%rbp,%rax,4), %eax
	movl	%eax, -340(%rbp)
	movl	-344(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-336(%rbp,%rax,4), %edx
	movl	-344(%rbp), %eax
	cltq
	movl	%edx, -336(%rbp,%rax,4)
	movl	-344(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-340(%rbp), %edx
	movl	%edx, -336(%rbp,%rax,4)
.L10:
	subl	$1, -344(%rbp)
.L9:
	movl	-344(%rbp), %eax
	cmpl	-348(%rbp), %eax
	jge	.L11
	addl	$1, -348(%rbp)
.L8:
	cmpl	$3, -348(%rbp)
	jle	.L12
	movl	-324(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$35, %ecx
	pxor	%xmm0, %xmm0
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$328, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 312(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	movq	%rsp, %rbx
	movaps	%xmm0, (%rsp)
	movq	%rbx, %rsi
	rep stosq
	movl	$0, (%rdi)
	movb	$0, 4(%rdi)
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rax
	xorl	%r11d, %r11d
	xorl	%esi, %esi
	leaq	301(%rsp), %rcx
	xorl	%r10d, %r10d
	xorl	%edi, %edi
	xorl	%ebx, %ebx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	cmpb	$85, %dl
	je	.L4
	cmpb	$80, %dl
	jne	.L5
	addl	$1, %edi
	movl	$1, %r10d
.L3:
	addq	$1, %rax
	cmpq	%rax, %rcx
	je	.L39
.L6:
	movzbl	(%rax), %edx
	cmpb	$75, %dl
	jne	.L2
	addq	$1, %rax
	addl	$1, %r8d
	movl	$1, %r13d
	cmpq	%rax, %rcx
	jne	.L6
.L39:
	salq	$32, %rsi
	testb	%r11b, %r11b
	cmovne	%rsi, %rbp
	testb	%r10b, %r10b
	je	.L8
	movl	$4294967295, %eax
	salq	$32, %rax
	andq	%rbp, %rax
	orq	%rdi, %rax
	movq	%rax, %rbp
.L8:
	testb	%bl, %bl
	je	.L9
	movq	%r9, %r12
	salq	$32, %r12
.L9:
	testb	%r13b, %r13b
	je	.L10
	movl	$4294967295, %eax
	salq	$32, %rax
	andq	%r12, %rax
	orq	%r8, %rax
	movq	%rax, %r12
.L10:
	movq	%rbp, %xmm2
	pshufd	$0xe5, %xmm2, %xmm4
	movd	%xmm4, %eax
	pshufd	$225, %xmm2, %xmm0
	cmpl	%ebp, %eax
	jle	.L18
	movq	%xmm0, %rbp
.L18:
	movq	%r12, %rdx
	movq	%rbp, %rax
	shrq	$32, %rdx
	salq	$32, %rax
	orq	%rdx, %rax
	movq	%rax, %xmm0
	movl	%eax, %edx
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm6, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L17
	movq	%xmm1, %rdx
	movl	%r12d, %r12d
	movq	%xmm1, %rax
	salq	$32, %rdx
	shrq	$32, %rax
	orq	%rdx, %r12
	movl	$4294967295, %edx
	salq	$32, %rdx
	andq	%rbp, %rdx
	orq	%rax, %rdx
	movq	%rdx, %rbp
.L17:
	movq	%r12, %xmm2
	pshufd	$0xe5, %xmm2, %xmm3
	movd	%xmm3, %edx
	pshufd	$225, %xmm2, %xmm0
	cmpl	%edx, %r12d
	jge	.L16
	movq	%xmm0, %r12
.L16:
	movq	%rbp, %xmm7
	pshufd	$225, %xmm7, %xmm0
	pshufd	$0xe5, %xmm7, %xmm7
	movd	%xmm7, %eax
	cmpl	%ebp, %eax
	jle	.L15
	movq	%xmm0, %rbp
.L15:
	movq	%rbp, %rax
	shrq	$32, %r12
	salq	$32, %rax
	orq	%r12, %rax
	movq	%rax, %xmm0
	movl	%eax, %edx
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm6, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L22
	movl	$4294967295, %edx
	movq	%xmm1, %rax
	salq	$32, %rdx
	shrq	$32, %rax
	andq	%rbp, %rdx
	orq	%rax, %rdx
	movq	%rdx, %rbp
.L22:
	movq	%rbp, %rax
	sarq	$32, %rax
	cmpl	%eax, %ebp
	jge	.L21
	movl	%ebp, %eax
	salq	$32, %rbp
	orq	%rax, %rbp
.L21:
	shrq	$32, %rbp
	xorl	%eax, %eax
	movl	$1, %edi
	movq	%rbp, %rdx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	312(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$328, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	cmpb	$67, %dl
	jne	.L3
	addl	$1, %esi
	movl	$1, %r11d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %r9d
	movl	$1, %ebx
	jmp	.L3
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$35, %ecx
	pxor	%xmm0, %xmm0
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$328, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 312(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdi
	movq	%rsp, %rbx
	movaps	%xmm0, (%rsp)
	movq	%rbx, %rsi
	rep stosq
	movl	$0, (%rdi)
	movb	$0, 4(%rdi)
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rax
	xorl	%r11d, %r11d
	xorl	%esi, %esi
	leaq	301(%rsp), %rcx
	xorl	%r10d, %r10d
	xorl	%edi, %edi
	xorl	%ebx, %ebx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	cmpb	$85, %dl
	je	.L4
	cmpb	$80, %dl
	jne	.L5
	addl	$1, %edi
	movl	$1, %r10d
.L3:
	addq	$1, %rax
	cmpq	%rax, %rcx
	je	.L39
.L6:
	movzbl	(%rax), %edx
	cmpb	$75, %dl
	jne	.L2
	addq	$1, %rax
	addl	$1, %r8d
	movl	$1, %r13d
	cmpq	%rax, %rcx
	jne	.L6
.L39:
	salq	$32, %rsi
	testb	%r11b, %r11b
	cmovne	%rsi, %rbp
	testb	%r10b, %r10b
	je	.L8
	movl	$4294967295, %eax
	salq	$32, %rax
	andq	%rbp, %rax
	orq	%rdi, %rax
	movq	%rax, %rbp
.L8:
	testb	%bl, %bl
	je	.L9
	movq	%r9, %r12
	salq	$32, %r12
.L9:
	testb	%r13b, %r13b
	je	.L10
	movl	$4294967295, %eax
	salq	$32, %rax
	andq	%r12, %rax
	orq	%r8, %rax
	movq	%rax, %r12
.L10:
	movq	%rbp, %xmm2
	pshufd	$0xe5, %xmm2, %xmm4
	movd	%xmm4, %eax
	pshufd	$225, %xmm2, %xmm0
	cmpl	%ebp, %eax
	jle	.L18
	movq	%xmm0, %rbp
.L18:
	movq	%r12, %rdx
	movq	%rbp, %rax
	shrq	$32, %rdx
	salq	$32, %rax
	orq	%rdx, %rax
	movq	%rax, %xmm0
	movl	%eax, %edx
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm6, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L17
	movq	%xmm1, %rdx
	movl	%r12d, %r12d
	movq	%xmm1, %rax
	salq	$32, %rdx
	shrq	$32, %rax
	orq	%rdx, %r12
	movl	$4294967295, %edx
	salq	$32, %rdx
	andq	%rbp, %rdx
	orq	%rax, %rdx
	movq	%rdx, %rbp
.L17:
	movq	%r12, %xmm2
	pshufd	$0xe5, %xmm2, %xmm3
	movd	%xmm3, %edx
	pshufd	$225, %xmm2, %xmm0
	cmpl	%edx, %r12d
	jge	.L16
	movq	%xmm0, %r12
.L16:
	movq	%rbp, %xmm7
	pshufd	$225, %xmm7, %xmm0
	pshufd	$0xe5, %xmm7, %xmm7
	movd	%xmm7, %eax
	cmpl	%ebp, %eax
	jle	.L15
	movq	%xmm0, %rbp
.L15:
	movq	%rbp, %rax
	shrq	$32, %r12
	salq	$32, %rax
	orq	%r12, %rax
	movq	%rax, %xmm0
	movl	%eax, %edx
	pshufd	$0xe5, %xmm0, %xmm6
	movd	%xmm6, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %edx
	jge	.L22
	movl	$4294967295, %edx
	movq	%xmm1, %rax
	salq	$32, %rdx
	shrq	$32, %rax
	andq	%rbp, %rdx
	orq	%rax, %rdx
	movq	%rdx, %rbp
.L22:
	movq	%rbp, %rax
	sarq	$32, %rax
	cmpl	%eax, %ebp
	jge	.L21
	movl	%ebp, %eax
	salq	$32, %rbp
	orq	%rax, %rbp
.L21:
	shrq	$32, %rbp
	xorl	%eax, %eax
	movl	$1, %edi
	movq	%rbp, %rdx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	312(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L40
	addq	$328, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	cmpb	$67, %dl
	jne	.L3
	addl	$1, %esi
	movl	$1, %r11d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %r9d
	movl	$1, %ebx
	jmp	.L3
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

#include<stdio.h>
#define MAX 301

int main()
{
  char array[MAX]={'\0'};
  int i,j;
  int count[4]={0};
  int temp;

  scanf("%s",&array);

  for( i=0; i<MAX; i++ ){
    if( array[i]=='K' ) count[0]++;
    if( array[i]=='U' ) count[1]++;
    if( array[i]=='P' ) count[2]++;
    if( array[i]=='C' ) count[3]++;
  }

  for( i=0; i<4; i++ ){
    for( j=2; j>=i; j-- ){
      if( count[j]<count[j+1] ){
	temp=count[j];
	count[j]=count[j+1];
	count[j+1]=temp;
      }
    }
  }
  printf("%d\n",count[3]);

  return 0;
}
KUPCkupcKUPC

2

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

```c
#include<stdio.h>
#define MAX 301

int main()
{
  char array[MAX]={'\0'};
  int i,j;
  int count[4]={0};
  int temp;

  scanf("%s",&array);

  for( i=0; i<MAX; i++ ){
    if( array[i]=='K' ) count[0]++;
    if( array[i]=='U' ) count[1]++;
    if( array[i]=='P' ) count[2]++;
    if( array[i]=='C' ) count[3]++;
  }

  for( i=0; i<4; i++ ){
    for( j=2; j>=i; j-- ){
      if( count[j]<count[j+1] ){
	temp=count[j];
	count[j]=count[j+1];
	count[j+1]=temp;
      }
    }
  }
  printf("%d\n",count[3]);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.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	$352, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -320(%rbp)
	movq	$0, -312(%rbp)
	leaq	-304(%rbp), %rdx
	movl	$0, %eax
	movl	$35, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movb	%al, (%rdx)
	addq	$1, %rdx
	movq	$0, -336(%rbp)
	movq	$0, -328(%rbp)
	leaq	-320(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -348(%rbp)
	jmp	.L2
.L7:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$75, %al
	jne	.L3
	movl	-336(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -336(%rbp)
.L3:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$85, %al
	jne	.L4
	movl	-332(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -332(%rbp)
.L4:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$80, %al
	jne	.L5
	movl	-328(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -328(%rbp)
.L5:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$67, %al
	jne	.L6
	movl	-324(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -324(%rbp)
.L6:
	addl	$1, -348(%rbp)
.L2:
	cmpl	$300, -348(%rbp)
	jle	.L7
	movl	$0, -348(%rbp)
	jmp	.L8
.L12:
	movl	$2, -344(%rbp)
	jmp	.L9
.L11:
	movl	-344(%rbp), %eax
	cltq
	movl	-336(%rbp,%rax,4), %edx
	movl	-344(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-336(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-344(%rbp), %eax
	cltq
	movl	-336(%rbp,%rax,4), %eax
	movl	%eax, -340(%rbp)
	movl	-344(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-336(%rbp,%rax,4), %edx
	movl	-344(%rbp), %eax
	cltq
	movl	%edx, -336(%rbp,%rax,4)
	movl	-344(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-340(%rbp), %edx
	movl	%edx, -336(%rbp,%rax,4)
.L10:
	subl	$1, -344(%rbp)
.L9:
	movl	-344(%rbp), %eax
	cmpl	-348(%rbp), %eax
	jge	.L11
	addl	$1, -348(%rbp)
.L8:
	cmpl	$3, -348(%rbp)
	jle	.L12
	movl	-324(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.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	$352, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -320(%rbp)
	movq	$0, -312(%rbp)
	leaq	-304(%rbp), %rdx
	movl	$0, %eax
	movl	$35, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movb	%al, (%rdx)
	addq	$1, %rdx
	movq	$0, -336(%rbp)
	movq	$0, -328(%rbp)
	leaq	-320(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -348(%rbp)
	jmp	.L2
.L7:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$75, %al
	jne	.L3
	movl	-336(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -336(%rbp)
.L3:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$85, %al
	jne	.L4
	movl	-332(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -332(%rbp)
.L4:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$80, %al
	jne	.L5
	movl	-328(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -328(%rbp)
.L5:
	movl	-348(%rbp), %eax
	cltq
	movzbl	-320(%rbp,%rax), %eax
	cmpb	$67, %al
	jne	.L6
	movl	-324(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -324(%rbp)
.L6:
	addl	$1, -348(%rbp)
.L2:
	cmpl	$300, -348(%rbp)
	jle	.L7
	movl	$0, -348(%rbp)
	jmp	.L8
.L12:
	movl	$2, -344(%rbp)
	jmp	.L9
.L11:
	movl	-344(%rbp), %eax
	cltq
	movl	-336(%rbp,%rax,4), %edx
	movl	-344(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-336(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-344(%rbp), %eax
	cltq
	movl	-336(%rbp,%rax,4), %eax
	movl	%eax, -340(%rbp)
	movl	-344(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-336(%rbp,%rax,4), %edx
	movl	-344(%rbp), %eax
	cltq
	movl	%edx, -336(%rbp,%rax,4)
	movl	-344(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-340(%rbp), %edx
	movl	%edx, -336(%rbp,%rax,4)
.L10:
	subl	$1, -344(%rbp)
.L9:
	movl	-344(%rbp), %eax
	cmpl	-348(%rbp), %eax
	jge	.L11
	addl	$1, -348(%rbp)
.L8:
	cmpl	$3, -348(%rbp)
	jle	.L12
	movl	-324(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
