; LLVM IR from stan-dev/math :: lib/tbb_2020.3/src/test (test_std_thread)

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

%"class.tbb::internal::tbb_thread_v3::id" = type { i64 }

@.str = external hidden unnamed_addr constant [85 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internaleqENS0_13tbb_thread_v32idES2_(i64, i64) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalneENS0_13tbb_thread_v32idES2_(i64, i64) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64, i64) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalgtENS0_13tbb_thread_v32idES2_(i64, i64) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalleENS0_13tbb_thread_v32idES2_(i64, i64) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalgeENS0_13tbb_thread_v32idES2_(i64, i64) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14CheckRelationsPKN3tbb8internal13tbb_thread_v32idEib(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %12 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %13 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %14 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %15 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %16 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %17 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %18 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %19 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %20 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %21 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %22 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %23 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %24 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %25 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %26 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %27 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %28 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %29 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %30 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %31 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %32 = alloca i32, align 4
  %33 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %34 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %35 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %36 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %37 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %38 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  %39 = alloca %"class.tbb::internal::tbb_thread_v3::id", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %40 = zext i1 %2 to i8
  store i8 %40, ptr %6, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %189, %3
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = load i32, ptr %5, align 4, !tbaa !9
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %192

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %47, i64 %49
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %50, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %185, %46
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = load i32, ptr %5, align 4, !tbaa !9
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %188

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load i32, ptr %10, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %57, i64 %59
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %60, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %61 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %12, i32 0, i32 0
  %62 = load i64, ptr %61, align 8
  %63 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %13, i32 0, i32 0
  %64 = load i64, ptr %63, align 8
  %65 = call noundef zeroext i1 @_ZN3tbb8internaleqENS0_13tbb_thread_v32idES2_(i64 %62, i64 %64) #4
  %66 = zext i1 %65 to i32
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %67 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %14, i32 0, i32 0
  %68 = load i64, ptr %67, align 8
  %69 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %15, i32 0, i32 0
  %70 = load i64, ptr %69, align 8
  %71 = call noundef zeroext i1 @_ZN3tbb8internalneENS0_13tbb_thread_v32idES2_(i64 %68, i64 %70) #4
  %72 = xor i1 %71, true
  %73 = zext i1 %72 to i32
  %74 = icmp eq i32 %66, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %56
  br label %77

76:                                               ; preds = %56
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 129, ptr noundef @.str.3, ptr noundef null)
  br label %77

77:                                               ; preds = %76, %75
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %78 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %16, i32 0, i32 0
  %79 = load i64, ptr %78, align 8
  %80 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %17, i32 0, i32 0
  %81 = load i64, ptr %80, align 8
  %82 = call noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64 %79, i64 %81) #4
  %83 = zext i1 %82 to i32
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %84 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %18, i32 0, i32 0
  %85 = load i64, ptr %84, align 8
  %86 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %19, i32 0, i32 0
  %87 = load i64, ptr %86, align 8
  %88 = call noundef zeroext i1 @_ZN3tbb8internalgeENS0_13tbb_thread_v32idES2_(i64 %85, i64 %87) #4
  %89 = xor i1 %88, true
  %90 = zext i1 %89 to i32
  %91 = icmp eq i32 %83, %90
  br i1 %91, label %92, label %93

92:                                               ; preds = %77
  br label %94

93:                                               ; preds = %77
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 130, ptr noundef @.str.4, ptr noundef null)
  br label %94

94:                                               ; preds = %93, %92
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %95 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %20, i32 0, i32 0
  %96 = load i64, ptr %95, align 8
  %97 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %21, i32 0, i32 0
  %98 = load i64, ptr %97, align 8
  %99 = call noundef zeroext i1 @_ZN3tbb8internalgtENS0_13tbb_thread_v32idES2_(i64 %96, i64 %98) #4
  %100 = zext i1 %99 to i32
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %101 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %22, i32 0, i32 0
  %102 = load i64, ptr %101, align 8
  %103 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %23, i32 0, i32 0
  %104 = load i64, ptr %103, align 8
  %105 = call noundef zeroext i1 @_ZN3tbb8internalleENS0_13tbb_thread_v32idES2_(i64 %102, i64 %104) #4
  %106 = xor i1 %105, true
  %107 = zext i1 %106 to i32
  %108 = icmp eq i32 %100, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %94
  br label %111

110:                                              ; preds = %94
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 131, ptr noundef @.str.5, ptr noundef null)
  br label %111

111:                                              ; preds = %110, %109
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %112 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %24, i32 0, i32 0
  %113 = load i64, ptr %112, align 8
  %114 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %25, i32 0, i32 0
  %115 = load i64, ptr %114, align 8
  %116 = call noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64 %113, i64 %115) #4
  %117 = zext i1 %116 to i32
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %118 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %26, i32 0, i32 0
  %119 = load i64, ptr %118, align 8
  %120 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %27, i32 0, i32 0
  %121 = load i64, ptr %120, align 8
  %122 = call noundef zeroext i1 @_ZN3tbb8internaleqENS0_13tbb_thread_v32idES2_(i64 %119, i64 %121) #4
  %123 = zext i1 %122 to i32
  %124 = add nsw i32 %117, %123
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %125 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %28, i32 0, i32 0
  %126 = load i64, ptr %125, align 8
  %127 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %29, i32 0, i32 0
  %128 = load i64, ptr %127, align 8
  %129 = call noundef zeroext i1 @_ZN3tbb8internalgtENS0_13tbb_thread_v32idES2_(i64 %126, i64 %128) #4
  %130 = zext i1 %129 to i32
  %131 = add nsw i32 %124, %130
  %132 = icmp eq i32 %131, 1
  br i1 %132, label %133, label %134

133:                                              ; preds = %111
  br label %135

134:                                              ; preds = %111
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 132, ptr noundef @.str.6, ptr noundef null)
  br label %135

135:                                              ; preds = %134, %133
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %30, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %31, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %136 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %30, i32 0, i32 0
  %137 = load i64, ptr %136, align 8
  %138 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %31, i32 0, i32 0
  %139 = load i64, ptr %138, align 8
  %140 = call noundef zeroext i1 @_ZN3tbb8internalneENS0_13tbb_thread_v32idES2_(i64 %137, i64 %139) #4
  br i1 %140, label %148, label %141

141:                                              ; preds = %135
  %142 = load i32, ptr %7, align 4, !tbaa !9
  %143 = load i32, ptr %10, align 4, !tbaa !9
  %144 = icmp eq i32 %142, %143
  br i1 %144, label %148, label %145

145:                                              ; preds = %141
  %146 = load i8, ptr %6, align 1, !tbaa !11, !range !16, !noundef !17
  %147 = trunc i8 %146 to i1
  br i1 %147, label %148, label %149

148:                                              ; preds = %145, %141, %135
  br label %150

149:                                              ; preds = %145
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 133, ptr noundef @.str.7, ptr noundef null)
  br label %150

150:                                              ; preds = %149, %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  store i32 0, ptr %32, align 4, !tbaa !9
  br label %151

151:                                              ; preds = %181, %150
  %152 = load i32, ptr %32, align 4, !tbaa !9
  %153 = load i32, ptr %5, align 4, !tbaa !9
  %154 = icmp slt i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  br label %184

156:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #4
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = load i32, ptr %10, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %157, i64 %159
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %160, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %34, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %161 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %34, i32 0, i32 0
  %162 = load i64, ptr %161, align 8
  %163 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %35, i32 0, i32 0
  %164 = load i64, ptr %163, align 8
  %165 = call noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64 %162, i64 %164) #4
  br i1 %165, label %166, label %178

166:                                              ; preds = %156
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %33, i64 8, i1 false), !tbaa.struct !13
  %167 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %36, i32 0, i32 0
  %168 = load i64, ptr %167, align 8
  %169 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %37, i32 0, i32 0
  %170 = load i64, ptr %169, align 8
  %171 = call noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64 %168, i64 %170) #4
  br i1 %171, label %172, label %178

172:                                              ; preds = %166
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %38, ptr align 8 %9, i64 8, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %39, ptr align 8 %33, i64 8, i1 false), !tbaa.struct !13
  %173 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %38, i32 0, i32 0
  %174 = load i64, ptr %173, align 8
  %175 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %39, i32 0, i32 0
  %176 = load i64, ptr %175, align 8
  %177 = call noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64 %174, i64 %176) #4
  br i1 %177, label %178, label %179

178:                                              ; preds = %172, %166, %156
  br label %180

179:                                              ; preds = %172
  call void @_Z11ReportErrorPKciS0_S0_(ptr noundef @.str, i32 noundef 136, ptr noundef @.str.8, ptr noundef @.str.9)
  br label %180

180:                                              ; preds = %179, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #4
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %32, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %32, align 4, !tbaa !9
  br label %151, !llvm.loop !18

184:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %10, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %10, align 4, !tbaa !9
  br label %51, !llvm.loop !20

188:                                              ; preds = %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %7, align 4, !tbaa !9
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %7, align 4, !tbaa !9
  br label %41, !llvm.loop !21

192:                                              ; preds = %45
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11ReportErrorPKciS0_S0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i64 0, i64 8, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}


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

%"class.tbb::internal::tbb_thread_v3::id" = type { i64 }

@.str = external hidden unnamed_addr constant [85 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internaleqENS0_13tbb_thread_v32idES2_(i64, i64) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalneENS0_13tbb_thread_v32idES2_(i64, i64) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64, i64) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalgtENS0_13tbb_thread_v32idES2_(i64, i64) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalleENS0_13tbb_thread_v32idES2_(i64, i64) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3tbb8internalgeENS0_13tbb_thread_v32idES2_(i64, i64) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z14CheckRelationsPKN3tbb8internal13tbb_thread_v32idEib(ptr nocapture noundef readonly %0, i32 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #1 {
  %4 = icmp sgt i32 %1, 0
  br i1 %4, label %.lr.ph74.us.preheader, label %._crit_edge79

.lr.ph74.us.preheader:                            ; preds = %3
  %wide.trip.count85 = zext nneg i32 %1 to i64
  br label %.lr.ph74.us

.lr.ph74.us:                                      ; preds = %.lr.ph74.us.preheader, %._crit_edge75.us
  %indvars.iv82 = phi i64 [ 0, %.lr.ph74.us.preheader ], [ %indvars.iv.next83, %._crit_edge75.us ]
  %5 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %0, i64 %indvars.iv82
  %.sroa.046.0.copyload.us = load i64, ptr %5, align 8, !tbaa !5
  br label %6

6:                                                ; preds = %.lr.ph74.us, %._crit_edge.us
  %indvars.iv = phi i64 [ 0, %.lr.ph74.us ], [ %indvars.iv.next, %._crit_edge.us ]
  %7 = getelementptr inbounds %"class.tbb::internal::tbb_thread_v3::id", ptr %0, i64 %indvars.iv
  %.sroa.029.0.copyload.us = load i64, ptr %7, align 8, !tbaa !5
  %8 = tail call noundef zeroext i1 @_ZN3tbb8internaleqENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  %9 = tail call noundef zeroext i1 @_ZN3tbb8internalneENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  %10 = xor i1 %8, %9
  br i1 %10, label %12, label %11

11:                                               ; preds = %6
  tail call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 129, ptr noundef nonnull @.str.3, ptr noundef null)
  br label %12

12:                                               ; preds = %11, %6
  %13 = tail call noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  %14 = tail call noundef zeroext i1 @_ZN3tbb8internalgeENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  %15 = xor i1 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  tail call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 130, ptr noundef nonnull @.str.4, ptr noundef null)
  br label %17

17:                                               ; preds = %16, %12
  %18 = tail call noundef zeroext i1 @_ZN3tbb8internalgtENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  %19 = tail call noundef zeroext i1 @_ZN3tbb8internalleENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  %20 = xor i1 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  tail call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 131, ptr noundef nonnull @.str.5, ptr noundef null)
  br label %22

22:                                               ; preds = %21, %17
  %23 = tail call noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  %24 = zext i1 %23 to i32
  %25 = tail call noundef zeroext i1 @_ZN3tbb8internaleqENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  %26 = zext i1 %25 to i32
  %27 = add nuw nsw i32 %26, %24
  %28 = tail call noundef zeroext i1 @_ZN3tbb8internalgtENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  %29 = zext i1 %28 to i32
  %30 = add nuw nsw i32 %27, %29
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %33, label %32

32:                                               ; preds = %22
  tail call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 132, ptr noundef nonnull @.str.6, ptr noundef null)
  br label %33

33:                                               ; preds = %32, %22
  %34 = tail call noundef zeroext i1 @_ZN3tbb8internalneENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  %35 = icmp eq i64 %indvars.iv82, %indvars.iv
  %or.cond.us = or i1 %35, %34
  %brmerge.us = or i1 %or.cond.us, %2
  br i1 %brmerge.us, label %.lr.ph.us.preheader, label %36

36:                                               ; preds = %33
  tail call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 133, ptr noundef nonnull @.str.7, ptr noundef null)
  br label %.lr.ph.us.preheader

.lr.ph.us.preheader:                              ; preds = %36, %33
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %43
  %.06971.us = phi i32 [ %44, %43 ], [ 0, %.lr.ph.us.preheader ]
  %.sroa.06.0.copyload.us = load i64, ptr %7, align 8, !tbaa !5
  %37 = tail call noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.029.0.copyload.us) #2
  br i1 %37, label %38, label %43

38:                                               ; preds = %.lr.ph.us
  %39 = tail call noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64 %.sroa.029.0.copyload.us, i64 %.sroa.06.0.copyload.us) #2
  br i1 %39, label %40, label %43

40:                                               ; preds = %38
  %41 = tail call noundef zeroext i1 @_ZN3tbb8internalltENS0_13tbb_thread_v32idES2_(i64 %.sroa.046.0.copyload.us, i64 %.sroa.06.0.copyload.us) #2
  br i1 %41, label %43, label %42

42:                                               ; preds = %40
  tail call void @_Z11ReportErrorPKciS0_S0_(ptr noundef nonnull @.str, i32 noundef 136, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9)
  br label %43

43:                                               ; preds = %42, %40, %38, %.lr.ph.us
  %44 = add nuw nsw i32 %.06971.us, 1
  %exitcond.not = icmp eq i32 %44, %1
  br i1 %exitcond.not, label %._crit_edge.us, label %.lr.ph.us, !llvm.loop !9

._crit_edge.us:                                   ; preds = %43
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond81.not = icmp eq i64 %indvars.iv.next, %wide.trip.count85
  br i1 %exitcond81.not, label %._crit_edge75.us, label %6, !llvm.loop !11

._crit_edge75.us:                                 ; preds = %._crit_edge.us
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
  br i1 %exitcond86.not, label %._crit_edge79, label %.lr.ph74.us, !llvm.loop !12

._crit_edge79:                                    ; preds = %._crit_edge75.us, %3
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11ReportErrorPKciS0_S0_(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { inlinehint mustprogress 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 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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