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

	pos = md->startpos;

	pos += 6; // c_magic

	ret = dbuf_read_ascii_number(c->infile, pos, 8, 16, &n);
	if(!ret) goto done;
	de_dbg(c, "c_ino: %d", (int)n);
	pos += 8;

	ret = dbuf_read_ascii_number(c->infile, pos, 8, 16, &md->mode);
	if(!ret) goto done;
	de_dbg(c, "c_mode: octal(%06o)", (unsigned int)md->mode);
	pos += 8;

	pos += 8; // c_uid
	pos += 8; // c_gid
	pos += 8; // c_nlink

	ret = dbuf_read_ascii_number(c->infile, pos, 8, 16, &modtime_unix);
	if(!ret) goto done;
	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 += 8;

	ret = dbuf_read_ascii_number(c->infile, pos, 8, 16, &md->filesize);
	if(!ret) goto done;
	de_dbg(c, "c_filesize: %d", (int)md->filesize);
	pos += 8;

	pos += 8; // c_devmajor
	pos += 8; // c_devminor
	pos += 8; // c_rdevmajor
	pos += 8; // c_rdevminor

	ret = dbuf_read_ascii_number(c->infile, pos, 8, 16, &md->namesize);
	if(!ret) goto done;
	de_dbg(c, "c_namesize: %d", (int)md->namesize);
	pos += 8;

	if(md->subfmt==SUBFMT_ASCII_NEWCRC) {
		ret = dbuf_read_ascii_number(c->infile, pos, 8, 16, &n);
		if(!ret) goto done;
		md->checksum_reported = (u32)n;
		de_dbg(c, "c_check: %u", (unsigned int)md->checksum_reported);
	}
	pos += 8; // c_check

	md->fixed_header_size = pos - md->startpos;

	header_and_namesize_padded = de_pad_to_4(md->fixed_header_size + md->namesize);
	md->namesize_padded = header_and_namesize_padded - md->fixed_header_size;

	md->filesize_padded = de_pad_to_4(md->filesize);

	retval = 1;

done:
	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl $0x8, %edx
movl $0x10, %ecx
leaq -0x30(%rbp), %r8
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x566b3
jmp 0x5698f
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl %eax, %edx
leaq 0x14fa1c(%rip), %rsi    # 0x1a60e0
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %r8
addq $0x38, %r8
movl $0x8, %edx
movl $0x10, %ecx
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x56708
jmp 0x5698f
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movl %eax, %edx
leaq 0x14f9cd(%rip), %rsi    # 0x1a60ea
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl $0x8, %edx
movl $0x10, %ecx
leaq -0x38(%rbp), %r8
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x56781
jmp 0x5698f
movq -0x38(%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 -0x90(%rbp), %rsi
movl $0x40, %edx
xorl %ecx, %ecx
callq 0x15e130
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %edx
leaq -0x90(%rbp), %rcx
leaq 0x14f92c(%rip), %rsi    # 0x1a60fe
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %r8
addq $0x28, %r8
movl $0x8, %edx
movl $0x10, %ecx
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x56816
jmp 0x5698f
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %edx
leaq 0x14f8f3(%rip), %rsi    # 0x1a611e
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %r8
addq $0x18, %r8
movl $0x8, %edx
movl $0x10, %ecx
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x5689f
jmp 0x5698f
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl %eax, %edx
leaq 0x14f85b(%rip), %rsi    # 0x1a610f
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x5, (%rax)
jne 0x56923
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movl $0x8, %edx
movl $0x10, %ecx
leaq -0x30(%rbp), %r8
callq 0x165f70
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x568fd
jmp 0x5698f
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x40(%rax), %edx
leaq 0x14f811(%rip), %rsi    # 0x1a612d
movb $0x0, %al
callq 0x15b0d0
movq -0x20(%rbp), %rax
addq $0x8, %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 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
addq 0x18(%rax), %rdi
callq 0x15ce30
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
subq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x15ce30
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x1, -0x44(%rbp)
movl -0x44(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)