#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 */
int perf_config_int(char const *, char const *);
int /*<<< orphan*/ strcasecmp(char const *, char *);
int perf_config_bool_or_int(const char *name, const char *value, int *is_bool) {
  *is_bool = 1;
  if (!value)
    return 1;
  if (!*value)
    return 0;
  if (!strcasecmp(value, "true") || !strcasecmp(value, "yes") ||
      !strcasecmp(value, "on"))
    return 1;
  if (!strcasecmp(value, "false") || !strcasecmp(value, "no") ||
      !strcasecmp(value, "off"))
    return 0;
  *is_bool = 0;
  return perf_config_int(name, value);
}


x86 assembly (clang, -O0):
<perf_config_bool_or_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <perf_config_bool_or_int+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1236 <perf_config_bool_or_int+0x116>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    116e <perf_config_bool_or_int+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1236 <perf_config_bool_or_int+0x116>
mov    -0x18(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     11b9 <perf_config_bool_or_int+0x99>
mov    -0x18(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     11b9 <perf_config_bool_or_int+0x99>
mov    -0x18(%rbp),%rdi
lea    0xe5e(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11c5 <perf_config_bool_or_int+0xa5>
movl   $0x1,-0x4(%rbp)
jmp    1236 <perf_config_bool_or_int+0x116>
mov    -0x18(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     1210 <perf_config_bool_or_int+0xf0>
mov    -0x18(%rbp),%rdi
lea    0xe29(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     1210 <perf_config_bool_or_int+0xf0>
mov    -0x18(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    121c <perf_config_bool_or_int+0xfc>
movl   $0x0,-0x4(%rbp)
jmp    1236 <perf_config_bool_or_int+0x116>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <perf_config_int@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_config_bool_or_int>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movl   $0x1,(%rdx)
mov    $0x1,%ebp
test   %rsi,%rsi
je     11e6 <perf_config_bool_or_int+0xc6>
mov    %rsi,%rbx
cmpb   $0x0,(%rsi)
je     11e4 <perf_config_bool_or_int+0xc4>
mov    %rdx,%r14
mov    %rdi,%r15
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e6 <perf_config_bool_or_int+0xc6>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e6 <perf_config_bool_or_int+0xc6>
lea    0xe8b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e6 <perf_config_bool_or_int+0xc6>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e4 <perf_config_bool_or_int+0xc4>
lea    0xe6e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e4 <perf_config_bool_or_int+0xc4>
lea    0xe5e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    $0x0,%ebp
test   %eax,%eax
je     11e6 <perf_config_bool_or_int+0xc6>
movl   $0x0,(%r14)
mov    %r15,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <perf_config_int@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"on\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [3 x i8] c"no\00"
@.str.5 = [4 x i8] c"off\00"
define i32 @perf_config_bool_or_int(i8* %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
%8 = load i32*, i32** %7
store i32 1, i32* %8
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %3
store i32 1, i32* %4
br label %48
12: ; preds = %3
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %12
store i32 0, i32* %4
br label %48
17: ; preds = %12
%18 = load i8*, i8** %6
%19 = call i32 @strcasecmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %29
21: ; preds = %17
%22 = load i8*, i8** %6
%23 = call i32 @strcasecmp(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i8*, i8** %6
%27 = call i32 @strcasecmp(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %30, label %29
29: ; preds = %25, %21, %17
store i32 1, i32* %4
br label %48
30: ; preds = %25
%31 = load i8*, i8** %6
%32 = call i32 @strcasecmp(i8* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %42
34: ; preds = %30
%35 = load i8*, i8** %6
%36 = call i32 @strcasecmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %42
38: ; preds = %34
%39 = load i8*, i8** %6
%40 = call i32 @strcasecmp(i8* %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%41 = icmp ne i32 %40, 0
br i1 %41, label %43, label %42
42: ; preds = %38, %34, %30
store i32 0, i32* %4
br label %48
43: ; preds = %38
%44 = load i32*, i32** %7
store i32 0, i32* %44
%45 = load i8*, i8** %5
%46 = load i8*, i8** %6
%47 = call i32 @perf_config_int(i8* %45, i8* %46)
store i32 %47, i32* %4
br label %48
48: ; preds = %43, %42, %29, %16, %11
%49 = load i32, i32* %4
ret i32 %49
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"on\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [3 x i8] c"no\00"
@.str.5 = [4 x i8] c"off\00"
define i32 @perf_config_bool_or_int(i8* %0, i8* %1, i32* nocapture writeonly %2) {
store i32 1, i32* %2
%4 = icmp eq i8* %1, null
br i1 %4, label %28, label %5
5: ; preds = %3
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 0
br i1 %7, label %28, label %8
8: ; preds = %5
%9 = tail call i32 @strcasecmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %28, label %11
11: ; preds = %8
%12 = tail call i32 @strcasecmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %28, label %14
14: ; preds = %11
%15 = tail call i32 @strcasecmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %28, label %17
17: ; preds = %14
%18 = tail call i32 @strcasecmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %28, label %20
20: ; preds = %17
%21 = tail call i32 @strcasecmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %28, label %23
23: ; preds = %20
%24 = tail call i32 @strcasecmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %23
store i32 0, i32* %2
%27 = tail call i32 @perf_config_int(i8* %0, i8* %1)
br label %28
28: ; preds = %17, %20, %23, %8, %11, %14, %5, %3, %26
%29 = phi i32 [ %27, %26 ], [ 1, %3 ], [ 0, %5 ], [ 1, %14 ], [ 1, %11 ], [ 1, %8 ], [ 0, %23 ], [ 0, %20 ], [ 0, %17 ]
ret i32 %29
}