; LLVM IR from fmela/libdict :: src (skiplist)

; 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.dict_remove_result = type { ptr, ptr, i8 }
%struct.skiplist = type { ptr, i32, i32, ptr, i64 }
%struct.skip_node = type { ptr, ptr, ptr, i32, [0 x ptr] }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@dict_free_func = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@__func__.skiplist_remove = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #0

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @abort() #2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
define dso_local void @skiplist_remove(ptr dead_on_unwind noalias writable sret(%struct.dict_remove_result) align 8 %0, ptr noundef %1, ptr noundef %2) #5 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [32 x ptr], align 16
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %1, ptr %4, align 8, !tbaa !5
  store ptr %2, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.skiplist, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %7) #6
  call void @llvm.memset.p0.i64(ptr align 16 %7, i8 0, i64 256, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  store i8 0, ptr %8, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.skiplist, ptr %17, i32 0, i32 2
  %19 = load i32, ptr %18, align 4, !tbaa !15
  %20 = add i32 %19, 1
  store i32 %20, ptr %9, align 4, !tbaa !16
  br label %21

21:                                               ; preds = %98, %3
  %22 = load i32, ptr %9, align 4, !tbaa !16
  %23 = add i32 %22, -1
  store i32 %23, ptr %9, align 4, !tbaa !16
  %24 = icmp ugt i32 %22, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %103

26:                                               ; preds = %21
  br label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.skip_node, ptr %28, i32 0, i32 3
  %30 = load i32, ptr %29, align 8, !tbaa !16
  %31 = load i32, ptr %9, align 4, !tbaa !16
  %32 = icmp ugt i32 %30, %31
  %33 = zext i1 %32 to i32
  %34 = sext i32 %33 to i64
  %35 = call i64 @llvm.expect.i64(i64 %34, i64 1)
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %40, label %37

37:                                               ; preds = %27
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 368, ptr noundef @__func__.skiplist_remove, ptr noundef @.str.4) #6
  call void @abort() #7
  unreachable

40:                                               ; preds = %27
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %97, %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.skip_node, ptr %44, i32 0, i32 4
  %46 = load i32, ptr %9, align 4, !tbaa !16
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds [0 x ptr], ptr %45, i64 0, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  store ptr %49, ptr %11, align 8, !tbaa !5
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %53, label %52

52:                                               ; preds = %43
  store i32 6, ptr %10, align 4
  br label %95

53:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.skiplist, ptr %54, i32 0, i32 3
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.skip_node, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = call i32 %56(ptr noundef %57, ptr noundef %60)
  store i32 %61, ptr %12, align 4, !tbaa !16
  %62 = load i32, ptr %12, align 4, !tbaa !16
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %64, label %66

64:                                               ; preds = %53
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %65, ptr %6, align 8, !tbaa !5
  br label %93

66:                                               ; preds = %53
  br label %67

67:                                               ; preds = %82, %66
  %68 = load i32, ptr %9, align 4, !tbaa !16
  %69 = icmp ugt i32 %68, 0
  br i1 %69, label %70, label %80

70:                                               ; preds = %67
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.skip_node, ptr %71, i32 0, i32 4
  %73 = load i32, ptr %9, align 4, !tbaa !16
  %74 = sub i32 %73, 1
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds [0 x ptr], ptr %72, i64 0, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = icmp eq ptr %77, %78
  br label %80

80:                                               ; preds = %70, %67
  %81 = phi i1 [ false, %67 ], [ %79, %70 ]
  br i1 %81, label %82, label %88

82:                                               ; preds = %80
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = load i32, ptr %9, align 4, !tbaa !16
  %85 = add i32 %84, -1
  store i32 %85, ptr %9, align 4, !tbaa !16
  %86 = zext i32 %84 to i64
  %87 = getelementptr inbounds [32 x ptr], ptr %7, i64 0, i64 %86
  store ptr %83, ptr %87, align 8, !tbaa !5
  br label %67, !llvm.loop !18

88:                                               ; preds = %80
  %89 = load i32, ptr %12, align 4, !tbaa !16
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  store i8 1, ptr %8, align 1, !tbaa !13
  br label %92

92:                                               ; preds = %91, %88
  store i32 6, ptr %10, align 4
  br label %94

93:                                               ; preds = %64
  store i32 0, ptr %10, align 4
  br label %94

94:                                               ; preds = %93, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %95

95:                                               ; preds = %94, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  %96 = load i32, ptr %10, align 4
  switch i32 %96, label %263 [
    i32 0, label %97
    i32 6, label %98
  ]

97:                                               ; preds = %95
  br label %43

98:                                               ; preds = %95
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = load i32, ptr %9, align 4, !tbaa !16
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds [32 x ptr], ptr %7, i64 0, i64 %101
  store ptr %99, ptr %102, align 8, !tbaa !5
  br label %21, !llvm.loop !20

103:                                              ; preds = %25
  %104 = load i8, ptr %8, align 1, !tbaa !13, !range !21, !noundef !22
  %105 = trunc i8 %104 to i1
  br i1 %105, label %110, label %106

106:                                              ; preds = %103
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 24, i1 false)
  %107 = getelementptr inbounds %struct.dict_remove_result, ptr %0, i32 0, i32 0
  %108 = getelementptr inbounds %struct.dict_remove_result, ptr %0, i32 0, i32 1
  %109 = getelementptr inbounds %struct.dict_remove_result, ptr %0, i32 0, i32 2
  store i32 1, ptr %10, align 4
  br label %262

110:                                              ; preds = %103
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.skip_node, ptr %111, i32 0, i32 4
  %113 = getelementptr inbounds [0 x ptr], ptr %112, i64 0, i64 0
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  store ptr %114, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !16
  br label %115

115:                                              ; preds = %185, %110
  %116 = load i32, ptr %13, align 4, !tbaa !16
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.skiplist, ptr %117, i32 0, i32 2
  %119 = load i32, ptr %118, align 4, !tbaa !15
  %120 = icmp ule i32 %116, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %115
  store i32 10, ptr %10, align 4
  br label %188

122:                                              ; preds = %115
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %13, align 4, !tbaa !16
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds [32 x ptr], ptr %7, i64 0, i64 %125
  %127 = load ptr, ptr %126, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  %129 = zext i1 %128 to i32
  %130 = sext i32 %129 to i64
  %131 = call i64 @llvm.expect.i64(i64 %130, i64 1)
  %132 = icmp ne i64 %131, 0
  br i1 %132, label %136, label %133

133:                                              ; preds = %123
  %134 = load ptr, ptr @stderr, align 8, !tbaa !5
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 390, ptr noundef @__func__.skiplist_remove, ptr noundef @.str.5) #6
  call void @abort() #7
  unreachable

136:                                              ; preds = %123
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %13, align 4, !tbaa !16
  %141 = zext i32 %140 to i64
  %142 = getelementptr inbounds [32 x ptr], ptr %7, i64 0, i64 %141
  %143 = load ptr, ptr %142, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.skip_node, ptr %143, i32 0, i32 3
  %145 = load i32, ptr %144, align 8, !tbaa !16
  %146 = load i32, ptr %13, align 4, !tbaa !16
  %147 = icmp ugt i32 %145, %146
  %148 = zext i1 %147 to i32
  %149 = sext i32 %148 to i64
  %150 = call i64 @llvm.expect.i64(i64 %149, i64 1)
  %151 = icmp ne i64 %150, 0
  br i1 %151, label %155, label %152

152:                                              ; preds = %139
  %153 = load ptr, ptr @stderr, align 8, !tbaa !5
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 391, ptr noundef @__func__.skiplist_remove, ptr noundef @.str.6) #6
  call void @abort() #7
  unreachable

155:                                              ; preds = %139
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %13, align 4, !tbaa !16
  %159 = zext i32 %158 to i64
  %160 = getelementptr inbounds [32 x ptr], ptr %7, i64 0, i64 %159
  %161 = load ptr, ptr %160, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.skip_node, ptr %161, i32 0, i32 4
  %163 = load i32, ptr %13, align 4, !tbaa !16
  %164 = zext i32 %163 to i64
  %165 = getelementptr inbounds [0 x ptr], ptr %162, i64 0, i64 %164
  %166 = load ptr, ptr %165, align 8, !tbaa !5
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = icmp ne ptr %166, %167
  br i1 %168, label %169, label %170

169:                                              ; preds = %157
  store i32 10, ptr %10, align 4
  br label %188

170:                                              ; preds = %157
  %171 = load ptr, ptr %6, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.skip_node, ptr %171, i32 0, i32 4
  %173 = load i32, ptr %13, align 4, !tbaa !16
  %174 = zext i32 %173 to i64
  %175 = getelementptr inbounds [0 x ptr], ptr %172, i64 0, i64 %174
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  %177 = load i32, ptr %13, align 4, !tbaa !16
  %178 = zext i32 %177 to i64
  %179 = getelementptr inbounds [32 x ptr], ptr %7, i64 0, i64 %178
  %180 = load ptr, ptr %179, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.skip_node, ptr %180, i32 0, i32 4
  %182 = load i32, ptr %13, align 4, !tbaa !16
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds [0 x ptr], ptr %181, i64 0, i64 %183
  store ptr %176, ptr %184, align 8, !tbaa !5
  br label %185

185:                                              ; preds = %170
  %186 = load i32, ptr %13, align 4, !tbaa !16
  %187 = add i32 %186, 1
  store i32 %187, ptr %13, align 4, !tbaa !16
  br label %115, !llvm.loop !23

188:                                              ; preds = %169, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %189

189:                                              ; preds = %188
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.skip_node, ptr %190, i32 0, i32 2
  %192 = load ptr, ptr %191, align 8, !tbaa !5
  %193 = icmp ne ptr %192, null
  br i1 %193, label %194, label %204

194:                                              ; preds = %189
  %195 = load ptr, ptr %6, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.skip_node, ptr %195, i32 0, i32 4
  %197 = getelementptr inbounds [0 x ptr], ptr %196, i64 0, i64 0
  %198 = load ptr, ptr %197, align 8, !tbaa !5
  %199 = load ptr, ptr %6, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.skip_node, ptr %199, i32 0, i32 2
  %201 = load ptr, ptr %200, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.skip_node, ptr %201, i32 0, i32 4
  %203 = getelementptr inbounds [0 x ptr], ptr %202, i64 0, i64 0
  store ptr %198, ptr %203, align 8, !tbaa !5
  br label %204

204:                                              ; preds = %194, %189
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.skip_node, ptr %205, i32 0, i32 4
  %207 = getelementptr inbounds [0 x ptr], ptr %206, i64 0, i64 0
  %208 = load ptr, ptr %207, align 8, !tbaa !5
  %209 = icmp ne ptr %208, null
  br i1 %209, label %210, label %219

210:                                              ; preds = %204
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.skip_node, ptr %211, i32 0, i32 2
  %213 = load ptr, ptr %212, align 8, !tbaa !5
  %214 = load ptr, ptr %6, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.skip_node, ptr %214, i32 0, i32 4
  %216 = getelementptr inbounds [0 x ptr], ptr %215, i64 0, i64 0
  %217 = load ptr, ptr %216, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.skip_node, ptr %217, i32 0, i32 2
  store ptr %213, ptr %218, align 8, !tbaa !5
  br label %219

219:                                              ; preds = %210, %204
  %220 = getelementptr inbounds %struct.dict_remove_result, ptr %0, i32 0, i32 0
  %221 = load ptr, ptr %6, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.skip_node, ptr %221, i32 0, i32 0
  %223 = load ptr, ptr %222, align 8, !tbaa !5
  store ptr %223, ptr %220, align 8, !tbaa !24
  %224 = getelementptr inbounds %struct.dict_remove_result, ptr %0, i32 0, i32 1
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.skip_node, ptr %225, i32 0, i32 1
  %227 = load ptr, ptr %226, align 8, !tbaa !5
  store ptr %227, ptr %224, align 8, !tbaa !26
  %228 = getelementptr inbounds %struct.dict_remove_result, ptr %0, i32 0, i32 2
  store i8 1, ptr %228, align 8, !tbaa !27
  %229 = load ptr, ptr @dict_free_func, align 8, !tbaa !5
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  call void %229(ptr noundef %230)
  br label %231

231:                                              ; preds = %252, %219
  %232 = load ptr, ptr %4, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.skiplist, ptr %232, i32 0, i32 2
  %234 = load i32, ptr %233, align 4, !tbaa !15
  %235 = icmp ugt i32 %234, 0
  br i1 %235, label %236, label %250

236:                                              ; preds = %231
  %237 = load ptr, ptr %4, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.skiplist, ptr %237, i32 0, i32 0
  %239 = load ptr, ptr %238, align 8, !tbaa !9
  %240 = getelementptr inbounds %struct.skip_node, ptr %239, i32 0, i32 4
  %241 = load ptr, ptr %4, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.skiplist, ptr %241, i32 0, i32 2
  %243 = load i32, ptr %242, align 4, !tbaa !15
  %244 = sub i32 %243, 1
  %245 = zext i32 %244 to i64
  %246 = getelementptr inbounds [0 x ptr], ptr %240, i64 0, i64 %245
  %247 = load ptr, ptr %246, align 8, !tbaa !5
  %248 = icmp ne ptr %247, null
  %249 = xor i1 %248, true
  br label %250

250:                                              ; preds = %236, %231
  %251 = phi i1 [ false, %231 ], [ %249, %236 ]
  br i1 %251, label %252, label %257

252:                                              ; preds = %250
  %253 = load ptr, ptr %4, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.skiplist, ptr %253, i32 0, i32 2
  %255 = load i32, ptr %254, align 4, !tbaa !15
  %256 = add i32 %255, -1
  store i32 %256, ptr %254, align 4, !tbaa !15
  br label %231, !llvm.loop !28

257:                                              ; preds = %250
  %258 = load ptr, ptr %4, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.skiplist, ptr %258, i32 0, i32 4
  %260 = load i64, ptr %259, align 8, !tbaa !29
  %261 = add i64 %260, -1
  store i64 %261, ptr %259, align 8, !tbaa !29
  store i32 1, ptr %10, align 4
  br label %262

262:                                              ; preds = %257, %106
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  ret void

263:                                              ; preds = %95
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 = { noreturn 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn 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, !6, i64 0}
!10 = !{!"skiplist", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16, !12, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!10, !11, i64 12}
!16 = !{!11, !11, i64 0}
!17 = !{!10, !6, i64 16}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !19}
!24 = !{!25, !6, i64 0}
!25 = !{!"", !6, i64 0, !6, i64 8, !14, i64 16}
!26 = !{!25, !6, i64 8}
!27 = !{!25, !14, i64 16}
!28 = distinct !{!28, !19}
!29 = !{!10, !12, i64 24}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@dict_free_func = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@__func__.skiplist_remove = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local void @skiplist_remove(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.dict_remove_result) align 8 %0, ptr nocapture noundef %1, ptr noundef %2) local_unnamed_addr #4 {
  %4 = alloca [32 x ptr], align 16
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %4, i8 0, i64 256, i1 false)
  %6 = getelementptr inbounds i8, ptr %1, i64 12
  %7 = load i32, ptr %6, align 4, !tbaa !12
  %8 = add i32 %7, 1
  %.not102 = icmp eq i32 %8, 0
  br i1 %.not102, label %._crit_edge.thread, label %.lr.ph106

.lr.ph106:                                        ; preds = %3
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  br label %10

._crit_edge:                                      ; preds = %.loopexit
  br i1 %.4.ph, label %38, label %._crit_edge.thread

10:                                               ; preds = %.lr.ph106, %.loopexit
  %.053105 = phi ptr [ %5, %.lr.ph106 ], [ %.1, %.loopexit ]
  %.054104 = phi i1 [ false, %.lr.ph106 ], [ %.4.ph, %.loopexit ]
  %.060103 = phi i32 [ %8, %.lr.ph106 ], [ %.464.ph, %.loopexit ]
  %11 = add i32 %.060103, -1
  %12 = getelementptr inbounds i8, ptr %.053105, i64 24
  %13 = load i32, ptr %12, align 8, !tbaa !13
  %14 = icmp ugt i32 %13, %11
  br i1 %14, label %.preheader89, label %16, !prof !14

.preheader89:                                     ; preds = %10
  %15 = zext i32 %11 to i64
  br label %19

16:                                               ; preds = %10
  %17 = load ptr, ptr @stderr, align 8, !tbaa !15
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 368, ptr noundef nonnull @__func__.skiplist_remove, ptr noundef nonnull @.str.4) #6
  tail call void @abort() #7
  unreachable

19:                                               ; preds = %.preheader89, %23
  %.1 = phi ptr [ %22, %23 ], [ %.053105, %.preheader89 ]
  %20 = getelementptr inbounds i8, ptr %.1, i64 32
  %21 = getelementptr inbounds [0 x ptr], ptr %20, i64 0, i64 %15
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %.not79 = icmp eq ptr %22, null
  br i1 %.not79, label %.loopexit, label %23

23:                                               ; preds = %19
  %24 = load ptr, ptr %9, align 8, !tbaa !16
  %25 = load ptr, ptr %22, align 8, !tbaa !15
  %26 = tail call i32 %24(ptr noundef %2, ptr noundef %25) #5
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %19, label %.preheader

.preheader:                                       ; preds = %23
  %.not8098 = icmp eq i32 %11, 0
  br i1 %.not8098, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %32
  %indvars.iv = phi i64 [ %indvars.iv.next, %32 ], [ %15, %.preheader ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %28 = and i64 %indvars.iv.next, 4294967295
  %29 = getelementptr inbounds [0 x ptr], ptr %20, i64 0, i64 %28
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = icmp eq ptr %30, %22
  br i1 %31, label %32, label %.critedge.loopexit.split.loop.exit138

32:                                               ; preds = %.lr.ph
  %33 = getelementptr inbounds [32 x ptr], ptr %4, i64 0, i64 %indvars.iv
  store ptr %.1, ptr %33, align 8, !tbaa !15
  %34 = and i64 %indvars.iv.next, 4294967295
  %.not80 = icmp eq i64 %34, 0
  br i1 %.not80, label %.critedge, label %.lr.ph, !llvm.loop !17

.critedge.loopexit.split.loop.exit138:            ; preds = %.lr.ph
  %35 = trunc nuw i64 %indvars.iv to i32
  br label %.critedge

.critedge:                                        ; preds = %32, %.critedge.loopexit.split.loop.exit138, %.preheader
  %.262.lcssa = phi i32 [ 0, %.preheader ], [ %35, %.critedge.loopexit.split.loop.exit138 ], [ 0, %32 ]
  %36 = icmp eq i32 %26, 0
  %spec.select = select i1 %36, i1 true, i1 %.054104
  %.pre129 = zext i32 %.262.lcssa to i64
  br label %.loopexit

.loopexit:                                        ; preds = %19, %.critedge
  %.pre-phi = phi i64 [ %.pre129, %.critedge ], [ %15, %19 ]
  %.464.ph = phi i32 [ %.262.lcssa, %.critedge ], [ %11, %19 ]
  %.4.ph = phi i1 [ %spec.select, %.critedge ], [ %.054104, %19 ]
  %37 = getelementptr inbounds [32 x ptr], ptr %4, i64 0, i64 %.pre-phi
  store ptr %.1, ptr %37, align 8, !tbaa !15
  %.not = icmp eq i32 %.464.ph, 0
  br i1 %.not, label %._crit_edge, label %10, !llvm.loop !19

._crit_edge.thread:                               ; preds = %3, %._crit_edge
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %0, i8 0, i64 24, i1 false)
  br label %89

38:                                               ; preds = %._crit_edge
  %39 = getelementptr inbounds i8, ptr %.1, i64 32
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = load i32, ptr %6, align 4, !tbaa !12
  %42 = getelementptr inbounds i8, ptr %40, i64 32
  %43 = add i32 %41, 1
  br label %44

44:                                               ; preds = %38, %62
  %indvars.iv121 = phi i64 [ 0, %38 ], [ %indvars.iv.next122, %62 ]
  %45 = getelementptr inbounds [32 x ptr], ptr %4, i64 0, i64 %indvars.iv121
  %46 = load ptr, ptr %45, align 8, !tbaa !15
  %.not73 = icmp eq ptr %46, null
  br i1 %.not73, label %47, label %50, !prof !20

47:                                               ; preds = %44
  %48 = load ptr, ptr @stderr, align 8, !tbaa !15
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 390, ptr noundef nonnull @__func__.skiplist_remove, ptr noundef nonnull @.str.5) #6
  tail call void @abort() #7
  unreachable

50:                                               ; preds = %44
  %51 = getelementptr inbounds i8, ptr %46, i64 24
  %52 = load i32, ptr %51, align 8, !tbaa !13
  %53 = zext i32 %52 to i64
  %54 = icmp ult i64 %indvars.iv121, %53
  br i1 %54, label %58, label %55, !prof !14

55:                                               ; preds = %50
  %56 = load ptr, ptr @stderr, align 8, !tbaa !15
  %57 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 391, ptr noundef nonnull @__func__.skiplist_remove, ptr noundef nonnull @.str.6) #6
  tail call void @abort() #7
  unreachable

58:                                               ; preds = %50
  %59 = getelementptr inbounds i8, ptr %46, i64 32
  %60 = getelementptr inbounds [0 x ptr], ptr %59, i64 0, i64 %indvars.iv121
  %61 = load ptr, ptr %60, align 8, !tbaa !15
  %.not74 = icmp eq ptr %61, %40
  br i1 %.not74, label %62, label %65

62:                                               ; preds = %58
  %63 = getelementptr inbounds [0 x ptr], ptr %42, i64 0, i64 %indvars.iv121
  %64 = load ptr, ptr %63, align 8, !tbaa !15
  store ptr %64, ptr %60, align 8, !tbaa !15
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next122 to i32
  %exitcond.not = icmp eq i32 %43, %lftr.wideiv
  br i1 %exitcond.not, label %65, label %44, !llvm.loop !21

65:                                               ; preds = %58, %62
  %66 = getelementptr inbounds i8, ptr %40, i64 16
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %.not75 = icmp eq ptr %67, null
  %.pre = load ptr, ptr %42, align 8, !tbaa !15
  br i1 %.not75, label %70, label %68

68:                                               ; preds = %65
  %69 = getelementptr inbounds i8, ptr %67, i64 32
  store ptr %.pre, ptr %69, align 8, !tbaa !15
  br label %70

70:                                               ; preds = %68, %65
  %.not76 = icmp eq ptr %.pre, null
  br i1 %.not76, label %74, label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr %66, align 8, !tbaa !15
  %73 = getelementptr inbounds i8, ptr %.pre, i64 16
  store ptr %72, ptr %73, align 8, !tbaa !15
  br label %74

74:                                               ; preds = %71, %70
  %75 = load <2 x ptr>, ptr %40, align 8, !tbaa !15
  store <2 x ptr> %75, ptr %0, align 8, !tbaa !15
  %76 = getelementptr inbounds i8, ptr %0, i64 16
  store i8 1, ptr %76, align 8, !tbaa !22
  %77 = load ptr, ptr @dict_free_func, align 8, !tbaa !15
  tail call void %77(ptr noundef nonnull %40) #5
  %.pr = load i32, ptr %6, align 4, !tbaa !12
  %.not77110 = icmp eq i32 %.pr, 0
  br i1 %.not77110, label %.critedge2, label %.lr.ph112

.lr.ph112:                                        ; preds = %74
  %78 = load ptr, ptr %1, align 8, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %78, i64 32
  %80 = zext i32 %.pr to i64
  br label %81

81:                                               ; preds = %.lr.ph112, %85
  %indvars.iv125 = phi i64 [ %80, %.lr.ph112 ], [ %indvars.iv.next126, %85 ]
  %indvars.iv.next126 = add nsw i64 %indvars.iv125, -1
  %82 = and i64 %indvars.iv.next126, 4294967295
  %83 = getelementptr inbounds [0 x ptr], ptr %79, i64 0, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !15
  %.not78 = icmp eq ptr %84, null
  br i1 %.not78, label %85, label %.critedge2

85:                                               ; preds = %81
  %indvars127 = trunc i64 %indvars.iv.next126 to i32
  store i32 %indvars127, ptr %6, align 4, !tbaa !12
  %.not77 = icmp eq i32 %indvars127, 0
  br i1 %.not77, label %.critedge2, label %81, !llvm.loop !25

.critedge2:                                       ; preds = %81, %85, %74
  %86 = getelementptr inbounds i8, ptr %1, i64 24
  %87 = load i64, ptr %86, align 8, !tbaa !26
  %88 = add i64 %87, -1
  store i64 %88, ptr %86, align 8, !tbaa !26
  br label %89

89:                                               ; preds = %.critedge2, %._crit_edge.thread
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #5
  ret void
}

attributes #0 = { nofree 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 #1 = { noreturn 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { noreturn 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, !7, i64 0}
!6 = !{!"skiplist", !7, i64 0, !10, i64 8, !10, i64 12, !7, i64 16, !11, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!6, !10, i64 12}
!13 = !{!10, !10, i64 0}
!14 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!15 = !{!7, !7, i64 0}
!16 = !{!6, !7, i64 16}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!21 = distinct !{!21, !18}
!22 = !{!23, !24, i64 16}
!23 = !{!"", !7, i64 0, !7, i64 8, !24, i64 16}
!24 = !{!"_Bool", !8, i64 0}
!25 = distinct !{!25, !18}
!26 = !{!6, !11, i64 24}


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