// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rsi, 0x30(%rsp)
movq %rdi, %rbx
movq 0x30(%rdx), %r12
movq %r12, 0x18(%rsp)
movq 0x38(%rdx), %r15
leaq 0x24(%rsp), %rsi
callq 0xe8a1c
movzbl 0x10(%r14), %edx
movq 0x30(%r14), %rcx
movq %r14, 0x38(%rsp)
movq 0x38(%r14), %r8
leaq 0xeccc4(%rip), %rsi     # 0x114aa6
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %r15, 0x10(%rsp)
cmpq $0x3, %r15
jl 0x27f9e
addq %r12, 0x10(%rsp)
leaq 0x3(%r12), %rbp
leaq 0x156507(%rip), %r14    # 0x17e320
movq 0x18(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0xeebeb
cmpq $0x3, %rax
jl 0x27f9e
movq %rax, %r13
leaq (%rax,%r12), %r15
cmpq 0x10(%rsp), %r15
jg 0x27f9e
movq 0x18(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0xeeb4b
movq 0x38(%rsp), %rcx
movb 0x10(%rcx), %dl
xorl %ecx, %ecx
cmpb %dl, (%rcx,%r14)
jne 0x27e68
cmpb %al, 0x1(%rcx,%r14)
je 0x27e8d
addq $0x18, %rcx
cmpq $0xd8, %rcx
jne 0x27e5b
movb $0x1, %cl
movl %ecx, 0xc(%rsp)
movq $0x0, 0x28(%rsp)
leaq 0x1042c6(%rip), %r8     # 0x12c151
jmp 0x27eb1
leaq (%r14,%rcx), %rdx
movq %rdx, 0x28(%rsp)
movq 0x8(%rcx,%r14), %r8
testq %r8, %r8
leaq 0x1042ac(%rip), %rcx    # 0x12c151
cmoveq %rcx, %r8
movl $0x0, 0xc(%rsp)
addq $-0x3, %r13
movzbl %al, %edx
movq %r13, (%rsp)
movq %rbx, %rdi
leaq 0xecc08(%rip), %rsi     # 0x114ace
movq %r8, 0x40(%rsp)
movq %r8, %rcx
movq %r12, %r8
movq %rbp, %r9
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
cmpb $0x0, 0xc(%rsp)
jne 0x27efa
movq 0x28(%rsp), %rax
testb $0x1, 0x4(%rax)
jne 0x27f1e
movq 0x18(%rbx), %rsi
movl $0x1, (%rsp)
movl $0x100, %r8d            # imm = 0x100
movq %rbx, %rdi
movq %rbp, %rdx
movq %r13, %rcx
xorl %r9d, %r9d
callq 0xe8bea
jmp 0x27f7a
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rax
movl 0x14(%rax), %eax
movl %eax, (%rsp)
movl $0x800, %ecx            # imm = 0x800
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %r8
movl $0x1, %r9d
callq 0xefc2a
movq %r12, %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0x1041c7(%rip), %rsi    # 0x12c12a
movq 0x40(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xe8617
movq %r12, %rdi
callq 0xf6753
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movq %r15, 0x18(%rsp)
leaq 0x3(%r15), %rbp
movq %r15, %r12
cmpq 0x10(%rsp), %rbp
jle 0x27e19
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq