; LLVM IR from seppo0010/rlite :: src (page_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.rl_data_type = type { ptr, ptr, ptr, ptr }
%struct.rl_skiplist_node = type { i64, double, i64, i64, [0 x %struct.rl_skiplist_node_level] }
%struct.rl_skiplist_node_level = type { i64, i64 }
%struct.rl_skiplist = type { i64, i64, i64, i64 }

@rl_data_type_skiplist_node = external global %struct.rl_data_type, align 8
@rl_data_type_skiplist = external global %struct.rl_data_type, align 8

; 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

declare i32 @rl_write(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

declare i32 @rl_read(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) #1

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

declare i32 @rl_multi_string_cmp_str(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_skiplist_delete(ptr noundef %0, ptr noundef %1, i64 noundef %2, double noundef %3, ptr noundef %4, i64 noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca double, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca [32 x ptr], align 16
  %14 = alloca [32 x i64], align 16
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i64 %2, ptr %9, align 8, !tbaa !9
  store double %3, ptr %10, align 8, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  store i64 %5, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 256, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 256, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = load double, ptr %10, align 8, !tbaa !11
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  %27 = load i64, ptr %12, align 8, !tbaa !9
  %28 = getelementptr inbounds [32 x ptr], ptr %13, i64 0, i64 0
  %29 = getelementptr inbounds [32 x i64], ptr %14, i64 0, i64 0
  %30 = call i32 @rl_skiplist_get_update(ptr noundef %23, ptr noundef %24, double noundef %25, i32 noundef 1, ptr noundef %26, i64 noundef %27, ptr noundef %28, ptr noundef %29, ptr noundef null)
  store i32 %30, ptr %15, align 4, !tbaa !13
  %31 = load i32, ptr %15, align 4, !tbaa !13
  %32 = icmp ne i32 0, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %6
  br label %266

34:                                               ; preds = %6
  %35 = getelementptr inbounds [32 x ptr], ptr %13, i64 0, i64 0
  %36 = load ptr, ptr %35, align 16, !tbaa !5
  %37 = getelementptr inbounds %struct.rl_skiplist_node, ptr %36, i32 0, i32 4
  %38 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %37, i64 0, i64 0
  %39 = getelementptr inbounds %struct.rl_skiplist_node_level, ptr %38, i32 0, i32 0
  %40 = load i64, ptr %39, align 8, !tbaa !15
  store i64 %40, ptr %19, align 8, !tbaa !9
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load i64, ptr %19, align 8, !tbaa !9
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = call i32 @rl_read(ptr noundef %41, ptr noundef @rl_data_type_skiplist_node, i64 noundef %42, ptr noundef %43, ptr noundef %16, i32 noundef 1)
  store i32 %44, ptr %15, align 4, !tbaa !13
  %45 = load i32, ptr %15, align 4, !tbaa !13
  %46 = icmp ne i32 2, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %34
  br label %266

48:                                               ; preds = %34
  %49 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %49, ptr %17, align 8, !tbaa !5
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load ptr, ptr %17, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.rl_skiplist_node, ptr %51, i32 0, i32 0
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = load i64, ptr %12, align 8, !tbaa !9
  %56 = call i32 @rl_multi_string_cmp_str(ptr noundef %50, i64 noundef %53, ptr noundef %54, i64 noundef %55, ptr noundef %20)
  store i32 %56, ptr %15, align 4, !tbaa !13
  %57 = load i32, ptr %15, align 4, !tbaa !13
  %58 = icmp ne i32 0, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %48
  br label %266

60:                                               ; preds = %48
  %61 = load ptr, ptr %17, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.rl_skiplist_node, ptr %61, i32 0, i32 1
  %63 = load double, ptr %62, align 8, !tbaa !11
  %64 = load double, ptr %10, align 8, !tbaa !11
  %65 = fcmp une double %63, %64
  br i1 %65, label %69, label %66

66:                                               ; preds = %60
  %67 = load i32, ptr %20, align 4, !tbaa !13
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %66, %60
  store i32 3, ptr %15, align 4, !tbaa !13
  br label %266

70:                                               ; preds = %66
  store i64 0, ptr %21, align 8, !tbaa !9
  br label %71

71:                                               ; preds = %141, %70
  %72 = load i64, ptr %21, align 8, !tbaa !9
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.rl_skiplist, ptr %73, i32 0, i32 3
  %75 = load i64, ptr %74, align 8, !tbaa !17
  %76 = icmp slt i64 %72, %75
  br i1 %76, label %77, label %144

77:                                               ; preds = %71
  %78 = load i64, ptr %21, align 8, !tbaa !9
  %79 = getelementptr inbounds [32 x ptr], ptr %13, i64 0, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.rl_skiplist_node, ptr %80, i32 0, i32 4
  %82 = load i64, ptr %21, align 8, !tbaa !9
  %83 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %81, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.rl_skiplist_node_level, ptr %83, i32 0, i32 0
  %85 = load i64, ptr %84, align 8, !tbaa !15
  %86 = load i64, ptr %19, align 8, !tbaa !9
  %87 = icmp eq i64 %85, %86
  br i1 %87, label %88, label %118

88:                                               ; preds = %77
  %89 = load ptr, ptr %17, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.rl_skiplist_node, ptr %89, i32 0, i32 4
  %91 = load i64, ptr %21, align 8, !tbaa !9
  %92 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %90, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.rl_skiplist_node_level, ptr %92, i32 0, i32 1
  %94 = load i64, ptr %93, align 8, !tbaa !19
  %95 = sub nsw i64 %94, 1
  %96 = load i64, ptr %21, align 8, !tbaa !9
  %97 = getelementptr inbounds [32 x ptr], ptr %13, i64 0, i64 %96
  %98 = load ptr, ptr %97, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.rl_skiplist_node, ptr %98, i32 0, i32 4
  %100 = load i64, ptr %21, align 8, !tbaa !9
  %101 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %99, i64 0, i64 %100
  %102 = getelementptr inbounds %struct.rl_skiplist_node_level, ptr %101, i32 0, i32 1
  %103 = load i64, ptr %102, align 8, !tbaa !19
  %104 = add nsw i64 %103, %95
  store i64 %104, ptr %102, align 8, !tbaa !19
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.rl_skiplist_node, ptr %105, i32 0, i32 4
  %107 = load i64, ptr %21, align 8, !tbaa !9
  %108 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %106, i64 0, i64 %107
  %109 = getelementptr inbounds %struct.rl_skiplist_node_level, ptr %108, i32 0, i32 0
  %110 = load i64, ptr %109, align 8, !tbaa !15
  %111 = load i64, ptr %21, align 8, !tbaa !9
  %112 = getelementptr inbounds [32 x ptr], ptr %13, i64 0, i64 %111
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.rl_skiplist_node, ptr %113, i32 0, i32 4
  %115 = load i64, ptr %21, align 8, !tbaa !9
  %116 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %114, i64 0, i64 %115
  %117 = getelementptr inbounds %struct.rl_skiplist_node_level, ptr %116, i32 0, i32 0
  store i64 %110, ptr %117, align 8, !tbaa !15
  br label %128

118:                                              ; preds = %77
  %119 = load i64, ptr %21, align 8, !tbaa !9
  %120 = getelementptr inbounds [32 x ptr], ptr %13, i64 0, i64 %119
  %121 = load ptr, ptr %120, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.rl_skiplist_node, ptr %121, i32 0, i32 4
  %123 = load i64, ptr %21, align 8, !tbaa !9
  %124 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %122, i64 0, i64 %123
  %125 = getelementptr inbounds %struct.rl_skiplist_node_level, ptr %124, i32 0, i32 1
  %126 = load i64, ptr %125, align 8, !tbaa !19
  %127 = add nsw i64 %126, -1
  store i64 %127, ptr %125, align 8, !tbaa !19
  br label %128

128:                                              ; preds = %118, %88
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = load i64, ptr %21, align 8, !tbaa !9
  %131 = getelementptr inbounds [32 x i64], ptr %14, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !9
  %133 = load i64, ptr %21, align 8, !tbaa !9
  %134 = getelementptr inbounds [32 x ptr], ptr %13, i64 0, i64 %133
  %135 = load ptr, ptr %134, align 8, !tbaa !5
  %136 = call i32 @rl_write(ptr noundef %129, ptr noundef @rl_data_type_skiplist_node, i64 noundef %132, ptr noundef %135)
  store i32 %136, ptr %15, align 4, !tbaa !13
  %137 = load i32, ptr %15, align 4, !tbaa !13
  %138 = icmp ne i32 0, %137
  br i1 %138, label %139, label %140

139:                                              ; preds = %128
  br label %266

140:                                              ; preds = %128
  br label %141

141:                                              ; preds = %140
  %142 = load i64, ptr %21, align 8, !tbaa !9
  %143 = add nsw i64 %142, 1
  store i64 %143, ptr %21, align 8, !tbaa !9
  br label %71, !llvm.loop !20

144:                                              ; preds = %71
  %145 = load ptr, ptr %17, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.rl_skiplist_node, ptr %145, i32 0, i32 4
  %147 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %146, i64 0, i64 0
  %148 = getelementptr inbounds %struct.rl_skiplist_node_level, ptr %147, i32 0, i32 0
  %149 = load i64, ptr %148, align 8, !tbaa !15
  store i64 %149, ptr %22, align 8, !tbaa !9
  %150 = load i64, ptr %22, align 8, !tbaa !9
  %151 = icmp ne i64 %150, 0
  br i1 %151, label %152, label %175

152:                                              ; preds = %144
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = load i64, ptr %22, align 8, !tbaa !9
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  %156 = call i32 @rl_read(ptr noundef %153, ptr noundef @rl_data_type_skiplist_node, i64 noundef %154, ptr noundef %155, ptr noundef %16, i32 noundef 1)
  store i32 %156, ptr %15, align 4, !tbaa !13
  %157 = load i32, ptr %15, align 4, !tbaa !13
  %158 = icmp ne i32 2, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %152
  br label %266

160:                                              ; preds = %152
  %161 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %161, ptr %18, align 8, !tbaa !5
  %162 = load ptr, ptr %17, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.rl_skiplist_node, ptr %162, i32 0, i32 2
  %164 = load i64, ptr %163, align 8, !tbaa !9
  %165 = load ptr, ptr %18, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.rl_skiplist_node, ptr %165, i32 0, i32 2
  store i64 %164, ptr %166, align 8, !tbaa !9
  %167 = load ptr, ptr %7, align 8, !tbaa !5
  %168 = load i64, ptr %22, align 8, !tbaa !9
  %169 = load ptr, ptr %18, align 8, !tbaa !5
  %170 = call i32 @rl_write(ptr noundef %167, ptr noundef @rl_data_type_skiplist_node, i64 noundef %168, ptr noundef %169)
  store i32 %170, ptr %15, align 4, !tbaa !13
  %171 = load i32, ptr %15, align 4, !tbaa !13
  %172 = icmp ne i32 0, %171
  br i1 %172, label %173, label %174

173:                                              ; preds = %160
  br label %266

174:                                              ; preds = %160
  br label %181

175:                                              ; preds = %144
  %176 = load ptr, ptr %17, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.rl_skiplist_node, ptr %176, i32 0, i32 2
  %178 = load i64, ptr %177, align 8, !tbaa !9
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.rl_skiplist, ptr %179, i32 0, i32 1
  store i64 %178, ptr %180, align 8, !tbaa !22
  br label %181

181:                                              ; preds = %175, %174
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = load ptr, ptr %17, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.rl_skiplist_node, ptr %183, i32 0, i32 0
  %185 = load i64, ptr %184, align 8, !tbaa !9
  %186 = call i32 @rl_multi_string_delete(ptr noundef %182, i64 noundef %185)
  store i32 %186, ptr %15, align 4, !tbaa !13
  %187 = load i32, ptr %15, align 4, !tbaa !13
  %188 = icmp ne i32 0, %187
  br i1 %188, label %189, label %190

189:                                              ; preds = %181
  br label %266

190:                                              ; preds = %181
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = load i64, ptr %19, align 8, !tbaa !9
  %193 = call i32 @rl_delete(ptr noundef %191, i64 noundef %192)
  store i32 %193, ptr %15, align 4, !tbaa !13
  %194 = load i32, ptr %15, align 4, !tbaa !13
  %195 = icmp ne i32 0, %194
  br i1 %195, label %196, label %197

196:                                              ; preds = %190
  br label %266

197:                                              ; preds = %190
  %198 = load ptr, ptr %8, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.rl_skiplist, ptr %198, i32 0, i32 0
  %200 = load i64, ptr %199, align 8, !tbaa !23
  store i64 %200, ptr %19, align 8, !tbaa !9
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = load ptr, ptr %8, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.rl_skiplist, ptr %202, i32 0, i32 0
  %204 = load i64, ptr %203, align 8, !tbaa !23
  %205 = load ptr, ptr %8, align 8, !tbaa !5
  %206 = call i32 @rl_read(ptr noundef %201, ptr noundef @rl_data_type_skiplist_node, i64 noundef %204, ptr noundef %205, ptr noundef %16, i32 noundef 1)
  store i32 %206, ptr %15, align 4, !tbaa !13
  %207 = load i32, ptr %15, align 4, !tbaa !13
  %208 = icmp ne i32 2, %207
  br i1 %208, label %209, label %210

209:                                              ; preds = %197
  br label %266

210:                                              ; preds = %197
  %211 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %211, ptr %17, align 8, !tbaa !5
  br label %212

212:                                              ; preds = %230, %210
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.rl_skiplist, ptr %213, i32 0, i32 3
  %215 = load i64, ptr %214, align 8, !tbaa !17
  %216 = icmp sgt i64 %215, 0
  br i1 %216, label %217, label %228

217:                                              ; preds = %212
  %218 = load ptr, ptr %17, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.rl_skiplist_node, ptr %218, i32 0, i32 4
  %220 = load ptr, ptr %8, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.rl_skiplist, ptr %220, i32 0, i32 3
  %222 = load i64, ptr %221, align 8, !tbaa !17
  %223 = sub nsw i64 %222, 1
  %224 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %219, i64 0, i64 %223
  %225 = getelementptr inbounds %struct.rl_skiplist_node_level, ptr %224, i32 0, i32 0
  %226 = load i64, ptr %225, align 8, !tbaa !15
  %227 = icmp eq i64 %226, 0
  br label %228

228:                                              ; preds = %217, %212
  %229 = phi i1 [ false, %212 ], [ %227, %217 ]
  br i1 %229, label %230, label %235

230:                                              ; preds = %228
  %231 = load ptr, ptr %8, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.rl_skiplist, ptr %231, i32 0, i32 3
  %233 = load i64, ptr %232, align 8, !tbaa !17
  %234 = add nsw i64 %233, -1
  store i64 %234, ptr %232, align 8, !tbaa !17
  br label %212, !llvm.loop !24

235:                                              ; preds = %228
  %236 = load ptr, ptr %8, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.rl_skiplist, ptr %236, i32 0, i32 2
  %238 = load i64, ptr %237, align 8, !tbaa !25
  %239 = add nsw i64 %238, -1
  store i64 %239, ptr %237, align 8, !tbaa !25
  %240 = icmp sgt i64 %238, 1
  br i1 %240, label %241, label %250

241:                                              ; preds = %235
  %242 = load ptr, ptr %7, align 8, !tbaa !5
  %243 = load i64, ptr %9, align 8, !tbaa !9
  %244 = load ptr, ptr %8, align 8, !tbaa !5
  %245 = call i32 @rl_write(ptr noundef %242, ptr noundef @rl_data_type_skiplist, i64 noundef %243, ptr noundef %244)
  store i32 %245, ptr %15, align 4, !tbaa !13
  %246 = load i32, ptr %15, align 4, !tbaa !13
  %247 = icmp ne i32 0, %246
  br i1 %247, label %248, label %249

248:                                              ; preds = %241
  br label %266

249:                                              ; preds = %241
  store i32 0, ptr %15, align 4, !tbaa !13
  br label %265

250:                                              ; preds = %235
  %251 = load ptr, ptr %7, align 8, !tbaa !5
  %252 = load i64, ptr %19, align 8, !tbaa !9
  %253 = call i32 @rl_delete(ptr noundef %251, i64 noundef %252)
  store i32 %253, ptr %15, align 4, !tbaa !13
  %254 = load i32, ptr %15, align 4, !tbaa !13
  %255 = icmp ne i32 0, %254
  br i1 %255, label %256, label %257

256:                                              ; preds = %250
  br label %266

257:                                              ; preds = %250
  %258 = load ptr, ptr %7, align 8, !tbaa !5
  %259 = load i64, ptr %9, align 8, !tbaa !9
  %260 = call i32 @rl_delete(ptr noundef %258, i64 noundef %259)
  store i32 %260, ptr %15, align 4, !tbaa !13
  %261 = load i32, ptr %15, align 4, !tbaa !13
  %262 = icmp ne i32 0, %261
  br i1 %262, label %263, label %264

263:                                              ; preds = %257
  br label %266

264:                                              ; preds = %257
  store i32 10, ptr %15, align 4, !tbaa !13
  br label %265

265:                                              ; preds = %264, %249
  br label %266

266:                                              ; preds = %265, %263, %256, %248, %209, %196, %189, %173, %159, %139, %69, %59, %47, %33
  %267 = load i32, ptr %15, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 256, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 256, ptr %13) #3
  ret i32 %267
}

declare i32 @rl_multi_string_delete(ptr noundef, i64 noundef) #1

declare i32 @rl_delete(ptr noundef, i64 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"rl_skiplist_node_level", !10, i64 0, !10, i64 8}
!17 = !{!18, !10, i64 24}
!18 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!19 = !{!16, !10, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!18, !10, i64 8}
!23 = !{!18, !10, i64 0}
!24 = distinct !{!24, !21}
!25 = !{!18, !10, i64 16}


; 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.rl_data_type = type { ptr, ptr, ptr, ptr }
%struct.rl_skiplist_node_level = type { i64, i64 }

@rl_data_type_skiplist_node = external global %struct.rl_data_type, align 8
@rl_data_type_skiplist = external global %struct.rl_data_type, align 8

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

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

declare i32 @rl_write(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @rl_read(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @rl_skiplist_get_update(ptr noundef, ptr noundef, double noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @rl_multi_string_cmp_str(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_skiplist_delete(ptr noundef %0, ptr noundef %1, i64 noundef %2, double noundef %3, ptr noundef %4, i64 noundef %5) local_unnamed_addr #2 {
  %7 = alloca [32 x ptr], align 16
  %8 = alloca [32 x i64], align 16
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %8) #3
  %11 = call i32 @rl_skiplist_get_update(ptr noundef %0, ptr noundef %1, double noundef %3, i32 noundef 1, ptr noundef %4, i64 noundef %5, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef null)
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %12, label %.loopexit

12:                                               ; preds = %6
  %13 = load ptr, ptr %7, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 32
  %15 = load i64, ptr %14, align 8, !tbaa !9
  %16 = call i32 @rl_read(ptr noundef %0, ptr noundef nonnull @rl_data_type_skiplist_node, i64 noundef %15, ptr noundef %1, ptr noundef nonnull %9, i32 noundef 1) #3
  %.not92 = icmp eq i32 %16, 2
  br i1 %.not92, label %17, label %.loopexit

17:                                               ; preds = %12
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = load i64, ptr %18, align 8, !tbaa !12
  %20 = call i32 @rl_multi_string_cmp_str(ptr noundef %0, i64 noundef %19, ptr noundef %4, i64 noundef %5, ptr noundef nonnull %10) #3
  %.not93 = icmp eq i32 %20, 0
  br i1 %.not93, label %21, label %.loopexit

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %18, i64 8
  %23 = load double, ptr %22, align 8, !tbaa !13
  %24 = fcmp une double %23, %3
  %25 = load i32, ptr %10, align 4
  %26 = icmp ne i32 %25, 0
  %or.cond = select i1 %24, i1 true, i1 %26
  br i1 %or.cond, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %21
  %27 = getelementptr inbounds i8, ptr %1, i64 24
  %28 = load i64, ptr %27, align 8, !tbaa !15
  %29 = icmp sgt i64 %28, 0
  br i1 %29, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %30 = getelementptr inbounds i8, ptr %18, i64 32
  br label %35

31:                                               ; preds = %55
  %32 = add nuw nsw i64 %.079105, 1
  %33 = load i64, ptr %27, align 8, !tbaa !15
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %35, label %._crit_edge, !llvm.loop !17

35:                                               ; preds = %.lr.ph, %31
  %.079105 = phi i64 [ 0, %.lr.ph ], [ %32, %31 ]
  %36 = getelementptr inbounds [32 x ptr], ptr %7, i64 0, i64 %.079105
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 32
  %39 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %38, i64 0, i64 %.079105
  %40 = load i64, ptr %39, align 8, !tbaa !9
  %41 = icmp eq i64 %40, %15
  br i1 %41, label %42, label %51

42:                                               ; preds = %35
  %43 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %30, i64 0, i64 %.079105
  %44 = getelementptr inbounds i8, ptr %43, i64 8
  %45 = load i64, ptr %44, align 8, !tbaa !19
  %46 = add nsw i64 %45, -1
  %47 = getelementptr inbounds i8, ptr %39, i64 8
  %48 = load i64, ptr %47, align 8, !tbaa !19
  %49 = add nsw i64 %46, %48
  store i64 %49, ptr %47, align 8, !tbaa !19
  %50 = load i64, ptr %43, align 8, !tbaa !9
  store i64 %50, ptr %39, align 8, !tbaa !9
  br label %55

51:                                               ; preds = %35
  %52 = getelementptr inbounds i8, ptr %39, i64 8
  %53 = load i64, ptr %52, align 8, !tbaa !19
  %54 = add nsw i64 %53, -1
  store i64 %54, ptr %52, align 8, !tbaa !19
  br label %55

55:                                               ; preds = %51, %42
  %56 = getelementptr inbounds [32 x i64], ptr %8, i64 0, i64 %.079105
  %57 = load i64, ptr %56, align 8, !tbaa !12
  %58 = call i32 @rl_write(ptr noundef %0, ptr noundef nonnull @rl_data_type_skiplist_node, i64 noundef %57, ptr noundef nonnull %37) #3
  %.not102 = icmp eq i32 %58, 0
  br i1 %.not102, label %31, label %.loopexit

._crit_edge:                                      ; preds = %31, %.preheader
  %59 = getelementptr inbounds i8, ptr %18, i64 32
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %.not94 = icmp eq i64 %60, 0
  br i1 %.not94, label %69, label %61

61:                                               ; preds = %._crit_edge
  %62 = call i32 @rl_read(ptr noundef %0, ptr noundef nonnull @rl_data_type_skiplist_node, i64 noundef %60, ptr noundef nonnull %1, ptr noundef nonnull %9, i32 noundef 1) #3
  %.not95 = icmp eq i32 %62, 2
  br i1 %.not95, label %63, label %.loopexit

63:                                               ; preds = %61
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %18, i64 16
  %66 = load i64, ptr %65, align 8, !tbaa !12
  %67 = getelementptr inbounds i8, ptr %64, i64 16
  store i64 %66, ptr %67, align 8, !tbaa !12
  %68 = call i32 @rl_write(ptr noundef %0, ptr noundef nonnull @rl_data_type_skiplist_node, i64 noundef %60, ptr noundef %64) #3
  %.not96 = icmp eq i32 %68, 0
  br i1 %.not96, label %73, label %.loopexit

69:                                               ; preds = %._crit_edge
  %70 = getelementptr inbounds i8, ptr %18, i64 16
  %71 = load i64, ptr %70, align 8, !tbaa !12
  %72 = getelementptr inbounds i8, ptr %1, i64 8
  store i64 %71, ptr %72, align 8, !tbaa !20
  br label %73

73:                                               ; preds = %63, %69
  %74 = load i64, ptr %18, align 8, !tbaa !12
  %75 = call i32 @rl_multi_string_delete(ptr noundef %0, i64 noundef %74) #3
  %.not97 = icmp eq i32 %75, 0
  br i1 %.not97, label %76, label %.loopexit

76:                                               ; preds = %73
  %77 = call i32 @rl_delete(ptr noundef %0, i64 noundef %15) #3
  %.not98 = icmp eq i32 %77, 0
  br i1 %.not98, label %78, label %.loopexit

78:                                               ; preds = %76
  %79 = load i64, ptr %1, align 8, !tbaa !21
  %80 = call i32 @rl_read(ptr noundef %0, ptr noundef nonnull @rl_data_type_skiplist_node, i64 noundef %79, ptr noundef nonnull %1, ptr noundef nonnull %9, i32 noundef 1) #3
  %.not99 = icmp eq i32 %80, 2
  br i1 %.not99, label %81, label %.loopexit

81:                                               ; preds = %78
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %.pr = load i64, ptr %27, align 8, !tbaa !15
  %83 = getelementptr inbounds i8, ptr %82, i64 32
  %84 = icmp sgt i64 %.pr, 0
  br i1 %84, label %.lr.ph107, label %.critedge

.lr.ph107:                                        ; preds = %81, %90
  %85 = phi i64 [ %86, %90 ], [ %.pr, %81 ]
  %86 = add nsw i64 %85, -1
  %87 = getelementptr inbounds [0 x %struct.rl_skiplist_node_level], ptr %83, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !9
  %89 = icmp eq i64 %88, 0
  br i1 %89, label %90, label %.critedge

90:                                               ; preds = %.lr.ph107
  store i64 %86, ptr %27, align 8, !tbaa !15
  %91 = icmp ugt i64 %85, 1
  br i1 %91, label %.lr.ph107, label %.critedge, !llvm.loop !22

.critedge:                                        ; preds = %.lr.ph107, %90, %81
  %92 = getelementptr inbounds i8, ptr %1, i64 16
  %93 = load i64, ptr %92, align 8, !tbaa !23
  %94 = add nsw i64 %93, -1
  store i64 %94, ptr %92, align 8, !tbaa !23
  %95 = icmp sgt i64 %93, 1
  br i1 %95, label %96, label %98

96:                                               ; preds = %.critedge
  %97 = call i32 @rl_write(ptr noundef %0, ptr noundef nonnull @rl_data_type_skiplist, i64 noundef %2, ptr noundef nonnull %1) #3
  br label %.loopexit

98:                                               ; preds = %.critedge
  %99 = call i32 @rl_delete(ptr noundef %0, i64 noundef %79) #3
  %.not100 = icmp eq i32 %99, 0
  br i1 %.not100, label %100, label %.loopexit

100:                                              ; preds = %98
  %101 = call i32 @rl_delete(ptr noundef %0, i64 noundef %2) #3
  %.not101 = icmp eq i32 %101, 0
  %spec.store.select2 = select i1 %.not101, i32 10, i32 %101
  br label %.loopexit

.loopexit:                                        ; preds = %55, %21, %100, %96, %98, %78, %76, %73, %63, %61, %17, %12, %6
  %.0 = phi i32 [ %11, %6 ], [ %16, %12 ], [ %20, %17 ], [ %62, %61 ], [ %68, %63 ], [ %75, %73 ], [ %77, %76 ], [ %80, %78 ], [ %97, %96 ], [ %99, %98 ], [ %spec.store.select2, %100 ], [ 3, %21 ], [ %58, %55 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %7) #3
  ret i32 %.0
}

declare i32 @rl_multi_string_delete(ptr noundef, i64 noundef) local_unnamed_addr #1

declare i32 @rl_delete(ptr noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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, !11, i64 0}
!10 = !{!"rl_skiplist_node_level", !11, i64 0, !11, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !11, i64 24}
!16 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !11, i64 8}
!20 = !{!16, !11, i64 8}
!21 = !{!16, !11, i64 0}
!22 = distinct !{!22, !18}
!23 = !{!16, !11, i64 16}


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