// File: /workspace/github_cpp_makefile_star2_O3/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::AnalyzeVariableScopeAccessHandler::set_current_block(spirv_cross::SPIRBlock const&)
void Compiler::AnalyzeVariableScopeAccessHandler::set_current_block(const SPIRBlock &block)
{
	current_block = &block;

	// If we're branching to a block which uses OpPhi, in GLSL
	// this will be a variable write when we branch,
	// so we need to track access to these variables as well to
	// have a complete picture.
	const auto test_phi = [this, &block](uint32_t to) {
		auto &next = compiler.get<SPIRBlock>(to);
		for (auto &phi : next.phi_variables)
		{
			if (phi.parent == block.self)
			{
				accessed_variables_to_block[phi.function_variable].insert(block.self);
				// Phi variables are also accessed in our target branch block.
				accessed_variables_to_block[phi.function_variable].insert(next.self);

				notify_variable_access(phi.local_variable, block.self);
			}
		}
	};

	switch (block.terminator)
	{
	case SPIRBlock::Direct:
		notify_variable_access(block.condition, block.self);
		test_phi(block.next_block);
		break;

	case SPIRBlock::Select:
		notify_variable_access(block.condition, block.self);
		test_phi(block.true_block);
		test_phi(block.false_block);
		break;

	case SPIRBlock::MultiSelect:
		notify_variable_access(block.condition, block.self);
		for (auto &target : block.cases)
			test_phi(target.block);
		if (block.default_block)
			test_phi(block.default_block);
		break;

	default:
		break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x8(%rsp)
movq %rsi, 0x130(%rdi)
movq %rsi, 0x20(%rsp)
movl 0xc(%rsi), %eax
cmpl $0x3, %eax
je 0x18729
cmpl $0x2, %eax
je 0x185cf
cmpl $0x1, %eax
jne 0x188b6
movq 0x20(%rsp), %r14
movl 0x8(%r14), %edx
movl 0x28(%r14), %esi
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x188c6
movl 0x18(%r14), %esi
movq 0x8(%rbx), %rdi
callq 0x7870
movq 0x50(%rax), %rbx
movq %rax, 0x10(%rsp)
movq 0x58(%rax), %r14
cmpq %r14, %rbx
je 0x188b6
addq $0x8, 0x20(%rsp)
movq 0x8(%rsp), %rax
leaq 0x18(%rax), %r12
addq $0x8, 0x10(%rsp)
movq 0x20(%rsp), %r13
movl 0x4(%rbx), %eax
movq 0x20(%rsp), %rcx
cmpl (%rcx), %eax
jne 0x185c1
leaq 0x8(%rbx), %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x23124
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq %r13, %rsi
leaq 0x18(%rsp), %r15
movq %r15, %rdx
callq 0x1f510
movq %r12, %rdi
movq %rbp, %rsi
callq 0x23124
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
callq 0x1f510
movl (%rbx), %esi
movl (%r13), %edx
movq 0x8(%rsp), %rdi
callq 0x188c6
addq $0xc, %rbx
cmpq %r14, %rbx
jne 0x1855e
jmp 0x188b6
movq 0x20(%rsp), %r14
movl 0x8(%r14), %edx
movl 0x28(%r14), %esi
leaq 0x8(%r14), %r15
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x188c6
movl 0x2c(%r14), %esi
movq 0x8(%rbx), %rdi
callq 0x7870
movq 0x50(%rax), %rbx
movq %rax, 0x10(%rsp)
movq 0x58(%rax), %r14
cmpq %r14, %rbx
je 0x18682
movq 0x8(%rsp), %rax
leaq 0x18(%rax), %r13
addq $0x8, 0x10(%rsp)
movl 0x4(%rbx), %eax
cmpl (%r15), %eax
jne 0x18679
leaq 0x8(%rbx), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x23124
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq %r15, %rsi
leaq 0x18(%rsp), %r12
movq %r12, %rdx
callq 0x1f510
movq %r13, %rdi
movq %rbp, %rsi
callq 0x23124
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x1f510
movl (%rbx), %esi
movl (%r15), %edx
movq 0x8(%rsp), %rdi
callq 0x188c6
addq $0xc, %rbx
cmpq %r14, %rbx
jne 0x1861b
movq 0x20(%rsp), %rax
movl 0x30(%rax), %esi
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x7870
movq 0x50(%rax), %rbx
movq %rax, 0x10(%rsp)
movq 0x58(%rax), %r13
cmpq %r13, %rbx
je 0x188b6
movq 0x8(%rsp), %rax
leaq 0x18(%rax), %r12
addq $0x8, 0x10(%rsp)
movl 0x4(%rbx), %eax
cmpl (%r15), %eax
jne 0x1871b
leaq 0x8(%rbx), %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x23124
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq %r15, %rsi
leaq 0x18(%rsp), %r14
movq %r14, %rdx
callq 0x1f510
movq %r12, %rdi
movq %rbp, %rsi
callq 0x23124
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x1f510
movl (%rbx), %esi
movl (%r15), %edx
movq 0x8(%rsp), %rdi
callq 0x188c6
addq $0xc, %rbx
cmpq %r13, %rbx
jne 0x186bd
jmp 0x188b6
movq 0x20(%rsp), %rbx
movl 0x8(%rbx), %edx
movl 0x28(%rbx), %esi
leaq 0x8(%rbx), %r15
movq 0x8(%rsp), %rdi
callq 0x188c6
movq 0x98(%rbx), %rcx
movq 0xa0(%rbx), %rax
movq %rax, 0x28(%rsp)
cmpq %rax, %rcx
je 0x18810
movq 0x8(%rsp), %rax
leaq 0x18(%rax), %r12
movq %rcx, 0x30(%rsp)
movl 0x4(%rcx), %esi
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x7870
movq 0x50(%rax), %rbx
movq %rax, 0x10(%rsp)
movq 0x58(%rax), %r13
cmpq %r13, %rbx
je 0x187fc
addq $0x8, 0x10(%rsp)
movl 0x4(%rbx), %eax
cmpl (%r15), %eax
jne 0x187f3
leaq 0x8(%rbx), %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x23124
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq %r15, %rsi
leaq 0x18(%rsp), %rbp
movq %rbp, %rdx
callq 0x1f510
movq %r12, %rdi
movq %r14, %rsi
callq 0x23124
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq 0x10(%rsp), %rsi
movq %rbp, %rdx
callq 0x1f510
movl (%rbx), %esi
movl (%r15), %edx
movq 0x8(%rsp), %rdi
callq 0x188c6
addq $0xc, %rbx
cmpq %r13, %rbx
jne 0x18795
movq 0x30(%rsp), %rcx
addq $0x8, %rcx
cmpq 0x28(%rsp), %rcx
jne 0x18767
movq 0x20(%rsp), %rax
movl 0x34(%rax), %esi
testl %esi, %esi
je 0x188b6
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x7870
movq 0x50(%rax), %rbx
movq %rax, 0x10(%rsp)
movq 0x58(%rax), %r13
cmpq %r13, %rbx
je 0x188b6
movq 0x8(%rsp), %rax
leaq 0x18(%rax), %r12
addq $0x8, 0x10(%rsp)
movl 0x4(%rbx), %eax
cmpl (%r15), %eax
jne 0x188ad
leaq 0x8(%rbx), %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x23124
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq %r15, %rsi
leaq 0x18(%rsp), %r14
movq %r14, %rdx
callq 0x1f510
movq %r12, %rdi
movq %rbp, %rsi
callq 0x23124
movq %rax, 0x18(%rsp)
movq %rax, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
callq 0x1f510
movl (%rbx), %esi
movl (%r15), %edx
movq 0x8(%rsp), %rdi
callq 0x188c6
addq $0xc, %rbx
cmpq %r13, %rbx
jne 0x1884f
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop