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>
#include<math.h>
#include<string.h>
#include<memory.h>
#include<stdlib.h>
int comp(const void* a, const void* b)
{
	return *(int*)a - *(int*)b;
}
int main(void)
{
	char s[100005];
	scanf("%s", s);
	int l = strlen(s);
	int i, sc = 0;
	for (i = 0; i < l; i++)
	{
		if (i % 2 == 0)
		{
			if (s[i] == 'p')
				sc--;
		}
		else
		{
			if (s[i] == 'g')
				sc++;
		}
	}
	printf("%d", sc);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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
	testq	%rax, %rax
	je	.L9
	movl	%eax, %ecx
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%esi, %esi
	cmpb	$112, (%rdx)
	sete	%sil
	addl	$1, %eax
	addq	$1, %rdx
	subl	%esi, %r8d
	cmpl	%eax, %ecx
	je	.L4
.L7:
	testb	$1, %al
	je	.L12
	xorl	%esi, %esi
	cmpb	$103, (%rdx)
	sete	%sil
	addl	$1, %eax
	addq	$1, %rdx
	addl	%esi, %r8d
	cmpl	%eax, %ecx
	jne	.L7
.L4:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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
	testq	%rax, %rax
	je	.L9
	movl	%eax, %ecx
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%esi, %esi
	cmpb	$112, (%rdx)
	sete	%sil
	addl	$1, %eax
	addq	$1, %rdx
	subl	%esi, %r8d
	cmpl	%eax, %ecx
	je	.L4
.L7:
	testb	$1, %al
	je	.L12
	xorl	%esi, %esi
	cmpb	$103, (%rdx)
	sete	%sil
	addl	$1, %eax
	addq	$1, %rdx
	addl	%esi, %r8d
	cmpl	%eax, %ecx
	jne	.L7
.L4:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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
	testq	%rax, %rax
	je	.L9
	movl	%eax, %ecx
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%esi, %esi
	cmpb	$112, (%rdx)
	sete	%sil
	addl	$1, %eax
	addq	$1, %rdx
	subl	%esi, %r8d
	cmpl	%eax, %ecx
	je	.L4
.L7:
	testb	$1, %al
	je	.L12
	xorl	%esi, %esi
	cmpb	$103, (%rdx)
	sete	%sil
	addl	$1, %eax
	addq	$1, %rdx
	addl	%esi, %r8d
	cmpl	%eax, %ecx
	jne	.L7
.L4:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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>
#include<math.h>
#include<string.h>
#include<memory.h>
#include<stdlib.h>
int comp(const void* a, const void* b)
{
	return *(int*)a - *(int*)b;
}
int main(void)
{
	char s[100005];
	scanf("%s", s);
	int l = strlen(s);
	int i, sc = 0;
	for (i = 0; i < l; i++)
	{
		if (i % 2 == 0)
		{
			if (s[i] == 'p')
				sc--;
		}
		else
		{
			if (s[i] == 'g')
				sc++;
		}
	}
	printf("%d", sc);
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<memory.h>
#include<stdlib.h>
int comp(const void* a, const void* b)
{
	return *(int*)a - *(int*)b;
}
int main(void)
{
	char s[100005];
	scanf("%s", s);
	int l = strlen(s);
	int i, sc = 0;
	for (i = 0; i < l; i++)
	{
		if (i % 2 == 0)
		{
			if (s[i] == 'p')
				sc--;
		}
		else
		{
			if (s[i] == 'g')
				sc++;
		}
	}
	printf("%d", sc);
	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:

gpg

0
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>
#include<math.h>
#include<string.h>
#include<memory.h>
#include<stdlib.h>
int comp(const void* a, const void* b)
{
	return *(int*)a - *(int*)b;
}
int main(void)
{
	char s[100005];
	scanf("%s", s);
	int l = strlen(s);
	int i, sc = 0;
	for (i = 0; i < l; i++)
	{
		if (i % 2 == 0)
		{
			if (s[i] == 'p')
				sc--;
		}
		else
		{
			if (s[i] == 'g')
				sc++;
		}
	}
	printf("%d", sc);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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
	testq	%rax, %rax
	je	.L9
	movl	%eax, %ecx
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%esi, %esi
	cmpb	$112, (%rdx)
	sete	%sil
	addl	$1, %eax
	addq	$1, %rdx
	subl	%esi, %r8d
	cmpl	%eax, %ecx
	je	.L4
.L7:
	testb	$1, %al
	je	.L12
	xorl	%esi, %esi
	cmpb	$103, (%rdx)
	sete	%sil
	addl	$1, %eax
	addq	$1, %rdx
	addl	%esi, %r8d
	cmpl	%eax, %ecx
	jne	.L7
.L4:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	comp, .-comp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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
	testq	%rax, %rax
	je	.L9
	movl	%eax, %ecx
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	xorl	%esi, %esi
	cmpb	$112, (%rdx)
	sete	%sil
	addl	$1, %eax
	addq	$1, %rdx
	subl	%esi, %r8d
	cmpl	%eax, %ecx
	je	.L4
.L7:
	testb	$1, %al
	je	.L12
	xorl	%esi, %esi
	cmpb	$103, (%rdx)
	sete	%sil
	addl	$1, %eax
	addq	$1, %rdx
	addl	%esi, %r8d
	cmpl	%eax, %ecx
	jne	.L7
.L4:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```