#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*/ assert(int /*<<< orphan*/);
char *configFileValue(char *);
int /*<<< orphan*/ configFileValueLong(char *, long *);
int /*<<< orphan*/ free(char *);
int log_level_int(char *);
void configReadLogParams(int *pLogLevel, int *pLogRollNumber,
                         long *pLogMaxSizeBytes, char **psLogPrefix) {
  long l = 0;
  char *sLogLevel = NULL;
  sLogLevel = configFileValue("LOGLEVEL");
  assert(sLogLevel != NULL);
  if (pLogLevel)
    (*pLogLevel) = log_level_int(sLogLevel);
  {
    free((sLogLevel));
    (sLogLevel) = NULL;
  };
  if (pLogRollNumber) {
    configFileValueLong("LOGROLLNUMBER", &l);
    (*pLogRollNumber) = ((int)l);
  }
  if (pLogMaxSizeBytes)
    configFileValueLong("LOGMAXSIZE", pLogMaxSizeBytes);
  if (psLogPrefix)
    (*psLogPrefix) = configFileValue("LOGPREFIX");
}


x86 assembly (clang, -O0):
<configReadLogParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
lea    0xe81(%rip),%rdi
call   1060 <configFileValue@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpq   $0x0,-0x8(%rbp)
je     11b6 <configReadLogParams+0x66>
mov    -0x30(%rbp),%rdi
call   1040 <log_level_int@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11ee <configReadLogParams+0x9e>
lea    0xe30(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1070 <configFileValueLong@plt>
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1209 <configReadLogParams+0xb9>
mov    -0x18(%rbp),%rsi
lea    0xe13(%rip),%rdi
call   1070 <configFileValueLong@plt>
cmpq   $0x0,-0x20(%rbp)
je     122a <configReadLogParams+0xda>
lea    0xe07(%rip),%rdi
call   1060 <configFileValue@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configReadLogParams>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
movq   $0x0,0x8(%rsp)
lea    0xe87(%rip),%rdi
call   1060 <configFileValue@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
test   %r13,%r13
je     11a0 <configReadLogParams+0x50>
mov    %rbx,%rdi
call   1040 <log_level_int@plt>
mov    %eax,0x0(%r13)
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r12,%r12
je     11c6 <configReadLogParams+0x76>
lea    0xe55(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1070 <configFileValueLong@plt>
mov    0x8(%rsp),%eax
mov    %eax,(%r12)
test   %r15,%r15
je     11da <configReadLogParams+0x8a>
lea    0xe45(%rip),%rdi
mov    %r15,%rsi
call   1070 <configFileValueLong@plt>
test   %r14,%r14
je     11ee <configReadLogParams+0x9e>
lea    0xe3c(%rip),%rdi
call   1060 <configFileValue@plt>
mov    %rax,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"LOGLEVEL\00"
@.str.1 = [14 x i8] c"LOGROLLNUMBER\00"
@.str.2 = [11 x i8] c"LOGMAXSIZE\00"
@.str.3 = [10 x i8] c"LOGPREFIX\00"
define void @configReadLogParams(i32* %0, i32* %1, i64* %2, i8** %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64*
%8 = alloca i8**
%9 = alloca i64
%10 = alloca i8*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64* %2, i64** %7
store i8** %3, i8*** %8
store i64 0, i64* %9
store i8* null, i8** %10
%11 = call i8* @configFileValue(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i8* %11, i8** %10
%12 = load i8*, i8** %10
%13 = icmp ne i8* %12, null
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32*, i32** %5
%17 = icmp ne i32* %16, null
br i1 %17, label %18, label %22
18: ; preds = %4
%19 = load i8*, i8** %10
%20 = call i32 @log_level_int(i8* %19)
%21 = load i32*, i32** %5
store i32 %20, i32* %21
br label %22
22: ; preds = %18, %4
%23 = load i8*, i8** %10
%24 = call i32 @free(i8* %23)
store i8* null, i8** %10
%25 = load i32*, i32** %6
%26 = icmp ne i32* %25, null
br i1 %26, label %27, label %32
27: ; preds = %22
%28 = call i32 @configFileValueLong(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i64* %9)
%29 = load i64, i64* %9
%30 = trunc i64 %29 to i32
%31 = load i32*, i32** %6
store i32 %30, i32* %31
br label %32
32: ; preds = %27, %22
%33 = load i64*, i64** %7
%34 = icmp ne i64* %33, null
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load i64*, i64** %7
%37 = call i32 @configFileValueLong(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64* %36)
br label %38
38: ; preds = %35, %32
%39 = load i8**, i8*** %8
%40 = icmp ne i8** %39, null
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = call i8* @configFileValue(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%43 = load i8**, i8*** %8
store i8* %42, i8** %43
br label %44
44: ; preds = %41, %38
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"LOGLEVEL\00"
@.str.1 = [14 x i8] c"LOGROLLNUMBER\00"
@.str.2 = [11 x i8] c"LOGMAXSIZE\00"
@.str.3 = [10 x i8] c"LOGPREFIX\00"
define void @configReadLogParams(i32* writeonly %0, i32* writeonly %1, i64* %2, i8** writeonly %3) {
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%7 = tail call i8* @configFileValue(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = icmp eq i32* %0, null
br i1 %11, label %14, label %12
12: ; preds = %4
%13 = tail call i32 @log_level_int(i8* %7)
store i32 %13, i32* %0
br label %14
14: ; preds = %12, %4
%15 = tail call i32 @free(i8* %7)
%16 = icmp eq i32* %1, null
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = call i32 @configFileValueLong(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i64* %5)
%19 = load i64, i64* %5
%20 = trunc i64 %19 to i32
store i32 %20, i32* %1
br label %21
21: ; preds = %17, %14
%22 = icmp eq i64* %2, null
br i1 %22, label %25, label %23
23: ; preds = %21
%24 = call i32 @configFileValueLong(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64* %2)
br label %25
25: ; preds = %23, %21
%26 = icmp eq i8** %3, null
br i1 %26, label %29, label %27
27: ; preds = %25
%28 = call i8* @configFileValue(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
store i8* %28, i8** %3
br label %29
29: ; preds = %27, %25
ret void
}