// File: /workspace/github_cpp_makefile_star2_O3/rossy[P]crossc/SPIRV-Cross/spirv_glsl.cpp
// Function: spirv_cross::CompilerGLSL::convert_separate_image_to_expression[abi:cxx11](unsigned int)
std::string CompilerGLSL::convert_separate_image_to_expression(uint32_t id)
{
	auto *var = maybe_get_backing_variable(id);

	// If we are fetching from a plain OpTypeImage, we must combine with a dummy sampler in GLSL.
	// In Vulkan GLSL, we can make use of the newer GL_EXT_samplerless_texture_functions.
	if (var)
	{
		auto &type = get<SPIRType>(var->basetype);
		if (type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer)
		{
			if (options.vulkan_semantics)
			{
				// Newer glslang supports this extension to deal with texture2D as argument to texture functions.
				if (dummy_sampler_id)
					SPIRV_CROSS_THROW("Vulkan GLSL should not have a dummy sampler for combining.");
				require_extension_internal("GL_EXT_samplerless_texture_functions");
			}
			else
			{
				if (!dummy_sampler_id)
					SPIRV_CROSS_THROW(
					    "Cannot find dummy sampler ID. Was build_dummy_sampler_for_combined_images() called?");

				return to_combined_image_sampler(id, dummy_sampler_id);
			}
		}
	}

	return to_expression(id);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movl %edx, %esi
callq 0x12c9a
testq %rax, %rax
je 0x3ca34
movl 0xc(%rax), %esi
movq %r14, %rdi
callq 0xa3ea
cmpl $0xd, 0xc(%rax)
jne 0x3ca34
cmpl $0x1, 0x8c(%rax)
jne 0x3ca34
cmpl $0x5, 0x84(%rax)
je 0x3ca34
movl 0x39c(%r14), %ecx
cmpb $0x1, 0x43e(%r14)
jne 0x3ca4f
testl %ecx, %ecx
jne 0x3ca62
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7bbc5(%rip), %rsi     # 0xb85c4
leaq 0x7bbe2(%rip), %rdx     # 0xb85e8
leaq 0x8(%rsp), %rdi
callq 0x7be0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x26356
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3ca34
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x33f8a
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testl %ecx, %ecx
je 0x3cac8
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3b62a
jmp 0x3ca41
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7bb0a(%rip), %rsi     # 0xb8589
leaq 0x7bb3d(%rip), %rdx     # 0xb85c3
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0xbf321(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0xbf2f9(%rip), %rsi     # 0xfbdb0
movq 0xc051a(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
jmp 0x3cb2c
movl $0x10, %edi
callq 0x6140
movq %rax, %r14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x7bb04(%rip), %rsi     # 0xb85e9
leaq 0x7bb50(%rip), %rdx     # 0xb863c
leaq 0x8(%rsp), %rdi
callq 0x7be0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x6320
leaq 0xbf2bb(%rip), %rax     # 0xfbdc8
addq $0x10, %rax
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0xbf293(%rip), %rsi     # 0xfbdb0
movq 0xc04b4(%rip), %rdx     # 0xfcfd8
movq %r14, %rdi
callq 0x6470
jmp 0x3cb30
jmp 0x3cb51
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3cb4a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
testb %bpl, %bpl
jne 0x3cb54
jmp 0x3cb7d
movq %rax, %rbx
movq %r14, %rdi
callq 0x6200
jmp 0x3cb7d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3cb7d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x3cb7d
movq %rax, %rbx
movq %rbx, %rdi
callq 0x64a0
nop