// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/arc.c
// Function: do_info_item
static void do_info_item(deark *c, lctx *d, struct member_data *md)
{
	int saved_indent_level;
	i64 pos = md->cmpr_data_pos;
	i64 endpos = md->cmpr_data_pos+md->cmpr_size;

	de_dbg_indent_save(c, &saved_indent_level);
	de_dbg(c, "info item data (meth=%d) at %"I64_FMT" len=%"I64_FMT, (int)md->cmpr_meth,
		md->cmpr_data_pos, md->cmpr_size);
	de_dbg_indent(c, 1);

	while(1) {
		i64 reclen;
		i64 recpos;
		i64 dpos;
		i64 dlen;
		u8 rectype;
		const struct extinfo_item_info *ei;
		const char *ei_name;

		recpos = pos;
		if(pos+3 > endpos) goto done;
		reclen = de_getu16le_p(&pos);
		if(reclen<3 || recpos+reclen > endpos) goto done;
		rectype = de_getbyte_p(&pos);
		ei = find_extinfo_item(md->cmpr_meth, rectype);
		if(ei && ei->name) ei_name = ei->name;
		else ei_name = "?";

		dpos = recpos + 3;
		dlen = reclen - 3;
		de_dbg(c, "record type %d (%s) at %"I64_FMT", dpos=%"I64_FMT", dlen=%"I64_FMT,
			(int)rectype, ei_name, recpos, dpos, dlen);
		de_dbg_indent(c, 1);
		if(ei && (ei->flags & 0x01)) {
			do_info_record_string(c, d, dpos, dlen, ei_name);
		}
		else {
			de_dbg_hexdump(c, c->infile, dpos, dlen, 256, NULL, 0x1);
		}
		de_dbg_indent(c, -1);
		pos = recpos + reclen;
	}

done:
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, 0x30(%rsp)
movq %rdi, %r12
movq 0x30(%rdx), %rbp
movq %rbp, 0x8(%rsp)
addq 0x38(%rdx), %rbp
leaq 0x1c(%rsp), %rsi
callq 0xe958c
movzbl 0x10(%rbx), %edx
movq 0x30(%rbx), %rcx
movq %rbx, 0x38(%rsp)
movq 0x38(%rbx), %r8
leaq 0xecbab(%rip), %rsi     # 0x1149cb
movq %r12, %rdi
xorl %eax, %eax
callq 0xe9226
movq %r12, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x8(%rsp), %r13
leaq 0x3(%r13), %rax
movq %rax, 0x28(%rsp)
cmpq %rbp, %rax
jg 0x27fdd
leaq 0x15642b(%rip), %r14    # 0x17e280
movq %r12, 0x10(%rsp)
movq %rbp, 0x20(%rsp)
movq 0x18(%r12), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef1ed
cmpq $0x3, %rax
jl 0x27fdd
movq %rax, %r15
leaq (%rax,%r13), %rbx
cmpq %rbp, %rbx
jg 0x27fdd
movq 0x18(%r12), %rdi
leaq 0x8(%rsp), %rsi
callq 0xef14d
movq 0x38(%rsp), %rcx
movb 0x10(%rcx), %cl
xorl %r12d, %r12d
cmpb %cl, (%r12,%r14)
jne 0x27eaf
cmpb %al, 0x1(%r12,%r14)
je 0x27ec1
addq $0x18, %r12
cmpq $0xd8, %r12
jne 0x27ea2
xorl %r12d, %r12d
jmp 0x27ec4
addq %r14, %r12
testq %r12, %r12
je 0x27ed3
movq 0x8(%r12), %rcx
testq %rcx, %rcx
jne 0x27eda
leaq 0x103f8f(%rip), %rcx    # 0x12be69
addq $-0x3, %r15
movzbl %al, %edx
movq %r15, (%rsp)
movq 0x10(%rsp), %rbp
movq %rbp, %rdi
leaq 0xecaff(%rip), %rsi     # 0x1149f3
movq %rcx, 0x40(%rsp)
movq %r13, %r8
movq 0x28(%rsp), %r13
movq %r13, %r9
xorl %eax, %eax
callq 0xe9226
movq %rbp, %rdi
movl $0x1, %esi
callq 0xe9585
testq %r12, %r12
je 0x27f25
testb $0x1, 0x4(%r12)
jne 0x27f4f
movq 0x10(%rsp), %r12
movq 0x18(%r12), %rsi
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %r12, %rdi
movq %r13, %rdx
movq %r15, %rcx
xorl %r9d, %r9d
callq 0xe975a
jmp 0x27fb1
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xf6870
movq %r13, %rsi
movq %rax, %r13
movq 0x18(%r12), %rdi
movq 0x30(%rsp), %rax
movl 0x14(%rax), %eax
movl %eax, (%rsp)
movl $0x800, %ecx            # imm = 0x800
movq %r15, %rdx
movq %r13, %r8
movl $0x1, %r9d
callq 0xf0203
movq %r13, %rdi
callq 0xf7557
movq %r12, %rdi
leaq 0x103ea8(%rip), %rsi    # 0x12be42
movq 0x40(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe9226
movq %r13, %rdi
callq 0xf6bb0
movq 0x20(%rsp), %rbp
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %rbx, 0x8(%rsp)
leaq 0x3(%rbx), %rax
movq %rbx, %r13
movq %rax, 0x28(%rsp)
cmpq %rbp, %rax
jle 0x27e5f
movl 0x1c(%rsp), %esi
movq %r12, %rdi
callq 0xe9595
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq