// File: /workspace/github_c_makefile_star2_O0/jsummers[P]deark/modules/cpio.c
// Function: read_header_binary
static int read_header_binary(deark *c, lctx *d, struct member_data *md)
{
	i64 pos;
	i64 n;
	i64 modtime_msw, modtime_lsw;
	i64 modtime_unix;
	i64 filesize_msw, filesize_lsw;
	int retval = 0;
	char timestamp_buf[64];

	pos = md->startpos;

	pos += 2; // c_magic
	pos += 2; // c_dev

	n = dbuf_getu16x(c->infile, pos, md->is_le);
	de_dbg(c, "c_ino: %d", (int)n);
	pos += 2;

	md->mode = dbuf_getu16x(c->infile, pos, md->is_le);
	de_dbg(c, "c_mode: octal(%06o)", (unsigned int)md->mode);
	pos += 2;

	pos += 2; // c_uid
	pos += 2; // c_gid
	pos += 2; // c_nlink
	pos += 2; // c_rdev

	modtime_msw = dbuf_getu16x(c->infile, pos, md->is_le);
	modtime_lsw = dbuf_getu16x(c->infile, pos+2, md->is_le);
	modtime_unix = (modtime_msw<<16) | modtime_lsw;
	de_unix_time_to_timestamp(modtime_unix, &md->fi->timestamp[DE_TIMESTAMPIDX_MODIFY], 0x1);
	de_timestamp_to_string(&md->fi->timestamp[DE_TIMESTAMPIDX_MODIFY], timestamp_buf, sizeof(timestamp_buf), 0);
	de_dbg(c, "c_mtime: %d (%s)", (int)modtime_unix, timestamp_buf);
	pos += 4;

	md->namesize = dbuf_getu16x(c->infile, pos, md->is_le);
	de_dbg(c, "c_namesize: %d", (int)md->namesize);
	pos += 2;

	filesize_msw = dbuf_getu16x(c->infile, pos, md->is_le);
	filesize_lsw = dbuf_getu16x(c->infile, pos+2, md->is_le);
	md->filesize = (filesize_msw<<16) | filesize_lsw;
	de_dbg(c, "c_filesize: %d", (int)md->filesize);
	pos += 4;

	md->fixed_header_size = pos - md->startpos;
	md->namesize_padded = de_pad_to_2(md->namesize);
	md->filesize_padded = de_pad_to_2(md->filesize);

	retval = 1;
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x54(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x165820
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %edx
leaq 0x14f6d1(%rip), %rsi    # 0x1a60e0
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x165820
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl %eax, %edx
leaq 0x14f690(%rip), %rsi    # 0x1a60ea
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x165820
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x165820
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
shlq $0x10, %rax
orq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
addq $0x18, %rsi
movl $0x1, %edx
callq 0x15d530
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
addq $0x18, %rdi
leaq -0xa0(%rbp), %rsi
movl $0x40, %edx
xorl %ecx, %ecx
callq 0x15e130
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movl %eax, %edx
leaq -0xa0(%rbp), %rcx
leaq 0x14f5c4(%rip), %rsi    # 0x1a60fe
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x165820
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %edx
leaq 0x14f58a(%rip), %rsi    # 0x1a610f
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x165820
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
addq $0x2, %rsi
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x165820
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rcx
shlq $0x10, %rcx
orq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %edx
leaq 0x14f521(%rip), %rsi    # 0x1a611e
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
subq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x15cdf0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x15cdf0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x1, -0x54(%rbp)
movl -0x54(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)