; LLVM IR from seppo0010/rlite :: src (rlite)

; 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.rlite = type { i64, i64, i32, ptr, i64, i64, i64, ptr, i32, i32, i32, i32, ptr, i64, i64, ptr, i64, i64, ptr, ptr, ptr, ptr }
%struct.rl_page = type { i64, ptr, ptr }

@rl_data_type_header = external dso_local 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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_ensure_pages(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_discard(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_write(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %12 = load i64, ptr %7, align 8, !tbaa !9
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.rlite, ptr %13, i32 0, i32 5
  %15 = load i64, ptr %14, align 8, !tbaa !11
  %16 = icmp eq i64 %12, %15
  br i1 %16, label %17, label %30

17:                                               ; preds = %4
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = call i32 @rl_alloc_page_number(ptr noundef %18, ptr noundef null)
  store i32 %19, ptr %11, align 4, !tbaa !14
  %20 = load i32, ptr %11, align 4, !tbaa !14
  %21 = icmp ne i32 0, %20
  br i1 %21, label %22, label %23

22:                                               ; preds = %17
  br label %249

23:                                               ; preds = %17
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call i32 @rl_write(ptr noundef %24, ptr noundef @rl_data_type_header, i64 noundef 0, ptr noundef null)
  store i32 %25, ptr %11, align 4, !tbaa !14
  %26 = load i32, ptr %11, align 4, !tbaa !14
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %23
  br label %249

29:                                               ; preds = %23
  br label %30

30:                                               ; preds = %29, %4
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load i64, ptr %7, align 8, !tbaa !9
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.rlite, ptr %34, i32 0, i32 18
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.rlite, ptr %37, i32 0, i32 17
  %39 = load i64, ptr %38, align 8, !tbaa !16
  %40 = call i32 @rl_search_cache(ptr noundef %31, ptr noundef %32, i64 noundef %33, ptr noundef null, ptr noundef %10, ptr noundef null, ptr noundef %36, i64 noundef %39)
  store i32 %40, ptr %11, align 4, !tbaa !14
  %41 = load i32, ptr %11, align 4, !tbaa !14
  %42 = icmp eq i32 %41, 2
  br i1 %42, label %43, label %103

43:                                               ; preds = %30
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.rlite, ptr %45, i32 0, i32 18
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  %48 = load i64, ptr %10, align 8, !tbaa !9
  %49 = getelementptr inbounds ptr, ptr %47, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.rl_page, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !17
  %53 = icmp ne ptr %44, %52
  br i1 %53, label %54, label %102

54:                                               ; preds = %43
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.rlite, ptr %55, i32 0, i32 18
  %57 = load ptr, ptr %56, align 8, !tbaa !15
  %58 = load i64, ptr %10, align 8, !tbaa !9
  %59 = getelementptr inbounds ptr, ptr %57, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.rl_page, ptr %60, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !17
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %85

64:                                               ; preds = %54
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.rlite, ptr %65, i32 0, i32 18
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = load i64, ptr %10, align 8, !tbaa !9
  %69 = getelementptr inbounds ptr, ptr %67, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.rl_page, ptr %70, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !19
  %73 = getelementptr inbounds %struct.rl_data_type, ptr %72, i32 0, i32 3
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.rlite, ptr %76, i32 0, i32 18
  %78 = load ptr, ptr %77, align 8, !tbaa !15
  %79 = load i64, ptr %10, align 8, !tbaa !9
  %80 = getelementptr inbounds ptr, ptr %78, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.rl_page, ptr %81, i32 0, i32 2
  %83 = load ptr, ptr %82, align 8, !tbaa !17
  %84 = call i32 %74(ptr noundef %75, ptr noundef %83)
  br label %85

85:                                               ; preds = %64, %54
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.rlite, ptr %87, i32 0, i32 18
  %89 = load ptr, ptr %88, align 8, !tbaa !15
  %90 = load i64, ptr %10, align 8, !tbaa !9
  %91 = getelementptr inbounds ptr, ptr %89, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.rl_page, ptr %92, i32 0, i32 2
  store ptr %86, ptr %93, align 8, !tbaa !17
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.rlite, ptr %95, i32 0, i32 18
  %97 = load ptr, ptr %96, align 8, !tbaa !15
  %98 = load i64, ptr %10, align 8, !tbaa !9
  %99 = getelementptr inbounds ptr, ptr %97, i64 %98
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.rl_page, ptr %100, i32 0, i32 1
  store ptr %94, ptr %101, align 8, !tbaa !19
  br label %102

102:                                              ; preds = %85, %43
  store i32 0, ptr %11, align 4, !tbaa !14
  br label %248

103:                                              ; preds = %30
  %104 = load i32, ptr %11, align 4, !tbaa !14
  %105 = icmp eq i32 %104, 3
  br i1 %105, label %106, label %247

106:                                              ; preds = %103
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.rlite, ptr %107, i32 0, i32 8
  %109 = load i32, ptr %108, align 8, !tbaa !22
  %110 = icmp eq i32 %109, 1
  br i1 %110, label %111, label %118

111:                                              ; preds = %106
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = call i32 @file_driver_fp(ptr noundef %112)
  store i32 %113, ptr %11, align 4, !tbaa !14
  %114 = load i32, ptr %11, align 4, !tbaa !14
  %115 = icmp ne i32 0, %114
  br i1 %115, label %116, label %117

116:                                              ; preds = %111
  br label %249

117:                                              ; preds = %111
  br label %118

118:                                              ; preds = %117, %106
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = call i32 @rl_ensure_pages(ptr noundef %119)
  %121 = call noalias ptr @malloc(i64 noundef 24) #6
  store ptr %121, ptr %9, align 8, !tbaa !5
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %125, label %124

124:                                              ; preds = %118
  store i32 4, ptr %11, align 4, !tbaa !14
  br label %249

125:                                              ; preds = %118
  %126 = load i64, ptr %7, align 8, !tbaa !9
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.rl_page, ptr %127, i32 0, i32 0
  store i64 %126, ptr %128, align 8, !tbaa !23
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.rl_page, ptr %130, i32 0, i32 1
  store ptr %129, ptr %131, align 8, !tbaa !19
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.rl_page, ptr %133, i32 0, i32 2
  store ptr %132, ptr %134, align 8, !tbaa !17
  %135 = load i64, ptr %10, align 8, !tbaa !9
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.rlite, ptr %136, i32 0, i32 17
  %138 = load i64, ptr %137, align 8, !tbaa !16
  %139 = icmp slt i64 %135, %138
  br i1 %139, label %140, label %158

140:                                              ; preds = %125
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.rlite, ptr %141, i32 0, i32 18
  %143 = load ptr, ptr %142, align 8, !tbaa !15
  %144 = load i64, ptr %10, align 8, !tbaa !9
  %145 = add nsw i64 %144, 1
  %146 = getelementptr inbounds ptr, ptr %143, i64 %145
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.rlite, ptr %147, i32 0, i32 18
  %149 = load ptr, ptr %148, align 8, !tbaa !15
  %150 = load i64, ptr %10, align 8, !tbaa !9
  %151 = getelementptr inbounds ptr, ptr %149, i64 %150
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.rlite, ptr %152, i32 0, i32 17
  %154 = load i64, ptr %153, align 8, !tbaa !16
  %155 = load i64, ptr %10, align 8, !tbaa !9
  %156 = sub nsw i64 %154, %155
  %157 = mul i64 8, %156
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %146, ptr align 8 %151, i64 %157, i1 false)
  br label %158

158:                                              ; preds = %140, %125
  %159 = load ptr, ptr %9, align 8, !tbaa !5
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.rlite, ptr %160, i32 0, i32 18
  %162 = load ptr, ptr %161, align 8, !tbaa !15
  %163 = load i64, ptr %10, align 8, !tbaa !9
  %164 = getelementptr inbounds ptr, ptr %162, i64 %163
  store ptr %159, ptr %164, align 8, !tbaa !5
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.rlite, ptr %165, i32 0, i32 17
  %167 = load i64, ptr %166, align 8, !tbaa !16
  %168 = add nsw i64 %167, 1
  store i64 %168, ptr %166, align 8, !tbaa !16
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = load i64, ptr %7, align 8, !tbaa !9
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.rlite, ptr %172, i32 0, i32 15
  %174 = load ptr, ptr %173, align 8, !tbaa !24
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.rlite, ptr %175, i32 0, i32 14
  %177 = load i64, ptr %176, align 8, !tbaa !25
  %178 = call i32 @rl_search_cache(ptr noundef %169, ptr noundef %170, i64 noundef %171, ptr noundef null, ptr noundef %10, ptr noundef null, ptr noundef %174, i64 noundef %177)
  store i32 %178, ptr %11, align 4, !tbaa !14
  %179 = load i32, ptr %11, align 4, !tbaa !14
  %180 = icmp eq i32 %179, 2
  br i1 %180, label %181, label %241

181:                                              ; preds = %158
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.rlite, ptr %182, i32 0, i32 15
  %184 = load ptr, ptr %183, align 8, !tbaa !24
  %185 = load i64, ptr %10, align 8, !tbaa !9
  %186 = getelementptr inbounds ptr, ptr %184, i64 %185
  %187 = load ptr, ptr %186, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.rl_page, ptr %187, i32 0, i32 2
  %189 = load ptr, ptr %188, align 8, !tbaa !17
  %190 = load ptr, ptr %8, align 8, !tbaa !5
  %191 = icmp ne ptr %189, %190
  br i1 %191, label %192, label %213

192:                                              ; preds = %181
  %193 = load ptr, ptr %5, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.rlite, ptr %193, i32 0, i32 15
  %195 = load ptr, ptr %194, align 8, !tbaa !24
  %196 = load i64, ptr %10, align 8, !tbaa !9
  %197 = getelementptr inbounds ptr, ptr %195, i64 %196
  %198 = load ptr, ptr %197, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.rl_page, ptr %198, i32 0, i32 1
  %200 = load ptr, ptr %199, align 8, !tbaa !19
  %201 = getelementptr inbounds %struct.rl_data_type, ptr %200, i32 0, i32 3
  %202 = load ptr, ptr %201, align 8, !tbaa !20
  %203 = load ptr, ptr %5, align 8, !tbaa !5
  %204 = load ptr, ptr %5, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.rlite, ptr %204, i32 0, i32 15
  %206 = load ptr, ptr %205, align 8, !tbaa !24
  %207 = load i64, ptr %10, align 8, !tbaa !9
  %208 = getelementptr inbounds ptr, ptr %206, i64 %207
  %209 = load ptr, ptr %208, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.rl_page, ptr %209, i32 0, i32 2
  %211 = load ptr, ptr %210, align 8, !tbaa !17
  %212 = call i32 %202(ptr noundef %203, ptr noundef %211)
  br label %213

213:                                              ; preds = %192, %181
  %214 = load ptr, ptr %5, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.rlite, ptr %214, i32 0, i32 15
  %216 = load ptr, ptr %215, align 8, !tbaa !24
  %217 = load i64, ptr %10, align 8, !tbaa !9
  %218 = getelementptr inbounds ptr, ptr %216, i64 %217
  %219 = load ptr, ptr %218, align 8, !tbaa !5
  call void @free(ptr noundef %219) #5
  %220 = load ptr, ptr %5, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.rlite, ptr %220, i32 0, i32 15
  %222 = load ptr, ptr %221, align 8, !tbaa !24
  %223 = load i64, ptr %10, align 8, !tbaa !9
  %224 = getelementptr inbounds ptr, ptr %222, i64 %223
  %225 = load ptr, ptr %5, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.rlite, ptr %225, i32 0, i32 15
  %227 = load ptr, ptr %226, align 8, !tbaa !24
  %228 = load i64, ptr %10, align 8, !tbaa !9
  %229 = add nsw i64 %228, 1
  %230 = getelementptr inbounds ptr, ptr %227, i64 %229
  %231 = load ptr, ptr %5, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.rlite, ptr %231, i32 0, i32 14
  %233 = load i64, ptr %232, align 8, !tbaa !25
  %234 = load i64, ptr %10, align 8, !tbaa !9
  %235 = sub nsw i64 %233, %234
  %236 = mul i64 8, %235
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %224, ptr align 8 %230, i64 %236, i1 false)
  %237 = load ptr, ptr %5, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.rlite, ptr %237, i32 0, i32 14
  %239 = load i64, ptr %238, align 8, !tbaa !25
  %240 = add nsw i64 %239, -1
  store i64 %240, ptr %238, align 8, !tbaa !25
  store i32 0, ptr %11, align 4, !tbaa !14
  br label %246

241:                                              ; preds = %158
  %242 = load i32, ptr %11, align 4, !tbaa !14
  %243 = icmp ne i32 %242, 3
  br i1 %243, label %244, label %245

244:                                              ; preds = %241
  br label %249

245:                                              ; preds = %241
  br label %246

246:                                              ; preds = %245, %213
  store i32 0, ptr %11, align 4, !tbaa !14
  br label %247

247:                                              ; preds = %246, %103
  br label %248

248:                                              ; preds = %247, %102
  br label %249

249:                                              ; preds = %248, %244, %124, %116, %28, %22
  %250 = load i32, ptr %11, align 4, !tbaa !14
  %251 = icmp ne i32 %250, 0
  br i1 %251, label %252, label %272

252:                                              ; preds = %249
  %253 = load ptr, ptr %8, align 8, !tbaa !5
  %254 = icmp ne ptr %253, null
  br i1 %254, label %255, label %265

255:                                              ; preds = %252
  %256 = load ptr, ptr %6, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.rl_data_type, ptr %256, i32 0, i32 3
  %258 = load ptr, ptr %257, align 8, !tbaa !20
  %259 = load ptr, ptr %5, align 8, !tbaa !5
  %260 = load ptr, ptr %8, align 8, !tbaa !5
  %261 = call i32 %258(ptr noundef %259, ptr noundef %260)
  %262 = load ptr, ptr %5, align 8, !tbaa !5
  %263 = load i64, ptr %7, align 8, !tbaa !9
  %264 = call i32 @rl_purge_cache(ptr noundef %262, i64 noundef %263)
  br label %265

265:                                              ; preds = %255, %252
  %266 = load i64, ptr %7, align 8, !tbaa !9
  %267 = icmp ne i64 %266, 0
  br i1 %267, label %268, label %271

268:                                              ; preds = %265
  %269 = load ptr, ptr %5, align 8, !tbaa !5
  %270 = call i32 @rl_discard(ptr noundef %269)
  br label %271

271:                                              ; preds = %268, %265
  br label %272

272:                                              ; preds = %271, %249
  %273 = load i32, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret i32 %273
}

; Function Attrs: nounwind uwtable
declare hidden i32 @file_driver_fp(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @rl_search_cache(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) #3

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

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

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

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

!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, !10, i64 40}
!12 = !{!"rlite", !10, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !6, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !6, i64 80, !10, i64 88, !10, i64 96, !6, i64 104, !10, i64 112, !10, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !6, i64 128}
!16 = !{!12, !10, i64 120}
!17 = !{!18, !6, i64 16}
!18 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!18, !6, i64 8}
!20 = !{!21, !6, i64 24}
!21 = !{!"rl_data_type", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!12, !13, i64 64}
!23 = !{!18, !10, i64 0}
!24 = !{!12, !6, i64 104}
!25 = !{!12, !10, i64 96}


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

@rl_data_type_header = external dso_local 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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_ensure_pages(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_discard(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_write(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %6 = getelementptr inbounds i8, ptr %0, i64 40
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %8 = icmp eq i64 %7, %2
  br i1 %8, label %9, label %13

9:                                                ; preds = %4
  %10 = tail call i32 @rl_alloc_page_number(ptr noundef nonnull %0, ptr noundef null)
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %.thread

11:                                               ; preds = %9
  %12 = tail call i32 @rl_write(ptr noundef nonnull %0, ptr noundef nonnull @rl_data_type_header, i64 noundef 0, ptr noundef null)
  %.not78 = icmp eq i32 %12, 0
  br i1 %.not78, label %13, label %.thread

13:                                               ; preds = %11, %4
  %14 = getelementptr inbounds i8, ptr %0, i64 128
  %15 = load ptr, ptr %14, align 8, !tbaa !12
  %16 = getelementptr inbounds i8, ptr %0, i64 120
  %17 = load i64, ptr %16, align 8, !tbaa !13
  %18 = call i32 @rl_search_cache(ptr noundef nonnull %0, ptr noundef %1, i64 noundef %2, ptr noundef null, ptr noundef nonnull %5, ptr noundef null, ptr noundef %15, i64 noundef %17)
  switch i32 %18, label %97 [
    i32 2, label %19
    i32 3, label %41
  ]

19:                                               ; preds = %13
  %20 = load ptr, ptr %14, align 8, !tbaa !12
  %21 = load i64, ptr %5, align 8, !tbaa !14
  %22 = getelementptr inbounds ptr, ptr %20, i64 %21
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  %25 = load ptr, ptr %24, align 8, !tbaa !16
  %.not83 = icmp eq ptr %25, %3
  br i1 %.not83, label %.thread93, label %26

26:                                               ; preds = %19
  %.not84 = icmp eq ptr %25, null
  br i1 %.not84, label %33, label %27

27:                                               ; preds = %26
  %28 = getelementptr inbounds i8, ptr %23, i64 8
  %29 = load ptr, ptr %28, align 8, !tbaa !18
  %30 = getelementptr inbounds i8, ptr %29, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %32 = call i32 %31(ptr noundef nonnull %0, ptr noundef nonnull %25) #5
  %.pre100 = load ptr, ptr %14, align 8, !tbaa !12
  %.pre101 = load i64, ptr %5, align 8, !tbaa !14
  %.phi.trans.insert102 = getelementptr inbounds ptr, ptr %.pre100, i64 %.pre101
  %.pre103 = load ptr, ptr %.phi.trans.insert102, align 8, !tbaa !15
  br label %33

33:                                               ; preds = %27, %26
  %34 = phi ptr [ %.pre103, %27 ], [ %23, %26 ]
  %35 = phi i64 [ %.pre101, %27 ], [ %21, %26 ]
  %36 = phi ptr [ %.pre100, %27 ], [ %20, %26 ]
  %37 = getelementptr inbounds ptr, ptr %36, i64 %35
  %38 = getelementptr inbounds i8, ptr %34, i64 16
  store ptr %3, ptr %38, align 8, !tbaa !16
  %39 = load ptr, ptr %37, align 8, !tbaa !15
  %40 = getelementptr inbounds i8, ptr %39, i64 8
  store ptr %1, ptr %40, align 8, !tbaa !18
  br label %.thread93

41:                                               ; preds = %13
  %42 = getelementptr inbounds i8, ptr %0, i64 64
  %43 = load i32, ptr %42, align 8, !tbaa !21
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %47

45:                                               ; preds = %41
  %46 = call i32 @file_driver_fp(ptr noundef nonnull %0)
  %.not79 = icmp eq i32 %46, 0
  br i1 %.not79, label %47, label %.thread

47:                                               ; preds = %45, %41
  %48 = call i32 @rl_ensure_pages(ptr noundef nonnull %0)
  %49 = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  %.not80 = icmp eq ptr %49, null
  br i1 %.not80, label %.thread, label %50

50:                                               ; preds = %47
  store i64 %2, ptr %49, align 8, !tbaa !22
  %51 = getelementptr inbounds i8, ptr %49, i64 8
  store ptr %1, ptr %51, align 8, !tbaa !18
  %52 = getelementptr inbounds i8, ptr %49, i64 16
  store ptr %3, ptr %52, align 8, !tbaa !16
  %53 = load i64, ptr %5, align 8, !tbaa !14
  %54 = load i64, ptr %16, align 8, !tbaa !13
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %56, label %62

56:                                               ; preds = %50
  %57 = load ptr, ptr %14, align 8, !tbaa !12
  %58 = getelementptr ptr, ptr %57, i64 %53
  %59 = getelementptr i8, ptr %58, i64 8
  %60 = sub nsw i64 %54, %53
  %61 = shl i64 %60, 3
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %59, ptr align 8 %58, i64 %61, i1 false)
  %.pre = load i64, ptr %5, align 8, !tbaa !14
  %.pre96 = load i64, ptr %16, align 8, !tbaa !13
  br label %62

62:                                               ; preds = %56, %50
  %63 = phi i64 [ %.pre96, %56 ], [ %54, %50 ]
  %64 = phi i64 [ %.pre, %56 ], [ %53, %50 ]
  %65 = load ptr, ptr %14, align 8, !tbaa !12
  %66 = getelementptr inbounds ptr, ptr %65, i64 %64
  store ptr %49, ptr %66, align 8, !tbaa !15
  %67 = add nsw i64 %63, 1
  store i64 %67, ptr %16, align 8, !tbaa !13
  %68 = getelementptr inbounds i8, ptr %0, i64 104
  %69 = load ptr, ptr %68, align 8, !tbaa !23
  %70 = getelementptr inbounds i8, ptr %0, i64 96
  %71 = load i64, ptr %70, align 8, !tbaa !24
  %72 = call i32 @rl_search_cache(ptr noundef nonnull %0, ptr noundef %1, i64 noundef %2, ptr noundef null, ptr noundef nonnull %5, ptr noundef null, ptr noundef %69, i64 noundef %71)
  switch i32 %72, label %97 [
    i32 2, label %73
    i32 3, label %.thread93
  ]

73:                                               ; preds = %62
  %74 = load ptr, ptr %68, align 8, !tbaa !23
  %75 = load i64, ptr %5, align 8, !tbaa !14
  %76 = getelementptr inbounds ptr, ptr %74, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !15
  %78 = getelementptr inbounds i8, ptr %77, i64 16
  %79 = load ptr, ptr %78, align 8, !tbaa !16
  %.not82 = icmp eq ptr %79, %3
  br i1 %.not82, label %86, label %80

80:                                               ; preds = %73
  %81 = getelementptr inbounds i8, ptr %77, i64 8
  %82 = load ptr, ptr %81, align 8, !tbaa !18
  %83 = getelementptr inbounds i8, ptr %82, i64 24
  %84 = load ptr, ptr %83, align 8, !tbaa !19
  %85 = call i32 %84(ptr noundef nonnull %0, ptr noundef %79) #5
  %.pre97 = load ptr, ptr %68, align 8, !tbaa !23
  %.pre98 = load i64, ptr %5, align 8, !tbaa !14
  %.phi.trans.insert = getelementptr inbounds ptr, ptr %.pre97, i64 %.pre98
  %.pre99 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !15
  br label %86

86:                                               ; preds = %80, %73
  %87 = phi ptr [ %.pre99, %80 ], [ %77, %73 ]
  call void @free(ptr noundef %87) #5
  %88 = load ptr, ptr %68, align 8, !tbaa !23
  %89 = load i64, ptr %5, align 8, !tbaa !14
  %90 = getelementptr ptr, ptr %88, i64 %89
  %91 = getelementptr i8, ptr %90, i64 8
  %92 = load i64, ptr %70, align 8, !tbaa !24
  %93 = sub nsw i64 %92, %89
  %94 = shl i64 %93, 3
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %90, ptr align 8 %91, i64 %94, i1 false)
  %95 = load i64, ptr %70, align 8, !tbaa !24
  %96 = add nsw i64 %95, -1
  store i64 %96, ptr %70, align 8, !tbaa !24
  br label %.thread93

97:                                               ; preds = %62, %13
  %.0 = phi i32 [ %18, %13 ], [ %72, %62 ]
  %.not85 = icmp eq i32 %.0, 0
  br i1 %.not85, label %.thread93, label %.thread

.thread:                                          ; preds = %47, %45, %11, %9, %97
  %.090 = phi i32 [ %.0, %97 ], [ 4, %47 ], [ %46, %45 ], [ %12, %11 ], [ %10, %9 ]
  %.not86 = icmp eq ptr %3, null
  br i1 %.not86, label %103, label %98

98:                                               ; preds = %.thread
  %99 = getelementptr inbounds i8, ptr %1, i64 24
  %100 = load ptr, ptr %99, align 8, !tbaa !19
  %101 = call i32 %100(ptr noundef nonnull %0, ptr noundef nonnull %3) #5
  %102 = call i32 @rl_purge_cache(ptr noundef nonnull %0, i64 noundef %2)
  br label %103

103:                                              ; preds = %98, %.thread
  %.not87 = icmp eq i64 %2, 0
  br i1 %.not87, label %.thread93, label %104

104:                                              ; preds = %103
  %105 = call i32 @rl_discard(ptr noundef nonnull %0)
  br label %.thread93

.thread93:                                        ; preds = %86, %62, %19, %33, %103, %104, %97
  %.091 = phi i32 [ %.090, %103 ], [ %.090, %104 ], [ 0, %97 ], [ 0, %33 ], [ 0, %19 ], [ 0, %62 ], [ 0, %86 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret i32 %.091
}

; Function Attrs: nounwind uwtable
declare hidden i32 @file_driver_fp(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @rl_search_cache(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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 40}
!6 = !{!"rlite", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !11, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !11, i64 80, !7, i64 88, !7, i64 96, !11, i64 104, !7, i64 112, !7, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !11, i64 128}
!13 = !{!6, !7, i64 120}
!14 = !{!7, !7, i64 0}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !11, i64 16}
!17 = !{!"", !7, i64 0, !11, i64 8, !11, i64 16}
!18 = !{!17, !11, i64 8}
!19 = !{!20, !11, i64 24}
!20 = !{!"rl_data_type", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!21 = !{!6, !10, i64 64}
!22 = !{!17, !7, i64 0}
!23 = !{!6, !11, i64 104}
!24 = !{!6, !7, i64 96}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass