#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 */
scalar_t__ CallBack4(int, void *, void *, void *, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int SetIgorMenuItem(int message, int enable, const char *text, int param) {
  if (!CheckRunningInMainThread("SetIgorMenuItem"))
    return 0;
  return (int)CallBack4(69, (void *)message, (void *)enable, (void *)text,
                        (void *)param);
}


x86 assembly (clang, -O0):
<SetIgorMenuItem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xec4(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1156 <SetIgorMenuItem+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1173 <SetIgorMenuItem+0x53>
movslq -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%r8
mov    $0x45,%edi
call   1040 <CallBack4@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetIgorMenuItem>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xec8(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1159 <SetIgorMenuItem+0x39>
movslq %ebp,%rsi
movslq %ebx,%rdx
movslq %r15d,%r8
mov    $0x45,%edi
mov    %r14,%rcx
call   1040 <CallBack4@plt>
jmp    115b <SetIgorMenuItem+0x3b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"SetIgorMenuItem\00"
define i32 @SetIgorMenuItem(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %4
store i32 0, i32* %5
br label %26
13: ; preds = %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
%20 = load i8*, i8** %8
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i8*
%24 = call i64 @CallBack4(i32 69, i8* %16, i8* %19, i8* %20, i8* %23)
%25 = trunc i64 %24 to i32
store i32 %25, i32* %5
br label %26
26: ; preds = %13, %12
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
@.str = [16 x i8] c"SetIgorMenuItem\00"
define i32 @SetIgorMenuItem(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %4
%8 = sext i32 %0 to i64
%9 = inttoptr i64 %8 to i8*
%10 = sext i32 %1 to i64
%11 = inttoptr i64 %10 to i8*
%12 = sext i32 %3 to i64
%13 = inttoptr i64 %12 to i8*
%14 = tail call i64 @CallBack4(i32 69, i8* %9, i8* %11, i8* %2, i8* %13)
%15 = trunc i64 %14 to i32
br label %16
16: ; preds = %4, %7
%17 = phi i32 [ %15, %7 ], [ 0, %4 ]
ret i32 %17
}