LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/parse-tags.c
// Function: esctab
static int esctab(int c) {
	switch (c) {
	case 0x30: // '0'
		c = '\0';
		break;
	case 0x5c: // '\'
		c = 0x5c;
		break;
	case 0x6e: // 'n'
		c = 0x0a;
		break;
	case 0x72: // 'r'
		c = 0x0d;
		break;
	default:
		err_esc();
		break;
	}
	return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
subl $0x30, %eax
je 0x40d6
jmp 0x40b8
movl -0x8(%rbp), %eax
subl $0x5c, %eax
je 0x40df
jmp 0x40c2
movl -0x8(%rbp), %eax
subl $0x6e, %eax
je 0x40e8
jmp 0x40cc
movl -0x8(%rbp), %eax
subl $0x72, %eax
je 0x40f1
jmp 0x40fa
movl $0x0, -0x4(%rbp)
jmp 0x40ff
movl $0x5c, -0x4(%rbp)
jmp 0x40ff
movl $0xa, -0x4(%rbp)
jmp 0x40ff
movl $0xd, -0x4(%rbp)
jmp 0x40ff
callq 0x3d00
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/parse-tags.c
// Function: append_buffer
static void append_buffer(uint8_t *line, size_t n) {
	if (store_picture) {
		decode_base64(line, n);
		return;
	}
	editlen += n;
	if (editlen > TAG_LENGTH_LIMIT__OUTPUT) {
		exceed_output_limit();
	}
	recordlen += n;
	fwrite(line, 1, n, strstore);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
testb $0x1, 0x928c(%rip)      # 0xd5b3
je 0x4338
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4550
jmp 0x4388
movq -0x10(%rbp), %rax
addq 0x929d(%rip), %rax      # 0xd5e0
movq %rax, 0x9296(%rip)      # 0xd5e0
cmpq $0x2800000, 0x928b(%rip) # imm = 0x2800000
jbe 0x435c
callq 0x8ad0
movq -0x10(%rbp), %rcx
movl 0x925a(%rip), %eax      # 0xd5c0
addq %rcx, %rax
movl %eax, 0x9251(%rip)      # 0xd5c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq 0x9202(%rip), %rcx      # 0xd580
movl $0x1, %esi
callq 0x2490
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/parse-tags.c
// Function: tagerror
static noreturn void tagerror(char *e) {
	errorprefix();
	fprintf(stderr, catgets(catd, 1, 6, "editing input #%zu: "), tagnum + 1);
	fputs(e, stderr);
	fputc('\n', stderr);
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
callq 0x8510
movq 0x8c50(%rip), %rax      # 0xcff8
movq (%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0x1930a(%rip), %rax     # 0x1d6c0
movq (%rax), %rdi
movl $0x1, %esi
movl $0x6, %edx
leaq 0x5c8f(%rip), %rcx      # 0xa059
callq 0x2460
movq -0x10(%rbp), %rdi
movq %rax, %rsi
movq 0x91bb(%rip), %rdx      # 0xd598
addq $0x1, %rdx
movb $0x0, %al
callq 0x2290
movq -0x8(%rbp), %rdi
movq 0x8c05(%rip), %rax      # 0xcff8
movq (%rax), %rsi
callq 0x2190
movq 0x8bf6(%rip), %rax      # 0xcff8
movq (%rax), %rsi
movl $0xa, %edi
callq 0x2210
movl $0x1, %edi
callq 0x2480
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/parse-tags.c
// Function: count_field_len
static bool count_field_len(uint8_t *line, size_t n) {
	size_t add;
	bool filled;
	if (on_field) {
		add = n - fieldlen;
	}
	else {
		add = (uint8_t*)memchr(line, 0x3d, n) - line;
	}
	if (fieldlen + add <= 22) {
		memcpy(&field_pending[fieldlen], line, add);
		filled = !on_field;
	}
	else {
		memcpy(&field_pending[fieldlen], line, 22 - fieldlen);
		filled = true;
	}
	fieldlen += add;
	return filled;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
testb $0x1, 0x911b(%rip)      # 0xd5b2
je 0x44aa
movq -0x10(%rbp), %rax
subq 0x9124(%rip), %rax      # 0xd5c8
movq %rax, -0x18(%rbp)
jmp 0x44c7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x3d, %esi
callq 0x2220
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x18(%rbp)
movq 0x90fa(%rip), %rax      # 0xd5c8
addq -0x18(%rbp), %rax
cmpq $0x16, %rax
ja 0x4502
leaq 0x9111(%rip), %rdi      # 0xd5f0
addq 0x90e2(%rip), %rdi      # 0xd5c8
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x22d0
movb 0x90b9(%rip), %al       # 0xd5b2
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x19(%rbp)
jmp 0x4529
leaq 0x90e7(%rip), %rdi      # 0xd5f0
addq 0x90b8(%rip), %rdi      # 0xd5c8
movq -0x8(%rbp), %rsi
movl $0x16, %edx
subq 0x90a8(%rip), %rdx      # 0xd5c8
callq 0x22d0
movb $0x1, -0x19(%rbp)
movq -0x18(%rbp), %rax
addq 0x9094(%rip), %rax      # 0xd5c8
movq %rax, 0x908d(%rip)      # 0xd5c8
movb -0x19(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/parse-tags.c
// Function: readerror
static void readerror(void) {
	if (from_file) {
		fileerror(O.tag_filename);
	}
	else {
		oserror();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testb $0x1, 0x8e75(%rip)      # 0xd5a0
je 0x473f
leaq 0x18f94(%rip), %rax     # 0x1d6c8
movq 0x18(%rax), %rdi
callq 0x8960
jmp 0x4744
callq 0x8880
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read.c
// Function: move_file
void move_file(void) {
	if (fclose(built_stream) == EOF) {
		fileerror(O.out ? O.out : outtmp);
	}
	if (O.out || !input_is_regular_file) {
	}
	else {
		int fd = fileno(stream_input);
		struct stat st;
		fstat(fd, &st);
		if (!rename(outtmp, O.in)) {
			// rename(2)は移動先が存在していてもunlink(2)の必要はない
			remove_tmp = false;
			if (!chmod(O.in, st.st_mode)) {
				return;
			}
		}
		oserror();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq 0x18fbe(%rip), %rax     # 0x1d720
movq (%rax), %rdi
callq 0x2120
cmpl $-0x1, %eax
jne 0x47ab
leaq 0x18f52(%rip), %rax     # 0x1d6c8
cmpq $0x0, 0x30(%rax)
je 0x4791
leaq 0x18f44(%rip), %rax     # 0x1d6c8
movq 0x30(%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x479f
movq 0x8e78(%rip), %rax      # 0xd610
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x8960
leaq 0x18f16(%rip), %rax     # 0x1d6c8
cmpq $0x0, 0x30(%rax)
jne 0x47c5
leaq 0x18f48(%rip), %rax     # 0x1d708
testb $0x1, (%rax)
jne 0x47c7
jmp 0x482c
leaq 0x18f32(%rip), %rax     # 0x1d700
movq (%rax), %rdi
callq 0x2300
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
leaq -0x98(%rbp), %rsi
callq 0x24f0
movq 0x8e21(%rip), %rdi      # 0xd610
leaq 0x18ed2(%rip), %rax     # 0x1d6c8
movq 0x28(%rax), %rsi
callq 0x2400
cmpl $0x0, %eax
jne 0x4827
movb $0x0, 0x8e0d(%rip)      # 0xd618
leaq 0x18eb6(%rip), %rax     # 0x1d6c8
movq 0x28(%rax), %rdi
movl -0x80(%rbp), %esi
callq 0x23a0
cmpl $0x0, %eax
jne 0x4825
jmp 0x482c
jmp 0x4827
callq 0x8880
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read.c
// Function: put_left
static noreturn void put_left(long rew) {
	clearerr(stream_input);
	if (fseek(stream_input, seeked_len - rew, SEEK_SET)) {
		oserror();
	}
	
	size_t l;
	uint8_t buf[STACK_BUF_LEN];
	while (l = fread(buf, 1, STACK_BUF_LEN, stream_input)) {
		size_t ret = fwrite(buf, 1, l, built_stream);
		if (ret != l) {
			oserror();
		}
	}
	if (ferror(stream_input)) {
		oserror();
	}
	move_file();
	exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1020, %rsp           # imm = 0x1020
movq %rdi, -0x8(%rbp)
leaq 0x1883a(%rip), %rax     # 0x1d700
movq (%rax), %rdi
callq 0x22c0
leaq 0x1882b(%rip), %rax     # 0x1d700
movq (%rax), %rdi
movq 0x8759(%rip), %rsi      # 0xd638
subq -0x8(%rbp), %rsi
xorl %edx, %edx
callq 0x2340
cmpl $0x0, %eax
je 0x4ef4
callq 0x8880
jmp 0x4ef6
leaq -0x1010(%rbp), %rdi
leaq 0x187fc(%rip), %rax     # 0x1d700
movq (%rax), %rcx
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x20e0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x4f5a
leaq -0x1010(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x187ee(%rip), %rax     # 0x1d720
movq (%rax), %rcx
movl $0x1, %esi
callq 0x2490
movq %rax, -0x1018(%rbp)
movq -0x1018(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x4f58
callq 0x8880
jmp 0x4ef6
leaq 0x1879f(%rip), %rax     # 0x1d700
movq (%rax), %rdi
callq 0x20c0
cmpl $0x0, %eax
je 0x4f73
callq 0x8880
callq 0x4750
xorl %edi, %edi
callq 0x2480
nop
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read.c
// Function: check_header_is_single_page
static void check_header_is_single_page(ogg_page *og) {
	uint8_t lace_num = og->header[26];
	if (!lace_num) opuserror(err_opus_border);
	uint8_t const *lace = &og->header[27];
	for (int_fast16_t i = 0; i < lace_num - 1; i++) {
		if (*lace++ != 255) {
			opuserror(err_opus_border);
		}
	}
	if (*lace == 255) {
		opuserror(err_opus_border);
	}
	// 最後のlacing valueはチェックしない
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movb 0x1a(%rax), %al
movb %al, -0x9(%rbp)
cmpb $0x0, -0x9(%rbp)
jne 0x551b
movl $0x3, %edi
movb $0x0, %al
callq 0x8690
movq -0x8(%rbp), %rax
movq (%rax), %rax
addq $0x1b, %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzbl -0x9(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x557a
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movzbl (%rax), %eax
cmpl $0xff, %eax
je 0x556a
movl $0x3, %edi
movb $0x0, %al
callq 0x8690
jmp 0x556c
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x5532
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xff, %eax
jne 0x5594
movl $0x3, %edi
movb $0x0, %al
callq 0x8690
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read.c
// Function: parse_page_sound
bool parse_page_sound(ogg_page *og) {
	set_pageno(og, ogg_page_pageno(og) + opus_idx_diff);
	ogg_page_checksum_set(og);
	write_page(og, built_stream);
	if (ogg_page_eos(og)) {
		if (input_is_regular_file) {
			put_left(0);
			/* NOTREACHED */
		}
		else {
			opus_idx_diff = 0;
		}
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2080
movq -0x10(%rbp), %rdi
leaq 0x17f50(%rip), %rcx     # 0x1d718
movl (%rcx), %ecx
addq %rcx, %rax
movl %eax, %esi
callq 0x6c90
movq -0x8(%rbp), %rdi
callq 0x2110
movq -0x8(%rbp), %rdi
leaq 0x17f38(%rip), %rax     # 0x1d720
movq (%rax), %rsi
callq 0x6c10
movq -0x8(%rbp), %rdi
callq 0x24e0
cmpl $0x0, %eax
je 0x5824
leaq 0x17f03(%rip), %rax     # 0x1d708
testb $0x1, (%rax)
je 0x5815
xorl %eax, %eax
movl %eax, %edi
callq 0x4eb0
jmp 0x5822
leaq 0x17efc(%rip), %rax     # 0x1d718
movl $0x0, (%rax)
jmp 0x5824
movb $0x1, %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read.c
// Function: parse_comment
bool parse_comment(ogg_page *og) {
	if (ogg_page_eos(og) || opus_idx > 1 && !ogg_page_continued(og)) {
		opuserror(err_opus_bad_stream);
	}
	opus_idx++;
	bool packet_break_in_page;
	if (copy_tag_packet(og, &packet_break_in_page)) {
		return parse_comment_term(og, packet_break_in_page);
	}
	
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x24e0
cmpl $0x0, %eax
jne 0x5864
leaq 0x17ebf(%rip), %rax     # 0x1d710
cmpl $0x1, (%rax)
jbe 0x5870
movq -0x10(%rbp), %rdi
callq 0x24a0
cmpl $0x0, %eax
jne 0x5870
movl $0x5, %edi
movb $0x0, %al
callq 0x8690
leaq 0x17e99(%rip), %rax     # 0x1d710
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x17e8d(%rip), %rax     # 0x1d710
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
leaq -0x11(%rbp), %rsi
callq 0x58c0
testb $0x1, %al
jne 0x5898
jmp 0x58b0
movq -0x10(%rbp), %rdi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x5a60
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x58b4
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read.c
// Function: parse_comment_term
static bool parse_comment_term(ogg_page *og, bool packet_break_in_page) {
	// タグパケットのパース処理のスレッドを合流
	struct rettag_st *rst;
	struct edit_st *est;
	close(retriever_fd);
	pthread_join(retriever_thread, (void**)&rst);
	if (O.edit != EDIT_LIST) {
		// 編集入力タグパースのスレッドを合流
		pthread_join(parser_thread, (void **)&est);
	}
	
	if (O.edit == EDIT_APPEND && !rst->del && !est->num && !O.out && !O.gain_fix && !rst->upcase) {
		// タグ追記モードで出力が上書き且つ
		// タグ入力、ゲイン調整、タグ削除、大文字化適用が全て無い場合はすぐ終了する
		exit(0);
	}
//	来ない
// 	else if (O.edit == EDIT_LIST) {
// 		exit(0);
// 	}
	store_tags(og, rst, est, packet_break_in_page);
	free(rst);
	free(est);
	
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movl 0x7bd6(%rip), %edi      # 0xd650
callq 0x21e0
movq 0x7bd2(%rip), %rdi      # 0xd658
leaq -0x18(%rbp), %rsi
callq 0x24c0
leaq 0x17c32(%rip), %rax     # 0x1d6c8
cmpl $0x1, (%rax)
je 0x5aae
leaq 0x17c96(%rip), %rax     # 0x1d738
movq (%rax), %rdi
leaq -0x20(%rbp), %rsi
callq 0x24c0
leaq 0x17c13(%rip), %rax     # 0x1d6c8
cmpl $0x3, (%rax)
jne 0x5afc
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x5afc
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x5afc
leaq 0x17bf1(%rip), %rax     # 0x1d6c8
cmpq $0x0, 0x30(%rax)
jne 0x5afc
leaq 0x17be3(%rip), %rax     # 0x1d6c8
testb $0x1, 0x4(%rax)
jne 0x5afc
movq -0x18(%rbp), %rax
testb $0x1, 0x28(%rax)
jne 0x5afc
xorl %edi, %edi
callq 0x2480
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movb -0x9(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0x4840
movq -0x18(%rbp), %rdi
callq 0x2030
movq -0x20(%rbp), %rdi
callq 0x2030
movb $0x1, %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read.c
// Function: read_page
void read_page(ogg_sync_state *oy) {
	int seeklen;
	ogg_page og;
	while ((seeklen = ogg_sync_pageseek(oy, &og)) != 0) {
		if (seeklen > 0) {
			seeked_len += seeklen;
			parse_page(&og);
		}
		else seeked_len += -seeklen;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x2380
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
je 0x5b9b
cmpl $0x0, -0xc(%rbp)
jle 0x5b84
movslq -0xc(%rbp), %rax
addq 0x7ac6(%rip), %rax      # 0xd638
movq %rax, 0x7abf(%rip)      # 0xd638
leaq -0x30(%rbp), %rdi
callq 0x5bb0
jmp 0x5b99
xorl %eax, %eax
subl -0xc(%rbp), %eax
cltq
addq 0x7aa6(%rip), %rax      # 0xd638
movq %rax, 0x7a9f(%rip)      # 0xd638
jmp 0x5b4c
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read.c
// Function: parse_page
static void parse_page(ogg_page *og) {
	bool isopus;
	if (opst == PAGE_INFO) {
		isopus = parse_info(og);
	}
	else if ((isopus = test_non_opus(og))) {
		switch (opst) {
		case PAGE_INFO_BORDER:
			parse_info_border(og);
			break;
			
		case PAGE_COMMENT:
			parse_comment(og);
			break;
			
		case PAGE_SOUND:
			parse_page_sound(og);
			break;
		}
	}
	if (isopus && opst < PAGE_SOUND && ogg_page_eos(og)) {
		opuserror(err_opus_bad_stream);
	}
	if (!isopus) {
		write_page(og, ogg_page_pageno(og) && non_opus_stream ? non_opus_stream : built_stream);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x17b49(%rip), %rax     # 0x1d70c
cmpl $0x0, (%rax)
jne 0x5bd8
movq -0x8(%rbp), %rdi
callq 0x5310
andb $0x1, %al
movb %al, -0x9(%rbp)
jmp 0x5c39
movq -0x8(%rbp), %rdi
callq 0x6ac0
movb %al, %cl
andb $0x1, %cl
movb %cl, -0x9(%rbp)
testb $0x1, %al
jne 0x5bef
jmp 0x5c37
leaq 0x17b16(%rip), %rax     # 0x1d70c
movl (%rax), %eax
movl %eax, -0x10(%rbp)
subl $0x1, %eax
je 0x5c16
jmp 0x5c02
movl -0x10(%rbp), %eax
subl $0x2, %eax
je 0x5c21
jmp 0x5c0c
movl -0x10(%rbp), %eax
subl $0x4, %eax
je 0x5c2c
jmp 0x5c35
movq -0x8(%rbp), %rdi
callq 0x55a0
jmp 0x5c35
movq -0x8(%rbp), %rdi
callq 0x5830
jmp 0x5c35
movq -0x8(%rbp), %rdi
callq 0x57a0
jmp 0x5c37
jmp 0x5c39
testb $0x1, -0x9(%rbp)
je 0x5c65
leaq 0x17ac6(%rip), %rax     # 0x1d70c
cmpl $0x4, (%rax)
jae 0x5c65
movq -0x8(%rbp), %rdi
callq 0x24e0
cmpl $0x0, %eax
je 0x5c65
movl $0x5, %edi
movb $0x0, %al
callq 0x8690
testb $0x1, -0x9(%rbp)
jne 0x5cb4
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2080
cmpq $0x0, %rax
je 0x5c99
cmpq $0x0, 0x7996(%rip)      # 0xd620
je 0x5c99
movq 0x798d(%rip), %rax      # 0xd620
movq %rax, -0x20(%rbp)
jmp 0x5ca7
leaq 0x17a80(%rip), %rax     # 0x1d720
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6c10
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read.c
// Function: put_non_opus_stream
static void put_non_opus_stream() {
	rewind(non_opus_stream);
	uint8_t buf[STACK_BUF_LEN];
	size_t readlen;
	while (readlen = fread(buf, 1, STACK_BUF_LEN, non_opus_stream)) {
		if (fwrite(buf, 1, readlen, built_stream) != readlen) {
			oserror();
		}
	}
	fclose(non_opus_stream);
	non_opus_stream = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1010, %rsp           # imm = 0x1010
movq 0x794e(%rip), %rdi      # 0xd620
callq 0x2160
leaq -0x1000(%rbp), %rdi
movq 0x793b(%rip), %rcx      # 0xd620
movl $0x1, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x20e0
movq %rax, -0x1008(%rbp)
cmpq $0x0, %rax
je 0x5d33
leaq -0x1000(%rbp), %rdi
movq -0x1008(%rbp), %rdx
leaq 0x17a0a(%rip), %rax     # 0x1d720
movq (%rax), %rcx
movl $0x1, %esi
callq 0x2490
cmpq -0x1008(%rbp), %rax
je 0x5d31
callq 0x8880
jmp 0x5cd7
movq 0x78e6(%rip), %rdi      # 0xd620
callq 0x2120
movq $0x0, 0x78d6(%rip) # 0xd620
addq $0x1010, %rsp           # imm = 0x1010
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read-flac.c
// Function: get_metadata_header
bool get_metadata_header(uint8_t *type, size_t *len) {
	size_t readlen = fread(gbuf, 1, 4, stream_input);
	if (readlen == (size_t)-1) oserror();
	if (readlen != 4) {
		opuserror(err_opus_non_flac);
	}
	
	bool last = 0x80 & gbuf[0];
	*type = 0x7f & gbuf[0];
	gbuf[0] = 0;
	*len = htonl(*(uint32_t*)gbuf);
	gbuf[0] = *type; // 「最後のヘッダ」標識を削除
	return last;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x17989(%rip), %rax     # 0x1d700
movq (%rax), %rcx
leaq 0x78ef(%rip), %rdi      # 0xd670
movl $0x1, %esi
movl $0x4, %edx
callq 0x20e0
movq %rax, -0x18(%rbp)
cmpq $-0x1, -0x18(%rbp)
jne 0x5da0
callq 0x8880
cmpq $0x4, -0x18(%rbp)
je 0x5db3
movl $0xf, %edi
movb $0x0, %al
callq 0x8690
movzbl 0x78b6(%rip), %eax      # 0xd670
andl $0x80, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x19(%rbp)
movzbl 0x789f(%rip), %eax      # 0xd670
andl $0x7f, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
movb $0x0, 0x788d(%rip)      # 0xd670
movl 0x7887(%rip), %edi      # 0xd670
callq 0x21a0
movl %eax, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movb (%rax), %al
movb %al, 0x786b(%rip)       # 0xd670
movb -0x19(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read-flac.c
// Function: store_tags_flac
void store_tags_flac(struct rettag_st *rst, struct edit_st *est) {
	size_t readlen;
	if (rst) {
		store_tags(NULL, rst, est, false);
		uint32_t left = ftell(rst->tag);
		*(uint32_t*)gbuf = ntohl(left);
		gbuf[0] = 4;
		write_buffer(gbuf, 4, built_stream);
		rewind(rst->tag);
		while (readlen = fread(gbuf, 1, gbuflen, rst->tag)) {
			write_buffer(gbuf, readlen, built_stream);
		}
	}
	rewind(est->pict);
	while (readlen = fread(gbuf, 1, gbuflen, est->pict)) {
		write_buffer(gbuf, readlen, built_stream);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x5ece
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
xorl %ecx, %ecx
callq 0x4840
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x22b0
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x24d0
movl %eax, 0x7815(%rip)      # 0xd670
movb $0x4, 0x780e(%rip)      # 0xd670
leaq 0x178b7(%rip), %rax     # 0x1d720
movq (%rax), %rdx
leaq 0x77fd(%rip), %rdi      # 0xd670
movl $0x4, %esi
callq 0x5f30
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x2160
movq -0x8(%rbp), %rax
movq (%rax), %rcx
leaq 0x77d9(%rip), %rdi      # 0xd670
movl $0x1, %esi
movl $0x10000, %edx          # imm = 0x10000
callq 0x20e0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x5ecc
movq -0x18(%rbp), %rsi
leaq 0x17865(%rip), %rax     # 0x1d720
movq (%rax), %rdx
leaq 0x77ab(%rip), %rdi      # 0xd670
callq 0x5f30
jmp 0x5e89
jmp 0x5ece
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2160
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
leaq 0x7786(%rip), %rdi      # 0xd670
movl $0x1, %esi
movl $0x10000, %edx          # imm = 0x10000
callq 0x20e0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
je 0x5f1f
movq -0x18(%rbp), %rsi
leaq 0x17812(%rip), %rax     # 0x1d720
movq (%rax), %rdx
leaq 0x7758(%rip), %rdi      # 0xd670
callq 0x5f30
jmp 0x5edb
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read-flac.c
// Function: read_comment
static void read_comment(size_t left) {
	// ここから read.c の parse_info_border() と大体一緒
	pthread_t retriever_thread;
	
	// タグヘッダパースを別スレッド化 retrieve_tags.c へ
	int pfd[2];
	pipe(pfd);
	FILE *retriever = fdopen(pfd[0], "r");
	pthread_create(&retriever_thread, NULL, retrieve_tags, retriever);
	
	// 本スレッドはタグヘッダを送り続ける
	while (left) {
		size_t readlen = left > gbuflen ? gbuflen : left;
		size_t readret = fread(gbuf, 1, readlen, stream_input);
		if (readlen != readret) oserror();
		write(pfd[1], gbuf, readlen);
		left -= readlen;
	}
	
	// ここから read.c の parse_comment_term() と似たようなこと
	struct rettag_st *rst;
	struct edit_st *est;
	close(pfd[1]);
	pthread_join(retriever_thread, (void**)&rst);
	if (O.edit != EDIT_LIST) {
		// 編集入力タグパースのスレッドを合流
		pthread_join(parser_thread, (void **)&est);
		store_tags_flac(rst, est);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x2200
movl -0x18(%rbp), %edi
leaq 0x3c80(%rip), %rsi      # 0xa07f
callq 0x2360
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
leaq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x915(%rip), %rdx       # 0x6d30
callq 0x23b0
cmpq $0x0, -0x8(%rbp)
je 0x64a5
cmpq $0x10000, -0x8(%rbp)    # imm = 0x10000
jbe 0x643c
movl $0x10000, %eax          # imm = 0x10000
movq %rax, -0x48(%rbp)
jmp 0x6444
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdx
leaq 0x172a9(%rip), %rax     # 0x1d700
movq (%rax), %rcx
leaq 0x720f(%rip), %rdi      # 0xd670
movl $0x1, %esi
callq 0x20e0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x647e
callq 0x8880
movl -0x14(%rbp), %edi
movq -0x28(%rbp), %rdx
leaq 0x71e4(%rip), %rsi      # 0xd670
callq 0x2100
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x6420
movl -0x14(%rbp), %edi
callq 0x21e0
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x24c0
leaq 0x17207(%rip), %rax     # 0x1d6c8
cmpl $0x1, (%rax)
je 0x64e6
leaq 0x1726b(%rip), %rax     # 0x1d738
movq (%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x24c0
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x5e10
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read-flac.c
// Function: put_base64_locale
static void *put_base64_locale(void *tagin_) {
	FILE *tagin = tagin_;
	iconv_t cd = iconv_open(nl_langinfo(CODESET), "us-ascii");
	size_t readlen;
	char buf[128];
	while (readlen = fread(buf, 1, 64, tagin)) {
		size_t asciileft = readlen, locleft = 128 - readlen;
		char *ascii = buf, *loc = buf + readlen;
		iconv(cd, &ascii, &asciileft, &loc, &locleft);
		// このiconv()はPCS範囲内でシフトも発生しないはずなのでバッファ持ち越しがない
		// asciiは元のlocの位置に移った
		write_buffer(ascii, loc - ascii, tag_output);
	}
	iconv_close(cd);
	fclose(tagin);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0xe, %edi
callq 0x2320
movq %rax, %rdi
leaq 0x395f(%rip), %rsi      # 0xa0fa
callq 0x2510
movq %rax, -0x18(%rbp)
leaq -0xa0(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0x40, %edx
callq 0x20e0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x6858
movq -0x20(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x80, %eax
subq -0x20(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0xa0(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
leaq -0xb0(%rbp), %r8
callq 0x20b0
movq -0xb8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rax
subq %rax, %rsi
leaq 0x16edd(%rip), %rax     # 0x1d728
movq (%rax), %rdx
callq 0x5f30
jmp 0x67a4
movq -0x18(%rbp), %rdi
callq 0x2390
movq -0x10(%rbp), %rdi
callq 0x2120
xorl %eax, %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/ocutil.c
// Function: test_tag_field
bool test_tag_field(uint8_t *line, size_t n, bool upcase, bool *on_field, bool *upcase_applied_) {
	// フィールドの使用文字チェック・大文字化
	if (!upcase) {
		return test_tag_field_keepcase(line, n, on_field);
	}
	
	bool dummy_, *upcase_applied;
	upcase_applied = upcase_applied_ ? upcase_applied_ : &dummy_;
	
	size_t i;
	bool valid = true;
	for (i = 0; i < n && line[i] != 0x3d; i++) {
		if (!(line[i] >= 0x20 && line[i] <= 0x7d)) {
			valid = false;
		}
		if (line[i] >= 0x61 && line[i] <= 0x7a) {
			line[i] -= 32;
			*upcase_applied = true;
		}
	}
	if (i < n) *on_field = false;
	return valid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x68c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x69c0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x69a9
cmpq $0x0, -0x30(%rbp)
je 0x68d1
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x68db
leaq -0x31(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x68db
movq -0x58(%rbp), %rax
movq %rax, -0x40(%rbp)
movb $0x1, -0x49(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rcx
xorl %eax, %eax
cmpq -0x18(%rbp), %rcx
movb %al, -0x59(%rbp)
jae 0x6913
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
setne %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x691c
jmp 0x6990
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jl 0x693e
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x7d, %eax
jle 0x6942
movb $0x0, -0x49(%rbp)
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x61, %eax
jl 0x697d
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x7a, %eax
jg 0x697d
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %edx
subl $0x20, %edx
movb %dl, (%rax,%rcx)
movq -0x40(%rbp), %rax
movb $0x1, (%rax)
jmp 0x697f
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x68ef
movq -0x48(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x69a1
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movb -0x49(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/ocutil.c
// Function: test_tag_field_keepcase
static bool test_tag_field_keepcase(uint8_t *line, size_t n, bool *on_field) {
	size_t i;
	bool valid = true;
	for (i = 0; i < n && line[i] != 0x3d; i++) {
		if (!(line[i] >= 0x20 && line[i] <= 0x7d)) {
			valid = false;
		}
	}
	if (i < n) *on_field = false;
	return valid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x1, -0x21(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpq -0x10(%rbp), %rcx
movb %al, -0x22(%rbp)
jae 0x6a00
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
setne %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
testb $0x1, %al
jne 0x6a09
jmp 0x6a3f
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jl 0x6a2b
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x7d, %eax
jle 0x6a2f
movb $0x0, -0x21(%rbp)
jmp 0x6a31
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x69dc
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x6a50
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movb -0x21(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/ocutil.c
// Function: test_non_opus
bool test_non_opus(ogg_page *og) {
	if (ogg_page_serialno(og) == opus_sno) {
		if (ogg_page_bos(og)) {
			opuserror(err_opus_bad_stream);
		}
		if (opst != PAGE_SOUND && ogg_page_pageno(og) != opus_idx) {
			opuserror(err_opus_discontinuous, ogg_page_pageno(og), opus_idx);
		}
		return true;
	}
// 	have_multi_streams = true;
	
	int pno = ogg_page_pageno(og);
	if (pno == 0) {
		if (leave_header_packets) {
			opuserror(err_opus_bad_stream);
		}
		if (!ogg_page_bos(og) || ogg_page_eos(og) || ogg_page_granulepos(og) != 0) {
			opuserror(err_opus_bad_stream);
		}
	}
	else if (pno == 1) {
		// 複数論理ストリームの先頭は全て0で始まるため、何かが1ページ目を始めたら今後0ページ目は来ないはずである。
		leave_header_packets = true;
	}
	else {
		if (!leave_header_packets) {
			// 他で1ページ目が始まってないのに2ページ目以上が来た場合
			opuserror(err_opus_bad_stream);
		}
	}
	
	if (pno && ogg_page_bos(og)) {
		// Opusが続いているストリーム途中でBOSが来るはずがない
		opuserror(err_opus_bad_stream);
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2440
leaq 0x16c38(%rip), %rcx     # 0x1d714
cmpl (%rcx), %eax
jne 0x6b47
movq -0x10(%rbp), %rdi
callq 0x2040
cmpl $0x0, %eax
je 0x6afa
movl $0x5, %edi
movb $0x0, %al
callq 0x8690
leaq 0x16c0b(%rip), %rax     # 0x1d70c
cmpl $0x4, (%rax)
je 0x6b3e
movq -0x10(%rbp), %rdi
callq 0x2080
leaq 0x16bfa(%rip), %rcx     # 0x1d710
movl (%rcx), %ecx
cmpq %rcx, %rax
je 0x6b3e
movq -0x10(%rbp), %rdi
callq 0x2080
movq %rax, %rsi
leaq 0x16be0(%rip), %rax     # 0x1d710
movl (%rax), %edx
movl $0xa, %edi
movb $0x0, %al
callq 0x8690
movb $0x1, -0x1(%rbp)
jmp 0x6bfc
movq -0x10(%rbp), %rdi
callq 0x2080
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x6baa
leaq 0x16bbc(%rip), %rax     # 0x1d71c
testb $0x1, (%rax)
je 0x6b71
movl $0x5, %edi
movb $0x0, %al
callq 0x8690
movq -0x10(%rbp), %rdi
callq 0x2040
cmpl $0x0, %eax
je 0x6b9c
movq -0x10(%rbp), %rdi
callq 0x24e0
cmpl $0x0, %eax
jne 0x6b9c
movq -0x10(%rbp), %rdi
callq 0x22e0
cmpq $0x0, %rax
je 0x6ba8
movl $0x5, %edi
movb $0x0, %al
callq 0x8690
jmp 0x6bd8
cmpl $0x1, -0x14(%rbp)
jne 0x6bbc
leaq 0x16b65(%rip), %rax     # 0x1d71c
movb $0x1, (%rax)
jmp 0x6bd6
leaq 0x16b59(%rip), %rax     # 0x1d71c
testb $0x1, (%rax)
jne 0x6bd4
movl $0x5, %edi
movb $0x0, %al
callq 0x8690
jmp 0x6bd6
jmp 0x6bd8
cmpl $0x0, -0x14(%rbp)
je 0x6bf8
movq -0x10(%rbp), %rdi
callq 0x2040
cmpl $0x0, %eax
je 0x6bf8
movl $0x5, %edi
movb $0x0, %al
callq 0x8690
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/ocutil.c
// Function: write_page
void write_page(ogg_page *og, FILE *fp) {
	size_t ret;
	ret = fwrite(og->header, 1, og->header_len, fp);
	if (ret != og->header_len) {
		oserror();
	}
	ret = fwrite(og->body, 1, og->body_len, fp);
	if (ret != og->body_len) {
		oserror();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %esi
callq 0x2490
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
je 0x6c54
callq 0x8880
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x10(%rbp), %rcx
movl $0x1, %esi
callq 0x2490
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x18(%rcx), %rax
je 0x6c89
callq 0x8880
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/retrieve-tags.c
// Function: rtcopy_list
static bool rtcopy_list(FILE *packet_input, void *listfd_) {
	static size_t idx = 1;
	int listfd = *(int*)listfd_;
	uint32_t len = rtchunk(packet_input);
	uint8_t buf[STACK_BUF_LEN];
	bool first = true;
	bool field = true;
	bool copy;
	while (len) {
		size_t rl = rtfill(buf, len, STACK_BUF_LEN, packet_input);
		if (first) {
			if (*buf == 0x3d) opuserror(err_opus_bad_tag, idx);
			first = false;
			copy = !O.tag_ignore_picture || !test_mbp(buf, len);
			if (copy) {
				write(listfd, &len, 4);
			}
		}
		if (copy) {
			if (field) {
				if(!test_tag_field(buf, rl, O.tag_toupper, &field, &upcase_applied) && O.tag_verify) {
					opuserror(err_opus_bad_tag, idx);
				}
			}
			write(listfd, buf, rl);
		}
		len -= rl;
	}
	if (O.tag_verify && field) {
		opuserror(err_opus_bad_tag, idx);
	}
	idx++;
	return copy;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1040, %rsp           # imm = 0x1040
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7360
movl %eax, -0x18(%rbp)
movb $0x1, -0x1021(%rbp)
movb $0x1, -0x1022(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x756b
leaq -0x1020(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, %esi
movq -0x8(%rbp), %rcx
movl $0x1000, %edx           # imm = 0x1000
callq 0x7390
movq %rax, -0x1030(%rbp)
testb $0x1, -0x1021(%rbp)
je 0x74d8
movzbl -0x1020(%rbp), %eax
cmpl $0x3d, %eax
jne 0x7479
movq 0x5e6b(%rip), %rsi      # 0xd2d8
movl $0xd, %edi
movb $0x0, %al
callq 0x8690
movb $0x0, -0x1021(%rbp)
movb $0x1, %al
leaq 0x1623f(%rip), %rcx     # 0x1d6c8
testb $0x1, 0xe(%rcx)
movb %al, -0x1031(%rbp)
je 0x74ae
leaq -0x1020(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, %esi
callq 0x7d90
xorb $-0x1, %al
movb %al, -0x1031(%rbp)
movb -0x1031(%rbp), %al
andb $0x1, %al
movb %al, -0x1023(%rbp)
testb $0x1, -0x1023(%rbp)
je 0x74d6
movl -0x14(%rbp), %edi
leaq -0x18(%rbp), %rsi
movl $0x4, %edx
callq 0x2100
jmp 0x74d8
testb $0x1, -0x1023(%rbp)
je 0x7556
testb $0x1, -0x1022(%rbp)
je 0x7540
leaq -0x1020(%rbp), %rdi
movq -0x1030(%rbp), %rsi
leaq 0x161c9(%rip), %rax     # 0x1d6c8
movb 0x16(%rax), %al
leaq -0x1022(%rbp), %rcx
leaq 0x16188(%rip), %r8      # 0x1d698
andb $0x1, %al
movzbl %al, %edx
callq 0x6880
testb $0x1, %al
jne 0x753e
leaq 0x161a3(%rip), %rax     # 0x1d6c8
testb $0x1, 0x21(%rax)
je 0x753e
movq 0x5da6(%rip), %rsi      # 0xd2d8
movl $0xd, %edi
movb $0x0, %al
callq 0x8690
jmp 0x7540
movl -0x14(%rbp), %edi
leaq -0x1020(%rbp), %rsi
movq -0x1030(%rbp), %rdx
callq 0x2100
movq -0x1030(%rbp), %rcx
movl -0x18(%rbp), %eax
subq %rcx, %rax
movl %eax, -0x18(%rbp)
jmp 0x7426
leaq 0x16156(%rip), %rax     # 0x1d6c8
testb $0x1, 0x21(%rax)
je 0x7594
testb $0x1, -0x1022(%rbp)
je 0x7594
movq 0x5d50(%rip), %rsi      # 0xd2d8
movl $0xd, %edi
movb $0x0, %al
callq 0x8690
movq 0x5d3d(%rip), %rax      # 0xd2d8
addq $0x1, %rax
movq %rax, 0x5d32(%rip)      # 0xd2d8
movb -0x1023(%rbp), %al
andb $0x1, %al
addq $0x1040, %rsp           # imm = 0x1040
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/retrieve-tags.c
// Function: rt_del_args
void rt_del_args(uint8_t *buf, size_t len, bool term) {
	static uint32_t recordlen = 0;
	static bool field = true;
	if (!buf) {
		if (!recordlen) {
			opterror('d', catgets(catd, 7, 3, "invalid tag format"));
		}
		recordlen = oi32(recordlen);
		fwrite(&recordlen, 4, 1, dellist_len);
		uint8_t f = field;
		fwrite(&f, 1, 1, dellist_len);
		recordlen = 0;
		field = true;
		return;
	}
	dellist_len = dellist_len ? dellist_len : tmpfile();
	dellist_str = dellist_str ? dellist_str : tmpfile();
	
	recordlen += len;
	if (field && !test_tag_field(buf, len, true, &field, &upcase_applied)) {
		opterror('d', catgets(catd, 7, 3, "invalid tag format"));
	}
	fwrite(buf, 1, len, dellist_str);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x7ca1
cmpl $0x0, 0x15a93(%rip)     # 0x1d69c
jne 0x7c3a
leaq 0x15aae(%rip), %rax     # 0x1d6c0
movq (%rax), %rdi
movl $0x7, %esi
movl $0x3, %edx
leaq 0x24e1(%rip), %rcx      # 0xa107
callq 0x2460
movq %rax, %rsi
movl $0x64, %edi
movb $0x0, %al
callq 0x89d0
movl 0x15a5c(%rip), %edi     # 0x1d69c
callq 0x84f0
movl %eax, 0x15a51(%rip)     # 0x1d69c
movq 0x15a3e(%rip), %rcx     # 0x1d690
leaq 0x15a43(%rip), %rdi     # 0x1d69c
movl $0x4, %esi
movl $0x1, %edx
callq 0x2490
movb 0x5662(%rip), %al       # 0xd2d0
andb $0x1, %al
movb %al, -0x12(%rbp)
movq 0x15a16(%rip), %rcx     # 0x1d690
leaq -0x12(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x2490
movl $0x0, 0x15a07(%rip)     # 0x1d69c
movb $0x1, 0x5634(%rip)      # 0xd2d0
jmp 0x7d7f
cmpq $0x0, 0x159e7(%rip)     # 0x1d690
je 0x7cb8
movq 0x159de(%rip), %rax     # 0x1d690
movq %rax, -0x20(%rbp)
jmp 0x7cc1
callq 0x2260
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, 0x159c4(%rip)     # 0x1d690
cmpq $0x0, 0x159ac(%rip)     # 0x1d680
je 0x7ce3
movq 0x159a3(%rip), %rax     # 0x1d680
movq %rax, -0x28(%rbp)
jmp 0x7cec
callq 0x2260
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, 0x15989(%rip)     # 0x1d680
movq -0x10(%rbp), %rcx
movl 0x1599b(%rip), %eax     # 0x1d69c
addq %rcx, %rax
movl %eax, 0x15992(%rip)     # 0x1d69c
testb $0x1, 0x55bf(%rip)      # 0xd2d0
je 0x7d66
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
leaq 0x55a9(%rip), %rcx      # 0xd2d0
leaq 0x1596a(%rip), %r8      # 0x1d698
callq 0x6880
testb $0x1, %al
jne 0x7d66
leaq 0x15982(%rip), %rax     # 0x1d6c0
movq (%rax), %rdi
movl $0x7, %esi
movl $0x3, %edx
leaq 0x23b5(%rip), %rcx      # 0xa107
callq 0x2460
movq %rax, %rsi
movl $0x64, %edi
movb $0x0, %al
callq 0x89d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq 0x1590b(%rip), %rcx     # 0x1d680
movl $0x1, %esi
callq 0x2490
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/retrieve-tags.c
// Function: test_mbp
static bool test_mbp(uint8_t *buf, size_t len) {
	uint8_t const *mbp = MBPeq;
	size_t const mbplen = 23;
	if (len < mbplen) {
		return false;
	}
	while (*mbp) {
		uint8_t c = *buf++;
		if (c >= 0x61 && c <= 0x7a) { // a-z in ASCII
			c -= 32;
		}
		if (*mbp != c) {
			break;
		}
		mbp++;
	}
	return !*mbp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq 0x4ff5(%rip), %rax      # 0xcd98
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x17, -0x28(%rbp)
cmpq $0x17, -0x18(%rbp)
jae 0x7dbf
movb $0x0, -0x1(%rbp)
jmp 0x7e2a
jmp 0x7dc1
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
je 0x7e19
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %al
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
cmpl $0x61, %eax
jl 0x7dfa
movzbl -0x29(%rbp), %eax
cmpl $0x7a, %eax
jg 0x7dfa
movzbl -0x29(%rbp), %eax
subl $0x20, %eax
movb %al, -0x29(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movzbl -0x29(%rbp), %ecx
cmpl %ecx, %eax
je 0x7e0b
jmp 0x7e19
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x7dc1
movq -0x20(%rbp), %rax
cmpb $0x0, (%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/select-codec.c
// Function: select_codec_by_name
bool select_codec_by_name(char const *name) {
	static locale_t clocale = (locale_t)0;
	if (!clocale) {
		clocale = newlocale(LC_ALL, "C", (locale_t)0);
		if (!clocale) {
			oserror();
		}
	}
	for (codec = set; codec->name != NULL && strcasecmp_l(name, codec->name, clocale) != 0; codec++) {}
	return !!codec->name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, 0x1579c(%rip)     # 0x1d6a0
jne 0x7f33
movl $0x6, %edi
leaq 0x25cd(%rip), %rsi      # 0xa4df
xorl %eax, %eax
movl %eax, %edx
callq 0x2170
movq %rax, 0x1577e(%rip)     # 0x1d6a0
cmpq $0x0, 0x15776(%rip)     # 0x1d6a0
jne 0x7f31
callq 0x8880
jmp 0x7f33
leaq 0x15776(%rip), %rax     # 0x1d6b0
leaq 0x53af(%rip), %rcx      # 0xd2f0
movq %rcx, (%rax)
leaq 0x15765(%rip), %rax     # 0x1d6b0
movq (%rax), %rcx
xorl %eax, %eax
cmpq $0x0, 0x10(%rcx)
movb %al, -0x9(%rbp)
je 0x7f81
movq -0x8(%rbp), %rdi
leaq 0x1574b(%rip), %rax     # 0x1d6b0
movq (%rax), %rax
movq 0x10(%rax), %rsi
movq 0x1572d(%rip), %rdx     # 0x1d6a0
callq 0x2350
cmpl $0x0, %eax
setne %al
movb %al, -0x9(%rbp)
movb -0x9(%rbp), %al
testb $0x1, %al
jne 0x7f8a
jmp 0x7fa6
jmp 0x7f8c
leaq 0x1571d(%rip), %rax     # 0x1d6b0
movq (%rax), %rcx
addq $0x40, %rcx
leaq 0x1570f(%rip), %rax     # 0x1d6b0
movq %rcx, (%rax)
jmp 0x7f44
leaq 0x15703(%rip), %rax     # 0x1d6b0
movq (%rax), %rax
cmpq $0x0, 0x10(%rax)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/select-codec.c
// Function: check_theora
static void check_theora(ogg_page *og) {
	if (og->body_len != 42) {
		opuserror(err_opus_bad_content);
	}
	// major 3, minor 2
	if (og->body[7] != 3 || og->body[8] != 2) {
		opuserror(err_opus_version);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x2a, 0x18(%rax)
je 0x8233
movl $0xc, %edi
movb $0x0, %al
callq 0x8690
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movzbl 0x7(%rax), %eax
cmpl $0x3, %eax
jne 0x8255
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movzbl 0x8(%rax), %eax
cmpl $0x2, %eax
je 0x8261
movl $0x6, %edi
movb $0x0, %al
callq 0x8690
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/select-codec.c
// Function: check_vorbis
static void check_vorbis(ogg_page *og) {
// 0-6 "\x1" "\x76\x6f\x72\x62\x69\x73" 
/*7-10   1) [vorbis_version] = read 32 bits as unsigned integer
11   2) [audio_channels] = read 8 bit integer as unsigned
12-15   3) [audio_sample_rate] = read 32 bits as unsigned integer
16   4) [bitrate_maximum] = read 32 bits as signed integer
20   5) [bitrate_nominal] = read 32 bits as signed integer
24   6) [bitrate_minimum] = read 32 bits as signed integer
28.0-3   7) [blocksize_0] = 2 exponent (read 4 bits as unsigned integer)
28.4-7   8) [blocksize_1] = 2 exponent (read 4 bits as unsigned integer)
29   9) [framing_flag] = read one bit
*/
	if (og->body_len != 30) opuserror(err_opus_bad_content);
	if (oi32(*(uint32_t*)&og->body[7]) != 0) opuserror(err_opus_version);
	if (!og->body[11]) opuserror(err_opus_bad_content);
	if (oi32(*(uint32_t*)&og->body[12]) == 0) opuserror(err_opus_bad_content);
	if (!og->body[29]) opuserror(err_opus_bad_content);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x1e, 0x18(%rax)
je 0x8293
movl $0xc, %edi
movb $0x0, %al
callq 0x8690
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x7(%rax), %edi
callq 0x84f0
cmpl $0x0, %eax
je 0x82b4
movl $0x6, %edi
movb $0x0, %al
callq 0x8690
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpb $0x0, 0xb(%rax)
jne 0x82ce
movl $0xc, %edi
movb $0x0, %al
callq 0x8690
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0xc(%rax), %edi
callq 0x84f0
cmpl $0x0, %eax
jne 0x82ef
movl $0xc, %edi
movb $0x0, %al
callq 0x8690
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpb $0x0, 0x1d(%rax)
jne 0x8309
movl $0xc, %edi
movb $0x0, %al
callq 0x8690
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/select-codec.c
// Function: check_vp8
static void check_vp8(ogg_page *og) {
	// https://people.freedesktop.org/~slomo/ogg-vp8/ogg-vp8.pdf
	// ヘッダ長、ヘッダ種類
	if (og->body_len < 26 || og->body[5] != 1) opuserror(err_opus_bad_content);
	// major 1
	if (og->body[6] != 1) opuserror(err_opus_version);
	// minor 0。0ならば必ずサイズは26
	if (og->body[7] == 0 && og->body_len != 26) opuserror(err_opus_bad_content);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x1a, 0x18(%rax)
jl 0x8478
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movzbl 0x5(%rax), %eax
cmpl $0x1, %eax
je 0x8484
movl $0xc, %edi
movb $0x0, %al
callq 0x8690
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movzbl 0x6(%rax), %eax
cmpl $0x1, %eax
je 0x84a1
movl $0x6, %edi
movb $0x0, %al
callq 0x8690
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movzbl 0x7(%rax), %eax
cmpl $0x0, %eax
jne 0x84c9
movq -0x8(%rbp), %rax
cmpq $0x1a, 0x18(%rax)
je 0x84c9
movl $0xc, %edi
movb $0x0, %al
callq 0x8690
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/error.c
// Function: mainerror
noreturn void mainerror(int e, ...) {
	va_list ap;
	va_start(ap, e);
	errorprefix();
	char const *msg[] = {
#define LIST(I, E, S) S,
#include "errordef/main.tab"
#undef LIST
	};
	vfprintf(stderr, catgets(catd, 2, e, msg[e]), ap);
	fputc('\n', stderr);
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
testb %al, %al
je 0x85b7
movaps %xmm0, -0x120(%rbp)
movaps %xmm1, -0x110(%rbp)
movaps %xmm2, -0x100(%rbp)
movaps %xmm3, -0xf0(%rbp)
movaps %xmm4, -0xe0(%rbp)
movaps %xmm5, -0xd0(%rbp)
movaps %xmm6, -0xc0(%rbp)
movaps %xmm7, -0xb0(%rbp)
movq %r9, -0x128(%rbp)
movq %r8, -0x130(%rbp)
movq %rcx, -0x138(%rbp)
movq %rdx, -0x140(%rbp)
movq %rsi, -0x148(%rbp)
movl %edi, -0x4(%rbp)
leaq -0x20(%rbp), %rax
leaq -0x150(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
callq 0x8510
leaq -0xa0(%rbp), %rdi
leaq 0x460c(%rip), %rsi      # 0xcc20
movl $0x78, %edx
callq 0x22d0
movq 0x49d3(%rip), %rax      # 0xcff8
movq (%rax), %rax
movq %rax, -0x158(%rbp)
leaq 0x1508a(%rip), %rax     # 0x1d6c0
movq (%rax), %rdi
movl -0x4(%rbp), %edx
movslq -0x4(%rbp), %rax
movq -0xa0(%rbp,%rax,8), %rcx
movl $0x2, %esi
callq 0x2460
movq -0x158(%rbp), %rdi
movq %rax, %rsi
leaq -0x20(%rbp), %rdx
callq 0x2420
movq 0x498c(%rip), %rax      # 0xcff8
movq (%rax), %rsi
movl $0xa, %edi
callq 0x2210
movl $0x1, %edi
callq 0x2480
nopw %cs:(%rax,%rax)