#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 *);
scalar_t__ gmalloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(void *, char *);
void initialize_environments(void **root_path, void **port) {
  *root_path = (char *)gmalloc(255);
  memset(*root_path, 0, 255);
  *port = (char *)gmalloc(255);
  memset(*port, 0, 255);
  strcpy(*root_path, getenv("PWD"));
  strcpy(*port, "8080");
}


x86 assembly (clang, -O0):
<initialize_environments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xff,%edi
call   1040 <gmalloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1060 <memset@plt>
mov    $0xff,%edi
call   1040 <gmalloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1060 <memset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    0xe50(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
call   1050 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe35(%rip),%rsi
call   1050 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_environments>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xff,%edi
call   1040 <gmalloc@plt>
mov    %rax,(%rbx)
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1060 <memset@plt>
mov    $0xff,%edi
call   1040 <gmalloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1060 <memset@plt>
mov    (%rbx),%rbx
lea    0xe74(%rip),%rdi
call   1030 <getenv@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <strcpy@plt>
mov    (%r14),%rdi
lea    0xe5e(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <strcpy@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"PWD\00"
@.str.1 = [5 x i8] c"8080\00"
define void @initialize_environments(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%5 = call i64 @gmalloc(i32 255)
%6 = inttoptr i64 %5 to i8*
%7 = load i8**, i8*** %3
store i8* %6, i8** %7
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = call i32 @memset(i8* %9, i32 0, i32 255)
%11 = call i64 @gmalloc(i32 255)
%12 = inttoptr i64 %11 to i8*
%13 = load i8**, i8*** %4
store i8* %12, i8** %13
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
%16 = call i32 @memset(i8* %15, i32 0, i32 255)
%17 = load i8**, i8*** %3
%18 = load i8*, i8** %17
%19 = call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @strcpy(i8* %18, i8* %19)
%21 = load i8**, i8*** %4
%22 = load i8*, i8** %21
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"PWD\00"
@.str.1 = [5 x i8] c"8080\00"
define void @initialize_environments(i8** nocapture %0, i8** nocapture %1) {
%3 = tail call i64 @gmalloc(i32 255)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %0
%5 = tail call i32 @memset(i8* %4, i32 0, i32 255)
%6 = tail call i64 @gmalloc(i32 255)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %1
%8 = tail call i32 @memset(i8* %7, i32 0, i32 255)
%9 = load i8*, i8** %0
%10 = tail call i8* @getenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %1
%13 = tail call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}