// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/misc3.c
// Function: do_arcv_common_fields
static void do_arcv_common_fields(deark *c, de_arch_lctx *d,
	struct de_arch_member_data *md, i64 pos1, i64 *nbytes_consumed)
{
	i64 fnlen;
	UI fver_maj1, fver_min1;
	UI fver_maj2, fver_min2;
	i64 pos = pos1;
	UI attr;

	fnlen = (i64)de_getbyte_p(&pos);
	dbuf_read_to_ucstring(c->infile, pos, fnlen, md->filename, 0,
		d->input_encoding);
	de_dbg(c, "filename: \"%s\"", ucstring_getpsz_d(md->filename));
	pos += fnlen;

	de_arch_read_field_orig_len_p(md, &pos);
	de_arch_read_field_cmpr_len_p(md, &pos);

	attr = (UI)de_getu32le_p(&pos); // TODO: How big is this field
	de_arch_handle_field_dos_attr(md, attr);

	de_arch_read_field_dttm_p(d, &md->fi->timestamp[DE_TIMESTAMPIDX_MODIFY], "mod",
		DE_ARCH_TSTYPE_DOS_TD, &pos);

	fver_min1 = (UI)de_getu16le_p(&pos);
	fver_maj1 = (UI)de_getu16le_p(&pos);
	de_dbg(c, "file ver (1): %u.%u", fver_maj1, fver_min1);
	fver_min2 = (UI)de_getu16le_p(&pos);
	fver_maj2 = (UI)de_getu16le_p(&pos);
	de_dbg(c, "file ver (2): %u.%u", fver_maj2, fver_min2);

	// Algorithm seems to be "CRC-32/JAMCRC".
	// Same as the usual CRC-32, except it doesn't invert the bits as a final step.
	md->crc_reported = (u32)de_getu32le_p(&pos);
	de_dbg(c, "crc (reported): 0x%08x", (UI)md->crc_reported);

	*nbytes_consumed = pos - pos1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x165170
movzbl %al, %eax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x10(%rbp), %rax
movl 0x18(%rax), %r9d
xorl %r8d, %r8d
callq 0x1669f0
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x172650
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x123c2c(%rip), %rsi    # 0x1c7583
movb $0x0, %al
callq 0x15b0d0
movq -0x30(%rbp), %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x17c350
movq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x17c400
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x165580
movl %eax, -0x4c(%rbp)
movq -0x18(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x17c4a0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
addq $0x18, %rsi
leaq 0x100538(%rip), %rdx    # 0x1a3ef3
movl $0x4, %ecx
leaq -0x48(%rbp), %r8
callq 0x17c580
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
leaq 0x10e1c3(%rip), %rsi    # 0x1b1bc5
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1652c0
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl -0x40(%rbp), %ecx
leaq 0x10e197(%rip), %rsi    # 0x1b1bd9
movb $0x0, %al
callq 0x15b0d0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x165580
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x48(%rax), %edx
leaq 0x12c323(%rip), %rsi    # 0x1cfd98
movb $0x0, %al
callq 0x15b0d0
movq -0x48(%rbp), %rcx
subq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)