// File: /workspace/github_c_makefile_star2_O3/jsummers[P]deark/modules/jbf.c
// Function: de_run_jbf
static void de_run_jbf(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 pos = 0;
	i64 bytes_consumed;
	i64 count = 0;

	d = de_malloc(c, sizeof(lctx));
	d->input_encoding = de_get_input_encoding(c, NULL, DE_ENCODING_WINDOWS1252);

	if(!do_read_header(c, d, pos)) goto done;
	pos += 1024;

	count = 0;
	while(1) {
		if(count>=d->image_count) break;
		if(pos>=c->infile->len) goto done;

		bytes_consumed = 0;
		if(!do_one_thumbnail(c, d, pos, count, &bytes_consumed)) {
			goto done;
		}
		if(bytes_consumed<1) goto done;
		pos += bytes_consumed;
		count++;
	}

done:
	de_free(c, d);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
movl $0x18, %esi
callq 0xe8b2b
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xeb220
movl %eax, (%r14)
leaq 0xa3edd(%rip), %rsi     # 0x12337f
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
leaq 0x30(%rsp), %r15
movq $0xf, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeeb91
movl %eax, 0x4(%r14)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeeb91
movl %eax, 0x8(%r14)
movl 0x4(%r14), %edx
movl %edx, %ecx
shll $0x10, %ecx
orl %eax, %ecx
movl %ecx, 0xc(%r14)
leaq 0x99de2(%rip), %rsi     # 0x1192df
movq %rbx, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xe8617
movl 0x4(%r14), %edx
leal -0x3(%rdx), %eax
cmpl $-0x3, %eax
ja 0x7f53c
movl 0x8(%r14), %ecx
leaq 0xab12f(%rip), %rsi     # 0x12a64f
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
jmp 0x7fce6
cmpl $0x1, %edx
jne 0x7f56b
movl 0x8(%r14), %ecx
cmpl $0x2, %ecx
setne %al
cmpl $0x4, %ecx
setb %dl
testb %dl, %al
jne 0x7f56b
leaq 0xab119(%rip), %rsi     # 0x12a675
movq %rbx, %rdi
movl $0x1, %edx
xorl %eax, %eax
callq 0xe8faa
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
callq 0xeed61
movq %rax, 0x10(%r14)
leaq 0xaa227(%rip), %rsi     # 0x1297ab
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0xf1e9d
movl %eax, %ebp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
testl %ebp, %ebp
je 0x7fce6
cmpq $0x0, 0x10(%r14)
jle 0x7fce6
movl $0x400, %ebp            # imm = 0x400
leaq 0xab0f7(%rip), %r12     # 0x12a6c1
xorl %edx, %edx
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %rbp
jge 0x7fce6
movq %rbp, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
movq %rdx, 0x20(%rsp)
movq %rbp, %rcx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe8b2b
movq %rax, %r15
movq %rbx, %rdi
callq 0xea504
movq %r15, 0x8(%rsp)
movq %rax, (%r15)
movq %rbp, 0x30(%rsp)
movq %rbx, %rdi
callq 0xf6410
movq %rax, %r15
cmpl $0x10001, 0xc(%r14)     # imm = 0x10001
movq 0x18(%rbx), %rdi
movq %rbp, 0x28(%rsp)
jb 0x7f68b
leaq 0x30(%rsp), %rsi
callq 0xeed83
movq %rax, %r13
movq %rbx, %rdi
leaq 0xab10a(%rip), %rsi     # 0x12a764
movl %r13d, %edx
xorl %eax, %eax
callq 0xe8617
cmpq $0x3e8, %r13            # imm = 0x3E8
jle 0x7f6aa
movq %rbx, %rdi
leaq 0xab107(%rip), %rsi     # 0x12a77e
xorl %eax, %eax
callq 0xe9295
movq %r15, %rdi
callq 0xf6753
jmp 0x7fa47
movl (%r14), %r9d
movl $0xc, %edx
movq %rbp, %rsi
movq %r15, %rcx
movl $0x1, %r8d
callq 0xefbd7
leaq 0xd(%rbp), %r13
jmp 0x7f6c9
movq 0x18(%rbx), %rdi
movq 0x30(%rsp), %rsi
movl (%r14), %r9d
movq %r13, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0xefbd7
addq 0x30(%rsp), %r13
movq %r13, 0x30(%rsp)
movq %r15, %rdi
callq 0xf705c
movq %rbx, %rdi
leaq 0xab0b2(%rip), %rsi     # 0x12a792
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
cmpb $0x0, 0xd0(%rbx)
je 0x7f760
movq %r15, %rdi
callq 0xf66ff
movq 0x8(%rsp), %r13
movq %rax, 0x8(%r13)
movq %rax, %rdi
leaq 0xab09c(%rip), %rsi     # 0x12a7aa
movl $0x5, %edx
callq 0xf65e3
cmpl $0x2, 0x4(%r14)
movq 0x8(%r13), %rdi
leaq 0xa1a3a(%rip), %rsi     # 0x121162
leaq 0xb4183(%rip), %rax     # 0x1338b2
cmovaeq %rax, %rsi
movl $0x5, %edx
callq 0xf65e3
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xea53f
movq (%r13), %rax
movb $0x1, 0x8(%rax)
leaq 0xaabc2(%rip), %r13     # 0x12a320
jmp 0x7f787
cmpl $0x2, 0x4(%r14)
leaq 0xaabb4(%rip), %r13     # 0x12a320
jb 0x7f777
leaq 0xb413d(%rip), %rax     # 0x1338b2
jmp 0x7f77e
leaq 0xa19e4(%rip), %rax     # 0x121162
movq 0x8(%rsp), %rcx
movq %rax, 0x10(%rcx)
movq %r15, %rdi
callq 0xf6753
movq 0x30(%rsp), %rsi
subq %rbp, %rsi
addq (%rsp), %rsi
movq %rsi, (%rsp)
movl 0x4(%r14), %eax
cmpl $0x2, %eax
jne 0x7f809
movq 0x18(%rbx), %rdi
callq 0xeef09
movq 0x8(%rsp), %r15
movq (%r15), %rsi
addq $0x18, %rsi
movq %rax, %rdi
movl $0x1, %edx
callq 0xea829
movq (%r15), %rdi
addq $0x18, %rdi
movl $0x40, %edx
leaq 0x30(%rsp), %r15
movq %r15, %rsi
xorl %ecx, %ecx
callq 0xeaf46
movq %rbx, %rdi
leaq 0x9f3a0(%rip), %rsi     # 0x11eb8f
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movq (%rsp), %rsi
addq $0x8, %rsi
movq %rsi, (%rsp)
movl 0x4(%r14), %eax
movq %rsp, %rcx
cmpl $0x1, %eax
je 0x7f850
cmpl $0x2, %eax
jne 0x7f8f5
movq 0x18(%rbx), %rdi
movq %rcx, %rsi
callq 0xeed83
cmpl $0x10, %eax
jg 0x7f868
testl %eax, %eax
je 0x7f890
cmpl $0x1, %eax
je 0x7f899
leaq 0x92c61(%rip), %rcx     # 0x11249c
cmpl $0xa, %eax
jne 0x7f8de
leaq 0xaaf67(%rip), %rcx     # 0x12a7b2
jmp 0x7f8de
cmpl $0x2, 0x8(%r14)
ja 0x7f8f5
addq $0x4, %rsi
movq %rsi, (%rsp)
jmp 0x7f8f5
leal -0x1c(%rax), %ecx
cmpl $0x8, %ecx
ja 0x7f8a2
leaq 0xaaa79(%rip), %rsi     # 0x12a2f0
movslq (%rsi,%rcx,4), %rdx
addq %rsi, %rdx
leaq 0x92c17(%rip), %rcx     # 0x11249c
jmpq *%rdx
leaq 0xb7df7(%rip), %rcx     # 0x137685
jmp 0x7f8de
leaq 0x90e7a(%rip), %rcx     # 0x110711
jmp 0x7f8de
leaq 0xa3eb9(%rip), %rcx     # 0x123759
jmp 0x7f8de
cmpl $0x11, %eax
je 0x7f8d7
leaq 0x92bee(%rip), %rcx     # 0x11249c
cmpl $0x18, %eax
jne 0x7f8de
leaq 0xaaefc(%rip), %rcx     # 0x12a7b6
jmp 0x7f8de
leaq 0xcae7b(%rip), %rcx     # 0x14a73e
jmp 0x7f8de
leaq 0xaaeee(%rip), %rcx     # 0x12a7ba
jmp 0x7f8de
leaq 0xaaee9(%rip), %rcx     # 0x12a7be
jmp 0x7f8de
leaq 0x92c99(%rip), %rcx     # 0x112577
movq %rbx, %rdi
leaq 0xaadea(%rip), %rsi     # 0x12a6d2
movl %eax, %edx
xorl %eax, %eax
callq 0xe8617
movq (%rsp), %rsi
movq 0x18(%rbx), %rdi
callq 0xeebc8
movq %rax, %r15
movq (%rsp), %rsi
addq $0x4, %rsi
movq %rsi, (%rsp)
movq 0x18(%rbx), %rdi
callq 0xeebc8
addq $0x4, (%rsp)
movq %rbx, %rdi
leaq 0xaadcd(%rip), %rsi     # 0x12a6f2
movl %r15d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe8617
movq (%rsp), %rax
leaq 0x4(%rax), %rcx
movq %rcx, (%rsp)
cmpl $0x2, 0x4(%r14)
jne 0x7f94c
addq $0x8, %rax
movq %rax, (%rsp)
movq 0x18(%rbx), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0xeed83
movq %rbx, %rdi
leaq 0xa10ab(%rip), %rsi     # 0x120a10
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movl 0x4(%r14), %eax
cmpl $0x1, %eax
jne 0x7f9d9
movq (%rsp), %rsi
movq 0x18(%rbx), %rdi
callq 0xeedfa
movq 0x8(%rsp), %r15
movq (%r15), %rsi
addq $0x18, %rsi
movq %rax, %rdi
movl $0x1, %edx
callq 0xea7f5
movq (%r15), %rdi
addq $0x18, %rdi
movl $0x40, %edx
leaq 0x30(%rsp), %r15
movq %r15, %rsi
xorl %ecx, %ecx
callq 0xeaf46
movq %rbx, %rdi
leaq 0x9f1cc(%rip), %rsi     # 0x11eb8f
movq %r15, %rdx
movq %rsp, %r15
xorl %eax, %eax
callq 0xe8617
addq $0x8, (%rsp)
movl 0x4(%r14), %eax
cmpl $0x2, %eax
jne 0x7fa4f
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
testq %rax, %rax
je 0x7fc5a
addq $0x8, (%rsp)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xeed83
movq %rax, %r15
movq %rbx, %rdi
leaq 0xaad13(%rip), %rsi     # 0x12a724
movq %rax, %rdx
xorl %eax, %eax
callq 0xe8617
movq (%rsp), %rsi
movq %r15, %rax
addq %rsi, %rax
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %rax
jle 0x7fc6f
movq %rbx, %rdi
leaq 0xaacf8(%rip), %rsi     # 0x12a735
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9295
movb $0x1, %bpl
jmp 0x7fc8c
movq (%rsp), %r15
movq %r15, 0x10(%rsp)
movq %rbx, %rdi
leaq 0xb6ba3(%rip), %rsi     # 0x136605
movq %r15, %rdx
xorl %eax, %eax
callq 0xe8617
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe8a15
movq 0x18(%rbx), %rsi
movq 0x18(%rsi), %r8
subq %r15, %r8
movq %rbx, %rdi
leaq 0x30(%rsp), %rdx
movq %r15, 0x18(%rsp)
movq %r15, %rcx
xorl %r9d, %r9d
callq 0xf7425
leaq 0x9c404(%rip), %rsi     # 0x11bea7
testl %eax, %eax
je 0x7fc14
cmpq $0x28, 0x48(%rsp)
leaq 0xaad0a(%rip), %rsi     # 0x12a7c2
jne 0x7fc14
movq 0x8(%rsp), %rax
movq (%rax), %rdx
movq 0x10(%rax), %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xefda1
movq %rax, %r15
movq %rax, %rdi
callq 0xf0855
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x30(%rsp), %rdx
xorl %ecx, %ecx
callq 0xf78fa
movq 0x18(%rbx), %rdi
movq 0x48(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq %r15, %rcx
callq 0xef481
movl $0x2, %r12d
movzbl (%r12,%r13), %esi
movq %r15, %rdi
callq 0xf0bd6
movzbl -0x1(%r12,%r13), %esi
movq %r15, %rdi
callq 0xf0bd6
movzbl -0x2(%r12,%r13), %esi
movq %r15, %rdi
callq 0xf0bd6
movq %r15, %rdi
xorl %esi, %esi
callq 0xf0bd6
addq $0x3, %r12
cmpq $0x302, %r12            # imm = 0x302
jne 0x7fb0d
movq 0x48(%rsp), %rax
addq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rbx), %rdi
xorl %r12d, %r12d
cmpq 0x18(%rdi), %rax
jge 0x7fc24
cmpq $0x0, 0x98(%rsp)
jle 0x7fc24
xorl %ebp, %ebp
leaq 0x10(%rsp), %rsi
callq 0xeeb4b
cmpl $0x3, 0x8(%r14)
jb 0x7fb97
cmpb $-0x7f, %al
jb 0x7fbbf
andb $0x7f, %al
jmp 0x7fb9d
cmpb $-0x3f, %al
jb 0x7fbde
andb $0x3f, %al
movzbl %al, %r13d
movq 0x18(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xeeb4b
movzbl %al, %esi
movq %r15, %rdi
movq %r13, %rdx
callq 0xf0eba
jmp 0x7fbef
movzbl %al, %r13d
movq 0x18(%rbx), %rdi
movq 0x10(%rsp), %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0xef481
addq %r13, 0x10(%rsp)
jmp 0x7fbef
movzbl %al, %esi
movq %r15, %rdi
callq 0xf0bd6
movl $0x1, %r13d
movq 0x10(%rsp), %rax
movq 0x18(%rbx), %rdi
xorl %r12d, %r12d
cmpq 0x18(%rdi), %rax
jge 0x7fc24
addq %r13, %rbp
cmpq 0x98(%rsp), %rbp
jl 0x7fb7e
jmp 0x7fc24
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9295
movb $0x1, %r12b
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xf052b
movq 0x10(%rsp), %r15
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
movb $0x1, %bpl
testb %r12b, %r12b
leaq 0xaaa76(%rip), %r12     # 0x12a6c1
jne 0x7fc8c
subq 0x18(%rsp), %r15
addq %r15, (%rsp)
xorl %ebp, %ebp
jmp 0x7fc8c
xorl %ebp, %ebp
movq %rbx, %rdi
leaq 0xaaaa8(%rip), %rsi     # 0x12a70e
xorl %eax, %eax
callq 0xe8617
jmp 0x7fc8c
movq 0x8(%rsp), %rax
movq (%rax), %r8
movq 0x10(%rax), %rcx
xorl %ebp, %ebp
movq %r15, %rdx
xorl %r9d, %r9d
callq 0xefd48
addq %r15, (%rsp)
movq (%rsp), %r15
movq 0x8(%rsp), %r13
movq (%r13), %rsi
movq %rbx, %rdi
callq 0xea50e
movq 0x8(%r13), %rdi
callq 0xf6753
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe8be2
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe8a15
testb %bpl, %bpl
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rdx
jne 0x7fce6
cmpq %rax, %r15
jle 0x7fce6
incq %rdx
movq %r15, %rbp
cmpq 0x10(%r14), %rdx
jl 0x7f5cc
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe8be2
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq