// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_hlsl.cpp
// Function: spirv_cross::CompilerHLSL::image_type_hlsl_modern[abi:cxx11](spirv_cross::SPIRType const&, unsigned int)
string CompilerHLSL::image_type_hlsl_modern(const SPIRType &type, uint32_t)
{
	auto &imagetype = get<SPIRType>(type.image.type);
	const char *dim = nullptr;
	bool typed_load = false;
	uint32_t components = 4;

	switch (type.image.dim)
	{
	case Dim1D:
		typed_load = type.image.sampled == 2;
		dim = "1D";
		break;
	case Dim2D:
		typed_load = type.image.sampled == 2;
		dim = "2D";
		break;
	case Dim3D:
		typed_load = type.image.sampled == 2;
		dim = "3D";
		break;
	case DimCube:
		if (type.image.sampled == 2)
			SPIRV_CROSS_THROW("RWTextureCube does not exist in HLSL.");
		dim = "Cube";
		break;
	case DimRect:
		SPIRV_CROSS_THROW("Rectangle texture support is not yet implemented for HLSL."); // TODO
	case DimBuffer:
		if (type.image.sampled == 1)
			return join("Buffer<", type_to_glsl(imagetype), components, ">");
		else if (type.image.sampled == 2)
			return join("RWBuffer<", image_format_to_type(type.image.format, imagetype.basetype), ">");
		else
			SPIRV_CROSS_THROW("Sampler buffers must be either sampled or unsampled. Cannot deduce in runtime.");
	case DimSubpassData:
		dim = "2D";
		typed_load = false;
		break;
	default:
		SPIRV_CROSS_THROW("Invalid dimension.");
	}
	const char *arrayed = type.image.arrayed ? "Array" : "";
	const char *ms = type.image.ms ? "MS" : "";
	const char *rw = typed_load ? "RW" : "";
	return join(rw, "Texture", dim, ms, arrayed, "<",
	            typed_load ? image_format_to_type(type.image.format, imagetype.basetype) :
	                         join(type_to_glsl(imagetype), components),
	            ">");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl 0x80(%rdx), %esi
movq %r14, %rdi
callq 0xa426
movq $0x0, 0x20(%rsp)
movl $0x4, 0x2c(%rsp)
movl 0x84(%r15), %ecx
cmpq $0x6, %rcx
ja 0x62ee6
leaq 0x593c6(%rip), %rdx     # 0xbbfc0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
cmpl $0x2, 0x8c(%r15)
sete %bpl
leaq 0x55cd8(%rip), %rcx     # 0xb88ee
jmp 0x62cae
movl 0x8c(%r15), %ecx
cmpl $0x2, %ecx
je 0x62dc5
cmpl $0x1, %ecx
jne 0x62f48
movq (%r14), %r8
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq *0x98(%r8)
leaq 0x59d48(%rip), %rsi     # 0xbc99b
leaq 0x525a2(%rip), %r8      # 0xb51fc
leaq 0x2c(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x75c0d
jmp 0x62df3
cmpl $0x2, 0x8c(%r15)
sete %bpl
leaq 0x55cc2(%rip), %rcx     # 0xb8944
jmp 0x62cae
cmpl $0x2, 0x8c(%r15)
je 0x62e1c
leaq 0x55cc1(%rip), %rcx     # 0xb895a
jmp 0x62cbc
cmpl $0x2, 0x8c(%r15)
sete %bpl
leaq 0x55c57(%rip), %rcx     # 0xb8905
movq %rcx, 0x20(%rsp)
jmp 0x62cc3
leaq 0x55c49(%rip), %rcx     # 0xb8905
movq %rcx, 0x20(%rsp)
xorl %ebp, %ebp
leaq 0x55c2f(%rip), %rcx     # 0xb88f9
leaq 0x52bde(%rip), %rdx     # 0xb58af
cmpb $0x0, 0x89(%r15)
cmoveq %rdx, %rcx
movq %rcx, 0x40(%rsp)
leaq 0x55c35(%rip), %rcx     # 0xb891e
cmpb $0x0, 0x8a(%r15)
cmoveq %rdx, %rcx
movq %rcx, 0x38(%rsp)
leaq 0x59d04(%rip), %rcx     # 0xbca05
testb %bpl, %bpl
cmoveq %rdx, %rcx
movq %rcx, 0x30(%rsp)
je 0x62d23
movl 0x90(%r15), %esi
movl 0xc(%rax), %edx
movq %rsp, %rdi
callq 0x630c2
jmp 0x62d4d
movq (%r14), %r8
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq *0x98(%r8)
movq %rsp, %rdi
leaq 0x2c(%rsp), %rdx
movq %r15, %rsi
callq 0x75e14
subq $0x8, %rsp
leaq 0x524a4(%rip), %rax     # 0xb51fc
leaq 0x8(%rsp), %r10
leaq 0x56399(%rip), %r11     # 0xb90fd
leaq 0x59c9d(%rip), %rdx     # 0xbca08
leaq 0x38(%rsp), %rsi
leaq 0x28(%rsp), %rcx
leaq 0x40(%rsp), %r8
leaq 0x48(%rsp), %r9
movq %rbx, %rdi
pushq %rax
pushq %r10
pushq %r11
callq 0x75d47
addq $0x20, %rsp
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x62dab
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x62e0e
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x62e0e
movq 0x58(%rsp), %rsi
jmp 0x62e06
movl 0x90(%r15), %esi
movl 0xc(%rax), %edx
movq %rsp, %r14
movq %r14, %rdi
callq 0x630c2
leaq 0x59bb8(%rip), %rsi     # 0xbc999
leaq 0x52414(%rip), %rcx     # 0xb51fc
movq %rbx, %rdi
movq %r14, %rdx
callq 0x75cab
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x62e0e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x59aff(%rip), %rsi     # 0xbc938
leaq 0x59b1d(%rip), %rdx     # 0xbc95d
movq %rsp, %rdi
callq 0x7c64
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x99f3b(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x99f13(%rip), %rsi     # 0xfcd80
movq 0x9b164(%rip), %rdx     # 0xfdfd8
movq %r14, %rdi
callq 0x6470
jmp 0x62fa8
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x59ac0(%rip), %rsi     # 0xbc95e
leaq 0x59af3(%rip), %rdx     # 0xbc998
movq %rsp, %rdi
callq 0x7c64
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x99ed6(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x99eae(%rip), %rsi     # 0xfcd80
movq 0x9b0ff(%rip), %rdx     # 0xfdfd8
movq %r14, %rdi
callq 0x6470
jmp 0x62fa8
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x59aef(%rip), %rsi     # 0xbc9f2
leaq 0x59afa(%rip), %rdx     # 0xbca04
movq %rsp, %rdi
callq 0x7c64
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x99e71(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x99e49(%rip), %rsi     # 0xfcd80
movq 0x9b09a(%rip), %rdx     # 0xfdfd8
movq %r14, %rdi
callq 0x6470
jmp 0x62fa8
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x59a3e(%rip), %rsi     # 0xbc9a3
leaq 0x59a85(%rip), %rdx     # 0xbc9f1
movq %rsp, %rdi
callq 0x7c64
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x99e0f(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x99de7(%rip), %rsi     # 0xfcd80
movq 0x9b038(%rip), %rdx     # 0xfdfd8
movq %r14, %rdi
callq 0x6470
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x62fc9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x62fc9
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x630ba
jmp 0x63077
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x62ff8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x62ff8
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x630ba
jmp 0x63077
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x63024
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x63024
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x630ba
jmp 0x63077
jmp 0x63031
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x630ba
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x630ba
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x63072
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x63072
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x630ba
movq %r14, %rdi
callq 0x6200
jmp 0x630ba
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x630ab
movq %rax, %rbx
xorb $0x1, %bpl
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x630ab
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
je 0x630ba
leaq 0x48(%rsp), %rdi
callq 0x6deb
movq %rbx, %rdi
callq 0x64a0