// File: /workspace/github_c_makefile_star2_O3/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 0xe8b2b
movq %rax, %rbp
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xeb220
movl %eax, (%rbp)
movq %rbx, %rdi
movl $0x22, %esi
callq 0xeb499
movq %rax, 0x28(%rbp)
movq 0x18(%rbx), %rax
cmpq $0x0, 0x18(%rax)
jle 0x85513
leaq 0x8(%rsp), %r14
xorl %r12d, %r12d
movq %rbp, 0x18(%rsp)
movl $0xf8, %esi
movq %rbx, %rdi
callq 0xe8b2b
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 0xe8a1c
movq %rbx, %rdi
leaq 0xb694d(%rip), %rsi     # 0x13bb5d
movq %r12, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movb $0x0, (%r15)
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebeb
testq %rax, %rax
je 0x854e3
movq %rax, %r13
movq %rbx, %rdi
leaq 0xa73e8(%rip), %rsi     # 0x12c635
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0x12, %r13
jl 0x85507
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebeb
movq %rax, %r14
movl $0x0, (%rsp)
movb $0x0, 0x4(%rsp)
cmpl $0x1, %r14d
je 0x85295
testl %r14d, %r14d
jne 0x852a1
movb $0x2d, 0x4(%rsp)
movl $0x30686c2d, (%rsp)     # imm = 0x30686C2D
jmp 0x852a1
movb $0x2d, 0x4(%rsp)
movl $0x34686c2d, (%rsp)     # imm = 0x34686C2D
movq %r13, %rbp
addq $-0x12, %rbp
movl $0x70, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, 0x18(%r15)
movq %rsp, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x8698f
movq 0x18(%r15), %rcx
addq $0x1b, %rcx
movq %rbx, %rdi
leaq 0xa370c(%rip), %rsi     # 0x1289e4
movq %r14, 0x20(%rsp)
movl %r14d, %edx
xorl %eax, %eax
callq 0xe8617
addq $0x6, 0x8(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0xeed83
movq %rax, 0x60(%r15)
movq %rbx, %rdi
leaq 0x9908f(%rip), %rsi     # 0x11e39b
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeed83
movq %rax, 0x28(%r15)
movq %rbx, %rdi
leaq 0x92ebc(%rip), %rsi     # 0x1181ec
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebeb
movl %eax, 0x4c(%r15)
movq %rbx, %rdi
leaq 0x9b462(%rip), %rsi     # 0x1207b6
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rcx
callq 0x86b1d
addq %rbp, 0x8(%rsp)
movq %rbx, %rdi
movq 0x18(%rsp), %rbp
movq %rbp, %rsi
movq %r15, %rdx
callq 0x86fd3
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebeb
movl %eax, 0x38(%r15)
movq %rbx, %rdi
leaq 0xa72b5(%rip), %rsi     # 0x12c657
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x28(%rbp), %rdi
callq 0xeb7fe
movq 0x28(%rbp), %rdi
movq 0x18(%rbx), %rsi
movq 0x8(%r15), %rdx
addq $0x2, %rdx
movq %r13, %rcx
callq 0xeb944
movq 0x28(%rbp), %rdi
callq 0xeb865
movl %eax, 0x3c(%r15)
movq %rbx, %rdi
leaq 0xaa192(%rip), %rsi     # 0x12f575
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movl 0x38(%r15), %edx
movl 0x3c(%r15), %ecx
cmpl %edx, %ecx
je 0x85409
movq %rbx, %rdi
leaq 0xa7047(%rip), %rsi     # 0x12c449
xorl %eax, %eax
callq 0xe9295
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0xeebeb
movq %rax, %r13
movq %rbx, %rdi
leaq 0xa7259(%rip), %rsi     # 0x12c67b
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
testq %r13, %r13
jne 0x854f6
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 0x94f7a(%rip), %rsi     # 0x11a3d3
xorl %eax, %eax
callq 0xe8617
movq 0x18(%r15), %rax
cmpq $0x0, 0x8(%rax)
je 0x85488
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x87088
jmp 0x854aa
movq 0x78(%r15), %rdi
callq 0xf70f6
movq %rbx, %rdi
leaq 0xa7228(%rip), %rsi     # 0x12c6c3
movq %rax, %rdx
movq 0x20(%rsp), %rcx
xorl %eax, %eax
callq 0xe9295
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq 0x10(%r15), %rax
testq %rax, %rax
jle 0x85513
incl 0x1c(%rbp)
addq %rax, %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0x86902
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %r12
jl 0x851d5
xorl %r15d, %r15d
jmp 0x85513
leaq 0x92f11(%rip), %rsi     # 0x1183fb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe8617
jmp 0x85507
leaq 0xa7199(%rip), %rsi     # 0x12c696
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
movl 0x14(%rsp), %esi
movq %rbx, %rdi
callq 0xe8a25
movq %rbx, %rdi
movq %r15, %rsi
callq 0x86902
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x868ce
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq