// File: /workspace/github_cpp_makefile_star2_O3/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, %rbp
leaq 0x48(%rsp), %rdi
movq %rbp, %rsi
callq 0x1a7b4
leaq 0x58(%rsp), %rdi
leaq 0x108(%rbp), %rsi
callq 0x236f2
movq %rax, %rbx
movl $0x90, %edi
callq 0x6250
movq %rax, %r15
movl 0x108(%rbp), %esi
movq %rbp, %rdi
callq 0xb98a
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x718c
movq (%rbx), %rsi
movq %r15, (%rbx)
testq %rsi, %rsi
je 0x1a487
movq %rbx, %rdi
callq 0xe060
movl 0x108(%rbp), %esi
movq %rbp, %rdi
callq 0xb98a
leaq 0x48(%rsp), %rdx
movq %rbp, %rdi
movq %rax, %rsi
callq 0x13dbc
leaq 0x3a0(%rbp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x67ec
movq 0x3b0(%rbp), %r15
testq %r15, %r15
je 0x1a6e6
leaq 0x8(%rbp), %rax
movq %rax, 0x20(%rsp)
leaq 0x90(%rsp), %r12
leaq 0xe1b22(%rip), %rax     # 0xfc000
addq $0x10, %rax
movq %rax, 0x18(%rsp)
movl 0x8(%r15), %esi
movq %rbp, %rdi
callq 0xb98a
movq %rax, %rbx
movq %r12, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x183ea
movq %r15, 0x28(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1919a
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x18f5e
movq 0x68(%rbx), %r12
movq 0x70(%rbx), %rax
movq %rax, 0x40(%rsp)
cmpq %rax, %r12
je 0x1a67f
movl (%r12), %esi
movq %rbp, %rdi
callq 0x7870
movq %rax, %r13
movq 0xd0(%rax), %rax
movq 0xd8(%r13), %rcx
subq %rax, %rcx
cmpq $0x5, %rcx
jb 0x1a670
movl (%rax), %esi
movq 0x20(%rsp), %rdi
callq 0x2496c
movq %rax, 0x8(%rsp)
movq 0xd0(%r13), %rax
movl (%rax), %esi
movq %rbp, %rdi
callq 0xb3ca
movq 0xd0(%r13), %r15
movq 0xd8(%r13), %rcx
movq %rcx, 0x30(%rsp)
cmpq %rcx, %r15
je 0x1a670
movl 0xc(%rax), %eax
movl %eax, 0x14(%rsp)
movq 0x8(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x38(%rsp)
movl (%r15), %esi
movq 0x20(%rsp), %rdi
callq 0x2496c
movq %rax, %rbx
movq 0x8(%rsp), %rax
movq (%rax), %rax
cmpq (%rbx), %rax
jne 0x1a62f
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
cmpq 0x20(%rbx), %rax
jne 0x1a62f
addq $0x8, %rbx
movq 0x38(%rsp), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x1a608
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x1f4b4
testq %rax, %rax
jne 0x1a5ed
jmp 0x1a62f
movq 0xd0(%r13), %rax
movl (%rax), %esi
movq %rbp, %rdi
callq 0xb3ca
movl 0x14(%rsp), %ecx
cmpl 0xc(%rax), %ecx
jne 0x1a62f
addq $0x4, %r15
cmpq 0x30(%rsp), %r15
jne 0x1a5b8
jmp 0x1a670
movq 0xd0(%r13), %rbx
movq 0xd8(%r13), %r15
cmpq %r15, %rbx
je 0x1a670
movl (%rbx), %esi
movq %rbp, %rdi
callq 0xb3ca
movb $0x0, 0x64(%rax)
addq $0x4, %rbx
cmpq %r15, %rbx
jne 0x1a642
movq 0xd0(%r13), %rax
cmpq %rax, 0xd8(%r13)
je 0x1a670
movq %rax, 0xd8(%r13)
addq $0x4, %r12
cmpq 0x40(%rsp), %r12
jne 0x1a53b
movq 0x18(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x188(%rsp), %rdi
callq 0x1f41a
leaq 0x150(%rsp), %rdi
callq 0x1f41a
leaq 0x118(%rsp), %rdi
callq 0xdcda
leaq 0xe0(%rsp), %rdi
callq 0x1f41a
leaq 0xa8(%rsp), %rdi
callq 0x1f41a
movq 0x28(%rsp), %r15
movq (%r15), %r15
testq %r15, %r15
leaq 0x90(%rsp), %r12
jne 0x1a4e7
leaq 0xe19a3(%rip), %rax     # 0xfc090
addq $0x10, %rax
movq %rax, 0x48(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xdfc0
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0xd549
movq %rax, %r14
movl $0x90, %esi
movq %r15, %rdi
callq 0x6260
jmp 0x1a792
jmp 0x1a730
jmp 0x1a730
movq %rax, %r14
jmp 0x1a792
jmp 0x1a741
jmp 0x1a741
jmp 0x1a741
jmp 0x1a741
jmp 0x1a741
jmp 0x1a741
movq %rax, %r14
movq 0x18(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x188(%rsp), %rdi
callq 0x1f41a
leaq 0x150(%rsp), %rdi
callq 0x1f41a
leaq 0x118(%rsp), %rdi
callq 0xdcda
leaq 0xe0(%rsp), %rdi
callq 0x1f41a
leaq 0xa8(%rsp), %rdi
callq 0x1f41a
leaq 0xe18f7(%rip), %rax     # 0xfc090
addq $0x10, %rax
movq %rax, 0x48(%rsp)
leaq 0x58(%rsp), %rdi
callq 0xdfc0
movq %r14, %rdi
callq 0x64a0