// File: rossy[P]crossc/SPIRV-Cross/spirv_msl.cpp
// Function: spirv_cross::CompilerMSL::image_type_glsl[abi:cxx11](spirv_cross::SPIRType const&, unsigned int)
string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id)
{
	auto *var = maybe_get<SPIRVariable>(id);
	if (var && var->basevariable)
	{
		// For comparison images, check against the base variable,
		// and not the fake ID which might have been generated for this variable.
		id = var->basevariable;
	}

	if (!type.array.empty())
	{
		uint32_t major = 2, minor = 0;
		if (msl_options.is_ios())
		{
			major = 1;
			minor = 2;
		}
		if (!msl_options.supports_msl_version(major, minor))
		{
			if (msl_options.is_ios())
				SPIRV_CROSS_THROW("MSL 1.2 or greater is required for arrays of textures.");
			else
				SPIRV_CROSS_THROW("MSL 2.0 or greater is required for arrays of textures.");
		}

		if (type.array.size() > 1)
			SPIRV_CROSS_THROW("Arrays of arrays of textures are not supported in MSL.");

		// Arrays of images in MSL must be declared with a special array<T, N> syntax ala C++11 std::array.
		uint32_t array_size =
		    type.array_size_literal.back() ? type.array.back() : get<SPIRConstant>(type.array.back()).scalar();
		if (array_size == 0)
			SPIRV_CROSS_THROW("Unsized array of images is not supported in MSL.");

		auto &parent = get<SPIRType>(get_non_pointer_type(type).parent_type);
		return join("array<", image_type_glsl(parent, id), ", ", array_size, ">");
	}

	string img_type_name;

	// Bypass pointers because we need the real image struct
	auto &img_type = get<SPIRType>(type.self).image;
	if (image_is_comparison(type, id))
	{
		switch (img_type.dim)
		{
		case Dim1D:
			img_type_name += "depth1d_unsupported_by_metal";
			break;
		case Dim2D:
			if (img_type.ms && img_type.arrayed)
			{
				if (!msl_options.supports_msl_version(2, 1))
					SPIRV_CROSS_THROW("Multisampled array textures are supported from 2.1.");
				img_type_name += "depth2d_ms_array";
			}
			else if (img_type.ms)
				img_type_name += "depth2d_ms";
			else if (img_type.arrayed)
				img_type_name += "depth2d_array";
			else
				img_type_name += "depth2d";
			break;
		case Dim3D:
			img_type_name += "depth3d_unsupported_by_metal";
			break;
		case DimCube:
			img_type_name += (img_type.arrayed ? "depthcube_array" : "depthcube");
			break;
		default:
			img_type_name += "unknown_depth_texture_type";
			break;
		}
	}
	else
	{
		switch (img_type.dim)
		{
		case Dim1D:
			img_type_name += (img_type.arrayed ? "texture1d_array" : "texture1d");
			break;
		case DimBuffer:
		case Dim2D:
		case DimSubpassData:
			if (img_type.ms && img_type.arrayed)
			{
				if (!msl_options.supports_msl_version(2, 1))
					SPIRV_CROSS_THROW("Multisampled array textures are supported from 2.1.");
				img_type_name += "texture2d_ms_array";
			}
			else if (img_type.ms)
				img_type_name += "texture2d_ms";
			else if (img_type.arrayed)
				img_type_name += "texture2d_array";
			else
				img_type_name += "texture2d";
			break;
		case Dim3D:
			img_type_name += "texture3d";
			break;
		case DimCube:
			img_type_name += (img_type.arrayed ? "texturecube_array" : "texturecube");
			break;
		default:
			img_type_name += "unknown_texture_type";
			break;
		}
	}

	// Append the pixel type
	img_type_name += "<";
	img_type_name += type_to_glsl(get<SPIRType>(img_type.type));

	// For unsampled images, append the sample/read/write access qualifier.
	// For kernel images, the access qualifier my be supplied directly by SPIR-V.
	// Otherwise it may be set based on whether the image is read from or written to within the shader.
	if (type.basetype == SPIRType::Image && type.image.sampled == 2 && type.image.dim != DimSubpassData)
	{
		switch (img_type.access)
		{
		case AccessQualifierReadOnly:
			img_type_name += ", access::read";
			break;

		case AccessQualifierWriteOnly:
			img_type_name += ", access::write";
			break;

		case AccessQualifierReadWrite:
			img_type_name += ", access::read_write";
			break;

		default:
		{
			auto *p_var = maybe_get_backing_variable(id);
			if (p_var && p_var->basevariable)
				p_var = maybe_get<SPIRVariable>(p_var->basevariable);
			if (p_var && !has_decoration(p_var->self, DecorationNonWritable))
			{
				img_type_name += ", access::";

				if (!has_decoration(p_var->self, DecorationNonReadable))
					img_type_name += "read_";

				img_type_name += "write";
			}
			break;
		}
		}
	}

	img_type_name += ">";

	return img_type_name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x1a8(%rbp)
movq %rdi, %rax
movq %rax, -0x1a0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x198(%rbp)
movl -0x1c(%rbp), %esi
callq 0x116b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x10c3dd
movq -0x28(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x10c3dd
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
callq 0x8690
testb $0x1, %al
jne 0x10c8c8
movq -0x198(%rbp), %rdi
movl $0x2, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
addq $0x7cc, %rdi            # imm = 0x7CC
callq 0x116b00
testb $0x1, %al
jne 0x10c419
jmp 0x10c427
movl $0x1, -0x2c(%rbp)
movl $0x2, -0x30(%rbp)
movq -0x198(%rbp), %rdi
addq $0x7cc, %rdi            # imm = 0x7CC
movl -0x2c(%rbp), %esi
movl -0x30(%rbp), %edx
xorl %ecx, %ecx
callq 0x1160d0
testb $0x1, %al
jne 0x10c5ee
movq -0x198(%rbp), %rdi
addq $0x7cc, %rdi            # imm = 0x7CC
callq 0x116b00
testb $0x1, %al
jne 0x10c466
jmp 0x10c51e
movb $0x1, -0x65(%rbp)
movl $0x10, %edi
callq 0x71a0
movq %rax, -0x1b8(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x7650
movq -0x1b0(%rbp), %rdx
leaq 0x411e2(%rip), %rsi     # 0x14d67b
leaq -0x50(%rbp), %rdi
callq 0x7520
jmp 0x10c4a4
movq -0x1b8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x9c50
jmp 0x10c4b6
movq -0x1b8(%rbp), %rdi
movb $0x0, -0x65(%rbp)
leaq 0xa1910(%rip), %rsi     # 0x1addd8
leaq -0x10283f(%rip), %rdx   # 0x9c90
callq 0x7610
jmp 0x10d0ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x10c4fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x7708
leaq -0x51(%rbp), %rdi
callq 0x73d0
testb $0x1, -0x65(%rbp)
jne 0x10c50d
jmp 0x10c519
movq -0x1b8(%rbp), %rdi
callq 0x72c0
jmp 0x10d0b1
movb $0x1, -0x8a(%rbp)
movl $0x10, %edi
callq 0x71a0
movq %rax, -0x1c8(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0x1c0(%rbp)
callq 0x7650
movq -0x1c0(%rbp), %rdx
leaq 0x4115b(%rip), %rsi     # 0x14d6b2
leaq -0x88(%rbp), %rdi
callq 0x7520
jmp 0x10c565
movq -0x1c8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x9c50
jmp 0x10c57a
movq -0x1c8(%rbp), %rdi
movb $0x0, -0x8a(%rbp)
leaq 0xa1849(%rip), %rsi     # 0x1addd8
leaq -0x102906(%rip), %rdx   # 0x9c90
callq 0x7610
jmp 0x10d0ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x10c5c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x7708
leaq -0x89(%rbp), %rdi
callq 0x73d0
testb $0x1, -0x8a(%rbp)
jne 0x10c5dd
jmp 0x10c5e9
movq -0x1c8(%rbp), %rdi
callq 0x72c0
jmp 0x10d0b1
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
callq 0x8650
cmpq $0x1, %rax
jbe 0x10c6d5
movb $0x1, -0xb2(%rbp)
movl $0x10, %edi
callq 0x71a0
movq %rax, -0x1d8(%rbp)
leaq -0xb1(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x7650
movq -0x1d0(%rbp), %rdx
leaq 0x410ab(%rip), %rsi     # 0x14d6e9
leaq -0xb0(%rbp), %rdi
callq 0x7520
jmp 0x10c64c
movq -0x1d8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x9c50
jmp 0x10c661
movq -0x1d8(%rbp), %rdi
movb $0x0, -0xb2(%rbp)
leaq 0xa1762(%rip), %rsi     # 0x1addd8
leaq -0x1029ed(%rip), %rdx   # 0x9c90
callq 0x7610
jmp 0x10d0ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x10c6ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x7708
leaq -0xb1(%rbp), %rdi
callq 0x73d0
testb $0x1, -0xb2(%rbp)
jne 0x10c6c4
jmp 0x10c6d0
movq -0x1d8(%rbp), %rdi
callq 0x72c0
jmp 0x10d0b1
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
callq 0x2fe70
testb $0x1, %al
jne 0x10c6e8
jmp 0x10c6ff
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
callq 0x2fe30
movl (%rax), %eax
movl %eax, -0x1dc(%rbp)
jmp 0x10c72c
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
callq 0x2fe30
movq -0x198(%rbp), %rdi
movl (%rax), %esi
callq 0x31910
movq %rax, %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x2f560
movl %eax, -0x1dc(%rbp)
movl -0x1dc(%rbp), %eax
movl %eax, -0xb8(%rbp)
cmpl $0x0, -0xb8(%rbp)
jne 0x10c815
movb $0x1, -0xda(%rbp)
movl $0x10, %edi
callq 0x71a0
movq %rax, -0x1f0(%rbp)
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x7650
movq -0x1e8(%rbp), %rdx
leaq 0x40fa2(%rip), %rsi     # 0x14d720
leaq -0xd8(%rbp), %rdi
callq 0x7520
jmp 0x10c78c
movq -0x1f0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x9c50
jmp 0x10c7a1
movq -0x1f0(%rbp), %rdi
movb $0x0, -0xda(%rbp)
leaq 0xa1622(%rip), %rsi     # 0x1addd8
leaq -0x102b2d(%rip), %rdx   # 0x9c90
callq 0x7610
jmp 0x10d0ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x10c7ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x7708
leaq -0xd9(%rbp), %rdi
callq 0x73d0
testb $0x1, -0xda(%rbp)
jne 0x10c804
jmp 0x10c810
movq -0x1f0(%rbp), %rdi
callq 0x72c0
jmp 0x10d0b1
movq -0x198(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x22e00
movq -0x198(%rbp), %rdi
movl 0x9c(%rax), %esi
callq 0xea90
movq -0x198(%rbp), %rsi
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movq (%rsi), %rax
movq 0xb0(%rax), %rax
leaq -0x108(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq *%rax
movq -0x1a8(%rbp), %rdi
movq -0x1f8(%rbp), %rdx
leaq 0x31d35(%rip), %rsi     # 0x13e5b3
leaq 0x37d0a(%rip), %rcx     # 0x14458f
leaq 0x3195f(%rip), %r9      # 0x13e1eb
leaq -0xb8(%rbp), %r8
callq 0x117b90
jmp 0x10c89a
leaq -0x108(%rbp), %rdi
callq 0x7708
jmp 0x10d0a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x7708
jmp 0x10d0b1
movq -0x1a8(%rbp), %rdi
movb $0x0, -0x109(%rbp)
callq 0x7530
movq -0x198(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %esi
callq 0xea90
movq %rax, -0x200(%rbp)
jmp 0x10c8f7
movq -0x198(%rbp), %rdi
movq -0x200(%rbp), %rax
subq $-0x80, %rax
movq %rax, -0x118(%rbp)
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x2c890
movb %al, -0x201(%rbp)
jmp 0x10c924
movb -0x201(%rbp), %al
testb $0x1, %al
jne 0x10c933
jmp 0x10cb97
movq -0x118(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x210(%rbp)
subq $0x3, %rax
ja 0x10cb7b
movq -0x210(%rbp), %rax
leaq 0x3da2c(%rip), %rcx     # 0x14a388
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x10d093
movq -0x1a8(%rbp), %rdi
leaq 0x40dcd(%rip), %rsi     # 0x14d751
callq 0x7340
jmp 0x10c98b
jmp 0x10cb92
movq -0x118(%rbp), %rax
testb $0x1, 0xa(%rax)
je 0x10cad0
movq -0x118(%rbp), %rax
testb $0x1, 0x9(%rax)
je 0x10cad0
movq -0x198(%rbp), %rdi
addq $0x7cc, %rdi            # imm = 0x7CC
movl $0x2, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x1160d0
movb %al, -0x211(%rbp)
jmp 0x10c9d9
movb -0x211(%rbp), %al
testb $0x1, %al
jne 0x10cab9
jmp 0x10c9e9
movb $0x1, -0x13a(%rbp)
movl $0x10, %edi
callq 0x71a0
movq %rax, -0x228(%rbp)
leaq -0x139(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x7650
movq -0x220(%rbp), %rdx
leaq 0x40d4c(%rip), %rsi     # 0x14d76e
leaq -0x138(%rbp), %rdi
callq 0x7520
jmp 0x10ca30
movq -0x228(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x9c50
jmp 0x10ca45
movq -0x228(%rbp), %rdi
movb $0x0, -0x13a(%rbp)
leaq 0xa137e(%rip), %rsi     # 0x1addd8
leaq -0x102dd1(%rip), %rdx   # 0x9c90
callq 0x7610
jmp 0x10d0ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x10ca91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x7708
leaq -0x139(%rbp), %rdi
callq 0x73d0
testb $0x1, -0x13a(%rbp)
jne 0x10caa8
jmp 0x10cab4
movq -0x228(%rbp), %rdi
callq 0x72c0
jmp 0x10d093
movq -0x1a8(%rbp), %rdi
leaq 0x40cdb(%rip), %rsi     # 0x14d7a2
callq 0x7340
jmp 0x10cace
jmp 0x10cb33
movq -0x118(%rbp), %rax
testb $0x1, 0xa(%rax)
je 0x10caf4
movq -0x1a8(%rbp), %rdi
leaq 0x40cc8(%rip), %rsi     # 0x14d7b3
callq 0x7340
jmp 0x10caf2
jmp 0x10cb31
movq -0x118(%rbp), %rax
testb $0x1, 0x9(%rax)
je 0x10cb18
movq -0x1a8(%rbp), %rdi
leaq 0x40caf(%rip), %rsi     # 0x14d7be
callq 0x7340
jmp 0x10cb16
jmp 0x10cb2f
movq -0x1a8(%rbp), %rdi
leaq 0x40ca6(%rip), %rsi     # 0x14d7cc
callq 0x7340
jmp 0x10cb2d
jmp 0x10cb2f
jmp 0x10cb31
jmp 0x10cb33
jmp 0x10cb92
movq -0x1a8(%rbp), %rdi
leaq 0x40c91(%rip), %rsi     # 0x14d7d4
callq 0x7340
jmp 0x10cb4a
jmp 0x10cb92
movq -0x1a8(%rbp), %rdi
movq -0x118(%rbp), %rax
movb 0x9(%rax), %cl
leaq 0x40c8d(%rip), %rax     # 0x14d7f1
leaq 0x40c96(%rip), %rsi     # 0x14d801
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x7340
jmp 0x10cb79
jmp 0x10cb92
movq -0x1a8(%rbp), %rdi
leaq 0x40c82(%rip), %rsi     # 0x14d80b
callq 0x7340
jmp 0x10cb90
jmp 0x10cb92
jmp 0x10cdff
movq -0x118(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x230(%rbp)
subq $0x6, %rax
ja 0x10cde6
movq -0x230(%rbp), %rax
leaq 0x3d7ac(%rip), %rcx     # 0x14a36c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x1a8(%rbp), %rdi
movq -0x118(%rbp), %rax
movb 0x9(%rax), %cl
leaq 0x40c45(%rip), %rax     # 0x14d826
leaq 0x40c4e(%rip), %rsi     # 0x14d836
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x7340
jmp 0x10cbf6
jmp 0x10cdfd
movq -0x118(%rbp), %rax
testb $0x1, 0xa(%rax)
je 0x10cd3b
movq -0x118(%rbp), %rax
testb $0x1, 0x9(%rax)
je 0x10cd3b
movq -0x198(%rbp), %rdi
addq $0x7cc, %rdi            # imm = 0x7CC
movl $0x2, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x1160d0
movb %al, -0x231(%rbp)
jmp 0x10cc44
movb -0x231(%rbp), %al
testb $0x1, %al
jne 0x10cd24
jmp 0x10cc54
movb $0x1, -0x162(%rbp)
movl $0x10, %edi
callq 0x71a0
movq %rax, -0x248(%rbp)
leaq -0x161(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x7650
movq -0x240(%rbp), %rdx
leaq 0x40ae1(%rip), %rsi     # 0x14d76e
leaq -0x160(%rbp), %rdi
callq 0x7520
jmp 0x10cc9b
movq -0x248(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x9c50
jmp 0x10ccb0
movq -0x248(%rbp), %rdi
movb $0x0, -0x162(%rbp)
leaq 0xa1113(%rip), %rsi     # 0x1addd8
leaq -0x10303c(%rip), %rdx   # 0x9c90
callq 0x7610
jmp 0x10d0ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x10ccfc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x7708
leaq -0x161(%rbp), %rdi
callq 0x73d0
testb $0x1, -0x162(%rbp)
jne 0x10cd13
jmp 0x10cd1f
movq -0x248(%rbp), %rdi
callq 0x72c0
jmp 0x10d093
movq -0x1a8(%rbp), %rdi
leaq 0x40b0e(%rip), %rsi     # 0x14d840
callq 0x7340
jmp 0x10cd39
jmp 0x10cd9e
movq -0x118(%rbp), %rax
testb $0x1, 0xa(%rax)
je 0x10cd5f
movq -0x1a8(%rbp), %rdi
leaq 0x40afd(%rip), %rsi     # 0x14d853
callq 0x7340
jmp 0x10cd5d
jmp 0x10cd9c
movq -0x118(%rbp), %rax
testb $0x1, 0x9(%rax)
je 0x10cd83
movq -0x1a8(%rbp), %rdi
leaq 0x40ae6(%rip), %rsi     # 0x14d860
callq 0x7340
jmp 0x10cd81
jmp 0x10cd9a
movq -0x1a8(%rbp), %rdi
leaq 0x40adf(%rip), %rsi     # 0x14d870
callq 0x7340
jmp 0x10cd98
jmp 0x10cd9a
jmp 0x10cd9c
jmp 0x10cd9e
jmp 0x10cdfd
movq -0x1a8(%rbp), %rdi
leaq 0x40acc(%rip), %rsi     # 0x14d87a
callq 0x7340
jmp 0x10cdb5
jmp 0x10cdfd
movq -0x1a8(%rbp), %rdi
movq -0x118(%rbp), %rax
movb 0x9(%rax), %cl
leaq 0x40ab5(%rip), %rax     # 0x14d884
leaq 0x40ac0(%rip), %rsi     # 0x14d896
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x7340
jmp 0x10cde4
jmp 0x10cdfd
movq -0x1a8(%rbp), %rdi
leaq 0x40aae(%rip), %rsi     # 0x14d8a2
callq 0x7340
jmp 0x10cdfb
jmp 0x10cdfd
jmp 0x10cdff
movq -0x1a8(%rbp), %rdi
leaq 0x357c4(%rip), %rsi     # 0x1425d1
callq 0x7340
jmp 0x10ce14
movq -0x198(%rbp), %rdi
movq -0x118(%rbp), %rax
movl (%rax), %esi
callq 0xea90
movq %rax, -0x250(%rbp)
jmp 0x10ce32
movq -0x250(%rbp), %rdx
movq -0x198(%rbp), %rsi
movq (%rsi), %rax
movq 0x98(%rax), %rax
leaq -0x188(%rbp), %rdi
xorl %ecx, %ecx
callq *%rax
jmp 0x10ce57
movq -0x1a8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x7470
jmp 0x10ce6c
leaq -0x188(%rbp), %rdi
callq 0x7708
movq -0x18(%rbp), %rax
cmpl $0xd, 0xc(%rax)
jne 0x10d060
movq -0x18(%rbp), %rax
cmpl $0x2, 0x8c(%rax)
jne 0x10d060
movq -0x18(%rbp), %rax
cmpl $0x6, 0x84(%rax)
je 0x10d060
movq -0x118(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, -0x254(%rbp)
testl %eax, %eax
je 0x10cef5
jmp 0x10cebe
movl -0x254(%rbp), %eax
subl $0x1, %eax
je 0x10cf0f
jmp 0x10cecb
movl -0x254(%rbp), %eax
subl $0x2, %eax
je 0x10cf29
jmp 0x10cf43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x7708
jmp 0x10d093
movq -0x1a8(%rbp), %rdi
leaq 0x409b4(%rip), %rsi     # 0x14d8b7
callq 0x7340
jmp 0x10cf0a
jmp 0x10d05e
movq -0x1a8(%rbp), %rdi
leaq 0x409a9(%rip), %rsi     # 0x14d8c6
callq 0x7340
jmp 0x10cf24
jmp 0x10d05e
movq -0x1a8(%rbp), %rdi
leaq 0x4099f(%rip), %rsi     # 0x14d8d6
callq 0x7340
jmp 0x10cf3e
jmp 0x10d05e
movq -0x198(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x1fa90
movq %rax, -0x260(%rbp)
jmp 0x10cf5b
movq -0x260(%rbp), %rax
movq %rax, -0x190(%rbp)
cmpq $0x0, -0x190(%rbp)
je 0x10cfad
movq -0x190(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x10cfad
movq -0x198(%rbp), %rdi
movq -0x190(%rbp), %rax
movl 0x1c(%rax), %esi
callq 0x116b0
movq %rax, -0x268(%rbp)
jmp 0x10cf9f
movq -0x268(%rbp), %rax
movq %rax, -0x190(%rbp)
cmpq $0x0, -0x190(%rbp)
je 0x10d05c
movq -0x198(%rbp), %rdi
movq -0x190(%rbp), %rax
movl 0x8(%rax), %esi
movl $0x18, %edx
callq 0x1f560
movb %al, -0x269(%rbp)
jmp 0x10cfde
movb -0x269(%rbp), %al
testb $0x1, %al
jne 0x10d05c
jmp 0x10cfea
movq -0x1a8(%rbp), %rdi
leaq 0x408f3(%rip), %rsi     # 0x14d8eb
callq 0x7340
jmp 0x10cfff
movq -0x198(%rbp), %rdi
movq -0x190(%rbp), %rax
movl 0x8(%rax), %esi
movl $0x19, %edx
callq 0x1f560
movb %al, -0x26a(%rbp)
jmp 0x10d022
movb -0x26a(%rbp), %al
testb $0x1, %al
jne 0x10d045
jmp 0x10d02e
movq -0x1a8(%rbp), %rdi
leaq 0x408ba(%rip), %rsi     # 0x14d8f6
callq 0x7340
jmp 0x10d043
jmp 0x10d045
movq -0x1a8(%rbp), %rdi
leaq 0x4087d(%rip), %rsi     # 0x14d8d0
callq 0x7340
jmp 0x10d05a
jmp 0x10d05c
jmp 0x10d05e
jmp 0x10d060
movq -0x1a8(%rbp), %rdi
leaq 0x3117d(%rip), %rsi     # 0x13e1eb
callq 0x7340
jmp 0x10d075
movb $0x1, -0x109(%rbp)
testb $0x1, -0x109(%rbp)
jne 0x10d091
movq -0x1a8(%rbp), %rdi
callq 0x7708
jmp 0x10d0a1
movq -0x1a8(%rbp), %rdi
callq 0x7708
jmp 0x10d0b1
movq -0x1a0(%rbp), %rax
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x7640
nopw (%rax,%rax)