// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/cpio.c
// Function: de_run_cpio
static void de_run_cpio(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	const char *subfmt_name;
	i64 bytes_consumed;
	i64 pos;
	int ret;

	d = de_malloc(c, sizeof(lctx));

	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_UTF8);

	pos = 0;

	if(identify_cpio_internal(c, pos, &d->first_subfmt)==0) {
		de_err(c, "Not a cpio file, or unknown cpio format");
		goto done;
	}

	subfmt_name = get_subfmt_name(d->first_subfmt);
	de_declare_fmtf(c, "cpio %s", subfmt_name);

	d->crco_cksum = de_crcobj_create(c, DE_CRCOBJ_SUM_BYTES);

	while(1) {
		if(d->trailer_found) break;
		if(pos >= c->infile->len) break;
		bytes_consumed = 0;
		ret = read_member(c, d, pos, &bytes_consumed);
		if(!ret) break;
		if(bytes_consumed<1) break;
		pos += bytes_consumed;
	}

done:
	if(d) {
		de_crcobj_destroy(d->crco_cksum);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movl $0x18, %esi
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0xeb7d1
movl %eax, 0x8(%r14)
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3fa20
testl %eax, %eax
je 0x3f292
movl (%r14), %eax
decl %eax
cmpl $0x4, %eax
ja 0x3f2a5
movl %eax, %eax
leaq 0xdaf2f(%rip), %rcx     # 0x11a1b8
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
jmp 0x3f2ac
leaq 0xdaf45(%rip), %rsi     # 0x11a1de
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0x3f2d5
leaq 0xecbbd(%rip), %rdx     # 0x12be69
leaq 0xdaf53(%rip), %rsi     # 0x11a206
movq %rbx, %rdi
xorl %eax, %eax
callq 0xeb703
movq %rbx, %rdi
movl $0x30, %esi
callq 0xeba56
movq %rax, 0x10(%r14)
cmpl $0x0, 0x4(%r14)
je 0x3f2fd
testq %r14, %r14
je 0x3f2ee
movq 0x10(%r14), %rdi
callq 0xebe1d
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %rbp
jge 0x3f2d5
movq %rbx, %rdi
leaq 0x1c(%rsp), %rsi
callq 0xe958c
movq %rbx, %rdi
leaq 0xfc4c3(%rip), %rsi     # 0x13b7e3
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
leaq 0xdaf30(%rip), %rsi     # 0x11a271
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl $0x60, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r15
movq %rbp, 0x8(%rax)
movq %rbx, %rdi
callq 0xea9a9
movq %rax, 0x50(%r15)
movb $0x1, 0xc(%rax)
movq 0x8(%r15), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3fa20
movl (%r15), %eax
decl %eax
cmpl $0x4, %eax
ja 0x3f806
leaq 0xdae04(%rip), %rcx     # 0x11a1a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r15), %r12
leaq 0x6(%r12), %rsi
movq 0x18(%rbx), %rdi
movl $0x8, %edx
movl $0x10, %ecx
leaq 0x10(%rsp), %r8
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movl 0x10(%rsp), %edx
movq %rbx, %rdi
leaq 0xdaf80(%rip), %rsi     # 0x11a360
xorl %eax, %eax
callq 0xe9226
leaq 0xe(%r12), %rsi
movq 0x18(%rbx), %rdi
leaq 0x38(%r15), %r13
movl $0x8, %edx
movl $0x10, %ecx
movq %r13, %r8
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movl (%r13), %edx
movq %rbx, %rdi
leaq 0xdaf4e(%rip), %rsi     # 0x11a36a
xorl %eax, %eax
callq 0xe9226
leaq 0x2e(%r12), %rsi
movq 0x18(%rbx), %rdi
movl $0x8, %edx
movl $0x10, %ecx
leaq 0x8(%rsp), %r8
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movq 0x8(%rsp), %rdi
movq 0x50(%r15), %rsi
addq $0x18, %rsi
movl $0x1, %edx
callq 0xeace2
movq 0x50(%r15), %rdi
addq $0x18, %rdi
movl $0x40, %edx
leaq 0x20(%rsp), %r13
movq %r13, %rsi
xorl %ecx, %ecx
callq 0xeb4f8
movl 0x8(%rsp), %edx
movq %rbx, %rdi
leaq 0xdaef5(%rip), %rsi     # 0x11a37e
movq %r13, %rcx
xorl %eax, %eax
callq 0xe9226
leaq 0x36(%r12), %rsi
movq 0x18(%rbx), %rdi
leaq 0x28(%r15), %r8
movl $0x8, %edx
movl $0x10, %ecx
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movl 0x28(%r15), %edx
movq %rbx, %rdi
leaq 0xdaed9(%rip), %rsi     # 0x11a39e
xorl %eax, %eax
callq 0xe9226
leaq 0x5e(%r12), %rsi
movq 0x18(%rbx), %rdi
movq %r15, %r8
addq $0x18, %r8
movl $0x8, %edx
movl $0x10, %ecx
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movl 0x18(%r15), %edx
movq %rbx, %rdi
leaq 0xdae8e(%rip), %rsi     # 0x11a38f
xorl %eax, %eax
callq 0xe9226
cmpl $0x5, (%r15)
jne 0x3f54c
leaq 0x66(%r12), %rsi
movq 0x18(%rbx), %rdi
movl $0x8, %edx
movl $0x10, %ecx
leaq 0x10(%rsp), %r8
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movl 0x10(%rsp), %edx
movl %edx, 0x40(%r15)
movq %rbx, %rdi
leaq 0xdae68(%rip), %rsi     # 0x11a3ad
xorl %eax, %eax
callq 0xe9226
subq 0x8(%r15), %r12
addq $0x6e, %r12
movq %r12, 0x10(%r15)
addq 0x18(%r15), %r12
movq %r12, %rdi
callq 0xea7de
subq 0x10(%r15), %rax
movq %rax, 0x20(%r15)
movq 0x28(%r15), %rdi
callq 0xea7de
movq %rax, 0x30(%r15)
jmp 0x3f701
movq 0x8(%r15), %r13
leaq 0xc(%r13), %rsi
movq 0x18(%rbx), %rdi
movl $0x6, %edx
movl $0x8, %ecx
leaq 0x10(%rsp), %r8
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movl 0x10(%rsp), %edx
movq %rbx, %rdi
leaq 0xdadac(%rip), %rsi     # 0x11a360
xorl %eax, %eax
callq 0xe9226
leaq 0x12(%r13), %rsi
movq 0x18(%rbx), %rdi
leaq 0x38(%r15), %r12
movl $0x6, %edx
movl $0x8, %ecx
movq %r12, %r8
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movl (%r12), %edx
movq %rbx, %rdi
leaq 0xdad7b(%rip), %rsi     # 0x11a36a
xorl %eax, %eax
callq 0xe9226
leaq 0x30(%r13), %rsi
movq 0x18(%rbx), %rdi
movl $0xb, %edx
movl $0x8, %ecx
leaq 0x8(%rsp), %r8
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movq 0x8(%rsp), %rdi
movq 0x50(%r15), %rsi
addq $0x18, %rsi
movl $0x1, %edx
callq 0xeace2
movq 0x50(%r15), %rdi
addq $0x18, %rdi
movl $0x40, %edx
leaq 0x20(%rsp), %r12
movq %r12, %rsi
xorl %ecx, %ecx
callq 0xeb4f8
movl 0x8(%rsp), %edx
movq %rbx, %rdi
leaq 0xdad23(%rip), %rsi     # 0x11a37e
movq %r12, %rcx
xorl %eax, %eax
callq 0xe9226
leaq 0x3b(%r13), %rsi
movq 0x18(%rbx), %rdi
leaq 0x18(%r15), %r8
movl $0x6, %edx
movl $0x8, %ecx
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movl 0x18(%r15), %edx
movq %rbx, %rdi
leaq 0xdacfd(%rip), %rsi     # 0x11a38f
xorl %eax, %eax
callq 0xe9226
leaq 0x41(%r13), %rsi
movq 0x18(%rbx), %rdi
movq %r15, %r8
addq $0x28, %r8
movl $0xb, %edx
movl $0x8, %ecx
callq 0xefa0a
testl %eax, %eax
je 0x3f701
movl 0x28(%r15), %edx
movq %rbx, %rdi
leaq 0xdacd5(%rip), %rsi     # 0x11a39e
xorl %eax, %eax
callq 0xe9226
subq 0x8(%r15), %r13
addq $0x4c, %r13
movq %r13, 0x10(%r15)
movq 0x18(%r15), %rax
movq 0x28(%r15), %rcx
movq %rax, 0x20(%r15)
movq %rcx, 0x30(%r15)
jmp 0x3f701
movl $0x1, 0x4(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3fae8
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x10(%r15), %rdx
addq 0x8(%r15), %rdx
movq %rbx, %rdi
leaq 0xdab80(%rip), %rsi     # 0x11a2a0
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rcx
cmpq $0x2, %rcx
movl $0x1, %eax
cmovlq %rax, %rcx
movl $0x1f5, %eax            # imm = 0x1F5
cmpq %rax, %rcx
cmovgeq %rax, %rcx
decq %rcx
movq 0x18(%rbx), %rdi
addq 0x8(%r15), %rsi
movl 0x8(%r14), %r9d
movq %rcx, %rdx
xorl %r8d, %r8d
callq 0xefe67
movq %rax, 0x48(%r15)
movq 0x18(%rax), %rdi
callq 0xf74bd
movq %rbx, %rdi
leaq 0xe2ded(%rip), %rsi     # 0x122573
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r15), %r12
addq 0x8(%r15), %r12
addq 0x20(%r15), %r12
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x28(%r15), %rcx
movq %rbx, %rdi
leaq 0xdaafc(%rip), %rsi     # 0x11a2b3
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x28(%r15), %rax
addq %r12, %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jg 0x3f81b
movq 0x38(%r15), %rax
movl %eax, %ecx
andl $0xf000, %ecx           # imm = 0xF000
cmpl $0x4000, %ecx           # imm = 0x4000
je 0x3f820
cmpl $0x8000, %ecx           # imm = 0x8000
jne 0x3f828
movl $0x1, %r13d
jmp 0x3f88c
movq 0x8(%r15), %rdx
movq %rbx, %rdi
leaq 0xdaa71(%rip), %rsi     # 0x11a285
xorl %eax, %eax
callq 0xe9df7
movb $0x1, %r12b
jmp 0x3f898
movl $0x2, %r13d
jmp 0x3f88c
xorl %r13d, %r13d
movb $0x1, %cl
testq %rax, %rax
jne 0x3f874
cmpq $0xb, 0x18(%r15)
jne 0x3f874
movq 0x48(%r15), %rax
movq 0x8(%rax), %rdi
leaq 0xdaa87(%rip), %rsi     # 0x11a2cf
callq 0x181a0
movb $0x1, %cl
testl %eax, %eax
jne 0x3f874
movq %rbx, %rdi
leaq 0xdaa7d(%rip), %rsi     # 0x11a2da
xorl %eax, %eax
callq 0xe9226
xorl %ecx, %ecx
movl $0x1, 0x4(%r14)
movl $0x3, %r13d
testb %cl, %cl
je 0x3f88c
xorl %r13d, %r13d
movq %rbx, %rdi
leaq 0xdaa70(%rip), %rsi     # 0x11a2f5
xorl %eax, %eax
callq 0xe9226
leal -0x3(%r13), %eax
cmpl $-0x2, %eax
jae 0x3f90e
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %r13, %rdi
callq 0xf0b13
testb %r12b, %r12b
je 0x3f8ad
xorl %r13d, %r13d
jmp 0x3f8b9
movq 0x20(%r15), %r13
addq 0x10(%r15), %r13
addq 0x30(%r15), %r13
movq 0x48(%r15), %rsi
movq %rbx, %rdi
callq 0xf00aa
movq 0x50(%r15), %rsi
movq %rbx, %rdi
callq 0xea9b3
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe9752
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
testq %r13, %r13
setle %al
orb %al, %r12b
cmpb $0x1, %r12b
je 0x3f2d5
addq %r13, %rbp
cmpl $0x0, 0x4(%r14)
je 0x3f2ff
jmp 0x3f2d5
cmpl $0x2, %r13d
jne 0x3f923
movq 0x50(%r15), %rax
movb $0x1, 0x9(%rax)
movl $0x3, %ecx
jmp 0x3f941
testb $0x49, 0x38(%r15)
movq 0x50(%r15), %rax
movl 0x14(%rax), %ecx
je 0x3f936
orl $0x2, %ecx
jmp 0x3f939
orl $0x1, %ecx
movl %ecx, 0x14(%rax)
movl $0x1, %ecx
movq 0x48(%r15), %rax
movq 0x50(%r15), %rsi
movq 0x18(%rax), %rdx
movq %rbx, %rdi
callq 0xea9e4
movq 0x50(%r15), %rdx
movb $0x1, 0x8(%rdx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0xf037a
movq %rax, %r13
cmpl $0x5, (%r15)
jne 0x3f98e
movq 0x10(%r14), %rdi
callq 0xebdc3
movq 0x10(%r14), %rdx
movq %r13, %rdi
leaq 0xb20c8(%rip), %rsi     # 0xf1a51
callq 0xf1a12
movq 0x18(%rbx), %rdi
movq 0x28(%r15), %rdx
movq %r12, %rsi
movq %r13, %rcx
callq 0xefabc
cmpl $0x5, (%r15)
jne 0x3fa09
movq 0x10(%r14), %rdi
callq 0xebe2a
movl %eax, 0x58(%r15)
xorl %r12d, %r12d
movq %rbx, %rdi
leaq 0xda954(%rip), %rsi     # 0x11a315
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movl 0x58(%r15), %eax
cmpl 0x40(%r15), %eax
je 0x3f89b
movq 0x48(%r15), %rax
movq 0x18(%rax), %rdi
callq 0xf7557
movl 0x40(%r15), %ecx
movl 0x58(%r15), %r8d
xorl %r12d, %r12d
movq %rbx, %rdi
leaq 0xda935(%rip), %rsi     # 0x11a32f
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9b27
jmp 0x3f89b
xorl %r12d, %r12d
jmp 0x3f89b