// File: /workspace/github_cpp_makefile_star2_O3/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 0xa3ea
movl $0x4, 0x24(%rsp)
movl 0x84(%r15), %ecx
cmpq $0x6, %rcx
ja 0x62666
leaq 0x58c67(%rip), %rdx     # 0xbafb0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl 0x8c(%r15), %ecx
leaq 0x5557e(%rip), %rdx     # 0xb78de
jmp 0x623ee
movl 0x8c(%r15), %ecx
cmpl $0x2, %ecx
je 0x62545
cmpl $0x1, %ecx
jne 0x626c8
movq (%r14), %r8
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq *0x98(%r8)
leaq 0x59606(%rip), %rsi     # 0xbb9a3
leaq 0x51e58(%rip), %r8      # 0xb41fc
leaq 0x24(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x75101
jmp 0x62573
movl 0x8c(%r15), %ecx
leaq 0x5556d(%rip), %rdx     # 0xb7934
jmp 0x623ee
cmpl $0x2, 0x8c(%r15)
je 0x6259c
leaq 0x5556c(%rip), %rcx     # 0xb794a
jmp 0x62459
movl 0x8c(%r15), %ecx
leaq 0x55507(%rip), %rdx     # 0xb78f5
movq %rdx, 0x38(%rsp)
leaq 0x554ef(%rip), %rdx     # 0xb78e9
leaq 0x524ae(%rip), %rsi     # 0xb48af
cmpb $0x0, 0x89(%r15)
cmoveq %rsi, %rdx
movq %rdx, 0x30(%rsp)
leaq 0x554f5(%rip), %rdx     # 0xb790e
cmpb $0x0, 0x8a(%r15)
cmoveq %rsi, %rdx
movq %rdx, 0x28(%rsp)
cmpl $0x2, %ecx
jne 0x62495
leaq 0x595d7(%rip), %rcx     # 0xbba0d
movq %rcx, 0x40(%rsp)
movl 0x90(%r15), %esi
movl 0xc(%rax), %edx
movq %rsp, %rdi
callq 0x62832
movb $0x1, %bpl
jmp 0x624cd
leaq 0x5549c(%rip), %rcx     # 0xb78f5
movq %rcx, 0x38(%rsp)
leaq 0x55484(%rip), %rcx     # 0xb78e9
leaq 0x52443(%rip), %rdx     # 0xb48af
cmpb $0x0, 0x89(%r15)
cmoveq %rdx, %rcx
movq %rcx, 0x30(%rsp)
cmpb $0x0, 0x8a(%r15)
leaq 0x55482(%rip), %rcx     # 0xb790e
cmoveq %rdx, %rcx
movq %rcx, 0x28(%rsp)
leaq 0x52413(%rip), %rcx     # 0xb48af
movq %rcx, 0x40(%rsp)
movq (%r14), %r8
leaq 0x48(%rsp), %r15
xorl %ebp, %ebp
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq *0x98(%r8)
movq %rsp, %rdi
leaq 0x24(%rsp), %rdx
movq %r15, %rsi
callq 0x75308
subq $0x8, %rsp
leaq 0x51d24(%rip), %rax     # 0xb41fc
leaq 0x8(%rsp), %r10
leaq 0x55c09(%rip), %r11     # 0xb80ed
leaq 0x59525(%rip), %rdx     # 0xbba10
leaq 0x48(%rsp), %rsi
leaq 0x40(%rsp), %rcx
leaq 0x30(%rsp), %r8
leaq 0x38(%rsp), %r9
movq %rbx, %rdi
pushq %rax
pushq %r10
pushq %r11
callq 0x7523b
addq $0x20, %rsp
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6252b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x6258e
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6258e
movq 0x58(%rsp), %rsi
jmp 0x62586
movl 0x90(%r15), %esi
movl 0xc(%rax), %edx
movq %rsp, %r14
movq %r14, %rdi
callq 0x62832
leaq 0x59440(%rip), %rsi     # 0xbb9a1
leaq 0x51c94(%rip), %rcx     # 0xb41fc
movq %rbx, %rdi
movq %r14, %rdx
callq 0x7519f
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6258e
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 0x59387(%rip), %rsi     # 0xbb940
leaq 0x593a5(%rip), %rdx     # 0xbb965
movq %rsp, %rdi
callq 0x7be0
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x997eb(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x997c3(%rip), %rsi     # 0xfbdb0
movq 0x9a9e4(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
jmp 0x62728
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x59348(%rip), %rsi     # 0xbb966
leaq 0x5937b(%rip), %rdx     # 0xbb9a0
movq %rsp, %rdi
callq 0x7be0
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x99786(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x9975e(%rip), %rsi     # 0xfbdb0
movq 0x9a97f(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
jmp 0x62728
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x59377(%rip), %rsi     # 0xbb9fa
leaq 0x59382(%rip), %rdx     # 0xbba0c
movq %rsp, %rdi
callq 0x7be0
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x99721(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x996f9(%rip), %rsi     # 0xfbdb0
movq 0x9a91a(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
jmp 0x62728
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x592c6(%rip), %rsi     # 0xbb9ab
leaq 0x5930d(%rip), %rdx     # 0xbb9f9
movq %rsp, %rdi
callq 0x7be0
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0x6320
leaq 0x996bf(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x99697(%rip), %rsi     # 0xfbdb0
movq 0x9a8b8(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x62741
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
je 0x6282a
jmp 0x627dd
jmp 0x6279b
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x6276a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
je 0x6282a
jmp 0x627dd
jmp 0x6279b
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x62790
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
je 0x6282a
jmp 0x627dd
movq %rax, %rbx
jmp 0x627dd
jmp 0x627a2
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6282a
movq 0x10(%rsp), %rsi
jmp 0x62822
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x627d3
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x627dd
jmp 0x6282a
movq %rax, %rbx
movq %r14, %rdi
callq 0x6200
jmp 0x6282a
movq %rax, %rbx
jmp 0x6280f
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6280a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x6282a
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6282a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0