// File: rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::build_dummy_sampler_for_combined_images()
uint32_t Compiler::build_dummy_sampler_for_combined_images()
{
	DummySamplerForCombinedImageHandler handler(*this);
	traverse_all_reachable_opcodes(get<SPIRFunction>(ir.default_entry_point), handler);
	if (handler.need_dummy_sampler)
	{
		uint32_t offset = ir.increase_bound_by(3);
		auto type_id = offset + 0;
		auto ptr_type_id = offset + 1;
		auto var_id = offset + 2;

		SPIRType sampler_type;
		auto &sampler = set<SPIRType>(type_id);
		sampler.basetype = SPIRType::Sampler;

		auto &ptr_sampler = set<SPIRType>(ptr_type_id);
		ptr_sampler = sampler;
		ptr_sampler.self = type_id;
		ptr_sampler.storage = StorageClassUniformConstant;
		ptr_sampler.pointer = true;

		set<SPIRVariable>(var_id, ptr_type_id, StorageClassUniformConstant, 0);
		set_name(var_id, "SPIRV_Cross_DummySampler");
		dummy_sampler_id = var_id;
		return var_id;
	}
	else
		return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x170(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x313f0
movq -0x170(%rbp), %rdi
movl 0x108(%rdi), %esi
callq 0x106d0
movq %rax, -0x168(%rbp)
jmp 0x27b6e
movq -0x168(%rbp), %rsi
movq -0x170(%rbp), %rdi
leaq -0x28(%rbp), %rdx
callq 0x21b20
jmp 0x27b87
testb $0x1, -0x18(%rbp)
je 0x27d9b
movq -0x170(%rbp), %rdi
addq $0x8, %rdi
movl $0x3, %esi
callq 0x55780
movl %eax, -0x174(%rbp)
jmp 0x27bae
movl -0x174(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
incl %eax
movl %eax, -0x40(%rbp)
movl -0x38(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x44(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x31440
movq -0x170(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x30cb0
movq %rax, -0x180(%rbp)
jmp 0x27bf2
movq -0x170(%rbp), %rdi
movq -0x180(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movl $0xf, 0xc(%rax)
movl -0x40(%rbp), %esi
callq 0x30cb0
movq %rax, -0x188(%rbp)
jmp 0x27c26
movq -0x188(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rsi
movq -0x130(%rbp), %rdi
callq 0x2f600
jmp 0x27c49
movq -0x170(%rbp), %rdi
movl -0x3c(%rbp), %ecx
movq -0x130(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x130(%rbp), %rax
movl $0x0, 0x64(%rax)
movq -0x130(%rbp), %rax
movb $0x1, 0x60(%rax)
movl -0x44(%rbp), %esi
movl $0x0, -0x134(%rbp)
movl $0x0, -0x138(%rbp)
leaq -0x40(%rbp), %rdx
leaq -0x134(%rbp), %rcx
leaq -0x138(%rbp), %r8
callq 0x30d00
jmp 0x27ca6
movl -0x44(%rbp), %eax
movl %eax, -0x194(%rbp)
leaq -0x159(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x7650
movq -0x190(%rbp), %rdx
leaq 0x117b93(%rip), %rsi    # 0x13f863
leaq -0x158(%rbp), %rdi
callq 0x7520
jmp 0x27cde
movl -0x194(%rbp), %esi
movq -0x170(%rbp), %rdi
leaq -0x158(%rbp), %rdx
callq 0x22cd0
jmp 0x27cf9
leaq -0x158(%rbp), %rdi
callq 0x7708
leaq -0x159(%rbp), %rdi
callq 0x73d0
movq -0x170(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, 0x39c(%rax)
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x160(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x314e0
jmp 0x27dac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x27dc1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x27d8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x27d81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x7708
leaq -0x159(%rbp), %rdi
callq 0x73d0
leaq -0x120(%rbp), %rdi
callq 0x314e0
jmp 0x27dc1
movl $0x0, -0x4(%rbp)
movl $0x1, -0x160(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x31550
movl -0x4(%rbp), %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x31550
movq -0x30(%rbp), %rdi
callq 0x7640
nopw %cs:(%rax,%rax)