; LLVM IR from jermp/2i_bench :: external/CRoaring/src (roaring_array)

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

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@__PRETTY_FUNCTION__.ra_portable_serialize = external hidden unnamed_addr constant [62 x i8], align 1

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @container_get_cardinality(ptr noundef, i8 noundef zeroext) #4

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @ra_has_run_container(ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i8 @get_container_type(ptr noundef, i8 noundef zeroext) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @container_size_in_bytes(ptr noundef, i8 noundef zeroext) #4

; Function Attrs: nounwind uwtable
define dso_local i64 @ra_portable_serialize(ptr noundef %0, ptr noundef %1) #5 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i16, align 2
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %17, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = call zeroext i1 @ra_has_run_container(ptr noundef %18)
  %20 = zext i1 %19 to i8
  store i8 %20, ptr %7, align 1, !tbaa !11
  %21 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %22 = trunc i8 %21 to i1
  br i1 %22, label %23, label %119

23:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.roaring_array_s, ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !15
  %27 = sub nsw i32 %26, 1
  %28 = shl i32 %27, 16
  %29 = or i32 12347, %28
  store i32 %29, ptr %8, align 4, !tbaa !9
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %30, ptr align 4 %8, i64 4, i1 false)
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 4
  store ptr %32, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.roaring_array_s, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !15
  %36 = add nsw i32 %35, 7
  %37 = sdiv i32 %36, 8
  store i32 %37, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = zext i32 %38 to i64
  %40 = call noalias ptr @calloc(i64 noundef %39, i64 noundef 1) #8
  store ptr %40, ptr %10, align 8, !tbaa !5
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %23
  br label %45

44:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 633, ptr noundef @__PRETTY_FUNCTION__.ra_portable_serialize) #9
  unreachable

45:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %85, %45
  %47 = load i32, ptr %11, align 4, !tbaa !9
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.roaring_array_s, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !15
  %51 = icmp slt i32 %47, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %88

53:                                               ; preds = %46
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.roaring_array_s, ptr %54, i32 0, i32 2
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds ptr, ptr %56, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.roaring_array_s, ptr %61, i32 0, i32 4
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i8, ptr %63, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !19
  %68 = call zeroext i8 @get_container_type(ptr noundef %60, i8 noundef zeroext %67)
  %69 = zext i8 %68 to i32
  %70 = icmp eq i32 %69, 3
  br i1 %70, label %71, label %84

71:                                               ; preds = %53
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = srem i32 %72, 8
  %74 = shl i32 1, %73
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = load i32, ptr %11, align 4, !tbaa !9
  %77 = sdiv i32 %76, 8
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i8, ptr %75, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !19
  %81 = zext i8 %80 to i32
  %82 = or i32 %81, %74
  %83 = trunc i32 %82 to i8
  store i8 %83, ptr %79, align 1, !tbaa !19
  br label %84

84:                                               ; preds = %71, %53
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %11, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %11, align 4, !tbaa !9
  br label %46, !llvm.loop !20

88:                                               ; preds = %52
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = zext i32 %91 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %89, ptr align 1 %90, i64 %92, i1 false)
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = zext i32 %93 to i64
  %96 = getelementptr inbounds i8, ptr %94, i64 %95
  store ptr %96, ptr %4, align 8, !tbaa !5
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %97) #7
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.roaring_array_s, ptr %98, i32 0, i32 0
  %100 = load i32, ptr %99, align 8, !tbaa !15
  %101 = icmp slt i32 %100, 4
  br i1 %101, label %102, label %110

102:                                              ; preds = %88
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.roaring_array_s, ptr %103, i32 0, i32 0
  %105 = load i32, ptr %104, align 8, !tbaa !15
  %106 = mul nsw i32 4, %105
  %107 = add nsw i32 4, %106
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = add i32 %107, %108
  store i32 %109, ptr %6, align 4, !tbaa !9
  br label %118

110:                                              ; preds = %88
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.roaring_array_s, ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !15
  %114 = mul nsw i32 8, %113
  %115 = add nsw i32 4, %114
  %116 = load i32, ptr %9, align 4, !tbaa !9
  %117 = add i32 %115, %116
  store i32 %117, ptr %6, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %110, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %138

119:                                              ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 12346, ptr %12, align 4, !tbaa !9
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %120, ptr align 4 %12, i64 4, i1 false)
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i64 4
  store ptr %122, ptr %4, align 8, !tbaa !5
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.roaring_array_s, ptr %124, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %123, ptr align 8 %125, i64 4, i1 false)
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds i8, ptr %126, i64 4
  store ptr %127, ptr %4, align 8, !tbaa !5
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.roaring_array_s, ptr %128, i32 0, i32 0
  %130 = load i32, ptr %129, align 8, !tbaa !15
  %131 = mul nsw i32 4, %130
  %132 = add nsw i32 8, %131
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.roaring_array_s, ptr %133, i32 0, i32 0
  %135 = load i32, ptr %134, align 8, !tbaa !15
  %136 = mul nsw i32 4, %135
  %137 = add nsw i32 %132, %136
  store i32 %137, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %138

138:                                              ; preds = %119, %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %176, %138
  %140 = load i32, ptr %13, align 4, !tbaa !9
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.roaring_array_s, ptr %141, i32 0, i32 0
  %143 = load i32, ptr %142, align 8, !tbaa !15
  %144 = icmp slt i32 %140, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %179

146:                                              ; preds = %139
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.roaring_array_s, ptr %148, i32 0, i32 3
  %150 = load ptr, ptr %149, align 8, !tbaa !22
  %151 = load i32, ptr %13, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds i16, ptr %150, i64 %152
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %147, ptr align 2 %153, i64 2, i1 false)
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds i8, ptr %154, i64 2
  store ptr %155, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #7
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.roaring_array_s, ptr %156, i32 0, i32 2
  %158 = load ptr, ptr %157, align 8, !tbaa !17
  %159 = load i32, ptr %13, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds ptr, ptr %158, i64 %160
  %162 = load ptr, ptr %161, align 8, !tbaa !5
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.roaring_array_s, ptr %163, i32 0, i32 4
  %165 = load ptr, ptr %164, align 8, !tbaa !18
  %166 = load i32, ptr %13, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds i8, ptr %165, i64 %167
  %169 = load i8, ptr %168, align 1, !tbaa !19
  %170 = call i32 @container_get_cardinality(ptr noundef %162, i8 noundef zeroext %169)
  %171 = sub nsw i32 %170, 1
  %172 = trunc i32 %171 to i16
  store i16 %172, ptr %14, align 2, !tbaa !23
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %173, ptr align 2 %14, i64 2, i1 false)
  %174 = load ptr, ptr %4, align 8, !tbaa !5
  %175 = getelementptr inbounds i8, ptr %174, i64 2
  store ptr %175, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #7
  br label %176

176:                                              ; preds = %146
  %177 = load i32, ptr %13, align 4, !tbaa !9
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %13, align 4, !tbaa !9
  br label %139, !llvm.loop !25

179:                                              ; preds = %145
  %180 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %181 = trunc i8 %180 to i1
  br i1 %181, label %182, label %187

182:                                              ; preds = %179
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.roaring_array_s, ptr %183, i32 0, i32 0
  %185 = load i32, ptr %184, align 8, !tbaa !15
  %186 = icmp sge i32 %185, 4
  br i1 %186, label %187, label %220

187:                                              ; preds = %182, %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %216, %187
  %189 = load i32, ptr %15, align 4, !tbaa !9
  %190 = load ptr, ptr %3, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.roaring_array_s, ptr %190, i32 0, i32 0
  %192 = load i32, ptr %191, align 8, !tbaa !15
  %193 = icmp slt i32 %189, %192
  br i1 %193, label %195, label %194

194:                                              ; preds = %188
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %219

195:                                              ; preds = %188
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %196, ptr align 4 %6, i64 4, i1 false)
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = getelementptr inbounds i8, ptr %197, i64 4
  store ptr %198, ptr %4, align 8, !tbaa !5
  %199 = load i32, ptr %6, align 4, !tbaa !9
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.roaring_array_s, ptr %200, i32 0, i32 2
  %202 = load ptr, ptr %201, align 8, !tbaa !17
  %203 = load i32, ptr %15, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds ptr, ptr %202, i64 %204
  %206 = load ptr, ptr %205, align 8, !tbaa !5
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.roaring_array_s, ptr %207, i32 0, i32 4
  %209 = load ptr, ptr %208, align 8, !tbaa !18
  %210 = load i32, ptr %15, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds i8, ptr %209, i64 %211
  %213 = load i8, ptr %212, align 1, !tbaa !19
  %214 = call i32 @container_size_in_bytes(ptr noundef %206, i8 noundef zeroext %213)
  %215 = add i32 %199, %214
  store i32 %215, ptr %6, align 4, !tbaa !9
  br label %216

216:                                              ; preds = %195
  %217 = load i32, ptr %15, align 4, !tbaa !9
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %15, align 4, !tbaa !9
  br label %188, !llvm.loop !26

219:                                              ; preds = %194
  br label %220

220:                                              ; preds = %219, %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %221

221:                                              ; preds = %248, %220
  %222 = load i32, ptr %16, align 4, !tbaa !9
  %223 = load ptr, ptr %3, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.roaring_array_s, ptr %223, i32 0, i32 0
  %225 = load i32, ptr %224, align 8, !tbaa !15
  %226 = icmp slt i32 %222, %225
  br i1 %226, label %228, label %227

227:                                              ; preds = %221
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %251

228:                                              ; preds = %221
  %229 = load ptr, ptr %3, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.roaring_array_s, ptr %229, i32 0, i32 2
  %231 = load ptr, ptr %230, align 8, !tbaa !17
  %232 = load i32, ptr %16, align 4, !tbaa !9
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds ptr, ptr %231, i64 %233
  %235 = load ptr, ptr %234, align 8, !tbaa !5
  %236 = load ptr, ptr %3, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.roaring_array_s, ptr %236, i32 0, i32 4
  %238 = load ptr, ptr %237, align 8, !tbaa !18
  %239 = load i32, ptr %16, align 4, !tbaa !9
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds i8, ptr %238, i64 %240
  %242 = load i8, ptr %241, align 1, !tbaa !19
  %243 = load ptr, ptr %4, align 8, !tbaa !5
  %244 = call i32 @container_write(ptr noundef %235, i8 noundef zeroext %242, ptr noundef %243)
  %245 = load ptr, ptr %4, align 8, !tbaa !5
  %246 = sext i32 %244 to i64
  %247 = getelementptr inbounds i8, ptr %245, i64 %246
  store ptr %247, ptr %4, align 8, !tbaa !5
  br label %248

248:                                              ; preds = %228
  %249 = load i32, ptr %16, align 4, !tbaa !9
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %16, align 4, !tbaa !9
  br label %221, !llvm.loop !27

251:                                              ; preds = %227
  %252 = load ptr, ptr %4, align 8, !tbaa !5
  %253 = load ptr, ptr %5, align 8, !tbaa !5
  %254 = ptrtoint ptr %252 to i64
  %255 = ptrtoint ptr %253 to i64
  %256 = sub i64 %254, %255
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  ret i64 %256
}

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @container_write(ptr noundef, i8 noundef zeroext, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 allocsize(0,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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !10, i64 0}
!16 = !{!"roaring_array_s", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !7, i64 32}
!17 = !{!16, !6, i64 8}
!18 = !{!16, !6, i64 24}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!16, !6, i64 16}
!23 = !{!24, !24, i64 0}
!24 = !{!"short", !7, i64 0}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !21}
!27 = distinct !{!27, !21}


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

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@__PRETTY_FUNCTION__.ra_portable_serialize = external hidden unnamed_addr constant [62 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @container_get_cardinality(ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @ra_has_run_container(ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i8 @get_container_type(ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @container_size_in_bytes(ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i64 @ra_portable_serialize(ptr noundef %0, ptr noundef %1) local_unnamed_addr #4 {
  %3 = tail call zeroext i1 @ra_has_run_container(ptr noundef %0)
  br i1 %3, label %4, label %47

4:                                                ; preds = %2
  %5 = load i32, ptr %0, align 8, !tbaa !5
  %6 = shl i32 %5, 16
  %7 = add i32 %6, -53189
  store i32 %7, ptr %1, align 1
  %8 = getelementptr inbounds i8, ptr %1, i64 4
  %9 = load i32, ptr %0, align 8, !tbaa !5
  %10 = add nsw i32 %9, 7
  %11 = sdiv i32 %10, 8
  %12 = zext i32 %11 to i64
  %13 = tail call noalias ptr @calloc(i64 noundef %12, i64 noundef 1) #6
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %17, label %.preheader88

.preheader88:                                     ; preds = %4
  %14 = icmp sgt i32 %9, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader88
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = getelementptr inbounds i8, ptr %0, i64 24
  br label %25

17:                                               ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 633, ptr noundef nonnull @__PRETTY_FUNCTION__.ra_portable_serialize) #7
  unreachable

._crit_edge:                                      ; preds = %43, %.preheader88
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %8, ptr nonnull align 1 %13, i64 %12, i1 false)
  %18 = getelementptr inbounds i8, ptr %8, i64 %12
  tail call void @free(ptr noundef %13) #8
  %19 = load i32, ptr %0, align 8, !tbaa !5
  %20 = icmp slt i32 %19, 4
  %21 = shl nsw i32 %19, 2
  %22 = add nsw i32 %21, 4
  %23 = shl nsw i32 %19, 3
  %24 = or disjoint i32 %23, 4
  %.pn = select i1 %20, i32 %22, i32 %24
  %.078 = add i32 %.pn, %11
  br label %54

25:                                               ; preds = %.lr.ph, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %43 ]
  %26 = load ptr, ptr %15, align 8, !tbaa !11
  %27 = getelementptr inbounds ptr, ptr %26, i64 %indvars.iv
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  %29 = load ptr, ptr %16, align 8, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %29, i64 %indvars.iv
  %31 = load i8, ptr %30, align 1, !tbaa !14
  %32 = tail call zeroext i8 @get_container_type(ptr noundef %28, i8 noundef zeroext %31)
  %33 = icmp eq i8 %32, 3
  br i1 %33, label %34, label %43

34:                                               ; preds = %25
  %35 = trunc i64 %indvars.iv to i8
  %36 = and i8 %35, 7
  %37 = shl nuw i8 1, %36
  %38 = lshr i64 %indvars.iv, 3
  %39 = and i64 %38, 536870911
  %40 = getelementptr inbounds i8, ptr %13, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !14
  %42 = or i8 %41, %37
  store i8 %42, ptr %40, align 1, !tbaa !14
  br label %43

43:                                               ; preds = %25, %34
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = load i32, ptr %0, align 8, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %25, label %._crit_edge, !llvm.loop !15

47:                                               ; preds = %2
  store i32 12346, ptr %1, align 1
  %48 = getelementptr inbounds i8, ptr %1, i64 4
  %49 = load i32, ptr %0, align 8
  store i32 %49, ptr %48, align 1
  %50 = getelementptr inbounds i8, ptr %1, i64 8
  %51 = load i32, ptr %0, align 8, !tbaa !5
  %52 = shl i32 %51, 3
  %53 = add i32 %52, 8
  br label %54

54:                                               ; preds = %47, %._crit_edge
  %55 = phi i32 [ %19, %._crit_edge ], [ %51, %47 ]
  %.179 = phi i32 [ %.078, %._crit_edge ], [ %53, %47 ]
  %.076 = phi ptr [ %18, %._crit_edge ], [ %50, %47 ]
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph93, label %._crit_edge94

.lr.ph93:                                         ; preds = %54
  %57 = getelementptr inbounds i8, ptr %0, i64 16
  %58 = getelementptr inbounds i8, ptr %0, i64 8
  %59 = getelementptr inbounds i8, ptr %0, i64 24
  br label %65

._crit_edge94:                                    ; preds = %65, %54
  %.1.lcssa = phi ptr [ %.076, %54 ], [ %79, %65 ]
  %60 = phi i32 [ %55, %54 ], [ %80, %65 ]
  %61 = icmp slt i32 %60, 4
  %or.cond.not = and i1 %3, %61
  br i1 %or.cond.not, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %._crit_edge94
  %62 = icmp sgt i32 %60, 0
  br i1 %62, label %.lr.ph99, label %._crit_edge105

.lr.ph99:                                         ; preds = %.preheader
  %63 = getelementptr inbounds i8, ptr %0, i64 8
  %64 = getelementptr inbounds i8, ptr %0, i64 24
  br label %83

65:                                               ; preds = %.lr.ph93, %65
  %indvars.iv112 = phi i64 [ 0, %.lr.ph93 ], [ %indvars.iv.next113, %65 ]
  %.191 = phi ptr [ %.076, %.lr.ph93 ], [ %79, %65 ]
  %66 = load ptr, ptr %57, align 8, !tbaa !17
  %67 = getelementptr inbounds i16, ptr %66, i64 %indvars.iv112
  %68 = load i16, ptr %67, align 2
  store i16 %68, ptr %.191, align 1
  %69 = getelementptr inbounds i8, ptr %.191, i64 2
  %70 = load ptr, ptr %58, align 8, !tbaa !11
  %71 = getelementptr inbounds ptr, ptr %70, i64 %indvars.iv112
  %72 = load ptr, ptr %71, align 8, !tbaa !12
  %73 = load ptr, ptr %59, align 8, !tbaa !13
  %74 = getelementptr inbounds i8, ptr %73, i64 %indvars.iv112
  %75 = load i8, ptr %74, align 1, !tbaa !14
  %76 = tail call i32 @container_get_cardinality(ptr noundef %72, i8 noundef zeroext %75)
  %77 = trunc i32 %76 to i16
  %78 = add i16 %77, -1
  store i16 %78, ptr %69, align 1
  %79 = getelementptr inbounds i8, ptr %.191, i64 4
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %80 = load i32, ptr %0, align 8, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next113, %81
  br i1 %82, label %65, label %._crit_edge94, !llvm.loop !18

83:                                               ; preds = %.lr.ph99, %83
  %indvars.iv115 = phi i64 [ 0, %.lr.ph99 ], [ %indvars.iv.next116, %83 ]
  %.297 = phi ptr [ %.1.lcssa, %.lr.ph99 ], [ %84, %83 ]
  %.28096 = phi i32 [ %.179, %.lr.ph99 ], [ %92, %83 ]
  store i32 %.28096, ptr %.297, align 1
  %84 = getelementptr inbounds i8, ptr %.297, i64 4
  %85 = load ptr, ptr %63, align 8, !tbaa !11
  %86 = getelementptr inbounds ptr, ptr %85, i64 %indvars.iv115
  %87 = load ptr, ptr %86, align 8, !tbaa !12
  %88 = load ptr, ptr %64, align 8, !tbaa !13
  %89 = getelementptr inbounds i8, ptr %88, i64 %indvars.iv115
  %90 = load i8, ptr %89, align 1, !tbaa !14
  %91 = tail call i32 @container_size_in_bytes(ptr noundef %87, i8 noundef zeroext %90)
  %92 = add i32 %91, %.28096
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %93 = load i32, ptr %0, align 8, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = icmp slt i64 %indvars.iv.next116, %94
  br i1 %95, label %83, label %.loopexit, !llvm.loop !19

.loopexit:                                        ; preds = %83, %._crit_edge94
  %96 = phi i32 [ %60, %._crit_edge94 ], [ %93, %83 ]
  %.3 = phi ptr [ %.1.lcssa, %._crit_edge94 ], [ %84, %83 ]
  %97 = icmp sgt i32 %96, 0
  br i1 %97, label %.lr.ph104, label %._crit_edge105

.lr.ph104:                                        ; preds = %.loopexit
  %98 = getelementptr inbounds i8, ptr %0, i64 8
  %99 = getelementptr inbounds i8, ptr %0, i64 24
  br label %103

._crit_edge105:                                   ; preds = %103, %.preheader, %.loopexit
  %.4.lcssa = phi ptr [ %.3, %.loopexit ], [ %.1.lcssa, %.preheader ], [ %112, %103 ]
  %100 = ptrtoint ptr %.4.lcssa to i64
  %101 = ptrtoint ptr %1 to i64
  %102 = sub i64 %100, %101
  ret i64 %102

103:                                              ; preds = %.lr.ph104, %103
  %indvars.iv118 = phi i64 [ 0, %.lr.ph104 ], [ %indvars.iv.next119, %103 ]
  %.4101 = phi ptr [ %.3, %.lr.ph104 ], [ %112, %103 ]
  %104 = load ptr, ptr %98, align 8, !tbaa !11
  %105 = getelementptr inbounds ptr, ptr %104, i64 %indvars.iv118
  %106 = load ptr, ptr %105, align 8, !tbaa !12
  %107 = load ptr, ptr %99, align 8, !tbaa !13
  %108 = getelementptr inbounds i8, ptr %107, i64 %indvars.iv118
  %109 = load i8, ptr %108, align 1, !tbaa !14
  %110 = tail call i32 @container_write(ptr noundef %106, i8 noundef zeroext %109, ptr noundef %.4101)
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i8, ptr %.4101, i64 %111
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %113 = load i32, ptr %0, align 8, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = icmp slt i64 %indvars.iv.next119, %114
  br i1 %115, label %103, label %._crit_edge105, !llvm.loop !20
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @container_write(ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree 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 = { 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 #6 = { nounwind allocsize(0,1) }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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 = !{!"roaring_array_s", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !8, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!10, !10, i64 0}
!13 = !{!6, !10, i64 24}
!14 = !{!8, !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!6, !10, i64 16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}


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