#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 */
int atoi(char *);
scalar_t__ getIniString(int /*<<< orphan*/ *, char *, char *, char *,
                        int /*<<< orphan*/);
int /*<<< orphan*/ isnum(char *);
int getIniInt(FILE *fd, char *section, char *name, int *value) {
  char buf[512];
  if (getIniString(fd, section, name, buf, 0))
    return 1;
  if (!isnum(buf))
    return 1;
  *value = atoi(buf);
  return 0;
}


x86 assembly (clang, -O0):
<getIniInt>:
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   1030 <getIniString@plt>
cmp    $0x0,%rax
je     117c <getIniInt+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    11b8 <getIniInt+0x88>
lea    -0x230(%rbp),%rdi
call   1040 <isnum@plt>
cmp    $0x0,%eax
jne    119d <getIniInt+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    11b8 <getIniInt+0x88>
lea    -0x230(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIniInt>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %rcx,%rbx
mov    %rsp,%rcx
xor    %r8d,%r8d
call   1030 <getIniString@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1169 <getIniInt+0x39>
mov    %rsp,%rdi
call   1040 <isnum@plt>
test   %eax,%eax
je     1169 <getIniInt+0x39>
mov    %rsp,%rdi
call   1050 <atoi@plt>
mov    %eax,(%rbx)
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getIniInt(i32* %0, i8* %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca [512 x i8]
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %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 %27
18: ; preds = %4
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%20 = call i32 @isnum(i8* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %18
store i32 1, i32* %5
br label %27
23: ; preds = %18
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%25 = call i32 @atoi(i8* %24)
%26 = load i32*, i32** %9
store i32 %25, i32* %26
store i32 0, i32* %5
br label %27
27: ; preds = %23, %22, %17
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @getIniInt(i32* %0, i8* %1, i8* %2, i32* 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 %14
9: ; preds = %4
%10 = call i32 @isnum(i8* %6)
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = call i32 @atoi(i8* %6)
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %4, %12
%15 = phi i32 [ 0, %12 ], [ 1, %4 ], [ 1, %9 ]
ret i32 %15
}