// File: /workspace/github_c_makefile_star2_O3/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
leaq 0x1938b(%rip), %r13     # 0x1c688
movq 0x18(%r13), %rdi
testq %rdi, %rdi
je 0x333b
cmpb $0x2d, (%rdi)
jne 0x3311
cmpb $0x0, 0x1(%rdi)
je 0x335e
movb $0x1, 0x9248(%rip)      # 0xc560
leaq 0x4d5e(%rip), %rsi      # 0x807d
callq 0x23c0
movq %rax, 0x923d(%rip)      # 0xc568
testq %rax, %rax
jne 0x336f
movq 0x18(%r13), %rdi
callq 0x7025
jmp 0x336f
movq 0x9216(%rip), %rbx      # 0xc558
movq 0x8c7f(%rip), %rax      # 0xbfc8
movq (%rax), %rax
movq %rax, 0x9215(%rip)      # 0xc568
testq %rbx, %rbx
jne 0x35d5
jmp 0x336f
movq 0x8c63(%rip), %rax      # 0xbfc8
movq (%rax), %rax
movq %rax, 0x91f9(%rip)      # 0xc568
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x21e0
movl (%rbx), %edi
leaq 0x4cf8(%rip), %rsi      # 0x807d
callq 0x2340
cmpl $0x2, 0x10(%r13)
leaq -0x2a9(%rip), %rcx      # 0x30ed
leaq -0x773(%rip), %rdx      # 0x2c2a
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 0x33cb
leaq 0x4c3b(%rip), %rsi      # 0x8004
jmp 0x33d8
movl $0xe, %edi
callq 0x22f0
movq %rax, %rsi
leaq 0x4c25(%rip), %rdi      # 0x8004
callq 0x297e
movq %rax, %r14
movq $0x0, 0x8(%rsp)
movq 0x9171(%rip), %rcx      # 0xc568
movl $0x1, %esi
movl $0x800, %edx            # imm = 0x800
movq %r15, %rdi
callq 0x20e0
testq %rax, %rax
je 0x351c
movq %rax, %rbp
leaq 0x40(%rsp), %r12
xorl %eax, %eax
addq %rbp, %rax
movq %rax, 0x28(%rsp)
cmpq $0x7800001, %rax        # imm = 0x7800001
jb 0x3438
movl $0xb, %edi
xorl %eax, %eax
callq 0x6cf0
cmpl $0x2, 0x10(%r13)
movq 0x8(%rsp), %r13
je 0x3459
leaq (%r15,%r13), %rdi
movq %rbp, %rsi
callq 0x21b0
cmpq %rbp, %rax
jne 0x361a
addq %rbp, %r13
movq %r13, 0x8(%rsp)
movq $0x800, 0x20(%rsp)      # imm = 0x800
movq %r15, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x20(%rsp), %r8
callq 0x20b0
movq %rax, %r13
callq 0x2050
movl (%rax), %ebp
cmpq $-0x1, %r13
jne 0x34bc
cmpl $0x54, %ebp
jne 0x34aa
callq 0x6f57
movq 0x10(%rsp), %rsi
movq 0x8(%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 0x34d9
cmpl $0x16, %ebp
jne 0x3461
movq 0x8(%rsp), %rax
leaq (%r15,%rax), %rdi
movl $0x800, %edx            # imm = 0x800
subq %rax, %rdx
movq 0x9077(%rip), %rcx      # 0xc568
movl $0x1, %esi
callq 0x20e0
movq %rax, %rbp
testq %rax, %rax
leaq 0x19180(%rip), %r13     # 0x1c688
movq 0x28(%rsp), %rax
jne 0x341c
testq %rax, %rax
setne %bpl
jmp 0x351e
xorl %ebp, %ebp
movq 0x9043(%rip), %rdi      # 0xc568
callq 0x2120
cmpl $-0x1, %eax
jne 0x3534
callq 0x3ea0
cmpq $0x0, 0x8(%rsp)
je 0x354c
callq 0x2050
movl $0x54, (%rax)
callq 0x3ea0
leaq 0x40(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, (%rcx)
leaq 0x20(%rsp), %r8
movq $0x800, (%r8)           # imm = 0x800
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x20b0
movq %rax, 0x8(%rsp)
cmpq $-0x1, %rax
jne 0x3581
callq 0x6f57
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 0x35c2
cmpb $0x1, 0x20(%r13)
jne 0x35c2
movl $0xc, %edi
xorl %eax, %eax
callq 0x6cf0
movq 0x30(%rsp), %rdi
xorl %esi, %esi
callq 0x2490
movq 0x8f83(%rip), %rbx      # 0xc558
movl $0x1, %edi
movl $0x20, %esi
callq 0x2220
movq 0x8f55(%rip), %rcx      # 0xc540
movq %rcx, (%rax)
movq 0x8f53(%rip), %rcx      # 0xc548
movq %rcx, 0x8(%rax)
movq 0x8f50(%rip), %rcx      # 0xc550
movq %rcx, 0x10(%rax)
movq %rbx, 0x18(%rax)
addq $0x1048, %rsp           # imm = 0x1048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1905f(%rip), %rax     # 0x1c680
movq (%rax), %rdi
leaq 0x4a90(%rip), %rcx      # 0x80bb
movl $0x5, %esi
movl $0x4, %edx
callq 0x2440
movq %rax, %rdi
callq 0x3e30