// File: /workspace/github_cpp_makefile_star2_O1/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 0xa426
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movl 0xc(%rax), %eax
cmpl $0x5, %eax
je 0x63c57
cmpl $0x4, %eax
jne 0x63c70
leaq 0x53fb2(%rip), %rcx     # 0xb7c07
jmp 0x63c5e
leaq 0x5701b(%rip), %rcx     # 0xbac79
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 0x63d06
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0xe480
leaq 0x57ab9(%rip), %rsi     # 0xbb768
leaq 0x20(%rsp), %rdi
callq 0x64e0
leaq 0x54c5e(%rip), %rax     # 0xb891e
leaq 0x51be8(%rip), %rsi     # 0xb58af
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 0x63ded
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x63df3
leaq 0x5adab(%rip), %rsi     # 0xbeab8
cmpl $0xd, %ecx
jne 0x63d40
cmpl $0x6, %eax
je 0x63d40
cmpl $0x5, %eax
jne 0x63d26
cmpl $0x1, 0x8c(%r14)
je 0x63d40
cmpl $0x2, 0x8c(%r14)
leaq 0x57a40(%rip), %rax     # 0xbb775
leaq 0x5f83c(%rip), %rsi     # 0xc3578
cmoveq %rax, %rsi
movq %rsp, %rdi
callq 0x64e0
movl 0x84(%r14), %eax
cmpq $0x6, %rax
ja 0x63e6c
movl $0x6f, %ecx
btl %eax, %ecx
jae 0x63e6c
leaq 0x58ada(%rip), %rcx     # 0xbc848
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq %rsp, %rdi
callq 0x64e0
cmpb $0x1, 0x8a(%r14)
jne 0x63d96
leaq 0x54b90(%rip), %rsi     # 0xb891e
movq %rsp, %rdi
callq 0x64e0
cmpb $0x1, 0x89(%r14)
jne 0x63daf
leaq 0x54b52(%rip), %rsi     # 0xb88f9
movq %rsp, %rdi
callq 0x64e0
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x1b812
testb %al, %al
je 0x63dcf
leaq 0x54d18(%rip), %rsi     # 0xb8adf
movq %rsp, %rdi
callq 0x64e0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%rsp), %rcx
cmpq %r12, %rcx
je 0x63e23
movq %rcx, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x63e2b
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 0x63e46
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x63e46
movups (%r12), %xmm0
movups %xmm0, (%rax)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r12, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x63e5c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
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 0x57925(%rip), %rsi     # 0xbb7ae
leaq 0x5795f(%rip), %rdx     # 0xbb7ef
leaq 0x20(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x98ee7(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x98ebf(%rip), %rsi     # 0xfcd80
movq 0x9a110(%rip), %rdx     # 0xfdfd8
movq %r14, %rdi
callq 0x6470
jmp 0x63f03
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x63ef4
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x63ef4
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x63f24
movq %r14, %rdi
callq 0x6200
jmp 0x63f24
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x63f24
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x63f24
jmp 0x63f21
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x63f3a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0