// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: do_binary_ii_member
static void do_binary_ii_member(deark *c,
	de_arch_lctx *d, struct de_arch_member_data *md, struct binary_ii_extra_md *b2_md)
{
	i64 pos1;
	i64 pos;
	UI filesize_hi;
	i64 space_reqd_in_blocks;
	i64 fnlen;
	UI auxtype, auxtype_hi;
	UI accesscode, accesscode_hi;
	UI filetype, filetype_hi;
	UI storagetype, storagetype_hi;
	UI eof_hi;
	UI crdate_raw;
	UI crtime_raw;
	UI moddate_raw;
	UI modtime_raw;
	UI ostype;
	UI data_flags;
	u8 fmt_ver;
	int saved_indent_level;

	de_dbg_indent_save(c, &saved_indent_level);
	pos1 = md->member_hdr_pos;
	de_dbg(c, "member at %"I64_FMT, pos1);
	de_dbg_indent(c, 1);

	// Skip ahead and read some "high bytes" fields first.
	pos = pos1 + 109;
	auxtype_hi = (UI)de_getu16le_p(&pos);
	accesscode_hi = (UI)de_getbyte_p(&pos);
	filetype_hi = (UI)de_getbyte_p(&pos);
	storagetype_hi = (UI)de_getbyte_p(&pos);
	filesize_hi = (UI)de_getu16le_p(&pos);
	eof_hi = (UI)de_getbyte_p(&pos);

	pos = pos1 + 3;
	accesscode = (UI)de_getbyte_p(&pos);
	accesscode = accesscode | (accesscode_hi<<8);
	de_dbg(c, "access: 0x%04x", accesscode);

	filetype = (UI)de_getbyte_p(&pos);
	filetype = filetype | (filetype_hi<<8);
	de_dbg(c, "file type: 0x%04x", filetype);

	auxtype = (UI)de_getu16le_p(&pos);
	auxtype = auxtype | (auxtype_hi<<16);
	de_dbg(c, "aux type: 0x%08x",auxtype);

	storagetype = (UI)de_getbyte_p(&pos);
	storagetype = storagetype | (storagetype_hi<<8);
	de_dbg(c, "storage type: 0x%04x", storagetype);

	b2_md->filesize = de_getu16le_p(&pos);
	b2_md->filesize |= ((i64)filesize_hi<<16);
	de_dbg(c, "\"file size\": %"I64_FMT" (in 512-byte blocks)", b2_md->filesize);

	moddate_raw = (UI)de_getu16le_p(&pos);
	modtime_raw = (UI)de_getu16le_p(&pos);
	de_prodos_datetime_to_timestamp(&md->fi->timestamp[DE_TIMESTAMPIDX_MODIFY],
		moddate_raw, modtime_raw);
	dbg_timestamp(c, &md->fi->timestamp[DE_TIMESTAMPIDX_MODIFY], "mod time");

	crdate_raw = (UI)de_getu16le_p(&pos);
	crtime_raw = (UI)de_getu16le_p(&pos);
	de_prodos_datetime_to_timestamp(&md->fi->timestamp[DE_TIMESTAMPIDX_CREATE],
		crdate_raw, crtime_raw);
	dbg_timestamp(c, &md->fi->timestamp[DE_TIMESTAMPIDX_CREATE], "create time");

	pos = pos1 + 20;
	md->orig_len = (UI)dbuf_getint_ext(c->infile, pos, 3, 1, 0);
	md->orig_len |= ((i64)eof_hi<<24);
	de_dbg(md->c, "original size: %"I64_FMT, md->orig_len);
	md->orig_len_known = 1;
	md->cmpr_len = md->orig_len;
	pos += 3;

	fnlen = de_getbyte_p(&pos);
	if(fnlen>64) {
		d->need_errmsg = 1;
		goto done;
	}
	dbuf_read_to_ucstring(c->infile, pos, fnlen, md->filename, DE_CONVFLAG_STOP_AT_NUL,
		d->input_encoding);
	de_dbg(c, "filename: \"%s\"", ucstring_getpsz_d(md->filename));

	pos = pos1 + 117;
	space_reqd_in_blocks = de_getu32le_p(&pos);
	de_dbg(c, "disk space req'd: %"I64_FMT" (in 512-byte blocks)", space_reqd_in_blocks);

	ostype = (UI)de_getbyte_p(&pos);
	de_dbg(c, "OS type: 0x%02x", ostype);

	pos += 2; // [122] native file type
	pos += 1; // [124] phantom file flag

	data_flags = (UI)de_getbyte_p(&pos);
	de_dbg(c, "data flags: 0x%02x", data_flags);

	fmt_ver = de_getbyte_p(&pos);
	de_dbg(c, "fmt ver: 0x%02x", (UI)fmt_ver);

	b2_md->num_members_remaining = (int)de_getbyte_p(&pos);
	de_dbg(c, "num members remaining: %d", b2_md->num_members_remaining);

	md->cmpr_pos = pos;
	md->dfn = noncompressed_decompressor_fn;
	de_arch_extract_member_file(md);

done:
	de_dbg_indent_restore(c, saved_indent_level);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x8c(%rbp), %rsi
callq 0x15b580
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x122f5c(%rip), %rsi    # 0x1c7392
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x15b560
movq -0x28(%rbp), %rax
addq $0x6d, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, -0x6c(%rbp)
movq -0x28(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movl -0x58(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rdi
movl -0x54(%rbp), %edx
leaq 0x10d988(%rip), %rsi    # 0x1b1ea2
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl -0x60(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0x5c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x5c(%rbp), %edx
leaq 0xfca8b(%rip), %rsi     # 0x1a0fdf
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl -0x50(%rbp), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movl %eax, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x4c(%rbp), %edx
leaq 0x10d926(%rip), %rsi    # 0x1b1eb1
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl -0x68(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0x64(%rbp)
movq -0x8(%rbp), %rdi
movl -0x64(%rbp), %edx
leaq 0x10d8fd(%rip), %rsi    # 0x1b1ec2
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl -0x34(%rbp), %eax
movl %eax, %ecx
shlq $0x10, %rcx
movq -0x20(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
leaq 0x10d8cb(%rip), %rsi    # 0x1b1ed7
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x7c(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
addq $0x18, %rdi
movl -0x78(%rbp), %eax
movl %eax, %esi
movl -0x7c(%rbp), %eax
movl %eax, %edx
callq 0x15db40
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
addq $0x18, %rsi
leaq 0x115505(%rip), %rdx    # 0x1b9b72
callq 0xa4940
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x74(%rbp)
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
addq $0x18, %rdi
addq $0x10, %rdi
movl -0x70(%rbp), %eax
movl %eax, %esi
movl -0x74(%rbp), %eax
movl %eax, %edx
callq 0x15db40
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
addq $0x18, %rsi
addq $0x10, %rsi
leaq 0x116848(%rip), %rdx    # 0x1baf1c
callq 0xa4940
movq -0x28(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
movl $0x3, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x165a80
movl %eax, %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movl -0x6c(%rbp), %eax
movl %eax, %ecx
shlq $0x18, %rcx
movq -0x18(%rbp), %rax
orq 0x38(%rax), %rcx
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdx
leaq 0xff7cf(%rip), %rsi     # 0x1a3f09
movb $0x0, %al
callq 0x15b0d0
movq -0x18(%rbp), %rax
movb $0x1, 0x4c(%rax)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x30(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movq %rax, -0x48(%rbp)
cmpq $0x40, -0x48(%rbp)
jle 0xa4791
movq -0x10(%rbp), %rax
movb $0x1, 0x14(%rax)
jmp 0xa4924
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x10(%rbp), %rax
movl 0x18(%rax), %r9d
movl $0x1, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x172650
movq -0x98(%rbp), %rdi
movq %rax, %rdx
leaq 0x122d9e(%rip), %rsi    # 0x1c7583
movb $0x0, %al
callq 0x15b0d0
movq -0x28(%rbp), %rax
addq $0x75, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165580
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x10d6e1(%rip), %rsi    # 0x1b1efd
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
movl -0x80(%rbp), %edx
leaq 0x10d6e0(%rip), %rsi    # 0x1b1f28
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movl %eax, -0x84(%rbp)
movq -0x8(%rbp), %rdi
movl -0x84(%rbp), %edx
leaq 0x10d6a6(%rip), %rsi    # 0x1b1f38
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movb %al, -0x85(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x85(%rbp), %edx
leaq 0x10d689(%rip), %rsi    # 0x1b1f4b
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x30(%rbp), %rsi
callq 0x165170
movzbl %al, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x10d665(%rip), %rsi    # 0x1b1f5b
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rax
leaq -0x21d4(%rip), %rcx     # 0xa2740
movq %rcx, 0xa8(%rax)
movq -0x18(%rbp), %rdi
callq 0x17c920
movq -0x8(%rbp), %rdi
movl -0x8c(%rbp), %esi
callq 0x15b5a0
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)