#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*/ tbuf;

/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ realpath(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, ...);
int /*<<< orphan*/ strcmp(char *, char *);
scalar_t__ strlen(char *);
int write(int /*<<< orphan*/, char *, scalar_t__);
int main(int argc, char **argv) {
  int i, perm = 0;
  if (!getenv("TERMINOLOGY"))
    return 0;
  if (argc > 1 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) {
    printf("Usage: %s [-p] [FILE1 FILE2 ...]\n"
           "  Change the terminal background to the given file/uri\n"
           "  -p  Make change permanent (stored in config)\n"
           "\n",
           argv[0]);
    return 0;
  }
  if (argc <= 1) {
    char tbuf[32];
    snprintf(tbuf, sizeof(tbuf), "%c}bt", 0x1b);
    if (write(0, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1))
      perror("write");
    return 0;
  }
  for (i = 1; i < argc; i++) {
    char *path, buf[PATH_MAX * 2], tbuf[PATH_MAX * 3];
    if (!strcmp(argv[i], "-p")) {
      perm = 1;
      i++;
      if (i >= argc)
        break;
    }
    path = argv[i];
    if (realpath(path, buf))
      path = buf;
    if (perm)
      snprintf(tbuf, sizeof(tbuf), "%c}bp%s", 0x1b, path);
    else
      snprintf(tbuf, sizeof(tbuf), "%c}bt%s", 0x1b, path);
    if (write(0, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1))
      perror("write");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xe59(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%eax
jne    11c1 <main+0x41>
movl   $0x0,-0x4(%rbp)
jmp    146a <main+0x2ea>
cmpl   $0x1,-0x8(%rbp)
jle    1224 <main+0xa4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe32(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
je     1205 <main+0x85>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe18(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1224 <main+0xa4>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe03(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    146a <main+0x2ea>
cmpl   $0x1,-0x8(%rbp)
jg     12a3 <main+0x123>
lea    -0x40(%rbp),%rdi
mov    $0x20,%esi
lea    0xe61(%rip),%rdx
mov    $0x1b,%ecx
mov    $0x0,%al
call   1070 <snprintf@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    -0x40(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x70(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %edi,%edi
call   1040 <write@plt>
mov    %eax,-0x68(%rbp)
lea    -0x40(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x68(%rbp),%eax
add    $0x1,%rcx
cmp    %ecx,%eax
je     1297 <main+0x117>
lea    0xe13(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    146a <main+0x2ea>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1463 <main+0x2e3>
mov    0x2d33(%rip),%rax
mov    (%rax),%ecx
add    %ecx,%ecx
mov    %rsp,%rdx
mov    %rdx,-0x50(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x88(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x58(%rbp)
mov    (%rax),%ecx
mov    %ecx,%eax
lea    (%rax,%rax,2),%eax
mov    %rax,-0x80(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd8a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    135c <main+0x1dc>
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1357 <main+0x1d7>
movl   $0x2,-0x64(%rbp)
jmp    1434 <main+0x2b4>
jmp    135c <main+0x1dc>
mov    -0x88(%rbp),%rsi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
call   1090 <realpath@plt>
cmp    $0x0,%rax
je     1391 <main+0x211>
mov    -0x88(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     13c1 <main+0x241>
mov    -0x78(%rbp),%rdi
mov    -0x80(%rbp),%rax
mov    %eax,%esi
mov    -0x48(%rbp),%r8
lea    0xcfe(%rip),%rdx
mov    $0x1b,%ecx
mov    $0x0,%al
call   1070 <snprintf@plt>
jmp    13e2 <main+0x262>
mov    -0x78(%rbp),%rdi
mov    -0x80(%rbp),%rax
mov    %eax,%esi
mov    -0x48(%rbp),%r8
lea    0xce0(%rip),%rdx
mov    $0x1b,%ecx
mov    $0x0,%al
call   1070 <snprintf@plt>
mov    -0x78(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x78(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %edi,%edi
call   1040 <write@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,-0x8c(%rbp)
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x8c(%rbp),%eax
add    $0x1,%rcx
cmp    %ecx,%eax
je     142d <main+0x2ad>
lea    0xc7d(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,%rsp
mov    -0x64(%rbp),%eax
test   %eax,%eax
je     1450 <main+0x2d0>
jmp    144b <main+0x2cb>
jmp    1463 <main+0x2e3>
jmp    1455 <main+0x2d5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12aa <main+0x12a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,-0x38(%rbp)
mov    %edi,-0x2c(%rbp)
lea    0xe61(%rip),%rdi
call   1030 <getenv@plt>
test   %eax,%eax
je     137f <main+0x1ff>
cmpl   $0x2,-0x2c(%rbp)
jl     1318 <main+0x198>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rbx
lea    0xe47(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
je     136c <main+0x1ec>
lea    0xe33(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
je     136c <main+0x1ec>
mov    $0x1,%r13d
movl   $0x0,-0x30(%rbp)
jmp    1284 <main+0x104>
xchg   %ax,%ax
mov    -0x30(%rbp),%r15d
mov    %r14,%rdi
mov    %r12,%rsi
call   1090 <realpath@plt>
test   %rax,%rax
cmove  %r14,%r12
mov    %r15d,-0x30(%rbp)
test   %r15d,%r15d
lea    0xe8a(%rip),%rdx
lea    0xe8b(%rip),%rax
cmove  %rax,%rdx
mov    %rbx,%rdi
mov    -0x40(%rbp),%rsi
mov    $0x1b,%ecx
mov    %r12,%r8
xor    %eax,%eax
call   1070 <snprintf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rdx
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <write@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
cmp    %eax,%r14d
jne    1307 <main+0x187>
mov    -0x48(%rbp),%rsp
add    $0x1,%r13d
cmp    -0x2c(%rbp),%r13d
jge    137f <main+0x1ff>
mov    %rsp,%r15
mov    0x2d62(%rip),%rcx
mov    (%rcx),%eax
add    %eax,%eax
mov    %rsp,%r12
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    (%rcx),%eax
lea    (%rax,%rax,2),%eax
mov    %rax,-0x40(%rbp)
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
movslq %r13d,%rax
mov    -0x38(%rbp),%rcx
mov    (%rcx,%rax,8),%r14
mov    %r14,%rdi
lea    0xdd9(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
mov    %r15,-0x48(%rbp)
jne    1200 <main+0x80>
add    $0x1,%r13d
cmp    -0x2c(%rbp),%r13d
jge    1390 <main+0x210>
movslq %r13d,%rax
mov    -0x38(%rbp),%rcx
mov    (%rcx,%rax,8),%r14
mov    $0x1,%r15d
jmp    1204 <main+0x84>
lea    0xd97(%rip),%rdi
call   10a0 <perror@plt>
jmp    1272 <main+0xf2>
lea    0xd80(%rip),%rdx
lea    -0x70(%rbp),%r14
mov    %r14,%rdi
mov    $0x20,%esi
mov    $0x1b,%ecx
xor    %eax,%eax
call   1070 <snprintf@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rdx
xor    %edi,%edi
mov    %r14,%rsi
call   1040 <write@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
cmp    %eax,%ebx
je     137f <main+0x1ff>
lea    0xd40(%rip),%rdi
call   10a0 <perror@plt>
jmp    137f <main+0x1ff>
mov    -0x38(%rbp),%rax
mov    (%rax),%rsi
lea    0xc9c(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r15,%rsp
jmp    137f <main+0x1ff>

LLVM IR (-O0):
@.str = [12 x i8] c"TERMINOLOGY\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [7 x i8] c"--help\00"
@.str.3 = [137 x i8] c"Usage: %s [-p] [FILE1 FILE2 ...]\0A Change the terminal background to the given file/uri\0A -p Make change permanent (stored in config)\0A\0A\00"
@.str.4 = [6 x i8] c"%c}bt\00"
@.str.5 = [6 x i8] c"write\00"
@PATH_MAX = global i32 0
@.str.6 = [3 x i8] c"-p\00"
@.str.7 = [8 x i8] c"%c}bp%s\00"
@.str.8 = [8 x i8] c"%c}bt%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [32 x i8]
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%14 = call i32 @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %2
store i32 0, i32* %3
br label %126
17: ; preds = %2
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 1
br i1 %19, label %20, label %37
20: ; preds = %17
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %20
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br i1 %31, label %37, label %32
32: ; preds = %26, %20
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 0
%35 = load i8*, i8** %34
%36 = call i32 @printf(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i8* %35)
store i32 0, i32* %3
br label %126
37: ; preds = %26, %17
%38 = load i32, i32* %4
%39 = icmp sle i32 %38, 1
br i1 %39, label %40, label %56
40: ; preds = %37
%41 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%42 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %41, i32 32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 27)
%43 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%44 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%45 = call i64 @strlen(i8* %44)
%46 = add nsw i64 %45, 1
%47 = call i32 @write(i32 0, i8* %43, i64 %46)
%48 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%49 = call i64 @strlen(i8* %48)
%50 = add nsw i64 %49, 1
%51 = trunc i64 %50 to i32
%52 = icmp ne i32 %47, %51
br i1 %52, label %53, label %55
53: ; preds = %40
%54 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %55
55: ; preds = %53, %40
store i32 0, i32* %3
br label %126
56: ; preds = %37
store i32 1, i32* %6
br label %57
57: ; preds = %122, %56
%58 = load i32, i32* %6
%59 = load i32, i32* %4
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %125
61: ; preds = %57
%62 = load i32, i32* @PATH_MAX
%63 = mul nsw i32 %62, 2
%64 = zext i32 %63 to i64
%65 = call i8* @llvm.stacksave()
store i8* %65, i8** %10
%66 = alloca i8, i64 %64
store i64 %64, i64* %11
%67 = load i32, i32* @PATH_MAX
%68 = mul nsw i32 %67, 3
%69 = zext i32 %68 to i64
%70 = alloca i8, i64 %69
store i64 %69, i64* %12
%71 = load i8**, i8*** %5
%72 = load i32, i32* %6
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8*, i8** %71, i64 %73
%75 = load i8*, i8** %74
%76 = call i32 @strcmp(i8* %75, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%77 = icmp ne i32 %76, 0
br i1 %77, label %86, label %78
78: ; preds = %61
store i32 1, i32* %7
%79 = load i32, i32* %6
%80 = add nsw i32 %79, 1
store i32 %80, i32* %6
%81 = load i32, i32* %6
%82 = load i32, i32* %4
%83 = icmp sge i32 %81, %82
br i1 %83, label %84, label %85
84: ; preds = %78
store i32 2, i32* %13
br label %118
85: ; preds = %78
br label %86
86: ; preds = %85, %61
%87 = load i8**, i8*** %5
%88 = load i32, i32* %6
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8*, i8** %87, i64 %89
%91 = load i8*, i8** %90
store i8* %91, i8** %9
%92 = load i8*, i8** %9
%93 = call i64 @realpath(i8* %92, i8* %66)
%94 = icmp ne i64 %93, 0
br i1 %94, label %95, label %96
95: ; preds = %86
store i8* %66, i8** %9
br label %96
96: ; preds = %95, %86
%97 = load i32, i32* %7
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %103
99: ; preds = %96
%100 = trunc i64 %69 to i32
%101 = load i8*, i8** %9
%102 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %70, i32 %100, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 27, i8* %101)
br label %107
103: ; preds = %96
%104 = trunc i64 %69 to i32
%105 = load i8*, i8** %9
%106 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %70, i32 %104, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 27, i8* %105)
br label %107
107: ; preds = %103, %99
%108 = call i64 @strlen(i8* %70)
%109 = add nsw i64 %108, 1
%110 = call i32 @write(i32 0, i8* %70, i64 %109)
%111 = call i64 @strlen(i8* %70)
%112 = add nsw i64 %111, 1
%113 = trunc i64 %112 to i32
%114 = icmp ne i32 %110, %113
br i1 %114, label %115, label %117
115: ; preds = %107
%116 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %117
117: ; preds = %115, %107
store i32 0, i32* %13
br label %118
118: ; preds = %117, %84
%119 = load i8*, i8** %10
%120 = load i32, i32* %13
switch i32 %120, label %128 [
i32 0, label %121
i32 2, label %125
]
121: ; preds = %118
br label %122
122: ; preds = %121
%123 = load i32, i32* %6
%124 = add nsw i32 %123, 1
store i32 %124, i32* %6
br label %57
125: ; preds = %118, %57
store i32 0, i32* %3
br label %126
126: ; preds = %125, %55, %32, %16
%127 = load i32, i32* %3
ret i32 %127
128: ; preds = %118
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"TERMINOLOGY\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [7 x i8] c"--help\00"
@.str.3 = [137 x i8] c"Usage: %s [-p] [FILE1 FILE2 ...]\0A Change the terminal background to the given file/uri\0A -p Make change permanent (stored in config)\0A\0A\00"
@.str.4 = [6 x i8] c"%c}bt\00"
@.str.5 = [6 x i8] c"write\00"
@PATH_MAX = global i32 0
@.str.6 = [3 x i8] c"-p\00"
@.str.7 = [8 x i8] c"%c}bp%s\00"
@.str.8 = [8 x i8] c"%c}bt%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [32 x i8]
%4 = tail call i32 @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %79, label %6
6: ; preds = %2
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %19
8: ; preds = %6
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %32
16: ; preds = %13, %8
%17 = load i8*, i8** %1
%18 = tail call i32 @printf(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.3, i64 0, i64 0), i8* %17)
br label %79
19: ; preds = %6
%20 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%21 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %20, i32 32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 27)
%22 = call i64 @strlen(i8* %20)
%23 = add nsw i64 %22, 1
%24 = call i32 @write(i32 0, i8* %20, i64 %23)
%25 = call i64 @strlen(i8* %20)
%26 = trunc i64 %25 to i32
%27 = add i32 %26, 1
%28 = icmp eq i32 %24, %27
br i1 %28, label %31, label %29
29: ; preds = %19
%30 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %31
31: ; preds = %29, %19
br label %79
32: ; preds = %13, %76
%33 = phi i32 [ %77, %76 ], [ 1, %13 ]
%34 = phi i32 [ %58, %76 ], [ 0, %13 ]
%35 = load i32, i32* @PATH_MAX
%36 = shl nsw i32 %35, 1
%37 = zext i32 %36 to i64
%38 = call i8* @llvm.stacksave()
%39 = alloca i8, i64 %37
%40 = load i32, i32* @PATH_MAX
%41 = mul nsw i32 %40, 3
%42 = zext i32 %41 to i64
%43 = alloca i8, i64 %42
%44 = sext i32 %33 to i64
%45 = getelementptr inbounds i8*, i8** %1, i64 %44
%46 = load i8*, i8** %45
%47 = call i32 @strcmp(i8* dereferenceable(1) %46, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %56
49: ; preds = %32
%50 = add nsw i32 %33, 1
%51 = icmp slt i32 %50, %0
br i1 %51, label %52, label %75
52: ; preds = %49
%53 = sext i32 %50 to i64
%54 = getelementptr inbounds i8*, i8** %1, i64 %53
%55 = load i8*, i8** %54
br label %56
56: ; preds = %52, %32
%57 = phi i8* [ %46, %32 ], [ %55, %52 ]
%58 = phi i32 [ %34, %32 ], [ 1, %52 ]
%59 = phi i32 [ %33, %32 ], [ %50, %52 ]
%60 = call i64 @realpath(i8* %57, i8* %39)
%61 = icmp eq i64 %60, 0
%62 = select i1 %61, i8* %57, i8* %39
%63 = icmp eq i32 %58, 0
%64 = select i1 %63, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0)
%65 = call i32 (i8*, i32, i8*, i32, ...) @snprintf(i8* %43, i32 %41, i8* %64, i32 27, i8* %62)
%66 = call i64 @strlen(i8* %43)
%67 = add nsw i64 %66, 1
%68 = call i32 @write(i32 0, i8* %43, i64 %67)
%69 = call i64 @strlen(i8* %43)
%70 = trunc i64 %69 to i32
%71 = add i32 %70, 1
%72 = icmp eq i32 %68, %71
br i1 %72, label %76, label %73
73: ; preds = %56
%74 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %76
75: ; preds = %49
br label %79
76: ; preds = %73, %56
%77 = add nsw i32 %59, 1
%78 = icmp slt i32 %77, %0
br i1 %78, label %32, label %79
79: ; preds = %76, %75, %2, %31, %16
ret i32 0
}