// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/installshld.c
// Function: de_run_is_instarch
static void de_run_is_instarch(deark *c, de_module_params *mparams)
{
	de_arch_lctx *da = NULL;
	i64 pos;
	i64 i;
	struct de_arch_member_data *md = NULL;

	da = de_arch_create_lctx(c);
	da->is_le = 1;
	da->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_WINDOWS1252);

	pos = 78;
	da->num_members = de_getu16le_p(&pos); // This might actually be a 32-bit field
	de_dbg(c, "number of members: %"I64_FMT, da->num_members);
	pos += 2;

	for(i=0; i<da->num_members; i++) {
		if(pos >= c->infile->len) goto done;

		if(md) {
			de_arch_destroy_md(c, md);
			md = NULL;
		}
		md = de_arch_create_md(c, da);
		md->member_hdr_pos = pos;
		if(!do_instarch_member(c, da, md)) goto done;
		if(md->member_hdr_size<=0) goto done;
		pos += md->member_hdr_size;
	}

done:
	if(md) {
		de_arch_destroy_md(c, md);
	}
	if(da) {
		de_arch_destroy_lctx(c, da);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0xfdb0a
movq %rax, %r14
movl $0x1, 0x10(%rax)
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xeb7d1
movl %eax, 0x18(%r14)
leaq 0x10(%rsp), %r12
movq $0x4e, (%r12)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef1ed
movq %rax, 0x20(%r14)
leaq 0x71d8b(%rip), %rsi     # 0x11465c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
addq $0x2, (%r12)
cmpq $0x0, 0x20(%r14)
jle 0xa2ab4
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
movq 0x18(%rbx), %rcx
cmpq 0x18(%rcx), %rax
jge 0xa2ab4
testq %r15, %r15
je 0xa2916
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfdab8
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfda6c
movq %rax, %r15
movq 0x10(%rsp), %rax
movq %rax, 0x18(%r15)
movq %rax, (%rsp)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
callq 0xe958c
movq 0x18(%r15), %rdx
movq %rbx, %rdi
leaq 0x98e97(%rip), %rsi     # 0x13b7e3
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq %rsp, %r13
movq %r13, %rsi
callq 0xef3a0
movq %rax, 0x40(%r15)
movq %rbx, %rdi
leaq 0x83482(%rip), %rsi     # 0x125dff
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq %r15, %rdi
movq %r13, %rsi
callq 0xfdbe0
movq %r15, %rdi
movq %r13, %rsi
callq 0xfdb9b
addq $0x8, (%rsp)
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xef1ed
movq %rax, %r12
movq 0x18(%rbx), %rdi
movq (%rsp), %rsi
movq 0x58(%r15), %rcx
movl 0x18(%r14), %r9d
movq %rax, %rdx
xorl %r8d, %r8d
callq 0xf01b0
movq 0x58(%r15), %rdi
callq 0xf7557
movq %rbx, %rdi
leaq 0x8fc32(%rip), %rsi     # 0x132611
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
addq %r12, (%rsp)
movq 0x18(%rbx), %rdi
movq %r13, %rsi
callq 0xef1ed
movq %rax, %r12
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r13
movq 0x18(%rbx), %rdi
movq (%rsp), %rsi
movl 0x18(%r14), %r9d
movq %r12, %rdx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0xf01b0
movq %r13, %rdi
callq 0xf7557
movq %rbx, %rdi
leaq 0x8fbeb(%rip), %rsi     # 0x13261e
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
addq %r12, (%rsp)
movq %r15, %rdi
callq 0xfde12
testl %eax, %eax
je 0xa2aa0
leaq 0x73d(%rip), %rax       # 0xa3191
movq %rax, 0xa8(%r15)
movq %r15, %rdi
callq 0xfdec1
movq (%rsp), %rax
subq 0x18(%r15), %rax
movq %rax, 0x20(%r15)
movq %r13, %rdi
callq 0xf6bb0
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movq 0x20(%r15), %rax
testq %rax, %rax
jle 0xa2ab4
addq %rax, 0x10(%rsp)
incq %rbp
cmpq 0x20(%r14), %rbp
jl 0xa28f3
jmp 0xa2ab4
movq %r13, %rdi
callq 0xf6bb0
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
testq %r15, %r15
je 0xa2ac4
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfdab8
testq %r14, %r14
je 0xa2ad4
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfdb25
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq