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

; 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.TestContextFpuEnvNativeLoopBody = type { i8 }
%class.TestContextFpuEnvEhNativeLoopBody = type { i8 }

@_ZL8SseModes = external hidden constant [4 x i32], align 16
@_ZL13RoundingModes = external hidden constant [4 x i32], align 16
@contexts = external dso_local global [16 x ptr], align 16
@roundingModes = external dso_local global [20 x i32], align 16
@sseModes = external dso_local global [20 x i32], align 16

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z10SetSseModei(i32 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z15SetRoundingModei(i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17TestContextFpuEnvv() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %class.TestContextFpuEnvNativeLoopBody, align 1
  %11 = alloca %class.TestContextFpuEnvEhNativeLoopBody, align 1
  %12 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %56, %0
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 4
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  br label %59

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [4 x i32], ptr @_ZL13RoundingModes, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %21, ptr %4, align 4, !tbaa !5
  %22 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z15SetRoundingModei(i32 noundef %22)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %46, %17
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = icmp slt i32 %24, 4
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %55

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [4 x i32], ptr @_ZL8SseModes, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %31, ptr %6, align 4, !tbaa !5
  %32 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z10SetSseModei(i32 noundef %32)
  %33 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 256) #7
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %33, i32 noundef 0, i64 noundef 196608)
          to label %34 unwind label %51

34:                                               ; preds = %27
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [16 x ptr], ptr @contexts, i64 0, i64 %36
  store ptr %33, ptr %37, align 8, !tbaa !9
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [20 x i32], ptr @roundingModes, i64 0, i64 %40
  store i32 %38, ptr %41, align 4, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [20 x i32], ptr @sseModes, i64 0, i64 %44
  store i32 %42, ptr %45, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %46

46:                                               ; preds = %34
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %5, align 4, !tbaa !5
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %2, align 4, !tbaa !5
  br label %23, !llvm.loop !11

51:                                               ; preds = %27
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %7, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %33, i64 noundef 256) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  br label %103

55:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %1, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %1, align 4, !tbaa !5
  br label %13, !llvm.loop !13

59:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %83, %59
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = icmp slt i32 %61, 4
  br i1 %62, label %64, label %63

63:                                               ; preds = %60
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %86

64:                                               ; preds = %60
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = srem i32 %65, 16
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [20 x i32], ptr @roundingModes, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = load i32, ptr %9, align 4, !tbaa !5
  %71 = add nsw i32 16, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [20 x i32], ptr @roundingModes, i64 0, i64 %72
  store i32 %69, ptr %73, align 4, !tbaa !5
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = srem i32 %74, 16
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [20 x i32], ptr @sseModes, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = add nsw i32 16, %79
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [20 x i32], ptr @sseModes, i64 0, i64 %81
  store i32 %78, ptr %82, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %64
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %9, align 4, !tbaa !5
  br label %60, !llvm.loop !14

86:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  call void @_Z17NativeParallelForIi31TestContextFpuEnvNativeLoopBodyEvT_RKT0_(i32 noundef 4, ptr noundef nonnull align 1 dereferenceable(1) %10)
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  call void @_Z17NativeParallelForIi33TestContextFpuEnvEhNativeLoopBodyEvT_RKT0_(i32 noundef 4, ptr noundef nonnull align 1 dereferenceable(1) %11)
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %99, %86
  %88 = load i32, ptr %12, align 4, !tbaa !5
  %89 = icmp slt i32 %88, 16
  br i1 %89, label %91, label %90

90:                                               ; preds = %87
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %102

91:                                               ; preds = %87
  %92 = load i32, ptr %12, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [16 x ptr], ptr @contexts, i64 0, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  %96 = icmp eq ptr %95, null
  br i1 %96, label %98, label %97

97:                                               ; preds = %91
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %95) #6
  call void @_ZdlPvm(ptr noundef %95, i64 noundef 256) #8
  br label %98

98:                                               ; preds = %97, %91
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %12, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %12, align 4, !tbaa !5
  br label %87, !llvm.loop !15

102:                                              ; preds = %90
  ret void

103:                                              ; preds = %51
  %104 = load ptr, ptr %7, align 8
  %105 = load i32, ptr %8, align 4
  %106 = insertvalue { ptr, i32 } poison, ptr %104, 0
  %107 = insertvalue { ptr, i32 } %106, i32 %105, 1
  resume { ptr, i32 } %107
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256), i32 noundef, i64 noundef) unnamed_addr #2 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17NativeParallelForIi31TestContextFpuEnvNativeLoopBodyEvT_RKT0_(i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17NativeParallelForIi33TestContextFpuEnvEhNativeLoopBodyEvT_RKT0_(i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) #2

; Function Attrs: nounwind
declare void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #5

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 = { 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 #3 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 #5 = { nounwind "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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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

%class.TestContextFpuEnvNativeLoopBody = type { i8 }
%class.TestContextFpuEnvEhNativeLoopBody = type { i8 }

@_ZL8SseModes = external hidden local_unnamed_addr constant [4 x i32], align 16
@_ZL13RoundingModes = external hidden local_unnamed_addr constant [4 x i32], align 16
@contexts = external dso_local local_unnamed_addr global [16 x ptr], align 16
@roundingModes = external dso_local local_unnamed_addr global [20 x i32], align 16
@sseModes = external dso_local local_unnamed_addr global [20 x i32], align 16

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z10SetSseModei(i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z15SetRoundingModei(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17TestContextFpuEnvv() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.TestContextFpuEnvNativeLoopBody, align 1
  %2 = alloca %class.TestContextFpuEnvEhNativeLoopBody, align 1
  %3 = load i32, ptr @_ZL13RoundingModes, align 16, !tbaa !5
  tail call void @_Z15SetRoundingModei(i32 noundef %3)
  %4 = load i32, ptr @_ZL8SseModes, align 16, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %4)
  %5 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %5, i32 noundef 0, i64 noundef 196608)
          to label %6 unwind label %46

6:                                                ; preds = %0
  store ptr %5, ptr @contexts, align 16, !tbaa !9
  store i32 %3, ptr @roundingModes, align 16, !tbaa !5
  store i32 %4, ptr @sseModes, align 16, !tbaa !5
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL8SseModes, i64 4), align 4, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %7)
  %8 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %8, i32 noundef 0, i64 noundef 196608)
          to label %9 unwind label %46

9:                                                ; preds = %6
  store ptr %8, ptr getelementptr inbounds (i8, ptr @contexts, i64 8), align 8, !tbaa !9
  store i32 %3, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 4), align 4, !tbaa !5
  store i32 %7, ptr getelementptr inbounds (i8, ptr @sseModes, i64 4), align 4, !tbaa !5
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL8SseModes, i64 8), align 8, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %10)
  %11 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %11, i32 noundef 0, i64 noundef 196608)
          to label %12 unwind label %46

12:                                               ; preds = %9
  store ptr %11, ptr getelementptr inbounds (i8, ptr @contexts, i64 16), align 16, !tbaa !9
  store i32 %3, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 8), align 8, !tbaa !5
  store i32 %10, ptr getelementptr inbounds (i8, ptr @sseModes, i64 8), align 8, !tbaa !5
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL8SseModes, i64 12), align 4, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %13)
  %14 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %14, i32 noundef 0, i64 noundef 196608)
          to label %15 unwind label %46

15:                                               ; preds = %12
  store ptr %14, ptr getelementptr inbounds (i8, ptr @contexts, i64 24), align 8, !tbaa !9
  store i32 %3, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 12), align 4, !tbaa !5
  store i32 %13, ptr getelementptr inbounds (i8, ptr @sseModes, i64 12), align 4, !tbaa !5
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL13RoundingModes, i64 4), align 4, !tbaa !5
  tail call void @_Z15SetRoundingModei(i32 noundef %16)
  tail call void @_Z10SetSseModei(i32 noundef %4)
  %17 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %17, i32 noundef 0, i64 noundef 196608)
          to label %18 unwind label %46

18:                                               ; preds = %15
  store ptr %17, ptr getelementptr inbounds (i8, ptr @contexts, i64 32), align 16, !tbaa !9
  store i32 %16, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 16), align 16, !tbaa !5
  store i32 %4, ptr getelementptr inbounds (i8, ptr @sseModes, i64 16), align 16, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %7)
  %19 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %19, i32 noundef 0, i64 noundef 196608)
          to label %20 unwind label %46

20:                                               ; preds = %18
  store ptr %19, ptr getelementptr inbounds (i8, ptr @contexts, i64 40), align 8, !tbaa !9
  store i32 %16, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 20), align 4, !tbaa !5
  store i32 %7, ptr getelementptr inbounds (i8, ptr @sseModes, i64 20), align 4, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %10)
  %21 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %21, i32 noundef 0, i64 noundef 196608)
          to label %22 unwind label %46

22:                                               ; preds = %20
  store ptr %21, ptr getelementptr inbounds (i8, ptr @contexts, i64 48), align 16, !tbaa !9
  store i32 %16, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 24), align 8, !tbaa !5
  store i32 %10, ptr getelementptr inbounds (i8, ptr @sseModes, i64 24), align 8, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %13)
  %23 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %23, i32 noundef 0, i64 noundef 196608)
          to label %24 unwind label %46

24:                                               ; preds = %22
  store ptr %23, ptr getelementptr inbounds (i8, ptr @contexts, i64 56), align 8, !tbaa !9
  store i32 %16, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 28), align 4, !tbaa !5
  store i32 %13, ptr getelementptr inbounds (i8, ptr @sseModes, i64 28), align 4, !tbaa !5
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL13RoundingModes, i64 8), align 8, !tbaa !5
  tail call void @_Z15SetRoundingModei(i32 noundef %25)
  tail call void @_Z10SetSseModei(i32 noundef %4)
  %26 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %26, i32 noundef 0, i64 noundef 196608)
          to label %27 unwind label %46

27:                                               ; preds = %24
  store ptr %26, ptr getelementptr inbounds (i8, ptr @contexts, i64 64), align 16, !tbaa !9
  store i32 %25, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 32), align 16, !tbaa !5
  store i32 %4, ptr getelementptr inbounds (i8, ptr @sseModes, i64 32), align 16, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %7)
  %28 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %28, i32 noundef 0, i64 noundef 196608)
          to label %29 unwind label %46

29:                                               ; preds = %27
  store ptr %28, ptr getelementptr inbounds (i8, ptr @contexts, i64 72), align 8, !tbaa !9
  store i32 %25, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 36), align 4, !tbaa !5
  store i32 %7, ptr getelementptr inbounds (i8, ptr @sseModes, i64 36), align 4, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %10)
  %30 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %30, i32 noundef 0, i64 noundef 196608)
          to label %31 unwind label %46

31:                                               ; preds = %29
  store ptr %30, ptr getelementptr inbounds (i8, ptr @contexts, i64 80), align 16, !tbaa !9
  store i32 %25, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 40), align 8, !tbaa !5
  store i32 %10, ptr getelementptr inbounds (i8, ptr @sseModes, i64 40), align 8, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %13)
  %32 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %32, i32 noundef 0, i64 noundef 196608)
          to label %33 unwind label %46

33:                                               ; preds = %31
  store ptr %32, ptr getelementptr inbounds (i8, ptr @contexts, i64 88), align 8, !tbaa !9
  store i32 %25, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 44), align 4, !tbaa !5
  store i32 %13, ptr getelementptr inbounds (i8, ptr @sseModes, i64 44), align 4, !tbaa !5
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL13RoundingModes, i64 12), align 4, !tbaa !5
  tail call void @_Z15SetRoundingModei(i32 noundef %34)
  tail call void @_Z10SetSseModei(i32 noundef %4)
  %35 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %35, i32 noundef 0, i64 noundef 196608)
          to label %36 unwind label %46

36:                                               ; preds = %33
  store ptr %35, ptr getelementptr inbounds (i8, ptr @contexts, i64 96), align 16, !tbaa !9
  store i32 %34, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 48), align 16, !tbaa !5
  store i32 %4, ptr getelementptr inbounds (i8, ptr @sseModes, i64 48), align 16, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %7)
  %37 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %37, i32 noundef 0, i64 noundef 196608)
          to label %38 unwind label %46

38:                                               ; preds = %36
  store ptr %37, ptr getelementptr inbounds (i8, ptr @contexts, i64 104), align 8, !tbaa !9
  store i32 %34, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 52), align 4, !tbaa !5
  store i32 %7, ptr getelementptr inbounds (i8, ptr @sseModes, i64 52), align 4, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %10)
  %39 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %39, i32 noundef 0, i64 noundef 196608)
          to label %40 unwind label %46

40:                                               ; preds = %38
  store ptr %39, ptr getelementptr inbounds (i8, ptr @contexts, i64 112), align 16, !tbaa !9
  store i32 %34, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 56), align 8, !tbaa !5
  store i32 %10, ptr getelementptr inbounds (i8, ptr @sseModes, i64 56), align 8, !tbaa !5
  tail call void @_Z10SetSseModei(i32 noundef %13)
  %41 = tail call noalias noundef nonnull dereferenceable(256) ptr @_Znwm(i64 noundef 256) #6
  invoke void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256) %41, i32 noundef 0, i64 noundef 196608)
          to label %.preheader.preheader unwind label %46

.preheader.preheader:                             ; preds = %40
  store ptr %41, ptr getelementptr inbounds (i8, ptr @contexts, i64 120), align 8, !tbaa !9
  store i32 %34, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 60), align 4, !tbaa !5
  store i32 %13, ptr getelementptr inbounds (i8, ptr @sseModes, i64 60), align 4, !tbaa !5
  %42 = load <4 x i32>, ptr @roundingModes, align 16, !tbaa !5
  store <4 x i32> %42, ptr getelementptr inbounds (i8, ptr @roundingModes, i64 64), align 16, !tbaa !5
  %43 = load <4 x i32>, ptr @sseModes, align 16, !tbaa !5
  store <4 x i32> %43, ptr getelementptr inbounds (i8, ptr @sseModes, i64 64), align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #7
  call void @_Z17NativeParallelForIi31TestContextFpuEnvNativeLoopBodyEvT_RKT0_(i32 noundef 4, ptr noundef nonnull align 1 dereferenceable(1) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #7
  call void @_Z17NativeParallelForIi33TestContextFpuEnvEhNativeLoopBodyEvT_RKT0_(i32 noundef 4, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  %44 = load ptr, ptr @contexts, align 16, !tbaa !9
  %45 = icmp eq ptr %44, null
  br i1 %45, label %49, label %48

46:                                               ; preds = %40, %38, %36, %33, %31, %29, %27, %24, %22, %20, %18, %15, %12, %9, %6, %0
  %.lcssa = phi ptr [ %5, %0 ], [ %8, %6 ], [ %11, %9 ], [ %14, %12 ], [ %17, %15 ], [ %19, %18 ], [ %21, %20 ], [ %23, %22 ], [ %26, %24 ], [ %28, %27 ], [ %30, %29 ], [ %32, %31 ], [ %35, %33 ], [ %37, %36 ], [ %39, %38 ], [ %41, %40 ]
  %47 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %.lcssa, i64 noundef 256) #8
  resume { ptr, i32 } %47

48:                                               ; preds = %.preheader.preheader
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %44) #7
  call void @_ZdlPvm(ptr noundef nonnull %44, i64 noundef 256) #8
  br label %49

49:                                               ; preds = %.preheader.preheader, %48
  %50 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 8), align 8, !tbaa !9
  %51 = icmp eq ptr %50, null
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %50) #7
  call void @_ZdlPvm(ptr noundef nonnull %50, i64 noundef 256) #8
  br label %53

53:                                               ; preds = %52, %49
  %54 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 16), align 16, !tbaa !9
  %55 = icmp eq ptr %54, null
  br i1 %55, label %57, label %56

56:                                               ; preds = %53
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %54) #7
  call void @_ZdlPvm(ptr noundef nonnull %54, i64 noundef 256) #8
  br label %57

57:                                               ; preds = %56, %53
  %58 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 24), align 8, !tbaa !9
  %59 = icmp eq ptr %58, null
  br i1 %59, label %61, label %60

60:                                               ; preds = %57
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %58) #7
  call void @_ZdlPvm(ptr noundef nonnull %58, i64 noundef 256) #8
  br label %61

61:                                               ; preds = %60, %57
  %62 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 32), align 16, !tbaa !9
  %63 = icmp eq ptr %62, null
  br i1 %63, label %65, label %64

64:                                               ; preds = %61
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %62) #7
  call void @_ZdlPvm(ptr noundef nonnull %62, i64 noundef 256) #8
  br label %65

65:                                               ; preds = %64, %61
  %66 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 40), align 8, !tbaa !9
  %67 = icmp eq ptr %66, null
  br i1 %67, label %69, label %68

68:                                               ; preds = %65
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %66) #7
  call void @_ZdlPvm(ptr noundef nonnull %66, i64 noundef 256) #8
  br label %69

69:                                               ; preds = %68, %65
  %70 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 48), align 16, !tbaa !9
  %71 = icmp eq ptr %70, null
  br i1 %71, label %73, label %72

72:                                               ; preds = %69
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %70) #7
  call void @_ZdlPvm(ptr noundef nonnull %70, i64 noundef 256) #8
  br label %73

73:                                               ; preds = %72, %69
  %74 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 56), align 8, !tbaa !9
  %75 = icmp eq ptr %74, null
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %74) #7
  call void @_ZdlPvm(ptr noundef nonnull %74, i64 noundef 256) #8
  br label %77

77:                                               ; preds = %76, %73
  %78 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 64), align 16, !tbaa !9
  %79 = icmp eq ptr %78, null
  br i1 %79, label %81, label %80

80:                                               ; preds = %77
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %78) #7
  call void @_ZdlPvm(ptr noundef nonnull %78, i64 noundef 256) #8
  br label %81

81:                                               ; preds = %80, %77
  %82 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 72), align 8, !tbaa !9
  %83 = icmp eq ptr %82, null
  br i1 %83, label %85, label %84

84:                                               ; preds = %81
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %82) #7
  call void @_ZdlPvm(ptr noundef nonnull %82, i64 noundef 256) #8
  br label %85

85:                                               ; preds = %84, %81
  %86 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 80), align 16, !tbaa !9
  %87 = icmp eq ptr %86, null
  br i1 %87, label %89, label %88

88:                                               ; preds = %85
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %86) #7
  call void @_ZdlPvm(ptr noundef nonnull %86, i64 noundef 256) #8
  br label %89

89:                                               ; preds = %88, %85
  %90 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 88), align 8, !tbaa !9
  %91 = icmp eq ptr %90, null
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %90) #7
  call void @_ZdlPvm(ptr noundef nonnull %90, i64 noundef 256) #8
  br label %93

93:                                               ; preds = %92, %89
  %94 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 96), align 16, !tbaa !9
  %95 = icmp eq ptr %94, null
  br i1 %95, label %97, label %96

96:                                               ; preds = %93
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %94) #7
  call void @_ZdlPvm(ptr noundef nonnull %94, i64 noundef 256) #8
  br label %97

97:                                               ; preds = %96, %93
  %98 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 104), align 8, !tbaa !9
  %99 = icmp eq ptr %98, null
  br i1 %99, label %101, label %100

100:                                              ; preds = %97
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %98) #7
  call void @_ZdlPvm(ptr noundef nonnull %98, i64 noundef 256) #8
  br label %101

101:                                              ; preds = %100, %97
  %102 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 112), align 16, !tbaa !9
  %103 = icmp eq ptr %102, null
  br i1 %103, label %105, label %104

104:                                              ; preds = %101
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %102) #7
  call void @_ZdlPvm(ptr noundef nonnull %102, i64 noundef 256) #8
  br label %105

105:                                              ; preds = %104, %101
  %106 = load ptr, ptr getelementptr inbounds (i8, ptr @contexts, i64 120), align 8, !tbaa !9
  %107 = icmp eq ptr %106, null
  br i1 %107, label %109, label %108

108:                                              ; preds = %105
  call void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %106) #7
  call void @_ZdlPvm(ptr noundef nonnull %106, i64 noundef 256) #8
  br label %109

109:                                              ; preds = %108, %105
  ret void
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3tbb18task_group_contextC2ENS0_9kind_typeEm(ptr noundef nonnull align 8 dereferenceable(256), i32 noundef, i64 noundef) unnamed_addr #2 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17NativeParallelForIi31TestContextFpuEnvNativeLoopBodyEvT_RKT0_(i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z17NativeParallelForIi33TestContextFpuEnvEhNativeLoopBodyEvT_RKT0_(i32 noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3tbb18task_group_contextD1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #5

attributes #0 = { mustprogress 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 = { 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 #3 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 #5 = { nounwind "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 #6 = { builtin allocsize(0) }
attributes #7 = { nounwind }
attributes #8 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass