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 <stdlib.h>
#include <string.h>

int		countHB(char *S)
{
	int		countHB;

	countHB = 0;
	for (int i = 0; S[i]; i++)
	{
		if (i % 2 == 0)
		{
			if (S[i] == '0')
			{
				//S[i] = '1';
				countHB++;
			}
		}
		else
		{
			if (S[i] == '1')
			{
				//S[i] = '0';
				countHB++;
			}
		}
	}
	//printf("HB:%s\n",S);
	return (countHB);
}

int		countBH(char *S)
{
	int		countBH;

	countBH = 0;
	for (int i = 0; S[i]; i++)
	{
		if (i % 2 == 0)
		{
			if (S[i] == '1')
			{
				//S[i] = '0';
				countBH++;
			}
		}
		else
		{
			if (S[i] == '0')
			{
				//S[i] = '1';
				countBH++;
			}
		}
	}
	//printf("BH:%s\n",S);
	return (countBH);
}


int		main(void)
{
	char	S[100001];
	// char	*S2;
	int		N;
	int		HB;
	int		BH;

	N = 0;
	scanf("%s", S);
	//S2 = (char *)malloc(strlen(S) + 1);
	// while (S[N])
	// {
	// 	S2[N] = S[N];
	// 	N++;
	// }
	// S2[N] = '\0';
	HB = countHB(S);
	BH = countBH(S);
	if (HB >= BH)
		printf("%d",BH);
	else
		printf("%d",HB);
	return (0);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	countHB
	.type	countHB, @function
countHB:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	jne	.L4
	addl	$1, -8(%rbp)
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L4
	addl	$1, -8(%rbp)
.L4:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	countHB, .-countHB
	.globl	countBH
	.type	countBH, @function
countBH:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L8
.L11:
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L9
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L10
	addl	$1, -8(%rbp)
	jmp	.L10
.L9:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	jne	.L10
	addl	$1, -8(%rbp)
.L10:
	addl	$1, -4(%rbp)
.L8:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L11
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	countBH, .-countBH
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100028(%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	countHB
	movl	%eax, -100024(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	countBH
	movl	%eax, -100020(%rbp)
	movl	-100024(%rbp), %eax
	cmpl	-100020(%rbp), %eax
	jl	.L14
	movl	-100020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	movl	-100024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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
	.p2align 4
	.globl	countHB
	.type	countHB, @function
countHB:
.LFB51:
	.cfi_startproc
	endbr64
	movzbl	(%rdi), %edx
	testb	%dl, %dl
	je	.L6
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$48, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rdi,%rax), %edx
	testb	%dl, %dl
	je	.L1
.L5:
	testb	$1, %al
	je	.L9
	cmpb	$49, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rdi,%rax), %edx
	testb	%dl, %dl
	jne	.L5
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	countHB, .-countHB
	.p2align 4
	.globl	countBH
	.type	countBH, @function
countBH:
.LFB52:
	.cfi_startproc
	endbr64
	movzbl	(%rdi), %edx
	testb	%dl, %dl
	je	.L15
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L17:
	cmpb	$49, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rdi,%rax), %edx
	testb	%dl, %dl
	je	.L10
.L14:
	testb	$1, %al
	je	.L17
	cmpb	$48, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rdi,%rax), %edx
	testb	%dl, %dl
	jne	.L14
.L10:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	countBH, .-countBH
	.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:
.LFB53:
	.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
	movzbl	(%rsp), %edx
	testb	%dl, %dl
	je	.L29
	movl	%edx, %ecx
	xorl	%eax, %eax
	xorl	%r9d, %r9d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L34:
	cmpb	$48, %cl
	sete	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %r9d
	movzbl	(%rbx,%rax), %ecx
	testb	%cl, %cl
	je	.L33
.L22:
	testb	$1, %al
	je	.L34
	cmpb	$49, %cl
	sete	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %r9d
	movzbl	(%rbx,%rax), %ecx
	testb	%cl, %cl
	jne	.L22
.L33:
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L36:
	cmpb	$49, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rbx,%rax), %edx
	testb	%dl, %dl
	je	.L35
.L25:
	testb	$1, %al
	je	.L36
	cmpb	$48, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rbx,%rax), %edx
	testb	%dl, %dl
	jne	.L25
.L35:
	cmpl	%r9d, %r8d
	jle	.L19
	movl	%r9d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L27:
	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
	xorl	%r8d, %r8d
.L19:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L27
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.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
	.p2align 4
	.globl	countHB
	.type	countHB, @function
countHB:
.LFB51:
	.cfi_startproc
	endbr64
	movzbl	(%rdi), %edx
	testb	%dl, %dl
	je	.L6
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$48, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rdi,%rax), %edx
	testb	%dl, %dl
	je	.L1
.L5:
	testb	$1, %al
	je	.L9
	cmpb	$49, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rdi,%rax), %edx
	testb	%dl, %dl
	jne	.L5
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	countHB, .-countHB
	.p2align 4
	.globl	countBH
	.type	countBH, @function
countBH:
.LFB52:
	.cfi_startproc
	endbr64
	movzbl	(%rdi), %edx
	testb	%dl, %dl
	je	.L15
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L17:
	cmpb	$49, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rdi,%rax), %edx
	testb	%dl, %dl
	je	.L10
.L14:
	testb	$1, %al
	je	.L17
	cmpb	$48, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rdi,%rax), %edx
	testb	%dl, %dl
	jne	.L14
.L10:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	countBH, .-countBH
	.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:
.LFB53:
	.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
	movzbl	(%rsp), %edx
	testb	%dl, %dl
	je	.L29
	movl	%edx, %ecx
	xorl	%eax, %eax
	xorl	%r9d, %r9d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L34:
	cmpb	$48, %cl
	sete	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %r9d
	movzbl	(%rbx,%rax), %ecx
	testb	%cl, %cl
	je	.L33
.L22:
	testb	$1, %al
	je	.L34
	cmpb	$49, %cl
	sete	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %r9d
	movzbl	(%rbx,%rax), %ecx
	testb	%cl, %cl
	jne	.L22
.L33:
	xorl	%eax, %eax
	xorl	%r8d, %r8d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L36:
	cmpb	$49, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rbx,%rax), %edx
	testb	%dl, %dl
	je	.L35
.L25:
	testb	$1, %al
	je	.L36
	cmpb	$48, %dl
	sete	%dl
	addq	$1, %rax
	movzbl	%dl, %edx
	addl	%edx, %r8d
	movzbl	(%rbx,%rax), %edx
	testb	%dl, %dl
	jne	.L25
.L35:
	cmpl	%r9d, %r8d
	jle	.L19
	movl	%r9d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L27:
	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
	xorl	%r8d, %r8d
.L19:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L27
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.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>
#include <stdlib.h>
#include <string.h>

int		countHB(char *S)
{
	int		countHB;

	countHB = 0;
	for (int i = 0; S[i]; i++)
	{
		if (i % 2 == 0)
		{
			if (S[i] == '0')
			{
				//S[i] = '1';
				countHB++;
			}
		}
		else
		{
			if (S[i] == '1')
			{
				//S[i] = '0';
				countHB++;
			}
		}
	}
	//printf("HB:%s\n",S);
	return (countHB);
}

int		countBH(char *S)
{
	int		countBH;

	countBH = 0;
	for (int i = 0; S[i]; i++)
	{
		if (i % 2 == 0)
		{
			if (S[i] == '1')
			{
				//S[i] = '0';
				countBH++;
			}
		}
		else
		{
			if (S[i] == '0')
			{
				//S[i] = '1';
				countBH++;
			}
		}
	}
	//printf("BH:%s\n",S);
	return (countBH);
}


int		main(void)
{
	char	S[100001];
	// char	*S2;
	int		N;
	int		HB;
	int		BH;

	N = 0;
	scanf("%s", S);
	//S2 = (char *)malloc(strlen(S) + 1);
	// while (S[N])
	// {
	// 	S2[N] = S[N];
	// 	N++;
	// }
	// S2[N] = '\0';
	HB = countHB(S);
	BH = countBH(S);
	if (HB >= BH)
		printf("%d",BH);
	else
		printf("%d",HB);
	return (0);
}

10110010
 010
 10110110
 00110110
 100
 10100110
 01110110
 01110111
 10011010
 1

2 0 3 4 1 2 3 2 2 0
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 <stdlib.h>
#include <string.h>

int		countHB(char *S)
{
	int		countHB;

	countHB = 0;
	for (int i = 0; S[i]; i++)
	{
		if (i % 2 == 0)
		{
			if (S[i] == '0')
			{
				//S[i] = '1';
				countHB++;
			}
		}
		else
		{
			if (S[i] == '1')
			{
				//S[i] = '0';
				countHB++;
			}
		}
	}
	//printf("HB:%s\n",S);
	return (countHB);
}

int		countBH(char *S)
{
	int		countBH;

	countBH = 0;
	for (int i = 0; S[i]; i++)
	{
		if (i % 2 == 0)
		{
			if (S[i] == '1')
			{
				//S[i] = '0';
				countBH++;
			}
		}
		else
		{
			if (S[i] == '0')
			{
				//S[i] = '1';
				countBH++;
			}
		}
	}
	//printf("BH:%s\n",S);
	return (countBH);
}


int		main(void)
{
	char	S[100001];
	// char	*S2;
	int		N;
	int		HB;
	int		BH;

	N = 0;
	scanf("%s", S);
	//S2 = (char *)malloc(strlen(S) + 1);
	// while (S[N])
	// {
	// 	S2[N] = S[N];
	// 	N++;
	// }
	// S2[N] = '\0';
	HB = countHB(S);
	BH = countBH(S);
	if (HB >= BH)
		printf("%d",BH);
	else
		printf("%d",HB);
	return (0);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	countHB
	.type	countHB, @function
countHB:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	jne	.L4
	addl	$1, -8(%rbp)
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L4
	addl	$1, -8(%rbp)
.L4:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	countHB, .-countHB
	.globl	countBH
	.type	countBH, @function
countBH:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L8
.L11:
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L9
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L10
	addl	$1, -8(%rbp)
	jmp	.L10
.L9:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	jne	.L10
	addl	$1, -8(%rbp)
.L10:
	addl	$1, -4(%rbp)
.L8:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L11
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	countBH, .-countBH
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100028(%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	countHB
	movl	%eax, -100024(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	countBH
	movl	%eax, -100020(%rbp)
	movl	-100024(%rbp), %eax
	cmpl	-100020(%rbp), %eax
	jl	.L14
	movl	-100020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	movl	-100024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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
	.globl	countHB
	.type	countHB, @function
countHB:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	jne	.L4
	addl	$1, -8(%rbp)
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L4
	addl	$1, -8(%rbp)
.L4:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L5
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	countHB, .-countHB
	.globl	countBH
	.type	countBH, @function
countBH:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L8
.L11:
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L9
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$49, %al
	jne	.L10
	addl	$1, -8(%rbp)
	jmp	.L10
.L9:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	jne	.L10
	addl	$1, -8(%rbp)
.L10:
	addl	$1, -4(%rbp)
.L8:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	jne	.L11
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	countBH, .-countBH
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.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	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100028(%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	countHB
	movl	%eax, -100024(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	countBH
	movl	%eax, -100020(%rbp)
	movl	-100024(%rbp), %eax
	cmpl	-100020(%rbp), %eax
	jl	.L14
	movl	-100020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	movl	-100024(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
