; LLVM IR from CLASS-SZ/class_sz :: class-sz/source (transfer)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.background = type { double, double, double, double, double, double, double, i32, double, double, double, double, i16, double, double, double, double, double, double, double, double, double, i16, double, double, ptr, i32, i32, double, i32, ptr, ptr, double, ptr, double, ptr, double, ptr, double, ptr, ptr, ptr, double, double, double, double, i32, ptr, double, double, double, double, double, double, double, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i16, i16, i16, i16, i16, i16, [2048 x i8], i16, [2048 x i8] }
%struct.transfers = type { double, double, double, [100 x double], [100 x double], i16, i16, [256 x i8], i32, ptr, ptr, ptr, i16, i16, [256 x i8], i32, ptr, ptr, ptr, ptr, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, ptr, double, i64, ptr, ptr, i32, ptr, i16, i16, [2048 x i8] }

@.str = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [86 x i8], align 1
@__func__.transfer_selection_compute = external hidden unnamed_addr constant [27 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [84 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

declare void @class_protect_sprintf(ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @transfer_selection_function(ptr noundef, ptr noundef, ptr noundef, i32 noundef, double noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @transfer_selection_compute(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, i32 noundef %7, ptr noundef %8, double noundef %9, i32 noundef %10) #2 {
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca i32, align 4
  %28 = alloca double, align 8
  %29 = alloca [2048 x i8], align 16
  %30 = alloca i32, align 4
  %31 = alloca [2048 x i8], align 16
  %32 = alloca [2048 x i8], align 16
  store ptr %0, ptr %13, align 8, !tbaa !5
  store ptr %1, ptr %14, align 8, !tbaa !5
  store ptr %2, ptr %15, align 8, !tbaa !5
  store ptr %3, ptr %16, align 8, !tbaa !5
  store ptr %4, ptr %17, align 8, !tbaa !5
  store ptr %5, ptr %18, align 8, !tbaa !5
  store ptr %6, ptr %19, align 8, !tbaa !5
  store i32 %7, ptr %20, align 4, !tbaa !9
  store ptr %8, ptr %21, align 8, !tbaa !5
  store double %9, ptr %22, align 8, !tbaa !11
  store i32 %10, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  %33 = load i32, ptr %20, align 4, !tbaa !9
  %34 = icmp sgt i32 %33, 1
  br i1 %34, label %35, label %153

35:                                               ; preds = %11
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %115, %35
  %37 = load i32, ptr %24, align 4, !tbaa !9
  %38 = load i32, ptr %20, align 4, !tbaa !9
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %40, label %118

40:                                               ; preds = %36
  %41 = load double, ptr %22, align 8, !tbaa !11
  %42 = load ptr, ptr %18, align 8, !tbaa !5
  %43 = load i32, ptr %24, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds double, ptr %42, i64 %44
  %46 = load double, ptr %45, align 8, !tbaa !11
  %47 = fsub double %41, %46
  store double %47, ptr %25, align 8, !tbaa !11
  %48 = load ptr, ptr %14, align 8, !tbaa !5
  %49 = load double, ptr %25, align 8, !tbaa !11
  %50 = load ptr, ptr %14, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.background, ptr %50, i32 0, i32 143
  %52 = load i16, ptr %51, align 4, !tbaa !13
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.background, ptr %53, i32 0, i32 144
  %55 = load i16, ptr %54, align 2, !tbaa !16
  %56 = load ptr, ptr %21, align 8, !tbaa !5
  %57 = call i32 @background_at_tau(ptr noundef %48, double noundef %49, i16 noundef signext %52, i16 noundef signext %55, ptr noundef %27, ptr noundef %56)
  %58 = icmp eq i32 %57, 1
  br i1 %58, label %59, label %68

59:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 2048, ptr %29) #3
  %60 = getelementptr inbounds [2048 x i8], ptr %29, i64 0, i64 0
  %61 = load ptr, ptr %14, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.background, ptr %61, i32 0, i32 149
  %63 = getelementptr inbounds [2048 x i8], ptr %62, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %60, ptr noundef @.str, ptr noundef @.str.88, ptr noundef %63)
  %64 = load ptr, ptr %16, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.transfers, ptr %64, i32 0, i32 52
  %66 = getelementptr inbounds [2048 x i8], ptr %65, i64 0, i64 0
  %67 = getelementptr inbounds [2048 x i8], ptr %29, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %66, ptr noundef @.str.2, ptr noundef @__func__.transfer_selection_compute, i32 noundef 2921, ptr noundef %67)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %29) #3
  store i32 1, ptr %12, align 4
  store i32 1, ptr %30, align 4
  br label %157

68:                                               ; preds = %40
  %69 = load ptr, ptr %14, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.background, ptr %69, i32 0, i32 58
  %71 = load double, ptr %70, align 8, !tbaa !17
  %72 = load ptr, ptr %21, align 8, !tbaa !5
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.background, ptr %73, i32 0, i32 59
  %75 = load i32, ptr %74, align 8, !tbaa !18
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds double, ptr %72, i64 %76
  %78 = load double, ptr %77, align 8, !tbaa !11
  %79 = fdiv double %71, %78
  %80 = fsub double %79, 1.000000e+00
  store double %80, ptr %28, align 8, !tbaa !11
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = load ptr, ptr %15, align 8, !tbaa !5
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = load i32, ptr %23, align 4, !tbaa !9
  %85 = load double, ptr %28, align 8, !tbaa !11
  %86 = load ptr, ptr %17, align 8, !tbaa !5
  %87 = load i32, ptr %24, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %86, i64 %88
  %90 = call i32 @transfer_selection_function(ptr noundef %81, ptr noundef %82, ptr noundef %83, i32 noundef %84, double noundef %85, ptr noundef %89)
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %92, label %101

92:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 2048, ptr %31) #3
  %93 = getelementptr inbounds [2048 x i8], ptr %31, i64 0, i64 0
  %94 = load ptr, ptr %16, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.transfers, ptr %94, i32 0, i32 52
  %96 = getelementptr inbounds [2048 x i8], ptr %95, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %93, ptr noundef @.str, ptr noundef @.str.89, ptr noundef %96)
  %97 = load ptr, ptr %16, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.transfers, ptr %97, i32 0, i32 52
  %99 = getelementptr inbounds [2048 x i8], ptr %98, i64 0, i64 0
  %100 = getelementptr inbounds [2048 x i8], ptr %31, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %99, ptr noundef @.str.2, ptr noundef @__func__.transfer_selection_compute, i32 noundef 2934, ptr noundef %100)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %31) #3
  store i32 1, ptr %12, align 4
  store i32 1, ptr %30, align 4
  br label %157

101:                                              ; preds = %68
  %102 = load ptr, ptr %21, align 8, !tbaa !5
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.background, ptr %103, i32 0, i32 60
  %105 = load i32, ptr %104, align 4, !tbaa !19
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds double, ptr %102, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !11
  %109 = load ptr, ptr %17, align 8, !tbaa !5
  %110 = load i32, ptr %24, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds double, ptr %109, i64 %111
  %113 = load double, ptr %112, align 8, !tbaa !11
  %114 = fmul double %113, %108
  store double %114, ptr %112, align 8, !tbaa !11
  br label %115

115:                                              ; preds = %101
  %116 = load i32, ptr %24, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %24, align 4, !tbaa !9
  br label %36, !llvm.loop !20

118:                                              ; preds = %36
  %119 = load ptr, ptr %17, align 8, !tbaa !5
  %120 = load i32, ptr %20, align 4, !tbaa !9
  %121 = load ptr, ptr %19, align 8, !tbaa !5
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.transfers, ptr %122, i32 0, i32 52
  %124 = getelementptr inbounds [2048 x i8], ptr %123, i64 0, i64 0
  %125 = call i32 @array_trapezoidal_integral(ptr noundef %119, i32 noundef %120, ptr noundef %121, ptr noundef %26, ptr noundef %124)
  %126 = icmp eq i32 %125, 1
  br i1 %126, label %127, label %136

127:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 2048, ptr %32) #3
  %128 = getelementptr inbounds [2048 x i8], ptr %32, i64 0, i64 0
  %129 = load ptr, ptr %16, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.transfers, ptr %129, i32 0, i32 52
  %131 = getelementptr inbounds [2048 x i8], ptr %130, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %128, ptr noundef @.str, ptr noundef @.str.90, ptr noundef %131)
  %132 = load ptr, ptr %16, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.transfers, ptr %132, i32 0, i32 52
  %134 = getelementptr inbounds [2048 x i8], ptr %133, i64 0, i64 0
  %135 = getelementptr inbounds [2048 x i8], ptr %32, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %134, ptr noundef @.str.2, ptr noundef @__func__.transfer_selection_compute, i32 noundef 2948, ptr noundef %135)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %32) #3
  store i32 1, ptr %12, align 4
  store i32 1, ptr %30, align 4
  br label %157

136:                                              ; preds = %118
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %137

137:                                              ; preds = %149, %136
  %138 = load i32, ptr %24, align 4, !tbaa !9
  %139 = load i32, ptr %20, align 4, !tbaa !9
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %141, label %152

141:                                              ; preds = %137
  %142 = load double, ptr %26, align 8, !tbaa !11
  %143 = load ptr, ptr %17, align 8, !tbaa !5
  %144 = load i32, ptr %24, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds double, ptr %143, i64 %145
  %147 = load double, ptr %146, align 8, !tbaa !11
  %148 = fdiv double %147, %142
  store double %148, ptr %146, align 8, !tbaa !11
  br label %149

149:                                              ; preds = %141
  %150 = load i32, ptr %24, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %24, align 4, !tbaa !9
  br label %137, !llvm.loop !22

152:                                              ; preds = %137
  br label %156

153:                                              ; preds = %11
  %154 = load ptr, ptr %17, align 8, !tbaa !5
  %155 = getelementptr inbounds double, ptr %154, i64 0
  store double 1.000000e+00, ptr %155, align 8, !tbaa !11
  br label %156

156:                                              ; preds = %153, %152
  store i32 0, ptr %12, align 4
  store i32 1, ptr %30, align 4
  br label %157

157:                                              ; preds = %156, %127, %92, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  %158 = load i32, ptr %12, align 4
  ret i32 %158
}

declare i32 @background_at_tau(ptr noundef, double noundef, i16 noundef signext, i16 noundef signext, ptr noundef, ptr noundef) #1

declare i32 @array_trapezoidal_integral(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !15, i64 844}
!14 = !{!"background", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !10, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !15, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !15, i64 176, !12, i64 184, !12, i64 192, !6, i64 200, !10, i64 208, !10, i64 212, !12, i64 216, !10, i64 224, !6, i64 232, !6, i64 240, !12, i64 248, !6, i64 256, !12, i64 264, !6, i64 272, !12, i64 280, !6, i64 288, !12, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !12, i64 352, !10, i64 360, !6, i64 368, !12, i64 376, !12, i64 384, !12, i64 392, !12, i64 400, !12, i64 408, !12, i64 416, !12, i64 424, !12, i64 432, !12, i64 440, !12, i64 448, !12, i64 456, !10, i64 464, !10, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !10, i64 488, !10, i64 492, !10, i64 496, !10, i64 500, !10, i64 504, !10, i64 508, !10, i64 512, !10, i64 516, !10, i64 520, !10, i64 524, !10, i64 528, !10, i64 532, !10, i64 536, !10, i64 540, !10, i64 544, !10, i64 548, !10, i64 552, !10, i64 556, !10, i64 560, !10, i64 564, !10, i64 568, !10, i64 572, !10, i64 576, !10, i64 580, !10, i64 584, !10, i64 588, !10, i64 592, !10, i64 596, !10, i64 600, !10, i64 604, !10, i64 608, !10, i64 612, !10, i64 616, !10, i64 620, !10, i64 624, !10, i64 628, !6, i64 632, !6, i64 640, !6, i64 648, !6, i64 656, !6, i64 664, !10, i64 672, !10, i64 676, !10, i64 680, !10, i64 684, !10, i64 688, !10, i64 692, !10, i64 696, !10, i64 700, !10, i64 704, !10, i64 708, !10, i64 712, !10, i64 716, !10, i64 720, !15, i64 724, !15, i64 726, !15, i64 728, !15, i64 730, !15, i64 732, !15, i64 734, !15, i64 736, !15, i64 738, !15, i64 740, !15, i64 742, !15, i64 744, !6, i64 752, !6, i64 760, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !15, i64 840, !15, i64 842, !15, i64 844, !15, i64 846, !15, i64 848, !15, i64 850, !7, i64 852, !15, i64 2900, !7, i64 2902}
!15 = !{!"short", !7, i64 0}
!16 = !{!14, !15, i64 846}
!17 = !{!14, !12, i64 456}
!18 = !{!14, !10, i64 464}
!19 = !{!14, !10, i64 468}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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

@.str = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [86 x i8], align 1
@__func__.transfer_selection_compute = external hidden unnamed_addr constant [27 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [84 x i8], align 1

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

declare void @class_protect_sprintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @transfer_selection_function(ptr noundef, ptr noundef, ptr noundef, i32 noundef, double noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @transfer_selection_compute(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr nocapture noundef readonly %5, ptr noundef %6, i32 noundef %7, ptr noundef %8, double noundef %9, i32 noundef %10) local_unnamed_addr #2 {
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca [2048 x i8], align 16
  %15 = alloca [2048 x i8], align 16
  %16 = alloca [2048 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #3
  %17 = icmp sgt i32 %7, 1
  br i1 %17, label %.preheader44, label %66

.preheader44:                                     ; preds = %11
  %18 = getelementptr inbounds i8, ptr %1, i64 844
  %19 = getelementptr inbounds i8, ptr %1, i64 846
  %20 = getelementptr inbounds i8, ptr %1, i64 456
  %21 = getelementptr inbounds i8, ptr %1, i64 464
  %22 = getelementptr inbounds i8, ptr %1, i64 468
  %wide.trip.count = zext nneg i32 %7 to i64
  br label %23

23:                                               ; preds = %.preheader44, %47
  %indvars.iv = phi i64 [ 0, %.preheader44 ], [ %indvars.iv.next, %47 ]
  %24 = getelementptr inbounds double, ptr %5, i64 %indvars.iv
  %25 = load double, ptr %24, align 8, !tbaa !5
  %26 = fsub double %9, %25
  %27 = load i16, ptr %18, align 4, !tbaa !9
  %28 = load i16, ptr %19, align 2, !tbaa !14
  %29 = call i32 @background_at_tau(ptr noundef %1, double noundef %26, i16 noundef signext %27, i16 noundef signext %28, ptr noundef nonnull %13, ptr noundef %8) #3
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %34

31:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %14) #3
  %32 = getelementptr inbounds i8, ptr %1, i64 2902
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %14, ptr noundef nonnull @.str, ptr noundef nonnull @.str.88, ptr noundef nonnull %32) #3
  %33 = getelementptr inbounds i8, ptr %3, i64 2380
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %33, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.transfer_selection_compute, i32 noundef 2921, ptr noundef nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %14) #3
  br label %.loopexit

34:                                               ; preds = %23
  %35 = load double, ptr %20, align 8, !tbaa !15
  %36 = load i32, ptr %21, align 8, !tbaa !16
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds double, ptr %8, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !5
  %40 = fdiv double %35, %39
  %41 = fadd double %40, -1.000000e+00
  %42 = getelementptr inbounds double, ptr %4, i64 %indvars.iv
  %43 = call i32 @transfer_selection_function(ptr noundef %0, ptr noundef %2, ptr noundef %3, i32 noundef %10, double noundef %41, ptr noundef %42)
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %47

45:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %15) #3
  %46 = getelementptr inbounds i8, ptr %3, i64 2380
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str, ptr noundef nonnull @.str.89, ptr noundef nonnull %46) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %46, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.transfer_selection_compute, i32 noundef 2934, ptr noundef nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %15) #3
  br label %.loopexit

47:                                               ; preds = %34
  %48 = load i32, ptr %22, align 4, !tbaa !17
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds double, ptr %8, i64 %49
  %51 = load double, ptr %50, align 8, !tbaa !5
  %52 = load double, ptr %42, align 8, !tbaa !5
  %53 = fmul double %51, %52
  store double %53, ptr %42, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %54, label %23, !llvm.loop !18

54:                                               ; preds = %47
  %55 = getelementptr inbounds i8, ptr %3, i64 2380
  %56 = call i32 @array_trapezoidal_integral(ptr noundef nonnull %4, i32 noundef %7, ptr noundef %6, ptr noundef nonnull %12, ptr noundef nonnull %55) #3
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %62, label %.lr.ph

.lr.ph:                                           ; preds = %54
  %58 = load double, ptr %12, align 8, !tbaa !5
  %n.vec = and i64 %wide.trip.count, 2147483646
  %broadcast.splatinsert = insertelement <2 x double> poison, double %58, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %.lr.ph
  %index = phi i64 [ 0, %.lr.ph ], [ %index.next, %vector.body ]
  %59 = getelementptr inbounds double, ptr %4, i64 %index
  %wide.load = load <2 x double>, ptr %59, align 8, !tbaa !5
  %60 = fdiv <2 x double> %wide.load, %broadcast.splat
  store <2 x double> %60, ptr %59, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 2
  %61 = icmp eq i64 %index.next, %n.vec
  br i1 %61, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit, label %scalar.ph

62:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %16) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %16, ptr noundef nonnull @.str, ptr noundef nonnull @.str.90, ptr noundef nonnull %55) #3
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %55, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.transfer_selection_compute, i32 noundef 2948, ptr noundef nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %16) #3
  br label %.loopexit

scalar.ph:                                        ; preds = %middle.block, %scalar.ph
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %scalar.ph ], [ %n.vec, %middle.block ]
  %63 = getelementptr inbounds double, ptr %4, i64 %indvars.iv48
  %64 = load double, ptr %63, align 8, !tbaa !5
  %65 = fdiv double %64, %58
  store double %65, ptr %63, align 8, !tbaa !5
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond52.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count
  br i1 %exitcond52.not, label %.loopexit, label %scalar.ph, !llvm.loop !23

66:                                               ; preds = %11
  store double 1.000000e+00, ptr %4, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %scalar.ph, %middle.block, %66, %62, %45, %31
  %.0 = phi i32 [ 1, %31 ], [ 1, %45 ], [ 1, %62 ], [ 0, %66 ], [ 0, %middle.block ], [ 0, %scalar.ph ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #3
  ret i32 %.0
}

declare i32 @background_at_tau(ptr noundef, double noundef, i16 noundef signext, i16 noundef signext, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @array_trapezoidal_integral(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { 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, !12, i64 844}
!10 = !{!"background", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !12, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !12, i64 176, !6, i64 184, !6, i64 192, !13, i64 200, !11, i64 208, !11, i64 212, !6, i64 216, !11, i64 224, !13, i64 232, !13, i64 240, !6, i64 248, !13, i64 256, !6, i64 264, !13, i64 272, !6, i64 280, !13, i64 288, !6, i64 296, !13, i64 304, !13, i64 312, !13, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !11, i64 360, !13, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !11, i64 464, !11, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !11, i64 488, !11, i64 492, !11, i64 496, !11, i64 500, !11, i64 504, !11, i64 508, !11, i64 512, !11, i64 516, !11, i64 520, !11, i64 524, !11, i64 528, !11, i64 532, !11, i64 536, !11, i64 540, !11, i64 544, !11, i64 548, !11, i64 552, !11, i64 556, !11, i64 560, !11, i64 564, !11, i64 568, !11, i64 572, !11, i64 576, !11, i64 580, !11, i64 584, !11, i64 588, !11, i64 592, !11, i64 596, !11, i64 600, !11, i64 604, !11, i64 608, !11, i64 612, !11, i64 616, !11, i64 620, !11, i64 624, !11, i64 628, !13, i64 632, !13, i64 640, !13, i64 648, !13, i64 656, !13, i64 664, !11, i64 672, !11, i64 676, !11, i64 680, !11, i64 684, !11, i64 688, !11, i64 692, !11, i64 696, !11, i64 700, !11, i64 704, !11, i64 708, !11, i64 712, !11, i64 716, !11, i64 720, !12, i64 724, !12, i64 726, !12, i64 728, !12, i64 730, !12, i64 732, !12, i64 734, !12, i64 736, !12, i64 738, !12, i64 740, !12, i64 742, !12, i64 744, !13, i64 752, !13, i64 760, !13, i64 768, !13, i64 776, !13, i64 784, !13, i64 792, !13, i64 800, !13, i64 808, !13, i64 816, !13, i64 824, !13, i64 832, !12, i64 840, !12, i64 842, !12, i64 844, !12, i64 846, !12, i64 848, !12, i64 850, !7, i64 852, !12, i64 2900, !7, i64 2902}
!11 = !{!"int", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!10, !12, i64 846}
!15 = !{!10, !6, i64 456}
!16 = !{!10, !11, i64 464}
!17 = !{!10, !11, i64 468}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !19, !22, !21}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass