// File: /workspace/github_c_makefile_star2_O1/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 $0xe8, %rsp
movq %rdi, %rbx
movl $0x18, %esi
callq 0xe969b
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xeb7d1
movl %eax, (%r14)
leaq 0x40(%rsp), %r15
movq $0x0, (%r15)
leaq 0xa36f1(%rip), %rsi     # 0x12319f
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
addq $0xf, (%r15)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef193
movl %eax, 0x4(%r14)
movq 0x18(%rbx), %rdi
movq %r15, %rsi
callq 0xef193
movl %eax, 0x8(%r14)
movl 0x4(%r14), %edx
movl %edx, %ecx
shll $0x10, %ecx
orl %eax, %ecx
movl %ecx, 0xc(%r14)
leaq 0x996be(%rip), %rsi     # 0x1191bf
movq %rbx, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xe9226
movl 0x4(%r14), %edx
leal -0x3(%rdx), %eax
cmpl $-0x3, %eax
ja 0x7fb40
movl 0x8(%r14), %ecx
leaq 0xaa8bb(%rip), %rsi     # 0x12a3df
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
jmp 0x80313
cmpl $0x1, %edx
jne 0x7fb6c
movl 0x8(%r14), %ecx
cmpl $0x2, %ecx
setne %al
cmpl $0x4, %ecx
setb %sil
testb %sil, %al
jne 0x7fb6c
leaq 0xaa8a3(%rip), %rsi     # 0x12a405
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
movq 0x18(%rbx), %rdi
movq 0x40(%rsp), %rsi
callq 0xef37e
movq %rax, 0x10(%r14)
leaq 0xa99f6(%rip), %rsi     # 0x12957b
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0xf2509
movl %eax, %ebp
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
testl %ebp, %ebp
je 0x80313
cmpq $0x0, 0x10(%r14)
jle 0x80313
movl $0x400, %r15d           # imm = 0x400
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %r15
jge 0x80313
movq %r15, 0x8(%rsp)
movq %rbx, %rdi
leaq 0xaa86c(%rip), %rsi     # 0x12a451
movl %r12d, %edx
movq %r15, 0x38(%rsp)
movq %r15, %rcx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r15
movq %rbx, %rdi
callq 0xea9a9
movq %r15, 0x20(%rsp)
movq %rax, (%r15)
movq 0x8(%rsp), %r13
movq %r13, 0x40(%rsp)
movq %rbx, %rdi
callq 0xf6870
movq %rax, %r15
cmpl $0x10001, 0xc(%r14)     # imm = 0x10001
movq 0x18(%rbx), %rdi
movq %r12, 0x28(%rsp)
jb 0x7fc96
leaq 0x40(%rsp), %rsi
callq 0xef3a0
movq %rax, %rbp
movq %rbx, %rdi
leaq 0xaa891(%rip), %rsi     # 0x12a4f4
movl %ebp, %edx
xorl %eax, %eax
callq 0xe9226
cmpq $0x3e9, %rbp            # imm = 0x3E9
jge 0x7fcb9
movq 0x18(%rbx), %rdi
movq 0x40(%rsp), %rsi
movl (%r14), %r9d
movq %rbp, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0xf01b0
addq %rbp, 0x40(%rsp)
jmp 0x7fcca
movq 0x40(%rsp), %rsi
movl (%r14), %r9d
movl $0xc, %edx
movq %r15, %rcx
movl $0x1, %r8d
callq 0xf01b0
addq $0xd, 0x40(%rsp)
jmp 0x7fcda
movq %rbx, %rdi
leaq 0xaa84b(%rip), %rsi     # 0x12a50e
xorl %eax, %eax
callq 0xe9df7
movb $0x1, %r12b
cmpq $0x3e9, %rbp            # imm = 0x3E9
jge 0x7fd8b
movq %r15, %rdi
callq 0xf74bd
movq %rbx, %rdi
leaq 0xaa836(%rip), %rsi     # 0x12a522
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
cmpb $0x0, 0xd0(%rbx)
je 0x7fd68
movq %r15, %rdi
callq 0xf6b5c
movq 0x20(%rsp), %rbp
movq %rax, 0x8(%rbp)
movq %rax, %rdi
leaq 0xaa820(%rip), %rsi     # 0x12a53a
movl $0x5, %edx
callq 0xf6a40
cmpl $0x2, 0x4(%r14)
movq 0x8(%rbp), %rdi
leaq 0xa131e(%rip), %rsi     # 0x121052
leaq 0xb377f(%rip), %rax     # 0x1334ba
cmovaeq %rax, %rsi
movl $0x5, %edx
callq 0xf6a40
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xea9e4
movq (%rbp), %rax
movb $0x1, 0x8(%rax)
jmp 0x7fd8b
cmpl $0x2, 0x4(%r14)
jb 0x7fd78
leaq 0xb3744(%rip), %rax     # 0x1334ba
jmp 0x7fd7f
leaq 0xa12d3(%rip), %rax     # 0x121052
movq 0x20(%rsp), %rcx
movq %rax, 0x10(%rcx)
xorl %r12d, %r12d
movq %r15, %rdi
callq 0xf6bb0
movb $0x1, %al
testb %r12b, %r12b
je 0x7fe05
movl %eax, 0x14(%rsp)
movq 0x28(%rsp), %r12
movq 0x8(%rsp), %r15
movq 0x20(%rsp), %r13
movq (%r13), %rsi
movq %rbx, %rdi
callq 0xea9b3
movq 0x8(%r13), %rdi
callq 0xf6bb0
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe9752
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
cmpb $0x0, 0x14(%rsp)
movq 0x38(%rsp), %rax
jne 0x80313
cmpq %rax, %r15
jle 0x80313
incq %r12
cmpq 0x10(%r14), %r12
jl 0x7fbc8
jmp 0x80313
movl %eax, 0x14(%rsp)
movq 0x40(%rsp), %rsi
subq %r13, %rsi
addq 0x8(%rsp), %rsi
movq %rsi, 0x8(%rsp)
cmpl $0x2, 0x4(%r14)
leaq 0x8(%rsp), %r12
jne 0x7fe7e
movq 0x18(%rbx), %rdi
callq 0xef536
movq 0x20(%rsp), %r15
movq (%r15), %rsi
addq $0x18, %rsi
movq %rax, %rdi
movl $0x1, %edx
callq 0xead1a
movq (%r15), %rdi
addq $0x18, %rdi
movl $0x40, %edx
leaq 0x40(%rsp), %r15
movq %r15, %rsi
xorl %ecx, %ecx
callq 0xeb4f8
movq %rbx, %rdi
leaq 0x9ec19(%rip), %rsi     # 0x11ea87
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
addq $0x8, 0x8(%rsp)
movl 0x4(%r14), %eax
cmpl $0x1, %eax
je 0x7fecd
cmpl $0x2, %eax
leaq 0xaa21f(%rip), %r13     # 0x12a0b0
jne 0x7ff73
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
cmpl $0x10, %eax
jg 0x7feea
testl %eax, %eax
je 0x7ff12
cmpl $0x1, %eax
je 0x7ff1b
leaq 0x925d4(%rip), %rcx     # 0x11248c
cmpl $0xa, %eax
jne 0x7ff60
leaq 0xaa67a(%rip), %rcx     # 0x12a542
jmp 0x7ff60
cmpl $0x2, 0x8(%r14)
leaq 0xaa1d7(%rip), %r13     # 0x12a0b0
ja 0x7ff73
addq $0x4, 0x8(%rsp)
jmp 0x7ff73
leal -0x1c(%rax), %ecx
cmpl $0x8, %ecx
ja 0x7ff24
leaq 0xaa187(%rip), %rsi     # 0x12a080
movslq (%rsi,%rcx,4), %rdx
addq %rsi, %rdx
leaq 0x92585(%rip), %rcx     # 0x11248c
jmpq *%rdx
leaq 0xb73ed(%rip), %rcx     # 0x1372fd
jmp 0x7ff60
leaq 0x9080c(%rip), %rcx     # 0x110725
jmp 0x7ff60
leaq 0xa3657(%rip), %rcx     # 0x123579
jmp 0x7ff60
cmpl $0x11, %eax
je 0x7ff59
leaq 0x9255c(%rip), %rcx     # 0x11248c
cmpl $0x18, %eax
jne 0x7ff60
leaq 0xaa60a(%rip), %rcx     # 0x12a546
jmp 0x7ff60
leaq 0xca249(%rip), %rcx     # 0x14a18e
jmp 0x7ff60
leaq 0xaa5fc(%rip), %rcx     # 0x12a54a
jmp 0x7ff60
leaq 0xaa5f7(%rip), %rcx     # 0x12a54e
jmp 0x7ff60
leaq 0x92607(%rip), %rcx     # 0x112567
movq %rbx, %rdi
leaq 0xaa4f8(%rip), %rsi     # 0x12a462
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
movq 0x8(%rsp), %rsi
callq 0xef1ca
movq %rax, %r15
movq 0x8(%rsp), %rsi
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
movq 0x18(%rbx), %rdi
callq 0xef1ca
addq $0x4, 0x8(%rsp)
movq %rbx, %rdi
leaq 0xaa4d7(%rip), %rsi     # 0x12a482
movl %r15d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0xe9226
movq 0x8(%rsp), %rax
leaq 0x4(%rax), %rcx
movq %rcx, 0x8(%rsp)
cmpl $0x2, 0x4(%r14)
jne 0x7ffd5
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
movq %rbx, %rdi
leaq 0xa08fd(%rip), %rsi     # 0x1208e8
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
cmpl $0x1, 0x4(%r14)
jne 0x80058
movq 0x8(%rsp), %rsi
movq 0x18(%rbx), %rdi
callq 0xef417
movq 0x20(%rsp), %r15
movq (%r15), %rsi
addq $0x18, %rsi
movq %rax, %rdi
movl $0x1, %edx
callq 0xeace2
movq (%r15), %rdi
addq $0x18, %rdi
movl $0x40, %edx
leaq 0x40(%rsp), %r15
movq %r15, %rsi
xorl %ecx, %ecx
callq 0xeb4f8
movq %rbx, %rdi
leaq 0x9ea3f(%rip), %rsi     # 0x11ea87
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9226
addq $0x8, 0x8(%rsp)
cmpl $0x2, 0x4(%r14)
jne 0x800cf
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
testq %rax, %rax
je 0x802cc
addq $0x8, 0x8(%rsp)
movq 0x18(%rbx), %rdi
movq %r12, %rsi
callq 0xef3a0
movq %rax, %r15
movq %rbx, %rdi
leaq 0xaa421(%rip), %rsi     # 0x12a4b4
movq %rax, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x8(%rsp), %rsi
movq %r15, %rax
addq %rsi, %rax
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %rax
jle 0x802ea
movq %rbx, %rdi
leaq 0xaa405(%rip), %rsi     # 0x12a4c5
movq %r15, %rdx
xorl %eax, %eax
callq 0xe9df7
jmp 0x7fd9e
movq 0x8(%rsp), %rdx
movq %rdx, 0x18(%rsp)
movq %rbx, %rdi
leaq 0xb60df(%rip), %rsi     # 0x1361c2
movq %rdx, 0x30(%rsp)
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rsi
movq 0x18(%rsp), %rcx
movq 0x18(%rsi), %r8
subq %rcx, %r8
movq %rbx, %rdi
leaq 0x40(%rsp), %rdx
xorl %r9d, %r9d
callq 0xf7881
leaq 0x9bc5c(%rip), %rsi     # 0x11bd7f
testl %eax, %eax
je 0x8027d
cmpq $0x28, 0x58(%rsp)
leaq 0xaa41a(%rip), %rsi     # 0x12a552
jne 0x8027d
movq 0x20(%rsp), %rax
movq (%rax), %rdx
movq 0x10(%rax), %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xf037a
movq %rax, %r15
movq %rax, %rdi
callq 0xf0e3f
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x40(%rsp), %rdx
xorl %ecx, %ecx
callq 0xf7d41
movq 0x18(%rbx), %rdi
movq 0x18(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r15, %rcx
callq 0xefabc
movl $0x2, %r12d
movzbl (%r12,%r13), %esi
movq %r15, %rdi
callq 0xf11be
movzbl -0x1(%r12,%r13), %esi
movq %r15, %rdi
callq 0xf11be
movzbl -0x2(%r12,%r13), %esi
movq %r15, %rdi
callq 0xf11be
movq %r15, %rdi
xorl %esi, %esi
callq 0xf11be
addq $0x3, %r12
cmpq $0x302, %r12            # imm = 0x302
jne 0x8018d
movq 0x58(%rsp), %rax
addq %rax, 0x18(%rsp)
xorl %r13d, %r13d
movq 0x18(%rsp), %rax
movq 0x18(%rbx), %rdi
cmpq 0x18(%rdi), %rax
setl %al
cmpq 0xa8(%rsp), %r13
setl %r12b
andb %al, %r12b
cmpb $0x1, %r12b
jne 0x80270
leaq 0x18(%rsp), %rsi
callq 0xef14d
cmpl $0x3, 0x8(%r14)
jb 0x80218
cmpb $-0x7f, %al
jb 0x8023f
andb $0x7f, %al
jmp 0x8021e
cmpb $-0x3f, %al
jb 0x8025d
andb $0x3f, %al
movzbl %al, %ebp
movq 0x18(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0xef14d
movzbl %al, %esi
movq %r15, %rdi
movq %rbp, %rdx
callq 0xf14bd
jmp 0x8026d
movzbl %al, %ebp
movq 0x18(%rbx), %rdi
movq 0x18(%rsp), %rsi
movq %rbp, %rdx
movq %r15, %rcx
callq 0xefabc
addq %rbp, 0x18(%rsp)
jmp 0x8026d
movzbl %al, %esi
movq %r15, %rdi
callq 0xf11be
movl $0x1, %ebp
addq %rbp, %r13
testb %r12b, %r12b
jne 0x801da
xorl %ebp, %ebp
jmp 0x8028d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movb $0x1, %bpl
xorl %r15d, %r15d
movq %r15, %rdi
callq 0xf0b13
movq 0x18(%rsp), %r15
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
testb %bpl, %bpl
movq 0x28(%rsp), %r12
jne 0x7fda3
subq 0x30(%rsp), %r15
addq %r15, 0x8(%rsp)
movl $0x0, 0x14(%rsp)
jmp 0x7fda3
movl $0x0, 0x14(%rsp)
movq %rbx, %rdi
leaq 0xaa1c0(%rip), %rsi     # 0x12a49e
xorl %eax, %eax
callq 0xe9226
jmp 0x7fd9e
movq 0x20(%rsp), %rax
movq (%rax), %r8
movq 0x10(%rax), %rcx
movl $0x0, 0x14(%rsp)
movq %r15, %rdx
xorl %r9d, %r9d
callq 0xf0321
addq %r15, 0x8(%rsp)
jmp 0x7fd9e
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe9752
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq