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

	// Avoid shadow declarations.
	local_variable_names = resource_names;

	string decl;

	auto &type = get<SPIRType>(func.return_type);
	decl += flags_to_precision_qualifiers_glsl(type, return_flags);
	decl += type_to_glsl(type);
	decl += type_to_array_glsl(type);
	decl += " ";

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

	decl += "(";
	vector<string> arglist;
	for (auto &arg : func.arguments)
	{
		// Do not pass in separate images or samplers if we're remapping
		// to combined image samplers.
		if (skip_argument(arg.id))
			continue;

		// Might change the variable name if it already exists in this function.
		// SPIRV OpName doesn't have any semantic effect, so it's valid for an implementation
		// to use same name for variables.
		// Since we want to make the GLSL debuggable and somewhat sane, use fallback names for variables which are duplicates.
		add_local_variable_name(arg.id);

		arglist.push_back(argument_decl(arg));

		// 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;
	}

	for (auto &arg : func.shadow_arguments)
	{
		// Might change the variable name if it already exists in this function.
		// SPIRV OpName doesn't have any semantic effect, so it's valid for an implementation
		// to use same name for variables.
		// Since we want to make the GLSL debuggable and somewhat sane, use fallback names for variables which are duplicates.
		add_local_variable_name(arg.id);

		arglist.push_back(argument_decl(arg));

		// 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 += merge(arglist);
	decl += ")";
	statement(decl);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %rbx
movl 0x8(%rsi), %eax
cmpl 0x108(%rdi), %eax
je 0x4d0bb
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4ce5a
leaq 0x488(%rbx), %rsi
leaq 0x450(%rbx), %r14
movq %r14, %rdi
callq 0xd596
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movl 0xc(%rbp), %esi
movq %rbx, %rdi
callq 0xa3ea
movq %rax, %r12
movq %rbx, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x2b8e0
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x64e0
movq (%rbx), %rax
movq %rsp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq *0x98(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x60b0
leaq 0x10(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x4d151
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rsp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2b55a
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x60b0
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x4d188
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x6771f(%rip), %rsi     # 0xb48ae
leaq 0x20(%rsp), %rdi
callq 0x64e0
movl 0x8(%rbp), %edx
cmpl 0x108(%rbx), %edx
jne 0x4d1be
leaq 0x70932(%rip), %rsi     # 0xbdadd
leaq 0x20(%rsp), %rdi
callq 0x64e0
movb $0x1, 0x5d8(%rbx)
jmp 0x4d1f8
movq (%rbx), %rax
movq %rsp, %rdi
movq %rbx, %rsi
movl $0x1, %ecx
callq *0x38(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x60b0
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x4d1f8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x75a72(%rip), %rsi     # 0xc2c71
leaq 0x20(%rsp), %rdi
callq 0x64e0
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x18(%rbp), %r12
movq %rbp, 0x60(%rsp)
movq 0x20(%rbp), %r15
cmpq %r15, %r12
je 0x4d2bf
movq %rsp, %r13
leaq 0x40(%rsp), %rbp
movl 0x4(%r12), %esi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x148(%rax)
testb %al, %al
jne 0x4d2b2
movl 0x4(%r12), %eax
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2b3ee
movq %r13, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x4bf50
movq %rbp, %rdi
movq %r13, %rsi
callq 0xebc2
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4d29c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x4(%r12), %esi
movq %rbx, %rdi
callq 0xc7b4
testq %rax, %rax
je 0x4d2b2
movq %r12, 0x68(%rax)
addq $0x14, %r12
cmpq %r15, %r12
jne 0x4d238
movq 0x60(%rsp), %rax
movq 0x30(%rax), %r12
movq 0x38(%rax), %rbp
cmpq %rbp, %r12
je 0x4d347
movq %rsp, %r15
leaq 0x40(%rsp), %r13
movl 0x4(%r12), %eax
imulq $0x148, %rax, %rdx      # imm = 0x148
addq 0x38(%rbx), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2b3ee
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x4bf50
movq %r13, %rdi
movq %r15, %rsi
callq 0xebc2
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x4d328
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
movl 0x4(%r12), %esi
movq %rbx, %rdi
callq 0xc7b4
testq %rax, %rax
je 0x4d33e
movq %r12, 0x68(%rax)
addq $0x14, %r12
cmpq %rbp, %r12
jne 0x4d2d9
leaq 0x10(%rsp), %rbp
movq %rbp, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq 0x40(%rsp), %r12
movq 0x48(%rsp), %r13
cmpq %r13, %r12
je 0x4d3b5
movq %rsp, %r14
leaq 0x6cd34(%rip), %r15     # 0xba0ab
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r14, %rdi
callq 0x60b0
movq 0x48(%rsp), %rax
addq $-0x20, %rax
cmpq %rax, %r12
je 0x4d3a1
movq %r14, %rdi
movq %r15, %rsi
callq 0x64e0
addq $0x20, %r12
cmpq %r13, %r12
jne 0x4d377
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
jmp 0x4d3ba
xorl %edx, %edx
movq %rbp, %rsi
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %r15
callq 0x60b0
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x4d3df
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x6d62f(%rip), %rsi     # 0xbaa15
leaq 0x20(%rsp), %rdi
callq 0x64e0
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0xb634
leaq 0x40(%rsp), %rdi
callq 0xda2c
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x4d41e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4d433
jmp 0x4d46a
jmp 0x4d493
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
jne 0x4d454
jmp 0x4d4bb
jmp 0x4d46a
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4d4bb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
jmp 0x4d4bb
jmp 0x4d46a
movq %rax, %rbx
jmp 0x4d4b1
movq %rax, %rbx
jmp 0x4d4bb
jmp 0x4d479
jmp 0x4d48e
jmp 0x4d48e
jmp 0x4d48e
jmp 0x4d48e
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
jne 0x4d49f
jmp 0x4d4ac
jmp 0x4d48e
movq %rax, %rbx
jmp 0x4d4ac
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x4d4ac
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6260
leaq 0x30(%rsp), %r15
leaq 0x40(%rsp), %rdi
callq 0xda2c
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x4d4d2
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x6260
movq %rbx, %rdi
callq 0x64a0