// File: /workspace/github_cpp_makefile_star2_O2/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 0x90a4
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
andq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movl 0xc(%rax), %eax
cmpl $0x5, %eax
je 0x3dcac
cmpl $0x4, %eax
jne 0x3dcbd
leaq 0x53f2d(%rip), %rsi     # 0x91bd7
jmp 0x3dcb3
leaq 0x56f96(%rip), %rsi     # 0x94c49
leaq 0x28(%rsp), %rdi
callq 0x64e0
movl 0xc(%r14), %ecx
movl 0x84(%r14), %eax
movl %ecx, %edx
xorl $0xd, %edx
movl %eax, %esi
xorl $0x6, %esi
orl %edx, %esi
leaq 0x5ad75(%rip), %rsi     # 0x98a50
jne 0x3dd37
cmpb $0x1, 0x43e(%r15)
jne 0x3dd70
leaq 0x57a46(%rip), %rdx     # 0x95738
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x174a5
leaq 0x54be6(%rip), %rax     # 0x928ee
leaq 0x51b78(%rip), %rdx     # 0x8f887
cmpb $0x0, 0x8a(%r14)
cmovneq %rax, %rdx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xab3f
leaq 0x8(%rsp), %rdi
callq 0x6548
jmp 0x3df55
cmpl $0xd, %ecx
jne 0x3dd70
cmpl $0x5, %eax
je 0x3dd4f
cmpl $0x6, %eax
je 0x3dd70
movl 0x8c(%r14), %eax
jmp 0x3dd5b
movl 0x8c(%r14), %eax
cmpl $0x1, %eax
je 0x3dd70
cmpl $0x2, %eax
leaq 0x579e0(%rip), %rax     # 0x95745
leaq 0x5f794(%rip), %rsi     # 0x9d500
cmoveq %rax, %rsi
leaq 0x28(%rsp), %rdi
callq 0x64d0
movl 0x84(%r14), %eax
cmpq $0x6, %rax
ja 0x3df71
leaq 0x53476(%rip), %rcx     # 0x91208
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x54b33(%rip), %r12     # 0x928d5
jmp 0x3de60
leaq 0x54b66(%rip), %r12     # 0x92914
jmp 0x3de60
leaq 0x54b04(%rip), %r12     # 0x928be
jmp 0x3de60
leaq 0x54b64(%rip), %r12     # 0x9292a
jmp 0x3de60
movb 0x43c(%r15), %al
movl 0x438(%r15), %ecx
cmpl $0x140, %ecx            # imm = 0x140
setb %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x3de1f
leaq 0x5795b(%rip), %rsi     # 0x9574b
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x6100
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x21390
leaq 0x8(%rsp), %rdi
callq 0x6548
leaq 0x54b00(%rip), %r12     # 0x9291d
jmp 0x3de60
cmpl $0x12c, %ecx            # imm = 0x12C
setae %cl
orb %cl, %al
leaq 0x54aec(%rip), %r12     # 0x9291d
jne 0x3de60
leaq 0x57927(%rip), %rsi     # 0x95761
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x6100
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x21390
leaq 0x8(%rsp), %rdi
callq 0x6548
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x64d0
cmpb $0x1, 0x8a(%r14)
jne 0x3de88
leaq 0x54a70(%rip), %rsi     # 0x928ee
leaq 0x28(%rsp), %rdi
callq 0x64d0
cmpb $0x1, 0x89(%r14)
jne 0x3dee7
cmpb $0x0, 0x43c(%r15)
jne 0x3ded6
cmpl $0x81, 0x438(%r15)
ja 0x3ded6
leaq 0x57910(%rip), %rsi     # 0x957c0
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x6100
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x21390
leaq 0x8(%rsp), %rdi
callq 0x6548
leaq 0x549ec(%rip), %rsi     # 0x928c9
leaq 0x28(%rsp), %rdi
callq 0x64d0
movl 0xc(%r14), %eax
andl $-0x2, %eax
cmpl $0xe, %eax
jne 0x3df15
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x16cd4
testb %al, %al
je 0x3df15
leaq 0x54ba4(%rip), %rsi     # 0x92aaf
leaq 0x28(%rsp), %rdi
callq 0x64d0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x28(%rsp), %rcx
cmpq %r13, %rcx
je 0x3df34
movq %rcx, (%rbx)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x3df3c
movups (%r13), %xmm0
movups %xmm0, (%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r13, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x6548
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x6140
movq %rax, %r14
leaq 0x577fb(%rip), %rsi     # 0x9577e
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x6100
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x6f6e
xorl %ebp, %ebp
leaq 0xa8e15(%rip), %rsi     # 0xe6dc0
movq 0xaa02e(%rip), %rdx     # 0xe7fe0
movq %r14, %rdi
callq 0x6490
jmp 0x3dfe7
jmp 0x3dff8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6548
testb %bpl, %bpl
jne 0x3dfd5
jmp 0x3dffb
movq %rax, %rbx
movq %r14, %rdi
callq 0x6200
jmp 0x3dffb
jmp 0x3dfe7
jmp 0x3dff8
jmp 0x3dfe7
jmp 0x3dff8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6548
jmp 0x3dffb
jmp 0x3dff8
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0
nop