; LLVM IR from aagdev/mlimgsynth :: src (tensor_name_conv)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.StrSlice = type { ptr, i64 }

@g_allocator_dopt = external global ptr, align 8
@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @tnconv_prefix_match_replace(ptr noundef, ptr noundef, ptr, i64, ptr, i64) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @dynbuf_append(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @tnconv_number_match_push(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @tnconv_clip_1(ptr %0, i64 %1, ptr noundef %2) #1 {
  %4 = alloca %struct.StrSlice, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.StrSlice, align 8
  %8 = alloca %struct.StrSlice, align 8
  %9 = alloca %struct.StrSlice, align 8
  %10 = alloca %struct.StrSlice, align 8
  %11 = alloca %struct.StrSlice, align 8
  %12 = alloca %struct.StrSlice, align 8
  %13 = alloca %struct.StrSlice, align 8
  %14 = alloca %struct.StrSlice, align 8
  %15 = alloca %struct.StrSlice, align 8
  %16 = alloca %struct.StrSlice, align 8
  %17 = alloca %struct.StrSlice, align 8
  %18 = alloca %struct.StrSlice, align 8
  %19 = alloca %struct.StrSlice, align 8
  %20 = alloca %struct.StrSlice, align 8
  %21 = alloca %struct.StrSlice, align 8
  %22 = alloca %struct.StrSlice, align 8
  %23 = alloca %struct.StrSlice, align 8
  %24 = alloca %struct.StrSlice, align 8
  %25 = alloca %struct.StrSlice, align 8
  %26 = alloca %struct.StrSlice, align 8
  %27 = alloca %struct.StrSlice, align 8
  %28 = alloca %struct.StrSlice, align 8
  %29 = getelementptr inbounds { ptr, i64 }, ptr %4, i32 0, i32 0
  store ptr %0, ptr %29, align 8
  %30 = getelementptr inbounds { ptr, i64 }, ptr %4, i32 0, i32 1
  store i64 %1, ptr %30, align 8
  store ptr %2, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !9
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.StrSlice, ptr %7, i32 0, i32 0
  store ptr @.str, ptr %32, align 8, !tbaa !11
  %33 = getelementptr inbounds %struct.StrSlice, ptr %7, i32 0, i32 1
  store i64 23, ptr %33, align 8, !tbaa !14
  %34 = getelementptr inbounds %struct.StrSlice, ptr %8, i32 0, i32 0
  store ptr @.str.1, ptr %34, align 8, !tbaa !11
  %35 = getelementptr inbounds %struct.StrSlice, ptr %8, i32 0, i32 1
  store i64 5, ptr %35, align 8, !tbaa !14
  %36 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8
  %38 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  %39 = load i64, ptr %38, align 8
  %40 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8
  %42 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 1
  %43 = load i64, ptr %42, align 8
  %44 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %31, ptr %37, i64 %39, ptr %41, i64 %43)
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %226

46:                                               ; preds = %3
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.StrSlice, ptr %9, i32 0, i32 0
  store ptr @.str.2, ptr %48, align 8, !tbaa !11
  %49 = getelementptr inbounds %struct.StrSlice, ptr %9, i32 0, i32 1
  store i64 11, ptr %49, align 8, !tbaa !14
  %50 = getelementptr inbounds %struct.StrSlice, ptr %10, i32 0, i32 0
  store ptr @.str.3, ptr %50, align 8, !tbaa !11
  %51 = getelementptr inbounds %struct.StrSlice, ptr %10, i32 0, i32 1
  store i64 6, ptr %51, align 8, !tbaa !14
  %52 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8
  %54 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %55 = load i64, ptr %54, align 8
  %56 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8
  %58 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 1
  %59 = load i64, ptr %58, align 8
  %60 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %47, ptr %53, i64 %55, ptr %57, i64 %59)
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %98

62:                                               ; preds = %46
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.StrSlice, ptr %11, i32 0, i32 0
  store ptr @.str.4, ptr %64, align 8, !tbaa !11
  %65 = getelementptr inbounds %struct.StrSlice, ptr %11, i32 0, i32 1
  store i64 19, ptr %65, align 8, !tbaa !14
  %66 = getelementptr inbounds %struct.StrSlice, ptr %12, i32 0, i32 0
  store ptr @.str.5, ptr %66, align 8, !tbaa !11
  %67 = getelementptr inbounds %struct.StrSlice, ptr %12, i32 0, i32 1
  store i64 9, ptr %67, align 8, !tbaa !14
  %68 = getelementptr inbounds { ptr, i64 }, ptr %11, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8
  %70 = getelementptr inbounds { ptr, i64 }, ptr %11, i32 0, i32 1
  %71 = load i64, ptr %70, align 8
  %72 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8
  %74 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 1
  %75 = load i64, ptr %74, align 8
  %76 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %63, ptr %69, i64 %71, ptr %73, i64 %75)
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %62
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %97

79:                                               ; preds = %62
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.StrSlice, ptr %13, i32 0, i32 0
  store ptr @.str.6, ptr %81, align 8, !tbaa !11
  %82 = getelementptr inbounds %struct.StrSlice, ptr %13, i32 0, i32 1
  store i64 16, ptr %82, align 8, !tbaa !14
  %83 = getelementptr inbounds %struct.StrSlice, ptr %14, i32 0, i32 0
  store ptr @.str.7, ptr %83, align 8, !tbaa !11
  %84 = getelementptr inbounds %struct.StrSlice, ptr %14, i32 0, i32 1
  store i64 6, ptr %84, align 8, !tbaa !14
  %85 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8
  %87 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %88 = load i64, ptr %87, align 8
  %89 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8
  %91 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 1
  %92 = load i64, ptr %91, align 8
  %93 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %80, ptr %86, i64 %88, ptr %90, i64 %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %79
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %95, %79
  br label %97

97:                                               ; preds = %96, %78
  br label %225

98:                                               ; preds = %46
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.StrSlice, ptr %15, i32 0, i32 0
  store ptr @.str.8, ptr %100, align 8, !tbaa !11
  %101 = getelementptr inbounds %struct.StrSlice, ptr %15, i32 0, i32 1
  store i64 15, ptr %101, align 8, !tbaa !14
  %102 = getelementptr inbounds %struct.StrSlice, ptr %16, i32 0, i32 0
  store ptr @.str.8, ptr %102, align 8, !tbaa !11
  %103 = getelementptr inbounds %struct.StrSlice, ptr %16, i32 0, i32 1
  store i64 15, ptr %103, align 8, !tbaa !14
  %104 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8
  %106 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 1
  %107 = load i64, ptr %106, align 8
  %108 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8
  %110 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 1
  %111 = load i64, ptr %110, align 8
  %112 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %99, ptr %105, i64 %107, ptr %109, i64 %111)
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %188

114:                                              ; preds = %98
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = call i32 @tnconv_number_match_push(ptr noundef %4, ptr noundef %115)
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.StrSlice, ptr %17, i32 0, i32 0
  store ptr @.str.9, ptr %118, align 8, !tbaa !11
  %119 = getelementptr inbounds %struct.StrSlice, ptr %17, i32 0, i32 1
  store i64 12, ptr %119, align 8, !tbaa !14
  %120 = getelementptr inbounds %struct.StrSlice, ptr %18, i32 0, i32 0
  store ptr @.str.10, ptr %120, align 8, !tbaa !11
  %121 = getelementptr inbounds %struct.StrSlice, ptr %18, i32 0, i32 1
  store i64 6, ptr %121, align 8, !tbaa !14
  %122 = getelementptr inbounds { ptr, i64 }, ptr %17, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8
  %124 = getelementptr inbounds { ptr, i64 }, ptr %17, i32 0, i32 1
  %125 = load i64, ptr %124, align 8
  %126 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8
  %128 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 1
  %129 = load i64, ptr %128, align 8
  %130 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %117, ptr %123, i64 %125, ptr %127, i64 %129)
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %133

132:                                              ; preds = %114
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %187

133:                                              ; preds = %114
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.StrSlice, ptr %19, i32 0, i32 0
  store ptr @.str.11, ptr %135, align 8, !tbaa !11
  %136 = getelementptr inbounds %struct.StrSlice, ptr %19, i32 0, i32 1
  store i64 12, ptr %136, align 8, !tbaa !14
  %137 = getelementptr inbounds %struct.StrSlice, ptr %20, i32 0, i32 0
  store ptr @.str.12, ptr %137, align 8, !tbaa !11
  %138 = getelementptr inbounds %struct.StrSlice, ptr %20, i32 0, i32 1
  store i64 6, ptr %138, align 8, !tbaa !14
  %139 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8
  %141 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 1
  %142 = load i64, ptr %141, align 8
  %143 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8
  %145 = getelementptr inbounds { ptr, i64 }, ptr %20, i32 0, i32 1
  %146 = load i64, ptr %145, align 8
  %147 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %134, ptr %140, i64 %142, ptr %144, i64 %146)
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %133
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %186

150:                                              ; preds = %133
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.StrSlice, ptr %21, i32 0, i32 0
  store ptr @.str.13, ptr %152, align 8, !tbaa !11
  %153 = getelementptr inbounds %struct.StrSlice, ptr %21, i32 0, i32 1
  store i64 10, ptr %153, align 8, !tbaa !14
  %154 = getelementptr inbounds %struct.StrSlice, ptr %22, i32 0, i32 0
  store ptr @.str.14, ptr %154, align 8, !tbaa !11
  %155 = getelementptr inbounds %struct.StrSlice, ptr %22, i32 0, i32 1
  store i64 5, ptr %155, align 8, !tbaa !14
  %156 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 0
  %157 = load ptr, ptr %156, align 8
  %158 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 1
  %159 = load i64, ptr %158, align 8
  %160 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 0
  %161 = load ptr, ptr %160, align 8
  %162 = getelementptr inbounds { ptr, i64 }, ptr %22, i32 0, i32 1
  %163 = load i64, ptr %162, align 8
  %164 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %151, ptr %157, i64 %159, ptr %161, i64 %163)
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %167

166:                                              ; preds = %150
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %185

167:                                              ; preds = %150
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.StrSlice, ptr %23, i32 0, i32 0
  store ptr @.str.15, ptr %169, align 8, !tbaa !11
  %170 = getelementptr inbounds %struct.StrSlice, ptr %23, i32 0, i32 1
  store i64 4, ptr %170, align 8, !tbaa !14
  %171 = getelementptr inbounds %struct.StrSlice, ptr %24, i32 0, i32 0
  store ptr @.str.15, ptr %171, align 8, !tbaa !11
  %172 = getelementptr inbounds %struct.StrSlice, ptr %24, i32 0, i32 1
  store i64 4, ptr %172, align 8, !tbaa !14
  %173 = getelementptr inbounds { ptr, i64 }, ptr %23, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8
  %175 = getelementptr inbounds { ptr, i64 }, ptr %23, i32 0, i32 1
  %176 = load i64, ptr %175, align 8
  %177 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8
  %179 = getelementptr inbounds { ptr, i64 }, ptr %24, i32 0, i32 1
  %180 = load i64, ptr %179, align 8
  %181 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %168, ptr %174, i64 %176, ptr %178, i64 %180)
  %182 = icmp ne i32 %181, 0
  br i1 %182, label %183, label %184

183:                                              ; preds = %167
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %184

184:                                              ; preds = %183, %167
  br label %185

185:                                              ; preds = %184, %166
  br label %186

186:                                              ; preds = %185, %149
  br label %187

187:                                              ; preds = %186, %132
  br label %224

188:                                              ; preds = %98
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.StrSlice, ptr %25, i32 0, i32 0
  store ptr @.str.16, ptr %190, align 8, !tbaa !11
  %191 = getelementptr inbounds %struct.StrSlice, ptr %25, i32 0, i32 1
  store i64 17, ptr %191, align 8, !tbaa !14
  %192 = getelementptr inbounds %struct.StrSlice, ptr %26, i32 0, i32 0
  store ptr @.str.17, ptr %192, align 8, !tbaa !11
  %193 = getelementptr inbounds %struct.StrSlice, ptr %26, i32 0, i32 1
  store i64 9, ptr %193, align 8, !tbaa !14
  %194 = getelementptr inbounds { ptr, i64 }, ptr %25, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8
  %196 = getelementptr inbounds { ptr, i64 }, ptr %25, i32 0, i32 1
  %197 = load i64, ptr %196, align 8
  %198 = getelementptr inbounds { ptr, i64 }, ptr %26, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8
  %200 = getelementptr inbounds { ptr, i64 }, ptr %26, i32 0, i32 1
  %201 = load i64, ptr %200, align 8
  %202 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %189, ptr %195, i64 %197, ptr %199, i64 %201)
  %203 = icmp ne i32 %202, 0
  br i1 %203, label %204, label %205

204:                                              ; preds = %188
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %223

205:                                              ; preds = %188
  %206 = load ptr, ptr %5, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.StrSlice, ptr %27, i32 0, i32 0
  store ptr @.str.18, ptr %207, align 8, !tbaa !11
  %208 = getelementptr inbounds %struct.StrSlice, ptr %27, i32 0, i32 1
  store i64 15, ptr %208, align 8, !tbaa !14
  %209 = getelementptr inbounds %struct.StrSlice, ptr %28, i32 0, i32 0
  store ptr @.str.19, ptr %209, align 8, !tbaa !11
  %210 = getelementptr inbounds %struct.StrSlice, ptr %28, i32 0, i32 1
  store i64 9, ptr %210, align 8, !tbaa !14
  %211 = getelementptr inbounds { ptr, i64 }, ptr %27, i32 0, i32 0
  %212 = load ptr, ptr %211, align 8
  %213 = getelementptr inbounds { ptr, i64 }, ptr %27, i32 0, i32 1
  %214 = load i64, ptr %213, align 8
  %215 = getelementptr inbounds { ptr, i64 }, ptr %28, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8
  %217 = getelementptr inbounds { ptr, i64 }, ptr %28, i32 0, i32 1
  %218 = load i64, ptr %217, align 8
  %219 = call i32 @tnconv_prefix_match_replace(ptr noundef %4, ptr noundef %206, ptr %212, i64 %214, ptr %216, i64 %218)
  %220 = icmp ne i32 %219, 0
  br i1 %220, label %221, label %222

221:                                              ; preds = %205
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %222

222:                                              ; preds = %221, %205
  br label %223

223:                                              ; preds = %222, %204
  br label %224

224:                                              ; preds = %223, %187
  br label %225

225:                                              ; preds = %224, %97
  br label %226

226:                                              ; preds = %225, %3
  %227 = load i32, ptr %6, align 4, !tbaa !9
  %228 = icmp sgt i32 %227, 0
  br i1 %228, label %229, label %238

229:                                              ; preds = %226
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.StrSlice, ptr %4, i32 0, i32 1
  %232 = load i64, ptr %231, align 8, !tbaa !14
  %233 = trunc i64 %232 to i32
  %234 = getelementptr inbounds %struct.StrSlice, ptr %4, i32 0, i32 0
  %235 = load ptr, ptr %234, align 8, !tbaa !11
  %236 = load ptr, ptr @g_allocator_dopt, align 8, !tbaa !5
  %237 = call ptr @dynbuf_append(ptr noundef %230, i32 noundef %233, ptr noundef %235, i64 noundef 1, i32 noundef 1, ptr noundef %236)
  br label %238

238:                                              ; preds = %229, %226
  %239 = load i32, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  ret i32 %239
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"StrSlice", !6, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.StrSlice = type { ptr, i64 }

@g_allocator_dopt = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tnconv_prefix_match_replace(ptr noundef, ptr noundef, ptr, i64, ptr, i64) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @dynbuf_append(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tnconv_number_match_push(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @tnconv_clip_1(ptr %0, i64 %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.StrSlice, align 8
  store ptr %0, ptr %4, align 8
  %5 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 %1, ptr %5, align 8
  %6 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str, i64 23, ptr nonnull @.str.1, i64 5)
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %.thread74, label %7

7:                                                ; preds = %3
  %8 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str.2, i64 11, ptr nonnull @.str.3, i64 6)
  %.not56 = icmp eq i32 %8, 0
  br i1 %.not56, label %13, label %9

9:                                                ; preds = %7
  %10 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str.4, i64 19, ptr nonnull @.str.5, i64 9)
  %.not64 = icmp eq i32 %10, 0
  br i1 %.not64, label %11, label %.thread

11:                                               ; preds = %9
  %12 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str.6, i64 16, ptr nonnull @.str.7, i64 6)
  %.not65.not.not = icmp eq i32 %12, 0
  br i1 %.not65.not.not, label %.thread74, label %.thread

13:                                               ; preds = %7
  %14 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str.8, i64 15, ptr nonnull @.str.8, i64 15)
  %.not57 = icmp eq i32 %14, 0
  br i1 %.not57, label %24, label %15

15:                                               ; preds = %13
  %16 = call i32 @tnconv_number_match_push(ptr noundef nonnull %4, ptr noundef %2)
  %17 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str.9, i64 12, ptr nonnull @.str.10, i64 6)
  %.not60 = icmp eq i32 %17, 0
  br i1 %.not60, label %18, label %.thread

18:                                               ; preds = %15
  %19 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str.11, i64 12, ptr nonnull @.str.12, i64 6)
  %.not61 = icmp eq i32 %19, 0
  br i1 %.not61, label %20, label %.thread

20:                                               ; preds = %18
  %21 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str.13, i64 10, ptr nonnull @.str.14, i64 5)
  %.not62 = icmp eq i32 %21, 0
  br i1 %.not62, label %22, label %.thread

22:                                               ; preds = %20
  %23 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str.15, i64 4, ptr nonnull @.str.15, i64 4)
  %.not63.not.not = icmp eq i32 %23, 0
  br i1 %.not63.not.not, label %.thread74, label %.thread

24:                                               ; preds = %13
  %25 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str.16, i64 17, ptr nonnull @.str.17, i64 9)
  %.not58 = icmp eq i32 %25, 0
  br i1 %.not58, label %26, label %.thread

26:                                               ; preds = %24
  %27 = call i32 @tnconv_prefix_match_replace(ptr noundef nonnull %4, ptr noundef %2, ptr nonnull @.str.18, i64 15, ptr nonnull @.str.19, i64 9)
  %.not59.not.not = icmp eq i32 %27, 0
  br i1 %.not59.not.not, label %.thread74, label %.thread

.thread:                                          ; preds = %24, %20, %18, %15, %9, %22, %11, %26
  %28 = load i64, ptr %5, align 8, !tbaa !5
  %29 = trunc i64 %28 to i32
  %30 = load ptr, ptr %4, align 8, !tbaa !11
  %31 = load ptr, ptr @g_allocator_dopt, align 8, !tbaa !12
  %32 = call ptr @dynbuf_append(ptr noundef %2, i32 noundef %29, ptr noundef %30, i64 noundef 1, i32 noundef 1, ptr noundef %31)
  br label %.thread74

.thread74:                                        ; preds = %3, %22, %11, %.thread, %26
  %.072 = phi i32 [ 1, %.thread ], [ 0, %26 ], [ 0, %11 ], [ 0, %22 ], [ 0, %3 ]
  ret i32 %.072
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"StrSlice", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!7, !7, i64 0}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass