#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*/ path_buf;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ apply_dot_mod(char *, char *, int);
scalar_t__ apply_e_mod(char *, char *, int);
scalar_t__ apply_h_mod(char *, char *, int);
scalar_t__ apply_p_mod(char *, char const *, char *, int);
scalar_t__ apply_r_mod(char *, char *, int);
scalar_t__ apply_s_gs_mod(char *, char const *, char *, int);
scalar_t__ apply_t_mod(char *, char *, int);
scalar_t__ apply_tilde_mod(char *, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
scalar_t__ starts_withn(char const *, char *, int);
const char *apply_mod(const char *path, const char *parent, const char *mod,
                      int *mod_len, int for_shell) {
  char path_buf[4096];
  static char buf[4096];
  snprintf(path_buf, sizeof(path_buf), "%s", path);
  *mod_len = 2;
  if (starts_withn((mod), (":p"), sizeof(":p") / sizeof((":p")[0]) - 1U))
    *mod_len += apply_p_mod(path_buf, parent, buf, sizeof(buf));
  else if (starts_withn((mod), (":~"), sizeof(":~") / sizeof((":~")[0]) - 1U))
    *mod_len += apply_tilde_mod(path_buf, buf, sizeof(buf));
  else if (starts_withn((mod), (":."), sizeof(":.") / sizeof((":.")[0]) - 1U))
    *mod_len += apply_dot_mod(path_buf, buf, sizeof(buf));
  else if (starts_withn((mod), (":h"), sizeof(":h") / sizeof((":h")[0]) - 1U))
    *mod_len += apply_h_mod(path_buf, buf, sizeof(buf));
  else if (starts_withn((mod), (":t"), sizeof(":t") / sizeof((":t")[0]) - 1U))
    *mod_len += apply_t_mod(path_buf, buf, sizeof(buf));
  else if (starts_withn((mod), (":r"), sizeof(":r") / sizeof((":r")[0]) - 1U))
    *mod_len += apply_r_mod(path_buf, buf, sizeof(buf));
  else if (starts_withn((mod), (":e"), sizeof(":e") / sizeof((":e")[0]) - 1U))
    *mod_len += apply_e_mod(path_buf, buf, sizeof(buf));
  else if (starts_withn((mod), (":s"), sizeof(":s") / sizeof((":s")[0]) - 1U) ||
           starts_withn((mod), (":gs"),
                        sizeof(":gs") / sizeof((":gs")[0]) - 1U))
    *mod_len += apply_s_gs_mod(path_buf, mod, buf, sizeof(buf));
  else
    return NULL;
  return buf;
}


x86 assembly (clang, -O0):
<apply_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1030,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
lea    -0x1030(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1000,%esi
lea    0xe2a(%rip),%rdx
call   1070 <snprintf@plt>
mov    -0x28(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x20(%rbp),%rdi
lea    0xe13(%rip),%rsi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
cmp    $0x0,%rax
je     1234 <apply_mod+0x94>
lea    -0x1030(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0x2e6a(%rip),%rdx
mov    $0x1000,%ecx
call   1080 <apply_p_mod@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
jmp    1494 <apply_mod+0x2f4>
mov    -0x20(%rbp),%rdi
lea    0xdc7(%rip),%rsi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
cmp    $0x0,%rax
je     127f <apply_mod+0xdf>
lea    -0x1030(%rbp),%rdi
lea    0x2e1f(%rip),%rsi
mov    $0x1000,%edx
call   1090 <apply_tilde_mod@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
jmp    148f <apply_mod+0x2ef>
mov    -0x20(%rbp),%rdi
lea    0xd7f(%rip),%rsi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
cmp    $0x0,%rax
je     12ca <apply_mod+0x12a>
lea    -0x1030(%rbp),%rdi
lea    0x2dd4(%rip),%rsi
mov    $0x1000,%edx
call   1030 <apply_dot_mod@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
jmp    148a <apply_mod+0x2ea>
mov    -0x20(%rbp),%rdi
lea    0xd37(%rip),%rsi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
cmp    $0x0,%rax
je     1315 <apply_mod+0x175>
lea    -0x1030(%rbp),%rdi
lea    0x2d89(%rip),%rsi
mov    $0x1000,%edx
call   10a0 <apply_h_mod@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
jmp    1485 <apply_mod+0x2e5>
mov    -0x20(%rbp),%rdi
lea    0xcef(%rip),%rsi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
cmp    $0x0,%rax
je     1360 <apply_mod+0x1c0>
lea    -0x1030(%rbp),%rdi
lea    0x2d3e(%rip),%rsi
mov    $0x1000,%edx
call   1060 <apply_t_mod@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
jmp    1480 <apply_mod+0x2e0>
mov    -0x20(%rbp),%rdi
lea    0xca7(%rip),%rsi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
cmp    $0x0,%rax
je     13ab <apply_mod+0x20b>
lea    -0x1030(%rbp),%rdi
lea    0x2cf3(%rip),%rsi
mov    $0x1000,%edx
call   1050 <apply_r_mod@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
jmp    147b <apply_mod+0x2db>
mov    -0x20(%rbp),%rdi
lea    0xc5f(%rip),%rsi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
cmp    $0x0,%rax
je     13f6 <apply_mod+0x256>
lea    -0x1030(%rbp),%rdi
lea    0x2ca8(%rip),%rsi
mov    $0x1000,%edx
call   10c0 <apply_e_mod@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
jmp    1476 <apply_mod+0x2d6>
mov    -0x20(%rbp),%rdi
lea    0xc17(%rip),%rsi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
cmp    $0x0,%rax
jne    1434 <apply_mod+0x294>
mov    -0x20(%rbp),%rdi
lea    0xbfb(%rip),%rsi
mov    $0x3,%edx
call   10b0 <starts_withn@plt>
cmp    $0x0,%rax
je     1464 <apply_mod+0x2c4>
lea    -0x1030(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    0x2c3a(%rip),%rdx
mov    $0x1000,%ecx
call   1040 <apply_s_gs_mod@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
jmp    1471 <apply_mod+0x2d1>
movq   $0x0,-0x8(%rbp)
jmp    149f <apply_mod+0x2ff>
jmp    1476 <apply_mod+0x2d6>
jmp    147b <apply_mod+0x2db>
jmp    1480 <apply_mod+0x2e0>
jmp    1485 <apply_mod+0x2e5>
jmp    148a <apply_mod+0x2ea>
jmp    148f <apply_mod+0x2ef>
jmp    1494 <apply_mod+0x2f4>
lea    0x2be5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_mod>:
push   %r15
push   %r14
push   %rbx
sub    $0x1000,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xe41(%rip),%rdx
mov    %rsp,%rdi
mov    $0x1000,%esi
call   1070 <snprintf@plt>
movl   $0x2,(%r14)
lea    0xe29(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
test   %rax,%rax
je     1208 <apply_mod+0x68>
lea    0x2e8d(%rip),%rdx
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x1000,%ecx
call   1080 <apply_p_mod@plt>
jmp    1377 <apply_mod+0x1d7>
lea    0xdf7(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
test   %rax,%rax
je     123a <apply_mod+0x9a>
lea    0x2e58(%rip),%rsi
mov    %rsp,%rdi
mov    $0x1000,%edx
call   1090 <apply_tilde_mod@plt>
jmp    1377 <apply_mod+0x1d7>
lea    0xdc8(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
test   %rax,%rax
je     126c <apply_mod+0xcc>
lea    0x2e26(%rip),%rsi
mov    %rsp,%rdi
mov    $0x1000,%edx
call   1030 <apply_dot_mod@plt>
jmp    1377 <apply_mod+0x1d7>
lea    0xd99(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
test   %rax,%rax
je     129e <apply_mod+0xfe>
lea    0x2df4(%rip),%rsi
mov    %rsp,%rdi
mov    $0x1000,%edx
call   10a0 <apply_h_mod@plt>
jmp    1377 <apply_mod+0x1d7>
lea    0xd6a(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
test   %rax,%rax
je     12d0 <apply_mod+0x130>
lea    0x2dc2(%rip),%rsi
mov    %rsp,%rdi
mov    $0x1000,%edx
call   1060 <apply_t_mod@plt>
jmp    1377 <apply_mod+0x1d7>
lea    0xd3b(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
test   %rax,%rax
je     12ff <apply_mod+0x15f>
lea    0x2d90(%rip),%rsi
mov    %rsp,%rdi
mov    $0x1000,%edx
call   1050 <apply_r_mod@plt>
jmp    1377 <apply_mod+0x1d7>
lea    0xd0f(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
test   %rax,%rax
je     132e <apply_mod+0x18e>
lea    0x2d61(%rip),%rsi
mov    %rsp,%rdi
mov    $0x1000,%edx
call   10c0 <apply_e_mod@plt>
jmp    1377 <apply_mod+0x1d7>
lea    0xce3(%rip),%rsi
mov    %r15,%rdi
mov    $0x2,%edx
call   10b0 <starts_withn@plt>
test   %rax,%rax
jne    1360 <apply_mod+0x1c0>
lea    0xccd(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   10b0 <starts_withn@plt>
test   %rax,%rax
je     138e <apply_mod+0x1ee>
lea    0x2d19(%rip),%rdx
mov    %rsp,%rdi
mov    %r15,%rsi
mov    $0x1000,%ecx
call   1040 <apply_s_gs_mod@plt>
add    %eax,(%r14)
lea    0x2cff(%rip),%rax
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %eax,%eax
jmp    1381 <apply_mod+0x1e1>

LLVM IR (-O0):
@apply_mod.buf = internal global [4096 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c":p\00"
@.str.2 = [3 x i8] c":~\00"
@.str.3 = [3 x i8] c":.\00"
@.str.4 = [3 x i8] c":h\00"
@.str.5 = [3 x i8] c":t\00"
@.str.6 = [3 x i8] c":r\00"
@.str.7 = [3 x i8] c":e\00"
@.str.8 = [3 x i8] c":s\00"
@.str.9 = [4 x i8] c":gs\00"
define i8* @apply_mod(i8* %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca [4096 x i8]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32* %3, i32** %10
store i32 %4, i32* %11
%13 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%14 = load i8*, i8** %7
%15 = call i32 @snprintf(i8* %13, i32 4096, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32*, i32** %10
store i32 2, i32* %16
%17 = load i8*, i8** %9
%18 = call i64 @starts_withn(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %29
20: ; preds = %5
%21 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%22 = load i8*, i8** %8
%23 = call i64 @apply_p_mod(i8* %21, i8* %22, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
%24 = load i32*, i32** %10
%25 = load i32, i32* %24
%26 = sext i32 %25 to i64
%27 = add nsw i64 %26, %23
%28 = trunc i64 %27 to i32
store i32 %28, i32* %24
br label %126
29: ; preds = %5
%30 = load i8*, i8** %9
%31 = call i64 @starts_withn(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %41
33: ; preds = %29
%34 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%35 = call i64 @apply_tilde_mod(i8* %34, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
%36 = load i32*, i32** %10
%37 = load i32, i32* %36
%38 = sext i32 %37 to i64
%39 = add nsw i64 %38, %35
%40 = trunc i64 %39 to i32
store i32 %40, i32* %36
br label %125
41: ; preds = %29
%42 = load i8*, i8** %9
%43 = call i64 @starts_withn(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %53
45: ; preds = %41
%46 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%47 = call i64 @apply_dot_mod(i8* %46, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
%48 = load i32*, i32** %10
%49 = load i32, i32* %48
%50 = sext i32 %49 to i64
%51 = add nsw i64 %50, %47
%52 = trunc i64 %51 to i32
store i32 %52, i32* %48
br label %124
53: ; preds = %41
%54 = load i8*, i8** %9
%55 = call i64 @starts_withn(i8* %54, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %65
57: ; preds = %53
%58 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%59 = call i64 @apply_h_mod(i8* %58, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
%60 = load i32*, i32** %10
%61 = load i32, i32* %60
%62 = sext i32 %61 to i64
%63 = add nsw i64 %62, %59
%64 = trunc i64 %63 to i32
store i32 %64, i32* %60
br label %123
65: ; preds = %53
%66 = load i8*, i8** %9
%67 = call i64 @starts_withn(i8* %66, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%68 = icmp ne i64 %67, 0
br i1 %68, label %69, label %77
69: ; preds = %65
%70 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%71 = call i64 @apply_t_mod(i8* %70, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
%72 = load i32*, i32** %10
%73 = load i32, i32* %72
%74 = sext i32 %73 to i64
%75 = add nsw i64 %74, %71
%76 = trunc i64 %75 to i32
store i32 %76, i32* %72
br label %122
77: ; preds = %65
%78 = load i8*, i8** %9
%79 = call i64 @starts_withn(i8* %78, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%80 = icmp ne i64 %79, 0
br i1 %80, label %81, label %89
81: ; preds = %77
%82 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%83 = call i64 @apply_r_mod(i8* %82, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
%84 = load i32*, i32** %10
%85 = load i32, i32* %84
%86 = sext i32 %85 to i64
%87 = add nsw i64 %86, %83
%88 = trunc i64 %87 to i32
store i32 %88, i32* %84
br label %121
89: ; preds = %77
%90 = load i8*, i8** %9
%91 = call i64 @starts_withn(i8* %90, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 2)
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %101
93: ; preds = %89
%94 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%95 = call i64 @apply_e_mod(i8* %94, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
%96 = load i32*, i32** %10
%97 = load i32, i32* %96
%98 = sext i32 %97 to i64
%99 = add nsw i64 %98, %95
%100 = trunc i64 %99 to i32
store i32 %100, i32* %96
br label %120
101: ; preds = %89
%102 = load i8*, i8** %9
%103 = call i64 @starts_withn(i8* %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32 2)
%104 = icmp ne i64 %103, 0
br i1 %104, label %109, label %105
105: ; preds = %101
%106 = load i8*, i8** %9
%107 = call i64 @starts_withn(i8* %106, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %118
109: ; preds = %105, %101
%110 = getelementptr inbounds [4096 x i8], [4096 x i8]* %12, i64 0, i64 0
%111 = load i8*, i8** %9
%112 = call i64 @apply_s_gs_mod(i8* %110, i8* %111, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
%113 = load i32*, i32** %10
%114 = load i32, i32* %113
%115 = sext i32 %114 to i64
%116 = add nsw i64 %115, %112
%117 = trunc i64 %116 to i32
store i32 %117, i32* %113
br label %119
118: ; preds = %105
store i8* null, i8** %6
br label %127
119: ; preds = %109
br label %120
120: ; preds = %119, %93
br label %121
121: ; preds = %120, %81
br label %122
122: ; preds = %121, %69
br label %123
123: ; preds = %122, %57
br label %124
124: ; preds = %123, %45
br label %125
125: ; preds = %124, %33
br label %126
126: ; preds = %125, %20
store i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i8** %6
br label %127
127: ; preds = %126, %118
%128 = load i8*, i8** %6
ret i8* %128
}

LLVM IR (-O2):
@apply_mod.buf = internal global [4096 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c":p\00"
@.str.2 = [3 x i8] c":~\00"
@.str.3 = [3 x i8] c":.\00"
@.str.4 = [3 x i8] c":h\00"
@.str.5 = [3 x i8] c":t\00"
@.str.6 = [3 x i8] c":r\00"
@.str.7 = [3 x i8] c":e\00"
@.str.8 = [3 x i8] c":s\00"
@.str.9 = [4 x i8] c":gs\00"
define i8* @apply_mod(i8* %0, i8* %1, i8* %2, i32* nocapture %3, i32 %4) {
%6 = alloca [4096 x i8]
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%8 = call i32 @snprintf(i8* %7, i32 4096, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
store i32 2, i32* %3
%9 = call i64 @starts_withn(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %5
%12 = call i64 @apply_p_mod(i8* %7, i8* %1, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
br label %51
13: ; preds = %5
%14 = call i64 @starts_withn(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%15 = icmp eq i64 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = call i64 @apply_tilde_mod(i8* %7, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
br label %51
18: ; preds = %13
%19 = call i64 @starts_withn(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%20 = icmp eq i64 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %18
%22 = call i64 @apply_dot_mod(i8* %7, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
br label %51
23: ; preds = %18
%24 = call i64 @starts_withn(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%25 = icmp eq i64 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = call i64 @apply_h_mod(i8* %7, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
br label %51
28: ; preds = %23
%29 = call i64 @starts_withn(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%30 = icmp eq i64 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %28
%32 = call i64 @apply_t_mod(i8* %7, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
br label %51
33: ; preds = %28
%34 = call i64 @starts_withn(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 2)
%35 = icmp eq i64 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = call i64 @apply_r_mod(i8* %7, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
br label %51
38: ; preds = %33
%39 = call i64 @starts_withn(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 2)
%40 = icmp eq i64 %39, 0
br i1 %40, label %43, label %41
41: ; preds = %38
%42 = call i64 @apply_e_mod(i8* %7, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
br label %51
43: ; preds = %38
%44 = call i64 @starts_withn(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32 2)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = call i64 @starts_withn(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%48 = icmp eq i64 %47, 0
br i1 %48, label %56, label %49
49: ; preds = %46, %43
%50 = call i64 @apply_s_gs_mod(i8* %7, i8* %2, i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), i32 4096)
br label %51
51: ; preds = %16, %26, %36, %49, %41, %31, %21, %11
%52 = phi i64 [ %12, %11 ], [ %22, %21 ], [ %32, %31 ], [ %42, %41 ], [ %50, %49 ], [ %37, %36 ], [ %27, %26 ], [ %17, %16 ]
%53 = load i32, i32* %3
%54 = trunc i64 %52 to i32
%55 = add i32 %53, %54
store i32 %55, i32* %3
br label %56
56: ; preds = %51, %46
%57 = phi i8* [ null, %46 ], [ getelementptr inbounds ([4096 x i8], [4096 x i8]* @apply_mod.buf, i64 0, i64 0), %51 ]
ret i8* %57
}