// File: /workspace/github_c_makefile_star2_O0/hcmiya[P]opuscomment/src/read-flac.c
// Function: read_picture_list
static void read_picture_list(size_t left) {
	pthread_t loctr_th;
	FILE *ascii_out;
	if (!O.tag_raw) {
		int pfd[2];
		pipe(pfd);
		ascii_out = fdopen(pfd[1], "w");
		FILE *tagin = fdopen(pfd[0], "r");
		pthread_create(&loctr_th, NULL, put_base64_locale, tagin);
	}
	else {
		ascii_out = tag_output;
	}
	
	if (O.tag_escape == TAG_ESCAPE_NUL && (met_comment || met_picture)) {
		write_buffer("", 1, ascii_out);
	}
	write_buffer(MBPeq, strlen(MBPeq), ascii_out);
	
	while (left) {
		uint8_t raw[3] = {0};
		uint8_t b64[4];
		size_t readlen = left > 3 ? 3 : left;
		size_t readret = fread(raw, 1, readlen, stream_input);
		if (readret != readlen) {
			if (ferror(stream_input)) oserror();
			else opuserror(err_opus_lost_tag);
		}
		// 00000011 11112222 22333333
		b64[0] = raw[0] >> 2;
		b64[1] = (raw[0] << 4 | raw[1] >> 4) & 0x3f;
		b64[2] = (raw[1] << 2 | raw[2] >> 6) & 0x3f;
		b64[3] = raw[2] & 0x3f;
		switch (readlen) {
		case 1:
			b64[2] = 64;
			// FALLTHROUGH
		case 2:
			b64[3] = 64;
			break;
		}
		for (int_fast8_t i = 0; i < 4; i++) {
			b64[i] = b64tab_ascii[b64[i]];
		}
		write_buffer(b64, 4, ascii_out);
		left -= readlen;
	}
	
	if (O.tag_escape != TAG_ESCAPE_NUL) {
		write_buffer((uint8_t[]){ 0xa }, 1, ascii_out);
	}
	
	if (!O.tag_raw) {
		fclose(ascii_out);
		pthread_join(loctr_th, NULL);
	}
	
	met_picture = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x171c5(%rip), %rax     # 0x1d6c8
testb $0x1, 0x15(%rax)
jne 0x6552
leaq -0x20(%rbp), %rdi
callq 0x2200
movl -0x1c(%rbp), %edi
leaq 0x3bbe(%rip), %rsi      # 0xa0da
callq 0x2360
movq %rax, -0x18(%rbp)
movl -0x20(%rbp), %edi
leaq 0x3b50(%rip), %rsi      # 0xa07f
callq 0x2360
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
leaq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x225(%rip), %rdx       # 0x6770
callq 0x23b0
jmp 0x6560
leaq 0x171cf(%rip), %rax     # 0x1d728
movq (%rax), %rax
movq %rax, -0x18(%rbp)
leaq 0x17161(%rip), %rax     # 0x1d6c8
cmpl $0x2, 0x10(%rax)
jne 0x6594
testb $0x1, 0x170fc(%rip)     # 0x1d670
jne 0x657f
testb $0x1, 0x170f4(%rip)     # 0x1d671
je 0x6594
movq -0x18(%rbp), %rdx
leaq 0x41a8(%rip), %rdi      # 0xa732
movl $0x1, %esi
callq 0x5f30
leaq 0x67fd(%rip), %rax      # 0xcd98
movq (%rax), %rax
movq %rax, -0x50(%rbp)
leaq 0x67ef(%rip), %rax      # 0xcd98
movq (%rax), %rdi
callq 0x2130
movq -0x50(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x5f30
cmpq $0x0, -0x8(%rbp)
je 0x6710
leaq -0x2b(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x21b0
cmpq $0x3, -0x8(%rbp)
jbe 0x65ee
movl $0x3, %eax
movq %rax, -0x58(%rbp)
jmp 0x65f6
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x2b(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x170f3(%rip), %rax     # 0x1d700
movq (%rax), %rcx
movl $0x1, %esi
callq 0x20e0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
je 0x6651
leaq 0x170d1(%rip), %rax     # 0x1d700
movq (%rax), %rdi
callq 0x20c0
cmpl $0x0, %eax
je 0x6643
callq 0x8880
jmp 0x664f
movl $0xb, %edi
movb $0x0, %al
callq 0x8690
jmp 0x6651
movzbl -0x2b(%rbp), %eax
shrl $0x2, %eax
movb %al, -0x2f(%rbp)
movzbl -0x2b(%rbp), %eax
shll $0x4, %eax
movzbl -0x2a(%rbp), %ecx
shrl $0x4, %ecx
orl %ecx, %eax
andb $0x3f, %al
movb %al, -0x2e(%rbp)
movzbl -0x2a(%rbp), %eax
movzbl -0x29(%rbp), %edx
shrl $0x6, %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,4), %eax
andb $0x3f, %al
movb %al, -0x2d(%rbp)
movb -0x29(%rbp), %al
andb $0x3f, %al
movb %al, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
subq $0x1, %rax
je 0x66ab
jmp 0x669f
movq -0x60(%rbp), %rax
subq $0x2, %rax
je 0x66af
jmp 0x66b3
movb $0x40, -0x2d(%rbp)
movb $0x40, -0x2c(%rbp)
movb $0x0, -0x41(%rbp)
movsbl -0x41(%rbp), %eax
cmpl $0x4, %eax
jge 0x66ea
leaq 0x66d9(%rip), %rax      # 0xcda0
movq (%rax), %rax
movsbq -0x41(%rbp), %rcx
movzbl -0x2f(%rbp,%rcx), %ecx
movb (%rax,%rcx), %cl
movsbq -0x41(%rbp), %rax
movb %cl, -0x2f(%rbp,%rax)
movb -0x41(%rbp), %al
addb $0x1, %al
movb %al, -0x41(%rbp)
jmp 0x66b7
leaq -0x2f(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x4, %esi
callq 0x5f30
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x65c1
leaq 0x16fb1(%rip), %rax     # 0x1d6c8
cmpl $0x2, 0x10(%rax)
je 0x6733
movb $0xa, -0x42(%rbp)
leaq -0x42(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x1, %esi
callq 0x5f30
leaq 0x16f8e(%rip), %rax     # 0x1d6c8
testb $0x1, 0x15(%rax)
jne 0x6756
movq -0x18(%rbp), %rdi
callq 0x2120
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x24c0
movb $0x1, 0x16f14(%rip)     # 0x1d671
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)