#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 *, ...);
int /*<<< orphan*/ make_inline(char *, int);
void Call_C_Invoke(char *fct_name, int fc, int nb_args, int nb_args_in_words) {
  if (!make_inline(fct_name, nb_args)) {
    Inst_Printf("jsr", "$26,%s", fct_name);
    Inst_Printf("ldgp", "$gp,0($26)");
  }
}


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)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <make_inline@plt>
cmp    $0x0,%eax
jne    1178 <Call_C_Invoke+0x58>
mov    -0x8(%rbp),%rdx
lea    0xeab(%rip),%rdi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
lea    0xea1(%rip),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Call_C_Invoke>:
push   %rbx
mov    %rdi,%rbx
mov    %edx,%esi
call   1040 <make_inline@plt>
test   %eax,%eax
je     1131 <Call_C_Invoke+0x11>
pop    %rbx
ret
lea    0xec8(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
lea    0xebb(%rip),%rdi
lea    0xeb9(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"jsr\00"
@.str.1 = [7 x i8] c"$26,%s\00"
@.str.2 = [5 x i8] c"ldgp\00"
@.str.3 = [11 x i8] c"$gp,0($26)\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 = load i8*, i8** %5
%10 = load i32, i32* %7
%11 = call i32 @make_inline(i8* %9, i32 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %4
%14 = load i8*, i8** %5
%15 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"jsr\00"
@.str.1 = [7 x i8] c"$26,%s\00"
@.str.2 = [5 x i8] c"ldgp\00"
@.str.3 = [11 x i8] c"$gp,0($26)\00"
define void @Call_C_Invoke(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @make_inline(i8* %0, i32 %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%9 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %7, %4
ret void
}