#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 EXIT_SUCCESS;
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ log_init(char *, int);
char *strdup(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  log_init("debug", 0x01);
  char *pwd = strdup(getenv("PWD"));
  char *home = strdup(getenv("HOME"));
  char *path = strdup(getenv("PATH"));
  ;
  ;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x1,%esi
call   1040 <log_init@plt>
lea    0xea8(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
lea    0xe95(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,-0x20(%rbp)
lea    0xe83(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,-0x28(%rbp)
mov    0x2e3d(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x1,%esi
call   1040 <log_init@plt>
lea    0xebd(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
lea    0xeae(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
lea    0xea0(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"debug\00"
@.str.1 = [4 x i8] c"PWD\00"
@.str.2 = [5 x i8] c"HOME\00"
@.str.3 = [5 x i8] c"PATH\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @log_init(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
%10 = call i32 @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = call i8* @strdup(i32 %10)
store i8* %11, i8** %6
%12 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%13 = call i8* @strdup(i32 %12)
store i8* %13, i8** %7
%14 = call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%15 = call i8* @strdup(i32 %14)
store i8* %15, i8** %8
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@.str = [6 x i8] c"debug\00"
@.str.1 = [4 x i8] c"PWD\00"
@.str.2 = [5 x i8] c"HOME\00"
@.str.3 = [5 x i8] c"PATH\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @log_init(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i8* @strdup(i32 %4)
%6 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i8* @strdup(i32 %6)
%8 = tail call i32 @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i8* @strdup(i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}