#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 */
double _user_func_3(double const, double const, double const);
scalar_t__ strcmp(char const *, char *);
double user_func_0();
double user_func_1(double const);
double user_func_2(double const, double const);
int user_fnc_cb(void *user_data, const char *name, const int num_args,
                const double *args, double *value) {
  if (strcmp(name, "user_func_0") == 0 && num_args == 0) {
    *value = user_func_0();
    return (!0);
  } else if (strcmp(name, "user_func_1") == 0 && num_args == 1) {
    *value = user_func_1(args[0]);
    return (!0);
  } else if (strcmp(name, "user_func_2") == 0 && num_args == 2) {
    *value = user_func_2(args[0], args[1]);
    return (!0);
  } else if (strcmp(name, "_user_func_3") == 0 && num_args == 3) {
    *value = _user_func_3(args[0], args[1], args[2]);
    return (!0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<user_fnc_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11aa <user_fnc_cb+0x5a>
cmpl   $0x0,-0x1c(%rbp)
jne    11aa <user_fnc_cb+0x5a>
mov    $0x0,%al
call   1070 <user_func_0@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    12aa <user_fnc_cb+0x15a>
mov    -0x18(%rbp),%rdi
lea    0xe57(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ef <user_fnc_cb+0x9f>
cmpl   $0x1,-0x1c(%rbp)
jne    11ef <user_fnc_cb+0x9f>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <user_func_1@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    12aa <user_fnc_cb+0x15a>
mov    -0x18(%rbp),%rdi
lea    0xe1e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    123d <user_fnc_cb+0xed>
cmpl   $0x2,-0x1c(%rbp)
jne    123d <user_fnc_cb+0xed>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm1
call   1050 <user_func_2@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    12aa <user_fnc_cb+0x15a>
mov    -0x18(%rbp),%rdi
lea    0xddc(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1294 <user_fnc_cb+0x144>
cmpl   $0x3,-0x1c(%rbp)
jne    1294 <user_fnc_cb+0x144>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm2
call   1060 <_user_func_3@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    12aa <user_fnc_cb+0x15a>
jmp    1299 <user_fnc_cb+0x149>
jmp    129e <user_fnc_cb+0x14e>
jmp    12a3 <user_fnc_cb+0x153>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_fnc_cb>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %edx,%ebp
mov    %rsi,%rbx
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %ebp,%ebp
jne    1186 <user_fnc_cb+0x36>
test   %rax,%rax
jne    1186 <user_fnc_cb+0x36>
xor    %eax,%eax
call   1070 <user_func_0@plt>
jmp    120a <user_fnc_cb+0xba>
lea    0xe7f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
cmp    $0x1,%ebp
jne    11ab <user_fnc_cb+0x5b>
test   %rax,%rax
jne    11ab <user_fnc_cb+0x5b>
movsd  (%r15),%xmm0
call   1030 <user_func_1@plt>
jmp    120a <user_fnc_cb+0xba>
lea    0xe66(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
cmp    $0x2,%ebp
jne    11d6 <user_fnc_cb+0x86>
test   %rax,%rax
jne    11d6 <user_fnc_cb+0x86>
movsd  (%r15),%xmm0
movsd  0x8(%r15),%xmm1
call   1050 <user_func_2@plt>
jmp    120a <user_fnc_cb+0xba>
lea    0xe47(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x3,%ebp
jne    1214 <user_fnc_cb+0xc4>
test   %rcx,%rcx
jne    1214 <user_fnc_cb+0xc4>
movsd  (%r15),%xmm0
movsd  0x8(%r15),%xmm1
movsd  0x10(%r15),%xmm2
call   1060 <_user_func_3@plt>
movsd  %xmm0,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"user_func_0\00"
@.str.1 = [12 x i8] c"user_func_1\00"
@.str.2 = [12 x i8] c"user_func_2\00"
@.str.3 = [13 x i8] c"_user_func_3\00"
define i32 @user_fnc_cb(i8* %0, i8* %1, i32 %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store double* %3, double** %10
store double* %4, double** %11
%12 = load i8*, i8** %8
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %5
%16 = load i32, i32* %9
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = call double (...) @user_func_0()
%20 = load double*, double** %11
store double %19, double* %20
store i32 1, i32* %6
br label %73
21: ; preds = %15, %5
%22 = load i8*, i8** %8
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %21
%26 = load i32, i32* %9
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %34
28: ; preds = %25
%29 = load double*, double** %10
%30 = getelementptr inbounds double, double* %29, i64 0
%31 = load double, double* %30
%32 = call double @user_func_1(double %31)
%33 = load double*, double** %11
store double %32, double* %33
store i32 1, i32* %6
br label %73
34: ; preds = %25, %21
%35 = load i8*, i8** %8
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %50
38: ; preds = %34
%39 = load i32, i32* %9
%40 = icmp eq i32 %39, 2
br i1 %40, label %41, label %50
41: ; preds = %38
%42 = load double*, double** %10
%43 = getelementptr inbounds double, double* %42, i64 0
%44 = load double, double* %43
%45 = load double*, double** %10
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = load double, double* %46
%48 = call double @user_func_2(double %44, double %47)
%49 = load double*, double** %11
store double %48, double* %49
store i32 1, i32* %6
br label %73
50: ; preds = %38, %34
%51 = load i8*, i8** %8
%52 = call i64 @strcmp(i8* %51, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %69
54: ; preds = %50
%55 = load i32, i32* %9
%56 = icmp eq i32 %55, 3
br i1 %56, label %57, label %69
57: ; preds = %54
%58 = load double*, double** %10
%59 = getelementptr inbounds double, double* %58, i64 0
%60 = load double, double* %59
%61 = load double*, double** %10
%62 = getelementptr inbounds double, double* %61, i64 1
%63 = load double, double* %62
%64 = load double*, double** %10
%65 = getelementptr inbounds double, double* %64, i64 2
%66 = load double, double* %65
%67 = call double @_user_func_3(double %60, double %63, double %66)
%68 = load double*, double** %11
store double %67, double* %68
store i32 1, i32* %6
br label %73
69: ; preds = %54, %50
br label %70
70: ; preds = %69
br label %71
71: ; preds = %70
br label %72
72: ; preds = %71
store i32 0, i32* %6
br label %73
73: ; preds = %72, %57, %41, %28, %18
%74 = load i32, i32* %6
ret i32 %74
}

LLVM IR (-O2):
@.str = [12 x i8] c"user_func_0\00"
@.str.1 = [12 x i8] c"user_func_1\00"
@.str.2 = [12 x i8] c"user_func_2\00"
@.str.3 = [13 x i8] c"_user_func_3\00"
define i32 @user_fnc_cb(i8* nocapture readnone %0, i8* %1, i32 %2, double* nocapture %3, double* nocapture writeonly %4) {
%6 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = icmp eq i32 %2, 0
%9 = and i1 %8, %7
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call double (...) @user_func_0()
br label %42
12: ; preds = %5
%13 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
%15 = icmp eq i32 %2, 1
%16 = and i1 %15, %14
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load double, double* %3
%19 = tail call double @user_func_1(double %18)
br label %42
20: ; preds = %12
%21 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
%23 = icmp eq i32 %2, 2
%24 = and i1 %23, %22
br i1 %24, label %25, label %30
25: ; preds = %20
%26 = load double, double* %3
%27 = getelementptr inbounds double, double* %3, i64 1
%28 = load double, double* %27
%29 = tail call double @user_func_2(double %26, double %28)
br label %42
30: ; preds = %20
%31 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
%33 = icmp eq i32 %2, 3
%34 = and i1 %33, %32
br i1 %34, label %35, label %44
35: ; preds = %30
%36 = load double, double* %3
%37 = getelementptr inbounds double, double* %3, i64 1
%38 = load double, double* %37
%39 = getelementptr inbounds double, double* %3, i64 2
%40 = load double, double* %39
%41 = tail call double @_user_func_3(double %36, double %38, double %40)
br label %42
42: ; preds = %10, %17, %25, %35
%43 = phi double [ %41, %35 ], [ %29, %25 ], [ %19, %17 ], [ %11, %10 ]
store double %43, double* %4
br label %44
44: ; preds = %42, %30
%45 = phi i32 [ 0, %30 ], [ 1, %42 ]
ret i32 %45
}