// File: /workspace/github_cpp_makefile_star2_O2/rossy[P]crossc/SPIRV-Cross/spirv_cpp.cpp
// Function: spirv_cross::CompilerCPP::emit_function_prototype(spirv_cross::SPIRFunction&, spirv_cross::Bitset const&)
void CompilerCPP::emit_function_prototype(SPIRFunction &func, const Bitset &)
{
	if (func.self != ir.default_entry_point)
		add_function_overload(func);

	local_variable_names = resource_names;
	string decl;

	auto &type = get<SPIRType>(func.return_type);
	decl += "inline ";
	decl += type_to_glsl(type);
	decl += " ";

	if (func.self == ir.default_entry_point)
	{
		decl += "main";
		processing_entry_point = true;
	}
	else
		decl += to_name(func.self);

	decl += "(";
	for (auto &arg : func.arguments)
	{
		add_local_variable_name(arg.id);

		decl += argument_decl(arg);
		if (&arg != &func.arguments.back())
			decl += ", ";

		// Hold a pointer to the parameter so we can invalidate the readonly field if needed.
		auto *var = maybe_get<SPIRVariable>(arg.id);
		if (var)
			var->parameter = &arg;
	}

	decl += ")";
	statement(decl);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rsi), %eax
cmpl 0x108(%rdi), %eax
je 0x88aa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e668
leaq 0x488(%rbx), %rsi
leaq 0x450(%rbx), %rdi
callq 0xb54c
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x90a4
movq %rax, %r15
leaq 0x86cab(%rip), %rsi     # 0x8f58f
leaq 0x8(%rsp), %rdi
callq 0x64d0
movq (%rbx), %rax
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq *0x98(%rax)
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x64f0
leaq 0x28(%rsp), %rdi
callq 0x6548
leaq 0x86f62(%rip), %rsi     # 0x8f886
leaq 0x8(%rsp), %rdi
callq 0x64d0
movl 0x8(%r14), %edx
cmpl 0x108(%rbx), %edx
jne 0x8954
leaq 0x9012c(%rip), %rsi     # 0x98a6d
leaq 0x8(%rsp), %rdi
callq 0x64d0
movb $0x1, 0x5d8(%rbx)
jmp 0x897e
movq (%rbx), %rax
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq *0x38(%rax)
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x64f0
leaq 0x28(%rsp), %rdi
callq 0x6548
leaq 0x952a4(%rip), %rsi     # 0x9dc29
leaq 0x8(%rsp), %rdi
callq 0x64d0
movq 0x18(%r14), %r15
movq 0x20(%r14), %rbp
leaq 0x28(%rsp), %r12
leaq 0x8(%rsp), %r13
cmpq %rbp, %r15
je 0x8a0a
movl 0x4(%r15), %esi
movq %rbx, %rdi
callq 0x2f168
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x8a74
movq %r13, %rdi
movq %r12, %rsi
callq 0x64f0
movq %r12, %rdi
callq 0x6548
movq 0x20(%r14), %rax
addq $-0x14, %rax
cmpq %rax, %r15
je 0x89ef
movq %r13, %rdi
leaq 0x8c6a1(%rip), %rsi     # 0x9508b
callq 0x64d0
movl 0x4(%r15), %esi
movq %rbx, %rdi
callq 0xa9e4
testq %rax, %rax
je 0x8a04
movq %r15, 0x68(%rax)
addq $0x14, %r15
jmp 0x89a1
leaq 0x8cfe4(%rip), %rsi     # 0x959f5
leaq 0x8(%rsp), %rdi
callq 0x64d0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x9da6
leaq 0x8(%rsp), %rdi
callq 0x6548
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8a4d
jmp 0x8a5e
jmp 0x8a4d
jmp 0x8a5e
jmp 0x8a5e
jmp 0x8a5e
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6548
jmp 0x8a61
jmp 0x8a5e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6548
movq %rbx, %rdi
callq 0x64b0
nop