#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 */
char *getenv(char *);
int /*<<< orphan*/ readconfig(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void loadconfig(void) {
  char filename[255];
  strncpy(filename, "/etc", 255);
  strncat(filename, "/", 255);
  strncat(filename, "bloomutil", 255);
  readconfig(filename);
  strncpy(filename, getenv("HOME"), 255);
  strncat(filename, "/", 255);
  strncat(filename, ".", 255);
  strncat(filename, "bloomutil", 255);
  readconfig(filename);
}


x86 assembly (clang, -O0):
<loadconfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
lea    -0x100(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0xff,%edx
call   1050 <strncat@plt>
lea    -0x100(%rbp),%rdi
lea    0xe7e(%rip),%rsi
mov    $0xff,%edx
call   1050 <strncat@plt>
lea    -0x100(%rbp),%rdi
call   1060 <readconfig@plt>
lea    -0x100(%rbp),%rax
mov    %rax,-0x108(%rbp)
lea    0xe5d(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x108(%rbp),%rdi
mov    %rax,%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
lea    -0x100(%rbp),%rdi
lea    0xe2a(%rip),%rsi
mov    $0xff,%edx
call   1050 <strncat@plt>
lea    -0x100(%rbp),%rdi
lea    0xe23(%rip),%rsi
mov    $0xff,%edx
call   1050 <strncat@plt>
lea    -0x100(%rbp),%rdi
lea    0xdfc(%rip),%rsi
mov    $0xff,%edx
call   1050 <strncat@plt>
lea    -0x100(%rbp),%rdi
call   1060 <readconfig@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadconfig>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
lea    0xead(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xff,%edx
call   1040 <strncpy@plt>
lea    0xe9b(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xff,%edx
call   1050 <strncat@plt>
lea    0xe86(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xff,%edx
call   1050 <strncat@plt>
mov    %rbx,%rdi
call   1060 <readconfig@plt>
lea    0xe71(%rip),%rdi
call   1030 <getenv@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xff,%edx
call   1050 <strncat@plt>
lea    0xe4a(%rip),%rsi
mov    %rbx,%rdi
mov    $0xff,%edx
call   1050 <strncat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xff,%edx
call   1050 <strncat@plt>
mov    %rbx,%rdi
call   1060 <readconfig@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"/etc\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [10 x i8] c"bloomutil\00"
@.str.3 = [5 x i8] c"HOME\00"
@.str.4 = [2 x i8] c".\00"
define void @loadconfig() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @strncpy(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 255)
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%5 = call i32 @strncat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 255)
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%7 = call i32 @strncat(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 255)
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%9 = call i32 @readconfig(i8* %8)
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%11 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @strncpy(i8* %10, i8* %11, i32 255)
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%14 = call i32 @strncat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 255)
%15 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%16 = call i32 @strncat(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 255)
%17 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%18 = call i32 @strncat(i8* %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 255)
%19 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%20 = call i32 @readconfig(i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"/etc\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [10 x i8] c"bloomutil\00"
@.str.3 = [5 x i8] c"HOME\00"
@.str.4 = [2 x i8] c".\00"
define void @loadconfig() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = call i32 @strncpy(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 255)
%4 = call i32 @strncat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 255)
%5 = call i32 @strncat(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 255)
%6 = call i32 @readconfig(i8* %2)
%7 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @strncpy(i8* %2, i8* %7, i32 255)
%9 = call i32 @strncat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 255)
%10 = call i32 @strncat(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 255)
%11 = call i32 @strncat(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 255)
%12 = call i32 @readconfig(i8* %2)
ret void
}