// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::get_shader_resources(std::unordered_set<unsigned int, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<unsigned int>> const*) const
ShaderResources Compiler::get_shader_resources(const unordered_set<uint32_t> *active_variables) const
{
	ShaderResources res;

	for (auto &id : ir.ids)
	{
		if (id.get_type() != TypeVariable)
			continue;

		auto &var = id.get<SPIRVariable>();
		auto &type = get<SPIRType>(var.basetype);

		// It is possible for uniform storage classes to be passed as function parameters, so detect
		// that. To detect function parameters, check of StorageClass of variable is function scope.
		if (var.storage == StorageClassFunction || !type.pointer || is_builtin_variable(var))
			continue;

		if (active_variables && active_variables->find(var.self) == end(*active_variables))
			continue;

		// Input
		if (var.storage == StorageClassInput && interface_variable_exists_in_entry_point(var.self))
		{
			if (ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock))
				res.stage_inputs.push_back(
				    { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self) });
			else
				res.stage_inputs.push_back({ var.self, var.basetype, type.self, ir.meta[var.self].decoration.alias });
		}
		// Subpass inputs
		else if (var.storage == StorageClassUniformConstant && type.image.dim == DimSubpassData)
		{
			res.subpass_inputs.push_back({ var.self, var.basetype, type.self, ir.meta[var.self].decoration.alias });
		}
		// Outputs
		else if (var.storage == StorageClassOutput && interface_variable_exists_in_entry_point(var.self))
		{
			if (ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock))
				res.stage_outputs.push_back(
				    { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self) });
			else
				res.stage_outputs.push_back({ var.self, var.basetype, type.self, ir.meta[var.self].decoration.alias });
		}
		// UBOs
		else if (type.storage == StorageClassUniform &&
		         (ir.meta[type.self].decoration.decoration_flags.get(DecorationBlock)))
		{
			res.uniform_buffers.push_back(
			    { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self) });
		}
		// Old way to declare SSBOs.
		else if (type.storage == StorageClassUniform &&
		         (ir.meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock)))
		{
			res.storage_buffers.push_back(
			    { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self) });
		}
		// Modern way to declare SSBOs.
		else if (type.storage == StorageClassStorageBuffer)
		{
			res.storage_buffers.push_back(
			    { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self) });
		}
		// Push constant blocks
		else if (type.storage == StorageClassPushConstant)
		{
			// There can only be one push constant block, but keep the vector in case this restriction is lifted
			// in the future.
			res.push_constant_buffers.push_back(
			    { var.self, var.basetype, type.self, ir.meta[var.self].decoration.alias });
		}
		// Images
		else if (type.storage == StorageClassUniformConstant && type.basetype == SPIRType::Image &&
		         type.image.sampled == 2)
		{
			res.storage_images.push_back({ var.self, var.basetype, type.self, ir.meta[var.self].decoration.alias });
		}
		// Separate images
		else if (type.storage == StorageClassUniformConstant && type.basetype == SPIRType::Image &&
		         type.image.sampled == 1)
		{
			res.separate_images.push_back({ var.self, var.basetype, type.self, ir.meta[var.self].decoration.alias });
		}
		// Separate samplers
		else if (type.storage == StorageClassUniformConstant && type.basetype == SPIRType::Sampler)
		{
			res.separate_samplers.push_back({ var.self, var.basetype, type.self, ir.meta[var.self].decoration.alias });
		}
		// Textures
		else if (type.storage == StorageClassUniformConstant && type.basetype == SPIRType::SampledImage)
		{
			res.sampled_images.push_back({ var.self, var.basetype, type.self, ir.meta[var.self].decoration.alias });
		}
		// Atomic counters
		else if (type.storage == StorageClassAtomicCounter)
		{
			res.atomic_counters.push_back({ var.self, var.basetype, type.self, ir.meta[var.self].decoration.alias });
		}
	}

	return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, 0x48(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
movl $0x108, %edx            # imm = 0x108
xorl %esi, %esi
callq 0x6180
movq 0x20(%r15), %r12
movq 0x28(%r15), %r14
cmpq %r14, %r12
je 0x13b67
leaq 0x18(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x78(%rbx), %rax
movq %rax, 0x68(%rsp)
leaq 0xc0(%rbx), %rax
movq %rax, 0x78(%rsp)
leaq 0xa8(%rbx), %rax
movq %rax, 0x50(%rsp)
leaq 0x90(%rbx), %rax
movq %rax, 0x58(%rsp)
leaq 0xf0(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq 0xd8(%rbx), %rax
movq %rax, 0x70(%rsp)
leaq 0x48(%rbx), %rax
movq %rax, 0x38(%rsp)
leaq 0x60(%rbx), %rax
movq %rax, 0x80(%rsp)
leaq 0x30(%rbx), %rax
movq %rax, 0x40(%rsp)
cmpl $0x2, 0x8(%r12)
jne 0x13b5a
movq %r12, %rdi
callq 0x1bcc8
movq %rax, %r13
movl 0xc(%rax), %esi
movq %r15, %rdi
callq 0x1b9de
cmpl $0x7, 0x10(%r13)
je 0x13b5a
movq %rax, %rbp
cmpb $0x1, 0x60(%rax)
jne 0x13b5a
movq %r15, %rdi
movq %r13, %rsi
callq 0x133a2
testb %al, %al
jne 0x13b5a
cmpq $0x0, 0x48(%rsp)
je 0x1365a
movq %r13, %rcx
addq $0x8, %rcx
movl 0x8(%r13), %r8d
movq %r8, %rax
xorl %edx, %edx
movq 0x48(%rsp), %rdi
divq 0x8(%rdi)
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq 0x1f088
testq %rax, %rax
je 0x13b5a
cmpq $0x0, (%rax)
je 0x13b5a
cmpl $0x1, 0x10(%r13)
jne 0x136d6
movl 0x8(%r13), %esi
movq %r15, %rdi
callq 0x13f62
testb %al, %al
je 0x136d6
movl 0x8(%rbp), %eax
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rdx      # imm = 0x148
testb $0x4, 0x60(%rcx,%rdx)
jne 0x13845
movl 0x8(%r13), %edx
movl %edx, (%rsp)
movl 0xc(%r13), %esi
movl %esi, 0x4(%rsp)
movl %eax, 0x8(%rsp)
imulq $0x148, %rdx, %rax      # imm = 0x148
leaq 0x20(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe480
movq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
movl 0x10(%r13), %eax
testl %eax, %eax
jne 0x1373d
cmpl $0x6, 0x84(%rbp)
jne 0x1373d
movl 0x8(%r13), %eax
movl %eax, (%rsp)
movl 0xc(%r13), %ecx
movl %ecx, 0x4(%rsp)
movl 0x8(%rbp), %ecx
movl %ecx, 0x8(%rsp)
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq 0x20(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe480
movq 0x80(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
cmpl $0x3, %eax
jne 0x137b7
movl 0x8(%r13), %esi
movq %r15, %rdi
callq 0x13f62
testb %al, %al
je 0x137b7
movl 0x8(%rbp), %eax
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rdx      # imm = 0x148
testb $0x4, 0x60(%rcx,%rdx)
jne 0x139d0
movl 0x8(%r13), %edx
movl %edx, (%rsp)
movl 0xc(%r13), %esi
movl %esi, 0x4(%rsp)
movl %eax, 0x8(%rsp)
imulq $0x148, %rdx, %rax      # imm = 0x148
leaq 0x20(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe480
movq 0x38(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
movl 0x64(%rbp), %eax
cmpl $0x2, %eax
jne 0x137f6
movl 0x8(%rbp), %ecx
movq 0x38(%r15), %rdx
imulq $0x148, %rcx, %rsi      # imm = 0x148
testb $0x4, 0x60(%rdx,%rsi)
jne 0x13877
cmpl $0x2, %eax
jne 0x137f6
movl 0x8(%rbp), %ecx
movq 0x38(%r15), %rdx
imulq $0x148, %rcx, %rsi      # imm = 0x148
testb $0x8, 0x60(%rdx,%rsi)
jne 0x13abc
testl %eax, %eax
je 0x138fa
cmpl $0x9, %eax
je 0x138a7
cmpl $0xc, %eax
jne 0x1395c
movl 0x8(%r13), %edx
movl %edx, (%rsp)
movl 0xc(%r13), %eax
movl %eax, 0x4(%rsp)
movl 0x8(%rbp), %eax
movl %eax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x14082
movq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
movl 0x8(%r13), %edx
movl %edx, (%rsp)
movl 0xc(%r13), %ecx
movl %ecx, 0x4(%rsp)
movl %eax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x14082
movq 0x40(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
movl 0x8(%r13), %edx
movl %edx, (%rsp)
movl 0xc(%r13), %eax
movl %eax, 0x4(%rsp)
movl %ecx, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x14082
movq %rbx, %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
movl 0x8(%r13), %eax
movl %eax, (%rsp)
movl 0xc(%r13), %ecx
movl %ecx, 0x4(%rsp)
movl 0x8(%rbp), %ecx
movl %ecx, 0x8(%rsp)
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq 0x20(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe480
movq 0x78(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
cmpl $0xd, 0xc(%rbp)
jne 0x1395c
cmpl $0x2, 0x8c(%rbp)
jne 0x1395c
movl 0x8(%r13), %eax
movl %eax, (%rsp)
movl 0xc(%r13), %ecx
movl %ecx, 0x4(%rsp)
movl 0x8(%rbp), %ecx
movl %ecx, 0x8(%rsp)
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq 0x20(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe480
movq 0x68(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
movl 0xc(%rbp), %ecx
testl %eax, %eax
jne 0x13a02
cmpl $0xd, %ecx
jne 0x13a02
cmpl $0x1, 0x8c(%rbp)
jne 0x13a02
movl 0x8(%r13), %eax
movl %eax, (%rsp)
movl 0xc(%r13), %ecx
movl %ecx, 0x4(%rsp)
movl 0x8(%rbp), %ecx
movl %ecx, 0x8(%rsp)
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq 0x20(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe480
movq 0x70(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
movl 0x8(%r13), %edx
movl %edx, (%rsp)
movl 0xc(%r13), %ecx
movl %ecx, 0x4(%rsp)
movl %eax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x14082
movq 0x38(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
movl %ecx, %edx
xorl $0xf, %edx
orl %eax, %edx
jne 0x13a5e
movl 0x8(%r13), %eax
movl %eax, (%rsp)
movl 0xc(%r13), %ecx
movl %ecx, 0x4(%rsp)
movl 0x8(%rbp), %ecx
movl %ecx, 0x8(%rsp)
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq 0x20(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe480
movq 0x60(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
xorl $0xe, %ecx
orl %eax, %ecx
jne 0x13aeb
movl 0x8(%r13), %eax
movl %eax, (%rsp)
movl 0xc(%r13), %ecx
movl %ecx, 0x4(%rsp)
movl 0x8(%rbp), %ecx
movl %ecx, 0x8(%rsp)
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq 0x20(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe480
movq 0x58(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
movl 0x8(%r13), %edx
movl %edx, (%rsp)
movl 0xc(%r13), %eax
movl %eax, 0x4(%rsp)
movl %ecx, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x14082
movq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
jmp 0x13b3e
cmpl $0xa, %eax
jne 0x13b5a
movl 0x8(%r13), %eax
movl %eax, (%rsp)
movl 0xc(%r13), %ecx
movl %ecx, 0x4(%rsp)
movl 0x8(%rbp), %ecx
movl %ecx, 0x8(%rsp)
movq 0x38(%r15), %rcx
imulq $0x148, %rax, %rax      # imm = 0x148
leaq 0x20(%rsp), %rdx
movq %rdx, 0x10(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0xe480
movq 0x50(%rsp), %rdi
movq %rsp, %rsi
callq 0x20bb6
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x13b5a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0x10, %r12
cmpq %r14, %r12
jne 0x135cb
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
jmp 0x13bb0
jmp 0x13bd7
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x13bda
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x13bda
jmp 0x13bd7
jmp 0x13bd7
jmp 0x13bd7
movq %rax, %r14
movq %rbx, %rdi
callq 0x1bdf0
movq %r14, %rdi
callq 0x64a0