// File: /workspace/github_cpp_makefile_star2_O3/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 0xa3ea
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movl 0xc(%rax), %eax
cmpl $0x5, %eax
je 0x4c1bb
cmpl $0x4, %eax
jne 0x4c1d6
leaq 0x6aa3e(%rip), %rcx     # 0xb6bf7
jmp 0x4c1c2
leaq 0x6daa7(%rip), %rcx     # 0xb9c69
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
leaq 0x718cc(%rip), %rsi     # 0xbdac0
jne 0x4c27f
cmpb $0x1, 0x43e(%r15)
jne 0x4c310
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0xe456
leaq 0x6e529(%rip), %rsi     # 0xba758
leaq 0x8(%rsp), %rdi
callq 0x64e0
leaq 0x6b6ce(%rip), %rax     # 0xb790e
leaq 0x68668(%rip), %rsi     # 0xb48af
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 0x4c29b
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x4c2a1
cmpl $0xd, %ecx
jne 0x4c310
cmpl $0x5, %eax
je 0x4c2ef
cmpl $0x6, %eax
je 0x4c310
movl 0x8c(%r14), %eax
jmp 0x4c2fb
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 0x4c2cf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4c534
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x4c534
movl 0x8c(%r14), %eax
cmpl $0x1, %eax
je 0x4c310
cmpl $0x2, %eax
leaq 0x6e460(%rip), %rax     # 0xba765
leaq 0x7623c(%rip), %rsi     # 0xc2548
cmoveq %rax, %rsi
leaq 0x28(%rsp), %rdi
callq 0x64e0
movl 0x84(%r14), %eax
cmpq $0x6, %rax
ja 0x4c546
leaq 0x69ef6(%rip), %rcx     # 0xb6228
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x6b5b3(%rip), %r12     # 0xb78f5
jmp 0x4c436
leaq 0x6b5e6(%rip), %r12     # 0xb7934
jmp 0x4c436
leaq 0x6b584(%rip), %r12     # 0xb78de
jmp 0x4c436
leaq 0x6b5e4(%rip), %r12     # 0xb794a
jmp 0x4c436
movb 0x43c(%r15), %al
movl 0x438(%r15), %ecx
cmpl $0x140, %ecx            # imm = 0x140
setb %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x4c3d8
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x6e3d1(%rip), %rsi     # 0xba76b
leaq 0x6e3df(%rip), %rdx     # 0xba780
leaq 0x8(%rsp), %rdi
callq 0x7be0
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x26356
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4c3cf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x6b567(%rip), %r12     # 0xb793d
jmp 0x4c436
cmpl $0x12c, %ecx            # imm = 0x12C
setae %cl
orb %cl, %al
leaq 0x6b553(%rip), %r12     # 0xb793d
jne 0x4c436
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x6e385(%rip), %rsi     # 0xba781
leaq 0x6e39a(%rip), %rdx     # 0xba79d
leaq 0x8(%rsp), %rdi
callq 0x7be0
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x26356
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4c436
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x64e0
cmpb $0x1, 0x8a(%r14)
jne 0x4c45e
leaq 0x6b4ba(%rip), %rsi     # 0xb790e
leaq 0x28(%rsp), %rdi
callq 0x64e0
cmpb $0x1, 0x89(%r14)
jne 0x4c4d6
cmpb $0x0, 0x43c(%r15)
jne 0x4c4c5
cmpl $0x81, 0x438(%r15)
ja 0x4c4c5
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x6e350(%rip), %rsi     # 0xba7e0
leaq 0x6e35d(%rip), %rdx     # 0xba7f4
leaq 0x8(%rsp), %rdi
callq 0x7be0
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x26356
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4c4c5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x6b41d(%rip), %rsi     # 0xb78e9
leaq 0x28(%rsp), %rdi
callq 0x64e0
movl 0xc(%r14), %eax
andl $-0x2, %eax
cmpl $0xe, %eax
jne 0x4c504
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x1b12c
testb %al, %al
je 0x4c504
leaq 0x6b5d5(%rip), %rsi     # 0xb7acf
leaq 0x28(%rsp), %rdi
callq 0x64e0
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x28(%rsp), %rcx
cmpq %r13, %rcx
je 0x4c523
movq %rcx, (%rbx)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x4c52b
movups (%r13), %xmm0
movups %xmm0, (%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rbx)
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 0x6e23b(%rip), %rsi     # 0xba79e
leaq 0x6e275(%rip), %rdx     # 0xba7df
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0xaf83d(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0xaf815(%rip), %rsi     # 0xfbdb0
movq 0xb0a36(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x4c612
jmp 0x4c626
jmp 0x4c623
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4c5da
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x4c5e4
jmp 0x4c626
movq %rax, %rbx
movq %r14, %rdi
callq 0x6200
jmp 0x4c626
jmp 0x4c5f2
jmp 0x4c623
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x4c612
jmp 0x4c626
jmp 0x4c623
jmp 0x4c605
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x4c626
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x4c626
jmp 0x4c623
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x4c63d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop