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>
#include<string.h>
#define n 100000

int main(){
  long N, topp = 0, i;
  char s[n];
  scanf("%s", s);
  N = strlen(s);
  for(i = 0; i < N; i ++){
    if(s[i] == 'p') topp ++;
  }
  printf("%ld\n", N/2 - topp);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%ld\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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1744, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -100040(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, -100024(%rbp)
	movq	$0, -100032(%rbp)
	jmp	.L2
.L4:
	leaq	-100016(%rbp), %rdx
	movq	-100032(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$112, %al
	jne	.L3
	addq	$1, -100040(%rbp)
.L3:
	addq	$1, -100032(%rbp)
.L2:
	movq	-100032(%rbp), %rax
	cmpq	-100024(%rbp), %rax
	jl	.L4
	movq	-100024(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	subq	-100040(%rbp), %rax
	movq	%rax, %rsi
	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	.L6
	call	__stack_chk_fail@PLT
.L6:
	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"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1712, %rsp
	.cfi_def_cfa_offset 100032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%rax, %rdx
	testq	%rax, %rax
	je	.L24
	leaq	-1(%rax), %rax
	cmpq	$14, %rax
	jbe	.L25
	movq	%rdx, %rcx
	pxor	%xmm10, %xmm10
	pxor	%xmm5, %xmm5
	movq	%rbx, %rax
	andq	$-16, %rcx
	movdqa	.LC1(%rip), %xmm7
	pxor	%xmm4, %xmm4
	pxor	%xmm3, %xmm3
	movdqa	.LC2(%rip), %xmm6
	addq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm7, %xmm0
	movdqa	%xmm5, %xmm1
	movdqa	%xmm3, %xmm11
	addq	$16, %rax
	pcmpeqb	-16(%rax), %xmm0
	pand	%xmm6, %xmm0
	pcmpgtb	%xmm0, %xmm1
	movdqa	%xmm0, %xmm2
	punpcklbw	%xmm1, %xmm2
	punpckhbw	%xmm1, %xmm0
	movdqa	%xmm4, %xmm1
	pcmpgtw	%xmm2, %xmm1
	movdqa	%xmm2, %xmm9
	movdqa	%xmm0, %xmm8
	punpcklwd	%xmm1, %xmm9
	punpckhwd	%xmm1, %xmm2
	movdqa	%xmm4, %xmm1
	pcmpgtw	%xmm0, %xmm1
	pcmpgtd	%xmm9, %xmm11
	punpcklwd	%xmm1, %xmm8
	punpckhwd	%xmm1, %xmm0
	movdqa	%xmm9, %xmm1
	punpckldq	%xmm11, %xmm1
	punpckhdq	%xmm11, %xmm9
	paddq	%xmm10, %xmm1
	movdqa	%xmm2, %xmm10
	paddq	%xmm9, %xmm1
	movdqa	%xmm3, %xmm9
	pcmpgtd	%xmm2, %xmm9
	punpckldq	%xmm9, %xmm10
	punpckhdq	%xmm9, %xmm2
	movdqa	%xmm3, %xmm9
	pcmpgtd	%xmm8, %xmm9
	paddq	%xmm10, %xmm1
	paddq	%xmm2, %xmm1
	movdqa	%xmm8, %xmm2
	punpckldq	%xmm9, %xmm2
	paddq	%xmm2, %xmm1
	movdqa	%xmm8, %xmm2
	movdqa	%xmm0, %xmm8
	punpckhdq	%xmm9, %xmm2
	paddq	%xmm2, %xmm1
	movdqa	%xmm3, %xmm2
	pcmpgtd	%xmm0, %xmm2
	punpckldq	%xmm2, %xmm8
	punpckhdq	%xmm2, %xmm0
	paddq	%xmm8, %xmm1
	paddq	%xmm0, %xmm1
	movdqa	%xmm1, %xmm10
	cmpq	%rax, %rcx
	jne	.L4
	movdqa	%xmm1, %xmm0
	movq	%rdx, %rcx
	psrldq	$8, %xmm0
	andq	$-16, %rcx
	paddq	%xmm0, %xmm10
	movq	%xmm10, %rax
	testb	$15, %dl
	je	.L2
.L3:
	cmpb	$112, (%rsp,%rcx)
	jne	.L7
	addq	$1, %rax
.L7:
	leaq	1(%rcx), %rsi
	cmpq	%rdx, %rsi
	jge	.L2
	cmpb	$112, 1(%rsp,%rcx)
	je	.L29
.L8:
	leaq	2(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 2(%rsp,%rcx)
	je	.L30
.L9:
	leaq	3(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 3(%rsp,%rcx)
	je	.L31
.L10:
	leaq	4(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 4(%rsp,%rcx)
	je	.L32
.L11:
	leaq	5(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 5(%rsp,%rcx)
	jne	.L12
	addq	$1, %rax
.L12:
	leaq	6(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 6(%rsp,%rcx)
	jne	.L13
	addq	$1, %rax
.L13:
	leaq	7(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 7(%rsp,%rcx)
	jne	.L14
	addq	$1, %rax
.L14:
	leaq	8(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 8(%rsp,%rcx)
	jne	.L15
	addq	$1, %rax
.L15:
	leaq	9(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 9(%rsp,%rcx)
	je	.L33
.L16:
	leaq	10(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 10(%rsp,%rcx)
	je	.L34
.L17:
	leaq	11(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 11(%rsp,%rcx)
	je	.L35
.L18:
	leaq	12(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 12(%rsp,%rcx)
	je	.L36
.L19:
	leaq	13(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 13(%rsp,%rcx)
	jne	.L20
	addq	$1, %rax
.L20:
	addq	$14, %rcx
	cmpq	%rcx, %rdx
	jle	.L2
	cmpb	$112, (%rsp,%rcx)
	jne	.L2
	addq	$1, %rax
	.p2align 4,,10
	.p2align 3
.L2:
	sarq	%rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	subq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L29:
	.cfi_restore_state
	addq	$1, %rax
	jmp	.L8
.L30:
	addq	$1, %rax
	jmp	.L9
.L31:
	addq	$1, %rax
	jmp	.L10
.L32:
	addq	$1, %rax
	jmp	.L11
.L33:
	addq	$1, %rax
	jmp	.L16
.L34:
	addq	$1, %rax
	jmp	.L17
.L35:
	addq	$1, %rax
	jmp	.L18
.L36:
	addq	$1, %rax
	jmp	.L19
.L24:
	xorl	%eax, %eax
	jmp	.L2
.L25:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L3
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.align 16
.LC2:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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"
.LC3:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1712, %rsp
	.cfi_def_cfa_offset 100032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movq	%rax, %rdx
	testq	%rax, %rax
	je	.L24
	leaq	-1(%rax), %rax
	cmpq	$14, %rax
	jbe	.L25
	movq	%rdx, %rcx
	pxor	%xmm10, %xmm10
	pxor	%xmm5, %xmm5
	movq	%rbx, %rax
	andq	$-16, %rcx
	movdqa	.LC1(%rip), %xmm7
	pxor	%xmm4, %xmm4
	pxor	%xmm3, %xmm3
	movdqa	.LC2(%rip), %xmm6
	addq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm7, %xmm0
	movdqa	%xmm5, %xmm1
	movdqa	%xmm3, %xmm11
	addq	$16, %rax
	pcmpeqb	-16(%rax), %xmm0
	pand	%xmm6, %xmm0
	pcmpgtb	%xmm0, %xmm1
	movdqa	%xmm0, %xmm2
	punpcklbw	%xmm1, %xmm2
	punpckhbw	%xmm1, %xmm0
	movdqa	%xmm4, %xmm1
	pcmpgtw	%xmm2, %xmm1
	movdqa	%xmm2, %xmm9
	movdqa	%xmm0, %xmm8
	punpcklwd	%xmm1, %xmm9
	punpckhwd	%xmm1, %xmm2
	movdqa	%xmm4, %xmm1
	pcmpgtw	%xmm0, %xmm1
	pcmpgtd	%xmm9, %xmm11
	punpcklwd	%xmm1, %xmm8
	punpckhwd	%xmm1, %xmm0
	movdqa	%xmm9, %xmm1
	punpckldq	%xmm11, %xmm1
	punpckhdq	%xmm11, %xmm9
	paddq	%xmm10, %xmm1
	movdqa	%xmm2, %xmm10
	paddq	%xmm9, %xmm1
	movdqa	%xmm3, %xmm9
	pcmpgtd	%xmm2, %xmm9
	punpckldq	%xmm9, %xmm10
	punpckhdq	%xmm9, %xmm2
	movdqa	%xmm3, %xmm9
	pcmpgtd	%xmm8, %xmm9
	paddq	%xmm10, %xmm1
	paddq	%xmm2, %xmm1
	movdqa	%xmm8, %xmm2
	punpckldq	%xmm9, %xmm2
	paddq	%xmm2, %xmm1
	movdqa	%xmm8, %xmm2
	movdqa	%xmm0, %xmm8
	punpckhdq	%xmm9, %xmm2
	paddq	%xmm2, %xmm1
	movdqa	%xmm3, %xmm2
	pcmpgtd	%xmm0, %xmm2
	punpckldq	%xmm2, %xmm8
	punpckhdq	%xmm2, %xmm0
	paddq	%xmm8, %xmm1
	paddq	%xmm0, %xmm1
	movdqa	%xmm1, %xmm10
	cmpq	%rax, %rcx
	jne	.L4
	movdqa	%xmm1, %xmm0
	movq	%rdx, %rcx
	psrldq	$8, %xmm0
	andq	$-16, %rcx
	paddq	%xmm0, %xmm10
	movq	%xmm10, %rax
	testb	$15, %dl
	je	.L2
.L3:
	cmpb	$112, (%rsp,%rcx)
	jne	.L7
	addq	$1, %rax
.L7:
	leaq	1(%rcx), %rsi
	cmpq	%rdx, %rsi
	jge	.L2
	cmpb	$112, 1(%rsp,%rcx)
	je	.L29
.L8:
	leaq	2(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 2(%rsp,%rcx)
	je	.L30
.L9:
	leaq	3(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 3(%rsp,%rcx)
	je	.L31
.L10:
	leaq	4(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 4(%rsp,%rcx)
	je	.L32
.L11:
	leaq	5(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 5(%rsp,%rcx)
	jne	.L12
	addq	$1, %rax
.L12:
	leaq	6(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 6(%rsp,%rcx)
	jne	.L13
	addq	$1, %rax
.L13:
	leaq	7(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 7(%rsp,%rcx)
	jne	.L14
	addq	$1, %rax
.L14:
	leaq	8(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 8(%rsp,%rcx)
	jne	.L15
	addq	$1, %rax
.L15:
	leaq	9(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 9(%rsp,%rcx)
	je	.L33
.L16:
	leaq	10(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 10(%rsp,%rcx)
	je	.L34
.L17:
	leaq	11(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 11(%rsp,%rcx)
	je	.L35
.L18:
	leaq	12(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 12(%rsp,%rcx)
	je	.L36
.L19:
	leaq	13(%rcx), %rsi
	cmpq	%rsi, %rdx
	jle	.L2
	cmpb	$112, 13(%rsp,%rcx)
	jne	.L20
	addq	$1, %rax
.L20:
	addq	$14, %rcx
	cmpq	%rcx, %rdx
	jle	.L2
	cmpb	$112, (%rsp,%rcx)
	jne	.L2
	addq	$1, %rax
	.p2align 4,,10
	.p2align 3
.L2:
	sarq	%rdx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	subq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L29:
	.cfi_restore_state
	addq	$1, %rax
	jmp	.L8
.L30:
	addq	$1, %rax
	jmp	.L9
.L31:
	addq	$1, %rax
	jmp	.L10
.L32:
	addq	$1, %rax
	jmp	.L11
.L33:
	addq	$1, %rax
	jmp	.L16
.L34:
	addq	$1, %rax
	jmp	.L17
.L35:
	addq	$1, %rax
	jmp	.L18
.L36:
	addq	$1, %rax
	jmp	.L19
.L24:
	xorl	%eax, %eax
	jmp	.L2
.L25:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	jmp	.L3
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.byte	112
	.align 16
.LC2:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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>
#include<string.h>
#define n 100000

int main(){
  long N, topp = 0, i;
  char s[n];
  scanf("%s", s);
  N = strlen(s);
  for(i = 0; i < N; i ++){
    if(s[i] == 'p') topp ++;
  }
  printf("%ld\n", N/2 - topp);
  return 0;
}
ggpgggppgg
 ggp
 ggggggpppg
 ggppgpgggg
 ggppggpggg
 gggpggppgg
 gggggpppgg
 pggpggpggg
 ggggpppggg
 gggpggpggp

2
 0
 2
 2
 2
 2
 2
 2
 2
 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>
#include<string.h>
#define n 100000

int main(){
  long N, topp = 0, i;
  char s[n];
  scanf("%s", s);
  N = strlen(s);
  for(i = 0; i < N; i ++){
    if(s[i] == 'p') topp ++;
  }
  printf("%ld\n", N/2 - topp);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%ld\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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1744, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -100040(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, -100024(%rbp)
	movq	$0, -100032(%rbp)
	jmp	.L2
.L4:
	leaq	-100016(%rbp), %rdx
	movq	-100032(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$112, %al
	jne	.L3
	addq	$1, -100040(%rbp)
.L3:
	addq	$1, -100032(%rbp)
.L2:
	movq	-100032(%rbp), %rax
	cmpq	-100024(%rbp), %rax
	jl	.L4
	movq	-100024(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	subq	-100040(%rbp), %rax
	movq	%rax, %rsi
	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	.L6
	call	__stack_chk_fail@PLT
.L6:
	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	"%ld\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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1744, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -100040(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movq	%rax, -100024(%rbp)
	movq	$0, -100032(%rbp)
	jmp	.L2
.L4:
	leaq	-100016(%rbp), %rdx
	movq	-100032(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$112, %al
	jne	.L3
	addq	$1, -100040(%rbp)
.L3:
	addq	$1, -100032(%rbp)
.L2:
	movq	-100032(%rbp), %rax
	cmpq	-100024(%rbp), %rax
	jl	.L4
	movq	-100024(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	subq	-100040(%rbp), %rax
	movq	%rax, %rsi
	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	.L6
	call	__stack_chk_fail@PLT
.L6:
	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:
