#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ getIniString(int /*<<< orphan*/ *, char *, char *, char *,
                        int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int getIniBool(FILE *fd, char *section, char *name, unsigned char *value) {
  char buf[512];
  if (getIniString(fd, section, name, buf, 0))
    return 1;
  if (strcmp(buf, "true") == 0)
    *value = 1;
  else if (strcmp(buf, "false") == 0)
    *value = 0;
  return 1;
}


x86 assembly (clang, -O0):
<getIniBool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x230(%rbp),%rcx
xor    %r8d,%r8d
call   1040 <getIniString@plt>
cmp    $0x0,%rax
je     116c <getIniBool+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    11c5 <getIniBool+0xa5>
lea    -0x230(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1195 <getIniBool+0x75>
mov    -0x28(%rbp),%rax
movb   $0x1,(%rax)
jmp    11be <getIniBool+0x9e>
lea    -0x230(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11b9 <getIniBool+0x99>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
jmp    11be <getIniBool+0x9e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIniBool>:
push   %rbx
sub    $0x200,%rsp
mov    %rcx,%rbx
mov    %rsp,%rcx
xor    %r8d,%r8d
call   1040 <getIniString@plt>
test   %rax,%rax
jne    116b <getIniBool+0x4b>
lea    0xebe(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1167 <getIniBool+0x47>
lea    0xeaf(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    116b <getIniBool+0x4b>
xor    %eax,%eax
jmp    1169 <getIniBool+0x49>
mov    $0x1,%al
mov    %al,(%rbx)
mov    $0x1,%eax
add    $0x200,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i32 @getIniBool(i32* %0, i8* %1, i8* %2, i8* nocapture writeonly %3) {
%5 = alloca [512 x i8]
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = call i64 @getIniString(i32* %0, i8* %1, i8* %2, i8* %6, i32 0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %4
%10 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12, %9
%16 = phi i8 [ 1, %9 ], [ 0, %12 ]
store i8 %16, i8* %3
br label %17
17: ; preds = %15, %12, %4
ret i32 1
}