; LLVM IR from PeterQLee/sentinel1_denoise_rs :: tests (test_clib)

; 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.LinearResult = type { ptr, ptr, ptr, i64, i64, i64 }
%struct.RawResult = type { ptr, ptr, ptr, i64, i64 }
%struct.LPResult = type { ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64 }

@.str = external hidden unnamed_addr constant [109 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @destroy_lpresult(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: 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 i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca %struct.LinearResult, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.LinearResult, align 8
  %8 = alloca %struct.RawResult, align 8
  %9 = alloca %struct.LPResult, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.LPResult, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  store ptr @.str, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = call i64 @strlen(ptr noundef %15) #6
  store i64 %16, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %4) #5
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = load i64, ptr %3, align 8, !tbaa !9
  call void @linear_get_dualpol_data(ptr dead_on_unwind writable sret(%struct.LinearResult) align 8 %4, ptr noundef %17, i64 noundef %18, ptr noundef @.str.1, i64 noundef 0)
  call void @destroy_linearresult(ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %19 = call noalias ptr @malloc(i64 noundef 40) #7
  store ptr %19, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %20

20:                                               ; preds = %29, %0
  %21 = load i32, ptr %6, align 4, !tbaa !11
  %22 = icmp slt i32 %21, 5
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %32

24:                                               ; preds = %20
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = load i32, ptr %6, align 4, !tbaa !11
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds double, ptr %25, i64 %27
  store double 1.000000e+00, ptr %28, align 8, !tbaa !13
  br label %29

29:                                               ; preds = %24
  %30 = load i32, ptr %6, align 4, !tbaa !11
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %6, align 4, !tbaa !11
  br label %20, !llvm.loop !15

32:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #5
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = load i64, ptr %3, align 8, !tbaa !9
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  call void @linear_get_customscale_data(ptr dead_on_unwind writable sret(%struct.LinearResult) align 8 %7, ptr noundef %33, i64 noundef %34, ptr noundef %35, i64 noundef 5)
  call void @destroy_linearresult(ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #5
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = load i64, ptr %3, align 8, !tbaa !9
  call void @linear_get_raw_data(ptr dead_on_unwind writable sret(%struct.RawResult) align 8 %8, ptr noundef %36, i64 noundef %37)
  call void @destroy_rawresult(ptr noundef %8)
  call void @llvm.lifetime.start.p0(i64 72, ptr %9) #5
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = load i64, ptr %3, align 8, !tbaa !9
  call void @lp_get_dualpol_data(ptr dead_on_unwind writable sret(%struct.LPResult) align 8 %9, ptr noundef %38, i64 noundef %39, i8 noundef zeroext 1, ptr noundef @.str.1, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %40 = getelementptr inbounds %struct.LPResult, ptr %9, i32 0, i32 8
  %41 = load i64, ptr %40, align 8, !tbaa !17
  %42 = mul i64 8, %41
  %43 = call noalias ptr @malloc(i64 noundef %42) #7
  store ptr %43, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %44 = getelementptr inbounds %struct.LPResult, ptr %9, i32 0, i32 8
  %45 = load i64, ptr %44, align 8, !tbaa !17
  %46 = mul i64 8, %45
  %47 = call noalias ptr @malloc(i64 noundef %46) #7
  store ptr %47, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %48

48:                                               ; preds = %66, %32
  %49 = load i32, ptr %12, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %struct.LPResult, ptr %9, i32 0, i32 8
  %52 = load i64, ptr %51, align 8, !tbaa !17
  %53 = icmp ult i64 %50, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %69

55:                                               ; preds = %48
  %56 = getelementptr inbounds %struct.LPResult, ptr %9, i32 0, i32 3
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = load i32, ptr %12, align 4, !tbaa !11
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds double, ptr %57, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !13
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = load i32, ptr %12, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds double, ptr %62, i64 %64
  store double %61, ptr %65, align 8, !tbaa !13
  br label %66

66:                                               ; preds = %55
  %67 = load i32, ptr %12, align 4, !tbaa !11
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %12, align 4, !tbaa !11
  br label %48, !llvm.loop !20

69:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %70

70:                                               ; preds = %88, %69
  %71 = load i32, ptr %13, align 4, !tbaa !11
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds %struct.LPResult, ptr %9, i32 0, i32 8
  %74 = load i64, ptr %73, align 8, !tbaa !17
  %75 = icmp ult i64 %72, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %91

77:                                               ; preds = %70
  %78 = getelementptr inbounds %struct.LPResult, ptr %9, i32 0, i32 4
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = load i32, ptr %13, align 4, !tbaa !11
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %79, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !13
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = load i32, ptr %13, align 4, !tbaa !11
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds double, ptr %84, i64 %86
  store double %83, ptr %87, align 8, !tbaa !13
  br label %88

88:                                               ; preds = %77
  %89 = load i32, ptr %13, align 4, !tbaa !11
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %13, align 4, !tbaa !11
  br label %70, !llvm.loop !22

91:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 72, ptr %14) #5
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = load i64, ptr %3, align 8, !tbaa !9
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.LPResult, ptr %9, i32 0, i32 8
  %97 = load i64, ptr %96, align 8, !tbaa !17
  call void @lp_get_customscale_data(ptr dead_on_unwind writable sret(%struct.LPResult) align 8 %14, ptr noundef %92, i64 noundef %93, ptr noundef %94, ptr noundef %95, i64 noundef %97, ptr noundef @.str.1, i64 noundef 0)
  call void @destroy_lpresult(ptr noundef %9)
  call void @destroy_lpresult(ptr noundef %14)
  call void @llvm.lifetime.end.p0(i64 72, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %98 = load i32, ptr %1, align 4
  ret i32 %98
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

declare void @linear_get_dualpol_data(ptr dead_on_unwind writable sret(%struct.LinearResult) align 8, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #4

declare void @linear_get_customscale_data(ptr dead_on_unwind writable sret(%struct.LinearResult) align 8, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #4

declare void @linear_get_raw_data(ptr dead_on_unwind writable sret(%struct.RawResult) align 8, ptr noundef, i64 noundef) #4

declare void @lp_get_dualpol_data(ptr dead_on_unwind writable sret(%struct.LPResult) align 8, ptr noundef, i64 noundef, i8 noundef zeroext, ptr noundef, i64 noundef) #4

declare void @lp_get_customscale_data(ptr dead_on_unwind writable sret(%struct.LPResult) align 8, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #4

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 willreturn memory(read) "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 = { "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 }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !10, i64 64}
!18 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64}
!19 = !{!18, !6, i64 24}
!20 = distinct !{!20, !16}
!21 = !{!18, !6, i64 32}
!22 = distinct !{!22, !16}


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

%struct.LinearResult = type { ptr, ptr, ptr, i64, i64, i64 }
%struct.RawResult = type { ptr, ptr, ptr, i64, i64 }
%struct.LPResult = type { ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64 }

@.str = external hidden unnamed_addr constant [109 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.LinearResult, align 8
  %2 = alloca %struct.LinearResult, align 8
  %3 = alloca %struct.RawResult, align 8
  %4 = alloca %struct.LPResult, align 8
  %5 = alloca %struct.LPResult, align 8
  %6 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @.str) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #6
  call void @linear_get_dualpol_data(ptr dead_on_unwind nonnull writable sret(%struct.LinearResult) align 8 %1, ptr noundef nonnull @.str, i64 noundef %6, ptr noundef nonnull @.str.1, i64 noundef 0) #6
  call void @destroy_linearresult(ptr noundef nonnull %1)
  %7 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #7
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %7, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %7, i64 32
  store double 1.000000e+00, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #6
  call void @linear_get_customscale_data(ptr dead_on_unwind nonnull writable sret(%struct.LinearResult) align 8 %2, ptr noundef nonnull @.str, i64 noundef %6, ptr noundef nonnull %7, i64 noundef 5) #6
  call void @destroy_linearresult(ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #6
  call void @linear_get_raw_data(ptr dead_on_unwind nonnull writable sret(%struct.RawResult) align 8 %3, ptr noundef nonnull @.str, i64 noundef %6) #6
  call void @destroy_rawresult(ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %4) #6
  call void @lp_get_dualpol_data(ptr dead_on_unwind nonnull writable sret(%struct.LPResult) align 8 %4, ptr noundef nonnull @.str, i64 noundef %6, i8 noundef zeroext 1, ptr noundef nonnull @.str.1, i64 noundef 0) #6
  %10 = getelementptr inbounds i8, ptr %4, i64 64
  %11 = load i64, ptr %10, align 8, !tbaa !9
  %12 = shl i64 %11, 3
  %13 = call noalias ptr @malloc(i64 noundef %12) #7
  %14 = call noalias ptr @malloc(i64 noundef %12) #7
  %15 = ptrtoint ptr %14 to i64
  %.not = icmp eq i64 %11, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %16 = ptrtoint ptr %13 to i64
  %17 = getelementptr inbounds i8, ptr %4, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  %min.iters.check = icmp ult i64 %11, 6
  %19 = ptrtoint ptr %18 to i64
  %20 = sub i64 %16, %19
  %diff.check = icmp ult i64 %20, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %11, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %21 = getelementptr inbounds double, ptr %18, i64 %indvars.iv.prol
  %22 = load double, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.prol
  store double %22, ptr %23, align 8, !tbaa !5
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !14

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %24 = sub i64 %indvars.iv.ph, %11
  %25 = icmp ugt i64 %24, -4
  br i1 %25, label %.lr.ph35, label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %11, -4
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %26 = getelementptr inbounds double, ptr %18, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %wide.load = load <2 x double>, ptr %26, align 8, !tbaa !5
  %wide.load43 = load <2 x double>, ptr %27, align 8, !tbaa !5
  %28 = getelementptr inbounds double, ptr %13, i64 %index
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  store <2 x double> %wide.load, ptr %28, align 8, !tbaa !5
  store <2 x double> %wide.load43, ptr %29, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %30 = icmp eq i64 %index.next, %n.vec
  br i1 %30, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %11, %n.vec
  br i1 %cmp.n, label %.lr.ph35, label %scalar.ph.preheader

.lr.ph35:                                         ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %31 = getelementptr inbounds i8, ptr %4, i64 32
  %32 = load ptr, ptr %31, align 8, !tbaa !20
  %min.iters.check48 = icmp ult i64 %11, 6
  %33 = ptrtoint ptr %32 to i64
  %34 = sub i64 %15, %33
  %diff.check45 = icmp ult i64 %34, 32
  %or.cond61 = select i1 %min.iters.check48, i1 true, i1 %diff.check45
  br i1 %or.cond61, label %scalar.ph47.preheader, label %vector.ph49

scalar.ph47.preheader:                            ; preds = %middle.block46, %.lr.ph35
  %indvars.iv39.ph = phi i64 [ 0, %.lr.ph35 ], [ %n.vec51, %middle.block46 ]
  %xtraiter62 = and i64 %11, 3
  %lcmp.mod63.not = icmp eq i64 %xtraiter62, 0
  br i1 %lcmp.mod63.not, label %scalar.ph47.prol.loopexit, label %scalar.ph47.prol

scalar.ph47.prol:                                 ; preds = %scalar.ph47.preheader, %scalar.ph47.prol
  %indvars.iv39.prol = phi i64 [ %indvars.iv.next40.prol, %scalar.ph47.prol ], [ %indvars.iv39.ph, %scalar.ph47.preheader ]
  %prol.iter64 = phi i64 [ %prol.iter64.next, %scalar.ph47.prol ], [ 0, %scalar.ph47.preheader ]
  %35 = getelementptr inbounds double, ptr %32, i64 %indvars.iv39.prol
  %36 = load double, ptr %35, align 8, !tbaa !5
  %37 = getelementptr inbounds double, ptr %14, i64 %indvars.iv39.prol
  store double %36, ptr %37, align 8, !tbaa !5
  %indvars.iv.next40.prol = add nuw nsw i64 %indvars.iv39.prol, 1
  %prol.iter64.next = add i64 %prol.iter64, 1
  %prol.iter64.cmp.not = icmp eq i64 %prol.iter64.next, %xtraiter62
  br i1 %prol.iter64.cmp.not, label %scalar.ph47.prol.loopexit, label %scalar.ph47.prol, !llvm.loop !21

scalar.ph47.prol.loopexit:                        ; preds = %scalar.ph47.prol, %scalar.ph47.preheader
  %indvars.iv39.unr = phi i64 [ %indvars.iv39.ph, %scalar.ph47.preheader ], [ %indvars.iv.next40.prol, %scalar.ph47.prol ]
  %38 = sub i64 %indvars.iv39.ph, %11
  %39 = icmp ugt i64 %38, -4
  br i1 %39, label %._crit_edge, label %scalar.ph47

vector.ph49:                                      ; preds = %.lr.ph35
  %n.vec51 = and i64 %11, -4
  br label %vector.body53

vector.body53:                                    ; preds = %vector.body53, %vector.ph49
  %index54 = phi i64 [ 0, %vector.ph49 ], [ %index.next57, %vector.body53 ]
  %40 = getelementptr inbounds double, ptr %32, i64 %index54
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %wide.load55 = load <2 x double>, ptr %40, align 8, !tbaa !5
  %wide.load56 = load <2 x double>, ptr %41, align 8, !tbaa !5
  %42 = getelementptr inbounds double, ptr %14, i64 %index54
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  store <2 x double> %wide.load55, ptr %42, align 8, !tbaa !5
  store <2 x double> %wide.load56, ptr %43, align 8, !tbaa !5
  %index.next57 = add nuw i64 %index54, 4
  %44 = icmp eq i64 %index.next57, %n.vec51
  br i1 %44, label %middle.block46, label %vector.body53, !llvm.loop !22

middle.block46:                                   ; preds = %vector.body53
  %cmp.n58 = icmp eq i64 %11, %n.vec51
  br i1 %cmp.n58, label %._crit_edge, label %scalar.ph47.preheader

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %45 = getelementptr inbounds double, ptr %18, i64 %indvars.iv
  %46 = load double, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds double, ptr %13, i64 %indvars.iv
  store double %46, ptr %47, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = getelementptr inbounds double, ptr %18, i64 %indvars.iv.next
  %49 = load double, ptr %48, align 8, !tbaa !5
  %50 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next
  store double %49, ptr %50, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %51 = getelementptr inbounds double, ptr %18, i64 %indvars.iv.next.1
  %52 = load double, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next.1
  store double %52, ptr %53, align 8, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %54 = getelementptr inbounds double, ptr %18, i64 %indvars.iv.next.2
  %55 = load double, ptr %54, align 8, !tbaa !5
  %56 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next.2
  store double %55, ptr %56, align 8, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %11
  br i1 %exitcond.not.3, label %.lr.ph35, label %scalar.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %scalar.ph47.prol.loopexit, %scalar.ph47, %middle.block46, %0
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #6
  call void @lp_get_customscale_data(ptr dead_on_unwind nonnull writable sret(%struct.LPResult) align 8 %5, ptr noundef nonnull @.str, i64 noundef %6, ptr noundef %13, ptr noundef %14, i64 noundef %11, ptr noundef nonnull @.str.1, i64 noundef 0) #6
  call void @destroy_lpresult(ptr noundef nonnull %4)
  call void @destroy_lpresult(ptr noundef nonnull %5)
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #6
  ret i32 0

scalar.ph47:                                      ; preds = %scalar.ph47.prol.loopexit, %scalar.ph47
  %indvars.iv39 = phi i64 [ %indvars.iv.next40.3, %scalar.ph47 ], [ %indvars.iv39.unr, %scalar.ph47.prol.loopexit ]
  %57 = getelementptr inbounds double, ptr %32, i64 %indvars.iv39
  %58 = load double, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds double, ptr %14, i64 %indvars.iv39
  store double %58, ptr %59, align 8, !tbaa !5
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %60 = getelementptr inbounds double, ptr %32, i64 %indvars.iv.next40
  %61 = load double, ptr %60, align 8, !tbaa !5
  %62 = getelementptr inbounds double, ptr %14, i64 %indvars.iv.next40
  store double %61, ptr %62, align 8, !tbaa !5
  %indvars.iv.next40.1 = add nuw nsw i64 %indvars.iv39, 2
  %63 = getelementptr inbounds double, ptr %32, i64 %indvars.iv.next40.1
  %64 = load double, ptr %63, align 8, !tbaa !5
  %65 = getelementptr inbounds double, ptr %14, i64 %indvars.iv.next40.1
  store double %64, ptr %65, align 8, !tbaa !5
  %indvars.iv.next40.2 = add nuw nsw i64 %indvars.iv39, 3
  %66 = getelementptr inbounds double, ptr %32, i64 %indvars.iv.next40.2
  %67 = load double, ptr %66, align 8, !tbaa !5
  %68 = getelementptr inbounds double, ptr %14, i64 %indvars.iv.next40.2
  store double %67, ptr %68, align 8, !tbaa !5
  %indvars.iv.next40.3 = add nuw nsw i64 %indvars.iv39, 4
  %exitcond42.not.3 = icmp eq i64 %indvars.iv.next40.3, %11
  br i1 %exitcond42.not.3, label %._crit_edge, label %scalar.ph47, !llvm.loop !24
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

declare void @linear_get_dualpol_data(ptr dead_on_unwind writable sret(%struct.LinearResult) align 8, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

declare void @linear_get_customscale_data(ptr dead_on_unwind writable sret(%struct.LinearResult) align 8, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

declare void @linear_get_raw_data(ptr dead_on_unwind writable sret(%struct.RawResult) align 8, ptr noundef, i64 noundef) local_unnamed_addr #4

declare void @lp_get_dualpol_data(ptr dead_on_unwind writable sret(%struct.LPResult) align 8, ptr noundef, i64 noundef, i8 noundef zeroext, ptr noundef, i64 noundef) local_unnamed_addr #4

declare void @lp_get_customscale_data(ptr dead_on_unwind writable sret(%struct.LPResult) align 8, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { "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 willreturn memory(read) }
attributes #6 = { nounwind }
attributes #7 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 64}
!10 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !11, i64 24}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !17, !18, !19}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = !{!10, !11, i64 32}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !17, !18, !19}
!23 = distinct !{!23, !17, !18}
!24 = distinct !{!24, !17, !18}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass