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>
#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;
}```

Assembly Code:

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

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

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:

KUPCkupcKUPC

2

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>
#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;
}```

Assembly Code:

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

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