// File: /workspace/github_cpp_makefile_star2_O3/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 $0x40, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl 0x80(%rdx), %esi
movq %r15, %rdi
callq 0xa3ea
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movl 0xc(%rax), %eax
cmpl $0x5, %eax
je 0x633b9
cmpl $0x4, %eax
jne 0x633d2
leaq 0x53840(%rip), %rcx     # 0xb6bf7
jmp 0x633c0
leaq 0x568a9(%rip), %rcx     # 0xb9c69
movq %rsp, %rdi
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x63f0
movl 0xc(%r14), %ecx
movl 0x84(%r14), %eax
movl %ecx, %edx
xorl $0xd, %edx
movl %eax, %esi
xorl $0x6, %esi
orl %edx, %esi
jne 0x63461
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0xe456
leaq 0x57347(%rip), %rsi     # 0xba758
leaq 0x20(%rsp), %rdi
callq 0x64e0
leaq 0x544ec(%rip), %rax     # 0xb790e
leaq 0x51486(%rip), %rsi     # 0xb48af
cmpb $0x0, 0x8a(%r14)
cmovneq %rax, %rsi
leaq 0x20(%rsp), %rdi
callq 0x64e0
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x63484
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x6348a
leaq 0x5a658(%rip), %rsi     # 0xbdac0
cmpl $0xd, %ecx
jne 0x634f8
cmpl $0x5, %eax
je 0x634d7
cmpl $0x6, %eax
je 0x634f8
movl 0x8c(%r14), %eax
jmp 0x634e3
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x634b8
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x635b6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x635b6
movl 0x8c(%r14), %eax
cmpl $0x1, %eax
je 0x634f8
cmpl $0x2, %eax
leaq 0x57278(%rip), %rax     # 0xba765
leaq 0x5f054(%rip), %rsi     # 0xc2548
cmoveq %rax, %rsi
movq %rsp, %rdi
callq 0x64e0
movl 0x84(%r14), %eax
cmpq $0x6, %rax
ja 0x635c6
movl $0x6f, %ecx
btl %eax, %ecx
jae 0x635c6
leaq 0x58312(%rip), %rcx     # 0xbb838
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq %rsp, %rdi
callq 0x64e0
cmpb $0x1, 0x8a(%r14)
jne 0x6354e
leaq 0x543c8(%rip), %rsi     # 0xb790e
movq %rsp, %rdi
callq 0x64e0
cmpb $0x1, 0x89(%r14)
jne 0x63567
leaq 0x5438a(%rip), %rsi     # 0xb78e9
movq %rsp, %rdi
callq 0x64e0
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x1b12c
testb %al, %al
je 0x63587
leaq 0x54550(%rip), %rsi     # 0xb7acf
movq %rsp, %rdi
callq 0x64e0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%rsp), %rcx
cmpq %r12, %rcx
je 0x635a5
movq %rcx, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x635ad
movups (%r12), %xmm0
movups %xmm0, (%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x571bb(%rip), %rsi     # 0xba79e
leaq 0x571f5(%rip), %rdx     # 0xba7df
leaq 0x20(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x987bd(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x98795(%rip), %rsi     # 0xfbdb0
movq 0x999b6(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
jmp 0x6365a
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x63646
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x63650
jmp 0x6367b
movq %rax, %rbx
movq %r14, %rdi
callq 0x6200
jmp 0x6367b
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6367b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x6367b
jmp 0x63678
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x63691
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop