// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_hlsl.cpp
// Function: spirv_cross::CompilerHLSL::image_type_hlsl_legacy[abi:cxx11](spirv_cross::SPIRType const&, unsigned int)
string CompilerHLSL::image_type_hlsl_legacy(const SPIRType &type, uint32_t id)
{
	auto &imagetype = get<SPIRType>(type.image.type);
	string res;

	switch (imagetype.basetype)
	{
	case SPIRType::Int:
		res = "i";
		break;
	case SPIRType::UInt:
		res = "u";
		break;
	default:
		break;
	}

	if (type.basetype == SPIRType::Image && type.image.dim == DimSubpassData)
		return res + "subpassInput" + (type.image.ms ? "MS" : "");

	// If we're emulating subpassInput with samplers, force sampler2D
	// so we don't have to specify format.
	if (type.basetype == SPIRType::Image && type.image.dim != DimSubpassData)
	{
		// Sampler buffers are always declared as samplerBuffer even though they might be separate images in the SPIR-V.
		if (type.image.dim == DimBuffer && type.image.sampled == 1)
			res += "sampler";
		else
			res += type.image.sampled == 2 ? "image" : "texture";
	}
	else
		res += "sampler";

	switch (type.image.dim)
	{
	case Dim1D:
		res += "1D";
		break;
	case Dim2D:
		res += "2D";
		break;
	case Dim3D:
		res += "3D";
		break;
	case DimCube:
		res += "CUBE";
		break;

	case DimBuffer:
		res += "Buffer";
		break;

	case DimSubpassData:
		res += "2D";
		break;
	default:
		SPIRV_CROSS_THROW("Only 1D, 2D, 3D, Buffer, InputTarget and Cube textures supported.");
	}

	if (type.image.ms)
		res += "MS";
	if (type.image.arrayed)
		res += "Array";
	if (image_is_comparison(type, id))
		res += "Shadow";

	return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl 0x80(%rdx), %esi
movq %r15, %rdi
callq 0x90a4
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
andq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movl 0xc(%rax), %eax
cmpl $0x5, %eax
je 0x50d70
cmpl $0x4, %eax
jne 0x50d81
leaq 0x40e69(%rip), %rsi     # 0x91bd7
jmp 0x50d77
leaq 0x43ed2(%rip), %rsi     # 0x94c49
leaq 0x10(%rsp), %rdi
callq 0x64e0
movl 0xc(%r14), %ecx
movl 0x84(%r14), %eax
movl %ecx, %edx
xorl $0xd, %edx
movl %eax, %esi
xorl $0x6, %esi
orl %edx, %esi
jne 0x50de6
leaq 0x44997(%rip), %rdx     # 0x95738
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x174a5
leaq 0x41b37(%rip), %rax     # 0x928ee
leaq 0x3eac9(%rip), %rdx     # 0x8f887
cmpb $0x0, 0x8a(%r14)
cmovneq %rax, %rdx
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0xab3f
leaq 0x30(%rsp), %rdi
callq 0x6548
jmp 0x50efd
leaq 0x47c63(%rip), %rsi     # 0x98a50
cmpl $0xd, %ecx
jne 0x50e26
cmpl $0x5, %eax
je 0x50e05
cmpl $0x6, %eax
je 0x50e26
movl 0x8c(%r14), %eax
jmp 0x50e11
movl 0x8c(%r14), %eax
cmpl $0x1, %eax
je 0x50e26
cmpl $0x2, %eax
leaq 0x4492a(%rip), %rax     # 0x95745
leaq 0x4c6de(%rip), %rsi     # 0x9d500
cmoveq %rax, %rsi
leaq 0x10(%rsp), %rdi
callq 0x64d0
movl 0x84(%r14), %eax
cmpq $0x6, %rax
ja 0x50f17
pushq $0x6f
popq %rcx
btl %eax, %ecx
jae 0x50f17
leaq 0x45974(%rip), %rcx     # 0x967c8
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0x10(%rsp), %rdi
callq 0x64d0
cmpb $0x1, 0x8a(%r14)
jne 0x50e80
leaq 0x41a78(%rip), %rsi     # 0x928ee
leaq 0x10(%rsp), %rdi
callq 0x64d0
cmpb $0x1, 0x89(%r14)
jne 0x50e9b
leaq 0x41a38(%rip), %rsi     # 0x928c9
leaq 0x10(%rsp), %rdi
callq 0x64d0
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x16cd4
testb %al, %al
je 0x50ebd
leaq 0x41bfc(%rip), %rsi     # 0x92aaf
leaq 0x10(%rsp), %rdi
callq 0x64d0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x10(%rsp), %rcx
cmpq %r12, %rcx
je 0x50edc
movq %rcx, (%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x50ee4
movups (%r12), %xmm0
movups %xmm0, (%rax)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r12, 0x10(%rsp)
andq $0x0, 0x18(%rsp)
movb $0x0, 0x20(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x6548
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %rbx
leaq 0x44855(%rip), %rsi     # 0x9577e
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0x95e6f(%rip), %rsi     # 0xe6dc0
movq 0x97088(%rip), %rdx     # 0xe7fe0
movq %rbx, %rdi
callq 0x6490
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x6548
testb %bpl, %bpl
jne 0x50f77
jmp 0x50f95
movq %rax, %r14
movq %rbx, %rdi
callq 0x6200
jmp 0x50f95
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x6548
jmp 0x50f95
jmp 0x50f92
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x6548
movq %r14, %rdi
callq 0x64b0
nop