#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*/ libpath;
typedef int /*<<< orphan*/ datapath;
typedef int /*<<< orphan*/ configpath;

/* Variables and functions */
int /*<<< orphan*/ init_file_paths(char *, char *, char *);
int /*<<< orphan*/ my_strcat(char *, char *, int);
int /*<<< orphan*/ my_strcpy(char *, char *, int);
int /*<<< orphan*/ suffix(char *, char *);
void init_stuff(void) {
  char configpath[512];
  char libpath[512];
  char datapath[512];
  my_strcpy(configpath,
            "."
            "/"
            "lib"
            "/",
            sizeof(configpath));
  my_strcpy(libpath,
            "."
            "/"
            "lib"
            "/",
            sizeof(libpath));
  my_strcpy(datapath,
            "."
            "/"
            "lib"
            "/",
            sizeof(datapath));
  configpath[511] = '\0';
  libpath[511] = '\0';
  datapath[511] = '\0';
  if (!suffix(configpath, "/"))
    my_strcat(configpath, "/", sizeof(configpath));
  if (!suffix(libpath, "/"))
    my_strcat(libpath, "/", sizeof(libpath));
  if (!suffix(datapath, "/"))
    my_strcat(datapath, "/", sizeof(datapath));
  init_file_paths(configpath, libpath, datapath);
}


x86 assembly (clang, -O0):
<init_stuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x600,%rsp
lea    -0x200(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0x200,%edx
call   1030 <my_strcpy@plt>
lea    -0x400(%rbp),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x200,%edx
call   1030 <my_strcpy@plt>
lea    -0x600(%rbp),%rdi
lea    0xe77(%rip),%rsi
mov    $0x200,%edx
call   1030 <my_strcpy@plt>
movb   $0x0,-0x1(%rbp)
movb   $0x0,-0x201(%rbp)
movb   $0x0,-0x401(%rbp)
lea    -0x200(%rbp),%rdi
lea    0xe52(%rip),%rsi
call   1060 <suffix@plt>
cmp    $0x0,%eax
jne    11d9 <init_stuff+0x99>
lea    -0x200(%rbp),%rdi
lea    0xe36(%rip),%rsi
mov    $0x200,%edx
call   1040 <my_strcat@plt>
lea    -0x400(%rbp),%rdi
lea    0xe1e(%rip),%rsi
call   1060 <suffix@plt>
cmp    $0x0,%eax
jne    120d <init_stuff+0xcd>
lea    -0x400(%rbp),%rdi
lea    0xe02(%rip),%rsi
mov    $0x200,%edx
call   1040 <my_strcat@plt>
lea    -0x600(%rbp),%rdi
lea    0xdea(%rip),%rsi
call   1060 <suffix@plt>
cmp    $0x0,%eax
jne    1241 <init_stuff+0x101>
lea    -0x600(%rbp),%rdi
lea    0xdce(%rip),%rsi
mov    $0x200,%edx
call   1040 <my_strcat@plt>
lea    -0x200(%rbp),%rdi
lea    -0x400(%rbp),%rsi
lea    -0x600(%rbp),%rdx
call   1050 <init_file_paths@plt>
add    $0x600,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_stuff>:
push   %r14
push   %rbx
sub    $0x608,%rsp
lea    0xeaf(%rip),%rbx
lea    0x400(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x200,%edx
call   1030 <my_strcpy@plt>
lea    0x200(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x200,%edx
call   1030 <my_strcpy@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x200,%edx
call   1030 <my_strcpy@plt>
movb   $0x0,0x5ff(%rsp)
movb   $0x0,0x3ff(%rsp)
movb   $0x0,0x1ff(%rsp)
lea    0xe58(%rip),%rsi
mov    %r14,%rdi
call   1060 <suffix@plt>
test   %eax,%eax
jne    11d2 <init_stuff+0x92>
lea    0xe45(%rip),%rsi
lea    0x400(%rsp),%rdi
mov    $0x200,%edx
call   1040 <my_strcat@plt>
lea    0xe2c(%rip),%rsi
lea    0x200(%rsp),%rdi
call   1060 <suffix@plt>
test   %eax,%eax
jne    1203 <init_stuff+0xc3>
lea    0xe14(%rip),%rsi
lea    0x200(%rsp),%rdi
mov    $0x200,%edx
call   1040 <my_strcat@plt>
lea    0xdfb(%rip),%rsi
mov    %rsp,%rdi
call   1060 <suffix@plt>
test   %eax,%eax
jne    122a <init_stuff+0xea>
lea    0xde8(%rip),%rsi
mov    %rsp,%rdi
mov    $0x200,%edx
call   1040 <my_strcat@plt>
lea    0x400(%rsp),%rdi
lea    0x200(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <init_file_paths@plt>
add    $0x608,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"./lib/\00"
@.str.1 = [2 x i8] c"/\00"
define void @init_stuff() {
%1 = alloca [512 x i8]
%2 = alloca [512 x i8]
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = call i32 @my_strcpy(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 512)
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%7 = call i32 @my_strcpy(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 512)
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%9 = call i32 @my_strcpy(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 512)
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 511
store i8 0, i8* %10
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 511
store i8 0, i8* %11
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 511
store i8 0, i8* %12
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%14 = call i32 @suffix(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %0
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%18 = call i32 @my_strcat(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 512)
br label %19
19: ; preds = %16, %0
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%21 = call i32 @suffix(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %19
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%25 = call i32 @my_strcat(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 512)
br label %26
26: ; preds = %23, %19
%27 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%28 = call i32 @suffix(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %26
%31 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%32 = call i32 @my_strcat(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 512)
br label %33
33: ; preds = %30, %26
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%35 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%36 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%37 = call i32 @init_file_paths(i8* %34, i8* %35, i8* %36)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"./lib/\00"
@.str.1 = [2 x i8] c"/\00"
define void @init_stuff() {
%1 = alloca [512 x i8]
%2 = alloca [512 x i8]
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%7 = call i32 @my_strcpy(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 512)
%8 = call i32 @my_strcpy(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 512)
%9 = call i32 @my_strcpy(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 512)
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 511
store i8 0, i8* %10
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 511
store i8 0, i8* %11
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 511
store i8 0, i8* %12
%13 = call i32 @suffix(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 @my_strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 512)
br label %17
17: ; preds = %15, %0
%18 = call i32 @suffix(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @my_strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 512)
br label %22
22: ; preds = %20, %17
%23 = call i32 @suffix(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @my_strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 512)
br label %27
27: ; preds = %25, %22
%28 = call i32 @init_file_paths(i8* %4, i8* %5, i8* %6)
ret void
}