// File: /workspace/github_cpp_makefile_star2_O1/rossy[P]crossc/SPIRV-Cross/spirv_cross.cpp
// Function: spirv_cross::Compiler::build_function_control_flow_graphs_and_analyze()
void Compiler::build_function_control_flow_graphs_and_analyze()
{
	CFGBuilder handler(*this);
	handler.function_cfgs[ir.default_entry_point].reset(new CFG(*this, get<SPIRFunction>(ir.default_entry_point)));
	traverse_all_reachable_opcodes(get<SPIRFunction>(ir.default_entry_point), handler);
	function_cfgs = move(handler.function_cfgs);

	for (auto &f : function_cfgs)
	{
		auto &func = get<SPIRFunction>(f.first);
		AnalyzeVariableScopeAccessHandler scope_handler(*this, func);
		analyze_variable_scope(func, scope_handler);
		find_function_local_luts(func, scope_handler);

		// Check if we can actually use the loop variables we found in analyze_variable_scope.
		// To use multiple initializers, we need the same type and qualifiers.
		for (auto block : func.blocks)
		{
			auto &b = get<SPIRBlock>(block);
			if (b.loop_variables.size() < 2)
				continue;

			auto &flags = get_decoration_bitset(b.loop_variables.front());
			uint32_t type = get<SPIRVariable>(b.loop_variables.front()).basetype;
			bool invalid_initializers = false;
			for (auto loop_variable : b.loop_variables)
			{
				if (flags != get_decoration_bitset(loop_variable) ||
				    type != get<SPIRVariable>(b.loop_variables.front()).basetype)
				{
					invalid_initializers = true;
					break;
				}
			}

			if (invalid_initializers)
			{
				for (auto loop_variable : b.loop_variables)
					get<SPIRVariable>(loop_variable).loop_variable = false;
				b.loop_variables.clear();
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, %r12
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x1ae72
leaq 0x58(%rsp), %rdi
leaq 0x108(%r12), %rsi
callq 0x23dc6
movq %rax, %rbx
movl $0x90, %edi
callq 0x6250
movq %rax, %r15
movl 0x108(%r12), %esi
movq %r12, %rdi
callq 0xb9ca
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x71ec
movq (%rbx), %rsi
movq %r15, (%rbx)
testq %rsi, %rsi
je 0x1aafa
movq %rbx, %rdi
callq 0xe096
movl 0x108(%r12), %esi
movq %r12, %rdi
callq 0xb9ca
leaq 0x48(%rsp), %rdx
movq %r12, %rdi
movq %rax, %rsi
callq 0x13ece
leaq 0x3a0(%r12), %rdi
leaq 0x58(%rsp), %rsi
callq 0x6800
movq 0x3b0(%r12), %rcx
testq %rcx, %rcx
je 0x1ada5
leaq 0x8(%r12), %rbp
leaq 0x90(%rsp), %r14
leaq 0xe247f(%rip), %rax     # 0xfcfd0
addq $0x10, %rax
movq %rax, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movq %rcx, 0x28(%rsp)
movl 0x8(%rcx), %esi
movq %r12, %rdi
callq 0xb9ca
movq %rax, %rbx
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x18922
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x19702
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x19498
movq 0x68(%rbx), %r13
movq 0x70(%rbx), %rax
movq %rax, 0x38(%rsp)
cmpq %rax, %r13
je 0x1ad3e
movl (%r13), %esi
movq %r12, %rdi
callq 0x78fe
movq 0xd0(%rax), %rdx
movq 0xd8(%rax), %rcx
subq %rdx, %rcx
cmpq $0x5, %rcx
jb 0x1ad2f
movq %rax, (%rsp)
movl (%rdx), %esi
movq %rbp, %rdi
callq 0x25000
movq %rax, %rbx
movq (%rsp), %r15
movq 0xd0(%r15), %rax
movl (%rax), %esi
movq %r12, %rdi
callq 0xb40a
movq 0xd0(%r15), %r14
movq 0xd8(%r15), %r15
cmpq %r15, %r14
je 0x1ad2f
movq %r13, 0x30(%rsp)
movl 0xc(%rax), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rax
addq $0x18, %rax
movq %rax, 0x40(%rsp)
xorl %r13d, %r13d
movq %r15, 0x20(%rsp)
movl (%r14), %esi
movq %rbp, %rdi
callq 0x25000
movq %rax, %r12
movq (%rbx), %rdx
movb $0x1, %al
movb $0x1, %cl
cmpq (%r12), %rdx
jne 0x1acc7
movq 0x20(%rbx), %rdx
movb $0x1, %al
cmpq 0x20(%r12), %rdx
jne 0x1acc7
movq %rbp, %r15
addq $0x8, %r12
movq 0x40(%rsp), %rbp
movq (%rbp), %rbp
testq %rbp, %rbp
je 0x1ac92
leaq 0x8(%rbp), %rsi
movq %r12, %rdi
callq 0x1fbce
testq %rax, %rax
jne 0x1ac6a
movb $0x1, %al
movb $0x1, %cl
movq %r15, %rbp
movq 0x20(%rsp), %r15
jmp 0x1acc7
movq (%rsp), %rax
movq 0xd0(%rax), %rax
movl (%rax), %esi
movq 0x18(%rsp), %rdi
callq 0xb40a
movq %r15, %rbp
movq 0x20(%rsp), %r15
movl 0xc(%rsp), %ecx
cmpl 0xc(%rax), %ecx
setne %cl
movzbl %r13b, %eax
movl $0x1, %edx
cmovnel %edx, %eax
testb %cl, %cl
jne 0x1acdb
addq $0x4, %r14
movl %eax, %r13d
cmpq %r15, %r14
jne 0x1ac36
testb $0x1, %al
movq 0x18(%rsp), %r12
movq 0x30(%rsp), %r13
movq (%rsp), %rax
je 0x1ad2f
movq 0xd0(%rax), %rbx
movq 0xd8(%rax), %r14
cmpq %r14, %rbx
je 0x1ad14
movl (%rbx), %esi
movq %r12, %rdi
callq 0xb40a
movb $0x0, 0x64(%rax)
addq $0x4, %rbx
jmp 0x1acfb
movq (%rsp), %rcx
movq 0xd0(%rcx), %rax
cmpq %rax, 0xd8(%rcx)
je 0x1ad2f
movq %rax, 0xd8(%rcx)
addq $0x4, %r13
cmpq 0x38(%rsp), %r13
jne 0x1abb2
movq 0x10(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x188(%rsp), %rdi
callq 0x1fb34
leaq 0x150(%rsp), %rdi
callq 0x1fb34
leaq 0x118(%rsp), %rdi
callq 0xdd10
leaq 0xe0(%rsp), %rdi
callq 0x1fb34
leaq 0xa8(%rsp), %rdi
callq 0x1fb34
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
leaq 0x90(%rsp), %r14
jne 0x1ab5f
leaq 0xe22b4(%rip), %rax     # 0xfd060
addq $0x10, %rax
movq %rax, 0x48(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xdff6
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xd589
movq %rax, %rbx
movl $0x90, %esi
movq %r15, %rdi
callq 0x6260
jmp 0x1ae50
jmp 0x1adef
jmp 0x1adef
movq %rax, %rbx
jmp 0x1ae50
jmp 0x1ae00
jmp 0x1ae00
jmp 0x1ae00
jmp 0x1ae00
jmp 0x1ae00
jmp 0x1ae00
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
movq 0x10(%rsp), %rax
movq %rax, -0xf8(%rdi)
callq 0x1fb34
leaq 0x150(%rsp), %rdi
callq 0x1fb34
leaq 0x118(%rsp), %rdi
callq 0xdd10
leaq 0xe0(%rsp), %rdi
callq 0x1fb34
leaq 0xa8(%rsp), %rdi
callq 0x1fb34
leaq 0xe2209(%rip), %rax     # 0xfd060
addq $0x10, %rax
movq %rax, 0x48(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xdff6
movq %rbx, %rdi
callq 0x64a0