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

/* Variables and functions */
char *after_first(char const *, char);
int /*<<< orphan*/ copy_str(char *, int, char const *);
int /*<<< orphan*/ free(char *);
char *shell_like_escape(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
void format_mount_command(const char mount_point[], const char file_name[],
                          const char param[], const char format[],
                          size_t buf_size, char buf[], int *foreground) {
  char *buf_pos;
  const char *prog_pos;
  char *escaped_path;
  char *escaped_mount_point;
  *foreground = 0;
  escaped_path = shell_like_escape(file_name, 0);
  escaped_mount_point = shell_like_escape(mount_point, 0);
  buf_pos = buf;
  buf_pos[0] = '\0';
  prog_pos = after_first(format, '|');
  while (*prog_pos != '\0') {
    if (*prog_pos == '%') {
      char cmd_buf[96];
      char *cmd_pos;
      cmd_pos = cmd_buf;
      while (*prog_pos != '\0' && *prog_pos != ' ') {
        *cmd_pos = *prog_pos;
        if ((size_t)(cmd_pos - cmd_buf) < sizeof(cmd_buf)) {
          ++cmd_pos;
        }
        ++prog_pos;
      }
      *cmd_pos = '\0';
      if (!strcmp(cmd_buf, "%SOURCE_FILE")) {
        copy_str(buf_pos, buf_size - (buf_pos - buf), escaped_path);
        buf_pos += strlen(buf_pos);
      } else if (!strcmp(cmd_buf, "%PARAM")) {
        copy_str(buf_pos, buf_size - (buf_pos - buf), param);
        buf_pos += strlen(buf_pos);
      } else if (!strcmp(cmd_buf, "%DESTINATION_DIR")) {
        copy_str(buf_pos, buf_size - (buf_pos - buf), escaped_mount_point);
        buf_pos += strlen(buf_pos);
      } else if (!strcmp(cmd_buf, "%FOREGROUND") ||
                 !strcmp(cmd_buf, "%CLEAR")) {
        *foreground = 1;
      }
    } else {
      *buf_pos = *prog_pos;
      if ((size_t)(buf_pos - buf) < buf_size - 1) {
        ++buf_pos;
      }
      ++prog_pos;
    }
  }
  *buf_pos = '\0';
  free(escaped_mount_point);
  free(escaped_path);
}


x86 assembly (clang, -O0):
<format_mount_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1080 <shell_like_escape@plt>
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1080 <shell_like_escape@plt>
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
mov    $0x7c,%esi
call   1070 <after_first@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     143f <format_mount_command+0x2df>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    13fa <format_mount_command+0x29a>
lea    -0xb0(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xb9(%rbp)
je     1229 <format_mount_command+0xc9>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0xb9(%rbp)
mov    -0xb9(%rbp),%al
test   $0x1,%al
jne    123c <format_mount_command+0xdc>
jmp    1289 <format_mount_command+0x129>
mov    -0x40(%rbp),%rax
mov    (%rax),%cl
mov    -0xb8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xb8(%rbp),%rax
lea    -0xb0(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x60,%rax
jae    1278 <format_mount_command+0x118>
mov    -0xb8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xb8(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    11fe <format_mount_command+0x9e>
mov    -0xb8(%rbp),%rax
movb   $0x0,(%rax)
lea    -0xb0(%rbp),%rdi
lea    0xd5f(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    12ee <format_mount_command+0x18e>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rdx
sub    %rdx,%rcx
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x48(%rbp),%rdx
call   1060 <copy_str@plt>
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
jmp    13f5 <format_mount_command+0x295>
lea    -0xb0(%rbp),%rdi
lea    0xd11(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1349 <format_mount_command+0x1e9>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rdx
sub    %rdx,%rcx
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1060 <copy_str@plt>
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
jmp    13f0 <format_mount_command+0x290>
lea    -0xb0(%rbp),%rdi
lea    0xcbd(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    13a4 <format_mount_command+0x244>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rdx
sub    %rdx,%rcx
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x50(%rbp),%rdx
call   1060 <copy_str@plt>
mov    -0x38(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
jmp    13eb <format_mount_command+0x28b>
lea    -0xb0(%rbp),%rdi
lea    0xc73(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     13dc <format_mount_command+0x27c>
lea    -0xb0(%rbp),%rdi
lea    0xc63(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    13e6 <format_mount_command+0x286>
mov    0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    13eb <format_mount_command+0x28b>
jmp    13f0 <format_mount_command+0x290>
jmp    13f5 <format_mount_command+0x295>
jmp    143a <format_mount_command+0x2da>
mov    -0x40(%rbp),%rax
mov    (%rax),%cl
mov    -0x38(%rbp),%rax
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
mov    -0x30(%rbp),%rcx
sub    %rcx,%rax
mov    -0x28(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jae    142e <format_mount_command+0x2ce>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    11d0 <format_mount_command+0x70>
mov    -0x38(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_mount_command>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9,%r13
mov    %r8,%rbx
mov    %rcx,%r14
mov    %rdx,0x18(%rsp)
mov    %rdi,%rbp
mov    0xc0(%rsp),%rax
movl   $0x0,(%rax)
mov    %rsi,%rdi
xor    %esi,%esi
call   1070 <shell_like_escape@plt>
mov    %rax,0x10(%rsp)
mov    %rbp,%rdi
xor    %esi,%esi
call   1070 <shell_like_escape@plt>
mov    %rax,0x8(%rsp)
movb   $0x0,0x0(%r13)
mov    %r14,%rdi
mov    $0x7c,%esi
call   1060 <after_first@plt>
mov    %rax,%rbp
lea    (%rbx,%r13,1),%r15
add    $0xffffffffffffffff,%rbx
lea    0x20(%rsp),%r12
mov    %r13,%r14
jmp    11e5 <format_mount_command+0x95>
mov    %r15d,%esi
sub    %r14d,%esi
mov    %r14,%rdi
mov    0x10(%rsp),%rdx
call   1050 <copy_str@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
add    %rax,%r14
mov    0x0(%rbp),%al
cmp    $0x25,%al
je     1210 <format_mount_command+0xc0>
test   %al,%al
je     1335 <format_mount_command+0x1e5>
mov    %al,(%r14)
mov    %r14,%rax
sub    %r13,%rax
cmp    %rbx,%rax
adc    $0x0,%r14
add    $0x1,%rbp
jmp    11e5 <format_mount_command+0x95>
nopw   0x0(%rax,%rax,1)
mov    $0x25,%cl
mov    %r12,%rax
test   $0xdf,%cl
je     123d <format_mount_command+0xed>
nopw   0x0(%rax,%rax,1)
mov    %cl,(%rax)
mov    %rax,%rcx
sub    %r12,%rcx
cmp    $0x60,%rcx
adc    $0x0,%rax
movzbl 0x1(%rbp),%ecx
add    $0x1,%rbp
test   $0xdf,%cl
jne    1220 <format_mount_command+0xd0>
movb   $0x0,(%rax)
mov    0x20(%rsp),%rax
movabs $0x5f454352554f5325,%rcx
43 45 5f
xor    %rcx,%rax
mov    0x25(%rsp),%rcx
movabs $0x454c49465f4543,%rdx
xor    %rdx,%rcx
or     %rax,%rcx
je     11c5 <format_mount_command+0x75>
mov    0x20(%rsp),%eax
mov    $0x52415025,%ecx
xor    %ecx,%eax
mov    0x23(%rsp),%ecx
mov    $0x4d4152,%edx
xor    %edx,%ecx
or     %eax,%ecx
je     130f <format_mount_command+0x1bf>
mov    0x28(%rsp),%rax
movabs $0x5249445f4e4f4954,%rcx
44 49 52
xor    %rcx,%rax
mov    0x20(%rsp),%rcx
movabs $0x414e495453454425,%rdx
49 4e 41
xor    %rdx,%rcx
movzbl 0x30(%rsp),%edx
or     %rcx,%rdx
or     %rax,%rdx
je     1322 <format_mount_command+0x1d2>
mov    0x20(%rsp),%rax
movabs $0x4f524745524f4625,%rcx
47 52 4f
xor    %rcx,%rax
mov    0x28(%rsp),%ecx
xor    $0x444e55,%rcx
or     %rax,%rcx
je     12fc <format_mount_command+0x1ac>
mov    0x20(%rsp),%eax
mov    $0x454c4325,%ecx
xor    %ecx,%eax
mov    0x23(%rsp),%ecx
mov    $0x524145,%edx
xor    %edx,%ecx
or     %eax,%ecx
jne    11e5 <format_mount_command+0x95>
mov    0xc0(%rsp),%rax
movl   $0x1,(%rax)
jmp    11e5 <format_mount_command+0x95>
mov    %r15d,%esi
sub    %r14d,%esi
mov    %r14,%rdi
mov    0x18(%rsp),%rdx
jmp    11d3 <format_mount_command+0x83>
mov    %r15d,%esi
sub    %r14d,%esi
mov    %r14,%rdi
mov    0x8(%rsp),%rdx
jmp    11d3 <format_mount_command+0x83>
movb   $0x0,(%r14)
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%SOURCE_FILE\00"
@.str.1 = [7 x i8] c"%PARAM\00"
@.str.2 = [17 x i8] c"%DESTINATION_DIR\00"
@.str.3 = [12 x i8] c"%FOREGROUND\00"
@.str.4 = [7 x i8] c"%CLEAR\00"
define void @format_mount_command(i8* %0, i8* %1, i8* %2, i8* %3, i64 %4, i8* %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca [96 x i8]
%20 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i64 %4, i64* %12
store i8* %5, i8** %13
store i32* %6, i32** %14
%21 = load i32*, i32** %14
store i32 0, i32* %21
%22 = load i8*, i8** %9
%23 = call i8* @shell_like_escape(i8* %22, i32 0)
store i8* %23, i8** %17
%24 = load i8*, i8** %8
%25 = call i8* @shell_like_escape(i8* %24, i32 0)
store i8* %25, i8** %18
%26 = load i8*, i8** %13
store i8* %26, i8** %15
%27 = load i8*, i8** %15
%28 = getelementptr inbounds i8, i8* %27, i64 0
store i8 0, i8* %28
%29 = load i8*, i8** %11
%30 = call i8* @after_first(i8* %29, i8 signext 124)
store i8* %30, i8** %16
br label %31
31: ; preds = %167, %7
%32 = load i8*, i8** %16
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %168
36: ; preds = %31
%37 = load i8*, i8** %16
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 37
br i1 %40, label %41, label %149
41: ; preds = %36
%42 = getelementptr inbounds [96 x i8], [96 x i8]* %19, i64 0, i64 0
store i8* %42, i8** %20
br label %43
43: ; preds = %68, %41
%44 = load i8*, i8** %16
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %43
%49 = load i8*, i8** %16
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %51, 32
br label %53
53: ; preds = %48, %43
%54 = phi i1 [ false, %43 ], [ %52, %48 ]
br i1 %54, label %55, label %71
55: ; preds = %53
%56 = load i8*, i8** %16
%57 = load i8, i8* %56
%58 = load i8*, i8** %20
store i8 %57, i8* %58
%59 = load i8*, i8** %20
%60 = getelementptr inbounds [96 x i8], [96 x i8]* %19, i64 0, i64 0
%61 = ptrtoint i8* %59 to i64
%62 = ptrtoint i8* %60 to i64
%63 = sub i64 %61, %62
%64 = icmp ult i64 %63, 96
br i1 %64, label %65, label %68
65: ; preds = %55
%66 = load i8*, i8** %20
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %20
br label %68
68: ; preds = %65, %55
%69 = load i8*, i8** %16
%70 = getelementptr inbounds i8, i8* %69, i32 1
store i8* %70, i8** %16
br label %43
71: ; preds = %53
%72 = load i8*, i8** %20
store i8 0, i8* %72
%73 = getelementptr inbounds [96 x i8], [96 x i8]* %19, i64 0, i64 0
%74 = call i32 @strcmp(i8* %73, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%75 = icmp ne i32 %74, 0
br i1 %75, label %93, label %76
76: ; preds = %71
%77 = load i8*, i8** %15
%78 = load i64, i64* %12
%79 = load i8*, i8** %15
%80 = load i8*, i8** %13
%81 = ptrtoint i8* %79 to i64
%82 = ptrtoint i8* %80 to i64
%83 = sub i64 %81, %82
%84 = sub i64 %78, %83
%85 = trunc i64 %84 to i32
%86 = load i8*, i8** %17
%87 = call i32 @copy_str(i8* %77, i32 %85, i8* %86)
%88 = load i8*, i8** %15
%89 = call i32 @strlen(i8* %88)
%90 = load i8*, i8** %15
%91 = sext i32 %89 to i64
%92 = getelementptr inbounds i8, i8* %90, i64 %91
store i8* %92, i8** %15
br label %148
93: ; preds = %71
%94 = getelementptr inbounds [96 x i8], [96 x i8]* %19, i64 0, i64 0
%95 = call i32 @strcmp(i8* %94, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%96 = icmp ne i32 %95, 0
br i1 %96, label %114, label %97
97: ; preds = %93
%98 = load i8*, i8** %15
%99 = load i64, i64* %12
%100 = load i8*, i8** %15
%101 = load i8*, i8** %13
%102 = ptrtoint i8* %100 to i64
%103 = ptrtoint i8* %101 to i64
%104 = sub i64 %102, %103
%105 = sub i64 %99, %104
%106 = trunc i64 %105 to i32
%107 = load i8*, i8** %10
%108 = call i32 @copy_str(i8* %98, i32 %106, i8* %107)
%109 = load i8*, i8** %15
%110 = call i32 @strlen(i8* %109)
%111 = load i8*, i8** %15
%112 = sext i32 %110 to i64
%113 = getelementptr inbounds i8, i8* %111, i64 %112
store i8* %113, i8** %15
br label %147
114: ; preds = %93
%115 = getelementptr inbounds [96 x i8], [96 x i8]* %19, i64 0, i64 0
%116 = call i32 @strcmp(i8* %115, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%117 = icmp ne i32 %116, 0
br i1 %117, label %135, label %118
118: ; preds = %114
%119 = load i8*, i8** %15
%120 = load i64, i64* %12
%121 = load i8*, i8** %15
%122 = load i8*, i8** %13
%123 = ptrtoint i8* %121 to i64
%124 = ptrtoint i8* %122 to i64
%125 = sub i64 %123, %124
%126 = sub i64 %120, %125
%127 = trunc i64 %126 to i32
%128 = load i8*, i8** %18
%129 = call i32 @copy_str(i8* %119, i32 %127, i8* %128)
%130 = load i8*, i8** %15
%131 = call i32 @strlen(i8* %130)
%132 = load i8*, i8** %15
%133 = sext i32 %131 to i64
%134 = getelementptr inbounds i8, i8* %132, i64 %133
store i8* %134, i8** %15
br label %146
135: ; preds = %114
%136 = getelementptr inbounds [96 x i8], [96 x i8]* %19, i64 0, i64 0
%137 = call i32 @strcmp(i8* %136, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%138 = icmp ne i32 %137, 0
br i1 %138, label %139, label %143
139: ; preds = %135
%140 = getelementptr inbounds [96 x i8], [96 x i8]* %19, i64 0, i64 0
%141 = call i32 @strcmp(i8* %140, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%142 = icmp ne i32 %141, 0
br i1 %142, label %145, label %143
143: ; preds = %139, %135
%144 = load i32*, i32** %14
store i32 1, i32* %144
br label %145
145: ; preds = %143, %139
br label %146
146: ; preds = %145, %118
br label %147
147: ; preds = %146, %97
br label %148
148: ; preds = %147, %76
br label %167
149: ; preds = %36
%150 = load i8*, i8** %16
%151 = load i8, i8* %150
%152 = load i8*, i8** %15
store i8 %151, i8* %152
%153 = load i8*, i8** %15
%154 = load i8*, i8** %13
%155 = ptrtoint i8* %153 to i64
%156 = ptrtoint i8* %154 to i64
%157 = sub i64 %155, %156
%158 = load i64, i64* %12
%159 = sub i64 %158, 1
%160 = icmp ult i64 %157, %159
br i1 %160, label %161, label %164
161: ; preds = %149
%162 = load i8*, i8** %15
%163 = getelementptr inbounds i8, i8* %162, i32 1
store i8* %163, i8** %15
br label %164
164: ; preds = %161, %149
%165 = load i8*, i8** %16
%166 = getelementptr inbounds i8, i8* %165, i32 1
store i8* %166, i8** %16
br label %167
167: ; preds = %164, %148
br label %31
168: ; preds = %31
%169 = load i8*, i8** %15
store i8 0, i8* %169
%170 = load i8*, i8** %18
%171 = call i32 @free(i8* %170)
%172 = load i8*, i8** %17
%173 = call i32 @free(i8* %172)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%SOURCE_FILE\00"
@.str.1 = [7 x i8] c"%PARAM\00"
@.str.2 = [17 x i8] c"%DESTINATION_DIR\00"
@.str.3 = [12 x i8] c"%FOREGROUND\00"
@.str.4 = [7 x i8] c"%CLEAR\00"
define void @format_mount_command(i8* %0, i8* %1, i8* %2, i8* %3, i64 %4, i8* %5, i32* nocapture writeonly %6) {
%8 = alloca [96 x i8]
store i32 0, i32* %6
%9 = tail call i8* @shell_like_escape(i8* %1, i32 0)
%10 = tail call i8* @shell_like_escape(i8* %0, i32 0)
store i8 0, i8* %5
%11 = tail call i8* @after_first(i8* %3, i8 signext 124)
%12 = getelementptr inbounds [96 x i8], [96 x i8]* %8, i64 0, i64 0
%13 = ptrtoint [96 x i8]* %8 to i64
%14 = ptrtoint i8* %5 to i64
%15 = add i64 %14, %4
%16 = add i64 %4, -1
br label %17
17: ; preds = %83, %7
%18 = phi i8* [ %11, %7 ], [ %84, %83 ]
%19 = phi i8* [ %5, %7 ], [ %85, %83 ]
%20 = load i8, i8* %18
switch i8 %20, label %76 [
i8 0, label %86
i8 37, label %21
]
21: ; preds = %17
br label %22
22: ; preds = %26, %21
%23 = phi i8 [ 37, %21 ], [ %33, %26 ]
%24 = phi i8* [ %18, %21 ], [ %32, %26 ]
%25 = phi i8* [ %12, %21 ], [ %31, %26 ]
switch i8 %23, label %26 [
i8 0, label %34
i8 32, label %34
]
26: ; preds = %22
store i8 %23, i8* %25
%27 = ptrtoint i8* %25 to i64
%28 = sub i64 %27, %13
%29 = icmp ult i64 %28, 96
%30 = zext i1 %29 to i64
%31 = getelementptr i8, i8* %25, i64 %30
%32 = getelementptr inbounds i8, i8* %24, i64 1
%33 = load i8, i8* %32
br label %22
34: ; preds = %22, %22
store i8 0, i8* %25
%35 = call i32 @bcmp(i8* dereferenceable(13) %12, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 13)
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %45
37: ; preds = %34
%38 = ptrtoint i8* %19 to i64
%39 = sub i64 %15, %38
%40 = trunc i64 %39 to i32
%41 = call i32 @copy_str(i8* %19, i32 %40, i8* %9)
%42 = call i32 @strlen(i8* %19)
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %19, i64 %43
br label %74
45: ; preds = %34
%46 = call i32 @bcmp(i8* dereferenceable(7) %12, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 7)
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %56
48: ; preds = %45
%49 = ptrtoint i8* %19 to i64
%50 = sub i64 %15, %49
%51 = trunc i64 %50 to i32
%52 = call i32 @copy_str(i8* %19, i32 %51, i8* %2)
%53 = call i32 @strlen(i8* %19)
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %19, i64 %54
br label %74
56: ; preds = %45
%57 = call i32 @bcmp(i8* dereferenceable(17) %12, i8* dereferenceable(17) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i64 17)
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %67
59: ; preds = %56
%60 = ptrtoint i8* %19 to i64
%61 = sub i64 %15, %60
%62 = trunc i64 %61 to i32
%63 = call i32 @copy_str(i8* %19, i32 %62, i8* %10)
%64 = call i32 @strlen(i8* %19)
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %19, i64 %65
br label %74
67: ; preds = %56
%68 = call i32 @bcmp(i8* dereferenceable(12) %12, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i64 12)
%69 = icmp eq i32 %68, 0
br i1 %69, label %73, label %70
70: ; preds = %67
%71 = call i32 @bcmp(i8* dereferenceable(7) %12, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i64 7)
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %70, %67
store i32 1, i32* %6
br label %74
74: ; preds = %48, %70, %73, %59, %37
%75 = phi i8* [ %19, %70 ], [ %19, %73 ], [ %66, %59 ], [ %55, %48 ], [ %44, %37 ]
br label %83
76: ; preds = %17
store i8 %20, i8* %19
%77 = ptrtoint i8* %19 to i64
%78 = sub i64 %77, %14
%79 = icmp ult i64 %78, %16
%80 = zext i1 %79 to i64
%81 = getelementptr i8, i8* %19, i64 %80
%82 = getelementptr inbounds i8, i8* %18, i64 1
br label %83
83: ; preds = %76, %74
%84 = phi i8* [ %24, %74 ], [ %82, %76 ]
%85 = phi i8* [ %75, %74 ], [ %81, %76 ]
br label %17
86: ; preds = %17
store i8 0, i8* %19
%87 = call i32 @free(i8* %10)
%88 = call i32 @free(i8* %9)
ret void
}