#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 build_link(char *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
char *getenv(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
int main(int argc, char **argv) {
  const char *tmp = 0;
  char *tmp_prefix = 0;
  const char *kde_prefix = 0;
  int res = 0;
  if ((argc != 2) ||
      ((strcmp(argv[1], "tmp") != 0) && (strcmp(argv[1], "socket") != 0) &&
       (strcmp(argv[1], "cache") != 0))) {
    fprintf(stderr, "Usage: lnusertemp tmp|socket|cache\n");
    return 1;
  }
  tmp = getenv("KDETMP");
  if (!tmp || !tmp[0])
    tmp = getenv("TMPDIR");
  if (!tmp || !tmp[0])
    tmp = "/tmp";
  if (strcmp(argv[1], "tmp") == 0) {
    tmp_prefix = (char *)malloc(strlen(tmp) + strlen("/kde-") + 1);
    strcpy(tmp_prefix, tmp);
    strcat(tmp_prefix, "/kde-");
    kde_prefix = "/tmp-";
  } else if (strcmp(argv[1], "socket") == 0) {
    tmp_prefix = (char *)malloc(strlen(tmp) + strlen("/ksocket-") + 1);
    strcpy(tmp_prefix, tmp);
    strcat(tmp_prefix, "/ksocket-");
    kde_prefix = "/socket-";
  } else if (strcmp(argv[1], "cache") == 0) {
    tmp = getenv("KDEVARTMP");
    if (!tmp || !tmp[0])
      tmp = "/var/tmp";
    tmp_prefix = (char *)malloc(strlen(tmp) + strlen("/kdecache-") + 1);
    strcpy(tmp_prefix, tmp);
    strcat(tmp_prefix, "/kdecache-");
    kde_prefix = "/cache-";
  }
  res = build_link(tmp_prefix, kde_prefix);
  free(tmp_prefix);
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1229 <main+0x99>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8f(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     124a <main+0xba>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe04(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     124a <main+0xba>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xded(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     124a <main+0xba>
mov    0x2db0(%rip),%rax
mov    (%rax),%edi
lea    0xdd4(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1464 <main+0x2d4>
lea    0xde0(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1272 <main+0xe2>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1282 <main+0xf2>
lea    0xdbf(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     129a <main+0x10a>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    12a5 <main+0x115>
lea    0xdcb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdb9(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    131d <main+0x18d>
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x38(%rbp)
lea    0xd68(%rip),%rdi
call   1060 <strlen@plt>
mov    -0x38(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcpy@plt>
mov    -0x20(%rbp),%rdi
lea    0xd37(%rip),%rsi
call   10b0 <strcat@plt>
lea    0xd31(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1445 <main+0x2b5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcd4(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1395 <main+0x205>
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x40(%rbp)
lea    0xcfc(%rip),%rdi
call   1060 <strlen@plt>
mov    -0x40(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcpy@plt>
mov    -0x20(%rbp),%rdi
lea    0xccb(%rip),%rsi
call   10b0 <strcat@plt>
lea    0xcc9(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1440 <main+0x2b0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc63(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    143b <main+0x2ab>
lea    0xca4(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     13db <main+0x24b>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    13e6 <main+0x256>
lea    0xc86(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x48(%rbp)
lea    0xc77(%rip),%rdi
call   1060 <strlen@plt>
mov    -0x48(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcpy@plt>
mov    -0x20(%rbp),%rdi
lea    0xc46(%rip),%rsi
call   10b0 <strcat@plt>
lea    0xc45(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1440 <main+0x2b0>
jmp    1445 <main+0x2b5>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10a0 <build_link@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jne    11db <main+0x4b>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xec6(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11fa <main+0x6a>
mov    0x8(%rbx),%rdi
lea    0xe44(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11fa <main+0x6a>
mov    0x8(%rbx),%rdi
lea    0xe36(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11fa <main+0x6a>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
lea    0xe22(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%eax
jmp    1355 <main+0x1c5>
lea    0xe30(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1213 <main+0x83>
mov    %rax,%r14
cmpb   $0x0,(%rax)
jne    1233 <main+0xa3>
lea    0xe1e(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     122c <main+0x9c>
mov    %rax,%r14
cmpb   $0x0,(%rax)
jne    1233 <main+0xa3>
lea    0xe39(%rip),%r14
mov    0x8(%rbx),%rdi
lea    0xe2f(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     127b <main+0xeb>
mov    0x8(%rbx),%rdi
lea    0xdad(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12b5 <main+0x125>
mov    0x8(%rbx),%rdi
lea    0xd9f(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12ec <main+0x15c>
xor    %ebx,%ebx
xor    %esi,%esi
jmp    1341 <main+0x1b1>
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    0x6(%rax),%rdi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <strcpy@plt>
lea    0xd9e(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <strcat@plt>
lea    0xd95(%rip),%rsi
jmp    1341 <main+0x1b1>
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    0xa(%rax),%rdi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <strcpy@plt>
lea    0xd70(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <strcat@plt>
lea    0xd6b(%rip),%rsi
jmp    1341 <main+0x1b1>
lea    0xd6b(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1305 <main+0x175>
mov    %rax,%r14
cmpb   $0x0,(%rax)
jne    130c <main+0x17c>
lea    0xd5c(%rip),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    0xb(%rax),%rdi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <strcpy@plt>
lea    0xd3f(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <strcat@plt>
lea    0xd3b(%rip),%rsi
mov    %rbx,%rdi
call   10a0 <build_link@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"tmp\00"
@.str.1 = [7 x i8] c"socket\00"
@.str.2 = [6 x i8] c"cache\00"
@stderr = global i32 0
@.str.3 = [36 x i8] c"Usage: lnusertemp tmp|socket|cache\0A\00"
@.str.4 = [7 x i8] c"KDETMP\00"
@.str.5 = [7 x i8] c"TMPDIR\00"
@.str.6 = [5 x i8] c"/tmp\00"
@.str.7 = [6 x i8] c"/kde-\00"
@.str.8 = [6 x i8] c"/tmp-\00"
@.str.9 = [10 x i8] c"/ksocket-\00"
@.str.10 = [9 x i8] c"/socket-\00"
@.str.11 = [10 x i8] c"KDEVARTMP\00"
@.str.12 = [9 x i8] c"/var/tmp\00"
@.str.13 = [11 x i8] c"/kdecache-\00"
@.str.14 = [8 x i8] c"/cache-\00"
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*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* null, i8** %7
store i8* null, i8** %8
store i32 0, i32* %9
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %30, label %12
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %33
18: ; preds = %12
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %33
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %24, %2
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %129
33: ; preds = %24, %18, %12
%34 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
store i8* %34, i8** %6
%35 = load i8*, i8** %6
%36 = icmp ne i8* %35, null
br i1 %36, label %37, label %42
37: ; preds = %33
%38 = load i8*, i8** %6
%39 = getelementptr inbounds i8, i8* %38, i64 0
%40 = load i8, i8* %39
%41 = icmp ne i8 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %37, %33
%43 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
store i8* %43, i8** %6
br label %44
44: ; preds = %42, %37
%45 = load i8*, i8** %6
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %52
47: ; preds = %44
%48 = load i8*, i8** %6
%49 = getelementptr inbounds i8, i8* %48, i64 0
%50 = load i8, i8* %49
%51 = icmp ne i8 %50, 0
br i1 %51, label %53, label %52
52: ; preds = %47, %44
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %6
br label %53
53: ; preds = %52, %47
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %72
59: ; preds = %53
%60 = load i8*, i8** %6
%61 = call i64 @strlen(i8* %60)
%62 = call i64 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%63 = add nsw i64 %61, %62
%64 = add nsw i64 %63, 1
%65 = call i64 @malloc(i64 %64)
%66 = inttoptr i64 %65 to i8*
store i8* %66, i8** %7
%67 = load i8*, i8** %7
%68 = load i8*, i8** %6
%69 = call i32 @strcpy(i8* %67, i8* %68)
%70 = load i8*, i8** %7
%71 = call i32 @strcat(i8* %70, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8** %8
br label %122
72: ; preds = %53
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 1
%75 = load i8*, i8** %74
%76 = call i64 @strcmp(i8* %75, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %91
78: ; preds = %72
%79 = load i8*, i8** %6
%80 = call i64 @strlen(i8* %79)
%81 = call i64 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%82 = add nsw i64 %80, %81
%83 = add nsw i64 %82, 1
%84 = call i64 @malloc(i64 %83)
%85 = inttoptr i64 %84 to i8*
store i8* %85, i8** %7
%86 = load i8*, i8** %7
%87 = load i8*, i8** %6
%88 = call i32 @strcpy(i8* %86, i8* %87)
%89 = load i8*, i8** %7
%90 = call i32 @strcat(i8* %89, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8** %8
br label %121
91: ; preds = %72
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 1
%94 = load i8*, i8** %93
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %120
97: ; preds = %91
%98 = call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
store i8* %98, i8** %6
%99 = load i8*, i8** %6
%100 = icmp ne i8* %99, null
br i1 %100, label %101, label %106
101: ; preds = %97
%102 = load i8*, i8** %6
%103 = getelementptr inbounds i8, i8* %102, i64 0
%104 = load i8, i8* %103
%105 = icmp ne i8 %104, 0
br i1 %105, label %107, label %106
106: ; preds = %101, %97
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8** %6
br label %107
107: ; preds = %106, %101
%108 = load i8*, i8** %6
%109 = call i64 @strlen(i8* %108)
%110 = call i64 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
%111 = add nsw i64 %109, %110
%112 = add nsw i64 %111, 1
%113 = call i64 @malloc(i64 %112)
%114 = inttoptr i64 %113 to i8*
store i8* %114, i8** %7
%115 = load i8*, i8** %7
%116 = load i8*, i8** %6
%117 = call i32 @strcpy(i8* %115, i8* %116)
%118 = load i8*, i8** %7
%119 = call i32 @strcat(i8* %118, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8** %8
br label %120
120: ; preds = %107, %91
br label %121
121: ; preds = %120, %78
br label %122
122: ; preds = %121, %59
%123 = load i8*, i8** %7
%124 = load i8*, i8** %8
%125 = call i32 @build_link(i8* %123, i8* %124)
store i32 %125, i32* %9
%126 = load i8*, i8** %7
%127 = call i32 @free(i8* %126)
%128 = load i32, i32* %9
store i32 %128, i32* %3
br label %129
129: ; preds = %122, %30
%130 = load i32, i32* %3
ret i32 %130
}

LLVM IR (-O2):
@.str = [4 x i8] c"tmp\00"
@.str.1 = [7 x i8] c"socket\00"
@.str.2 = [6 x i8] c"cache\00"
@stderr = global i32 0
@.str.3 = [36 x i8] c"Usage: lnusertemp tmp|socket|cache\0A\00"
@.str.4 = [7 x i8] c"KDETMP\00"
@.str.5 = [7 x i8] c"TMPDIR\00"
@.str.6 = [5 x i8] c"/tmp\00"
@.str.7 = [6 x i8] c"/kde-\00"
@.str.8 = [6 x i8] c"/tmp-\00"
@.str.9 = [10 x i8] c"/ksocket-\00"
@.str.10 = [9 x i8] c"/socket-\00"
@.str.11 = [10 x i8] c"KDEVARTMP\00"
@.str.12 = [9 x i8] c"/var/tmp\00"
@.str.13 = [11 x i8] c"/kdecache-\00"
@.str.14 = [8 x i8] c"/cache-\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %20, label %9
9: ; preds = %4
%10 = load i8*, i8** %5
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %13, %2
%18 = load i32, i32* @stderr
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %80
20: ; preds = %13, %9, %4
%21 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i8* %21, null
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load i8, i8* %21
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %33
26: ; preds = %20, %23
%27 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%28 = icmp eq i8* %27, null
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = load i8, i8* %27
%31 = icmp eq i8 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %29, %26
br label %33
33: ; preds = %23, %32, %29
%34 = phi i8* [ %27, %29 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), %32 ], [ %21, %23 ]
%35 = load i8*, i8** %5
%36 = tail call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %45
38: ; preds = %33
%39 = tail call i64 @strlen(i8* dereferenceable(1) %34)
%40 = add nsw i64 %39, 6
%41 = tail call i64 @malloc(i64 %40)
%42 = inttoptr i64 %41 to i8*
%43 = tail call i32 @strcpy(i8* %42, i8* %34)
%44 = tail call i32 @strcat(i8* %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %75
45: ; preds = %33
%46 = load i8*, i8** %5
%47 = tail call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %56
49: ; preds = %45
%50 = tail call i64 @strlen(i8* dereferenceable(1) %34)
%51 = add nsw i64 %50, 10
%52 = tail call i64 @malloc(i64 %51)
%53 = inttoptr i64 %52 to i8*
%54 = tail call i32 @strcpy(i8* %53, i8* %34)
%55 = tail call i32 @strcat(i8* %53, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %75
56: ; preds = %45
%57 = load i8*, i8** %5
%58 = tail call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %75
60: ; preds = %56
%61 = tail call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%62 = icmp eq i8* %61, null
br i1 %62, label %66, label %63
63: ; preds = %60
%64 = load i8, i8* %61
%65 = icmp eq i8 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %63, %60
br label %67
67: ; preds = %66, %63
%68 = phi i8* [ %61, %63 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), %66 ]
%69 = tail call i64 @strlen(i8* dereferenceable(1) %68)
%70 = add nsw i64 %69, 11
%71 = tail call i64 @malloc(i64 %70)
%72 = inttoptr i64 %71 to i8*
%73 = tail call i32 @strcpy(i8* %72, i8* %68)
%74 = tail call i32 @strcat(i8* %72, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
br label %75
75: ; preds = %49, %67, %56, %38
%76 = phi i8* [ %42, %38 ], [ %53, %49 ], [ %72, %67 ], [ null, %56 ]
%77 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), %38 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), %49 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), %67 ], [ null, %56 ]
%78 = tail call i32 @build_link(i8* %76, i8* %77)
%79 = tail call i32 @free(i8* %76)
br label %80
80: ; preds = %75, %17
%81 = phi i32 [ 1, %17 ], [ %78, %75 ]
ret i32 %81
}