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

@stderr = external global ptr, align 8
@.str.30 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [16 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 @testSetdelsortedEtc(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
  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
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call ptr @qh_setnew(ptr noundef %13, i32 noundef 1)
  store ptr %14, 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
  %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 8150, ptr noundef @.str.39, i32 noundef %18)
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %187, %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 %190

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 %186

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 = %45, %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 %48

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
  call void @qh_setaddsorted(ptr noundef %40, ptr noundef %9, ptr noundef %44)
  br label %45

45:                                               ; preds = %39
  %46 = load i32, ptr %11, align 4, !tbaa !9
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %11, align 4, !tbaa !9
  br label %35, !llvm.loop !11

48:                                               ; preds = %35
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = load i32, ptr %12, align 4, !tbaa !9
  call void @checkSetContents(ptr noundef %49, ptr noundef @.str.40, ptr noundef %50, i32 noundef %51, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  %52 = load i32, ptr %12, align 4, !tbaa !9
  %53 = icmp sgt i32 %52, 3
  br i1 %53, label %54, label %78

54:                                               ; preds = %48
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = sdiv i32 %57, 2
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %56, i64 %59
  %61 = call ptr @qh_setdelsorted(ptr noundef %55, ptr noundef %60)
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = sub nsw i32 %64, 1
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = sdiv i32 %66, 2
  %68 = add nsw i32 %67, 1
  call void @checkSetContents(ptr noundef %62, ptr noundef @.str.41, ptr noundef %63, i32 noundef %65, i32 noundef 0, i32 noundef %68, i32 noundef -1)
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = sdiv i32 %71, 2
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %70, i64 %73
  call void @qh_setaddsorted(ptr noundef %69, ptr noundef %9, ptr noundef %74)
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load i32, ptr %12, align 4, !tbaa !9
  call void @checkSetContents(ptr noundef %75, ptr noundef @.str.42, ptr noundef %76, i32 noundef %77, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  br label %78

78:                                               ; preds = %54, %48
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = call ptr @qh_setdellast(ptr noundef %79)
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = load i32, ptr %12, align 4, !tbaa !9
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %88

85:                                               ; preds = %78
  %86 = load i32, ptr %12, align 4, !tbaa !9
  %87 = sub nsw i32 %86, 1
  br label %89

88:                                               ; preds = %78
  br label %89

89:                                               ; preds = %88, %85
  %90 = phi i32 [ %87, %85 ], [ 0, %88 ]
  call void @checkSetContents(ptr noundef %81, ptr noundef @.str.43, ptr noundef %82, i32 noundef %90, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  %91 = load i32, ptr %12, align 4, !tbaa !9
  %92 = icmp sgt i32 %91, 0
  br i1 %92, label %93, label %103

93:                                               ; preds = %89
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i32, ptr %95, i64 %97
  %99 = getelementptr inbounds i32, ptr %98, i64 -1
  call void @qh_setaddsorted(ptr noundef %94, ptr noundef %9, ptr noundef %99)
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = load i32, ptr %12, align 4, !tbaa !9
  call void @checkSetContents(ptr noundef %100, ptr noundef @.str.44, ptr noundef %101, i32 noundef %102, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %103

103:                                              ; preds = %93, %89
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = icmp sgt i32 %104, 4
  br i1 %105, label %106, label %165

106:                                              ; preds = %103
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = load i32, ptr %11, align 4, !tbaa !9
  %110 = sdiv i32 %109, 2
  %111 = call ptr @qh_setdelnthsorted(ptr noundef %107, ptr noundef %108, i32 noundef %110)
  %112 = load i32, ptr %8, align 4, !tbaa !9
  %113 = icmp eq i32 %112, 1
  br i1 %113, label %114, label %122

114:                                              ; preds = %106
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = load i32, ptr %12, align 4, !tbaa !9
  %118 = sub nsw i32 %117, 1
  %119 = load i32, ptr %11, align 4, !tbaa !9
  %120 = sdiv i32 %119, 2
  %121 = add nsw i32 %120, 1
  call void @checkSetContents(ptr noundef %115, ptr noundef @.str.45, ptr noundef %116, i32 noundef %118, i32 noundef 0, i32 noundef %121, i32 noundef -1)
  br label %122

122:                                              ; preds = %114, %106
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = sdiv i32 %125, 2
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %124, i64 %127
  %129 = getelementptr inbounds i32, ptr %128, i64 1
  %130 = call ptr @qh_setdelsorted(ptr noundef %123, ptr noundef %129)
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = load i32, ptr %12, align 4, !tbaa !9
  %134 = sub nsw i32 %133, 2
  %135 = load i32, ptr %11, align 4, !tbaa !9
  %136 = sdiv i32 %135, 2
  %137 = add nsw i32 %136, 2
  call void @checkSetContents(ptr noundef %131, ptr noundef @.str.46, ptr noundef %132, i32 noundef %134, i32 noundef 0, i32 noundef %137, i32 noundef -1)
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = load i32, ptr %11, align 4, !tbaa !9
  %141 = sdiv i32 %140, 2
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i32, ptr %139, i64 %142
  %144 = getelementptr inbounds i32, ptr %143, i64 1
  call void @qh_setaddsorted(ptr noundef %138, ptr noundef %9, ptr noundef %144)
  %145 = load i32, ptr %8, align 4, !tbaa !9
  %146 = icmp eq i32 %145, 1
  br i1 %146, label %147, label %155

147:                                              ; preds = %122
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = sub nsw i32 %150, 1
  %152 = load i32, ptr %11, align 4, !tbaa !9
  %153 = sdiv i32 %152, 2
  %154 = add nsw i32 %153, 1
  call void @checkSetContents(ptr noundef %148, ptr noundef @.str.47, ptr noundef %149, i32 noundef %151, i32 noundef 0, i32 noundef %154, i32 noundef -1)
  br label %155

155:                                              ; preds = %147, %122
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = load i32, ptr %11, align 4, !tbaa !9
  %159 = sdiv i32 %158, 2
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds i32, ptr %157, i64 %160
  call void @qh_setaddsorted(ptr noundef %156, ptr noundef %9, ptr noundef %161)
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = load i32, ptr %12, align 4, !tbaa !9
  call void @checkSetContents(ptr noundef %162, ptr noundef @.str.48, ptr noundef %163, i32 noundef %164, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %165

165:                                              ; preds = %155, %103
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setfree(ptr noundef %166, ptr noundef %10)
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = load ptr, ptr %9, align 8, !tbaa !5
  %169 = call ptr @qh_setcopy(ptr noundef %167, ptr noundef %168, i32 noundef 0)
  store ptr %169, ptr %10, align 8, !tbaa !5
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  call void @qh_setcompact(ptr noundef %170, ptr noundef %171)
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = load ptr, ptr %10, align 8, !tbaa !5
  call void @qh_setcompact(ptr noundef %172, ptr noundef %173)
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  %176 = load i32, ptr %12, align 4, !tbaa !9
  call void @checkSetContents(ptr noundef %174, ptr noundef @.str.38, ptr noundef %175, i32 noundef %176, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = load ptr, ptr %10, align 8, !tbaa !5
  %179 = load i32, ptr %12, align 4, !tbaa !9
  call void @checkSetContents(ptr noundef %177, ptr noundef @.str.49, ptr noundef %178, i32 noundef %179, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  call void @qh_setcompact(ptr noundef %180, ptr noundef %181)
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = load i32, ptr %12, align 4, !tbaa !9
  call void @checkSetContents(ptr noundef %182, ptr noundef @.str.50, ptr noundef %183, i32 noundef %184, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  %185 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setfree(ptr noundef %185, ptr noundef %10)
  br label %186

186:                                              ; preds = %165, %23
  br label %187

187:                                              ; preds = %186
  %188 = load i32, ptr %12, align 4, !tbaa !9
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %12, align 4, !tbaa !9
  br label %19, !llvm.loop !13

190:                                              ; preds = %19
  %191 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setfreelong(ptr noundef %191, ptr noundef %9)
  %192 = load ptr, ptr %9, align 8, !tbaa !5
  %193 = icmp ne ptr %192, null
  br i1 %193, label %194, label %196

194:                                              ; preds = %190
  %195 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setfree(ptr noundef %195, ptr noundef %9)
  br label %196

196:                                              ; preds = %194, %190
  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
}

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

; 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 ptr @qh_setcopy(ptr noundef, ptr noundef, i32 noundef) #2

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

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

declare ptr @qh_setdelsorted(ptr noundef, ptr noundef) #2

declare ptr @qh_setdellast(ptr noundef) #2

declare void @qh_setfreelong(ptr noundef, ptr 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}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.30 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [16 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 @testSetdelsortedEtc(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) #4
  %7 = tail call ptr @qh_setnew(ptr noundef %0, i32 noundef 1) #4
  store ptr %7, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  store ptr null, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = add nsw i32 %1, -1
  tail call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %8, i32 noundef 8150, ptr noundef nonnull @.str.39, i32 noundef %9)
  %invariant.gep = getelementptr i8, ptr %2, i64 -4
  %10 = icmp sgt i32 %1, 0
  br i1 %10, label %.lr.ph84, label %._crit_edge85

.lr.ph84:                                         ; preds = %4
  %11 = icmp eq i32 %3, 1
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %12

12:                                               ; preds = %.lr.ph84, %76
  %indvars.iv87 = phi i64 [ 0, %.lr.ph84 ], [ %indvars.iv.next88, %76 ]
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = trunc nuw nsw i64 %indvars.iv87 to i32
  %15 = call i32 @log_i(ptr noundef %0, ptr noundef %13, ptr noundef nonnull @.str.30, i32 noundef %14, i32 noundef %1, i32 noundef %3)
  %.not78 = icmp eq i32 %15, 0
  br i1 %.not78, label %76, label %16

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

.lr.ph:                                           ; preds = %16, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %19, %16 ]
  %21 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv
  call void @qh_setaddsorted(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %21) #4
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %22 = and i64 %indvars.iv.next, 4294967295
  %exitcond.not = icmp eq i64 %22, %indvars.iv87
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !9

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %16
  %.076.lcssa = phi i32 [ %18, %16 ], [ %lftr.wideiv, %._crit_edge.loopexit ]
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.40, ptr noundef %23, i32 noundef %14, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  %24 = icmp ugt i64 %indvars.iv87, 3
  br i1 %24, label %25, label %._crit_edge._crit_edge

._crit_edge._crit_edge:                           ; preds = %._crit_edge
  %.pre = add nsw i64 %indvars.iv87, -1
  br label %36

25:                                               ; preds = %._crit_edge
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = sdiv i32 %.076.lcssa, 2
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr %2, i64 %28
  %30 = call ptr @qh_setdelsorted(ptr noundef %26, ptr noundef %29) #4
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = add nsw i64 %indvars.iv87, -1
  %33 = add nsw i32 %27, 1
  %34 = trunc nsw i64 %32 to i32
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.41, ptr noundef %31, i32 noundef %34, i32 noundef 0, i32 noundef %33, i32 noundef -1)
  call void @qh_setaddsorted(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %29) #4
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.42, ptr noundef %35, i32 noundef %14, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  br label %36

36:                                               ; preds = %._crit_edge._crit_edge, %25
  %.pre-phi = phi i64 [ %.pre, %._crit_edge._crit_edge ], [ %32, %25 ]
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call ptr @qh_setdellast(ptr noundef %37) #4
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call i32 @llvm.usub.sat.i32(i32 %14, i32 1)
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.43, ptr noundef %39, i32 noundef %40, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  %.not80 = icmp eq i64 %indvars.iv87, 0
  br i1 %.not80, label %.thread, label %41

41:                                               ; preds = %36
  %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv87
  call void @qh_setaddsorted(ptr noundef %0, ptr noundef nonnull %5, ptr noundef nonnull %gep) #4
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.44, ptr noundef %42, i32 noundef %14, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  %43 = icmp ugt i64 %indvars.iv87, 4
  br i1 %43, label %44, label %.thread

44:                                               ; preds = %41
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = sdiv i32 %.076.lcssa, 2
  %47 = call ptr @qh_setdelnthsorted(ptr noundef %0, ptr noundef %45, i32 noundef %46) #4
  br i1 %11, label %48, label %52

48:                                               ; preds = %44
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = add nsw i32 %46, 1
  %51 = trunc nsw i64 %.pre-phi to i32
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.45, ptr noundef %49, i32 noundef %51, i32 noundef 0, i32 noundef %50, i32 noundef -1)
  br label %52

52:                                               ; preds = %48, %44
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = sext i32 %46 to i64
  %55 = getelementptr inbounds i32, ptr %2, i64 %54
  %56 = getelementptr inbounds i8, ptr %55, i64 4
  %57 = call ptr @qh_setdelsorted(ptr noundef %53, ptr noundef nonnull %56) #4
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = add nsw i32 %46, 2
  %60 = trunc i64 %indvars.iv87 to i32
  %61 = add i32 %60, -2
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.46, ptr noundef %58, i32 noundef %61, i32 noundef 0, i32 noundef %59, i32 noundef -1)
  call void @qh_setaddsorted(ptr noundef %0, ptr noundef nonnull %5, ptr noundef nonnull %56) #4
  br i1 %11, label %62, label %66

62:                                               ; preds = %52
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = add nsw i32 %46, 1
  %65 = trunc nsw i64 %.pre-phi to i32
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.47, ptr noundef %63, i32 noundef %65, i32 noundef 0, i32 noundef %64, i32 noundef -1)
  br label %66

66:                                               ; preds = %62, %52
  call void @qh_setaddsorted(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %55) #4
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.48, ptr noundef %67, i32 noundef %14, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %.thread

.thread:                                          ; preds = %36, %66, %41
  call void @qh_setfree(ptr noundef %0, ptr noundef nonnull %6) #4
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = call ptr @qh_setcopy(ptr noundef %0, ptr noundef %68, i32 noundef 0) #4
  store ptr %69, ptr %6, align 8, !tbaa !5
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setcompact(ptr noundef %0, ptr noundef %70) #4
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  call void @qh_setcompact(ptr noundef %0, ptr noundef %71) #4
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.38, ptr noundef %72, i32 noundef %14, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.49, ptr noundef %73, i32 noundef %14, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setcompact(ptr noundef %0, ptr noundef %74) #4
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.50, ptr noundef %75, i32 noundef %14, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  call void @qh_setfree(ptr noundef %0, ptr noundef nonnull %6) #4
  br label %76

76:                                               ; preds = %12, %.thread
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %exitcond90.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count
  br i1 %exitcond90.not, label %._crit_edge85, label %12, !llvm.loop !11

._crit_edge85:                                    ; preds = %76, %4
  call void @qh_setfreelong(ptr noundef %0, ptr noundef nonnull %5) #4
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %77, null
  br i1 %.not, label %79, label %78

78:                                               ; preds = %._crit_edge85
  call void @qh_setfree(ptr noundef %0, ptr noundef nonnull %5) #4
  br label %79

79:                                               ; preds = %78, %._crit_edge85
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  ret void
}

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

; 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 ptr @qh_setcopy(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_setaddsorted(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @qh_setdelsorted(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @qh_setdellast(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.usub.sat.i32(i32, i32) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


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