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

@stderr = external global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 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 @testSetappendSettruncate(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 i32, align 4
  %11 = 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
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = call ptr @qh_setnew(ptr noundef %12, i32 noundef 4)
  store ptr %13, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = load i32, ptr %6, align 4, !tbaa !9
  %17 = sub nsw i32 %16, 1
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %14, ptr noundef %15, i32 noundef 8108, ptr noundef @.str.17, i32 noundef %17)
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %42, %4
  %19 = load i32, ptr %10, align 4, !tbaa !9
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %22, label %45

22:                                               ; preds = %18
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = call i32 @log_i(ptr noundef %23, ptr noundef %24, ptr noundef @.str.18, i32 noundef %25, i32 noundef %26, i32 noundef %27)
  store i32 %28, ptr %11, align 4, !tbaa !9
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr %30, i64 %32
  call void @qh_setappend(ptr noundef %29, ptr noundef %9, ptr noundef %33)
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %41

36:                                               ; preds = %22
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  call void @checkSetContents(ptr noundef %37, ptr noundef @.str.19, ptr noundef %38, i32 noundef %40, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %41

41:                                               ; preds = %36, %22
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %10, align 4, !tbaa !9
  br label %18, !llvm.loop !11

45:                                               ; preds = %18
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = sdiv i32 %48, 2
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %46, ptr noundef %47, i32 noundef 8120, ptr noundef @.str.20, i32 noundef %49)
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = icmp sge i32 %50, 2
  br i1 %51, label %52, label %68

52:                                               ; preds = %45
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = sdiv i32 %55, 2
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = call i32 @log_i(ptr noundef %53, ptr noundef %54, ptr noundef @.str.21, i32 noundef %56, i32 noundef %57, i32 noundef %58)
  store i32 %59, ptr %11, align 4, !tbaa !9
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = load i32, ptr %6, align 4, !tbaa !9
  %63 = sdiv i32 %62, 2
  call void @qh_settruncate(ptr noundef %60, ptr noundef %61, i32 noundef %63)
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = sdiv i32 %66, 2
  call void @checkSetContents(ptr noundef %64, ptr noundef @.str.22, ptr noundef %65, i32 noundef %67, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %68

68:                                               ; preds = %52, %45
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !9
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = call i32 @log_i(ptr noundef %69, ptr noundef %70, ptr noundef @.str.21, i32 noundef 0, i32 noundef %71, i32 noundef %72)
  store i32 %73, ptr %11, align 4, !tbaa !9
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  call void @qh_settruncate(ptr noundef %74, ptr noundef %75, i32 noundef 0)
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %76, ptr noundef @.str.23, ptr noundef %77, i32 noundef 0, i32 noundef -1, i32 noundef -1, i32 noundef -1)
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = load ptr, ptr @stderr, align 8, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = sub nsw i32 %80, 1
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %78, ptr noundef %79, i32 noundef 8122, ptr noundef @.str.24, i32 noundef %81)
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setfree(ptr noundef %82, ptr noundef %9)
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = call ptr @qh_setnew(ptr noundef %83, i32 noundef 4)
  store ptr %84, ptr %9, align 8, !tbaa !5
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds i32, ptr %86, i64 0
  call void @qh_setappend(ptr noundef %85, ptr noundef %9, ptr noundef %87)
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %112, %68
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = load i32, ptr %6, align 4, !tbaa !9
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %92, label %115

92:                                               ; preds = %88
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = load i32, ptr %6, align 4, !tbaa !9
  %97 = load i32, ptr %8, align 4, !tbaa !9
  %98 = call i32 @log_i(ptr noundef %93, ptr noundef %94, ptr noundef @.str.18, i32 noundef %95, i32 noundef %96, i32 noundef %97)
  store i32 %98, ptr %11, align 4, !tbaa !9
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr %100, i64 %102
  call void @qh_setappend2ndlast(ptr noundef %99, ptr noundef %9, ptr noundef %103)
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %111

106:                                              ; preds = %92
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = add nsw i32 %109, 2
  call void @checkSetContents(ptr noundef %107, ptr noundef @.str.25, ptr noundef %108, i32 noundef %110, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  br label %111

111:                                              ; preds = %106, %92
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !9
  br label %88, !llvm.loop !13

115:                                              ; preds = %88
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = load ptr, ptr @stderr, align 8, !tbaa !5
  %118 = load i32, ptr %6, align 4, !tbaa !9
  %119 = sdiv i32 %118, 2
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %116, ptr noundef %117, i32 noundef 8146, ptr noundef @.str.26, i32 noundef %119)
  %120 = load i32, ptr %6, align 4, !tbaa !9
  %121 = icmp sge i32 %120, 2
  br i1 %121, label %122, label %150

122:                                              ; preds = %115
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = load i32, ptr %6, align 4, !tbaa !9
  %126 = sdiv i32 %125, 2
  %127 = load i32, ptr %6, align 4, !tbaa !9
  %128 = load i32, ptr %8, align 4, !tbaa !9
  %129 = call i32 @log_i(ptr noundef %123, ptr noundef %124, ptr noundef @.str.21, i32 noundef %126, i32 noundef %127, i32 noundef %128)
  store i32 %129, ptr %11, align 4, !tbaa !9
  %130 = load i32, ptr %6, align 4, !tbaa !9
  %131 = sdiv i32 %130, 2
  %132 = add nsw i32 %131, 1
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.setT, ptr %133, i32 0, i32 1
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.setT, ptr %135, i32 0, i32 0
  %137 = load i32, ptr %136, align 8, !tbaa !14
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1 x %union.setelemT], ptr %134, i64 0, i64 %138
  store i32 %132, ptr %139, align 8, !tbaa !16
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.setT, ptr %140, i32 0, i32 1
  %142 = load i32, ptr %6, align 4, !tbaa !9
  %143 = sdiv i32 %142, 2
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [1 x %union.setelemT], ptr %141, i64 0, i64 %144
  store ptr null, ptr %145, align 8, !tbaa !16
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = load i32, ptr %6, align 4, !tbaa !9
  %149 = sdiv i32 %148, 2
  call void @checkSetContents(ptr noundef %146, ptr noundef @.str.27, ptr noundef %147, i32 noundef %149, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %150

150:                                              ; preds = %122, %115
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = load i32, ptr %6, align 4, !tbaa !9
  %154 = load i32, ptr %8, align 4, !tbaa !9
  %155 = call i32 @log_i(ptr noundef %151, ptr noundef %152, ptr noundef @.str.21, i32 noundef 0, i32 noundef %153, i32 noundef %154)
  store i32 %155, ptr %11, align 4, !tbaa !9
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.setT, ptr %156, i32 0, i32 1
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.setT, ptr %158, i32 0, i32 0
  %160 = load i32, ptr %159, align 8, !tbaa !14
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [1 x %union.setelemT], ptr %157, i64 0, i64 %161
  store i32 1, ptr %162, align 8, !tbaa !16
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.setT, ptr %163, i32 0, i32 1
  %165 = getelementptr inbounds [1 x %union.setelemT], ptr %164, i64 0, i64 0
  store ptr null, ptr %165, align 8, !tbaa !16
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %166, ptr noundef @.str.28, ptr noundef %167, i32 noundef 0, i32 noundef -1, i32 noundef -1, i32 noundef -1)
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_setfree(ptr noundef %168, ptr noundef %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, 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

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

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

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

declare void @qh_setappend2ndlast(ptr noundef, 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}
!14 = !{!15, !10, i64 0}
!15 = !{!"setT", !10, i64 0, !7, i64 8}
!16 = !{!7, !7, i64 0}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 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 @testSetappendSettruncate(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %6 = tail call ptr @qh_setnew(ptr noundef %0, i32 noundef 4) #3
  store ptr %6, ptr %5, 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 8108, ptr noundef nonnull @.str.17, i32 noundef %8)
  %9 = icmp sgt i32 %1, 0
  br i1 %9, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %4
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %18
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.pre-phi, %18 ]
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = trunc nuw nsw i64 %indvars.iv to i32
  %12 = call i32 @log_i(ptr noundef %0, ptr noundef %10, ptr noundef nonnull @.str.18, i32 noundef %11, i32 noundef %1, i32 noundef %3)
  %13 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv
  call void @qh_setappend(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %13) #3
  %.not68 = icmp eq i32 %12, 0
  br i1 %.not68, label %.lr.ph._crit_edge, label %14

.lr.ph._crit_edge:                                ; preds = %.lr.ph
  %.pre = add nuw nsw i64 %indvars.iv, 1
  br label %18

14:                                               ; preds = %.lr.ph
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = add nuw nsw i64 %indvars.iv, 1
  %17 = trunc nuw nsw i64 %16 to i32
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.19, ptr noundef %15, i32 noundef %17, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %18

18:                                               ; preds = %.lr.ph._crit_edge, %14
  %indvars.iv.next.pre-phi = phi i64 [ %.pre, %.lr.ph._crit_edge ], [ %16, %14 ]
  %exitcond.not = icmp eq i64 %indvars.iv.next.pre-phi, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %18, %4
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = sdiv i32 %1, 2
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %19, i32 noundef 8120, ptr noundef nonnull @.str.20, i32 noundef %20)
  %21 = icmp sgt i32 %1, 1
  br i1 %21, label %22, label %27

22:                                               ; preds = %._crit_edge
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call i32 @log_i(ptr noundef %0, ptr noundef %23, ptr noundef nonnull @.str.21, i32 noundef %20, i32 noundef %1, i32 noundef %3)
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_settruncate(ptr noundef %0, ptr noundef %25, i32 noundef %20) #3
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.22, ptr noundef %26, i32 noundef %20, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %27

27:                                               ; preds = %22, %._crit_edge
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call i32 @log_i(ptr noundef %0, ptr noundef %28, ptr noundef nonnull @.str.21, i32 noundef 0, i32 noundef %1, i32 noundef %3)
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  call void @qh_settruncate(ptr noundef %0, ptr noundef %30, i32 noundef 0) #3
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.23, ptr noundef %31, i32 noundef 0, i32 noundef -1, i32 noundef -1, i32 noundef -1)
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %32, i32 noundef 8122, ptr noundef nonnull @.str.24, i32 noundef %8)
  call void @qh_setfree(ptr noundef %0, ptr noundef nonnull %5) #3
  %33 = call ptr @qh_setnew(ptr noundef %0, i32 noundef 4) #3
  store ptr %33, ptr %5, align 8, !tbaa !5
  call void @qh_setappend(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %2) #3
  br i1 %9, label %.lr.ph72.preheader, label %._crit_edge73.thread

._crit_edge73.thread:                             ; preds = %27
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %34, i32 noundef 8146, ptr noundef nonnull @.str.26, i32 noundef %20)
  br label %59

.lr.ph72.preheader:                               ; preds = %27
  %wide.trip.count78 = zext nneg i32 %1 to i64
  br label %.lr.ph72

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %43
  %indvars.iv75 = phi i64 [ 0, %.lr.ph72.preheader ], [ %indvars.iv.next76, %43 ]
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = trunc nuw nsw i64 %indvars.iv75 to i32
  %37 = call i32 @log_i(ptr noundef %0, ptr noundef %35, ptr noundef nonnull @.str.18, i32 noundef %36, i32 noundef %1, i32 noundef %3)
  %38 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv75
  call void @qh_setappend2ndlast(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %38) #3
  %.not = icmp eq i32 %37, 0
  br i1 %.not, label %43, label %39

39:                                               ; preds = %.lr.ph72
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = trunc i64 %indvars.iv75 to i32
  %42 = add i32 %41, 2
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.25, ptr noundef %40, i32 noundef %42, i32 noundef 0, i32 noundef 0, i32 noundef -1)
  br label %43

43:                                               ; preds = %.lr.ph72, %39
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
  br i1 %exitcond79.not, label %._crit_edge73, label %.lr.ph72, !llvm.loop !11

._crit_edge73:                                    ; preds = %43
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @qh_fprintf(ptr noundef %0, ptr noundef %44, i32 noundef 8146, ptr noundef nonnull @.str.26, i32 noundef %20)
  br i1 %21, label %45, label %59

45:                                               ; preds = %._crit_edge73
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = call i32 @log_i(ptr noundef %0, ptr noundef %46, ptr noundef nonnull @.str.21, i32 noundef %20, i32 noundef %1, i32 noundef %3)
  %48 = add nuw nsw i32 %20, 1
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  %51 = load i32, ptr %49, align 8, !tbaa !12
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1 x %union.setelemT], ptr %50, i64 0, i64 %52
  store i32 %48, ptr %53, align 8, !tbaa !15
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = zext nneg i32 %20 to i64
  %57 = getelementptr inbounds [1 x %union.setelemT], ptr %55, i64 0, i64 %56
  store ptr null, ptr %57, align 8, !tbaa !15
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.27, ptr noundef %58, i32 noundef %20, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  br label %59

59:                                               ; preds = %._crit_edge73.thread, %45, %._crit_edge73
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = call i32 @log_i(ptr noundef %0, ptr noundef %60, ptr noundef nonnull @.str.21, i32 noundef 0, i32 noundef %1, i32 noundef %3)
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  %64 = load i32, ptr %62, align 8, !tbaa !12
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1 x %union.setelemT], ptr %63, i64 0, i64 %65
  store i32 1, ptr %66, align 8, !tbaa !15
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  store ptr null, ptr %68, align 8, !tbaa !15
  call void @checkSetContents(ptr noundef %0, ptr noundef nonnull @.str.28, ptr noundef %67, i32 noundef 0, i32 noundef -1, i32 noundef -1, i32 noundef -1)
  call void @qh_setfree(ptr noundef %0, ptr noundef nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  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

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

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

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

declare void @qh_setappend2ndlast(ptr noundef, ptr noundef, ptr 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !14, i64 0}
!13 = !{!"setT", !14, i64 0, !7, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!7, !7, i64 0}


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