; LLVM IR from wuzhouhui/leetcode :: 71_simplify_path (simplifyPath)

; 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.node = type { ptr, ptr }

@.str = external hidden unnamed_addr constant [1 x i8], align 1
@simplifyPath.tmppath = external hidden global [4096 x i8], align 16
@stack = external hidden global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @simplifyPath(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = icmp ne ptr %9, null
  br i1 %10, label %11, label %16

11:                                               ; preds = %1
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 0
  %14 = load i8, ptr %13, align 1, !tbaa !9
  %15 = icmp ne i8 %14, 0
  br i1 %15, label %18, label %16

16:                                               ; preds = %11, %1
  %17 = call noalias ptr @strdup(ptr noundef @.str) #5
  store ptr %17, ptr %2, align 8
  br label %332

18:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store ptr null, ptr @stack, align 8, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !10
  br label %19

19:                                               ; preds = %211, %18
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = load i32, ptr %6, align 4, !tbaa !10
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i8, ptr %20, i64 %22
  %24 = load i8, ptr %23, align 1, !tbaa !9
  %25 = icmp ne i8 %24, 0
  br i1 %25, label %26, label %212

26:                                               ; preds = %19
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = load i32, ptr %6, align 4, !tbaa !10
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i8, ptr %27, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = sext i8 %31 to i32
  switch i32 %32, label %175 [
    i32 47, label %33
    i32 46, label %40
  ]

33:                                               ; preds = %26
  %34 = load i32, ptr %6, align 4, !tbaa !10
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %37, label %36

36:                                               ; preds = %33
  call void @push(ptr noundef @.str.1)
  br label %37

37:                                               ; preds = %36, %33
  %38 = load i32, ptr %6, align 4, !tbaa !10
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %6, align 4, !tbaa !10
  br label %211

40:                                               ; preds = %26
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !10
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i8, ptr %41, i64 %44
  %46 = load i8, ptr %45, align 1, !tbaa !9
  %47 = icmp ne i8 %46, 0
  br i1 %47, label %48, label %57

48:                                               ; preds = %40
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = load i32, ptr %6, align 4, !tbaa !10
  %51 = add nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i8, ptr %49, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %55 = sext i8 %54 to i32
  %56 = icmp eq i32 %55, 47
  br i1 %56, label %57, label %60

57:                                               ; preds = %48, %40
  %58 = load i32, ptr %6, align 4, !tbaa !10
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %6, align 4, !tbaa !10
  br label %174

60:                                               ; preds = %48
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = load i32, ptr %6, align 4, !tbaa !10
  %63 = add nsw i32 %62, 1
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i8, ptr %61, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !9
  %67 = sext i8 %66 to i32
  %68 = icmp eq i32 %67, 46
  br i1 %68, label %69, label %137

69:                                               ; preds = %60
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !10
  %72 = add nsw i32 %71, 2
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i8, ptr %70, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !9
  %76 = icmp ne i8 %75, 0
  br i1 %76, label %77, label %86

77:                                               ; preds = %69
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = load i32, ptr %6, align 4, !tbaa !10
  %80 = add nsw i32 %79, 2
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i8, ptr %78, i64 %81
  %83 = load i8, ptr %82, align 1, !tbaa !9
  %84 = sext i8 %83 to i32
  %85 = icmp eq i32 %84, 47
  br i1 %85, label %86, label %100

86:                                               ; preds = %77, %69
  %87 = load ptr, ptr @stack, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %90, label %89

89:                                               ; preds = %86
  call void @push(ptr noundef @.str.2)
  br label %97

90:                                               ; preds = %86
  %91 = call ptr @top()
  %92 = call i32 @strcmp(ptr noundef @.str.1, ptr noundef %91) #6
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %96

94:                                               ; preds = %90
  %95 = call ptr @pop()
  call void @free(ptr noundef %95) #5
  br label %96

96:                                               ; preds = %94, %90
  br label %97

97:                                               ; preds = %96, %89
  %98 = load i32, ptr %6, align 4, !tbaa !10
  %99 = add nsw i32 %98, 2
  store i32 %99, ptr %6, align 4, !tbaa !10
  br label %136

100:                                              ; preds = %77
  store i32 0, ptr %7, align 4, !tbaa !10
  br label %101

101:                                              ; preds = %129, %100
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = load i32, ptr %6, align 4, !tbaa !10
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i8, ptr %102, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !9
  %107 = sext i8 %106 to i32
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %117

109:                                              ; preds = %101
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = load i32, ptr %6, align 4, !tbaa !10
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i8, ptr %110, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !9
  %115 = sext i8 %114 to i32
  %116 = icmp ne i32 %115, 47
  br label %117

117:                                              ; preds = %109, %101
  %118 = phi i1 [ false, %101 ], [ %116, %109 ]
  br i1 %118, label %119, label %132

119:                                              ; preds = %117
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = load i32, ptr %6, align 4, !tbaa !10
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i8, ptr %120, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !9
  %125 = load i32, ptr %7, align 4, !tbaa !10
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %7, align 4, !tbaa !10
  %127 = sext i32 %125 to i64
  %128 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %127
  store i8 %124, ptr %128, align 1, !tbaa !9
  br label %129

129:                                              ; preds = %119
  %130 = load i32, ptr %6, align 4, !tbaa !10
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %6, align 4, !tbaa !10
  br label %101, !llvm.loop !12

132:                                              ; preds = %117
  %133 = load i32, ptr %7, align 4, !tbaa !10
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %134
  store i8 0, ptr %135, align 1, !tbaa !9
  call void @push(ptr noundef @simplifyPath.tmppath)
  br label %136

136:                                              ; preds = %132, %97
  br label %173

137:                                              ; preds = %60
  store i32 0, ptr %7, align 4, !tbaa !10
  br label %138

138:                                              ; preds = %166, %137
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = load i32, ptr %6, align 4, !tbaa !10
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i8, ptr %139, i64 %141
  %143 = load i8, ptr %142, align 1, !tbaa !9
  %144 = sext i8 %143 to i32
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %154

146:                                              ; preds = %138
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = load i32, ptr %6, align 4, !tbaa !10
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i8, ptr %147, i64 %149
  %151 = load i8, ptr %150, align 1, !tbaa !9
  %152 = sext i8 %151 to i32
  %153 = icmp ne i32 %152, 47
  br label %154

154:                                              ; preds = %146, %138
  %155 = phi i1 [ false, %138 ], [ %153, %146 ]
  br i1 %155, label %156, label %169

156:                                              ; preds = %154
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = load i32, ptr %6, align 4, !tbaa !10
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds i8, ptr %157, i64 %159
  %161 = load i8, ptr %160, align 1, !tbaa !9
  %162 = load i32, ptr %7, align 4, !tbaa !10
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %7, align 4, !tbaa !10
  %164 = sext i32 %162 to i64
  %165 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %164
  store i8 %161, ptr %165, align 1, !tbaa !9
  br label %166

166:                                              ; preds = %156
  %167 = load i32, ptr %6, align 4, !tbaa !10
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %6, align 4, !tbaa !10
  br label %138, !llvm.loop !14

169:                                              ; preds = %154
  %170 = load i32, ptr %7, align 4, !tbaa !10
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %171
  store i8 0, ptr %172, align 1, !tbaa !9
  call void @push(ptr noundef @simplifyPath.tmppath)
  br label %173

173:                                              ; preds = %169, %136
  br label %174

174:                                              ; preds = %173, %57
  br label %211

175:                                              ; preds = %26
  store i32 0, ptr %7, align 4, !tbaa !10
  br label %176

176:                                              ; preds = %204, %175
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = load i32, ptr %6, align 4, !tbaa !10
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i8, ptr %177, i64 %179
  %181 = load i8, ptr %180, align 1, !tbaa !9
  %182 = sext i8 %181 to i32
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %192

184:                                              ; preds = %176
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = load i32, ptr %6, align 4, !tbaa !10
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds i8, ptr %185, i64 %187
  %189 = load i8, ptr %188, align 1, !tbaa !9
  %190 = sext i8 %189 to i32
  %191 = icmp ne i32 %190, 47
  br label %192

192:                                              ; preds = %184, %176
  %193 = phi i1 [ false, %176 ], [ %191, %184 ]
  br i1 %193, label %194, label %207

194:                                              ; preds = %192
  %195 = load ptr, ptr %3, align 8, !tbaa !5
  %196 = load i32, ptr %6, align 4, !tbaa !10
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds i8, ptr %195, i64 %197
  %199 = load i8, ptr %198, align 1, !tbaa !9
  %200 = load i32, ptr %7, align 4, !tbaa !10
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %7, align 4, !tbaa !10
  %202 = sext i32 %200 to i64
  %203 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %202
  store i8 %199, ptr %203, align 1, !tbaa !9
  br label %204

204:                                              ; preds = %194
  %205 = load i32, ptr %6, align 4, !tbaa !10
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %6, align 4, !tbaa !10
  br label %176, !llvm.loop !15

207:                                              ; preds = %192
  %208 = load i32, ptr %7, align 4, !tbaa !10
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %209
  store i8 0, ptr %210, align 1, !tbaa !9
  call void @push(ptr noundef @simplifyPath.tmppath)
  br label %211

211:                                              ; preds = %207, %174, %37
  br label %19, !llvm.loop !16

212:                                              ; preds = %19
  %213 = load ptr, ptr @stack, align 8, !tbaa !5
  %214 = icmp ne ptr %213, null
  br i1 %214, label %217, label %215

215:                                              ; preds = %212
  %216 = call noalias ptr @strdup(ptr noundef @.str) #5
  store ptr %216, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %331

217:                                              ; preds = %212
  store ptr null, ptr %4, align 8, !tbaa !5
  br label %218

218:                                              ; preds = %221, %217
  %219 = load ptr, ptr @stack, align 8, !tbaa !5
  %220 = icmp ne ptr %219, null
  br i1 %220, label %221, label %230

221:                                              ; preds = %218
  %222 = load ptr, ptr @stack, align 8, !tbaa !5
  store ptr %222, ptr %5, align 8, !tbaa !5
  %223 = load ptr, ptr @stack, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.node, ptr %223, i32 0, i32 1
  %225 = load ptr, ptr %224, align 8, !tbaa !17
  store ptr %225, ptr @stack, align 8, !tbaa !5
  %226 = load ptr, ptr %4, align 8, !tbaa !5
  %227 = load ptr, ptr %5, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.node, ptr %227, i32 0, i32 1
  store ptr %226, ptr %228, align 8, !tbaa !17
  %229 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %229, ptr %4, align 8, !tbaa !5
  br label %218, !llvm.loop !19

230:                                              ; preds = %218
  store i32 0, ptr %6, align 4, !tbaa !10
  br label %231

231:                                              ; preds = %321, %230
  %232 = load ptr, ptr %4, align 8, !tbaa !5
  %233 = icmp ne ptr %232, null
  br i1 %233, label %234, label %326

234:                                              ; preds = %231
  %235 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %235, ptr %5, align 8, !tbaa !5
  %236 = load ptr, ptr %4, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.node, ptr %236, i32 0, i32 1
  %238 = load ptr, ptr %237, align 8, !tbaa !17
  store ptr %238, ptr %4, align 8, !tbaa !5
  %239 = load i32, ptr %6, align 4, !tbaa !10
  %240 = icmp ne i32 %239, 0
  br i1 %240, label %294, label %241

241:                                              ; preds = %234
  %242 = load ptr, ptr %5, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.node, ptr %242, i32 0, i32 0
  %244 = load ptr, ptr %243, align 8, !tbaa !20
  %245 = getelementptr inbounds i8, ptr %244, i64 0
  %246 = load i8, ptr %245, align 1, !tbaa !9
  %247 = sext i8 %246 to i32
  %248 = icmp eq i32 %247, 47
  br i1 %248, label %249, label %254

249:                                              ; preds = %241
  %250 = load i32, ptr %6, align 4, !tbaa !10
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %6, align 4, !tbaa !10
  %252 = sext i32 %250 to i64
  %253 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %252
  store i8 47, ptr %253, align 1, !tbaa !9
  br label %293

254:                                              ; preds = %241
  %255 = load ptr, ptr %5, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.node, ptr %255, i32 0, i32 0
  %257 = load ptr, ptr %256, align 8, !tbaa !20
  %258 = call i32 @strcmp(ptr noundef %257, ptr noundef @.str.2) #6
  %259 = icmp ne i32 %258, 0
  br i1 %259, label %269, label %260

260:                                              ; preds = %254
  %261 = load i32, ptr %6, align 4, !tbaa !10
  %262 = add nsw i32 %261, 1
  store i32 %262, ptr %6, align 4, !tbaa !10
  %263 = sext i32 %261 to i64
  %264 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %263
  store i8 46, ptr %264, align 1, !tbaa !9
  %265 = load i32, ptr %6, align 4, !tbaa !10
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %6, align 4, !tbaa !10
  %267 = sext i32 %265 to i64
  %268 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %267
  store i8 46, ptr %268, align 1, !tbaa !9
  br label %292

269:                                              ; preds = %254
  %270 = load i32, ptr %6, align 4, !tbaa !10
  %271 = add nsw i32 %270, 1
  store i32 %271, ptr %6, align 4, !tbaa !10
  %272 = sext i32 %270 to i64
  %273 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %272
  store i8 47, ptr %273, align 1, !tbaa !9
  %274 = load i32, ptr %6, align 4, !tbaa !10
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds i8, ptr @simplifyPath.tmppath, i64 %275
  %277 = load ptr, ptr %5, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.node, ptr %277, i32 0, i32 0
  %279 = load ptr, ptr %278, align 8, !tbaa !20
  %280 = load ptr, ptr %5, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.node, ptr %280, i32 0, i32 0
  %282 = load ptr, ptr %281, align 8, !tbaa !20
  %283 = call i64 @strlen(ptr noundef %282) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %276, ptr align 1 %279, i64 %283, i1 false)
  %284 = load ptr, ptr %5, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.node, ptr %284, i32 0, i32 0
  %286 = load ptr, ptr %285, align 8, !tbaa !20
  %287 = call i64 @strlen(ptr noundef %286) #6
  %288 = load i32, ptr %6, align 4, !tbaa !10
  %289 = sext i32 %288 to i64
  %290 = add i64 %289, %287
  %291 = trunc i64 %290 to i32
  store i32 %291, ptr %6, align 4, !tbaa !10
  br label %292

292:                                              ; preds = %269, %260
  br label %293

293:                                              ; preds = %292, %249
  br label %321

294:                                              ; preds = %234
  %295 = load i32, ptr %6, align 4, !tbaa !10
  %296 = icmp ne i32 %295, 1
  br i1 %296, label %297, label %302

297:                                              ; preds = %294
  %298 = load i32, ptr %6, align 4, !tbaa !10
  %299 = add nsw i32 %298, 1
  store i32 %299, ptr %6, align 4, !tbaa !10
  %300 = sext i32 %298 to i64
  %301 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %300
  store i8 47, ptr %301, align 1, !tbaa !9
  br label %302

302:                                              ; preds = %297, %294
  %303 = load i32, ptr %6, align 4, !tbaa !10
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds i8, ptr @simplifyPath.tmppath, i64 %304
  %306 = load ptr, ptr %5, align 8, !tbaa !5
  %307 = getelementptr inbounds %struct.node, ptr %306, i32 0, i32 0
  %308 = load ptr, ptr %307, align 8, !tbaa !20
  %309 = load ptr, ptr %5, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.node, ptr %309, i32 0, i32 0
  %311 = load ptr, ptr %310, align 8, !tbaa !20
  %312 = call i64 @strlen(ptr noundef %311) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %305, ptr align 1 %308, i64 %312, i1 false)
  %313 = load ptr, ptr %5, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.node, ptr %313, i32 0, i32 0
  %315 = load ptr, ptr %314, align 8, !tbaa !20
  %316 = call i64 @strlen(ptr noundef %315) #6
  %317 = load i32, ptr %6, align 4, !tbaa !10
  %318 = sext i32 %317 to i64
  %319 = add i64 %318, %316
  %320 = trunc i64 %319 to i32
  store i32 %320, ptr %6, align 4, !tbaa !10
  br label %321

321:                                              ; preds = %302, %293
  %322 = load ptr, ptr %5, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.node, ptr %322, i32 0, i32 0
  %324 = load ptr, ptr %323, align 8, !tbaa !20
  call void @free(ptr noundef %324) #5
  %325 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %325) #5
  br label %231, !llvm.loop !21

326:                                              ; preds = %231
  %327 = load i32, ptr %6, align 4, !tbaa !10
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %328
  store i8 0, ptr %329, align 1, !tbaa !9
  %330 = call noalias ptr @strdup(ptr noundef @simplifyPath.tmppath) #5
  store ptr %330, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %331

331:                                              ; preds = %326, %215
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %332

332:                                              ; preds = %331, %16
  %333 = load ptr, ptr %2, align 8
  ret ptr %333
}

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden void @push(ptr noundef) #0

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @top() #0

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @pop() #0

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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 = { nounwind "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind willreturn memory(read) "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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = !{!18, !6, i64 8}
!18 = !{!"node", !6, i64 0, !6, i64 8}
!19 = distinct !{!19, !13}
!20 = !{!18, !6, i64 0}
!21 = distinct !{!21, !13}


; 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"

@.str = external hidden unnamed_addr constant [1 x i8], align 1
@simplifyPath.tmppath = external hidden global [4096 x i8], align 16
@stack = external hidden local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noalias ptr @simplifyPath(ptr noundef readonly %0) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %90, label %2

2:                                                ; preds = %1
  %3 = load i8, ptr %0, align 1, !tbaa !5
  %.not95 = icmp eq i8 %3, 0
  br i1 %.not95, label %90, label %4

4:                                                ; preds = %2
  store ptr null, ptr @stack, align 8, !tbaa !8
  br label %5

5:                                                ; preds = %.backedge, %4
  %.079 = phi i32 [ 0, %4 ], [ %.079.be, %.backedge ]
  %6 = sext i32 %.079 to i64
  %7 = getelementptr inbounds i8, ptr %0, i64 %6
  %8 = load i8, ptr %7, align 1, !tbaa !5
  switch i8 %8, label %.preheader115 [
    i8 0, label %49
    i8 47, label %9
    i8 46, label %13
  ]

9:                                                ; preds = %5
  %.not111 = icmp eq i32 %.079, 0
  br i1 %.not111, label %10, label %11

10:                                               ; preds = %9
  tail call void @push(ptr noundef nonnull @.str.1)
  br label %11

11:                                               ; preds = %10, %9
  %12 = add nsw i32 %.079, 1
  br label %.backedge

13:                                               ; preds = %5
  %14 = add nsw i32 %.079, 1
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds i8, ptr %0, i64 %15
  %17 = load i8, ptr %16, align 1, !tbaa !5
  switch i8 %17, label %.preheader116 [
    i8 0, label %.backedge
    i8 47, label %.backedge
    i8 46, label %18
  ]

18:                                               ; preds = %13
  %19 = add nsw i32 %.079, 2
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds i8, ptr %0, i64 %20
  %22 = load i8, ptr %21, align 1, !tbaa !5
  switch i8 %22, label %.preheader117 [
    i8 0, label %23
    i8 47, label %23
  ]

23:                                               ; preds = %18, %18
  %24 = load ptr, ptr @stack, align 8, !tbaa !8
  %.not109 = icmp eq ptr %24, null
  br i1 %.not109, label %25, label %26

25:                                               ; preds = %23
  tail call void @push(ptr noundef nonnull @.str.2)
  br label %.backedge

.backedge:                                        ; preds = %25, %29, %26, %13, %13, %.critedge, %.critedge2, %.critedge4, %11
  %.079.be = phi i32 [ %46, %.critedge4 ], [ %34, %.critedge ], [ %40, %.critedge2 ], [ %12, %11 ], [ %14, %13 ], [ %14, %13 ], [ %19, %26 ], [ %19, %29 ], [ %19, %25 ]
  br label %5, !llvm.loop !10

26:                                               ; preds = %23
  %27 = tail call ptr @top()
  %28 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull dereferenceable(1) %27) #5
  %.not110 = icmp eq i32 %28, 0
  br i1 %.not110, label %.backedge, label %29

29:                                               ; preds = %26
  %30 = tail call ptr @pop()
  tail call void @free(ptr noundef %30) #6
  br label %.backedge

.preheader117:                                    ; preds = %18, %32
  %31 = phi i8 [ %.pre, %32 ], [ 46, %18 ]
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %32 ], [ 0, %18 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %32 ], [ %6, %18 ]
  switch i8 %31, label %32 [
    i8 0, label %.critedge
    i8 47, label %.critedge
  ]

32:                                               ; preds = %.preheader117
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %33 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %indvars.iv122
  store i8 %31, ptr %33, align 1, !tbaa !5
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next
  %.pre = load i8, ptr %.phi.trans.insert, align 1, !tbaa !5
  br label %.preheader117, !llvm.loop !12

.critedge:                                        ; preds = %.preheader117, %.preheader117
  %34 = trunc nsw i64 %indvars.iv to i32
  %35 = and i64 %indvars.iv122, 4294967295
  %36 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %35
  store i8 0, ptr %36, align 1, !tbaa !5
  tail call void @push(ptr noundef nonnull @simplifyPath.tmppath)
  br label %.backedge

.preheader116:                                    ; preds = %13, %38
  %37 = phi i8 [ %.pre142, %38 ], [ 46, %13 ]
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %38 ], [ 0, %13 ]
  %indvars.iv127 = phi i64 [ %indvars.iv.next128, %38 ], [ %6, %13 ]
  switch i8 %37, label %38 [
    i8 0, label %.critedge2
    i8 47, label %.critedge2
  ]

38:                                               ; preds = %.preheader116
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %39 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %indvars.iv129
  store i8 %37, ptr %39, align 1, !tbaa !5
  %indvars.iv.next128 = add nsw i64 %indvars.iv127, 1
  %.phi.trans.insert141 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next128
  %.pre142 = load i8, ptr %.phi.trans.insert141, align 1, !tbaa !5
  br label %.preheader116, !llvm.loop !13

.critedge2:                                       ; preds = %.preheader116, %.preheader116
  %40 = trunc nsw i64 %indvars.iv127 to i32
  %41 = and i64 %indvars.iv129, 4294967295
  %42 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %41
  store i8 0, ptr %42, align 1, !tbaa !5
  tail call void @push(ptr noundef nonnull @simplifyPath.tmppath)
  br label %.backedge

.preheader115:                                    ; preds = %5, %44
  %43 = phi i8 [ %.pre144, %44 ], [ %8, %5 ]
  %indvars.iv136 = phi i64 [ %indvars.iv.next137, %44 ], [ 0, %5 ]
  %indvars.iv134 = phi i64 [ %indvars.iv.next135, %44 ], [ %6, %5 ]
  switch i8 %43, label %44 [
    i8 0, label %.critedge4
    i8 47, label %.critedge4
  ]

44:                                               ; preds = %.preheader115
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %45 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %indvars.iv136
  store i8 %43, ptr %45, align 1, !tbaa !5
  %indvars.iv.next135 = add nsw i64 %indvars.iv134, 1
  %.phi.trans.insert143 = getelementptr inbounds i8, ptr %0, i64 %indvars.iv.next135
  %.pre144 = load i8, ptr %.phi.trans.insert143, align 1, !tbaa !5
  br label %.preheader115, !llvm.loop !14

.critedge4:                                       ; preds = %.preheader115, %.preheader115
  %46 = trunc nsw i64 %indvars.iv134 to i32
  %47 = and i64 %indvars.iv136, 4294967295
  %48 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %47
  store i8 0, ptr %48, align 1, !tbaa !5
  tail call void @push(ptr noundef nonnull @simplifyPath.tmppath)
  br label %.backedge

49:                                               ; preds = %5
  %50 = load ptr, ptr @stack, align 8, !tbaa !8
  %.not97 = icmp eq ptr %50, null
  br i1 %.not97, label %90, label %.preheader114

.preheader:                                       ; preds = %.preheader114
  store ptr null, ptr @stack, align 8, !tbaa !8
  br label %54

.preheader114:                                    ; preds = %49, %.preheader114
  %.082118 = phi ptr [ %51, %.preheader114 ], [ null, %49 ]
  %51 = phi ptr [ %53, %.preheader114 ], [ %50, %49 ]
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  store ptr %.082118, ptr %52, align 8, !tbaa !15
  %.not98 = icmp eq ptr %53, null
  br i1 %.not98, label %.preheader, label %.preheader114, !llvm.loop !17

54:                                               ; preds = %.preheader, %85
  %.5120 = phi i32 [ 0, %.preheader ], [ %.7, %85 ]
  %.183119 = phi ptr [ %51, %.preheader ], [ %56, %85 ]
  %55 = getelementptr inbounds i8, ptr %.183119, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  switch i32 %.5120, label %72 [
    i32 0, label %57
    i32 1, label %76
  ]

57:                                               ; preds = %54
  %58 = load ptr, ptr %.183119, align 8, !tbaa !18
  %59 = load i8, ptr %58, align 1, !tbaa !5
  %60 = icmp eq i8 %59, 47
  br i1 %60, label %61, label %62

61:                                               ; preds = %57
  store i8 47, ptr @simplifyPath.tmppath, align 16, !tbaa !5
  br label %85

62:                                               ; preds = %57
  %63 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %58, ptr noundef nonnull dereferenceable(1) @.str.2) #5
  %.not101 = icmp eq i32 %63, 0
  br i1 %.not101, label %64, label %65

64:                                               ; preds = %62
  store i8 46, ptr @simplifyPath.tmppath, align 16, !tbaa !5
  store i8 46, ptr getelementptr inbounds (i8, ptr @simplifyPath.tmppath, i64 1), align 1, !tbaa !5
  br label %85

65:                                               ; preds = %62
  store i8 47, ptr @simplifyPath.tmppath, align 16, !tbaa !5
  %66 = load ptr, ptr %.183119, align 8, !tbaa !18
  %67 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %66) #5
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 getelementptr inbounds (i8, ptr @simplifyPath.tmppath, i64 1), ptr align 1 %66, i64 %67, i1 false)
  %68 = load ptr, ptr %.183119, align 8, !tbaa !18
  %69 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %68) #5
  %70 = trunc i64 %69 to i32
  %71 = add i32 %70, 1
  br label %85

72:                                               ; preds = %54
  %73 = add nsw i32 %.5120, 1
  %74 = sext i32 %.5120 to i64
  %75 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %74
  store i8 47, ptr %75, align 1, !tbaa !5
  br label %76

76:                                               ; preds = %54, %72
  %.6 = phi i32 [ %73, %72 ], [ %.5120, %54 ]
  %77 = sext i32 %.6 to i64
  %78 = getelementptr inbounds i8, ptr @simplifyPath.tmppath, i64 %77
  %79 = load ptr, ptr %.183119, align 8, !tbaa !18
  %80 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %79) #5
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %78, ptr align 1 %79, i64 %80, i1 false)
  %81 = load ptr, ptr %.183119, align 8, !tbaa !18
  %82 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %81) #5
  %83 = trunc i64 %82 to i32
  %84 = add i32 %.6, %83
  br label %85

85:                                               ; preds = %61, %65, %64, %76
  %.7 = phi i32 [ %84, %76 ], [ 1, %61 ], [ %71, %65 ], [ 2, %64 ]
  %86 = load ptr, ptr %.183119, align 8, !tbaa !18
  tail call void @free(ptr noundef %86) #6
  tail call void @free(ptr noundef nonnull %.183119) #6
  %.not99 = icmp eq ptr %56, null
  br i1 %.not99, label %87, label %54, !llvm.loop !19

87:                                               ; preds = %85
  %88 = sext i32 %.7 to i64
  %89 = getelementptr inbounds [4096 x i8], ptr @simplifyPath.tmppath, i64 0, i64 %88
  store i8 0, ptr %89, align 1, !tbaa !5
  br label %90

90:                                               ; preds = %49, %1, %2, %87
  %.str.sink = phi ptr [ @simplifyPath.tmppath, %87 ], [ @.str, %2 ], [ @.str, %1 ], [ @.str, %49 ]
  %91 = tail call noalias ptr @strdup(ptr noundef nonnull %.str.sink) #6
  ret ptr %91
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @push(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden ptr @top() local_unnamed_addr #0

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden ptr @pop() local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind willreturn memory(read) }
attributes #6 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = !{!16, !9, i64 8}
!16 = !{!"node", !9, i64 0, !9, i64 8}
!17 = distinct !{!17, !11}
!18 = !{!16, !9, i64 0}
!19 = distinct !{!19, !11}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass