Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_STR_MAX		200005									// 最大文字列長

// 内部構造体 - 文字情報
typedef struct Char {
	char mcChar;												// 文字
	int miCnt;													// 文字数
} Char;

// 内部変数
static FILE *szpFpI;											// 入力
static char sc1Str[D_STR_MAX];									// 文字列
static Char sz1Char[D_STR_MAX];									// 文字情報
static int siCCnt;												// 文字情報数

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpA;
	static int siTNo;
#endif

// １行出力
int
fOutLine(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// 文字情報 - 追加
int
fAdd(
	char pcChar					// <I> 追加文字
)
{
	// 加算
	if (siCCnt > 0) {
		if (sz1Char[siCCnt - 1].mcChar == pcChar) {
			sz1Char[siCCnt - 1].miCnt++;
			return 0;
		}
	}

	// 新規
	sz1Char[siCCnt].mcChar = pcChar;
	sz1Char[siCCnt].miCnt = 1;
	siCCnt++;

	return 0;
}

// 文字情報 - 削除
int
fDel(
	char pcChar					// <I> 削除文字
)
{
	// 文字有無
	if (siCCnt < 1) {
		return -1;
	}
	if (sz1Char[siCCnt - 1].mcChar != pcChar) {
		return -1;
	}

	// 削除
	if (sz1Char[siCCnt - 1].miCnt > 1) {
		sz1Char[siCCnt - 1].miCnt--;
	}
	else {
		siCCnt--;
	}

	return 0;
}

// 実行メイン
int
fMain(
)
{
	int i, liRet;

	// 文字列 - 取得
	fgets(sc1Str, sizeof(sc1Str), szpFpI);

	// 各文字 - チェック
	for (i = 0; ; i++) {
		if (sc1Str[i] == 'S') {
			fAdd('S');
		}
		else if (sc1Str[i] == 'T') {

			// 削除
			liRet = fDel('S');

			// 追加
			if (liRet != 0) {
				fAdd('T');
			}
		}
		else {
			break;
		}
	}

	// 文字数合計 - 取得
	int liSum = 0;
	for (i = 0; i < siCCnt; i++) {
		liSum += sz1Char[i].miCnt;
	}

	return liSum;
}

// １回実行
int
fOne(
)
{
	int liRet;
	char lc1Buf[1024];

	// データ - 初期化
	siCCnt = 0;													// 文字情報数

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 実行メイン
	liRet = fMain();

	// １行出力
	sprintf(lc1Buf, "%d\n", liRet);
	fOutLine(lc1Buf);

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		siTNo = i;
		fOne();
	}
#else
	fOne();
#endif

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	szpFpI
	.comm	szpFpI,8,8
	.local	sc1Str
	.comm	sc1Str,200005,32
	.local	sz1Char
	.comm	sz1Char,1600040,32
	.local	siCCnt
	.comm	siCCnt,4,4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	fOutLine
	.type	fOutLine, @function
fOutLine:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%rdi, -1048(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-1048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fOutLine, .-fOutLine
	.globl	fAdd
	.type	fAdd, @function
fAdd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	movl	siCCnt(%rip), %eax
	testl	%eax, %eax
	jle	.L5
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Char(%rip), %rax
	movzbl	(%rdx,%rax), %eax
	cmpb	%al, -4(%rbp)
	jne	.L5
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+sz1Char(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$0, %eax
	jmp	.L6
.L5:
	movl	siCCnt(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Char(%rip), %rdx
	movzbl	-4(%rbp), %eax
	movb	%al, (%rcx,%rdx)
	movl	siCCnt(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	siCCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fAdd, .-fAdd
	.globl	fDel
	.type	fDel, @function
fDel:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	movl	siCCnt(%rip), %eax
	testl	%eax, %eax
	jg	.L8
	movl	$-1, %eax
	jmp	.L9
.L8:
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Char(%rip), %rax
	movzbl	(%rdx,%rax), %eax
	cmpb	%al, -4(%rbp)
	je	.L10
	movl	$-1, %eax
	jmp	.L9
.L10:
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jle	.L11
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+sz1Char(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L12
.L11:
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	movl	%eax, siCCnt(%rip)
.L12:
	movl	$0, %eax
.L9:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	fDel, .-fDel
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	szpFpI(%rip), %rax
	movq	%rax, %rdx
	movl	$200005, %esi
	leaq	sc1Str(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	cltq
	leaq	sc1Str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$83, %al
	jne	.L14
	movl	$83, %edi
	call	fAdd
	jmp	.L15
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	sc1Str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$84, %al
	jne	.L22
	movl	$83, %edi
	call	fDel
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L15
	movl	$84, %edi
	call	fAdd
.L15:
	addl	$1, -12(%rbp)
	jmp	.L18
.L22:
	nop
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L19
.L20:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L19:
	movl	siCCnt(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L20
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	fMain, .-fMain
	.section	.rodata
.LC1:
	.string	"%d\n"
	.text
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, siCCnt(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movl	$0, %eax
	call	fMain
	movl	%eax, -1044(%rbp)
	movl	-1044(%rbp), %edx
	leaq	-1040(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	fOutLine
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	fOne, .-fOne
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	fOne
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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"
	.text
	.p2align 4
	.globl	fOutLine
	.type	fOutLine, @function
fOutLine:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rdi, %rdx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	fOutLine, .-fOutLine
	.p2align 4
	.globl	fAdd
	.type	fAdd, @function
fAdd:
.LFB52:
	.cfi_startproc
	endbr64
	movl	siCCnt(%rip), %eax
	leaq	sz1Char(%rip), %rdx
	testl	%eax, %eax
	jle	.L5
	leal	-1(%rax), %ecx
	leaq	sz1Char(%rip), %rdx
	movslq	%ecx, %rcx
	cmpb	%dil, (%rdx,%rcx,8)
	je	.L9
.L5:
	movslq	%eax, %rcx
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	xorl	%eax, %eax
	movb	%dil, (%rdx,%rcx,8)
	movl	$1, 4(%rdx,%rcx,8)
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, 4(%rdx,%rcx,8)
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	fAdd, .-fAdd
	.p2align 4
	.globl	fDel
	.type	fDel, @function
fDel:
.LFB53:
	.cfi_startproc
	endbr64
	movl	siCCnt(%rip), %eax
	testl	%eax, %eax
	jle	.L14
	subl	$1, %eax
	leaq	sz1Char(%rip), %rcx
	movslq	%eax, %rsi
	cmpb	%dil, (%rcx,%rsi,8)
	jne	.L14
	movl	4(%rcx,%rsi,8), %edx
	cmpl	$1, %edx
	jle	.L12
	subl	$1, %edx
	xorl	%eax, %eax
	movl	%edx, 4(%rcx,%rsi,8)
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, siCCnt(%rip)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	fDel, .-fDel
	.p2align 4
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	szpFpI(%rip), %rdx
	leaq	sc1Str(%rip), %rbx
	movl	$200005, %esi
	movq	%rbx, %rdi
	call	fgets@PLT
	movl	siCCnt(%rip), %r10d
	movq	%rbx, %rax
	xorl	%r9d, %r9d
	leaq	sz1Char(%rip), %rdi
	movl	%r10d, %edx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L39:
	subl	$1, %ecx
	movl	%ecx, 4(%rdi,%rsi,8)
.L18:
	addq	$1, %rax
.L25:
	movzbl	(%rax), %ecx
	cmpb	$83, %cl
	je	.L37
	cmpb	$84, %cl
	jne	.L38
	testl	%edx, %edx
	jle	.L23
	leal	-1(%rdx), %r8d
	movslq	%r8d, %rsi
	movzbl	(%rdi,%rsi,8), %ecx
	cmpb	$83, %cl
	jne	.L24
	movl	4(%rdi,%rsi,8), %ecx
	cmpl	$1, %ecx
	jg	.L39
	movl	%r8d, %edx
	movl	$1, %r9d
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L37:
	testl	%edx, %edx
	jle	.L17
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rcx
	cmpb	$83, (%rdi,%rcx,8)
	je	.L40
.L17:
	movslq	%edx, %rcx
	movl	$1, %r9d
	addl	$1, %edx
	movb	$83, (%rdi,%rcx,8)
	movl	$1, 4(%rdi,%rcx,8)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L38:
	testb	%r9b, %r9b
	je	.L30
	movl	%edx, siCCnt(%rip)
.L20:
	xorl	%eax, %eax
	testl	%edx, %edx
	jle	.L15
	leal	-1(%rdx), %ecx
	cmpl	$3, %ecx
	jbe	.L32
	movl	%ecx, %esi
	leaq	4+sz1Char(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %esi
	leaq	32(%rax), %rdi
	subl	$1, %esi
	salq	$5, %rsi
	addq	%rdi, %rsi
	.p2align 4,,10
	.p2align 3
.L27:
	movdqu	(%rax), %xmm1
	movdqu	16(%rax), %xmm2
	addq	$32, %rax
	shufps	$136, %xmm2, %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%rax, %rsi
	jne	.L27
	movdqa	%xmm0, %xmm1
	andl	$-4, %ecx
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
.L26:
	movslq	%ecx, %rsi
	leaq	sz1Char(%rip), %rdi
	addl	4(%rdi,%rsi,8), %eax
	leal	1(%rcx), %esi
	cmpl	%edx, %esi
	jge	.L15
	movslq	%esi, %rsi
	addl	4(%rdi,%rsi,8), %eax
	leal	2(%rcx), %esi
	cmpl	%esi, %edx
	jle	.L15
	movslq	%esi, %rsi
	addl	$3, %ecx
	addl	4(%rdi,%rsi,8), %eax
	cmpl	%ecx, %edx
	jle	.L15
	movslq	%ecx, %rcx
	addl	4(%rdi,%rcx,8), %eax
.L15:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	movl	%r10d, %edx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L40:
	addl	$1, 4(%rdi,%rcx,8)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L24:
	cmpb	$84, %cl
	je	.L41
.L23:
	movslq	%edx, %rcx
	movl	$1, %r9d
	addl	$1, %edx
	movb	$84, (%rdi,%rcx,8)
	movl	$1, 4(%rdi,%rcx,8)
	jmp	.L18
.L32:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L26
.L41:
	addl	$1, 4(%rdi,%rsi,8)
	jmp	.L18
	.cfi_endproc
.LFE54:
	.size	fMain, .-fMain
	.section	.rodata.str1.1
.LC1:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	subq	$1040, %rsp
	.cfi_def_cfa_offset 1056
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rax
	movq	%rsp, %r12
	movl	$0, siCCnt(%rip)
	movq	%rax, szpFpI(%rip)
	xorl	%eax, %eax
	call	fMain
	movl	$1024, %edx
	movq	%r12, %rdi
	movl	$1, %esi
	movl	%eax, %r8d
	leaq	.LC1(%rip), %rcx
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$1040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L45:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.size	fOne, .-fOne
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB56:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	call	fOne
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE56:
	.size	main, .-main
	.local	siCCnt
	.comm	siCCnt,4,4
	.local	sz1Char
	.comm	sz1Char,1600040,32
	.local	sc1Str
	.comm	sc1Str,200005,32
	.local	szpFpI
	.comm	szpFpI,8,8
	.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"
	.text
	.p2align 4
	.globl	fOutLine
	.type	fOutLine, @function
fOutLine:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movq	%rdi, %rdx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE51:
	.size	fOutLine, .-fOutLine
	.p2align 4
	.globl	fAdd
	.type	fAdd, @function
fAdd:
.LFB52:
	.cfi_startproc
	endbr64
	movl	siCCnt(%rip), %eax
	leaq	sz1Char(%rip), %rdx
	testl	%eax, %eax
	jle	.L5
	leal	-1(%rax), %ecx
	leaq	sz1Char(%rip), %rdx
	movslq	%ecx, %rcx
	cmpb	%dil, (%rdx,%rcx,8)
	je	.L9
.L5:
	movslq	%eax, %rcx
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	xorl	%eax, %eax
	movb	%dil, (%rdx,%rcx,8)
	movl	$1, 4(%rdx,%rcx,8)
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, 4(%rdx,%rcx,8)
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	fAdd, .-fAdd
	.p2align 4
	.globl	fDel
	.type	fDel, @function
fDel:
.LFB53:
	.cfi_startproc
	endbr64
	movl	siCCnt(%rip), %eax
	testl	%eax, %eax
	jle	.L14
	subl	$1, %eax
	leaq	sz1Char(%rip), %rcx
	movslq	%eax, %rsi
	cmpb	%dil, (%rcx,%rsi,8)
	jne	.L14
	movl	4(%rcx,%rsi,8), %edx
	cmpl	$1, %edx
	jle	.L12
	subl	$1, %edx
	xorl	%eax, %eax
	movl	%edx, 4(%rcx,%rsi,8)
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, siCCnt(%rip)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	fDel, .-fDel
	.p2align 4
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB54:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	szpFpI(%rip), %rdx
	leaq	sc1Str(%rip), %rbx
	movl	$200005, %esi
	movq	%rbx, %rdi
	call	fgets@PLT
	movl	siCCnt(%rip), %r10d
	movq	%rbx, %rax
	xorl	%r9d, %r9d
	leaq	sz1Char(%rip), %rdi
	movl	%r10d, %edx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L39:
	subl	$1, %ecx
	movl	%ecx, 4(%rdi,%rsi,8)
.L18:
	addq	$1, %rax
.L25:
	movzbl	(%rax), %ecx
	cmpb	$83, %cl
	je	.L37
	cmpb	$84, %cl
	jne	.L38
	testl	%edx, %edx
	jle	.L23
	leal	-1(%rdx), %r8d
	movslq	%r8d, %rsi
	movzbl	(%rdi,%rsi,8), %ecx
	cmpb	$83, %cl
	jne	.L24
	movl	4(%rdi,%rsi,8), %ecx
	cmpl	$1, %ecx
	jg	.L39
	movl	%r8d, %edx
	movl	$1, %r9d
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L37:
	testl	%edx, %edx
	jle	.L17
	leal	-1(%rdx), %ecx
	movslq	%ecx, %rcx
	cmpb	$83, (%rdi,%rcx,8)
	je	.L40
.L17:
	movslq	%edx, %rcx
	movl	$1, %r9d
	addl	$1, %edx
	movb	$83, (%rdi,%rcx,8)
	movl	$1, 4(%rdi,%rcx,8)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L38:
	testb	%r9b, %r9b
	je	.L30
	movl	%edx, siCCnt(%rip)
.L20:
	xorl	%eax, %eax
	testl	%edx, %edx
	jle	.L15
	leal	-1(%rdx), %ecx
	cmpl	$3, %ecx
	jbe	.L32
	movl	%ecx, %esi
	leaq	4+sz1Char(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %esi
	leaq	32(%rax), %rdi
	subl	$1, %esi
	salq	$5, %rsi
	addq	%rdi, %rsi
	.p2align 4,,10
	.p2align 3
.L27:
	movdqu	(%rax), %xmm1
	movdqu	16(%rax), %xmm2
	addq	$32, %rax
	shufps	$136, %xmm2, %xmm1
	paddd	%xmm1, %xmm0
	cmpq	%rax, %rsi
	jne	.L27
	movdqa	%xmm0, %xmm1
	andl	$-4, %ecx
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
.L26:
	movslq	%ecx, %rsi
	leaq	sz1Char(%rip), %rdi
	addl	4(%rdi,%rsi,8), %eax
	leal	1(%rcx), %esi
	cmpl	%edx, %esi
	jge	.L15
	movslq	%esi, %rsi
	addl	4(%rdi,%rsi,8), %eax
	leal	2(%rcx), %esi
	cmpl	%esi, %edx
	jle	.L15
	movslq	%esi, %rsi
	addl	$3, %ecx
	addl	4(%rdi,%rsi,8), %eax
	cmpl	%ecx, %edx
	jle	.L15
	movslq	%ecx, %rcx
	addl	4(%rdi,%rcx,8), %eax
.L15:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L30:
	.cfi_restore_state
	movl	%r10d, %edx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L40:
	addl	$1, 4(%rdi,%rcx,8)
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L24:
	cmpb	$84, %cl
	je	.L41
.L23:
	movslq	%edx, %rcx
	movl	$1, %r9d
	addl	$1, %edx
	movb	$84, (%rdi,%rcx,8)
	movl	$1, 4(%rdi,%rcx,8)
	jmp	.L18
.L32:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L26
.L41:
	addl	$1, 4(%rdi,%rsi,8)
	jmp	.L18
	.cfi_endproc
.LFE54:
	.size	fMain, .-fMain
	.section	.rodata.str1.1
.LC1:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	subq	$1040, %rsp
	.cfi_def_cfa_offset 1056
	movq	%fs:40, %rax
	movq	%rax, 1032(%rsp)
	xorl	%eax, %eax
	movq	stdin(%rip), %rax
	movq	%rsp, %r12
	movl	$0, siCCnt(%rip)
	movq	%rax, szpFpI(%rip)
	xorl	%eax, %eax
	call	fMain
	movl	$1024, %edx
	movq	%r12, %rdi
	movl	$1, %esi
	movl	%eax, %r8d
	leaq	.LC1(%rip), %rcx
	xorl	%eax, %eax
	call	__sprintf_chk@PLT
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	1032(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$1040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L45:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.size	fOne, .-fOne
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB56:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	call	fOne
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE56:
	.size	main, .-main
	.local	siCCnt
	.comm	siCCnt,4,4
	.local	sz1Char
	.comm	sz1Char,1600040,32
	.local	sc1Str
	.comm	sc1Str,200005,32
	.local	szpFpI
	.comm	szpFpI,8,8
	.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 <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_STR_MAX		200005									// 最大文字列長

// 内部構造体 - 文字情報
typedef struct Char {
	char mcChar;												// 文字
	int miCnt;													// 文字数
} Char;

// 内部変数
static FILE *szpFpI;											// 入力
static char sc1Str[D_STR_MAX];									// 文字列
static Char sz1Char[D_STR_MAX];									// 文字情報
static int siCCnt;												// 文字情報数

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpA;
	static int siTNo;
#endif

// １行出力
int
fOutLine(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// 文字情報 - 追加
int
fAdd(
	char pcChar					// <I> 追加文字
)
{
	// 加算
	if (siCCnt > 0) {
		if (sz1Char[siCCnt - 1].mcChar == pcChar) {
			sz1Char[siCCnt - 1].miCnt++;
			return 0;
		}
	}

	// 新規
	sz1Char[siCCnt].mcChar = pcChar;
	sz1Char[siCCnt].miCnt = 1;
	siCCnt++;

	return 0;
}

// 文字情報 - 削除
int
fDel(
	char pcChar					// <I> 削除文字
)
{
	// 文字有無
	if (siCCnt < 1) {
		return -1;
	}
	if (sz1Char[siCCnt - 1].mcChar != pcChar) {
		return -1;
	}

	// 削除
	if (sz1Char[siCCnt - 1].miCnt > 1) {
		sz1Char[siCCnt - 1].miCnt--;
	}
	else {
		siCCnt--;
	}

	return 0;
}

// 実行メイン
int
fMain(
)
{
	int i, liRet;

	// 文字列 - 取得
	fgets(sc1Str, sizeof(sc1Str), szpFpI);

	// 各文字 - チェック
	for (i = 0; ; i++) {
		if (sc1Str[i] == 'S') {
			fAdd('S');
		}
		else if (sc1Str[i] == 'T') {

			// 削除
			liRet = fDel('S');

			// 追加
			if (liRet != 0) {
				fAdd('T');
			}
		}
		else {
			break;
		}
	}

	// 文字数合計 - 取得
	int liSum = 0;
	for (i = 0; i < siCCnt; i++) {
		liSum += sz1Char[i].miCnt;
	}

	return liSum;
}

// １回実行
int
fOne(
)
{
	int liRet;
	char lc1Buf[1024];

	// データ - 初期化
	siCCnt = 0;													// 文字情報数

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 実行メイン
	liRet = fMain();

	// １行出力
	sprintf(lc1Buf, "%d\n", liRet);
	fOutLine(lc1Buf);

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		siTNo = i;
		fOne();
	}
#else
	fOne();
#endif

	return 0;
}


SSTTTSST
 STTTSS
 SSSTTT
 TTTSSS
 TTTTSSSS
 TSTSST
 SSTTTS
 TSSTST
 STTSST
 TSSSTT

2
 4
 0
 6
 8
 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 <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_STR_MAX		200005									// 最大文字列長

// 内部構造体 - 文字情報
typedef struct Char {
	char mcChar;												// 文字
	int miCnt;													// 文字数
} Char;

// 内部変数
static FILE *szpFpI;											// 入力
static char sc1Str[D_STR_MAX];									// 文字列
static Char sz1Char[D_STR_MAX];									// 文字情報
static int siCCnt;												// 文字情報数

// 内部変数 - テスト用
#ifdef D_TEST
	static int siRes;
	static FILE *szpFpA;
	static int siTNo;
#endif

// １行出力
int
fOutLine(
	char *pcpLine				// <I> １行
)
{
	char lc1Buf[1024];

#ifdef D_TEST
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, pcpLine)) {
		siRes = -1;
	}
#else
	printf("%s", pcpLine);
#endif

	return 0;
}

// 文字情報 - 追加
int
fAdd(
	char pcChar					// <I> 追加文字
)
{
	// 加算
	if (siCCnt > 0) {
		if (sz1Char[siCCnt - 1].mcChar == pcChar) {
			sz1Char[siCCnt - 1].miCnt++;
			return 0;
		}
	}

	// 新規
	sz1Char[siCCnt].mcChar = pcChar;
	sz1Char[siCCnt].miCnt = 1;
	siCCnt++;

	return 0;
}

// 文字情報 - 削除
int
fDel(
	char pcChar					// <I> 削除文字
)
{
	// 文字有無
	if (siCCnt < 1) {
		return -1;
	}
	if (sz1Char[siCCnt - 1].mcChar != pcChar) {
		return -1;
	}

	// 削除
	if (sz1Char[siCCnt - 1].miCnt > 1) {
		sz1Char[siCCnt - 1].miCnt--;
	}
	else {
		siCCnt--;
	}

	return 0;
}

// 実行メイン
int
fMain(
)
{
	int i, liRet;

	// 文字列 - 取得
	fgets(sc1Str, sizeof(sc1Str), szpFpI);

	// 各文字 - チェック
	for (i = 0; ; i++) {
		if (sc1Str[i] == 'S') {
			fAdd('S');
		}
		else if (sc1Str[i] == 'T') {

			// 削除
			liRet = fDel('S');

			// 追加
			if (liRet != 0) {
				fAdd('T');
			}
		}
		else {
			break;
		}
	}

	// 文字数合計 - 取得
	int liSum = 0;
	for (i = 0; i < siCCnt; i++) {
		liSum += sz1Char[i].miCnt;
	}

	return liSum;
}

// １回実行
int
fOne(
)
{
	int liRet;
	char lc1Buf[1024];

	// データ - 初期化
	siCCnt = 0;													// 文字情報数

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
	szpFpI = fopen(lc1Buf, "r");
	sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
	szpFpA = fopen(lc1Buf, "r");
	siRes = 0;
#else
	szpFpI = stdin;
#endif

	// 実行メイン
	liRet = fMain();

	// １行出力
	sprintf(lc1Buf, "%d\n", liRet);
	fOutLine(lc1Buf);

	// 残データ有無
#ifdef D_TEST
	lc1Buf[0] = '\0';
	fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
	if (strcmp(lc1Buf, "")) {
		siRes = -1;
	}
#endif

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
	fclose(szpFpA);
#endif

	// テスト結果
#ifdef D_TEST
	if (siRes == 0) {
		printf("OK %d\n", siTNo);
	}
	else {
		printf("NG %d\n", siTNo);
	}
#endif

	return 0;
}

// プログラム開始
int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		siTNo = i;
		fOne();
	}
#else
	fOne();
#endif

	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	szpFpI
	.comm	szpFpI,8,8
	.local	sc1Str
	.comm	sc1Str,200005,32
	.local	sz1Char
	.comm	sz1Char,1600040,32
	.local	siCCnt
	.comm	siCCnt,4,4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	fOutLine
	.type	fOutLine, @function
fOutLine:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%rdi, -1048(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-1048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fOutLine, .-fOutLine
	.globl	fAdd
	.type	fAdd, @function
fAdd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	movl	siCCnt(%rip), %eax
	testl	%eax, %eax
	jle	.L5
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Char(%rip), %rax
	movzbl	(%rdx,%rax), %eax
	cmpb	%al, -4(%rbp)
	jne	.L5
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+sz1Char(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$0, %eax
	jmp	.L6
.L5:
	movl	siCCnt(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Char(%rip), %rdx
	movzbl	-4(%rbp), %eax
	movb	%al, (%rcx,%rdx)
	movl	siCCnt(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	siCCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fAdd, .-fAdd
	.globl	fDel
	.type	fDel, @function
fDel:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	movl	siCCnt(%rip), %eax
	testl	%eax, %eax
	jg	.L8
	movl	$-1, %eax
	jmp	.L9
.L8:
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Char(%rip), %rax
	movzbl	(%rdx,%rax), %eax
	cmpb	%al, -4(%rbp)
	je	.L10
	movl	$-1, %eax
	jmp	.L9
.L10:
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jle	.L11
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+sz1Char(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L12
.L11:
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	movl	%eax, siCCnt(%rip)
.L12:
	movl	$0, %eax
.L9:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	fDel, .-fDel
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	szpFpI(%rip), %rax
	movq	%rax, %rdx
	movl	$200005, %esi
	leaq	sc1Str(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	cltq
	leaq	sc1Str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$83, %al
	jne	.L14
	movl	$83, %edi
	call	fAdd
	jmp	.L15
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	sc1Str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$84, %al
	jne	.L22
	movl	$83, %edi
	call	fDel
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L15
	movl	$84, %edi
	call	fAdd
.L15:
	addl	$1, -12(%rbp)
	jmp	.L18
.L22:
	nop
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L19
.L20:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L19:
	movl	siCCnt(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L20
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	fMain, .-fMain
	.section	.rodata
.LC1:
	.string	"%d\n"
	.text
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, siCCnt(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movl	$0, %eax
	call	fMain
	movl	%eax, -1044(%rbp)
	movl	-1044(%rbp), %edx
	leaq	-1040(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	fOutLine
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	fOne, .-fOne
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	fOne
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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
	.local	szpFpI
	.comm	szpFpI,8,8
	.local	sc1Str
	.comm	sc1Str,200005,32
	.local	sz1Char
	.comm	sz1Char,1600040,32
	.local	siCCnt
	.comm	siCCnt,4,4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	fOutLine
	.type	fOutLine, @function
fOutLine:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%rdi, -1048(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-1048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	fOutLine, .-fOutLine
	.globl	fAdd
	.type	fAdd, @function
fAdd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	movl	siCCnt(%rip), %eax
	testl	%eax, %eax
	jle	.L5
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Char(%rip), %rax
	movzbl	(%rdx,%rax), %eax
	cmpb	%al, -4(%rbp)
	jne	.L5
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+sz1Char(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	$0, %eax
	jmp	.L6
.L5:
	movl	siCCnt(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	sz1Char(%rip), %rdx
	movzbl	-4(%rbp), %eax
	movb	%al, (%rcx,%rdx)
	movl	siCCnt(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	siCCnt(%rip), %eax
	addl	$1, %eax
	movl	%eax, siCCnt(%rip)
	movl	$0, %eax
.L6:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fAdd, .-fAdd
	.globl	fDel
	.type	fDel, @function
fDel:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	movl	siCCnt(%rip), %eax
	testl	%eax, %eax
	jg	.L8
	movl	$-1, %eax
	jmp	.L9
.L8:
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	sz1Char(%rip), %rax
	movzbl	(%rdx,%rax), %eax
	cmpb	%al, -4(%rbp)
	je	.L10
	movl	$-1, %eax
	jmp	.L9
.L10:
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jle	.L11
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	4+sz1Char(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L12
.L11:
	movl	siCCnt(%rip), %eax
	subl	$1, %eax
	movl	%eax, siCCnt(%rip)
.L12:
	movl	$0, %eax
.L9:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	fDel, .-fDel
	.globl	fMain
	.type	fMain, @function
fMain:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	szpFpI(%rip), %rax
	movq	%rax, %rdx
	movl	$200005, %esi
	leaq	sc1Str(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	cltq
	leaq	sc1Str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$83, %al
	jne	.L14
	movl	$83, %edi
	call	fAdd
	jmp	.L15
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	sc1Str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$84, %al
	jne	.L22
	movl	$83, %edi
	call	fDel
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L15
	movl	$84, %edi
	call	fAdd
.L15:
	addl	$1, -12(%rbp)
	jmp	.L18
.L22:
	nop
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L19
.L20:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+sz1Char(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -12(%rbp)
.L19:
	movl	siCCnt(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L20
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	fMain, .-fMain
	.section	.rodata
.LC1:
	.string	"%d\n"
	.text
	.globl	fOne
	.type	fOne, @function
fOne:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1056, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, siCCnt(%rip)
	movq	stdin(%rip), %rax
	movq	%rax, szpFpI(%rip)
	movl	$0, %eax
	call	fMain
	movl	%eax, -1044(%rbp)
	movl	-1044(%rbp), %edx
	leaq	-1040(%rbp), %rax
	leaq	.LC1(%rip), %rcx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	movl	$0, %eax
	call	sprintf@PLT
	leaq	-1040(%rbp), %rax
	movq	%rax, %rdi
	call	fOutLine
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	fOne, .-fOne
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	fOne
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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:
