// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %rdi, %rbx
movl (%rsi), %eax
movl %eax, 0x10(%rsp)
leaq 0x20(%rsp), %r14
movl $0x4, %esi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x608e
movl (%r14), %edi
callq 0x6d2b
movl %eax, 0x14(%rsp)
movb $0x1, 0xf(%rsp)
testl %eax, %eax
je 0x623a
movl %eax, %r15d
leaq 0x5c90(%rip), %rax      # 0xbd98
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movb $0x1, %bpl
movl $0x1000, %eax           # imm = 0x1000
cmpl %eax, %r15d
movl $0x1000, %r13d          # imm = 0x1000
cmovbl %r15d, %r13d
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x608e
testb $0x1, %bpl
je 0x61c8
cmpb $0x3d, 0x20(%rsp)
jne 0x6157
movq 0x614d(%rip), %rsi      # 0xc298
movl $0xd, %edi
xorl %eax, %eax
callq 0x6e10
movb $0x1, %r12b
cmpl $0x17, %r15d
jb 0x61ae
leaq 0x16521(%rip), %rax     # 0x1c688
cmpb $0x0, 0xe(%rax)
je 0x61ae
movq 0x18(%rsp), %rax
movq %r14, %rcx
movb (%rax), %dl
testb %dl, %dl
je 0x61a7
movzbl (%rcx), %esi
incq %rcx
leal -0x61(%rsi), %edi
leal -0x20(%rsi), %r8d
cmpb $0x1a, %dil
movzbl %r8b, %edi
cmovael %esi, %edi
incq %rax
cmpb %dil, %dl
je 0x6175
sete %cl
movzbl %cl, %ecx
addq %rcx, %rax
decq %rax
cmpb $0x0, (%rax)
setne %r12b
testb %r12b, %r12b
je 0x61c6
movl $0x4, %edx
movl 0x10(%rsp), %edi
leaq 0x14(%rsp), %rsi
callq 0x2100
xorl %ebp, %ebp
testb $0x1, %r12b
je 0x622a
cmpb $0x1, 0xf(%rsp)
jne 0x621b
leaq 0x164ac(%rip), %rax     # 0x1c688
movzbl 0x16(%rax), %edx
movq %r14, %rdi
movq %r13, %rsi
leaq 0xf(%rsp), %rcx
leaq 0x16466(%rip), %r8      # 0x1c658
callq 0x5988
testb %al, %al
jne 0x621b
leaq 0x16486(%rip), %rax     # 0x1c688
cmpb $0x1, 0x21(%rax)
jne 0x621b
movq 0x6089(%rip), %rsi      # 0xc298
movl $0xd, %edi
xorl %eax, %eax
callq 0x6e10
movl 0x10(%rsp), %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2100
subl %r13d, %r15d
movl %r15d, 0x14(%rsp)
jne 0x6113
jmp 0x623a
leaq 0x16447(%rip), %rax     # 0x1c688
cmpb $0x1, 0x21(%rax)
jne 0x6261
cmpb $0x1, 0xf(%rsp)
jne 0x6261
movq 0x6043(%rip), %rsi      # 0xc298
movl $0xd, %edi
xorl %eax, %eax
callq 0x6e10
incq 0x6030(%rip)            # 0xc298
andb $0x1, %r12b
movl %r12d, %eax
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq