#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, ...);
void Call_C_Invoke(char *fct_name, int fc, int nb_args, int nb_args_in_words) {
  Inst_Printf("sd", "$gp,%d($sp)", 32 * 8 + 8);
  Inst_Printf("sd", "$31,%d($sp)", 32 * 8);
  Inst_Printf("la", "$25,%s", fct_name);
  Inst_Printf("jal", "$25");
  Inst_Printf("ld", "$gp,%d($sp)", 32 * 8 + 8);
  Inst_Printf("ld", "$31,%d($sp)", 32 * 8);
}


x86 assembly (clang, -O0):
<Call_C_Invoke>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
lea    0xed4(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    $0x108,%edx
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
lea    0xeba(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x100,%edx
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
mov    -0x8(%rbp),%rdx
lea    0xeb7(%rip),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
lea    0xeac(%rip),%rdi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
lea    0xe9f(%rip),%rdi
lea    0xe6e(%rip),%rsi
mov    $0x108,%edx
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
lea    0xe85(%rip),%rdi
lea    0xe60(%rip),%rsi
mov    $0x100,%edx
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Call_C_Invoke>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xede(%rip),%r12
lea    0xeda(%rip),%r14
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x108,%edx
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
lea    0xecd(%rip),%r15
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x100,%edx
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
lea    0xec0(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
lea    0xeb2(%rip),%rdi
lea    0xeaf(%rip),%rsi
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
lea    0xea5(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x108,%edx
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x100,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"sd\00"
@.str.1 = [12 x i8] c"$gp,%d($sp)\00"
@.str.2 = [12 x i8] c"$31,%d($sp)\00"
@.str.3 = [3 x i8] c"la\00"
@.str.4 = [7 x i8] c"$25,%s\00"
@.str.5 = [4 x i8] c"jal\00"
@.str.6 = [4 x i8] c"$25\00"
@.str.7 = [3 x i8] c"ld\00"
define void @Call_C_Invoke(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 264)
%10 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 256)
%11 = load i8*, i8** %5
%12 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %11)
%13 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 264)
%15 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 256)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"sd\00"
@.str.1 = [12 x i8] c"$gp,%d($sp)\00"
@.str.2 = [12 x i8] c"$31,%d($sp)\00"
@.str.3 = [3 x i8] c"la\00"
@.str.4 = [7 x i8] c"$25,%s\00"
@.str.5 = [4 x i8] c"jal\00"
@.str.6 = [4 x i8] c"$25\00"
@.str.7 = [3 x i8] c"ld\00"
define void @Call_C_Invoke(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 264)
%6 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 256)
%7 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %0)
%8 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 264)
%10 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 256)
ret void
}