// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::image_type_glsl[abi:cxx11](spirv_cross::SPIRType const&, unsigned int)
string CompilerGLSL::image_type_glsl(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 && options.vulkan_semantics)
		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:
		if (options.es && options.version < 320)
			require_extension_internal("GL_OES_texture_buffer");
		else if (!options.es && options.version < 300)
			require_extension_internal("GL_EXT_texture_buffer_object");
		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)
	{
		if (is_legacy_desktop())
			require_extension_internal("GL_EXT_texture_array");
		res += "Array";
	}

	// "Shadow" state in GLSL only exists for samplers and combined image samplers.
	if (((type.basetype == SPIRType::SampledImage) || (type.basetype == SPIRType::Sampler)) &&
	    image_is_comparison(type, id))
	{
		res += "Shadow";
	}

	return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl 0x80(%rdx), %esi
movq %r15, %rdi
callq 0xa426
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movl 0xc(%rax), %eax
cmpl $0x5, %eax
je 0x4c93f
cmpl $0x4, %eax
jne 0x4c95a
leaq 0x6b2ca(%rip), %rcx     # 0xb7c07
jmp 0x4c946
leaq 0x6e333(%rip), %rcx     # 0xbac79
leaq 0x28(%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 0x4c9ff
cmpb $0x1, 0x43e(%r15)
jne 0x4c9ff
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0xe480
leaq 0x6edc0(%rip), %rsi     # 0xbb768
leaq 0x8(%rsp), %rdi
callq 0x64e0
leaq 0x6bf65(%rip), %rax     # 0xb891e
leaq 0x68eef(%rip), %rsi     # 0xb58af
cmpb $0x0, 0x8a(%r14)
cmovneq %rax, %rsi
leaq 0x8(%rsp), %rdi
callq 0x64e0
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x4cb08
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x4cb0e
leaq 0x720b2(%rip), %rsi     # 0xbeab8
cmpl $0xd, %ecx
jne 0x4ca39
cmpl $0x6, %eax
je 0x4ca39
cmpl $0x5, %eax
jne 0x4ca1f
cmpl $0x1, 0x8c(%r14)
je 0x4ca39
cmpl $0x2, 0x8c(%r14)
leaq 0x6ed47(%rip), %rax     # 0xbb775
leaq 0x76b43(%rip), %rsi     # 0xc3578
cmoveq %rax, %rsi
leaq 0x28(%rsp), %rdi
callq 0x64e0
movl 0x84(%r14), %eax
cmpq $0x6, %rax
ja 0x4ccdd
leaq 0x6a7dd(%rip), %rcx     # 0xb7238
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x6be9a(%rip), %r12     # 0xb8905
jmp 0x4cba3
leaq 0x6becd(%rip), %r12     # 0xb8944
jmp 0x4cba3
leaq 0x6be6b(%rip), %r12     # 0xb88ee
jmp 0x4cba3
leaq 0x6becb(%rip), %r12     # 0xb895a
jmp 0x4cba3
movb 0x43c(%r15), %al
movl 0x438(%r15), %ecx
cmpl $0x140, %ecx            # imm = 0x140
setb %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x4cb45
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x6ecb4(%rip), %rsi     # 0xbb77b
leaq 0x6ecc2(%rip), %rdx     # 0xbb790
leaq 0x8(%rsp), %rdi
callq 0x7c64
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x26a0a
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4cafc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x6be4a(%rip), %r12     # 0xb894d
jmp 0x4cba3
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 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ccb4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x4ccb4
cmpl $0x12c, %ecx            # imm = 0x12C
setae %cl
orb %cl, %al
leaq 0x6bdf6(%rip), %r12     # 0xb894d
jne 0x4cba3
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x6ec28(%rip), %rsi     # 0xbb791
leaq 0x6ec3d(%rip), %rdx     # 0xbb7ad
leaq 0x8(%rsp), %rdi
callq 0x7c64
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x26a0a
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4cba3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x64e0
cmpb $0x1, 0x8a(%r14)
jne 0x4cbcb
leaq 0x6bd5d(%rip), %rsi     # 0xb891e
leaq 0x28(%rsp), %rdi
callq 0x64e0
cmpb $0x1, 0x89(%r14)
jne 0x4cc43
cmpb $0x0, 0x43c(%r15)
jne 0x4cc32
cmpl $0x81, 0x438(%r15)
ja 0x4cc32
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x6ebf3(%rip), %rsi     # 0xbb7f0
leaq 0x6ec00(%rip), %rdx     # 0xbb804
leaq 0x8(%rsp), %rdi
callq 0x7c64
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x26a0a
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4cc32
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x6bcc0(%rip), %rsi     # 0xb88f9
leaq 0x28(%rsp), %rdi
callq 0x64e0
movl 0xc(%r14), %eax
andl $-0x2, %eax
cmpl $0xe, %eax
jne 0x4cc71
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x1b812
testb %al, %al
je 0x4cc71
leaq 0x6be78(%rip), %rsi     # 0xb8adf
leaq 0x28(%rsp), %rdi
callq 0x64e0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x28(%rsp), %rcx
cmpq %r13, %rcx
je 0x4cc90
movq %rcx, (%rbx)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x4cc98
movups (%r13), %xmm0
movups %xmm0, (%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r13, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4cccb
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x6eab4(%rip), %rsi     # 0xbb7ae
leaq 0x6eaee(%rip), %rdx     # 0xbb7ef
leaq 0x8(%rsp), %rdi
callq 0x7c64
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0xb0076(%rip), %rax     # 0xfcd98
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0xb004e(%rip), %rsi     # 0xfcd80
movq 0xb129f(%rip), %rdx     # 0xfdfd8
movq %r14, %rdi
callq 0x6470
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x4cdac
jmp 0x4cdc0
jmp 0x4cdbd
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4cd79
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x4cd79
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x4cdc0
movq %r14, %rdi
callq 0x6200
jmp 0x4cdc0
jmp 0x4cd8c
jmp 0x4cdbd
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x4cdac
jmp 0x4cdc0
jmp 0x4cdbd
jmp 0x4cd9f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4cdc0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x4cdc0
jmp 0x4cdbd
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4cdd7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop