; LLVM IR from tsotchke/quantum_geometric_tensor :: src/quantum_geometric/core (quantum_parameter_shift)

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @compute_parameter_shift_gradient(ptr noundef, i64 noundef, double noundef, ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @compute_higher_order_gradient(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5) #0 {
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i64 %1, ptr %9, align 8, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store i64 %3, ptr %11, align 8, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %36

24:                                               ; preds = %6
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %36

27:                                               ; preds = %24
  %28 = load ptr, ptr %13, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %36

30:                                               ; preds = %27
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %36

33:                                               ; preds = %30
  %34 = load i64, ptr %11, align 8, !tbaa !9
  %35 = icmp ult i64 %34, 2
  br i1 %35, label %36, label %37

36:                                               ; preds = %33, %30, %27, %24, %6
  store i1 false, ptr %7, align 1
  br label %181

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %38 = load i64, ptr %11, align 8, !tbaa !9
  %39 = mul i64 %38, 8
  %40 = call noalias ptr @malloc(i64 noundef %39) #5
  store ptr %40, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %41 = load i64, ptr %11, align 8, !tbaa !9
  %42 = mul i64 %41, 8
  %43 = call noalias ptr @malloc(i64 noundef %42) #5
  store ptr %43, ptr %15, align 8, !tbaa !5
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %49

46:                                               ; preds = %37
  %47 = load ptr, ptr %15, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %52, label %49

49:                                               ; preds = %46, %37
  %50 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %50) #4
  %51 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %51) #4
  store i1 false, ptr %7, align 1
  store i32 1, ptr %16, align 4
  br label %180

52:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %53

53:                                               ; preds = %119, %52
  %54 = load i64, ptr %17, align 8, !tbaa !9
  %55 = load i64, ptr %11, align 8, !tbaa !9
  %56 = icmp ult i64 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 2, ptr %16, align 4
  br label %122

58:                                               ; preds = %53
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = load i64, ptr %9, align 8, !tbaa !9
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = load i64, ptr %17, align 8, !tbaa !9
  %63 = getelementptr inbounds double, ptr %61, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !11
  %65 = load ptr, ptr %14, align 8, !tbaa !5
  %66 = load i64, ptr %17, align 8, !tbaa !9
  %67 = getelementptr inbounds ptr, ptr %65, i64 %66
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = load i64, ptr %17, align 8, !tbaa !9
  %70 = getelementptr inbounds i64, ptr %68, i64 %69
  %71 = call zeroext i1 @compute_parameter_shift_gradient(ptr noundef %59, i64 noundef %60, double noundef %64, ptr noundef %67, ptr noundef %70)
  br i1 %71, label %89, label %72

72:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store i64 0, ptr %18, align 8, !tbaa !9
  br label %73

73:                                               ; preds = %83, %72
  %74 = load i64, ptr %18, align 8, !tbaa !9
  %75 = load i64, ptr %17, align 8, !tbaa !9
  %76 = icmp ult i64 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %86

78:                                               ; preds = %73
  %79 = load ptr, ptr %14, align 8, !tbaa !5
  %80 = load i64, ptr %18, align 8, !tbaa !9
  %81 = getelementptr inbounds ptr, ptr %79, i64 %80
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  call void @free(ptr noundef %82) #4
  br label %83

83:                                               ; preds = %78
  %84 = load i64, ptr %18, align 8, !tbaa !9
  %85 = add i64 %84, 1
  store i64 %85, ptr %18, align 8, !tbaa !9
  br label %73, !llvm.loop !13

86:                                               ; preds = %77
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %87) #4
  %88 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %88) #4
  store i1 false, ptr %7, align 1
  store i32 1, ptr %16, align 4
  br label %122

89:                                               ; preds = %58
  %90 = load i64, ptr %17, align 8, !tbaa !9
  %91 = icmp ugt i64 %90, 0
  br i1 %91, label %92, label %118

92:                                               ; preds = %89
  %93 = load ptr, ptr %15, align 8, !tbaa !5
  %94 = load i64, ptr %17, align 8, !tbaa !9
  %95 = getelementptr inbounds i64, ptr %93, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !9
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = getelementptr inbounds i64, ptr %97, i64 0
  %99 = load i64, ptr %98, align 8, !tbaa !9
  %100 = icmp ne i64 %96, %99
  br i1 %100, label %101, label %118

101:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %102

102:                                              ; preds = %112, %101
  %103 = load i64, ptr %19, align 8, !tbaa !9
  %104 = load i64, ptr %17, align 8, !tbaa !9
  %105 = icmp ule i64 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %115

107:                                              ; preds = %102
  %108 = load ptr, ptr %14, align 8, !tbaa !5
  %109 = load i64, ptr %19, align 8, !tbaa !9
  %110 = getelementptr inbounds ptr, ptr %108, i64 %109
  %111 = load ptr, ptr %110, align 8, !tbaa !5
  call void @free(ptr noundef %111) #4
  br label %112

112:                                              ; preds = %107
  %113 = load i64, ptr %19, align 8, !tbaa !9
  %114 = add i64 %113, 1
  store i64 %114, ptr %19, align 8, !tbaa !9
  br label %102, !llvm.loop !15

115:                                              ; preds = %106
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %116) #4
  %117 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %117) #4
  store i1 false, ptr %7, align 1
  store i32 1, ptr %16, align 4
  br label %122

118:                                              ; preds = %92, %89
  br label %119

119:                                              ; preds = %118
  %120 = load i64, ptr %17, align 8, !tbaa !9
  %121 = add i64 %120, 1
  store i64 %121, ptr %17, align 8, !tbaa !9
  br label %53, !llvm.loop !16

122:                                              ; preds = %115, %86, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %123 = load i32, ptr %16, align 4
  switch i32 %123, label %180 [
    i32 2, label %124
  ]

124:                                              ; preds = %122
  %125 = load ptr, ptr %15, align 8, !tbaa !5
  %126 = getelementptr inbounds i64, ptr %125, i64 0
  %127 = load i64, ptr %126, align 8, !tbaa !9
  %128 = mul i64 %127, 8
  %129 = call noalias ptr @malloc(i64 noundef %128) #5
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %129, ptr %130, align 8, !tbaa !5
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = icmp ne ptr %132, null
  br i1 %133, label %151, label %134

134:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  store i64 0, ptr %20, align 8, !tbaa !9
  br label %135

135:                                              ; preds = %145, %134
  %136 = load i64, ptr %20, align 8, !tbaa !9
  %137 = load i64, ptr %11, align 8, !tbaa !9
  %138 = icmp ult i64 %136, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %135
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %148

140:                                              ; preds = %135
  %141 = load ptr, ptr %14, align 8, !tbaa !5
  %142 = load i64, ptr %20, align 8, !tbaa !9
  %143 = getelementptr inbounds ptr, ptr %141, i64 %142
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  call void @free(ptr noundef %144) #4
  br label %145

145:                                              ; preds = %140
  %146 = load i64, ptr %20, align 8, !tbaa !9
  %147 = add i64 %146, 1
  store i64 %147, ptr %20, align 8, !tbaa !9
  br label %135, !llvm.loop !17

148:                                              ; preds = %139
  %149 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %149) #4
  %150 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %150) #4
  store i1 false, ptr %7, align 1
  store i32 1, ptr %16, align 4
  br label %180

151:                                              ; preds = %124
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = load i64, ptr %11, align 8, !tbaa !9
  %154 = load ptr, ptr %15, align 8, !tbaa !5
  %155 = getelementptr inbounds i64, ptr %154, i64 0
  %156 = load i64, ptr %155, align 8, !tbaa !9
  %157 = load ptr, ptr %10, align 8, !tbaa !5
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = load ptr, ptr %158, align 8, !tbaa !5
  call void @richardson_extrapolate(ptr noundef %152, i64 noundef %153, i64 noundef %156, ptr noundef %157, ptr noundef %159)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store i64 0, ptr %21, align 8, !tbaa !9
  br label %160

160:                                              ; preds = %170, %151
  %161 = load i64, ptr %21, align 8, !tbaa !9
  %162 = load i64, ptr %11, align 8, !tbaa !9
  %163 = icmp ult i64 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  store i32 14, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %173

165:                                              ; preds = %160
  %166 = load ptr, ptr %14, align 8, !tbaa !5
  %167 = load i64, ptr %21, align 8, !tbaa !9
  %168 = getelementptr inbounds ptr, ptr %166, i64 %167
  %169 = load ptr, ptr %168, align 8, !tbaa !5
  call void @free(ptr noundef %169) #4
  br label %170

170:                                              ; preds = %165
  %171 = load i64, ptr %21, align 8, !tbaa !9
  %172 = add i64 %171, 1
  store i64 %172, ptr %21, align 8, !tbaa !9
  br label %160, !llvm.loop !18

173:                                              ; preds = %164
  %174 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %174) #4
  %175 = load ptr, ptr %15, align 8, !tbaa !5
  %176 = getelementptr inbounds i64, ptr %175, i64 0
  %177 = load i64, ptr %176, align 8, !tbaa !9
  %178 = load ptr, ptr %13, align 8, !tbaa !5
  store i64 %177, ptr %178, align 8, !tbaa !9
  %179 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %179) #4
  store i1 true, ptr %7, align 1
  store i32 1, ptr %16, align 4
  br label %180

180:                                              ; preds = %173, %148, %122, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %181

181:                                              ; preds = %180, %36
  %182 = load i1, ptr %7, align 1
  ret i1 %182
}

; Function Attrs: nounwind uwtable
declare hidden void @richardson_extrapolate(ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) #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 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 #3 = { 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 #4 = { nounwind }
attributes #5 = { nounwind allocsize(0) }

!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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @compute_parameter_shift_gradient(ptr noundef, i64 noundef, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @compute_higher_order_gradient(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef writeonly %4, ptr noundef writeonly %5) local_unnamed_addr #0 {
  %7 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %8 = insertelement <4 x ptr> %7, ptr %4, i64 1
  %9 = insertelement <4 x ptr> %8, ptr %5, i64 2
  %10 = insertelement <4 x ptr> %9, ptr %2, i64 3
  %11 = icmp eq <4 x ptr> %10, zeroinitializer
  %12 = icmp ult i64 %3, 2
  %13 = bitcast <4 x i1> %11 to i4
  %14 = icmp ne i4 %13, 0
  %op.rdx = or i1 %14, %12
  br i1 %op.rdx, label %50, label %15

15:                                               ; preds = %6
  %16 = shl i64 %3, 3
  %17 = tail call noalias ptr @malloc(i64 noundef %16) #3
  %18 = tail call noalias ptr @malloc(i64 noundef %16) #3
  %19 = icmp ne ptr %17, null
  %20 = icmp ne ptr %18, null
  %or.cond9 = and i1 %19, %20
  br i1 %or.cond9, label %.lr.ph.preheader, label %23

.lr.ph.preheader:                                 ; preds = %15
  %21 = load double, ptr %2, align 8, !tbaa !5
  %22 = tail call zeroext i1 @compute_parameter_shift_gradient(ptr noundef nonnull %0, i64 noundef %1, double noundef %21, ptr noundef nonnull %17, ptr noundef nonnull %18)
  br i1 %22, label %.lr.ph, label %._crit_edge108

23:                                               ; preds = %15
  tail call void @free(ptr noundef %17) #4
  br label %.sink.split

.lr.ph:                                           ; preds = %.lr.ph.preheader, %39
  %.077100 = phi i64 [ %40, %39 ], [ 1, %.lr.ph.preheader ]
  %24 = getelementptr inbounds double, ptr %2, i64 %.077100
  %25 = load double, ptr %24, align 8, !tbaa !5
  %26 = getelementptr inbounds ptr, ptr %17, i64 %.077100
  %27 = getelementptr inbounds i64, ptr %18, i64 %.077100
  %28 = tail call zeroext i1 @compute_parameter_shift_gradient(ptr noundef %0, i64 noundef %1, double noundef %25, ptr noundef nonnull %26, ptr noundef nonnull %27)
  br i1 %28, label %32, label %.lr.ph107

._crit_edge108:                                   ; preds = %.lr.ph107, %.lr.ph.preheader
  tail call void @free(ptr noundef nonnull %17) #4
  br label %.sink.split

.lr.ph107:                                        ; preds = %.lr.ph, %.lr.ph107
  %.076106 = phi i64 [ %31, %.lr.ph107 ], [ 0, %.lr.ph ]
  %29 = getelementptr inbounds ptr, ptr %17, i64 %.076106
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  tail call void @free(ptr noundef %30) #4
  %31 = add nuw i64 %.076106, 1
  %exitcond116.not = icmp eq i64 %31, %.077100
  br i1 %exitcond116.not, label %._crit_edge108, label %.lr.ph107, !llvm.loop !11

32:                                               ; preds = %.lr.ph
  %33 = load i64, ptr %27, align 8, !tbaa !13
  %34 = load i64, ptr %18, align 8, !tbaa !13
  %.not90 = icmp eq i64 %33, %34
  br i1 %.not90, label %39, label %.preheader

35:                                               ; preds = %.preheader
  tail call void @free(ptr noundef nonnull %17) #4
  br label %.sink.split

.preheader:                                       ; preds = %32, %.preheader
  %.075109 = phi i64 [ %38, %.preheader ], [ 0, %32 ]
  %36 = getelementptr inbounds ptr, ptr %17, i64 %.075109
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  tail call void @free(ptr noundef %37) #4
  %38 = add i64 %.075109, 1
  %exitcond117.not = icmp eq i64 %.075109, %.077100
  br i1 %exitcond117.not, label %35, label %.preheader, !llvm.loop !15

39:                                               ; preds = %32
  %40 = add nuw i64 %.077100, 1
  %exitcond.not = icmp eq i64 %40, %3
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !16

.critedge:                                        ; preds = %39
  %.pre = load i64, ptr %18, align 8, !tbaa !13
  %41 = shl i64 %.pre, 3
  %42 = tail call noalias ptr @malloc(i64 noundef %41) #3
  store ptr %42, ptr %4, align 8, !tbaa !9
  %.not93 = icmp eq ptr %42, null
  br i1 %.not93, label %.lr.ph104, label %.lr.ph102.preheader

._crit_edge105:                                   ; preds = %.lr.ph104
  tail call void @free(ptr noundef nonnull %17) #4
  br label %.sink.split

.lr.ph104:                                        ; preds = %.critedge, %.lr.ph104
  %.074103 = phi i64 [ %45, %.lr.ph104 ], [ 0, %.critedge ]
  %43 = getelementptr inbounds ptr, ptr %17, i64 %.074103
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  tail call void @free(ptr noundef %44) #4
  %45 = add nuw i64 %.074103, 1
  %exitcond119.not = icmp eq i64 %45, %3
  br i1 %exitcond119.not, label %._crit_edge105, label %.lr.ph104, !llvm.loop !18

.lr.ph102.preheader:                              ; preds = %.critedge
  tail call void @richardson_extrapolate(ptr noundef nonnull %17, i64 noundef %3, i64 noundef %.pre, ptr noundef nonnull %2, ptr noundef nonnull %42)
  br label %.lr.ph102

._crit_edge:                                      ; preds = %.lr.ph102
  tail call void @free(ptr noundef nonnull %17) #4
  %46 = load i64, ptr %18, align 8, !tbaa !13
  store i64 %46, ptr %5, align 8, !tbaa !13
  br label %.sink.split

.lr.ph102:                                        ; preds = %.lr.ph102.preheader, %.lr.ph102
  %.0101 = phi i64 [ %49, %.lr.ph102 ], [ 0, %.lr.ph102.preheader ]
  %47 = getelementptr inbounds ptr, ptr %17, i64 %.0101
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  tail call void @free(ptr noundef %48) #4
  %49 = add nuw i64 %.0101, 1
  %exitcond118.not = icmp eq i64 %49, %3
  br i1 %exitcond118.not, label %._crit_edge, label %.lr.ph102, !llvm.loop !19

.sink.split:                                      ; preds = %._crit_edge, %._crit_edge105, %23, %35, %._crit_edge108
  %.2.ph = phi i1 [ false, %._crit_edge108 ], [ false, %35 ], [ false, %23 ], [ false, %._crit_edge105 ], [ true, %._crit_edge ]
  tail call void @free(ptr noundef %18) #4
  br label %50

50:                                               ; preds = %.sink.split, %6
  %.2 = phi i1 [ false, %6 ], [ %.2.ph, %.sink.split ]
  ret i1 %.2
}

; Function Attrs: nounwind uwtable
declare hidden void @richardson_extrapolate(ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind allocsize(0) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !17}
!17 = !{!"llvm.loop.peeled.count", i32 1}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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