- fprintf(f, "# %s\n", pp->is_stdcall ? "__stdcall" : "__cdecl");
- fprintf(f, ".global %s\n", sym);
+ argc_repush = pp->argc;
+ stack_args = pp->argc_stack;
+ if (pp->is_vararg) {
+ argc_repush = ARRAY_SIZE(pp->arg); // hopefully enough?
+ stack_args = argc_repush - pp->argc_reg;
+ }
+
+ ret64 = strstr(pp->ret_type.name, "int64") != NULL;
+
+ fprintf(f, "# %s",
+ pp->is_fastcall ? "__fastcall" :
+ (pp->is_stdcall ? "__stdcall" : "__cdecl"));
+ if (ret64)
+ fprintf(f, " ret64");
+ fprintf(f, "\n.global %s\n", sym);