#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 */
struct LoadFileInfo {
  int dummy;
};
struct LoadDataInfo {
  int dummy;
};

/* Variables and functions */
scalar_t__ CallBack3(int, struct LoadDataInfo *, int *,
                     struct LoadFileInfo ***);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int PrepareLoadIgorData(struct LoadDataInfo *ldiPtr, int *refNumPtr,
                        struct LoadFileInfo ***topFIHPtr) {
  if (!CheckRunningInMainThread("PrepareLoadIgorData"))
    return 978;
  return (int)CallBack3(153, ldiPtr, refNumPtr, topFIHPtr);
}


x86 assembly (clang, -O0):
<PrepareLoadIgorData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xec5(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1155 <PrepareLoadIgorData+0x35>
movl   $0x3d2,-0x4(%rbp)
jmp    116e <PrepareLoadIgorData+0x4e>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x99,%edi
call   1030 <CallBack3@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrepareLoadIgorData>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xecb(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1153 <PrepareLoadIgorData+0x33>
mov    $0x99,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <CallBack3@plt>
jmp    1158 <PrepareLoadIgorData+0x38>
mov    $0x3d2,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.LoadDataInfo = type { i32 }
%struct.LoadFileInfo = type { i32 }
@.str = [20 x i8] c"PrepareLoadIgorData\00"
define i32 @PrepareLoadIgorData(%struct.LoadDataInfo* %0, i32* %1, %struct.LoadFileInfo*** %2) {
%4 = alloca i32
%5 = alloca %struct.LoadDataInfo*
%6 = alloca i32*
%7 = alloca %struct.LoadFileInfo***
store %struct.LoadDataInfo* %0, %struct.LoadDataInfo** %5
store i32* %1, i32** %6
store %struct.LoadFileInfo*** %2, %struct.LoadFileInfo**** %7
%8 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %3
store i32 978, i32* %4
br label %17
11: ; preds = %3
%12 = load %struct.LoadDataInfo*, %struct.LoadDataInfo** %5
%13 = load i32*, i32** %6
%14 = load %struct.LoadFileInfo***, %struct.LoadFileInfo**** %7
%15 = call i64 @CallBack3(i32 153, %struct.LoadDataInfo* %12, i32* %13, %struct.LoadFileInfo*** %14)
%16 = trunc i64 %15 to i32
store i32 %16, i32* %4
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
%struct.LoadDataInfo = type { i32 }
%struct.LoadFileInfo = type { i32 }
@.str = [20 x i8] c"PrepareLoadIgorData\00"
define i32 @PrepareLoadIgorData(%struct.LoadDataInfo* %0, i32* %1, %struct.LoadFileInfo*** %2) {
%4 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i64 @CallBack3(i32 153, %struct.LoadDataInfo* %0, i32* %1, %struct.LoadFileInfo*** %2)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %8, %6 ], [ 978, %3 ]
ret i32 %10
}