; LLVM IR from jrl-umi3218/mc_rtc :: 3rd-party/qhull/src/testqset_r (testqset_r)

; 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.setT = type { i32, [1 x %union.setelemT] }
%union.setelemT = type { ptr }

@error_count = external dso_local global i32, align 4
@stderr = external global ptr, align 8
@.str.30 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.83 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.84 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @qh_fprintf(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @testSetlastEtc(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = sub nsw i32 %17, 1
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %15, ptr noundef %16, i32 noundef 8152, ptr noundef @.str.74, i32 noundef %18)
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %236, %4
  %20 = load i32, ptr %12, align 4, !tbaa !9
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %23, label %239

23:                                               ; preds = %19
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = load i32, ptr %12, align 4, !tbaa !9
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = call i32 @log_i(ptr noundef %24, ptr noundef %25, ptr noundef @.str.30, i32 noundef %26, i32 noundef %27, i32 noundef %28)
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %235

31:                                               ; preds = %23
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = call i32 @qh_setsize(ptr noundef %32, ptr noundef %33)
  store i32 %34, ptr %11, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %91, %31
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = load i32, ptr %12, align 4, !tbaa !9
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %39, label %94

39:                                               ; preds = %35
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i32, ptr %41, i64 %43
  %45 = call i32 @qh_setunique(ptr noundef %40, ptr noundef %9, ptr noundef %44)
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %53, label %47

47:                                               ; preds = %39
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load ptr, ptr @stderr, align 8, !tbaa !5
  %50 = load i32, ptr %11, align 4, !tbaa !9
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %48, ptr noundef %49, i32 noundef 6340, ptr noundef @.str.75, i32 noundef %50)
  %51 = load i32, ptr @error_count, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr @error_count, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %47, %39
  %54 = load i32, ptr %8, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %56, label %61

56:                                               ; preds = %53
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load i32, ptr %11, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  call void @checkSetContents(ptr noundef %57, ptr noundef @.str.76, ptr noundef %58, i32 noundef %60, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %61

61:                                               ; preds = %56, %53
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  %67 = call i32 @qh_setunique(ptr noundef %62, ptr noundef %9, ptr noundef %66)
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %75

69:                                               ; preds = %61
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = load ptr, ptr @stderr, align 8, !tbaa !5
  %72 = load i32, ptr %11, align 4, !tbaa !9
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %70, ptr noundef %71, i32 noundef 6341, ptr noundef @.str.77, i32 noundef %72)
  %73 = load i32, ptr @error_count, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr @error_count, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %69, %61
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = sdiv i32 %78, 2
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i32, ptr %77, i64 %80
  %82 = call i32 @qh_setunique(ptr noundef %76, ptr noundef %9, ptr noundef %81)
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %90

84:                                               ; preds = %75
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = load ptr, ptr @stderr, align 8, !tbaa !5
  %87 = load i32, ptr %11, align 4, !tbaa !9
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %85, ptr noundef %86, i32 noundef 6346, ptr noundef @.str.78, i32 noundef %87)
  %88 = load i32, ptr @error_count, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr @error_count, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %84, %75
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %11, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %11, align 4, !tbaa !9
  br label %35, !llvm.loop !11

94:                                               ; preds = %35
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = load i32, ptr %12, align 4, !tbaa !9
  call void @checkSetContents(ptr noundef %95, ptr noundef @.str.79, ptr noundef %96, i32 noundef %97, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %100, label %109

100:                                              ; preds = %94
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = call ptr @qh_setlast(ptr noundef %101)
  %103 = icmp ne ptr null, %102
  br i1 %103, label %104, label %109

104:                                              ; preds = %100
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %105, ptr noundef %106, i32 noundef 6339, ptr noundef @.str.80)
  %107 = load i32, ptr @error_count, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr @error_count, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %104, %100, %94
  %110 = load i32, ptr %12, align 4, !tbaa !9
  %111 = icmp sgt i32 %110, 0
  br i1 %111, label %112, label %233

112:                                              ; preds = %109
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = load i32, ptr %12, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i32, ptr %113, i64 %115
  %117 = getelementptr inbounds i32, ptr %116, i64 -1
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = call ptr @qh_setlast(ptr noundef %118)
  %120 = icmp ne ptr %117, %119
  br i1 %120, label %121, label %126

121:                                              ; preds = %112
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %122, ptr noundef %123, i32 noundef 6338, ptr noundef @.str.81)
  %124 = load i32, ptr @error_count, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr @error_count, align 4, !tbaa !9
  br label %126

126:                                              ; preds = %121, %112
  %127 = load i32, ptr %12, align 4, !tbaa !9
  %128 = icmp slt i32 %127, 100
  br i1 %128, label %129, label %132

129:                                              ; preds = %126
  %130 = load i32, ptr %12, align 4, !tbaa !9
  %131 = sdiv i32 %130, 4
  br label %133

132:                                              ; preds = %126
  br label %133

133:                                              ; preds = %132, %129
  %134 = phi i32 [ %131, %129 ], [ 0, %132 ]
  store i32 %134, ptr %13, align 4, !tbaa !9
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = call i32 @qh_setsize(ptr noundef %137, ptr noundef %138)
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = sdiv i32 %140, 2
  %142 = load i32, ptr %13, align 4, !tbaa !9
  %143 = call ptr @qh_setnew_delnthsorted(ptr noundef %135, ptr noundef %136, i32 noundef %139, i32 noundef %141, i32 noundef %142)
  store ptr %143, ptr %10, align 8, !tbaa !5
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = load ptr, ptr %10, align 8, !tbaa !5
  %146 = call i32 @qh_setsize(ptr noundef %144, ptr noundef %145)
  %147 = load i32, ptr %12, align 4, !tbaa !9
  %148 = load i32, ptr %13, align 4, !tbaa !9
  %149 = add nsw i32 %147, %148
  %150 = sub nsw i32 %149, 1
  %151 = icmp ne i32 %146, %150
  br i1 %151, label %152, label %164

152:                                              ; preds = %133
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = load ptr, ptr @stderr, align 8, !tbaa !5
  %155 = load i32, ptr %12, align 4, !tbaa !9
  %156 = load i32, ptr %13, align 4, !tbaa !9
  %157 = add nsw i32 %155, %156
  %158 = sub nsw i32 %157, 1
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = call i32 @qh_setsize(ptr noundef %159, ptr noundef %160)
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %153, ptr noundef %154, i32 noundef 6345, ptr noundef @.str.82, i32 noundef %158, i32 noundef %161)
  %162 = load i32, ptr @error_count, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr @error_count, align 4, !tbaa !9
  br label %164

164:                                              ; preds = %152, %133
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %165

165:                                              ; preds = %178, %164
  %166 = load i32, ptr %11, align 4, !tbaa !9
  %167 = load i32, ptr %13, align 4, !tbaa !9
  %168 = icmp slt i32 %166, %167
  br i1 %168, label %169, label %181

169:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.setT, ptr %170, i32 0, i32 1
  %172 = load i32, ptr %11, align 4, !tbaa !9
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [1 x %union.setelemT], ptr %171, i64 0, i64 %173
  store ptr %174, ptr %14, align 8, !tbaa !5
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds i32, ptr %175, i64 0
  %177 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %176, ptr %177, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  br label %178

178:                                              ; preds = %169
  %179 = load i32, ptr %11, align 4, !tbaa !9
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %11, align 4, !tbaa !9
  br label %165, !llvm.loop !13

181:                                              ; preds = %165
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %182

182:                                              ; preds = %190, %181
  %183 = load i32, ptr %11, align 4, !tbaa !9
  %184 = load i32, ptr %13, align 4, !tbaa !9
  %185 = icmp slt i32 %183, %184
  br i1 %185, label %186, label %193

186:                                              ; preds = %182
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = load ptr, ptr %10, align 8, !tbaa !5
  %189 = call ptr @qh_setdelnthsorted(ptr noundef %187, ptr noundef %188, i32 noundef 0)
  br label %190

190:                                              ; preds = %186
  %191 = load i32, ptr %11, align 4, !tbaa !9
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %11, align 4, !tbaa !9
  br label %182, !llvm.loop !14

193:                                              ; preds = %182
  %194 = load ptr, ptr %5, align 8, !tbaa !5
  %195 = load ptr, ptr %10, align 8, !tbaa !5
  %196 = load i32, ptr %12, align 4, !tbaa !9
  %197 = sub nsw i32 %196, 1
  %198 = load i32, ptr %12, align 4, !tbaa !9
  %199 = sdiv i32 %198, 2
  %200 = add nsw i32 %199, 1
  call void @checkSetContents(ptr noundef %194, ptr noundef @.str.83, ptr noundef %195, i32 noundef %197, i32 noundef 0, i32 noundef %200, i32 noundef -1)
  %201 = load i32, ptr %12, align 4, !tbaa !9
  %202 = icmp sgt i32 %201, 2
  br i1 %202, label %203, label %232

203:                                              ; preds = %193
  %204 = load ptr, ptr %5, align 8, !tbaa !5
  %205 = load ptr, ptr %10, align 8, !tbaa !5
  %206 = load i32, ptr %12, align 4, !tbaa !9
  %207 = sdiv i32 %206, 2
  %208 = load i32, ptr %12, align 4, !tbaa !9
  %209 = sub nsw i32 %208, 1
  call void @qh_setzero(ptr noundef %204, ptr noundef %205, i32 noundef %207, i32 noundef %209)
  %210 = load ptr, ptr %5, align 8, !tbaa !5
  %211 = load ptr, ptr %10, align 8, !tbaa !5
  %212 = call i32 @qh_setsize(ptr noundef %210, ptr noundef %211)
  %213 = load i32, ptr %12, align 4, !tbaa !9
  %214 = sub nsw i32 %213, 1
  %215 = icmp ne i32 %212, %214
  br i1 %215, label %216, label %225

216:                                              ; preds = %203
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = load ptr, ptr @stderr, align 8, !tbaa !5
  %219 = load i32, ptr %12, align 4, !tbaa !9
  %220 = load ptr, ptr %5, align 8, !tbaa !5
  %221 = load ptr, ptr %10, align 8, !tbaa !5
  %222 = call i32 @qh_setsize(ptr noundef %220, ptr noundef %221)
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %217, ptr noundef %218, i32 noundef 6342, ptr noundef @.str.84, i32 noundef %219, i32 noundef %222)
  %223 = load i32, ptr @error_count, align 4, !tbaa !9
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr @error_count, align 4, !tbaa !9
  br label %225

225:                                              ; preds = %216, %203
  %226 = load ptr, ptr %5, align 8, !tbaa !5
  %227 = load ptr, ptr %10, align 8, !tbaa !5
  call void @qh_setcompact(ptr noundef %226, ptr noundef %227)
  %228 = load ptr, ptr %5, align 8, !tbaa !5
  %229 = load ptr, ptr %10, align 8, !tbaa !5
  %230 = load i32, ptr %12, align 4, !tbaa !9
  %231 = sdiv i32 %230, 2
  call void @checkSetContents(ptr noundef %228, ptr noundef @.str.85, ptr noundef %229, i32 noundef %231, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %232

232:                                              ; preds = %225, %193
  br label %233

233:                                              ; preds = %232, %109
  %234 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setfree(ptr noundef %234, ptr noundef %10)
  br label %235

235:                                              ; preds = %233, %23
  br label %236

236:                                              ; preds = %235
  %237 = load i32, ptr %12, align 4, !tbaa !9
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %12, align 4, !tbaa !9
  br label %19, !llvm.loop !15

239:                                              ; preds = %19
  %240 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setfreelong(ptr noundef %240, ptr noundef %9)
  %241 = load ptr, ptr %9, align 8, !tbaa !5
  %242 = icmp ne ptr %241, null
  br i1 %242, label %243, label %245

243:                                              ; preds = %239
  %244 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setfree(ptr noundef %244, ptr noundef %9)
  br label %245

245:                                              ; preds = %243, %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret void
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @checkSetContents(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

declare void @qh_setfree(ptr noundef, ptr noundef) #2

declare i32 @qh_setsize(ptr noundef, ptr noundef) #2

declare ptr @qh_setdelnthsorted(ptr noundef, ptr noundef, i32 noundef) #2

declare void @qh_setcompact(ptr noundef, ptr noundef) #2

declare void @qh_setfreelong(ptr noundef, ptr noundef) #2

declare i32 @qh_setunique(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @qh_setlast(ptr noundef) #2

declare ptr @qh_setnew_delnthsorted(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare void @qh_setzero(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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

%union.setelemT = type { ptr }

@error_count = external dso_local local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.30 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.83 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.84 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @qh_fprintf(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @testSetlastEtc(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  store ptr null, ptr %6, align 8, !tbaa !5
  %7 = load ptr, ptr @stderr, align 8, !tbaa !5
  %8 = add nsw i32 %1, -1
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %7, i32 noundef 8152, ptr noundef nonnull @.str.74, i32 noundef %8)
  %invariant.gep = getelementptr i8, ptr %2, i64 -4
  %9 = icmp sgt i32 %1, 0
  br i1 %9, label %.lr.ph103, label %._crit_edge104

.lr.ph103:                                        ; preds = %4
  %10 = icmp eq i32 %3, 1
  %wide.trip.count116 = zext nneg i32 %1 to i64
  br label %11

11:                                               ; preds = %.lr.ph103, %119
  %indvars.iv113 = phi i64 [ 0, %.lr.ph103 ], [ %indvars.iv.next114, %119 ]
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = trunc nuw nsw i64 %indvars.iv113 to i32
  %14 = call i32 @log_i(ptr noundef %0, ptr noundef %12, ptr noundef nonnull @.str.30, i32 noundef %13, i32 noundef %1, i32 noundef %3)
  %.not83 = icmp eq i32 %14, 0
  br i1 %.not83, label %119, label %15

15:                                               ; preds = %11
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call i32 @qh_setsize(ptr noundef %0, ptr noundef %16) #3
  %18 = sext i32 %17 to i64
  %19 = icmp sgt i64 %indvars.iv113, %18
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %15, %48
  %indvars.iv = phi i64 [ %indvars.iv.next, %48 ], [ %18, %15 ]
  %20 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv
  %21 = call i32 @qh_setunique(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %20) #3
  %.not89 = icmp eq i32 %21, 0
  br i1 %.not89, label %22, label %27

22:                                               ; preds = %.lr.ph
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = trunc nsw i64 %indvars.iv to i32
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %23, i32 noundef 6340, ptr noundef nonnull @.str.75, i32 noundef %24)
  %25 = load i32, ptr @error_count, align 4, !tbaa !9
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr @error_count, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %22, %.lr.ph
  br i1 %10, label %28, label %32

28:                                               ; preds = %27
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = trunc i64 %indvars.iv to i32
  %31 = add i32 %30, 1
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.76, ptr noundef %29, i32 noundef %31, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %32

32:                                               ; preds = %28, %27
  %33 = call i32 @qh_setunique(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %20) #3
  %.not90 = icmp eq i32 %33, 0
  br i1 %.not90, label %._crit_edge118, label %34

._crit_edge118:                                   ; preds = %32
  %.pre = trunc nsw i64 %indvars.iv to i32
  br label %39

34:                                               ; preds = %32
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = trunc nsw i64 %indvars.iv to i32
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %35, i32 noundef 6341, ptr noundef nonnull @.str.77, i32 noundef %36)
  %37 = load i32, ptr @error_count, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr @error_count, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %._crit_edge118, %34
  %.pre-phi = phi i32 [ %.pre, %._crit_edge118 ], [ %36, %34 ]
  %40 = sdiv i32 %.pre-phi, 2
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr %2, i64 %41
  %43 = call i32 @qh_setunique(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %42) #3
  %.not91 = icmp eq i32 %43, 0
  br i1 %.not91, label %48, label %44

44:                                               ; preds = %39
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %45, i32 noundef 6346, ptr noundef nonnull @.str.78, i32 noundef %.pre-phi)
  %46 = load i32, ptr @error_count, align 4, !tbaa !9
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr @error_count, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %39, %44
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %49 = and i64 %indvars.iv.next, 4294967295
  %exitcond.not = icmp eq i64 %49, %indvars.iv113
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %48, %15
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.79, ptr noundef %50, i32 noundef %13, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  %cond = icmp eq i64 %indvars.iv113, 0
  br i1 %cond, label %51, label %58

51:                                               ; preds = %._crit_edge
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = call ptr @qh_setlast(ptr noundef %52) #3
  %.not84 = icmp eq ptr %53, null
  br i1 %.not84, label %118, label %54

54:                                               ; preds = %51
  %55 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %55, i32 noundef 6339, ptr noundef nonnull @.str.80)
  %56 = load i32, ptr @error_count, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr @error_count, align 4, !tbaa !9
  br label %118

58:                                               ; preds = %._crit_edge
  %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv113
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = call ptr @qh_setlast(ptr noundef %59) #3
  %.not86 = icmp eq ptr %gep, %60
  br i1 %.not86, label %65, label %61

61:                                               ; preds = %58
  %62 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %62, i32 noundef 6338, ptr noundef nonnull @.str.81)
  %63 = load i32, ptr @error_count, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr @error_count, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %61, %58
  %66 = icmp ult i64 %indvars.iv113, 100
  %67 = lshr i32 %13, 2
  %spec.select = select i1 %66, i32 %67, i32 0
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = call i32 @qh_setsize(ptr noundef %0, ptr noundef %68) #3
  %70 = lshr i32 %13, 1
  %71 = call ptr @qh_setnew_delnthsorted(ptr noundef %0, ptr noundef %68, i32 noundef %69, i32 noundef %70, i32 noundef %spec.select) #3
  store ptr %71, ptr %6, align 8, !tbaa !5
  %72 = call i32 @qh_setsize(ptr noundef %0, ptr noundef %71) #3
  %73 = trunc i64 %indvars.iv113 to i32
  %74 = add i32 %73, -1
  %75 = add i32 %74, %spec.select
  %.not87 = icmp eq i32 %72, %75
  br i1 %.not87, label %82, label %76

76:                                               ; preds = %65
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = call i32 @qh_setsize(ptr noundef %0, ptr noundef %78) #3
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %77, i32 noundef 6345, ptr noundef nonnull @.str.82, i32 noundef %75, i32 noundef %79)
  %80 = load i32, ptr @error_count, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr @error_count, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %76, %65
  %.not105 = icmp eq i32 %spec.select, 0
  br i1 %.not105, label %._crit_edge98, label %.lr.ph95.preheader

.lr.ph95.preheader:                               ; preds = %82
  %wide.trip.count = zext nneg i32 %spec.select to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %83 = icmp ult i32 %spec.select, 4
  br i1 %83, label %.preheader.unr-lcssa, label %.lr.ph95.preheader.new

.lr.ph95.preheader.new:                           ; preds = %.lr.ph95.preheader
  %unroll_iter = and i64 %wide.trip.count, 1073741820
  br label %.lr.ph95

.preheader.unr-lcssa:                             ; preds = %.lr.ph95, %.lr.ph95.preheader
  %indvars.iv108.unr = phi i64 [ 0, %.lr.ph95.preheader ], [ %indvars.iv.next109.3, %.lr.ph95 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph95.epil

.lr.ph95.epil:                                    ; preds = %.preheader.unr-lcssa, %.lr.ph95.epil
  %indvars.iv108.epil = phi i64 [ %indvars.iv.next109.epil, %.lr.ph95.epil ], [ %indvars.iv108.unr, %.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph95.epil ], [ 0, %.preheader.unr-lcssa ]
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds i8, ptr %84, i64 8
  %86 = getelementptr inbounds [1 x %union.setelemT], ptr %85, i64 0, i64 %indvars.iv108.epil
  store ptr %2, ptr %86, align 8, !tbaa !5
  %indvars.iv.next109.epil = add nuw nsw i64 %indvars.iv108.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader, label %.lr.ph95.epil, !llvm.loop !13

.preheader:                                       ; preds = %.lr.ph95.epil, %.preheader.unr-lcssa
  br i1 %.not105, label %._crit_edge98, label %.lr.ph97

.lr.ph95:                                         ; preds = %.lr.ph95, %.lr.ph95.preheader.new
  %indvars.iv108 = phi i64 [ 0, %.lr.ph95.preheader.new ], [ %indvars.iv.next109.3, %.lr.ph95 ]
  %niter = phi i64 [ 0, %.lr.ph95.preheader.new ], [ %niter.next.3, %.lr.ph95 ]
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 8
  %89 = getelementptr inbounds [1 x %union.setelemT], ptr %88, i64 0, i64 %indvars.iv108
  store ptr %2, ptr %89, align 8, !tbaa !5
  %indvars.iv.next109 = or disjoint i64 %indvars.iv108, 1
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %90, i64 8
  %92 = getelementptr inbounds [1 x %union.setelemT], ptr %91, i64 0, i64 %indvars.iv.next109
  store ptr %2, ptr %92, align 8, !tbaa !5
  %indvars.iv.next109.1 = or disjoint i64 %indvars.iv108, 2
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i64 8
  %95 = getelementptr inbounds [1 x %union.setelemT], ptr %94, i64 0, i64 %indvars.iv.next109.1
  store ptr %2, ptr %95, align 8, !tbaa !5
  %indvars.iv.next109.2 = or disjoint i64 %indvars.iv108, 3
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 8
  %98 = getelementptr inbounds [1 x %union.setelemT], ptr %97, i64 0, i64 %indvars.iv.next109.2
  store ptr %2, ptr %98, align 8, !tbaa !5
  %indvars.iv.next109.3 = add nuw nsw i64 %indvars.iv108, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.unr-lcssa, label %.lr.ph95, !llvm.loop !15

.lr.ph97:                                         ; preds = %.preheader, %.lr.ph97
  %.296 = phi i32 [ %101, %.lr.ph97 ], [ 0, %.preheader ]
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = call ptr @qh_setdelnthsorted(ptr noundef %0, ptr noundef %99, i32 noundef 0) #3
  %101 = add nuw nsw i32 %.296, 1
  %exitcond112.not = icmp eq i32 %101, %spec.select
  br i1 %exitcond112.not, label %._crit_edge98, label %.lr.ph97, !llvm.loop !16

._crit_edge98:                                    ; preds = %.lr.ph97, %82, %.preheader
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = add nuw nsw i32 %70, 1
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.83, ptr noundef %102, i32 noundef %74, i32 noundef 0, i32 noundef %103, i32 noundef -1)
  %104 = icmp ugt i64 %indvars.iv113, 2
  br i1 %104, label %105, label %118

105:                                              ; preds = %._crit_edge98
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_setzero(ptr noundef %0, ptr noundef %106, i32 noundef %70, i32 noundef %74) #3
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = call i32 @qh_setsize(ptr noundef %0, ptr noundef %107) #3
  %.not88 = icmp eq i32 %108, %74
  br i1 %.not88, label %115, label %109

109:                                              ; preds = %105
  %110 = load ptr, ptr @stderr, align 8, !tbaa !5
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = call i32 @qh_setsize(ptr noundef %0, ptr noundef %111) #3
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %110, i32 noundef 6342, ptr noundef nonnull @.str.84, i32 noundef %13, i32 noundef %112)
  %113 = load i32, ptr @error_count, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr @error_count, align 4, !tbaa !9
  br label %115

115:                                              ; preds = %109, %105
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_setcompact(ptr noundef %0, ptr noundef %116) #3
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.85, ptr noundef %117, i32 noundef %70, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %118

118:                                              ; preds = %51, %54, %._crit_edge98, %115
  call void @qh_setfree(ptr noundef %0, ptr noundef nonnull %6) #3
  br label %119

119:                                              ; preds = %11, %118
  %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
  %exitcond117.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count116
  br i1 %exitcond117.not, label %._crit_edge104, label %11, !llvm.loop !17

._crit_edge104:                                   ; preds = %119, %4
  call void @qh_setfreelong(ptr noundef %0, ptr noundef nonnull %5) #3
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %120, null
  br i1 %.not, label %122, label %121

121:                                              ; preds = %._crit_edge104
  call void @qh_setfree(ptr noundef %0, ptr noundef nonnull %5) #3
  br label %122

122:                                              ; preds = %121, %._crit_edge104
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  ret void
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @checkSetContents(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare void @qh_setfree(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @qh_setsize(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @qh_setdelnthsorted(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @qh_setcompact(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @qh_setfreelong(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @qh_setunique(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @qh_setlast(ptr noundef) local_unnamed_addr #2

declare ptr @qh_setnew_delnthsorted(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @qh_setzero(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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