#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__ CallBack6(int, void *, void *, void *, void *, void *, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int RegisterOperation(const char *cmdTemplate, const char *runtimeNumVarList,
                      const char *runtimeStrVarList, int runtimeParamStructSize,
                      const void *runtimeAddress, int options) {
  if (!CheckRunningInMainThread("RegisterOperation"))
    return 978;
  return (int)CallBack6(187, (void *)cmdTemplate, (void *)runtimeNumVarList,
                        (void *)runtimeStrVarList,
                        (void *)runtimeParamStructSize, (void *)runtimeAddress,
                        (void *)options);
}


x86 assembly (clang, -O0):
<RegisterOperation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1160 <RegisterOperation+0x40>
movl   $0x3d2,-0x4(%rbp)
jmp    1189 <RegisterOperation+0x69>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
movslq -0x24(%rbp),%r8
mov    -0x30(%rbp),%r9
movslq -0x34(%rbp),%rax
mov    $0xbb,%edi
mov    %rax,(%rsp)
call   1040 <CallBack6@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RegisterOperation>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%ebp
mov    %r8,%r14
mov    %ecx,%ebx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
lea    0xebd(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     116e <RegisterOperation+0x4e>
movslq %ebx,%r8
movslq %ebp,%rax
mov    %rax,(%rsp)
mov    $0xbb,%edi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r9
call   1040 <CallBack6@plt>
jmp    1173 <RegisterOperation+0x53>
mov    $0x3d2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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