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

#define min(a, b)	(((a) < (b)) ? (a) : (b))		/* ２個の値の最小値 */

/********************************************************************************************************************************/
/* main *************************************************************************************************************************/
/********************************************************************************************************************************/
int DEBUG = 0;										/* デバッグプリント 提出時は0 */

int main()
{

	int		N;
	int		i,j, a,b,ba;
	char	s[10000][11];
	int		ans = 0;

	scanf("%d", &N);
	for (i=0; i<N; i++) {
		scanf("%s", s[i]);
		for(j=0; j<10; j++) {
			if (s[i][j+1]==0) break;
			if ((s[i][j]=='A')&&(s[i][j+1]=='B')) ans++;
		}
		s[i][1] = s[i][strlen(s[i])-1];
		s[i][2] = 0;
	}

	a = b = ba = 0;
	for (i=0; i<N; i++) {
		if (s[i][0]=='B') {
			if (s[i][1]=='A') {
				ba++;
			} else {
				b++;
			}
		}
		if ((s[i][1]=='A')&&(s[i][0]!='B')) a++;
	}

	if (DEBUG) printf("a b ba : %d %d %d\n",a,b,ba);
	if (ba==0) ans += min(a,b);
	if (ba!=0) {
		ans += ba-1;
		if (a>0) { ans++; a--; }
		if (b>0) { ans++; b--; }
		ans += min(a,b);
	}

	printf("%d\n",ans);

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	DEBUG
	.bss
	.align 4
	.type	DEBUG, @object
	.size	DEBUG, 4
DEBUG:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"a b ba : %d %d %d\n"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-106496(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3552, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -110020(%rbp)
	leaq	-110044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -110040(%rbp)
	jmp	.L2
.L8:
	leaq	-110016(%rbp), %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -110036(%rbp)
	jmp	.L3
.L7:
	movl	-110036(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L21
	movl	-110036(%rbp), %eax
	movslq	%eax, %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	jne	.L6
	movl	-110036(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	jne	.L6
	addl	$1, -110020(%rbp)
.L6:
	addl	$1, -110036(%rbp)
.L3:
	cmpl	$9, -110036(%rbp)
	jle	.L7
	jmp	.L5
.L21:
	nop
.L5:
	leaq	-110016(%rbp), %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	leaq	-1(%rax), %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %ecx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110015, %rax
	movb	%cl, (%rax)
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110014, %rax
	movb	$0, (%rax)
	addl	$1, -110040(%rbp)
.L2:
	movl	-110044(%rbp), %eax
	cmpl	%eax, -110040(%rbp)
	jl	.L8
	movl	$0, -110024(%rbp)
	movl	-110024(%rbp), %eax
	movl	%eax, -110028(%rbp)
	movl	-110028(%rbp), %eax
	movl	%eax, -110032(%rbp)
	movl	$0, -110040(%rbp)
	jmp	.L9
.L13:
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	jne	.L10
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110015, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	jne	.L11
	addl	$1, -110024(%rbp)
	jmp	.L10
.L11:
	addl	$1, -110028(%rbp)
.L10:
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110015, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	jne	.L12
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	je	.L12
	addl	$1, -110032(%rbp)
.L12:
	addl	$1, -110040(%rbp)
.L9:
	movl	-110044(%rbp), %eax
	cmpl	%eax, -110040(%rbp)
	jl	.L13
	movl	DEBUG(%rip), %eax
	testl	%eax, %eax
	je	.L14
	movl	-110024(%rbp), %ecx
	movl	-110028(%rbp), %edx
	movl	-110032(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	cmpl	$0, -110024(%rbp)
	jne	.L15
	movl	-110028(%rbp), %edx
	movl	-110032(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	addl	%eax, -110020(%rbp)
.L15:
	cmpl	$0, -110024(%rbp)
	je	.L16
	movl	-110024(%rbp), %eax
	subl	$1, %eax
	addl	%eax, -110020(%rbp)
	cmpl	$0, -110032(%rbp)
	jle	.L17
	addl	$1, -110020(%rbp)
	subl	$1, -110032(%rbp)
.L17:
	cmpl	$0, -110028(%rbp)
	jle	.L18
	addl	$1, -110020(%rbp)
	subl	$1, -110028(%rbp)
.L18:
	movl	-110028(%rbp), %edx
	movl	-110032(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	addl	%eax, -110020(%rbp)
.L16:
	movl	-110020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"a b ba : %d %d %d\n"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-106496(%rsp), %r11
	.cfi_def_cfa 11, 106544
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3536, %rsp
	.cfi_def_cfa_offset 110080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 110024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L27
	leaq	16(%rsp), %r13
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	movq	%r13, %rbx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	1(%rbx), %eax
	testb	%al, %al
	je	.L3
	cmpb	$65, (%rbx)
	movzbl	2(%rbx), %edx
	jne	.L4
	cmpb	$66, %al
	je	.L147
.L4:
	testb	%dl, %dl
	je	.L3
	cmpb	$65, %al
	jne	.L5
	cmpb	$66, %dl
	je	.L148
.L5:
	movzbl	3(%rbx), %eax
	testb	%al, %al
	je	.L3
	cmpb	$66, %al
	jne	.L6
	cmpb	$65, %dl
	je	.L149
.L6:
	movzbl	4(%rbx), %edx
	testb	%dl, %dl
	je	.L3
	cmpb	$65, %al
	jne	.L7
	cmpb	$66, %dl
	je	.L150
.L7:
	movzbl	5(%rbx), %eax
	testb	%al, %al
	je	.L3
	cmpb	$65, %dl
	jne	.L8
	cmpb	$66, %al
	je	.L151
.L8:
	movzbl	6(%rbx), %edx
	testb	%dl, %dl
	je	.L3
	cmpb	$65, %al
	jne	.L9
	cmpb	$66, %dl
	je	.L152
.L9:
	movzbl	7(%rbx), %eax
	testb	%al, %al
	je	.L3
	cmpb	$66, %al
	jne	.L10
	cmpb	$65, %dl
	je	.L153
.L10:
	movzbl	8(%rbx), %edx
	testb	%dl, %dl
	je	.L3
	cmpb	$65, %al
	jne	.L11
	cmpb	$66, %dl
	je	.L154
.L11:
	movzbl	9(%rbx), %eax
	testb	%al, %al
	je	.L3
	cmpb	$66, %al
	jne	.L12
	cmpb	$65, %dl
	je	.L155
.L12:
	cmpb	$66, 10(%rbx)
	jne	.L3
	cmpb	$65, %al
	sete	%al
	cmpb	$1, %al
	sbbl	$-1, %r12d
.L3:
	movq	%rbx, %rdi
	addq	$11, %rbx
	call	strlen@PLT
	movq	%rax, %r8
	movslq	%ebp, %rax
	addl	$1, %ebp
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rax,%rdx,2), %rax
	movl	12(%rsp), %edx
	addq	$110032, %rax
	addq	%rsp, %rax
	movzbl	-110017(%rax,%r8), %eax
	movb	$0, -9(%rbx)
	movb	%al, -10(%rbx)
	cmpl	%ebp, %edx
	jg	.L13
	testl	%edx, %edx
	jle	.L2
	subl	$1, %edx
	leaq	17(%rsp), %rax
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rdx,%rcx,2), %rdx
	leaq	12(%r13,%rdx), %rcx
	xorl	%r13d, %r13d
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L14:
	xorl	%edx, %edx
	cmpb	$65, (%rax)
	sete	%dl
	addl	%edx, %ebx
.L16:
	addq	$11, %rax
	cmpq	%rax, %rcx
	je	.L156
.L17:
	cmpb	$66, -1(%rax)
	jne	.L14
	cmpb	$65, (%rax)
	je	.L157
	addq	$11, %rax
	addl	$1, %ebp
	cmpq	%rax, %rcx
	jne	.L17
.L156:
	movl	DEBUG(%rip), %eax
	testl	%eax, %eax
	jne	.L24
.L18:
	testl	%r13d, %r13d
	je	.L25
	leal	-1(%r12,%r13), %eax
	testl	%ebx, %ebx
	je	.L23
	addl	$1, %eax
	subl	$1, %ebx
.L23:
	testl	%ebp, %ebp
	je	.L21
	addl	$1, %eax
	subl	$1, %ebp
.L21:
	cmpl	%ebp, %ebx
	movl	%ebp, %edx
	cmovle	%ebx, %edx
	addl	%eax, %edx
.L20:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	110024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L158
	addq	$110032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L157:
	.cfi_restore_state
	addl	$1, %r13d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L147:
	addl	$1, %r12d
	testb	%dl, %dl
	jne	.L5
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L148:
	movzbl	3(%rbx), %eax
	addl	$1, %r12d
	testb	%al, %al
	jne	.L6
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L149:
	movzbl	4(%rbx), %edx
	addl	$1, %r12d
	testb	%dl, %dl
	jne	.L7
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L150:
	movzbl	5(%rbx), %eax
	addl	$1, %r12d
	testb	%al, %al
	jne	.L8
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L151:
	movzbl	6(%rbx), %edx
	addl	$1, %r12d
	testb	%dl, %dl
	jne	.L9
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L152:
	movzbl	7(%rbx), %eax
	addl	$1, %r12d
	testb	%al, %al
	jne	.L10
	jmp	.L3
.L153:
	movzbl	8(%rbx), %edx
	addl	$1, %r12d
	testb	%dl, %dl
	jne	.L11
	jmp	.L3
.L154:
	movzbl	9(%rbx), %eax
	addl	$1, %r12d
	testb	%al, %al
	jne	.L12
	jmp	.L3
.L155:
	addl	$1, %r12d
	jmp	.L3
.L27:
	xorl	%r12d, %r12d
.L2:
	movl	DEBUG(%rip), %ebp
	xorl	%ebx, %ebx
	testl	%ebp, %ebp
	jne	.L28
.L25:
	cmpl	%ebx, %ebp
	cmovg	%ebx, %ebp
	leal	0(%rbp,%r12), %edx
	jmp	.L20
.L28:
	xorl	%ebp, %ebp
	xorl	%r13d, %r13d
.L24:
	movl	%r13d, %r8d
	movl	%ebp, %ecx
	movl	%ebx, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L18
.L158:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	DEBUG
	.bss
	.align 4
	.type	DEBUG, @object
	.size	DEBUG, 4
DEBUG:
	.zero	4
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"a b ba : %d %d %d\n"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-106496(%rsp), %r11
	.cfi_def_cfa 11, 106544
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3536, %rsp
	.cfi_def_cfa_offset 110080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 110024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L27
	leaq	16(%rsp), %r13
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	movq	%r13, %rbx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzbl	1(%rbx), %eax
	testb	%al, %al
	je	.L3
	cmpb	$65, (%rbx)
	movzbl	2(%rbx), %edx
	jne	.L4
	cmpb	$66, %al
	je	.L147
.L4:
	testb	%dl, %dl
	je	.L3
	cmpb	$65, %al
	jne	.L5
	cmpb	$66, %dl
	je	.L148
.L5:
	movzbl	3(%rbx), %eax
	testb	%al, %al
	je	.L3
	cmpb	$66, %al
	jne	.L6
	cmpb	$65, %dl
	je	.L149
.L6:
	movzbl	4(%rbx), %edx
	testb	%dl, %dl
	je	.L3
	cmpb	$65, %al
	jne	.L7
	cmpb	$66, %dl
	je	.L150
.L7:
	movzbl	5(%rbx), %eax
	testb	%al, %al
	je	.L3
	cmpb	$65, %dl
	jne	.L8
	cmpb	$66, %al
	je	.L151
.L8:
	movzbl	6(%rbx), %edx
	testb	%dl, %dl
	je	.L3
	cmpb	$65, %al
	jne	.L9
	cmpb	$66, %dl
	je	.L152
.L9:
	movzbl	7(%rbx), %eax
	testb	%al, %al
	je	.L3
	cmpb	$66, %al
	jne	.L10
	cmpb	$65, %dl
	je	.L153
.L10:
	movzbl	8(%rbx), %edx
	testb	%dl, %dl
	je	.L3
	cmpb	$65, %al
	jne	.L11
	cmpb	$66, %dl
	je	.L154
.L11:
	movzbl	9(%rbx), %eax
	testb	%al, %al
	je	.L3
	cmpb	$66, %al
	jne	.L12
	cmpb	$65, %dl
	je	.L155
.L12:
	cmpb	$66, 10(%rbx)
	jne	.L3
	cmpb	$65, %al
	sete	%al
	cmpb	$1, %al
	sbbl	$-1, %r12d
.L3:
	movq	%rbx, %rdi
	addq	$11, %rbx
	call	strlen@PLT
	movq	%rax, %r8
	movslq	%ebp, %rax
	addl	$1, %ebp
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rax,%rdx,2), %rax
	movl	12(%rsp), %edx
	addq	$110032, %rax
	addq	%rsp, %rax
	movzbl	-110017(%rax,%r8), %eax
	movb	$0, -9(%rbx)
	movb	%al, -10(%rbx)
	cmpl	%ebp, %edx
	jg	.L13
	testl	%edx, %edx
	jle	.L2
	subl	$1, %edx
	leaq	17(%rsp), %rax
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	(%rdx,%rdx,4), %rcx
	leaq	(%rdx,%rcx,2), %rdx
	leaq	12(%r13,%rdx), %rcx
	xorl	%r13d, %r13d
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L14:
	xorl	%edx, %edx
	cmpb	$65, (%rax)
	sete	%dl
	addl	%edx, %ebx
.L16:
	addq	$11, %rax
	cmpq	%rax, %rcx
	je	.L156
.L17:
	cmpb	$66, -1(%rax)
	jne	.L14
	cmpb	$65, (%rax)
	je	.L157
	addq	$11, %rax
	addl	$1, %ebp
	cmpq	%rax, %rcx
	jne	.L17
.L156:
	movl	DEBUG(%rip), %eax
	testl	%eax, %eax
	jne	.L24
.L18:
	testl	%r13d, %r13d
	je	.L25
	leal	-1(%r12,%r13), %eax
	testl	%ebx, %ebx
	je	.L23
	addl	$1, %eax
	subl	$1, %ebx
.L23:
	testl	%ebp, %ebp
	je	.L21
	addl	$1, %eax
	subl	$1, %ebp
.L21:
	cmpl	%ebp, %ebx
	movl	%ebp, %edx
	cmovle	%ebx, %edx
	addl	%eax, %edx
.L20:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	110024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L158
	addq	$110032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L157:
	.cfi_restore_state
	addl	$1, %r13d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L147:
	addl	$1, %r12d
	testb	%dl, %dl
	jne	.L5
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L148:
	movzbl	3(%rbx), %eax
	addl	$1, %r12d
	testb	%al, %al
	jne	.L6
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L149:
	movzbl	4(%rbx), %edx
	addl	$1, %r12d
	testb	%dl, %dl
	jne	.L7
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L150:
	movzbl	5(%rbx), %eax
	addl	$1, %r12d
	testb	%al, %al
	jne	.L8
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L151:
	movzbl	6(%rbx), %edx
	addl	$1, %r12d
	testb	%dl, %dl
	jne	.L9
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L152:
	movzbl	7(%rbx), %eax
	addl	$1, %r12d
	testb	%al, %al
	jne	.L10
	jmp	.L3
.L153:
	movzbl	8(%rbx), %edx
	addl	$1, %r12d
	testb	%dl, %dl
	jne	.L11
	jmp	.L3
.L154:
	movzbl	9(%rbx), %eax
	addl	$1, %r12d
	testb	%al, %al
	jne	.L12
	jmp	.L3
.L155:
	addl	$1, %r12d
	jmp	.L3
.L27:
	xorl	%r12d, %r12d
.L2:
	movl	DEBUG(%rip), %ebp
	xorl	%ebx, %ebx
	testl	%ebp, %ebp
	jne	.L28
.L25:
	cmpl	%ebx, %ebp
	cmovg	%ebx, %ebp
	leal	0(%rbp,%r12), %edx
	jmp	.L20
.L28:
	xorl	%ebp, %ebp
	xorl	%r13d, %r13d
.L24:
	movl	%r13d, %r8d
	movl	%ebp, %ecx
	movl	%ebx, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L18
.L158:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	DEBUG
	.bss
	.align 4
	.type	DEBUG, @object
	.size	DEBUG, 4
DEBUG:
	.zero	4
	.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>
#include <ctype.h>

#define min(a, b)	(((a) < (b)) ? (a) : (b))		/* ２個の値の最小値 */

/********************************************************************************************************************************/
/* main *************************************************************************************************************************/
/********************************************************************************************************************************/
int DEBUG = 0;										/* デバッグプリント 提出時は0 */

int main()
{

	int		N;
	int		i,j, a,b,ba;
	char	s[10000][11];
	int		ans = 0;

	scanf("%d", &N);
	for (i=0; i<N; i++) {
		scanf("%s", s[i]);
		for(j=0; j<10; j++) {
			if (s[i][j+1]==0) break;
			if ((s[i][j]=='A')&&(s[i][j+1]=='B')) ans++;
		}
		s[i][1] = s[i][strlen(s[i])-1];
		s[i][2] = 0;
	}

	a = b = ba = 0;
	for (i=0; i<N; i++) {
		if (s[i][0]=='B') {
			if (s[i][1]=='A') {
				ba++;
			} else {
				b++;
			}
		}
		if ((s[i][1]=='A')&&(s[i][0]!='B')) a++;
	}

	if (DEBUG) printf("a b ba : %d %d %d\n",a,b,ba);
	if (ba==0) ans += min(a,b);
	if (ba!=0) {
		ans += ba-1;
		if (a>0) { ans++; a--; }
		if (b>0) { ans++; b--; }
		ans += min(a,b);
	}

	printf("%d\n",ans);

	return 0;
}


9
BEWPVCRWH
ZQNZYIJX
BAVREA
PA
HJMYITEOX
BCJHMRMNK
BP
QVFABZ
PRGKSPUNA
 7
EBBYBAR
JOZ
BMHQUVA
BPA
ISU
MCMABAOBHZ
SZMEHMA
 3
ABCA
XBAZ
BAE
 3
ACBA
ZABX
AEB
 3
@DBA
ZAAX
AEB
 9
BEWPVCRWH
ZQNZYIJX
AERVAB
PA
HJMYITEOX
BCJHMRMNK
BP
QVFABZ
PRGKSPUNA
 7
EBBYBAR
JOZ
BMHQUVA
BPA
ISU
MCMABAOBIZ
SZMEHMA
 3
ABCA
XBAZ
BEA
 9
BEWPVCRWH
ZQNZYIJX
AERVAB
PA
HJMYITEOX
BCJHMRMNK
PB
QVFABZ
PRGKSPUNA
 7
EBBYBAR
JOZ
BMHQUVA
BPA
SIU
MCMABAOBIZ
SZMEHMA

4
 3
 2
 1
 0
 4
 3
 2
 4
 3

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

#define min(a, b)	(((a) < (b)) ? (a) : (b))		/* ２個の値の最小値 */

/********************************************************************************************************************************/
/* main *************************************************************************************************************************/
/********************************************************************************************************************************/
int DEBUG = 0;										/* デバッグプリント 提出時は0 */

int main()
{

	int		N;
	int		i,j, a,b,ba;
	char	s[10000][11];
	int		ans = 0;

	scanf("%d", &N);
	for (i=0; i<N; i++) {
		scanf("%s", s[i]);
		for(j=0; j<10; j++) {
			if (s[i][j+1]==0) break;
			if ((s[i][j]=='A')&&(s[i][j+1]=='B')) ans++;
		}
		s[i][1] = s[i][strlen(s[i])-1];
		s[i][2] = 0;
	}

	a = b = ba = 0;
	for (i=0; i<N; i++) {
		if (s[i][0]=='B') {
			if (s[i][1]=='A') {
				ba++;
			} else {
				b++;
			}
		}
		if ((s[i][1]=='A')&&(s[i][0]!='B')) a++;
	}

	if (DEBUG) printf("a b ba : %d %d %d\n",a,b,ba);
	if (ba==0) ans += min(a,b);
	if (ba!=0) {
		ans += ba-1;
		if (a>0) { ans++; a--; }
		if (b>0) { ans++; b--; }
		ans += min(a,b);
	}

	printf("%d\n",ans);

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	DEBUG
	.bss
	.align 4
	.type	DEBUG, @object
	.size	DEBUG, 4
DEBUG:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"a b ba : %d %d %d\n"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-106496(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3552, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -110020(%rbp)
	leaq	-110044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -110040(%rbp)
	jmp	.L2
.L8:
	leaq	-110016(%rbp), %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -110036(%rbp)
	jmp	.L3
.L7:
	movl	-110036(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L21
	movl	-110036(%rbp), %eax
	movslq	%eax, %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	jne	.L6
	movl	-110036(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	jne	.L6
	addl	$1, -110020(%rbp)
.L6:
	addl	$1, -110036(%rbp)
.L3:
	cmpl	$9, -110036(%rbp)
	jle	.L7
	jmp	.L5
.L21:
	nop
.L5:
	leaq	-110016(%rbp), %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	leaq	-1(%rax), %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %ecx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110015, %rax
	movb	%cl, (%rax)
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110014, %rax
	movb	$0, (%rax)
	addl	$1, -110040(%rbp)
.L2:
	movl	-110044(%rbp), %eax
	cmpl	%eax, -110040(%rbp)
	jl	.L8
	movl	$0, -110024(%rbp)
	movl	-110024(%rbp), %eax
	movl	%eax, -110028(%rbp)
	movl	-110028(%rbp), %eax
	movl	%eax, -110032(%rbp)
	movl	$0, -110040(%rbp)
	jmp	.L9
.L13:
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	jne	.L10
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110015, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	jne	.L11
	addl	$1, -110024(%rbp)
	jmp	.L10
.L11:
	addl	$1, -110028(%rbp)
.L10:
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110015, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	jne	.L12
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	je	.L12
	addl	$1, -110032(%rbp)
.L12:
	addl	$1, -110040(%rbp)
.L9:
	movl	-110044(%rbp), %eax
	cmpl	%eax, -110040(%rbp)
	jl	.L13
	movl	DEBUG(%rip), %eax
	testl	%eax, %eax
	je	.L14
	movl	-110024(%rbp), %ecx
	movl	-110028(%rbp), %edx
	movl	-110032(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	cmpl	$0, -110024(%rbp)
	jne	.L15
	movl	-110028(%rbp), %edx
	movl	-110032(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	addl	%eax, -110020(%rbp)
.L15:
	cmpl	$0, -110024(%rbp)
	je	.L16
	movl	-110024(%rbp), %eax
	subl	$1, %eax
	addl	%eax, -110020(%rbp)
	cmpl	$0, -110032(%rbp)
	jle	.L17
	addl	$1, -110020(%rbp)
	subl	$1, -110032(%rbp)
.L17:
	cmpl	$0, -110028(%rbp)
	jle	.L18
	addl	$1, -110020(%rbp)
	subl	$1, -110028(%rbp)
.L18:
	movl	-110028(%rbp), %edx
	movl	-110032(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	addl	%eax, -110020(%rbp)
.L16:
	movl	-110020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	DEBUG
	.bss
	.align 4
	.type	DEBUG, @object
	.size	DEBUG, 4
DEBUG:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"a b ba : %d %d %d\n"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-106496(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3552, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -110020(%rbp)
	leaq	-110044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -110040(%rbp)
	jmp	.L2
.L8:
	leaq	-110016(%rbp), %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -110036(%rbp)
	jmp	.L3
.L7:
	movl	-110036(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L21
	movl	-110036(%rbp), %eax
	movslq	%eax, %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	jne	.L6
	movl	-110036(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	jne	.L6
	addl	$1, -110020(%rbp)
.L6:
	addl	$1, -110036(%rbp)
.L3:
	cmpl	$9, -110036(%rbp)
	jle	.L7
	jmp	.L5
.L21:
	nop
.L5:
	leaq	-110016(%rbp), %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	leaq	-1(%rax), %rcx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$110016, %rax
	movzbl	(%rax), %ecx
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110015, %rax
	movb	%cl, (%rax)
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110014, %rax
	movb	$0, (%rax)
	addl	$1, -110040(%rbp)
.L2:
	movl	-110044(%rbp), %eax
	cmpl	%eax, -110040(%rbp)
	jl	.L8
	movl	$0, -110024(%rbp)
	movl	-110024(%rbp), %eax
	movl	%eax, -110028(%rbp)
	movl	-110028(%rbp), %eax
	movl	%eax, -110032(%rbp)
	movl	$0, -110040(%rbp)
	jmp	.L9
.L13:
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	jne	.L10
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110015, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	jne	.L11
	addl	$1, -110024(%rbp)
	jmp	.L10
.L11:
	addl	$1, -110028(%rbp)
.L10:
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110015, %rax
	movzbl	(%rax), %eax
	cmpb	$65, %al
	jne	.L12
	movl	-110040(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	subq	$110016, %rax
	movzbl	(%rax), %eax
	cmpb	$66, %al
	je	.L12
	addl	$1, -110032(%rbp)
.L12:
	addl	$1, -110040(%rbp)
.L9:
	movl	-110044(%rbp), %eax
	cmpl	%eax, -110040(%rbp)
	jl	.L13
	movl	DEBUG(%rip), %eax
	testl	%eax, %eax
	je	.L14
	movl	-110024(%rbp), %ecx
	movl	-110028(%rbp), %edx
	movl	-110032(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	cmpl	$0, -110024(%rbp)
	jne	.L15
	movl	-110028(%rbp), %edx
	movl	-110032(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	addl	%eax, -110020(%rbp)
.L15:
	cmpl	$0, -110024(%rbp)
	je	.L16
	movl	-110024(%rbp), %eax
	subl	$1, %eax
	addl	%eax, -110020(%rbp)
	cmpl	$0, -110032(%rbp)
	jle	.L17
	addl	$1, -110020(%rbp)
	subl	$1, -110032(%rbp)
.L17:
	cmpl	$0, -110028(%rbp)
	jle	.L18
	addl	$1, -110020(%rbp)
	subl	$1, -110028(%rbp)
.L18:
	movl	-110028(%rbp), %edx
	movl	-110032(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	addl	%eax, -110020(%rbp)
.L16:
	movl	-110020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
