#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*/ path;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _HE(char *);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(int /*<<< orphan*/, char *);
char *getenv(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char *argv[]) {
  char *p;
  char path[2048];
  FILE *f;
  bzero(path, sizeof(path));
  p = getenv("HOME");
  if (p)
    strncpy(path, p, sizeof(path) - 64);
  strcat(path, "/.myrcfile");
  f = fopen(_HE(path), "r");
  if (f)
    fclose(f);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x820(%rbp),%rdi
mov    $0x800,%esi
call   1070 <bzero@plt>
lea    0xe4f(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11da <main+0x5a>
lea    -0x820(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x7c0,%edx
call   1040 <strncpy@plt>
lea    -0x820(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   1080 <strcat@plt>
lea    -0x820(%rbp),%rdi
call   1090 <_HE@plt>
mov    %eax,%edi
lea    0xe0e(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x828(%rbp)
cmpq   $0x0,-0x828(%rbp)
je     1228 <main+0xa8>
mov    -0x828(%rbp),%rdi
call   1050 <fclose@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x800,%rsp
mov    %rsp,%rdi
mov    $0x800,%esi
call   1070 <bzero@plt>
lea    0xe64(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     11b6 <main+0x36>
mov    %rsp,%rdi
mov    %rax,%rsi
mov    $0x7c0,%edx
call   1040 <strncpy@plt>
lea    0xe48(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1080 <strcat@plt>
mov    %rbx,%rdi
call   1090 <_HE@plt>
lea    0xe39(%rip),%rsi
mov    %eax,%edi
call   1060 <fopen@plt>
test   %rax,%rax
je     11eb <main+0x6b>
mov    %rax,%rdi
call   1050 <fclose@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [11 x i8] c"/.myrcfile\00"
@.str.2 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [2048 x i8]
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%10 = call i32 @bzero(i8* %9, i32 2048)
%11 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%16 = load i8*, i8** %6
%17 = call i32 @strncpy(i8* %15, i8* %16, i32 1984)
br label %18
18: ; preds = %14, %2
%19 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%20 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%22 = call i32 @_HE(i8* %21)
%23 = call i32* @fopen(i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %23, i32** %8
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %29
26: ; preds = %18
%27 = load i32*, i32** %8
%28 = call i32 @fclose(i32* %27)
br label %29
29: ; preds = %26, %18
%30 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [11 x i8] c"/.myrcfile\00"
@.str.2 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 @bzero(i8* %4, i32 2048)
%6 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @strncpy(i8* %4, i8* %6, i32 1984)
br label %10
10: ; preds = %8, %2
%11 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @_HE(i8* %4)
%13 = call i32* @fopen(i32 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %17, label %15
15: ; preds = %10
%16 = call i32 @fclose(i32* %13)
br label %17
17: ; preds = %15, %10
%18 = call i32 @exit(i32 0)
unreachable
}