// File: /workspace/github_cpp_makefile_star2_O1/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 0x98fc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d5f8
leaq 0x488(%rbx), %rsi
leaq 0x450(%rbx), %rdi
callq 0xd5d6
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0xa426
movq %rax, %r15
leaq 0xabc7e(%rip), %rsi     # 0xb55b7
leaq 0x28(%rsp), %rdi
callq 0x64e0
movq (%rbx), %rax
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq *0x98(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x60b0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9988
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xabf1f(%rip), %rsi     # 0xb58ae
leaq 0x28(%rsp), %rdi
callq 0x64e0
movl 0x8(%r14), %edx
cmpl 0x108(%rbx), %edx
jne 0x99bf
leaq 0xb5129(%rip), %rsi     # 0xbead5
leaq 0x28(%rsp), %rdi
callq 0x64e0
movb $0x1, 0x5d8(%rbx)
jmp 0x9a02
movq (%rbx), %rax
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9a02
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0xba298(%rip), %rsi     # 0xc3ca1
leaq 0x28(%rsp), %rdi
callq 0x64e0
movq 0x18(%r14), %r15
movq 0x20(%r14), %rbp
cmpq %rbp, %r15
je 0x9ab4
leaq 0x8(%rsp), %r12
leaq 0x28(%rsp), %r13
movl 0x4(%r15), %esi
movq %rbx, %rdi
callq 0x39b62
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x9b60
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r13, %rdi
callq 0x60b0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9a76
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
movq 0x20(%r14), %rax
addq $-0x14, %rax
cmpq %rax, %r15
je 0x9a92
movq %r13, %rdi
leaq 0xb162e(%rip), %rsi     # 0xbb0bb
callq 0x64e0
movl 0x4(%r15), %esi
movq %rbx, %rdi
callq 0xc7f4
testq %rax, %rax
je 0x9aa7
movq %r15, 0x68(%rax)
addq $0x14, %r15
cmpq %rbp, %r15
jne 0x9a2e
leaq 0xb1f6a(%rip), %rsi     # 0xbba25
leaq 0x28(%rsp), %rdi
callq 0x64e0
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0xb674
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x9aee
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9b17
jmp 0x9b38
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x9b24
jmp 0x9b38
jmp 0x9b38
jmp 0x9b38
jmp 0x9b38
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9b3b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x9b3b
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x9b57
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0
nop