#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 XCSF {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cond_param_set_bits(struct XCSF *, int const);
int /*<<< orphan*/ cond_param_set_p_dontcare(struct XCSF *, double const);
scalar_t__ strncmp(char const *, char *, int);
void config_cl_cond_ternary(struct XCSF *xcsf, const char *n, const char *v,
                            const int i, const double f) {
  (void)v;
  if (strncmp(n, "COND_BITS\0", 10) == 0) {
    cond_param_set_bits(xcsf, i);
  } else if (strncmp(n, "COND_P_DONTCARE\0", 16) == 0) {
    cond_param_set_p_dontcare(xcsf, f);
  }
}


x86 assembly (clang, -O0):
<config_cl_cond_ternary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    117c <config_cl_cond_ternary+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1050 <cond_param_set_bits@plt>
jmp    11ae <config_cl_cond_ternary+0x7e>
mov    -0x10(%rbp),%rdi
lea    0xe84(%rip),%rsi
mov    $0x10,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11a9 <config_cl_cond_ternary+0x79>
mov    -0x8(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
call   1040 <cond_param_set_p_dontcare@plt>
jmp    11ae <config_cl_cond_ternary+0x7e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_cl_cond_ternary>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %ecx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1181 <config_cl_cond_ternary+0x51>
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
mov    $0x10,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1193 <config_cl_cond_ternary+0x63>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14,%rdi
mov    %ebp,%esi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <cond_param_set_bits@plt>
mov    %r14,%rdi
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <cond_param_set_p_dontcare@plt>

LLVM IR (-O0):
%struct.XCSF = type { i32 }
@.str = [11 x i8] c"COND_BITS\00\00"
@.str.1 = [17 x i8] c"COND_P_DONTCARE\00\00"
define void @config_cl_cond_ternary(%struct.XCSF* %0, i8* %1, i8* %2, i32 %3, double %4) {
%6 = alloca %struct.XCSF*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca double
store %struct.XCSF* %0, %struct.XCSF** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load i8*, i8** %8
%12 = load i8*, i8** %7
%13 = call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %5
%16 = load %struct.XCSF*, %struct.XCSF** %6
%17 = load i32, i32* %9
%18 = call i32 @cond_param_set_bits(%struct.XCSF* %16, i32 %17)
br label %28
19: ; preds = %5
%20 = load i8*, i8** %7
%21 = call i64 @strncmp(i8* %20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 16)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load %struct.XCSF*, %struct.XCSF** %6
%25 = load double, double* %10
%26 = call i32 @cond_param_set_p_dontcare(%struct.XCSF* %24, double %25)
br label %27
27: ; preds = %23, %19
br label %28
28: ; preds = %27, %15
ret void
}

LLVM IR (-O2):
%struct.XCSF = type { i32 }
@.str = [11 x i8] c"COND_BITS\00\00"
@.str.1 = [17 x i8] c"COND_P_DONTCARE\00\00"
define void @config_cl_cond_ternary(%struct.XCSF* %0, i8* %1, i8* nocapture readnone %2, i32 %3, double %4) {
%6 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @cond_param_set_bits(%struct.XCSF* %0, i32 %3)
br label %15
10: ; preds = %5
%11 = tail call i64 @strncmp(i8* %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 16)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @cond_param_set_p_dontcare(%struct.XCSF* %0, double %4)
br label %15
15: ; preds = %10, %13, %8
ret void
}