#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 */
long cfgDataGet(char *, char *, char *, char *, int);
int /*<<< orphan*/ cfgDbName(int, char *);
long cfgDbDataGet(int iDbId, char *sSect, char *sKey, char *sDataBuf,
                  int iDataLen) {
  char sDbName[32];
  if (cfgDbName(iDbId, sDbName) == (0))
    return (-1);
  return cfgDataGet(sDbName, sSect, sKey, sDataBuf, iDataLen);
}


x86 assembly (clang, -O0):
<cfgDbDataGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x50(%rbp),%rsi
call   1030 <cfgDbName@plt>
cmp    $0x0,%eax
jne    115d <cfgDbDataGet+0x3d>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    117a <cfgDbDataGet+0x5a>
lea    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
call   1040 <cfgDataGet@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfgDbDataGet>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rsp,%rsi
call   1030 <cfgDbName@plt>
test   %eax,%eax
je     1158 <cfgDbDataGet+0x38>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1040 <cfgDataGet@plt>
jmp    115f <cfgDbDataGet+0x3f>
mov    $0xffffffffffffffff,%rax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @cfgDbDataGet(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca [32 x i8]
store i32 %0, i32* %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
%13 = load i32, i32* %7
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 0
%15 = call i32 @cfgDbName(i32 %13, i8* %14)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %5
store i64 -1, i64* %6
br label %25
18: ; preds = %5
%19 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 0
%20 = load i8*, i8** %8
%21 = load i8*, i8** %9
%22 = load i8*, i8** %10
%23 = load i32, i32* %11
%24 = call i64 @cfgDataGet(i8* %19, i8* %20, i8* %21, i8* %22, i32 %23)
store i64 %24, i64* %6
br label %25
25: ; preds = %18, %17
%26 = load i64, i64* %6
ret i64 %26
}

LLVM IR (-O2):
define i64 @cfgDbDataGet(i32 %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca [32 x i8]
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%8 = call i32 @cfgDbName(i32 %0, i8* %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = call i64 @cfgDataGet(i8* %7, i8* %1, i8* %2, i8* %3, i32 %4)
br label %12
12: ; preds = %5, %10
%13 = phi i64 [ %11, %10 ], [ -1, %5 ]
ret i64 %13
}