// File: rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::to_function_args[abi:cxx11](unsigned int, spirv_cross::SPIRType const&, bool, bool, bool, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, bool*)
string CompilerGLSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool is_fetch, bool is_gather,
                                      bool is_proj, uint32_t coord, uint32_t coord_components, uint32_t dref,
                                      uint32_t grad_x, uint32_t grad_y, uint32_t lod, uint32_t coffset, uint32_t offset,
                                      uint32_t bias, uint32_t comp, uint32_t sample, bool *p_forward)
{
	string farg_str;
	if (is_fetch)
		farg_str = convert_separate_image_to_expression(img);
	else
		farg_str = to_expression(img);

	bool swizz_func = backend.swizzle_is_function;
	auto swizzle = [swizz_func](uint32_t comps, uint32_t in_comps) -> const char * {
		if (comps == in_comps)
			return "";

		switch (comps)
		{
		case 1:
			return ".x";
		case 2:
			return swizz_func ? ".xy()" : ".xy";
		case 3:
			return swizz_func ? ".xyz()" : ".xyz";
		default:
			return "";
		}
	};

	bool forward = should_forward(coord);

	// The IR can give us more components than we need, so chop them off as needed.
	auto swizzle_expr = swizzle(coord_components, expression_type(coord).vecsize);
	// Only enclose the UV expression if needed.
	auto coord_expr = (*swizzle_expr == '\0') ? to_expression(coord) : (to_enclosed_expression(coord) + swizzle_expr);

	// texelFetch only takes int, not uint.
	auto &coord_type = expression_type(coord);
	if (coord_type.basetype == SPIRType::UInt)
	{
		auto expected_type = coord_type;
		expected_type.basetype = SPIRType::Int;
		coord_expr = bitcast_expression(expected_type, coord_type.basetype, coord_expr);
	}

	// textureLod on sampler2DArrayShadow and samplerCubeShadow does not exist in GLSL for some reason.
	// To emulate this, we will have to use textureGrad with a constant gradient of 0.
	// The workaround will assert that the LOD is in fact constant 0, or we cannot emit correct code.
	// This happens for HLSL SampleCmpLevelZero on Texture2DArray and TextureCube.
	bool workaround_lod_array_shadow_as_grad =
	    ((imgtype.image.arrayed && imgtype.image.dim == Dim2D) || imgtype.image.dim == DimCube) &&
	    image_is_comparison(imgtype, img) && lod;

	if (dref)
	{
		forward = forward && should_forward(dref);

		// SPIR-V splits dref and coordinate.
		if (is_gather || coord_components == 4) // GLSL also splits the arguments in two. Same for textureGather.
		{
			farg_str += ", ";
			farg_str += to_expression(coord);
			farg_str += ", ";
			farg_str += to_expression(dref);
		}
		else if (is_proj)
		{
			// Have to reshuffle so we get vec4(coord, dref, proj), special case.
			// Other shading languages splits up the arguments for coord and compare value like SPIR-V.
			// The coordinate type for textureProj shadow is always vec4 even for sampler1DShadow.
			farg_str += ", vec4(";

			if (imgtype.image.dim == Dim1D)
			{
				// Could reuse coord_expr, but we will mess up the temporary usage checking.
				farg_str += to_enclosed_expression(coord) + ".x";
				farg_str += ", ";
				farg_str += "0.0, ";
				farg_str += to_expression(dref);
				farg_str += ", ";
				farg_str += to_enclosed_expression(coord) + ".y)";
			}
			else if (imgtype.image.dim == Dim2D)
			{
				// Could reuse coord_expr, but we will mess up the temporary usage checking.
				farg_str += to_enclosed_expression(coord) + (swizz_func ? ".xy()" : ".xy");
				farg_str += ", ";
				farg_str += to_expression(dref);
				farg_str += ", ";
				farg_str += to_enclosed_expression(coord) + ".z)";
			}
			else
				SPIRV_CROSS_THROW("Invalid type for textureProj with shadow.");
		}
		else
		{
			// Create a composite which merges coord/dref into a single vector.
			auto type = expression_type(coord);
			type.vecsize = coord_components + 1;
			farg_str += ", ";
			farg_str += type_to_glsl_constructor(type);
			farg_str += "(";
			farg_str += coord_expr;
			farg_str += ", ";
			farg_str += to_expression(dref);
			farg_str += ")";
		}
	}
	else
	{
		farg_str += ", ";
		farg_str += coord_expr;
	}

	if (grad_x || grad_y)
	{
		forward = forward && should_forward(grad_x);
		forward = forward && should_forward(grad_y);
		farg_str += ", ";
		farg_str += to_expression(grad_x);
		farg_str += ", ";
		farg_str += to_expression(grad_y);
	}

	if (lod)
	{
		if (workaround_lod_array_shadow_as_grad)
		{
			// Implement textureGrad() instead. LOD == 0.0 is implemented as gradient of 0.0.
			// Implementing this as plain texture() is not safe on some implementations.
			if (imgtype.image.dim == Dim2D)
				farg_str += ", vec2(0.0), vec2(0.0)";
			else if (imgtype.image.dim == DimCube)
				farg_str += ", vec3(0.0), vec3(0.0)";
		}
		else
		{
			if (check_explicit_lod_allowed(lod))
			{
				forward = forward && should_forward(lod);
				farg_str += ", ";
				farg_str += to_expression(lod);
			}
		}
	}
	else if (is_fetch && imgtype.image.dim != DimBuffer && !imgtype.image.ms)
	{
		// Lod argument is optional in OpImageFetch, but we require a LOD value, pick 0 as the default.
		farg_str += ", 0";
	}

	if (coffset)
	{
		forward = forward && should_forward(coffset);
		farg_str += ", ";
		farg_str += to_expression(coffset);
	}
	else if (offset)
	{
		forward = forward && should_forward(offset);
		farg_str += ", ";
		farg_str += to_expression(offset);
	}

	if (bias)
	{
		forward = forward && should_forward(bias);
		farg_str += ", ";
		farg_str += to_expression(bias);
	}

	if (comp)
	{
		forward = forward && should_forward(comp);
		farg_str += ", ";
		farg_str += to_expression(comp);
	}

	if (sample)
	{
		farg_str += ", ";
		farg_str += to_expression(sample);
	}

	*p_forward = forward;

	return farg_str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x610, %rsp            # imm = 0x610
movl %r9d, -0x5bc(%rbp)
movl %r8d, %eax
movq %rcx, %r8
movl -0x5bc(%rbp), %ecx
movq %r8, -0x5b8(%rbp)
movl %edx, %r8d
movq %rsi, %r9
movq -0x5b8(%rbp), %rsi
movq %rdi, -0x5b0(%rbp)
movb %al, %dl
movq %rdi, %rax
movq %rax, -0x5a8(%rbp)
movq 0x70(%rbp), %rax
movl 0x68(%rbp), %eax
movl 0x60(%rbp), %eax
movl 0x58(%rbp), %eax
movl 0x50(%rbp), %eax
movl 0x48(%rbp), %eax
movl 0x40(%rbp), %eax
movl 0x38(%rbp), %eax
movl 0x30(%rbp), %eax
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movb 0x10(%rbp), %al
movq %rdi, -0x8(%rbp)
movq %r9, -0x10(%rbp)
movl %r8d, -0x14(%rbp)
movq %rsi, -0x20(%rbp)
andb $0x1, %dl
movb %dl, -0x21(%rbp)
andb $0x1, %cl
movb %cl, -0x22(%rbp)
andb $0x1, %al
movb %al, -0x23(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x5a0(%rbp)
movb $0x0, -0x24(%rbp)
callq 0x7530
testb $0x1, -0x21(%rbp)
je 0x7ce59
movq -0x5a0(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq -0x48(%rbp), %rdi
callq 0x7ca40
jmp 0x7ce2d
movq -0x5b0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x7430
leaq -0x48(%rbp), %rdi
callq 0x7708
jmp 0x7ce87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7defd
movq -0x5a0(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq -0x78(%rbp), %rdi
callq 0x71b50
jmp 0x7ce6e
movq -0x5b0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x7430
leaq -0x78(%rbp), %rdi
callq 0x7708
movq -0x5a0(%rbp), %rdi
movb 0x620(%rdi), %al
andb $0x1, %al
movb %al, -0x79(%rbp)
movb -0x79(%rbp), %al
andb $0x1, %al
movb %al, -0x7a(%rbp)
movl 0x18(%rbp), %esi
callq 0x78810
movb %al, -0x5bd(%rbp)
jmp 0x7ceb1
movq -0x5a0(%rbp), %rdi
movb -0x5bd(%rbp), %al
andb $0x1, %al
movb %al, -0x7b(%rbp)
movl 0x20(%rbp), %eax
movl %eax, -0x5cc(%rbp)
movl 0x18(%rbp), %esi
callq 0x1f760
movq %rax, -0x5c8(%rbp)
jmp 0x7cedd
movl -0x5cc(%rbp), %esi
movq -0x5c8(%rbp), %rax
movl 0x14(%rax), %edx
leaq -0x7a(%rbp), %rdi
callq 0x7df20
movq %rax, -0x5d8(%rbp)
jmp 0x7ceff
movq -0x5d8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movsbl (%rax), %eax
movb $0x0, -0xc9(%rbp)
cmpl $0x0, %eax
jne 0x7cf3d
movq -0x5a0(%rbp), %rsi
movl 0x18(%rbp), %edx
leaq -0xa8(%rbp), %rdi
callq 0x71b50
jmp 0x7cf3b
jmp 0x7cf7a
movq -0x5a0(%rbp), %rsi
movl 0x18(%rbp), %edx
leaq -0xc8(%rbp), %rdi
callq 0x72630
jmp 0x7cf55
movb $0x1, -0xc9(%rbp)
movq -0x88(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x11910
jmp 0x7cf78
jmp 0x7cf7a
testb $0x1, -0xc9(%rbp)
jne 0x7cf85
jmp 0x7cf91
leaq -0xc8(%rbp), %rdi
callq 0x7708
movq -0x5a0(%rbp), %rdi
movl 0x18(%rbp), %esi
callq 0x1f760
movq %rax, -0x5e0(%rbp)
jmp 0x7cfa9
movq -0x5e0(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
cmpl $0x5, 0xc(%rax)
jne 0x7d097
movq -0xd8(%rbp), %rsi
leaq -0x1b0(%rbp), %rdi
callq 0x3d730
jmp 0x7cfdd
movq -0x5a0(%rbp), %rsi
movl $0x4, -0x1a4(%rbp)
movq -0xd8(%rbp), %rax
movl 0xc(%rax), %ecx
leaq -0x1d0(%rbp), %rdi
leaq -0x1b0(%rbp), %rdx
leaq -0xa8(%rbp), %r8
callq 0x7dfd0
jmp 0x7d014
leaq -0xa8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x7430
leaq -0x1d0(%rbp), %rdi
callq 0x7708
leaq -0x1b0(%rbp), %rdi
callq 0x314e0
jmp 0x7d097
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
testb $0x1, -0xc9(%rbp)
jne 0x7d058
jmp 0x7d064
leaq -0xc8(%rbp), %rdi
callq 0x7708
jmp 0x7defd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7ded3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x314e0
jmp 0x7ded3
movq -0x20(%rbp), %rax
testb $0x1, 0x89(%rax)
je 0x7d0b1
movq -0x20(%rbp), %rax
cmpl $0x1, 0x84(%rax)
je 0x7d0c6
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpl $0x3, 0x84(%rcx)
movb %al, -0x5e1(%rbp)
jne 0x7d103
movq -0x5a0(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x2c890
movb %al, -0x5e2(%rbp)
jmp 0x7d0e1
movb -0x5e2(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x5e1(%rbp)
jne 0x7d0f6
jmp 0x7d103
cmpl $0x0, 0x40(%rbp)
setne %al
movb %al, -0x5e1(%rbp)
movb -0x5e1(%rbp), %al
andb $0x1, %al
movb %al, -0x1d1(%rbp)
cmpl $0x0, 0x28(%rbp)
je 0x7d866
xorl %eax, %eax
testb $0x1, -0x7b(%rbp)
movb %al, -0x5e3(%rbp)
je 0x7d14e
movq -0x5a0(%rbp), %rdi
movl 0x28(%rbp), %esi
callq 0x78810
movb %al, -0x5e4(%rbp)
jmp 0x7d140
movb -0x5e4(%rbp), %al
movb %al, -0x5e3(%rbp)
jmp 0x7d14e
movb -0x5e3(%rbp), %al
andb $0x1, %al
movb %al, -0x7b(%rbp)
testb $0x1, -0x22(%rbp)
jne 0x7d169
cmpl $0x4, 0x20(%rbp)
jne 0x7d244
movq -0x5b0(%rbp), %rdi
leaq 0xc7418(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d17e
movq -0x5a0(%rbp), %rsi
movl 0x18(%rbp), %edx
leaq -0x1f8(%rbp), %rdi
callq 0x71b50
jmp 0x7d196
movq -0x5b0(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x7470
jmp 0x7d1ab
leaq -0x1f8(%rbp), %rdi
callq 0x7708
movq -0x5b0(%rbp), %rdi
leaq 0xc73ca(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d1cc
movq -0x5a0(%rbp), %rsi
movl 0x28(%rbp), %edx
leaq -0x218(%rbp), %rdi
callq 0x71b50
jmp 0x7d1e4
movq -0x5b0(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x7470
jmp 0x7d1f9
leaq -0x218(%rbp), %rdi
callq 0x7708
jmp 0x7d864
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
testb $0x1, -0x23(%rbp)
je 0x7d6ec
movq -0x5b0(%rbp), %rdi
leaq 0xc58c5(%rip), %rsi     # 0x142b21
callq 0x7340
jmp 0x7d263
movq -0x20(%rbp), %rax
cmpl $0x0, 0x84(%rax)
jne 0x7d43e
movq -0x5a0(%rbp), %rsi
movl 0x18(%rbp), %edx
leaq -0x258(%rbp), %rdi
callq 0x72630
jmp 0x7d28c
leaq 0xc6fcd(%rip), %rdx     # 0x144260
leaq -0x238(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x11910
jmp 0x7d2a8
movq -0x5b0(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x7470
jmp 0x7d2bd
leaq -0x238(%rbp), %rdi
callq 0x7708
leaq -0x258(%rbp), %rdi
callq 0x7708
movq -0x5b0(%rbp), %rdi
leaq 0xc72ac(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d2ea
movq -0x5b0(%rbp), %rdi
leaq 0xc5831(%rip), %rsi     # 0x142b29
callq 0x7340
jmp 0x7d2ff
movq -0x5a0(%rbp), %rsi
movl 0x28(%rbp), %edx
leaq -0x278(%rbp), %rdi
callq 0x71b50
jmp 0x7d317
movq -0x5b0(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x7470
jmp 0x7d32c
leaq -0x278(%rbp), %rdi
callq 0x7708
movq -0x5b0(%rbp), %rdi
leaq 0xc7249(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d34d
movq -0x5a0(%rbp), %rsi
movl 0x18(%rbp), %edx
leaq -0x2b8(%rbp), %rdi
callq 0x72630
jmp 0x7d365
leaq 0xc57c3(%rip), %rdx     # 0x142b2f
leaq -0x298(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x11910
jmp 0x7d381
movq -0x5b0(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x7470
jmp 0x7d396
leaq -0x298(%rbp), %rdi
callq 0x7708
leaq -0x2b8(%rbp), %rdi
callq 0x7708
jmp 0x7d6e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7d3d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x7708
leaq -0x258(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7d42d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x7708
leaq -0x2b8(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
movq -0x20(%rbp), %rax
cmpl $0x1, 0x84(%rax)
jne 0x7d615
movq -0x5a0(%rbp), %rsi
movl 0x18(%rbp), %edx
leaq -0x2f8(%rbp), %rdi
callq 0x72630
jmp 0x7d467
movb -0x79(%rbp), %cl
leaq 0xc56c2(%rip), %rax     # 0x142b33
leaq 0xc56c1(%rip), %rdx     # 0x142b39
testb $0x1, %cl
cmovneq %rax, %rdx
leaq -0x2d8(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x11910
jmp 0x7d494
movq -0x5b0(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x7470
jmp 0x7d4a9
leaq -0x2d8(%rbp), %rdi
callq 0x7708
leaq -0x2f8(%rbp), %rdi
callq 0x7708
movq -0x5b0(%rbp), %rdi
leaq 0xc70c0(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d4d6
movq -0x5a0(%rbp), %rsi
movl 0x28(%rbp), %edx
leaq -0x318(%rbp), %rdi
callq 0x71b50
jmp 0x7d4ee
movq -0x5b0(%rbp), %rdi
leaq -0x318(%rbp), %rsi
callq 0x7470
jmp 0x7d503
leaq -0x318(%rbp), %rdi
callq 0x7708
movq -0x5b0(%rbp), %rdi
leaq 0xc7072(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d524
movq -0x5a0(%rbp), %rsi
movl 0x18(%rbp), %edx
leaq -0x358(%rbp), %rdi
callq 0x72630
jmp 0x7d53c
leaq 0xc55fa(%rip), %rdx     # 0x142b3d
leaq -0x338(%rbp), %rdi
leaq -0x358(%rbp), %rsi
callq 0x11910
jmp 0x7d558
movq -0x5b0(%rbp), %rdi
leaq -0x338(%rbp), %rsi
callq 0x7470
jmp 0x7d56d
leaq -0x338(%rbp), %rdi
callq 0x7708
leaq -0x358(%rbp), %rdi
callq 0x7708
jmp 0x7d6e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7d5b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x7708
leaq -0x2f8(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x318(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7d604
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x338(%rbp), %rdi
callq 0x7708
leaq -0x358(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
movb $0x1, -0x37a(%rbp)
movl $0x10, %edi
callq 0x71a0
movq %rax, -0x5f8(%rbp)
leaq -0x379(%rbp), %rdi
movq %rdi, -0x5f0(%rbp)
callq 0x7650
movq -0x5f0(%rbp), %rdx
leaq 0xc54f3(%rip), %rsi     # 0x142b41
leaq -0x378(%rbp), %rdi
callq 0x7520
jmp 0x7d65c
movq -0x5f8(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0x9c50
jmp 0x7d671
movq -0x5f8(%rbp), %rdi
movb $0x0, -0x37a(%rbp)
leaq 0x130752(%rip), %rsi    # 0x1addd8
leaq -0x739fd(%rip), %rdx    # 0x9c90
callq 0x7610
jmp 0x7df12
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7d6bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x378(%rbp), %rdi
callq 0x7708
leaq -0x379(%rbp), %rdi
callq 0x73d0
testb $0x1, -0x37a(%rbp)
jne 0x7d6d4
jmp 0x7d6e0
movq -0x5f8(%rbp), %rdi
callq 0x72c0
jmp 0x7ded3
jmp 0x7d6e7
jmp 0x7d862
movq -0x5a0(%rbp), %rdi
movl 0x18(%rbp), %esi
callq 0x1f760
movq %rax, -0x600(%rbp)
jmp 0x7d704
movq -0x600(%rbp), %rsi
leaq -0x458(%rbp), %rdi
callq 0x3d730
jmp 0x7d719
movq -0x5b0(%rbp), %rdi
movl 0x20(%rbp), %eax
incl %eax
movl %eax, -0x444(%rbp)
leaq 0xc6e5d(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d739
movq -0x5a0(%rbp), %rsi
leaq -0x478(%rbp), %rdi
leaq -0x458(%rbp), %rdx
callq 0x72bf0
jmp 0x7d755
movq -0x5b0(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x7470
jmp 0x7d76a
leaq -0x478(%rbp), %rdi
callq 0x7708
movq -0x5b0(%rbp), %rdi
leaq 0xcfba9(%rip), %rsi     # 0x14d32d
callq 0x7340
jmp 0x7d78b
movq -0x5b0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x7470
jmp 0x7d7a0
movq -0x5b0(%rbp), %rdi
leaq 0xc6de1(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d7b5
movq -0x5a0(%rbp), %rsi
movl 0x28(%rbp), %edx
leaq -0x498(%rbp), %rdi
callq 0x71b50
jmp 0x7d7cd
movq -0x5b0(%rbp), %rdi
leaq -0x498(%rbp), %rsi
callq 0x7470
jmp 0x7d7e2
leaq -0x498(%rbp), %rdi
callq 0x7708
movq -0x5b0(%rbp), %rdi
leaq 0xc76fd(%rip), %rsi     # 0x144ef9
callq 0x7340
jmp 0x7d803
leaq -0x458(%rbp), %rdi
callq 0x314e0
jmp 0x7d862
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7d851
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x478(%rbp), %rdi
callq 0x7708
jmp 0x7d851
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x498(%rbp), %rdi
callq 0x7708
leaq -0x458(%rbp), %rdi
callq 0x314e0
jmp 0x7ded3
jmp 0x7d864
jmp 0x7d892
movq -0x5b0(%rbp), %rdi
leaq 0xc6d1b(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d87b
movq -0x5b0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x7470
jmp 0x7d890
jmp 0x7d892
cmpl $0x0, 0x30(%rbp)
jne 0x7d8a2
cmpl $0x0, 0x38(%rbp)
je 0x7d9f6
xorl %eax, %eax
testb $0x1, -0x7b(%rbp)
movb %al, -0x601(%rbp)
je 0x7d8d5
movq -0x5a0(%rbp), %rdi
movl 0x30(%rbp), %esi
callq 0x78810
movb %al, -0x602(%rbp)
jmp 0x7d8c7
movb -0x602(%rbp), %al
movb %al, -0x601(%rbp)
jmp 0x7d8d5
movb -0x601(%rbp), %al
andb $0x1, %al
movb %al, -0x7b(%rbp)
xorl %eax, %eax
testb $0x1, -0x7b(%rbp)
movb %al, -0x603(%rbp)
je 0x7d913
movq -0x5a0(%rbp), %rdi
movl 0x38(%rbp), %esi
callq 0x78810
movb %al, -0x604(%rbp)
jmp 0x7d905
movb -0x604(%rbp), %al
movb %al, -0x603(%rbp)
jmp 0x7d913
movq -0x5b0(%rbp), %rdi
movb -0x603(%rbp), %al
andb $0x1, %al
movb %al, -0x7b(%rbp)
leaq 0xc6c63(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d933
movq -0x5a0(%rbp), %rsi
movl 0x30(%rbp), %edx
leaq -0x4b8(%rbp), %rdi
callq 0x71b50
jmp 0x7d94b
movq -0x5b0(%rbp), %rdi
leaq -0x4b8(%rbp), %rsi
callq 0x7470
jmp 0x7d960
leaq -0x4b8(%rbp), %rdi
callq 0x7708
movq -0x5b0(%rbp), %rdi
leaq 0xc6c15(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7d981
movq -0x5a0(%rbp), %rsi
movl 0x38(%rbp), %edx
leaq -0x4d8(%rbp), %rdi
callq 0x71b50
jmp 0x7d999
movq -0x5b0(%rbp), %rdi
leaq -0x4d8(%rbp), %rsi
callq 0x7470
jmp 0x7d9ae
leaq -0x4d8(%rbp), %rdi
callq 0x7708
jmp 0x7d9f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x4b8(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x4d8(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
cmpl $0x0, 0x40(%rbp)
je 0x7db2d
testb $0x1, -0x1d1(%rbp)
je 0x7da58
movq -0x20(%rbp), %rax
cmpl $0x1, 0x84(%rax)
jne 0x7da2d
movq -0x5b0(%rbp), %rdi
leaq 0xc5147(%rip), %rsi     # 0x142b6b
callq 0x7340
jmp 0x7da2b
jmp 0x7da53
movq -0x20(%rbp), %rax
cmpl $0x3, 0x84(%rax)
jne 0x7da51
movq -0x5b0(%rbp), %rdi
leaq 0xc513a(%rip), %rsi     # 0x142b82
callq 0x7340
jmp 0x7da4f
jmp 0x7da51
jmp 0x7da53
jmp 0x7db2b
movq -0x5a0(%rbp), %rdi
movl 0x40(%rbp), %esi
callq 0x79db0
movb %al, -0x605(%rbp)
jmp 0x7da6f
movb -0x605(%rbp), %al
testb $0x1, %al
jne 0x7da7e
jmp 0x7db29
xorl %eax, %eax
testb $0x1, -0x7b(%rbp)
movb %al, -0x606(%rbp)
je 0x7dab1
movq -0x5a0(%rbp), %rdi
movl 0x40(%rbp), %esi
callq 0x78810
movb %al, -0x607(%rbp)
jmp 0x7daa3
movb -0x607(%rbp), %al
movb %al, -0x606(%rbp)
jmp 0x7dab1
movq -0x5b0(%rbp), %rdi
movb -0x606(%rbp), %al
andb $0x1, %al
movb %al, -0x7b(%rbp)
leaq 0xc6ac5(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7dad1
movq -0x5a0(%rbp), %rsi
movl 0x40(%rbp), %edx
leaq -0x4f8(%rbp), %rdi
callq 0x71b50
jmp 0x7dae9
movq -0x5b0(%rbp), %rdi
leaq -0x4f8(%rbp), %rsi
callq 0x7470
jmp 0x7dafe
leaq -0x4f8(%rbp), %rdi
callq 0x7708
jmp 0x7db29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x4f8(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
jmp 0x7db2b
jmp 0x7db66
testb $0x1, -0x21(%rbp)
je 0x7db64
movq -0x20(%rbp), %rax
cmpl $0x5, 0x84(%rax)
je 0x7db64
movq -0x20(%rbp), %rax
testb $0x1, 0x8a(%rax)
jne 0x7db64
movq -0x5b0(%rbp), %rdi
leaq 0xcf632(%rip), %rsi     # 0x14d18d
callq 0x7340
jmp 0x7db62
jmp 0x7db64
jmp 0x7db66
cmpl $0x0, 0x48(%rbp)
je 0x7dc1e
xorl %eax, %eax
testb $0x1, -0x7b(%rbp)
movb %al, -0x608(%rbp)
je 0x7dba3
movq -0x5a0(%rbp), %rdi
movl 0x48(%rbp), %esi
callq 0x78810
movb %al, -0x609(%rbp)
jmp 0x7db95
movb -0x609(%rbp), %al
movb %al, -0x608(%rbp)
jmp 0x7dba3
movq -0x5b0(%rbp), %rdi
movb -0x608(%rbp), %al
andb $0x1, %al
movb %al, -0x7b(%rbp)
leaq 0xc69d3(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7dbc3
movq -0x5a0(%rbp), %rsi
movl 0x48(%rbp), %edx
leaq -0x518(%rbp), %rdi
callq 0x71b50
jmp 0x7dbdb
movq -0x5b0(%rbp), %rdi
leaq -0x518(%rbp), %rsi
callq 0x7470
jmp 0x7dbf0
leaq -0x518(%rbp), %rdi
callq 0x7708
jmp 0x7dcd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x518(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
cmpl $0x0, 0x50(%rbp)
je 0x7dcd3
xorl %eax, %eax
testb $0x1, -0x7b(%rbp)
movb %al, -0x60a(%rbp)
je 0x7dc5b
movq -0x5a0(%rbp), %rdi
movl 0x50(%rbp), %esi
callq 0x78810
movb %al, -0x60b(%rbp)
jmp 0x7dc4d
movb -0x60b(%rbp), %al
movb %al, -0x60a(%rbp)
jmp 0x7dc5b
movq -0x5b0(%rbp), %rdi
movb -0x60a(%rbp), %al
andb $0x1, %al
movb %al, -0x7b(%rbp)
leaq 0xc691b(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7dc7b
movq -0x5a0(%rbp), %rsi
movl 0x50(%rbp), %edx
leaq -0x538(%rbp), %rdi
callq 0x71b50
jmp 0x7dc93
movq -0x5b0(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x7470
jmp 0x7dca8
leaq -0x538(%rbp), %rdi
callq 0x7708
jmp 0x7dcd3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x538(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
jmp 0x7dcd5
cmpl $0x0, 0x58(%rbp)
je 0x7dd8a
xorl %eax, %eax
testb $0x1, -0x7b(%rbp)
movb %al, -0x60c(%rbp)
je 0x7dd12
movq -0x5a0(%rbp), %rdi
movl 0x58(%rbp), %esi
callq 0x78810
movb %al, -0x60d(%rbp)
jmp 0x7dd04
movb -0x60d(%rbp), %al
movb %al, -0x60c(%rbp)
jmp 0x7dd12
movq -0x5b0(%rbp), %rdi
movb -0x60c(%rbp), %al
andb $0x1, %al
movb %al, -0x7b(%rbp)
leaq 0xc6864(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7dd32
movq -0x5a0(%rbp), %rsi
movl 0x58(%rbp), %edx
leaq -0x558(%rbp), %rdi
callq 0x71b50
jmp 0x7dd4a
movq -0x5b0(%rbp), %rdi
leaq -0x558(%rbp), %rsi
callq 0x7470
jmp 0x7dd5f
leaq -0x558(%rbp), %rdi
callq 0x7708
jmp 0x7dd8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x558(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
cmpl $0x0, 0x60(%rbp)
je 0x7de3f
xorl %eax, %eax
testb $0x1, -0x7b(%rbp)
movb %al, -0x60e(%rbp)
je 0x7ddc7
movq -0x5a0(%rbp), %rdi
movl 0x60(%rbp), %esi
callq 0x78810
movb %al, -0x60f(%rbp)
jmp 0x7ddb9
movb -0x60f(%rbp), %al
movb %al, -0x60e(%rbp)
jmp 0x7ddc7
movq -0x5b0(%rbp), %rdi
movb -0x60e(%rbp), %al
andb $0x1, %al
movb %al, -0x7b(%rbp)
leaq 0xc67af(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7dde7
movq -0x5a0(%rbp), %rsi
movl 0x60(%rbp), %edx
leaq -0x578(%rbp), %rdi
callq 0x71b50
jmp 0x7ddff
movq -0x5b0(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x7470
jmp 0x7de14
leaq -0x578(%rbp), %rdi
callq 0x7708
jmp 0x7de3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x578(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
cmpl $0x0, 0x68(%rbp)
je 0x7deaf
movq -0x5b0(%rbp), %rdi
leaq 0xc673c(%rip), %rsi     # 0x14458f
callq 0x7340
jmp 0x7de5a
movq -0x5a0(%rbp), %rsi
movl 0x68(%rbp), %edx
leaq -0x598(%rbp), %rdi
callq 0x71b50
jmp 0x7de72
movq -0x5b0(%rbp), %rdi
leaq -0x598(%rbp), %rsi
callq 0x7470
jmp 0x7de87
leaq -0x598(%rbp), %rdi
callq 0x7708
jmp 0x7deaf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x598(%rbp), %rdi
callq 0x7708
jmp 0x7ded3
movb -0x7b(%rbp), %cl
movq 0x70(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movb $0x1, -0x24(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x7708
testb $0x1, -0x24(%rbp)
jne 0x7deed
jmp 0x7dee1
leaq -0xa8(%rbp), %rdi
callq 0x7708
jmp 0x7defd
movq -0x5b0(%rbp), %rdi
callq 0x7708
movq -0x5a8(%rbp), %rax
addq $0x610, %rsp            # imm = 0x610
popq %rbp
retq
movq -0x5b0(%rbp), %rdi
callq 0x7708
movq -0x50(%rbp), %rdi
callq 0x7640
nopw %cs:(%rax,%rax)