#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__ atoi(char *);
scalar_t__ property_get(char *, char *, char *);
int /*<<< orphan*/ run_bluetoothd(int, int);
int /*<<< orphan*/ run_valgrind(int, int);
int /*<<< orphan*/ strcasecmp(char *, char *);
int main(int argc, char *argv[]) {
  char value[32];
  int debug = 0;
  int mgmt_dbg = 0;
  if (property_get("persist.sys.bluetooth.debug", value, "") > 0 &&
      (!strcasecmp(value, "true") || atoi(value) > 0))
    debug = 1;
  if (property_get("persist.sys.bluetooth.mgmtdbg", value, "") > 0 &&
      (!strcasecmp(value, "true") || atoi(value) > 0)) {
    debug = 1;
    mgmt_dbg = 1;
  }
  if (property_get("persist.sys.bluetooth.valgrind", value, "") > 0 &&
      (!strcasecmp(value, "true") || atoi(value) > 0))
    run_valgrind(debug, mgmt_dbg);
  run_bluetoothd(debug, mgmt_dbg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xe81(%rip),%rdi
lea    0xed7(%rip),%rdx
call   1070 <property_get@plt>
cmp    $0x0,%rax
jle    11c8 <main+0x78>
lea    -0x30(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     11c1 <main+0x71>
lea    -0x30(%rbp),%rdi
call   1060 <atoi@plt>
cmp    $0x0,%rax
jle    11c8 <main+0x78>
movl   $0x1,-0x34(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xe4e(%rip),%rdi
lea    0xe83(%rip),%rdx
call   1070 <property_get@plt>
cmp    $0x0,%rax
jle    1223 <main+0xd3>
lea    -0x30(%rbp),%rdi
lea    0xe28(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     1215 <main+0xc5>
lea    -0x30(%rbp),%rdi
call   1060 <atoi@plt>
cmp    $0x0,%rax
jle    1223 <main+0xd3>
movl   $0x1,-0x34(%rbp)
movl   $0x1,-0x38(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xe11(%rip),%rdi
lea    0xe28(%rip),%rdx
call   1070 <property_get@plt>
cmp    $0x0,%rax
jle    127b <main+0x12b>
lea    -0x30(%rbp),%rdi
lea    0xdcd(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     1270 <main+0x120>
lea    -0x30(%rbp),%rdi
call   1060 <atoi@plt>
cmp    $0x0,%rax
jle    127b <main+0x12b>
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1040 <run_valgrind@plt>
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1050 <run_bluetoothd@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
lea    0xea3(%rip),%rdi
lea    0xef9(%rip),%rdx
mov    %rsp,%rsi
call   1070 <property_get@plt>
xor    %ebx,%ebx
mov    $0x0,%ebp
test   %rax,%rax
jle    11a2 <main+0x52>
lea    0xe9d(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     119d <main+0x4d>
mov    %rsp,%rdi
call   1060 <atoi@plt>
mov    $0x0,%ebp
test   %rax,%rax
jle    11a2 <main+0x52>
mov    $0x1,%ebp
lea    0xe78(%rip),%rdi
lea    0xead(%rip),%rdx
mov    %rsp,%rsi
call   1070 <property_get@plt>
test   %rax,%rax
jle    11e7 <main+0x97>
lea    0xe58(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11dd <main+0x8d>
mov    %rsp,%rdi
call   1060 <atoi@plt>
test   %rax,%rax
jle    11e7 <main+0x97>
mov    $0x1,%ebp
mov    $0x1,%ebx
lea    0xe51(%rip),%rdi
lea    0xe68(%rip),%rdx
mov    %rsp,%rsi
call   1070 <property_get@plt>
test   %rax,%rax
jle    122b <main+0xdb>
lea    0xe13(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1222 <main+0xd2>
mov    %rsp,%rdi
call   1060 <atoi@plt>
test   %rax,%rax
jle    122b <main+0xdb>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <run_valgrind@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <run_bluetoothd@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"persist.sys.bluetooth.debug\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [30 x i8] c"persist.sys.bluetooth.mgmtdbg\00"
@.str.4 = [31 x i8] c"persist.sys.bluetooth.valgrind\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [32 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%10 = call i64 @property_get(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp sgt i64 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %2
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%14 = call i32 @strcasecmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%18 = call i64 @atoi(i8* %17)
%19 = icmp sgt i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16, %12
store i32 1, i32* %7
br label %21
21: ; preds = %20, %16, %2
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%23 = call i64 @property_get(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %22, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp sgt i64 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %21
%26 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%27 = call i32 @strcasecmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%31 = call i64 @atoi(i8* %30)
%32 = icmp sgt i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %29, %25
store i32 1, i32* %7
store i32 1, i32* %8
br label %34
34: ; preds = %33, %29, %21
%35 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%36 = call i64 @property_get(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %35, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%37 = icmp sgt i64 %36, 0
br i1 %37, label %38, label %50
38: ; preds = %34
%39 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%40 = call i32 @strcasecmp(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %38
%43 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%44 = call i64 @atoi(i8* %43)
%45 = icmp sgt i64 %44, 0
br i1 %45, label %46, label %50
46: ; preds = %42, %38
%47 = load i32, i32* %7
%48 = load i32, i32* %8
%49 = call i32 @run_valgrind(i32 %47, i32 %48)
br label %50
50: ; preds = %46, %42, %34
%51 = load i32, i32* %7
%52 = load i32, i32* %8
%53 = call i32 @run_bluetoothd(i32 %51, i32 %52)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"persist.sys.bluetooth.debug\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [30 x i8] c"persist.sys.bluetooth.mgmtdbg\00"
@.str.4 = [31 x i8] c"persist.sys.bluetooth.valgrind\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i64 @property_get(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = call i32 @strcasecmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = call i64 @atoi(i8* %4)
%12 = icmp sgt i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10, %7
br label %14
14: ; preds = %13, %10, %2
%15 = phi i32 [ 1, %13 ], [ 0, %10 ], [ 0, %2 ]
%16 = call i64 @property_get(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp sgt i64 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = call i32 @strcasecmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = call i64 @atoi(i8* %4)
%23 = icmp sgt i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %21, %14
%26 = phi i32 [ 1, %24 ], [ %15, %21 ], [ %15, %14 ]
%27 = phi i32 [ 1, %24 ], [ 0, %21 ], [ 0, %14 ]
%28 = call i64 @property_get(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp sgt i64 %28, 0
br i1 %29, label %30, label %38
30: ; preds = %25
%31 = call i32 @strcasecmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %30
%34 = call i64 @atoi(i8* %4)
%35 = icmp sgt i64 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33, %30
%37 = call i32 @run_valgrind(i32 %26, i32 %27)
br label %38
38: ; preds = %36, %33, %25
%39 = call i32 @run_bluetoothd(i32 %26, i32 %27)
ret i32 0
}