// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/lha.c
// Function: de_run_ar001
static void de_run_ar001(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos;
	struct member_data *md = NULL;

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

	d->crco = de_crcobj_create(c, DE_CRCOBJ_CRC16_IBMSDLC);

	pos = 0;
	while(1) {
		if(pos >= c->infile->len) break;

		md = create_member_data(c);
		md->encoding = d->input_encoding;
		md->member_pos = pos;
		if(!do_read_ar001_member(c, d, md)) goto done;
		if(md->total_size<1) goto done;

		d->member_count++;
		pos += md->total_size;

		destroy_member_data(c, md);
		md = NULL;
	}

done:
	destroy_member_data(c, md);
	lha_destroy_lctx(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl $0x38, %esi
callq 0xe969b
movq %rax, %rbp
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xeb7d1
movl %eax, (%rbp)
movq %rbx, %rdi
movl $0x22, %esi
callq 0xeba56
movq %rax, 0x28(%rbp)
movq 0x18(%rbx), %rax
cmpq $0x0, 0x18(%rax)
jle 0x85ba4
leaq 0x8(%rsp), %r14
xorl %r12d, %r12d
movq %rbp, 0x18(%rsp)
movl $0xf8, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r15
movb $0x1, 0x48(%rax)
movl (%rbp), %eax
movl %eax, 0x4(%r15)
movq %r12, 0x8(%r15)
movq %r12, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x14(%rsp), %rsi
callq 0xe958c
movq %rbx, %rdi
leaq 0xb5f42(%rip), %rsi     # 0x13b7e3
movq %r12, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movb $0x0, (%r15)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef1ed
testq %rax, %rax
je 0x85b74
movq %rax, %r13
movq %rbx, %rdi
leaq 0xa6a6f(%rip), %rsi     # 0x12c34d
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
cmpq $0x12, %r13
jl 0x85b98
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef1ed
movq %rax, %r14
movl $0x0, (%rsp)
movb $0x0, 0x4(%rsp)
cmpl $0x1, %r14d
je 0x85926
testl %r14d, %r14d
jne 0x85932
movb $0x2d, 0x4(%rsp)
movl $0x30686c2d, (%rsp)     # imm = 0x30686C2D
jmp 0x85932
movb $0x2d, 0x4(%rsp)
movl $0x34686c2d, (%rsp)     # imm = 0x34686C2D
movq %r13, %rbp
addq $-0x12, %rbp
movl $0x70, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, 0x18(%r15)
movq %rsp, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x87049
movq 0x18(%r15), %rcx
addq $0x1b, %rcx
movq %rbx, %rdi
leaq 0xa2e4b(%rip), %rsi     # 0x1287b4
movq %r14, 0x20(%rsp)
movl %r14d, %edx
xorl %eax, %eax
callq 0xe9226
addq $0x6, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xef3a0
movq %rax, 0x60(%r15)
movq %rbx, %rdi
leaq 0x988ee(%rip), %rsi     # 0x11e28b
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef3a0
movq %rax, 0x28(%r15)
movq %rbx, %rdi
leaq 0x926f3(%rip), %rsi     # 0x1180b4
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef1ed
movl %eax, 0x4c(%r15)
movq %rbx, %rdi
leaq 0x9aca9(%rip), %rsi     # 0x12068e
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x871ea
addq %rbp, 0x8(%rsp)
movq %rbx, %rdi
movq 0x18(%rsp), %rbp
movq %rbp, %rsi
movq %r15, %rdx
callq 0x8769e
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef1ed
movl %eax, 0x38(%r15)
movq %rbx, %rdi
leaq 0xa693c(%rip), %rsi     # 0x12c36f
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x28(%rbp), %rdi
callq 0xebdc3
movq 0x28(%rbp), %rdi
movq 0x18(%rbx), %rsi
movq 0x8(%r15), %rdx
addq $0x2, %rdx
movq %r13, %rcx
callq 0xebf09
movq 0x28(%rbp), %rdi
callq 0xebe2a
movl %eax, 0x3c(%r15)
movq %rbx, %rdi
leaq 0xa981e(%rip), %rsi     # 0x12f292
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movl 0x38(%r15), %edx
movl 0x3c(%r15), %ecx
cmpl %edx, %ecx
je 0x85a9a
movq %rbx, %rdi
leaq 0xa66ce(%rip), %rsi     # 0x12c161
xorl %eax, %eax
callq 0xe9df7
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xef1ed
movq %rax, %r13
movq %rbx, %rdi
leaq 0xa68e0(%rip), %rsi     # 0x12c393
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
testq %r13, %r13
jne 0x85b87
movq 0x8(%rsp), %rdx
movq 0x60(%r15), %rcx
movq %rdx, %rax
subq %r12, %rax
addq %rcx, %rax
movq %rax, 0x10(%r15)
movq %rdx, 0x58(%r15)
movq %rbx, %rdi
leaq 0x947c9(%rip), %rsi     # 0x11a2b3
xorl %eax, %eax
callq 0xe9226
movq 0x18(%r15), %rax
cmpq $0x0, 0x8(%rax)
je 0x85b19
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x87753
jmp 0x85b3b
movq 0x78(%r15), %rdi
callq 0xf7557
movq %rbx, %rdi
leaq 0xa68af(%rip), %rsi     # 0x12c3db
movq %rax, %rdx
movq 0x20(%rsp), %rcx
xorl %eax, %eax
callq 0xe9df7
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movq 0x10(%r15), %rax
testq %rax, %rax
jle 0x85ba4
incl 0x1c(%rbp)
addq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0x86fbc
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %r12
jl 0x85866
xorl %r15d, %r15d
jmp 0x85ba4
leaq 0x92748(%rip), %rsi     # 0x1182c3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
jmp 0x85b98
leaq 0xa6820(%rip), %rsi     # 0x12c3ae
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
movq %rbx, %rdi
movq %r15, %rsi
callq 0x86fbc
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x86f88
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq