#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 /*<<< orphan*/ Ini_GetString(char const *, char const *, char *, char *,
                                 int, char *);
int atoi(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int Ini_GetInteger(const char *category, const char *key, int defaultValue,
                   char *source) {
  char value[16];
  char buffer[16];
  sprintf(value, "%d", defaultValue);
  Ini_GetString(category, key, value, buffer, 15, source);
  return atoi(buffer);
}


x86 assembly (clang, -O0):
<Ini_GetInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xeab(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    -0x20(%rbp),%r9
mov    $0xf,%r8d
call   1030 <Ini_GetString@plt>
lea    -0x40(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ini_GetInteger>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xeb3(%rip),%rsi
lea    0x10(%rsp),%r12
mov    %r12,%rdi
call   1050 <sprintf@plt>
mov    %rsp,%r13
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    $0xf,%r8d
mov    %r14,%r9
call   1030 <Ini_GetString@plt>
mov    %r13,%rdi
call   1040 <atoi@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @Ini_GetInteger(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [16 x i8]
%10 = alloca [16 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%12 = load i32, i32* %7
%13 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %10, i64 0, i64 0
%18 = load i8*, i8** %8
%19 = call i32 @Ini_GetString(i8* %14, i8* %15, i8* %16, i8* %17, i32 15, i8* %18)
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %10, i64 0, i64 0
%21 = call i32 @atoi(i8* %20)
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @Ini_GetInteger(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca [16 x i8]
%6 = alloca [16 x i8]
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%9 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%10 = call i32 @Ini_GetString(i8* %0, i8* %1, i8* %7, i8* %8, i32 15, i8* %3)
%11 = call i32 @atoi(i8* %8)
ret i32 %11
}