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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ has_prefix(char const *, char *, int /*<<< orphan*/ *);
scalar_t__ has_prog_suffix(char const *);
scalar_t__ has_suffix(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ process_file(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdout;
scalar_t__ strlen(char *);
int main(int argc, char *argv[]) {
  char cmd_prefix[2048];
  int cmd_len = 0;
  char cpp_cmd_prefix[2048];
  int cpp_cmd_len = 0;
  int argn;
  FILE *ofp = stdout;
  for (argn = 1; argn != argc; argn++) {
    const char *arg = argv[argn];
    if (!has_prog_suffix(arg)) {
      if (has_prefix(arg, "-c++=", NULL)) {
        snprintf(&cpp_cmd_prefix[cpp_cmd_len],
                 sizeof(cpp_cmd_prefix) - cpp_cmd_len, "%s ", arg + 5);
        cpp_cmd_len += strlen(&cpp_cmd_prefix[cpp_cmd_len]);
      } else {
        snprintf(&cmd_prefix[cmd_len], sizeof(cmd_prefix) - cmd_len, "%s ",
                 arg);
        cmd_len += strlen(&cmd_prefix[cmd_len]);
        snprintf(&cpp_cmd_prefix[cpp_cmd_len],
                 sizeof(cpp_cmd_prefix) - cpp_cmd_len, "%s ", arg);
        cpp_cmd_len += strlen(&cpp_cmd_prefix[cpp_cmd_len]);
      }
    }
  }
  if (cmd_len >= (int)sizeof(cmd_prefix) - 1) {
    fprintf(stderr, "mkdep: command line is too long\n");
    exit(2);
  }
  if (cpp_cmd_len >= (int)sizeof(cpp_cmd_prefix) - 1) {
    fprintf(stderr, "mkdep: command line is too long\n");
    exit(2);
  }
  cmd_prefix[cmd_len] = 0;
  cpp_cmd_prefix[cpp_cmd_len] = 0;
  for (argn = 1; argn != argc; argn++) {
    if (has_prog_suffix(argv[argn])) {
      if (has_suffix(argv[argn], ".cc", ".CC", NULL)) {
        process_file(ofp, cpp_cmd_prefix, argv[argn]);
      } else {
        process_file(ofp, cmd_prefix, argv[argn]);
      }
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x814(%rbp)
movl   $0x0,-0x1024(%rbp)
mov    0x2e24(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x1030(%rbp)
movl   $0x1,-0x1028(%rbp)
mov    -0x1028(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1365 <main+0x1e5>
mov    -0x10(%rbp),%rax
movslq -0x1028(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x1038(%rbp)
mov    -0x1038(%rbp),%rdi
call   1070 <has_prog_suffix@plt>
cmp    $0x0,%rax
jne    134c <main+0x1cc>
mov    -0x1038(%rbp),%rdi
lea    0xdef(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <has_prefix@plt>
cmp    $0x0,%rax
je     128b <main+0x10b>
movslq -0x1024(%rbp),%rax
lea    -0x1020(%rbp),%rdi
add    %rax,%rdi
movslq -0x1024(%rbp),%rcx
mov    $0x800,%eax
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x1038(%rbp),%rcx
add    $0x5,%rcx
lea    0xdae(%rip),%rdx
call   1060 <snprintf@plt>
movslq -0x1024(%rbp),%rax
lea    -0x1020(%rbp),%rdi
add    %rax,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
movslq -0x1024(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x1024(%rbp)
jmp    1347 <main+0x1c7>
movslq -0x814(%rbp),%rax
lea    -0x810(%rbp),%rdi
add    %rax,%rdi
movslq -0x814(%rbp),%rcx
mov    $0x800,%eax
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x1038(%rbp),%rcx
lea    0xd4b(%rip),%rdx
call   1060 <snprintf@plt>
movslq -0x814(%rbp),%rax
lea    -0x810(%rbp),%rdi
add    %rax,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
movslq -0x814(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x814(%rbp)
movslq -0x1024(%rbp),%rax
lea    -0x1020(%rbp),%rdi
add    %rax,%rdi
movslq -0x1024(%rbp),%rcx
mov    $0x800,%eax
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x1038(%rbp),%rcx
lea    0xced(%rip),%rdx
call   1060 <snprintf@plt>
movslq -0x1024(%rbp),%rax
lea    -0x1020(%rbp),%rdi
add    %rax,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
movslq -0x1024(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x1024(%rbp)
jmp    134c <main+0x1cc>
jmp    1351 <main+0x1d1>
mov    -0x1028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1028(%rbp)
jmp    11c8 <main+0x48>
cmpl   $0x7ff,-0x814(%rbp)
jl     1394 <main+0x214>
mov    0x2c64(%rip),%rax
mov    (%rax),%edi
lea    0xc85(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x2,%edi
call   10a0 <exit@plt>
cmpl   $0x7ff,-0x1024(%rbp)
jl     13c3 <main+0x243>
mov    0x2c35(%rip),%rax
mov    (%rax),%edi
lea    0xc56(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x2,%edi
call   10a0 <exit@plt>
movslq -0x814(%rbp),%rax
movb   $0x0,-0x810(%rbp,%rax,1)
movslq -0x1024(%rbp),%rax
movb   $0x0,-0x1020(%rbp,%rax,1)
movl   $0x1,-0x1028(%rbp)
mov    -0x1028(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     14af <main+0x32f>
mov    -0x10(%rbp),%rax
movslq -0x1028(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <has_prog_suffix@plt>
cmp    $0x0,%rax
je     1496 <main+0x316>
mov    -0x10(%rbp),%rax
movslq -0x1028(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbfd(%rip),%rsi
lea    0xbfa(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1080 <has_suffix@plt>
cmp    $0x0,%rax
je     146f <main+0x2ef>
mov    -0x1030(%rbp),%rdi
lea    -0x1020(%rbp),%rsi
mov    -0x10(%rbp),%rax
movslq -0x1028(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
call   1050 <process_file@plt>
jmp    1491 <main+0x311>
mov    -0x1030(%rbp),%rdi
lea    -0x810(%rbp),%rsi
mov    -0x10(%rbp),%rax
movslq -0x1028(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
call   1050 <process_file@plt>
jmp    1496 <main+0x316>
jmp    149b <main+0x31b>
mov    -0x1028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1028(%rbp)
jmp    13eb <main+0x26b>
xor    %eax,%eax
add    $0x1040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1028,%rsp
cmp    $0x1,%edi
je     12ba <main+0x13a>
mov    %rsi,%rbx
mov    0x2e34(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x18(%rsp)
mov    %edi,0x8(%rsp)
mov    %edi,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,(%rsp)
mov    $0x1,%r14d
xor    %ebp,%ebp
jmp    123e <main+0xbe>
mov    %rbx,%r12
movslq (%rsp),%rbx
lea    (%rsp,%rbx,1),%rbp
add    $0x820,%rbp
mov    $0x800,%esi
sub    %ebx,%esi
mov    %rbp,%rdi
lea    0xe1c(%rip),%rdx
mov    %r15,%rcx
call   1060 <snprintf@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
add    %ebx,%eax
mov    %rax,(%rsp)
mov    %r12,%rbx
lea    (%rsp,%r13,1),%r12
add    $0x20,%r12
mov    $0x800,%esi
sub    %r13d,%esi
mov    %r12,%rdi
lea    0xde9(%rip),%rdx
mov    %r15,%rcx
call   1060 <snprintf@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    0xc(%rsp),%ebp
add    %eax,%ebp
add    $0x1,%r14
cmp    %r14,0x10(%rsp)
je     1286 <main+0x106>
mov    (%rbx,%r14,8),%r15
mov    %r15,%rdi
call   1070 <has_prog_suffix@plt>
test   %rax,%rax
jne    1233 <main+0xb3>
mov    %r15,%rdi
lea    0xda7(%rip),%rsi
xor    %edx,%edx
call   1030 <has_prefix@plt>
mov    %ebp,0xc(%rsp)
movslq %ebp,%r13
test   %rax,%rax
je     11c7 <main+0x47>
lea    (%rsp,%r13,1),%r12
add    $0x20,%r12
mov    $0x800,%esi
sub    %r13d,%esi
add    $0x5,%r15
jmp    1213 <main+0x93>
mov    (%rsp),%rax
cmp    $0x7ff,%eax
jge    1334 <main+0x1b4>
cmp    $0x7ff,%ebp
jge    1334 <main+0x1b4>
cltq
movb   $0x0,0x820(%rsp,%rax,1)
movslq %ebp,%rax
movb   $0x0,0x20(%rsp,%rax,1)
cmpl   $0x1,0x8(%rsp)
jne    12ce <main+0x14e>
xor    %eax,%eax
add    $0x1028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ebp
lea    0xd51(%rip),%r15
lea    0xd4e(%rip),%r14
lea    0x820(%rsp),%r12
lea    0x20(%rsp),%r13
jmp    12fb <main+0x17b>
add    $0x1,%rbp
cmp    %rbp,0x10(%rsp)
je     12ba <main+0x13a>
mov    (%rbx,%rbp,8),%rdi
call   1070 <has_prog_suffix@plt>
test   %rax,%rax
je     12f0 <main+0x170>
mov    (%rbx,%rbp,8),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1080 <has_suffix@plt>
test   %rax,%rax
mov    (%rbx,%rbp,8),%rdx
mov    %r13,%rsi
cmove  %r12,%rsi
mov    0x18(%rsp),%rdi
call   1050 <process_file@plt>
jmp    12f0 <main+0x170>
mov    0x2ca5(%rip),%rax
mov    (%rax),%edi
lea    0xcc6(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x2,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@stdout = global i32* null
@.str = [6 x i8] c"-c++=\00"
@.str.1 = [4 x i8] c"%s \00"
@stderr = global i32 0
@.str.2 = [33 x i8] c"mkdep: command line is too long\0A\00"
@.str.3 = [4 x i8] c".cc\00"
@.str.4 = [4 x i8] c".CC\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2048 x i8]
%7 = alloca i32
%8 = alloca [2048 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %9
%13 = load i32*, i32** @stdout
store i32* %13, i32** %11
store i32 1, i32* %10
br label %14
14: ; preds = %87, %2
%15 = load i32, i32* %10
%16 = load i32, i32* %4
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %90
18: ; preds = %14
%19 = load i8**, i8*** %5
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
store i8* %23, i8** %12
%24 = load i8*, i8** %12
%25 = call i64 @has_prog_suffix(i8* %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %86, label %27
27: ; preds = %18
%28 = load i8*, i8** %12
%29 = call i64 @has_prefix(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* null)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %50
31: ; preds = %27
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 %33
%35 = load i32, i32* %9
%36 = sext i32 %35 to i64
%37 = sub i64 2048, %36
%38 = trunc i64 %37 to i32
%39 = load i8*, i8** %12
%40 = getelementptr inbounds i8, i8* %39, i64 5
%41 = call i32 @snprintf(i8* %34, i32 %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %40)
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 %43
%45 = call i64 @strlen(i8* %44)
%46 = load i32, i32* %9
%47 = sext i32 %46 to i64
%48 = add nsw i64 %47, %45
%49 = trunc i64 %48 to i32
store i32 %49, i32* %9
br label %85
50: ; preds = %27
%51 = load i32, i32* %7
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 %52
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = sub i64 2048, %55
%57 = trunc i64 %56 to i32
%58 = load i8*, i8** %12
%59 = call i32 @snprintf(i8* %53, i32 %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %58)
%60 = load i32, i32* %7
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 %61
%63 = call i64 @strlen(i8* %62)
%64 = load i32, i32* %7
%65 = sext i32 %64 to i64
%66 = add nsw i64 %65, %63
%67 = trunc i64 %66 to i32
store i32 %67, i32* %7
%68 = load i32, i32* %9
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 %69
%71 = load i32, i32* %9
%72 = sext i32 %71 to i64
%73 = sub i64 2048, %72
%74 = trunc i64 %73 to i32
%75 = load i8*, i8** %12
%76 = call i32 @snprintf(i8* %70, i32 %74, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %75)
%77 = load i32, i32* %9
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 %78
%80 = call i64 @strlen(i8* %79)
%81 = load i32, i32* %9
%82 = sext i32 %81 to i64
%83 = add nsw i64 %82, %80
%84 = trunc i64 %83 to i32
store i32 %84, i32* %9
br label %85
85: ; preds = %50, %31
br label %86
86: ; preds = %85, %18
br label %87
87: ; preds = %86
%88 = load i32, i32* %10
%89 = add nsw i32 %88, 1
store i32 %89, i32* %10
br label %14
90: ; preds = %14
%91 = load i32, i32* %7
%92 = icmp sge i32 %91, 2047
br i1 %92, label %93, label %97
93: ; preds = %90
%94 = load i32, i32* @stderr
%95 = call i32 @fprintf(i32 %94, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%96 = call i32 @exit(i32 2)
unreachable
97: ; preds = %90
%98 = load i32, i32* %9
%99 = icmp sge i32 %98, 2047
br i1 %99, label %100, label %104
100: ; preds = %97
%101 = load i32, i32* @stderr
%102 = call i32 @fprintf(i32 %101, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%103 = call i32 @exit(i32 2)
unreachable
104: ; preds = %97
%105 = load i32, i32* %7
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 %106
store i8 0, i8* %107
%108 = load i32, i32* %9
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 %109
store i8 0, i8* %110
store i32 1, i32* %10
br label %111
111: ; preds = %151, %104
%112 = load i32, i32* %10
%113 = load i32, i32* %4
%114 = icmp ne i32 %112, %113
br i1 %114, label %115, label %154
115: ; preds = %111
%116 = load i8**, i8*** %5
%117 = load i32, i32* %10
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8*, i8** %116, i64 %118
%120 = load i8*, i8** %119
%121 = call i64 @has_prog_suffix(i8* %120)
%122 = icmp ne i64 %121, 0
br i1 %122, label %123, label %150
123: ; preds = %115
%124 = load i8**, i8*** %5
%125 = load i32, i32* %10
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i8*, i8** %124, i64 %126
%128 = load i8*, i8** %127
%129 = call i64 @has_suffix(i8* %128, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32* null)
%130 = icmp ne i64 %129, 0
br i1 %130, label %131, label %140
131: ; preds = %123
%132 = load i32*, i32** %11
%133 = getelementptr inbounds [2048 x i8], [2048 x i8]* %8, i64 0, i64 0
%134 = load i8**, i8*** %5
%135 = load i32, i32* %10
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i8*, i8** %134, i64 %136
%138 = load i8*, i8** %137
%139 = call i32 @process_file(i32* %132, i8* %133, i8* %138)
br label %149
140: ; preds = %123
%141 = load i32*, i32** %11
%142 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%143 = load i8**, i8*** %5
%144 = load i32, i32* %10
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i8*, i8** %143, i64 %145
%147 = load i8*, i8** %146
%148 = call i32 @process_file(i32* %141, i8* %142, i8* %147)
br label %149
149: ; preds = %140, %131
br label %150
150: ; preds = %149, %115
br label %151
151: ; preds = %150
%152 = load i32, i32* %10
%153 = add nsw i32 %152, 1
store i32 %153, i32* %10
br label %111
154: ; preds = %111
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [6 x i8] c"-c++=\00"
@.str.1 = [4 x i8] c"%s \00"
@stderr = global i32 0
@.str.2 = [33 x i8] c"mkdep: command line is too long\0A\00"
@.str.3 = [4 x i8] c".cc\00"
@.str.4 = [4 x i8] c".CC\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2048 x i8]
%4 = alloca [2048 x i8]
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%7 = load i32*, i32** @stdout
%8 = icmp eq i32 %0, 1
br i1 %8, label %86, label %9
9: ; preds = %2
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %46
%12 = phi i64 [ 1, %9 ], [ %49, %46 ]
%13 = phi i32 [ 0, %9 ], [ %48, %46 ]
%14 = phi i32 [ 0, %9 ], [ %47, %46 ]
%15 = getelementptr inbounds i8*, i8** %1, i64 %12
%16 = load i8*, i8** %15
%17 = call i64 @has_prog_suffix(i8* %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %46
19: ; preds = %11
%20 = call i64 @has_prefix(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* null)
%21 = icmp eq i64 %20, 0
br i1 %21, label %28, label %22
22: ; preds = %19
%23 = sext i32 %14 to i64
%24 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 %23
%25 = sub i32 2048, %14
%26 = getelementptr inbounds i8, i8* %16, i64 5
%27 = call i32 @snprintf(i8* %24, i32 %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %26)
br label %40
28: ; preds = %19
%29 = sext i32 %13 to i64
%30 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 %29
%31 = sub i32 2048, %13
%32 = call i32 @snprintf(i8* %30, i32 %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%33 = call i64 @strlen(i8* %30)
%34 = trunc i64 %33 to i32
%35 = add i32 %13, %34
%36 = sext i32 %14 to i64
%37 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 %36
%38 = sub i32 2048, %14
%39 = call i32 @snprintf(i8* %37, i32 %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %40
40: ; preds = %28, %22
%41 = phi i8* [ %24, %22 ], [ %37, %28 ]
%42 = phi i32 [ %13, %22 ], [ %35, %28 ]
%43 = call i64 @strlen(i8* %41)
%44 = trunc i64 %43 to i32
%45 = add i32 %14, %44
br label %46
46: ; preds = %40, %11
%47 = phi i32 [ %14, %11 ], [ %45, %40 ]
%48 = phi i32 [ %13, %11 ], [ %42, %40 ]
%49 = add nuw nsw i64 %12, 1
%50 = icmp eq i64 %49, %10
br i1 %50, label %51, label %11
51: ; preds = %46
%52 = icmp sgt i32 %48, 2046
br i1 %52, label %53, label %57
53: ; preds = %51
%54 = load i32, i32* @stderr
%55 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%56 = call i32 @exit(i32 2)
unreachable
57: ; preds = %51
%58 = icmp sgt i32 %47, 2046
br i1 %58, label %59, label %63
59: ; preds = %57
%60 = load i32, i32* @stderr
%61 = call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%62 = call i32 @exit(i32 2)
unreachable
63: ; preds = %57
%64 = sext i32 %48 to i64
%65 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 %64
store i8 0, i8* %65
%66 = sext i32 %47 to i64
%67 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 %66
store i8 0, i8* %67
br i1 %8, label %86, label %68
68: ; preds = %63
%69 = zext i32 %0 to i64
br label %70
70: ; preds = %68, %83
%71 = phi i64 [ 1, %68 ], [ %84, %83 ]
%72 = getelementptr inbounds i8*, i8** %1, i64 %71
%73 = load i8*, i8** %72
%74 = call i64 @has_prog_suffix(i8* %73)
%75 = icmp eq i64 %74, 0
br i1 %75, label %83, label %76
76: ; preds = %70
%77 = load i8*, i8** %72
%78 = call i64 @has_suffix(i8* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32* null)
%79 = icmp eq i64 %78, 0
%80 = load i8*, i8** %72
%81 = select i1 %79, i8* %5, i8* %6
%82 = call i32 @process_file(i32* %7, i8* %81, i8* %80)
br label %83
83: ; preds = %76, %70
%84 = add nuw nsw i64 %71, 1
%85 = icmp eq i64 %84, %69
br i1 %85, label %86, label %70
86: ; preds = %83, %2, %63
ret i32 0
}