#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 *expand_path(char *, char *);
char *getenv(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *pit_file_name() {
  static char file_name[128];
  if (!*file_name) {
    char *penv = getenv("PITFILE");
    char *expanded = expand_path(penv ? penv : "~/.pit", file_name);
    if (expanded != file_name) {
      strcpy(file_name, expanded);
    }
  }
  return file_name;
}


x86 assembly (clang, -O0):
<pit_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
cmpb   $0x0,0x2f11(%rip)
jne    11b7 <pit_file_name+0x87>
lea    0xeb4(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116d <pit_file_name+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    117d <pit_file_name+0x4d>
lea    0xe94(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    117d <pit_file_name+0x4d>
mov    -0x18(%rbp),%rdi
lea    0x2ec8(%rip),%rsi
call   1050 <expand_path@plt>
mov    %rax,-0x10(%rbp)
lea    0x2eb8(%rip),%rax
cmp    %rax,-0x10(%rbp)
je     11b2 <pit_file_name+0x82>
mov    -0x10(%rbp),%rsi
lea    0x2ea3(%rip),%rdi
call   1040 <strcpy@plt>
jmp    11b7 <pit_file_name+0x87>
lea    0x2e92(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pit_file_name>:
push   %rbx
cmpb   $0x0,0x2f18(%rip)
jne    1177 <pit_file_name+0x47>
lea    0xebf(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xeb8(%rip),%rdi
cmovne %rax,%rdi
lea    0x2ef5(%rip),%rbx
mov    %rbx,%rsi
call   1050 <expand_path@plt>
cmp    %rbx,%rax
je     1177 <pit_file_name+0x47>
lea    0x2ee1(%rip),%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
lea    0x2ed2(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@pit_file_name.file_name = internal global [128 x i8] zeroinitializer
@.str = [8 x i8] c"PITFILE\00"
@.str.1 = [7 x i8] c"~/.pit\00"
define i8* @pit_file_name() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i8, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @pit_file_name.file_name, i64 0, i64 0)
%4 = icmp ne i8 %3, 0
br i1 %4, label %21, label %5
5: ; preds = %0
%6 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = load i8*, i8** %1
br label %12
11: ; preds = %5
br label %12
12: ; preds = %11, %9
%13 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %11 ]
%14 = call i8* @expand_path(i8* %13, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @pit_file_name.file_name, i64 0, i64 0))
store i8* %14, i8** %2
%15 = load i8*, i8** %2
%16 = icmp ne i8* %15, getelementptr inbounds ([128 x i8], [128 x i8]* @pit_file_name.file_name, i64 0, i64 0)
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i8*, i8** %2
%19 = call i32 @strcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @pit_file_name.file_name, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %17, %12
br label %21
21: ; preds = %20, %0
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @pit_file_name.file_name, i64 0, i64 0)
}

LLVM IR (-O2):
@pit_file_name.file_name = internal global [128 x i8] zeroinitializer
@.str = [8 x i8] c"PITFILE\00"
@.str.1 = [7 x i8] c"~/.pit\00"
define i8* @pit_file_name() {
%1 = load i8, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @pit_file_name.file_name, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %3, label %11
3: ; preds = %0
%4 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4
%7 = tail call i8* @expand_path(i8* %6, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @pit_file_name.file_name, i64 0, i64 0))
%8 = icmp eq i8* %7, getelementptr inbounds ([128 x i8], [128 x i8]* @pit_file_name.file_name, i64 0, i64 0)
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @pit_file_name.file_name, i64 0, i64 0), i8* %7)
br label %11
11: ; preds = %3, %9, %0
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @pit_file_name.file_name, i64 0, i64 0)
}