#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 *);
char *strdup(char const *);
const char *NCBI_GetTestDataPath(void) {
  static const char *s_NcbiTestDataPath = NULL;
  if (s_NcbiTestDataPath)
    return s_NcbiTestDataPath;
  s_NcbiTestDataPath = getenv("NCBI_TEST_DATA_PATH");
  if (s_NcbiTestDataPath)
    return s_NcbiTestDataPath = strdup(s_NcbiTestDataPath);
  s_NcbiTestDataPath = "/net/snowman/vol/projects/toolkit_test_data/";
  return s_NcbiTestDataPath;
}


x86 assembly (clang, -O0):
<NCBI_GetTestDataPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpq   $0x0,0x2f08(%rip)
je     1146 <NCBI_GetTestDataPath+0x26>
mov    0x2efb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    119c <NCBI_GetTestDataPath+0x7c>
lea    0xeb3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,0x2edf(%rip)
cmpq   $0x0,0x2ed7(%rip)
je     1183 <NCBI_GetTestDataPath+0x63>
mov    0x2eca(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,0x2ebe(%rip)
mov    %rax,-0x8(%rbp)
jmp    119c <NCBI_GetTestDataPath+0x7c>
lea    0xe8a(%rip),%rax
mov    %rax,0x2ea7(%rip)
mov    0x2ea0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NCBI_GetTestDataPath>:
push   %rax
mov    0x2f10(%rip),%rax
test   %rax,%rax
je     112f <NCBI_GetTestDataPath+0xf>
pop    %rcx
ret
lea    0xeca(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     114a <NCBI_GetTestDataPath+0x2a>
mov    %rax,%rdi
call   1040 <strdup@plt>
jmp    1151 <NCBI_GetTestDataPath+0x31>
lea    0xec3(%rip),%rax
mov    %rax,0x2ee0(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@NCBI_GetTestDataPath.s_NcbiTestDataPath = internal global i8* null
@.str = [20 x i8] c"NCBI_TEST_DATA_PATH\00"
@.str.1 = [45 x i8] c"/net/snowman/vol/projects/toolkit_test_data/\00"
define i8* @NCBI_GetTestDataPath() {
%1 = alloca i8*
%2 = load i8*, i8** @NCBI_GetTestDataPath.s_NcbiTestDataPath
%3 = icmp ne i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i8*, i8** @NCBI_GetTestDataPath.s_NcbiTestDataPath
store i8* %5, i8** %1
br label %15
6: ; preds = %0
%7 = call i8* @getenv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** @NCBI_GetTestDataPath.s_NcbiTestDataPath
%8 = load i8*, i8** @NCBI_GetTestDataPath.s_NcbiTestDataPath
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i8*, i8** @NCBI_GetTestDataPath.s_NcbiTestDataPath
%12 = call i8* @strdup(i8* %11)
store i8* %12, i8** @NCBI_GetTestDataPath.s_NcbiTestDataPath
store i8* %12, i8** %1
br label %15
13: ; preds = %6
store i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8** @NCBI_GetTestDataPath.s_NcbiTestDataPath
%14 = load i8*, i8** @NCBI_GetTestDataPath.s_NcbiTestDataPath
store i8* %14, i8** %1
br label %15
15: ; preds = %13, %10, %4
%16 = load i8*, i8** %1
ret i8* %16
}

LLVM IR (-O2):
@NCBI_GetTestDataPath.s_NcbiTestDataPath = internal unnamed_addr global i8* null
@.str = [20 x i8] c"NCBI_TEST_DATA_PATH\00"
@.str.1 = [45 x i8] c"/net/snowman/vol/projects/toolkit_test_data/\00"
define i8* @NCBI_GetTestDataPath() {
%1 = load i8*, i8** @NCBI_GetTestDataPath.s_NcbiTestDataPath
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i8* @getenv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @strdup(i8* %4)
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), %3 ]
store i8* %9, i8** @NCBI_GetTestDataPath.s_NcbiTestDataPath
br label %10
10: ; preds = %8, %0
%11 = phi i8* [ %1, %0 ], [ %9, %8 ]
ret i8* %11
}