// File: /workspace/github_c_makefile_star2_O1/hcmiya[P]opuscomment/src/parse-tags.c
// Function: parse_tags
void *parse_tags(void* nouse_) {
	bool do_read = true;
	if (tagnum) {
		// -tでタグを追加した場合、-cが無ければstdinを使わない
		if (!O.tag_filename) {
			do_read = false;
		}
	}
	if (O.tag_filename && strcmp(O.tag_filename, "-") != 0) {
		from_file = true;
		edit_input = fopen(O.tag_filename, "r");
		if (!edit_input) {
			fileerror(O.tag_filename);
		}
	}
	else {
		edit_input = stdin;
	}
	
	if (do_read) {
		// UTF-8化された文字列をチャンク化する処理をスレッド化(化が多い)
		int pfd[2];
		pipe(pfd);
		FILE *fpu8 = fdopen(pfd[0], "r");
		pthread_t split_thread;
		void *(*split)(void*) = O.tag_escape == TAG_ESCAPE_NUL ? split_binary : split_text;
		pthread_create(&split_thread, NULL, split, fpu8);
		
		// 本スレッドはstdinをUTF-8化する
		toutf8(pfd[1]);
		pthread_join(split_thread, NULL);
	}
	
	struct edit_st *rtn = calloc(1, sizeof(*rtn));
	rtn->str = strstore;
	rtn->len = strcount;
	rtn->pict = flacpict;
	rtn->num = tagnum;
	return rtn;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1048, %rsp           # imm = 0x1048
cmpq $0x0, 0x9255(%rip)      # 0xc558
sete %al
leaq 0x1937b(%rip), %r13     # 0x1c688
movq 0x18(%r13), %rbx
testq %rbx, %rbx
setne %bpl
orb %al, %bpl
testq %rbx, %rbx
je 0x3360
leaq 0x4d18(%rip), %rsi      # 0x803f
movq %rbx, %rdi
callq 0x2240
testl %eax, %eax
je 0x3360
movb $0x1, 0x9226(%rip)      # 0xc560
leaq 0x4d3e(%rip), %rsi      # 0x807f
movq %rbx, %rdi
callq 0x23c0
movq %rax, 0x9218(%rip)      # 0xc568
testq %rax, %rax
jne 0x3371
movq 0x18(%r13), %rdi
callq 0x7069
jmp 0x3371
movq 0x8c61(%rip), %rax      # 0xbfc8
movq (%rax), %rax
movq %rax, 0x91f7(%rip)      # 0xc568
testb %bpl, %bpl
je 0x35da
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x21e0
movl (%rbx), %edi
leaq 0x4cef(%rip), %rsi      # 0x807f
callq 0x2340
cmpl $0x2, 0x10(%r13)
leaq -0x2af(%rip), %rcx      # 0x30f2
leaq -0x776(%rip), %rdx      # 0x2c32
cmoveq %rcx, %rdx
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x2390
movl 0x4(%rbx), %ebx
leaq 0x840(%rsp), %r15
cmpb $0x0, 0x15(%r13)
je 0x33d6
leaq 0x4c30(%rip), %rsi      # 0x8004
jmp 0x33e3
movl $0xe, %edi
callq 0x22f0
movq %rax, %rsi
leaq 0x4c1a(%rip), %rdi      # 0x8004
callq 0x2979
movq %rax, %r14
movq $0x0, (%rsp)
movq 0x9167(%rip), %rcx      # 0xc568
movl $0x1, %esi
movl $0x800, %edx            # imm = 0x800
movq %r15, %rdi
callq 0x20e0
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x352a
leaq 0x40(%rsp), %r12
xorl %ecx, %ecx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
cmpq $0x7800001, %rax        # imm = 0x7800001
jb 0x3444
movl $0xb, %edi
xorl %eax, %eax
callq 0x6d34
cmpl $0x2, 0x10(%r13)
je 0x3468
movq (%rsp), %rdi
addq %r15, %rdi
movq 0x8(%rsp), %r13
movq %r13, %rsi
callq 0x21b0
cmpq %r13, %rax
jne 0x3626
movq 0x8(%rsp), %rax
addq %rax, (%rsp)
movq $0x800, 0x10(%rsp)      # imm = 0x800
movq %r15, 0x20(%rsp)
movq %r12, 0x18(%rsp)
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
leaq 0x18(%rsp), %rcx
leaq 0x10(%rsp), %r8
callq 0x20b0
movq %rax, %r13
callq 0x2050
movl (%rax), %ebp
cmpq $-0x1, %r13
jne 0x34c9
cmpl $0x54, %ebp
jne 0x34b8
callq 0x6f9b
movq 0x20(%rsp), %rsi
movq (%rsp), %rdx
movq %r15, %rdi
callq 0x22a0
movq 0x18(%rsp), %rdx
subq %r12, %rdx
movl %ebx, %edi
movq %r12, %rsi
callq 0x2100
cmpq $-0x1, %r13
jne 0x34e6
cmpl $0x16, %ebp
jne 0x3471
movq (%rsp), %rax
leaq (%r15,%rax), %rdi
movl $0x800, %edx            # imm = 0x800
subq %rax, %rdx
movq 0x906b(%rip), %rcx      # 0xc568
movl $0x1, %esi
callq 0x20e0
movq %rax, 0x8(%rsp)
testq %rax, %rax
leaq 0x19172(%rip), %r13     # 0x1c688
movq 0x28(%rsp), %rcx
jne 0x3428
testq %rcx, %rcx
setne %bpl
jmp 0x352c
xorl %ebp, %ebp
movq 0x9035(%rip), %rdi      # 0xc568
callq 0x2120
cmpl $-0x1, %eax
jne 0x3542
callq 0x3ea4
cmpq $0x0, (%rsp)
je 0x3559
callq 0x2050
movl $0x54, (%rax)
callq 0x3ea4
leaq 0x40(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, (%rcx)
leaq 0x8(%rsp), %r8
movq $0x800, (%r8)           # imm = 0x800
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x20b0
movq %rax, (%rsp)
cmpq $-0x1, %rax
jne 0x358d
callq 0x6f9b
movq %r14, %rdi
callq 0x2370
movq 0x10(%rsp), %rdx
subq %r15, %rdx
movl %ebx, %edi
movq %r15, %rsi
callq 0x2100
movl %ebx, %edi
callq 0x21c0
cmpl $0x2, (%r13)
setne %al
orb %al, %bpl
jne 0x35ce
cmpb $0x1, 0x20(%r13)
jne 0x35ce
movl $0xc, %edi
xorl %eax, %eax
callq 0x6d34
movq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x2490
movl $0x1, %edi
movl $0x20, %esi
callq 0x2220
movq 0x8f50(%rip), %rcx      # 0xc540
movq %rcx, (%rax)
movq 0x8f4e(%rip), %rcx      # 0xc548
movq %rcx, 0x8(%rax)
movq 0x8f4b(%rip), %rcx      # 0xc550
movq %rcx, 0x10(%rax)
movq 0x8f48(%rip), %rcx      # 0xc558
movq %rcx, 0x18(%rax)
addq $0x1048, %rsp           # imm = 0x1048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19053(%rip), %rax     # 0x1c680
movq (%rax), %rdi
leaq 0x4a86(%rip), %rcx      # 0x80bd
movl $0x5, %esi
movl $0x4, %edx
callq 0x2440
movq %rax, %rdi
callq 0x3e34