// File: /workspace/github_c_makefile_star2_O1/jsummers[P]deark/modules/psd.c
// Function: de_run_psd
static void de_run_psd(deark *c, de_module_params *mparams)
{
	lctx *d = NULL;
	i64 x;
	zztype *zz = NULL;
	zztype czz;
	int whattodo = 0;

	d = de_malloc(c, sizeof(lctx));
	zz = de_malloc(c, sizeof(zztype));
	zz_init_absolute(zz, 0, c->infile->len);

	if(de_havemodcode(c, mparams, 'R')) {
		whattodo = 'R';
	}
	else if(de_havemodcode(c, mparams, 'T')) {
		whattodo = 'T';
	}
	else if(de_havemodcode(c, mparams, 'B')) {
		whattodo = 'B';
	}
	else if(!dbuf_memcmp(c->infile, 0, "8BIM", 4)) {
		// Assume this is a raw resources file (maybe extracted from an
		// .8bimtiff file)
		whattodo = 'R';
	}

	if(whattodo=='R') { // Image resources
		de_declare_fmt(c, "Photoshop resources");
		d->version = 1;
		init_version_specific_info(c, d);
		do_image_resource_blocks(c, d, zz);
		if(mparams) {
			// .out_params.flags: 0x02: has_iptc
			mparams->out_params.flags = 0;
			if(d->has_iptc) mparams->out_params.flags |= 0x02;
		}
		goto done;
	}
	else if(whattodo=='T') { // Tagged blocks
		d->version = 1;
		init_version_specific_info(c, d);
		do_external_tagged_blocks(c, d, zz);
		goto done;
	}
	else if(whattodo=='B') { // Tagged blocks, PSB-format
		d->version = 2;
		init_version_specific_info(c, d);
		do_external_tagged_blocks(c, d, zz);
		goto done;
	}

	d->main_iinfo = de_malloc(c, sizeof(struct image_info));

	if(!do_psd_header(c, d, zz->pos)) goto done;
	zz->pos += 26;

	de_dbg(c, "color mode data section at %d", (int)zz->pos);
	de_dbg_indent(c, 1);
	x = psd_getu32zz(zz);
	zz_init_with_len(&czz, zz, x);
	do_psd_color_mode_data(c, d, &czz);
	zz->pos += x;
	de_dbg_indent(c, -1);

	de_dbg(c, "image resources section at %d", (int)zz->pos);
	de_dbg_indent(c, 1);
	x = psd_getu32zz(zz); // Length of Image Resources
	// The PSD spec is ambiguous, but in practice the "length" field's value
	// does not include the size of the "length" field itself.
	de_dbg(c, "image resources data at %d, len=%d", (int)zz->pos, (int)x);

	if(x>0) {
		if(de_get_ext_option_bool(c, "extract8bim", 0)) {
			fmtutil_handle_photoshop_rsrc(c, c->infile, zz->pos, x, 0x1);
		}
		else {
			de_dbg_indent(c, 1);
			zz_init_with_len(&czz, zz, x);
			do_image_resource_blocks(c, d, &czz);
			de_dbg_indent(c, -1);
		}
	}
	zz->pos += x;
	de_dbg_indent(c, -1);

	zz_init(&czz, zz);
	if(!do_layer_and_mask_info_section(c, d, &czz)) goto done;
	zz->pos += zz_used(&czz);

	zz_init(&czz, zz);
	do_image_data(c, d, &czz);

done:
	de_free(c, zz);
	if(d) {
		de_free(c, d->main_iinfo);
		de_free(c, d);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movl $0x58, %esi
callq 0xe969b
movq %rax, %rbp
movl $0x18, %esi
movq %rbx, %rdi
callq 0xe969b
movq %rax, %r15
movq 0x18(%rbx), %rax
movq 0x18(%rax), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq %rax, 0x10(%r15)
movq %rbx, %rdi
movq %r12, %rsi
movl $0x52, %edx
callq 0xea97e
testl %eax, %eax
je 0xa45bb
movb $0x1, %al
xorl %r14d, %r14d
jmp 0xa45d8
movq %rbx, %rdi
movq %r12, %rsi
movl $0x54, %edx
callq 0xea97e
testl %eax, %eax
je 0xa4698
movb $0x1, %r14b
xorl %eax, %eax
xorl %ecx, %ecx
testb %al, %al
je 0xa4630
leaq 0x86661(%rip), %rsi     # 0x12ac46
movq %rbx, %rdi
callq 0xeb6d6
movl $0x1, (%rbp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xa64c0
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0xa64f9
testq %r12, %r12
movq %r15, %rsi
je 0xa4665
movl $0x0, 0x40(%r12)
xorl %eax, %eax
cmpb $0x0, 0x30(%rbp)
setne %al
addl %eax, %eax
movl %eax, 0x40(%r12)
jmp 0xa4665
testb %r14b, %r14b
je 0xa463e
movl $0x1, (%rbp)
jmp 0xa4649
testb %cl, %cl
je 0xa46bc
movl $0x2, (%rbp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xa64c0
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0xa68f5
movq %r15, %rsi
movq %rbx, %rdi
callq 0xe9752
testq %rbp, %rbp
je 0xa4689
movq 0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0xe9752
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xe9752
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r12, %rsi
movl $0x42, %edx
callq 0xea97e
testl %eax, %eax
je 0xa473d
movb $0x1, %cl
xorl %eax, %eax
xorl %r14d, %r14d
jmp 0xa45da
movl $0x448, %esi            # imm = 0x448
movq %rbx, %rdi
callq 0xe969b
movq %rax, 0x50(%rbp)
movq (%r15), %r12
leaq 0x94c87(%rip), %rsi     # 0x13935e
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
leaq 0x4(%r12), %rsi
movl 0x4(%rbp), %edx
callq 0xef570
movl %eax, (%rbp)
leaq 0x8fcc1(%rip), %rsi     # 0x1343cd
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xa64c0
movl (%rbp), %edx
cmpl $0x1, %edx
je 0xa4761
cmpl $0x2, %edx
jne 0xa4a7a
leaq 0x8fc82(%rip), %rsi     # 0x1343bd
jmp 0xa4768
movq 0x18(%rbx), %rdi
leaq 0xa57ad(%rip), %rdx     # 0x149ef5
xorl %r14d, %r14d
movl $0x4, %ecx
xorl %esi, %esi
callq 0xf025e
testl %eax, %eax
sete %al
jmp 0xa45d8
leaq 0x8e2c6(%rip), %rsi     # 0x132a2e
movq %rbx, %rdi
callq 0xeb6d6
movq 0x18(%rbx), %rdi
leaq 0xc(%r12), %rsi
movl 0x4(%rbp), %edx
callq 0xef570
movq 0x50(%rbp), %rcx
movq %rax, 0x18(%rcx)
leaq 0x7a468(%rip), %rsi     # 0x11ebf8
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
leaq 0xe(%r12), %rsi
movl 0x4(%rbp), %edx
callq 0xef614
movq 0x50(%rbp), %rcx
movq %rax, 0x8(%rcx)
movq 0x18(%rbx), %rdi
leaq 0x12(%r12), %rsi
movl 0x4(%rbp), %edx
callq 0xef614
movq 0x50(%rbp), %rcx
movq %rax, (%rcx)
movq 0x8(%rcx), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe9b05
movq 0x18(%rbx), %rdi
leaq 0x16(%r12), %rsi
movl 0x4(%rbp), %edx
callq 0xef570
movq 0x50(%rbp), %rcx
movq %rax, 0x20(%rcx)
leaq 0x8fd8f(%rip), %rsi     # 0x13458b
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq 0x18(%rbx), %rdi
addq $0x18, %r12
movl 0x4(%rbp), %edx
movq %r12, %rsi
callq 0xef570
movq 0x50(%rbp), %rcx
movq %rax, 0x10(%rcx)
cmpq $0x9, %rax
ja 0xa4836
leaq 0xe15e0(%rip), %rcx     # 0x185e10
movq (%rcx,%rax,8), %rcx
jmp 0xa483d
leaq 0x8762c(%rip), %rcx     # 0x12be69
leaq 0x8f761(%rip), %rsi     # 0x133fa5
xorl %r14d, %r14d
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq (%r15), %rdx
addq $0x1a, %rdx
movq %rdx, (%r15)
leaq 0x8e26a(%rip), %rsi     # 0x132adb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movl 0x4(%rbp), %edx
movq (%r15), %rsi
callq 0xef614
movq %rax, %r12
movq (%r15), %rax
movq %rbp, %rdx
movq 0x10(%r15), %rbp
leaq 0x4(%rax), %rsi
testq %r12, %r12
movq %r12, %rcx
cmovleq %r14, %rcx
addq %rcx, %rax
addq $0x4, %rax
cmpq %rbp, %rax
cmovlq %rax, %rbp
movq %rsi, (%r15)
movq %rsi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rbp, 0x28(%rsp)
movq %rdx, (%rsp)
movq 0x50(%rdx), %r13
subq %rsi, %rbp
cmovleq %r14, %rbp
movq %rsi, %r14
leaq 0x8faf2(%rip), %rsi     # 0x1343dd
movq %rbx, %rdi
movl %r14d, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xe9226
movabsq $0x5555555555555556, %rcx # imm = 0x5555555555555556
movq %rbp, %rax
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
addq %rdx, %rax
movq %rax, 0x40(%r13)
cmpq $0x3, %rbp
movq %r15, 0x8(%rsp)
jl 0xa49dd
movq %r12, 0x30(%rsp)
cmpq $0x303, %rbp            # imm = 0x303
jl 0xa493d
movq $0x100, 0x40(%r13)      # imm = 0x100
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
cmpq $0x0, 0x40(%r13)
jle 0xa49c6
xorl %ebp, %ebp
movq 0x18(%rbx), %rdi
leaq (%r14,%rbp), %r12
movq %r12, %rsi
callq 0xef0d5
movb %al, 0x10(%rsp)
movq 0x18(%rbx), %rdi
movq 0x40(%r13), %rsi
addq %r12, %rsi
callq 0xef0d5
movq %r14, %r15
movl %eax, %r14d
movq 0x18(%rbx), %rdi
movq 0x40(%r13), %rax
leaq (%r12,%rax,2), %rsi
callq 0xef0d5
movzbl 0x10(%rsp), %ecx
shll $0x10, %ecx
movzbl %r14b, %esi
movq %r15, %r14
shll $0x8, %esi
orl %ecx, %esi
movzbl %al, %edx
orl %esi, %edx
orl $0xff000000, %edx       # imm = 0xFF000000
movl %edx, 0x48(%r13,%rbp,4)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xe9d68
incq %rbp
cmpq 0x40(%r13), %rbp
jl 0xa4953
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x8(%rsp), %r15
movq 0x30(%rsp), %r12
addq %r12, (%r15)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movl (%r15), %edx
leaq 0x8e102(%rip), %rsi     # 0x132af9
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq (%rsp), %rbp
movl 0x4(%rbp), %edx
movq (%r15), %rsi
callq 0xef614
movq %rax, %r12
movq (%r15), %rdx
addq $0x4, %rdx
movq %rdx, (%r15)
leaq 0x8e0e2(%rip), %rsi     # 0x132b17
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0xe9226
testq %r12, %r12
jle 0xa4ae6
leaq 0x8e0e8(%rip), %rsi     # 0x132b3a
movq %rbx, %rdi
xorl %edx, %edx
callq 0xea727
testl %eax, %eax
je 0xa4a9d
movq 0x18(%rbx), %rsi
movq (%r15), %rdx
movq %rbx, %rdi
movq %r12, %rcx
movl $0x1, %r8d
callq 0xf8388
jmp 0xa4ae6
leaq 0x8f940(%rip), %rsi     # 0x1343c1
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
jmp 0xa4662
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq (%r15), %rax
movq 0x10(%r15), %rcx
movq %r12, %rsi
addq %rax, %rsi
cmpq %rcx, %rsi
cmovgeq %rcx, %rsi
leaq 0x18(%rsp), %rdx
movq %rax, 0x8(%rdx)
movq %rax, (%rdx)
movq %rsi, 0x10(%rdx)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xa64f9
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
addq %r12, (%r15)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq (%r15), %r14
movq 0x10(%r15), %rax
leaq 0x18(%rsp), %r12
movq %r14, 0x8(%r12)
movq %r14, (%r12)
movq %rax, 0x10(%r12)
leaq 0x3c(%rsp), %rsi
movq %rbx, %rdi
callq 0xe958c
leaq 0x8f8d2(%rip), %rsi     # 0x1343f6
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xabbfd
leaq 0x70(%rsp), %r14
movq %rax, (%r14)
leaq 0x8f8bb(%rip), %rsi     # 0x134416
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0xe9226
movq %r14, %rdi
callq 0xec0d1
movq (%r12), %rax
movq 0x10(%r12), %r15
movq (%r14), %rcx
leaq (%rcx,%rax), %r13
cmpq %r15, %r13
jle 0xa4b9a
leaq 0x8f8b8(%rip), %rsi     # 0x134443
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
jmp 0xa4cfb
xorl %r14d, %r14d
testq %rcx, %rcx
cmovgq %rcx, %r14
addq %rax, %r14
cmpq %r15, %r14
cmovgeq %r15, %r14
leaq 0x40(%rsp), %rdx
movq %rax, 0x8(%rdx)
movq %rax, (%rdx)
movq %r14, 0x10(%rdx)
movq %r13, 0x18(%rsp)
movq %rax, 0x60(%rsp)
movq %rax, 0x58(%rsp)
movq %r14, 0x68(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x1, %ecx
callq 0xab536
testl %eax, %eax
je 0xa4cfb
movq 0x50(%rsp), %rbp
cmpq %rbp, %r14
jle 0xa4c0a
leaq 0x8f863(%rip), %rsi     # 0x13445e
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9b27
jmp 0xa4cfb
movq 0x40(%rsp), %r12
cmpq %rbp, %r12
jge 0xa4cfb
leaq 0x8f85c(%rip), %rsi     # 0x13447b
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movq (%rsp), %rax
movl 0x4(%rax), %edx
movq %r12, %rsi
callq 0xef614
movq %rax, %r14
leaq 0x4(%r12), %rax
movq %rax, 0x40(%rsp)
leaq 0x8f838(%rip), %rsi     # 0x134498
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
addq %r14, %r12
addq $0x4, %r12
cmpq %r12, %rbp
jge 0xa4c92
leaq 0x8f839(%rip), %rsi     # 0x1344c6
jmp 0xa4bfb
movq %r12, 0x40(%rsp)
jle 0xa4cfb
leaq 0x8f84f(%rip), %rsi     # 0x1344ef
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movl %ebp, %edx
subl %r12d, %edx
leaq 0x8f83d(%rip), %rsi     # 0x134503
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9226
leaq 0x58(%rsp), %rdx
movq %r12, 0x8(%rdx)
movq %r12, (%rdx)
movq %rbp, 0x10(%rdx)
movq %rbx, %rdi
movq (%rsp), %rsi
xorl %ecx, %ecx
callq 0xa9600
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movl 0x3c(%rsp), %esi
movq %rbx, %rdi
callq 0xe9595
cmpq %r15, %r13
movq (%rsp), %rbp
movq 0x8(%rsp), %rsi
jg 0xa4665
movq 0x20(%rsp), %rax
movq %r15, %r13
subq %rax, %r13
jle 0xa4d38
movq 0x18(%rsp), %rcx
cmpq %r15, %rcx
jg 0xa4d3b
subq %rax, %rcx
movq %rcx, %r13
jmp 0xa4d3b
xorl %r13d, %r13d
movq 0x8(%rsp), %rsi
addq (%rsi), %r13
movq %r13, (%rsi)
movq 0x10(%rsi), %r14
movq %r13, 0x20(%rsp)
movq %r13, 0x18(%rsp)
movq %r14, 0x28(%rsp)
xorl %ecx, %ecx
movq %r14, %rax
subq %r13, %rax
cmovgq %rax, %rcx
cmpq $0x2, %rcx
jl 0xa4665
leaq 0x8f7ba(%rip), %rsi     # 0x134530
movq %rbx, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%rbx), %rdi
movl 0x4(%rbp), %edx
movq %r13, %rsi
callq 0xef570
movq %rax, %r12
addq $0x2, %r13
movq %r13, 0x18(%rsp)
movq %rbx, %rdi
movq %rax, %rsi
callq 0xac236
cmpl $0x2, 0x8c(%rbx)
je 0xa4f9e
movq 0x50(%rbp), %rax
movq 0x48(%rbp), %rcx
movq %rcx, 0x38(%rax)
movups 0x38(%rbp), %xmm0
movups %xmm0, 0x28(%rax)
cmpq $0x1, %r12
je 0xa4e01
testq %r12, %r12
jne 0xa4e8c
movq 0x50(%rbp), %rdx
movq 0x18(%rbx), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %r8
callq 0xac264
jmp 0xa4f9e
movq 0x50(%rbp), %r15
movl 0x8(%r15), %ecx
imull 0x18(%r15), %ecx
imull 0x18(%rbp), %ecx
leaq 0x8f7d4(%rip), %rsi     # 0x1345ed
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0xe9226
movq 0x8(%r15), %rax
movq %r15, 0x10(%rsp)
imulq 0x18(%r15), %rax
testq %rax, %rax
jle 0xa4ea5
xorl %r15d, %r15d
movq %r13, %r12
xorl %ebp, %ebp
movq (%rsp), %rax
cmpq $0x4, 0x18(%rax)
movq 0x18(%rbx), %rdi
movl 0x4(%rax), %edx
movq %r12, %rsi
jne 0xa4e64
callq 0xef614
movl $0x4, %ecx
jmp 0xa4e6e
callq 0xef570
movl $0x2, %ecx
addq %rax, %rbp
addq %rcx, %r12
incq %r15
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rax
imulq 0x18(%rcx), %rax
cmpq %rax, %r15
jl 0xa4e43
jmp 0xa4ea8
leaq 0x8f6c7(%rip), %rsi     # 0x13455a
movq %rbx, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0xe9df7
jmp 0xa4f9e
movq %r13, %r12
leaq 0x8114c(%rip), %rsi     # 0x125ffb
movq %rbx, %rdi
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0xe9226
leaq (%r12,%rbp), %rcx
movq 0x18(%rbx), %rax
cmpq 0x18(%rax), %rcx
jle 0xa4eea
leaq 0x6de30(%rip), %rsi     # 0x112d04
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xe9df7
movq (%rsp), %rbp
jmp 0xa4f77
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
xorl %edx, %edx
movq %rcx, 0x30(%rsp)
callq 0xf0faf
movq %rax, %r15
movq %rax, %rdi
callq 0xf0e3f
movq 0x18(%rbx), %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0xfad1a
movq %r15, %rdi
callq 0xf0ea4
movq %rbx, %rdi
movl $0x1, %esi
callq 0xe9585
movq 0x18(%r15), %rcx
leaq 0x6dd4a(%rip), %rsi     # 0x112c88
movq %rbx, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0xe9226
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq %rbx, %rdi
movq (%rsp), %rbp
movq %rbp, %rsi
movq 0x10(%rsp), %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0xac264
movq 0x30(%rsp), %r12
movq %r15, %rdi
callq 0xf0b13
movq %r14, %rax
subq %r13, %rax
jle 0xa4f94
cmpq %r14, %r12
jg 0xa4f96
subq %r13, %r12
movq %r12, %rax
jmp 0xa4f96
xorl %eax, %eax
addq %r13, %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe9585
movq 0x8(%rsp), %rsi
jmp 0xa4665