; LLVM IR from jermp/2i_bench :: external/CRoaring/tests/vendor/cmocka/cmocka.ll (run_group_tests)

; 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.TestState = type { ptr, ptr }
%struct.UnitTest = type { ptr, ptr, i32 }

@.str.5 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
declare hidden void @exit_test(i32 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
declare dso_local ptr @_test_malloc(i64 noundef, ptr noundef, i32 noundef) #0

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @fail_if_blocks_allocated(ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @_run_group_tests(ptr noundef %0, i64 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %struct.TestState, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  store i64 0, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  store i64 0, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #2
  store i64 0, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #2
  store i64 0, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #2
  store i64 0, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #2
  %26 = call ptr @check_point_allocated_blocks()
  store ptr %26, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #2
  %27 = load i64, ptr %4, align 8, !tbaa !9
  %28 = mul i64 %27, 8
  %29 = call ptr @_test_malloc(i64 noundef %28, ptr noundef @.str.5, i32 noundef 2672)
  store ptr %29, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #2
  store ptr null, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #2
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %30

30:                                               ; preds = %72, %2
  %31 = load i64, ptr %12, align 8, !tbaa !9
  %32 = load i64, ptr %4, align 8, !tbaa !9
  %33 = icmp ult i64 %31, %32
  br i1 %33, label %34, label %75

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #2
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = load i64, ptr %12, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.UnitTest, ptr %35, i64 %36
  store ptr %37, ptr %19, align 8, !tbaa !5
  %38 = load ptr, ptr %19, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.UnitTest, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 8, !tbaa !11
  %41 = icmp eq i32 %40, 3
  br i1 %41, label %42, label %54

42:                                               ; preds = %34
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %52

45:                                               ; preds = %42
  %46 = load ptr, ptr %19, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.UnitTest, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !14
  store ptr %48, ptr %5, align 8, !tbaa !5
  %49 = load ptr, ptr %19, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.UnitTest, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !15
  store ptr %51, ptr %6, align 8, !tbaa !5
  store i64 1, ptr %7, align 8, !tbaa !9
  br label %53

52:                                               ; preds = %42
  call void (ptr, ...) @print_error(ptr noundef @.str.40)
  call void @exit_test(i32 noundef 1)
  br label %53

53:                                               ; preds = %52, %45
  br label %54

54:                                               ; preds = %53, %34
  %55 = load ptr, ptr %19, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.UnitTest, ptr %55, i32 0, i32 2
  %57 = load i32, ptr %56, align 8, !tbaa !11
  %58 = icmp eq i32 %57, 4
  br i1 %58, label %59, label %71

59:                                               ; preds = %54
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = icmp eq ptr %60, null
  br i1 %61, label %62, label %69

62:                                               ; preds = %59
  %63 = load ptr, ptr %19, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.UnitTest, ptr %63, i32 0, i32 1
  %65 = load ptr, ptr %64, align 8, !tbaa !14
  store ptr %65, ptr %8, align 8, !tbaa !5
  %66 = load ptr, ptr %19, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.UnitTest, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !15
  store ptr %68, ptr %9, align 8, !tbaa !5
  store i64 1, ptr %10, align 8, !tbaa !9
  br label %70

69:                                               ; preds = %59
  call void (ptr, ...) @print_error(ptr noundef @.str.41)
  call void @exit_test(i32 noundef 1)
  br label %70

70:                                               ; preds = %69, %62
  br label %71

71:                                               ; preds = %70, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #2
  br label %72

72:                                               ; preds = %71
  %73 = load i64, ptr %12, align 8, !tbaa !9
  %74 = add i64 %73, 1
  store i64 %74, ptr %12, align 8, !tbaa !9
  br label %30, !llvm.loop !16

75:                                               ; preds = %30
  %76 = load i64, ptr %4, align 8, !tbaa !9
  %77 = load i64, ptr %7, align 8, !tbaa !9
  %78 = sub i64 %76, %77
  %79 = load i64, ptr %10, align 8, !tbaa !9
  %80 = sub i64 %78, %79
  call void (ptr, ...) @print_message(ptr noundef @.str.29, i64 noundef %80)
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %108

83:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #2
  %84 = call ptr @check_point_allocated_blocks()
  %85 = getelementptr inbounds %struct.TestState, ptr %18, i32 0, i32 0
  store ptr %84, ptr %85, align 8, !tbaa !18
  %86 = getelementptr inbounds %struct.TestState, ptr %18, i32 0, i32 1
  store ptr %86, ptr %17, align 8, !tbaa !5
  %87 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr null, ptr %87, align 8, !tbaa !5
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = load ptr, ptr %17, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.TestState, ptr %18, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !18
  %93 = call i32 @_run_test(ptr noundef %88, ptr noundef %89, ptr noundef %90, i32 noundef 1, ptr noundef %92)
  store i32 %93, ptr %20, align 4, !tbaa !20
  %94 = load i32, ptr %20, align 4, !tbaa !20
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %101

96:                                               ; preds = %83
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = load ptr, ptr %16, align 8, !tbaa !5
  %99 = load i64, ptr %14, align 8, !tbaa !9
  %100 = getelementptr inbounds ptr, ptr %98, i64 %99
  store ptr %97, ptr %100, align 8, !tbaa !5
  br label %101

101:                                              ; preds = %96, %83
  %102 = load i32, ptr %20, align 4, !tbaa !20
  %103 = sext i32 %102 to i64
  %104 = load i64, ptr %14, align 8, !tbaa !9
  %105 = add i64 %104, %103
  store i64 %105, ptr %14, align 8, !tbaa !9
  %106 = load i64, ptr %13, align 8, !tbaa !9
  %107 = add i64 %106, 1
  store i64 %107, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #2
  br label %108

108:                                              ; preds = %101, %75
  br label %109

109:                                              ; preds = %167, %165, %108
  %110 = load i64, ptr %11, align 8, !tbaa !9
  %111 = load i64, ptr %4, align 8, !tbaa !9
  %112 = icmp ult i64 %110, %111
  br i1 %112, label %113, label %168

113:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #2
  store i32 0, ptr %21, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #2
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = load i64, ptr %11, align 8, !tbaa !9
  %116 = add i64 %115, 1
  store i64 %116, ptr %11, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct.UnitTest, ptr %114, i64 %115
  store ptr %117, ptr %22, align 8, !tbaa !5
  %118 = load ptr, ptr %22, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.UnitTest, ptr %118, i32 0, i32 1
  %120 = load ptr, ptr %119, align 8, !tbaa !14
  %121 = icmp eq ptr %120, null
  br i1 %121, label %122, label %123

122:                                              ; preds = %113
  store i32 5, ptr %23, align 4
  br label %165, !llvm.loop !21

123:                                              ; preds = %113
  %124 = load ptr, ptr %22, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.UnitTest, ptr %124, i32 0, i32 2
  %126 = load i32, ptr %125, align 8, !tbaa !11
  switch i32 %126, label %129 [
    i32 0, label %127
    i32 1, label %128
    i32 2, label %128
    i32 3, label %128
    i32 4, label %128
  ]

127:                                              ; preds = %123
  store i32 1, ptr %21, align 4, !tbaa !20
  br label %133

128:                                              ; preds = %123, %123, %123, %123
  br label %133

129:                                              ; preds = %123
  %130 = load ptr, ptr %22, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.UnitTest, ptr %130, i32 0, i32 2
  %132 = load i32, ptr %131, align 8, !tbaa !11
  call void (ptr, ...) @print_error(ptr noundef @.str.31, i32 noundef %132)
  br label %133

133:                                              ; preds = %129, %128, %127
  %134 = load i32, ptr %21, align 4, !tbaa !20
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %164

136:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #2
  %137 = load ptr, ptr %22, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.UnitTest, ptr %137, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !15
  %140 = load ptr, ptr %22, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.UnitTest, ptr %140, i32 0, i32 1
  %142 = load ptr, ptr %141, align 8, !tbaa !14
  %143 = load ptr, ptr %17, align 8, !tbaa !5
  %144 = load ptr, ptr %22, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.UnitTest, ptr %144, i32 0, i32 2
  %146 = load i32, ptr %145, align 8, !tbaa !11
  %147 = call i32 @_run_test(ptr noundef %139, ptr noundef %142, ptr noundef %143, i32 noundef %146, ptr noundef null)
  store i32 %147, ptr %24, align 4, !tbaa !20
  %148 = load i32, ptr %24, align 4, !tbaa !20
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %157

150:                                              ; preds = %136
  %151 = load ptr, ptr %22, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.UnitTest, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !15
  %154 = load ptr, ptr %16, align 8, !tbaa !5
  %155 = load i64, ptr %14, align 8, !tbaa !9
  %156 = getelementptr inbounds ptr, ptr %154, i64 %155
  store ptr %153, ptr %156, align 8, !tbaa !5
  br label %157

157:                                              ; preds = %150, %136
  %158 = load i32, ptr %24, align 4, !tbaa !20
  %159 = sext i32 %158 to i64
  %160 = load i64, ptr %14, align 8, !tbaa !9
  %161 = add i64 %160, %159
  store i64 %161, ptr %14, align 8, !tbaa !9
  %162 = load i64, ptr %13, align 8, !tbaa !9
  %163 = add i64 %162, 1
  store i64 %163, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #2
  br label %164

164:                                              ; preds = %157, %133
  store i32 0, ptr %23, align 4
  br label %165

165:                                              ; preds = %164, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #2
  %166 = load i32, ptr %23, align 4
  switch i32 %166, label %221 [
    i32 0, label %167
    i32 5, label %109
  ]

167:                                              ; preds = %165
  br label %109, !llvm.loop !21

168:                                              ; preds = %109
  %169 = load ptr, ptr %8, align 8, !tbaa !5
  %170 = icmp ne ptr %169, null
  br i1 %170, label %171, label %192

171:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #2
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = load ptr, ptr %8, align 8, !tbaa !5
  %174 = load ptr, ptr %17, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.TestState, ptr %18, i32 0, i32 0
  %176 = load ptr, ptr %175, align 8, !tbaa !18
  %177 = call i32 @_run_test(ptr noundef %172, ptr noundef %173, ptr noundef %174, i32 noundef 4, ptr noundef %176)
  store i32 %177, ptr %25, align 4, !tbaa !20
  %178 = load i32, ptr %25, align 4, !tbaa !20
  %179 = icmp ne i32 %178, 0
  br i1 %179, label %180, label %185

180:                                              ; preds = %171
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = load ptr, ptr %16, align 8, !tbaa !5
  %183 = load i64, ptr %14, align 8, !tbaa !9
  %184 = getelementptr inbounds ptr, ptr %182, i64 %183
  store ptr %181, ptr %184, align 8, !tbaa !5
  br label %185

185:                                              ; preds = %180, %171
  %186 = load i32, ptr %25, align 4, !tbaa !20
  %187 = sext i32 %186 to i64
  %188 = load i64, ptr %14, align 8, !tbaa !9
  %189 = add i64 %188, %187
  store i64 %189, ptr %14, align 8, !tbaa !9
  %190 = load i64, ptr %13, align 8, !tbaa !9
  %191 = add i64 %190, 1
  store i64 %191, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #2
  br label %192

192:                                              ; preds = %185, %168
  %193 = load i64, ptr %13, align 8, !tbaa !9
  call void (ptr, ...) @print_message(ptr noundef @.str.34, i64 noundef %193)
  %194 = load i64, ptr %13, align 8, !tbaa !9
  %195 = load i64, ptr %14, align 8, !tbaa !9
  %196 = sub i64 %194, %195
  call void (ptr, ...) @print_error(ptr noundef @.str.35, i64 noundef %196)
  %197 = load i64, ptr %14, align 8, !tbaa !9
  %198 = icmp ne i64 %197, 0
  br i1 %198, label %199, label %214

199:                                              ; preds = %192
  %200 = load i64, ptr %14, align 8, !tbaa !9
  call void (ptr, ...) @print_error(ptr noundef @.str.36, i64 noundef %200)
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %201

201:                                              ; preds = %210, %199
  %202 = load i64, ptr %12, align 8, !tbaa !9
  %203 = load i64, ptr %14, align 8, !tbaa !9
  %204 = icmp ult i64 %202, %203
  br i1 %204, label %205, label %213

205:                                              ; preds = %201
  %206 = load ptr, ptr %16, align 8, !tbaa !5
  %207 = load i64, ptr %12, align 8, !tbaa !9
  %208 = getelementptr inbounds ptr, ptr %206, i64 %207
  %209 = load ptr, ptr %208, align 8, !tbaa !5
  call void (ptr, ...) @print_error(ptr noundef @.str.28, ptr noundef %209)
  br label %210

210:                                              ; preds = %205
  %211 = load i64, ptr %12, align 8, !tbaa !9
  %212 = add i64 %211, 1
  store i64 %212, ptr %12, align 8, !tbaa !9
  br label %201, !llvm.loop !22

213:                                              ; preds = %201
  br label %216

214:                                              ; preds = %192
  %215 = load i64, ptr %14, align 8, !tbaa !9
  call void (ptr, ...) @print_error(ptr noundef @.str.37, i64 noundef %215)
  br label %216

216:                                              ; preds = %214, %213
  %217 = load ptr, ptr %16, align 8, !tbaa !5
  call void @_test_free(ptr noundef %217, ptr noundef @.str.5, i32 noundef 2791)
  %218 = load ptr, ptr %15, align 8, !tbaa !5
  call void @fail_if_blocks_allocated(ptr noundef %218, ptr noundef @.str.42)
  %219 = load i64, ptr %14, align 8, !tbaa !9
  %220 = trunc i64 %219 to i32
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  ret i32 %220

221:                                              ; preds = %165
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden ptr @check_point_allocated_blocks() #0

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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 16}
!12 = !{!"UnitTest", !6, i64 0, !6, i64 8, !13, i64 16}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !6, i64 8}
!15 = !{!12, !6, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !6, i64 0}
!19 = !{!"TestState", !6, i64 0, !6, i64 8}
!20 = !{!13, !13, i64 0}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}


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

%struct.TestState = type { ptr, ptr }
%struct.UnitTest = type { ptr, ptr, i32 }

@.str.5 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
declare hidden void @exit_test(i32 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
declare dso_local ptr @_test_malloc(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @fail_if_blocks_allocated(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @_run_group_tests(ptr nocapture noundef readonly %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.TestState, align 8
  %4 = tail call ptr @check_point_allocated_blocks()
  %5 = shl i64 %1, 3
  %6 = tail call ptr @_test_malloc(i64 noundef %5, ptr noundef nonnull @.str.5, i32 noundef 2672)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #2
  %.not122 = icmp eq i64 %1, 0
  br i1 %.not122, label %._crit_edge118.thread, label %.lr.ph

.lr.ph:                                           ; preds = %2, %26
  %.0107 = phi ptr [ %.1132, %26 ], [ null, %2 ]
  %.072106 = phi ptr [ %.173131, %26 ], [ undef, %2 ]
  %.074105 = phi i64 [ %.175130, %26 ], [ 0, %2 ]
  %.077104 = phi ptr [ %.178, %26 ], [ null, %2 ]
  %.079103 = phi ptr [ %.180, %26 ], [ undef, %2 ]
  %.082102 = phi i64 [ %.183, %26 ], [ 0, %2 ]
  %.092101 = phi i64 [ %27, %26 ], [ 0, %2 ]
  %7 = getelementptr inbounds %struct.UnitTest, ptr %0, i64 %.092101
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %10 = icmp eq i32 %9, 3
  br i1 %10, label %11, label %thread-pre-split

11:                                               ; preds = %.lr.ph
  %12 = icmp eq ptr %.0107, null
  br i1 %12, label %thread-pre-split.thread, label %16

thread-pre-split.thread:                          ; preds = %11
  %13 = getelementptr inbounds i8, ptr %7, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = load ptr, ptr %7, align 8, !tbaa !12
  br label %26

16:                                               ; preds = %11
  tail call void (ptr, ...) @print_error(ptr noundef nonnull @.str.40)
  tail call void @exit_test(i32 noundef 1)
  %.pr.pre = load i32, ptr %8, align 8, !tbaa !5
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %16, %.lr.ph
  %17 = phi i32 [ %9, %.lr.ph ], [ %.pr.pre, %16 ]
  %18 = icmp eq i32 %17, 4
  br i1 %18, label %19, label %26

19:                                               ; preds = %thread-pre-split
  %20 = icmp eq ptr %.077104, null
  br i1 %20, label %21, label %25

21:                                               ; preds = %19
  %22 = getelementptr inbounds i8, ptr %7, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = load ptr, ptr %7, align 8, !tbaa !12
  br label %26

25:                                               ; preds = %19
  tail call void (ptr, ...) @print_error(ptr noundef nonnull @.str.41)
  tail call void @exit_test(i32 noundef 1)
  br label %26

26:                                               ; preds = %thread-pre-split.thread, %21, %25, %thread-pre-split
  %.1132 = phi ptr [ %.0107, %21 ], [ %.0107, %25 ], [ %.0107, %thread-pre-split ], [ %14, %thread-pre-split.thread ]
  %.173131 = phi ptr [ %.072106, %21 ], [ %.072106, %25 ], [ %.072106, %thread-pre-split ], [ %15, %thread-pre-split.thread ]
  %.175130 = phi i64 [ %.074105, %21 ], [ %.074105, %25 ], [ %.074105, %thread-pre-split ], [ 1, %thread-pre-split.thread ]
  %.183 = phi i64 [ 1, %21 ], [ %.082102, %25 ], [ %.082102, %thread-pre-split ], [ %.082102, %thread-pre-split.thread ]
  %.180 = phi ptr [ %24, %21 ], [ %.079103, %25 ], [ %.079103, %thread-pre-split ], [ %.079103, %thread-pre-split.thread ]
  %.178 = phi ptr [ %23, %21 ], [ %.077104, %25 ], [ %.077104, %thread-pre-split ], [ %.077104, %thread-pre-split.thread ]
  %27 = add nuw i64 %.092101, 1
  %exitcond.not = icmp eq i64 %27, %1
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %26
  %28 = add nuw nsw i64 %.183, %.175130
  %29 = sub i64 %1, %28
  tail call void (ptr, ...) @print_message(ptr noundef nonnull @.str.29, i64 noundef %29)
  %.not = icmp eq ptr %.1132, null
  br i1 %.not, label %.lr.ph117.preheader, label %30

30:                                               ; preds = %._crit_edge
  %31 = tail call ptr @check_point_allocated_blocks()
  store ptr %31, ptr %3, align 8, !tbaa !15
  %32 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr null, ptr %32, align 8, !tbaa !17
  %33 = call i32 @_run_test(ptr noundef %.173131, ptr noundef nonnull %.1132, ptr noundef nonnull %32, i32 noundef 1, ptr noundef %31)
  %.not95 = icmp eq i32 %33, 0
  br i1 %.not95, label %35, label %34

34:                                               ; preds = %30
  store ptr %.173131, ptr %6, align 8, !tbaa !17
  br label %35

35:                                               ; preds = %34, %30
  %36 = sext i32 %33 to i64
  br label %.lr.ph117.preheader

._crit_edge118.thread:                            ; preds = %2
  tail call void (ptr, ...) @print_message(ptr noundef nonnull @.str.29, i64 noundef %1)
  br label %65

.lr.ph117.preheader:                              ; preds = %35, %._crit_edge
  %.087.ph = phi i64 [ 0, %._crit_edge ], [ 1, %35 ]
  %.085.ph = phi i64 [ 0, %._crit_edge ], [ %36, %35 ]
  %.081.ph = phi ptr [ null, %._crit_edge ], [ %32, %35 ]
  br label %.lr.ph117

.lr.ph117:                                        ; preds = %.lr.ph117.preheader, %.critedge
  %.084115 = phi i64 [ %37, %.critedge ], [ 0, %.lr.ph117.preheader ]
  %.186114 = phi i64 [ %.3, %.critedge ], [ %.085.ph, %.lr.ph117.preheader ]
  %.188113 = phi i64 [ %.390, %.critedge ], [ %.087.ph, %.lr.ph117.preheader ]
  %37 = add nuw i64 %.084115, 1
  %38 = getelementptr inbounds %struct.UnitTest, ptr %0, i64 %.084115
  %39 = getelementptr inbounds i8, ptr %38, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = icmp eq ptr %40, null
  br i1 %41, label %.critedge, label %42, !llvm.loop !18

42:                                               ; preds = %.lr.ph117
  %43 = getelementptr inbounds i8, ptr %38, i64 16
  %44 = load i32, ptr %43, align 8, !tbaa !5
  switch i32 %44, label %48 [
    i32 0, label %45
    i32 1, label %.critedge
    i32 2, label %.critedge
    i32 3, label %.critedge
    i32 4, label %.critedge
  ]

45:                                               ; preds = %42
  %46 = load ptr, ptr %38, align 8, !tbaa !12
  %47 = call i32 @_run_test(ptr noundef %46, ptr noundef nonnull %40, ptr noundef %.081.ph, i32 noundef 0, ptr noundef null)
  %.not100 = icmp eq i32 %47, 0
  br i1 %.not100, label %52, label %49

48:                                               ; preds = %42
  call void (ptr, ...) @print_error(ptr noundef nonnull @.str.31, i32 noundef %44)
  br label %.critedge

49:                                               ; preds = %45
  %50 = load ptr, ptr %38, align 8, !tbaa !12
  %51 = getelementptr inbounds ptr, ptr %6, i64 %.186114
  store ptr %50, ptr %51, align 8, !tbaa !17
  br label %52

52:                                               ; preds = %49, %45
  %53 = sext i32 %47 to i64
  %54 = add i64 %.186114, %53
  %55 = add i64 %.188113, 1
  br label %.critedge

.critedge:                                        ; preds = %52, %42, %42, %42, %42, %48, %.lr.ph117
  %.390 = phi i64 [ %.188113, %.lr.ph117 ], [ %55, %52 ], [ %.188113, %42 ], [ %.188113, %42 ], [ %.188113, %42 ], [ %.188113, %42 ], [ %.188113, %48 ]
  %.3 = phi i64 [ %.186114, %.lr.ph117 ], [ %54, %52 ], [ %.186114, %42 ], [ %.186114, %42 ], [ %.186114, %42 ], [ %.186114, %42 ], [ %.186114, %48 ]
  %exitcond124.not = icmp eq i64 %37, %1
  br i1 %exitcond124.not, label %._crit_edge118, label %.lr.ph117

._crit_edge118:                                   ; preds = %.critedge
  %.not96 = icmp eq ptr %.178, null
  br i1 %.not96, label %65, label %56

56:                                               ; preds = %._crit_edge118
  %57 = load ptr, ptr %3, align 8, !tbaa !15
  %58 = call i32 @_run_test(ptr noundef %.180, ptr noundef nonnull %.178, ptr noundef %.081.ph, i32 noundef 4, ptr noundef %57)
  %.not97 = icmp eq i32 %58, 0
  br i1 %.not97, label %61, label %59

59:                                               ; preds = %56
  %60 = getelementptr inbounds ptr, ptr %6, i64 %.3
  store ptr %.180, ptr %60, align 8, !tbaa !17
  br label %61

61:                                               ; preds = %59, %56
  %62 = sext i32 %58 to i64
  %63 = add i64 %.3, %62
  %64 = add i64 %.390, 1
  br label %65

65:                                               ; preds = %._crit_edge118.thread, %61, %._crit_edge118
  %.491 = phi i64 [ %64, %61 ], [ %.390, %._crit_edge118 ], [ 0, %._crit_edge118.thread ]
  %.4 = phi i64 [ %63, %61 ], [ %.3, %._crit_edge118 ], [ 0, %._crit_edge118.thread ]
  call void (ptr, ...) @print_message(ptr noundef nonnull @.str.34, i64 noundef %.491)
  %66 = sub i64 %.491, %.4
  call void (ptr, ...) @print_error(ptr noundef nonnull @.str.35, i64 noundef %66)
  %.not98 = icmp eq i64 %.4, 0
  br i1 %.not98, label %72, label %67

67:                                               ; preds = %65
  call void (ptr, ...) @print_error(ptr noundef nonnull @.str.36, i64 noundef %.4)
  br label %68

68:                                               ; preds = %67, %68
  %.193121 = phi i64 [ 0, %67 ], [ %71, %68 ]
  %69 = getelementptr inbounds ptr, ptr %6, i64 %.193121
  %70 = load ptr, ptr %69, align 8, !tbaa !17
  call void (ptr, ...) @print_error(ptr noundef nonnull @.str.28, ptr noundef %70)
  %71 = add nuw i64 %.193121, 1
  %exitcond125.not = icmp eq i64 %71, %.4
  br i1 %exitcond125.not, label %.loopexit, label %68, !llvm.loop !19

72:                                               ; preds = %65
  call void (ptr, ...) @print_error(ptr noundef nonnull @.str.37, i64 noundef 0)
  br label %.loopexit

.loopexit:                                        ; preds = %68, %72
  call void @_test_free(ptr noundef %6, ptr noundef nonnull @.str.5, i32 noundef 2791)
  call void @fail_if_blocks_allocated(ptr noundef %4, ptr noundef nonnull @.str.42)
  %73 = trunc i64 %.4 to i32
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #2
  ret i32 %73
}

; Function Attrs: nounwind uwtable
declare hidden ptr @check_point_allocated_blocks() local_unnamed_addr #0

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 = { 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, !10, i64 16}
!6 = !{!"UnitTest", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !7, i64 0}
!16 = !{!"TestState", !7, i64 0, !7, i64 8}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


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