; LLVM IR from datocms/fast_thumbhash :: ext/fast_thumbhash (fast_thumbhash)

; 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.encoded_channel = type { double, ptr, i32, double }

; Function Attrs: nounwind uwtable
define dso_local void @encode_channel(ptr dead_on_unwind noalias writable sret(%struct.encoded_channel) align 8 %0, ptr noundef %1, i8 noundef zeroext %2, i8 noundef zeroext %3, i8 noundef zeroext %4, i8 noundef zeroext %5) #0 {
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca double, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca double, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i8 %2, ptr %8, align 1, !tbaa !9
  store i8 %3, ptr %9, align 1, !tbaa !9
  store i8 %4, ptr %10, align 1, !tbaa !9
  store i8 %5, ptr %11, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store double 0.000000e+00, ptr %12, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store double 0.000000e+00, ptr %13, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %26 = load i8, ptr %8, align 1, !tbaa !9
  %27 = zext i8 %26 to i32
  %28 = load i8, ptr %9, align 1, !tbaa !9
  %29 = zext i8 %28 to i32
  %30 = mul nsw i32 %27, %29
  %31 = sext i32 %30 to i64
  %32 = mul i64 %31, 8
  %33 = call noalias ptr @malloc(i64 noundef %32) #6
  store ptr %33, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %34 = load i8, ptr %10, align 1, !tbaa !9
  %35 = zext i8 %34 to i64
  %36 = mul i64 %35, 8
  %37 = call noalias ptr @malloc(i64 noundef %36) #6
  store ptr %37, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !12
  br label %38

38:                                               ; preds = %173, %6
  %39 = load i32, ptr %17, align 4, !tbaa !12
  %40 = load i8, ptr %9, align 1, !tbaa !9
  %41 = zext i8 %40 to i32
  %42 = icmp slt i32 %39, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %38
  store i32 2, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %176

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !12
  br label %45

45:                                               ; preds = %169, %44
  %46 = load i32, ptr %19, align 4, !tbaa !12
  %47 = load i8, ptr %9, align 1, !tbaa !9
  %48 = zext i8 %47 to i32
  %49 = mul nsw i32 %46, %48
  %50 = load i8, ptr %8, align 1, !tbaa !9
  %51 = zext i8 %50 to i32
  %52 = load i8, ptr %9, align 1, !tbaa !9
  %53 = zext i8 %52 to i32
  %54 = load i32, ptr %17, align 4, !tbaa !12
  %55 = sub nsw i32 %53, %54
  %56 = mul nsw i32 %51, %55
  %57 = icmp slt i32 %49, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %45
  store i32 5, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %172

59:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  store double 0.000000e+00, ptr %20, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !12
  br label %60

60:                                               ; preds = %83, %59
  %61 = load i32, ptr %21, align 4, !tbaa !12
  %62 = load i8, ptr %10, align 1, !tbaa !9
  %63 = zext i8 %62 to i32
  %64 = icmp slt i32 %61, %63
  br i1 %64, label %66, label %65

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

66:                                               ; preds = %60
  %67 = load i8, ptr %10, align 1, !tbaa !9
  %68 = zext i8 %67 to i32
  %69 = sitofp i32 %68 to double
  %70 = fdiv double 0x400921FB54442D18, %69
  %71 = load i32, ptr %19, align 4, !tbaa !12
  %72 = sitofp i32 %71 to double
  %73 = fmul double %70, %72
  %74 = load i32, ptr %21, align 4, !tbaa !12
  %75 = sitofp i32 %74 to double
  %76 = fadd double %75, 5.000000e-01
  %77 = fmul double %73, %76
  %78 = call double @cos(double noundef %77) #5
  %79 = load ptr, ptr %15, align 8, !tbaa !5
  %80 = load i32, ptr %21, align 4, !tbaa !12
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %79, i64 %81
  store double %78, ptr %82, align 8, !tbaa !10
  br label %83

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

86:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !12
  br label %87

87:                                               ; preds = %136, %86
  %88 = load i32, ptr %22, align 4, !tbaa !12
  %89 = load i8, ptr %11, align 1, !tbaa !9
  %90 = zext i8 %89 to i32
  %91 = icmp slt i32 %88, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %87
  store i32 11, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %139

93:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %94 = load i8, ptr %11, align 1, !tbaa !9
  %95 = zext i8 %94 to i32
  %96 = sitofp i32 %95 to double
  %97 = fdiv double 0x400921FB54442D18, %96
  %98 = load i32, ptr %17, align 4, !tbaa !12
  %99 = sitofp i32 %98 to double
  %100 = fmul double %97, %99
  %101 = load i32, ptr %22, align 4, !tbaa !12
  %102 = sitofp i32 %101 to double
  %103 = fadd double %102, 5.000000e-01
  %104 = fmul double %100, %103
  %105 = call double @cos(double noundef %104) #5
  store double %105, ptr %23, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !12
  br label %106

106:                                              ; preds = %132, %93
  %107 = load i32, ptr %24, align 4, !tbaa !12
  %108 = load i8, ptr %10, align 1, !tbaa !9
  %109 = zext i8 %108 to i32
  %110 = icmp slt i32 %107, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %106
  store i32 14, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %135

112:                                              ; preds = %106
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = load i32, ptr %24, align 4, !tbaa !12
  %115 = load i32, ptr %22, align 4, !tbaa !12
  %116 = load i8, ptr %10, align 1, !tbaa !9
  %117 = zext i8 %116 to i32
  %118 = mul nsw i32 %115, %117
  %119 = add nsw i32 %114, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %113, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !10
  %123 = load ptr, ptr %15, align 8, !tbaa !5
  %124 = load i32, ptr %24, align 4, !tbaa !12
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds double, ptr %123, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !10
  %128 = fmul double %122, %127
  %129 = load double, ptr %23, align 8, !tbaa !10
  %130 = load double, ptr %20, align 8, !tbaa !10
  %131 = call double @llvm.fmuladd.f64(double %128, double %129, double %130)
  store double %131, ptr %20, align 8, !tbaa !10
  br label %132

132:                                              ; preds = %112
  %133 = load i32, ptr %24, align 4, !tbaa !12
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %24, align 4, !tbaa !12
  br label %106, !llvm.loop !16

135:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %22, align 4, !tbaa !12
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %22, align 4, !tbaa !12
  br label %87, !llvm.loop !17

139:                                              ; preds = %92
  %140 = load i8, ptr %10, align 1, !tbaa !9
  %141 = zext i8 %140 to i32
  %142 = load i8, ptr %11, align 1, !tbaa !9
  %143 = zext i8 %142 to i32
  %144 = mul nsw i32 %141, %143
  %145 = sitofp i32 %144 to double
  %146 = load double, ptr %20, align 8, !tbaa !10
  %147 = fdiv double %146, %145
  store double %147, ptr %20, align 8, !tbaa !10
  %148 = load i32, ptr %19, align 4, !tbaa !12
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %153, label %150

150:                                              ; preds = %139
  %151 = load i32, ptr %17, align 4, !tbaa !12
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %166

153:                                              ; preds = %150, %139
  %154 = load double, ptr %20, align 8, !tbaa !10
  %155 = load ptr, ptr %14, align 8, !tbaa !5
  %156 = load i32, ptr %16, align 4, !tbaa !12
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %16, align 4, !tbaa !12
  %158 = sext i32 %156 to i64
  %159 = getelementptr inbounds double, ptr %155, i64 %158
  store double %154, ptr %159, align 8, !tbaa !10
  %160 = load double, ptr %13, align 8, !tbaa !10
  %161 = load double, ptr %20, align 8, !tbaa !10
  %162 = fpext double %161 to x86_fp80
  %163 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %162)
  %164 = fptrunc x86_fp80 %163 to double
  %165 = call double @llvm.maxnum.f64(double %160, double %164)
  store double %165, ptr %13, align 8, !tbaa !10
  br label %168

166:                                              ; preds = %150
  %167 = load double, ptr %20, align 8, !tbaa !10
  store double %167, ptr %12, align 8, !tbaa !10
  br label %168

168:                                              ; preds = %166, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %169

169:                                              ; preds = %168
  %170 = load i32, ptr %19, align 4, !tbaa !12
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %19, align 4, !tbaa !12
  br label %45, !llvm.loop !18

172:                                              ; preds = %58
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %17, align 4, !tbaa !12
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %17, align 4, !tbaa !12
  br label %38, !llvm.loop !19

176:                                              ; preds = %43
  %177 = load double, ptr %13, align 8, !tbaa !10
  %178 = fcmp une double %177, 0.000000e+00
  br i1 %178, label %179, label %202

179:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 0, ptr %25, align 4, !tbaa !12
  br label %180

180:                                              ; preds = %198, %179
  %181 = load i32, ptr %25, align 4, !tbaa !12
  %182 = load i32, ptr %16, align 4, !tbaa !12
  %183 = icmp slt i32 %181, %182
  br i1 %183, label %185, label %184

184:                                              ; preds = %180
  store i32 17, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %201

185:                                              ; preds = %180
  %186 = load double, ptr %13, align 8, !tbaa !10
  %187 = fdiv double 5.000000e-01, %186
  %188 = load ptr, ptr %14, align 8, !tbaa !5
  %189 = load i32, ptr %25, align 4, !tbaa !12
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds double, ptr %188, i64 %190
  %192 = load double, ptr %191, align 8, !tbaa !10
  %193 = call double @llvm.fmuladd.f64(double %187, double %192, double 5.000000e-01)
  %194 = load ptr, ptr %14, align 8, !tbaa !5
  %195 = load i32, ptr %25, align 4, !tbaa !12
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds double, ptr %194, i64 %196
  store double %193, ptr %197, align 8, !tbaa !10
  br label %198

198:                                              ; preds = %185
  %199 = load i32, ptr %25, align 4, !tbaa !12
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %25, align 4, !tbaa !12
  br label %180, !llvm.loop !20

201:                                              ; preds = %184
  br label %202

202:                                              ; preds = %201, %176
  %203 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %203) #5
  %204 = getelementptr inbounds %struct.encoded_channel, ptr %0, i32 0, i32 0
  %205 = load double, ptr %12, align 8, !tbaa !10
  store double %205, ptr %204, align 8, !tbaa !21
  %206 = getelementptr inbounds %struct.encoded_channel, ptr %0, i32 0, i32 1
  %207 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %207, ptr %206, align 8, !tbaa !23
  %208 = getelementptr inbounds %struct.encoded_channel, ptr %0, i32 0, i32 2
  %209 = load i32, ptr %16, align 4, !tbaa !12
  store i32 %209, ptr %208, align 8, !tbaa !24
  %210 = getelementptr inbounds %struct.encoded_channel, ptr %0, i32 0, i32 3
  %211 = load double, ptr %13, align 8, !tbaa !10
  store double %211, ptr %210, align 8, !tbaa !25
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  ret void
}

; 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 double @cos(double 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare x86_fp80 @llvm.fabs.f80(x86_fp80) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.maxnum.f64(double, double) #4

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = !{!22, !11, i64 0}
!22 = !{!"encoded_channel", !11, i64 0, !6, i64 8, !13, i64 16, !11, i64 24}
!23 = !{!22, !6, i64 8}
!24 = !{!22, !13, i64 16}
!25 = !{!22, !11, i64 24}


; 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.encoded_channel = type { double, ptr, i32, double }

; Function Attrs: nounwind uwtable
define dso_local void @encode_channel(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.encoded_channel) align 8 %0, ptr nocapture noundef readonly %1, i8 noundef zeroext %2, i8 noundef zeroext %3, i8 noundef zeroext %4, i8 noundef zeroext %5) local_unnamed_addr #0 {
  %7 = zext i8 %2 to i32
  %8 = zext i8 %3 to i32
  %9 = shl nuw nsw i32 %7, 3
  %10 = mul nuw nsw i32 %9, %8
  %11 = zext nneg i32 %10 to i64
  %12 = tail call noalias ptr @malloc(i64 noundef %11) #6
  %13 = zext i8 %4 to i64
  %14 = shl nuw nsw i64 %13, 3
  %15 = tail call noalias ptr @malloc(i64 noundef %14) #6
  %.not = icmp eq i8 %3, 0
  br i1 %.not, label %.loopexit, label %.preheader83.lr.ph

.preheader83.lr.ph:                               ; preds = %6
  %16 = zext i8 %4 to i32
  %.not166 = icmp eq i8 %4, 0
  %17 = uitofp i8 %4 to double
  %18 = fdiv double 0x400921FB54442D18, %17
  %19 = zext i8 %5 to i32
  %.not167 = icmp eq i8 %5, 0
  %20 = uitofp i8 %5 to double
  %21 = fdiv double 0x400921FB54442D18, %20
  %22 = mul nuw nsw i32 %19, %16
  %23 = uitofp nneg i32 %22 to double
  %24 = fdiv double 0.000000e+00, %23
  %25 = tail call double @llvm.fabs.f64(double %24)
  br i1 %.not167, label %.preheader83.lr.ph.split, label %.preheader83.lr.ph.split.us

.preheader83.lr.ph.split.us:                      ; preds = %.preheader83.lr.ph
  br i1 %.not166, label %.preheader83.us.preheader, label %.preheader83.us.us.us.preheader

.preheader83.us.preheader:                        ; preds = %.preheader83.lr.ph.split.us
  %xtraiter227 = and i32 %19, 3
  %26 = icmp ult i8 %5, 4
  %unroll_iter230 = and i32 %19, 252
  %lcmp.mod229.not = icmp eq i32 %xtraiter227, 0
  br label %.preheader83.us

.preheader83.us.us.us.preheader:                  ; preds = %.preheader83.lr.ph.split.us
  %27 = zext i8 %4 to i64
  %wide.trip.count181 = zext i8 %5 to i64
  %xtraiter = and i64 %27, 1
  %28 = icmp eq i8 %4, 1
  %unroll_iter = and i64 %27, 254
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %xtraiter221 = and i64 %27, 3
  %29 = icmp ult i8 %4, 4
  %unroll_iter224 = and i64 %27, 252
  %lcmp.mod222.not = icmp eq i64 %xtraiter221, 0
  br label %.preheader83.us.us.us

.preheader83.us.us.us:                            ; preds = %.preheader83.us.us.us.preheader, %._crit_edge.split.us.us.split.us.us.split.us.us
  %.063132.us.us.us = phi double [ %.1.lcssa.us.us.us, %._crit_edge.split.us.us.split.us.us.split.us.us ], [ 0.000000e+00, %.preheader83.us.us.us.preheader ]
  %.069129.us.us.us = phi i32 [ %33, %._crit_edge.split.us.us.split.us.us.split.us.us ], [ 0, %.preheader83.us.us.us.preheader ]
  %.070128.us.us.us = phi i32 [ %.171.lcssa.us.us.us, %._crit_edge.split.us.us.split.us.us.split.us.us ], [ 0, %.preheader83.us.us.us.preheader ]
  %.073127.us.us.us = phi double [ %.174.lcssa.us.us.us, %._crit_edge.split.us.us.split.us.us.split.us.us ], [ 0.000000e+00, %.preheader83.us.us.us.preheader ]
  %30 = sub nsw i32 %8, %.069129.us.us.us
  %31 = mul nsw i32 %30, %7
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.preheader82.lr.ph.us.us.us, label %._crit_edge.split.us.us.split.us.us.split.us.us

._crit_edge.split.us.us.split.us.us.split.us.us:  ; preds = %44, %.preheader83.us.us.us
  %.174.lcssa.us.us.us = phi double [ %.073127.us.us.us, %.preheader83.us.us.us ], [ %.275.us.us.us.us.us.us, %44 ]
  %.171.lcssa.us.us.us = phi i32 [ %.070128.us.us.us, %.preheader83.us.us.us ], [ %.272.us.us.us.us.us.us, %44 ]
  %.1.lcssa.us.us.us = phi double [ %.063132.us.us.us, %.preheader83.us.us.us ], [ %.2.us.us.us.us.us.us, %44 ]
  %33 = add nuw nsw i32 %.069129.us.us.us, 1
  %exitcond183.not = icmp eq i32 %33, %8
  br i1 %exitcond183.not, label %._crit_edge133, label %.preheader83.us.us.us, !llvm.loop !5

.preheader82.lr.ph.us.us.us:                      ; preds = %.preheader83.us.us.us
  %34 = uitofp nneg i32 %.069129.us.us.us to double
  %35 = fmul double %21, %34
  br label %.preheader82.us.us.us.us.us.us

.preheader82.us.us.us.us.us.us:                   ; preds = %44, %.preheader82.lr.ph.us.us.us
  %.1100.us.us.us.us.us.us = phi double [ %.063132.us.us.us, %.preheader82.lr.ph.us.us.us ], [ %.2.us.us.us.us.us.us, %44 ]
  %.06899.us.us.us.us.us.us = phi i32 [ 0, %.preheader82.lr.ph.us.us.us ], [ %45, %44 ]
  %.17198.us.us.us.us.us.us = phi i32 [ %.070128.us.us.us, %.preheader82.lr.ph.us.us.us ], [ %.272.us.us.us.us.us.us, %44 ]
  %.17497.us.us.us.us.us.us = phi double [ %.073127.us.us.us, %.preheader82.lr.ph.us.us.us ], [ %.275.us.us.us.us.us.us, %44 ]
  %36 = uitofp nneg i32 %.06899.us.us.us.us.us.us to double
  %37 = fmul double %18, %36
  br i1 %28, label %.lr.ph88.us.us.us.us.us.us.us.preheader.unr-lcssa, label %.preheader82.us.us.us.us.us.us.new

38:                                               ; preds = %._crit_edge93.split.us.us.us.us.us.us.us
  %39 = add nsw i32 %.17198.us.us.us.us.us.us, 1
  %40 = sext i32 %.17198.us.us.us.us.us.us to i64
  %41 = getelementptr inbounds double, ptr %12, i64 %40
  store double %97, ptr %41, align 8, !tbaa !7
  %42 = tail call double @llvm.fabs.f64(double %97)
  %43 = tail call double @llvm.maxnum.f64(double %.17497.us.us.us.us.us.us, double %42)
  br label %44

44:                                               ; preds = %._crit_edge93.split.us.us.us.us.us.us.us, %38
  %.275.us.us.us.us.us.us = phi double [ %43, %38 ], [ %.17497.us.us.us.us.us.us, %._crit_edge93.split.us.us.us.us.us.us.us ]
  %.272.us.us.us.us.us.us = phi i32 [ %39, %38 ], [ %.17198.us.us.us.us.us.us, %._crit_edge93.split.us.us.us.us.us.us.us ]
  %.2.us.us.us.us.us.us = phi double [ %.1100.us.us.us.us.us.us, %38 ], [ %97, %._crit_edge93.split.us.us.us.us.us.us.us ]
  %45 = add nuw nsw i32 %.06899.us.us.us.us.us.us, 1
  %46 = mul nuw nsw i32 %45, %8
  %47 = icmp slt i32 %46, %31
  br i1 %47, label %.preheader82.us.us.us.us.us.us, label %._crit_edge.split.us.us.split.us.us.split.us.us, !llvm.loop !11

.preheader82.us.us.us.us.us.us.new:               ; preds = %.preheader82.us.us.us.us.us.us, %.preheader82.us.us.us.us.us.us.new
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.preheader82.us.us.us.us.us.us.new ], [ 0, %.preheader82.us.us.us.us.us.us ]
  %niter = phi i64 [ %niter.next.1, %.preheader82.us.us.us.us.us.us.new ], [ 0, %.preheader82.us.us.us.us.us.us ]
  %48 = trunc nuw nsw i64 %indvars.iv to i32
  %49 = uitofp nneg i32 %48 to double
  %50 = fadd double %49, 5.000000e-01
  %51 = fmul double %37, %50
  %52 = tail call double @cos(double noundef %51) #7
  %53 = getelementptr inbounds double, ptr %15, i64 %indvars.iv
  store double %52, ptr %53, align 8, !tbaa !7
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %54 = trunc nuw nsw i64 %indvars.iv.next to i32
  %55 = uitofp nneg i32 %54 to double
  %56 = fadd double %55, 5.000000e-01
  %57 = fmul double %37, %56
  %58 = tail call double @cos(double noundef %57) #7
  %59 = getelementptr inbounds double, ptr %15, i64 %indvars.iv.next
  store double %58, ptr %59, align 8, !tbaa !7
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.lr.ph88.us.us.us.us.us.us.us.preheader.unr-lcssa, label %.preheader82.us.us.us.us.us.us.new, !llvm.loop !12

.lr.ph88.us.us.us.us.us.us.us.preheader.unr-lcssa: ; preds = %.preheader82.us.us.us.us.us.us.new, %.preheader82.us.us.us.us.us.us
  %indvars.iv.unr = phi i64 [ 0, %.preheader82.us.us.us.us.us.us ], [ %indvars.iv.next.1, %.preheader82.us.us.us.us.us.us.new ]
  br i1 %lcmp.mod.not, label %.lr.ph88.us.us.us.us.us.us.us.preheader, label %.lr.ph88.us.us.us.us.us.us.us.preheader.epilog-lcssa

.lr.ph88.us.us.us.us.us.us.us.preheader.epilog-lcssa: ; preds = %.lr.ph88.us.us.us.us.us.us.us.preheader.unr-lcssa
  %60 = trunc nuw nsw i64 %indvars.iv.unr to i32
  %61 = uitofp nneg i32 %60 to double
  %62 = fadd double %61, 5.000000e-01
  %63 = fmul double %37, %62
  %64 = tail call double @cos(double noundef %63) #7
  %65 = getelementptr inbounds double, ptr %15, i64 %indvars.iv.unr
  store double %64, ptr %65, align 8, !tbaa !7
  br label %.lr.ph88.us.us.us.us.us.us.us.preheader

.lr.ph88.us.us.us.us.us.us.us.preheader:          ; preds = %.lr.ph88.us.us.us.us.us.us.us.preheader.unr-lcssa, %.lr.ph88.us.us.us.us.us.us.us.preheader.epilog-lcssa
  br label %.lr.ph88.us.us.us.us.us.us.us

.lr.ph88.us.us.us.us.us.us.us:                    ; preds = %.lr.ph88.us.us.us.us.us.us.us.preheader, %._crit_edge.us.us.us.us.us.us.us
  %indvars.iv178 = phi i64 [ %indvars.iv.next179, %._crit_edge.us.us.us.us.us.us.us ], [ 0, %.lr.ph88.us.us.us.us.us.us.us.preheader ]
  %.06690.us.us.us.us.us.us.us = phi double [ %.lcssa, %._crit_edge.us.us.us.us.us.us.us ], [ 0.000000e+00, %.lr.ph88.us.us.us.us.us.us.us.preheader ]
  %66 = trunc nuw nsw i64 %indvars.iv178 to i32
  %67 = uitofp nneg i32 %66 to double
  %68 = fadd double %67, 5.000000e-01
  %69 = fmul double %35, %68
  %70 = tail call double @cos(double noundef %69) #7
  %71 = mul nuw nsw i64 %indvars.iv178, %27
  %invariant.gep = getelementptr inbounds double, ptr %1, i64 %71
  br i1 %29, label %._crit_edge.us.us.us.us.us.us.us.unr-lcssa, label %.lr.ph88.us.us.us.us.us.us.us.new

.lr.ph88.us.us.us.us.us.us.us.new:                ; preds = %.lr.ph88.us.us.us.us.us.us.us, %.lr.ph88.us.us.us.us.us.us.us.new
  %indvars.iv173 = phi i64 [ %indvars.iv.next174.3, %.lr.ph88.us.us.us.us.us.us.us.new ], [ 0, %.lr.ph88.us.us.us.us.us.us.us ]
  %.16786.us.us.us.us.us.us.us = phi double [ %91, %.lr.ph88.us.us.us.us.us.us.us.new ], [ %.06690.us.us.us.us.us.us.us, %.lr.ph88.us.us.us.us.us.us.us ]
  %niter225 = phi i64 [ %niter225.next.3, %.lr.ph88.us.us.us.us.us.us.us.new ], [ 0, %.lr.ph88.us.us.us.us.us.us.us ]
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv173
  %72 = load double, ptr %gep, align 8, !tbaa !7
  %73 = getelementptr inbounds double, ptr %15, i64 %indvars.iv173
  %74 = load double, ptr %73, align 8, !tbaa !7
  %75 = fmul double %72, %74
  %76 = tail call double @llvm.fmuladd.f64(double %75, double %70, double %.16786.us.us.us.us.us.us.us)
  %indvars.iv.next174 = or disjoint i64 %indvars.iv173, 1
  %gep.1 = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv.next174
  %77 = load double, ptr %gep.1, align 8, !tbaa !7
  %78 = getelementptr inbounds double, ptr %15, i64 %indvars.iv.next174
  %79 = load double, ptr %78, align 8, !tbaa !7
  %80 = fmul double %77, %79
  %81 = tail call double @llvm.fmuladd.f64(double %80, double %70, double %76)
  %indvars.iv.next174.1 = or disjoint i64 %indvars.iv173, 2
  %gep.2 = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv.next174.1
  %82 = load double, ptr %gep.2, align 8, !tbaa !7
  %83 = getelementptr inbounds double, ptr %15, i64 %indvars.iv.next174.1
  %84 = load double, ptr %83, align 8, !tbaa !7
  %85 = fmul double %82, %84
  %86 = tail call double @llvm.fmuladd.f64(double %85, double %70, double %81)
  %indvars.iv.next174.2 = or disjoint i64 %indvars.iv173, 3
  %gep.3 = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv.next174.2
  %87 = load double, ptr %gep.3, align 8, !tbaa !7
  %88 = getelementptr inbounds double, ptr %15, i64 %indvars.iv.next174.2
  %89 = load double, ptr %88, align 8, !tbaa !7
  %90 = fmul double %87, %89
  %91 = tail call double @llvm.fmuladd.f64(double %90, double %70, double %86)
  %indvars.iv.next174.3 = add nuw nsw i64 %indvars.iv173, 4
  %niter225.next.3 = add i64 %niter225, 4
  %niter225.ncmp.3 = icmp eq i64 %niter225.next.3, %unroll_iter224
  br i1 %niter225.ncmp.3, label %._crit_edge.us.us.us.us.us.us.us.unr-lcssa, label %.lr.ph88.us.us.us.us.us.us.us.new, !llvm.loop !13

._crit_edge.us.us.us.us.us.us.us.unr-lcssa:       ; preds = %.lr.ph88.us.us.us.us.us.us.us.new, %.lr.ph88.us.us.us.us.us.us.us
  %.lcssa.ph = phi double [ poison, %.lr.ph88.us.us.us.us.us.us.us ], [ %91, %.lr.ph88.us.us.us.us.us.us.us.new ]
  %indvars.iv173.unr = phi i64 [ 0, %.lr.ph88.us.us.us.us.us.us.us ], [ %indvars.iv.next174.3, %.lr.ph88.us.us.us.us.us.us.us.new ]
  %.16786.us.us.us.us.us.us.us.unr = phi double [ %.06690.us.us.us.us.us.us.us, %.lr.ph88.us.us.us.us.us.us.us ], [ %91, %.lr.ph88.us.us.us.us.us.us.us.new ]
  br i1 %lcmp.mod222.not, label %._crit_edge.us.us.us.us.us.us.us, label %.epil.preheader220

.epil.preheader220:                               ; preds = %._crit_edge.us.us.us.us.us.us.us.unr-lcssa, %.epil.preheader220
  %indvars.iv173.epil = phi i64 [ %indvars.iv.next174.epil, %.epil.preheader220 ], [ %indvars.iv173.unr, %._crit_edge.us.us.us.us.us.us.us.unr-lcssa ]
  %.16786.us.us.us.us.us.us.us.epil = phi double [ %96, %.epil.preheader220 ], [ %.16786.us.us.us.us.us.us.us.unr, %._crit_edge.us.us.us.us.us.us.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader220 ], [ 0, %._crit_edge.us.us.us.us.us.us.us.unr-lcssa ]
  %gep.epil = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv173.epil
  %92 = load double, ptr %gep.epil, align 8, !tbaa !7
  %93 = getelementptr inbounds double, ptr %15, i64 %indvars.iv173.epil
  %94 = load double, ptr %93, align 8, !tbaa !7
  %95 = fmul double %92, %94
  %96 = tail call double @llvm.fmuladd.f64(double %95, double %70, double %.16786.us.us.us.us.us.us.us.epil)
  %indvars.iv.next174.epil = add nuw nsw i64 %indvars.iv173.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter221
  br i1 %epil.iter.cmp.not, label %._crit_edge.us.us.us.us.us.us.us, label %.epil.preheader220, !llvm.loop !14

._crit_edge.us.us.us.us.us.us.us:                 ; preds = %.epil.preheader220, %._crit_edge.us.us.us.us.us.us.us.unr-lcssa
  %.lcssa = phi double [ %.lcssa.ph, %._crit_edge.us.us.us.us.us.us.us.unr-lcssa ], [ %96, %.epil.preheader220 ]
  %indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
  %exitcond182.not = icmp eq i64 %indvars.iv.next179, %wide.trip.count181
  br i1 %exitcond182.not, label %._crit_edge93.split.us.us.us.us.us.us.us, label %.lr.ph88.us.us.us.us.us.us.us, !llvm.loop !16

._crit_edge93.split.us.us.us.us.us.us.us:         ; preds = %._crit_edge.us.us.us.us.us.us.us
  %97 = fdiv double %.lcssa, %23
  %98 = or i32 %.06899.us.us.us.us.us.us, %.069129.us.us.us
  %or.cond.not.us.us.us.us.us.us = icmp eq i32 %98, 0
  br i1 %or.cond.not.us.us.us.us.us.us, label %44, label %38

.preheader83.us:                                  ; preds = %.preheader83.us.preheader, %._crit_edge.split.us.us.split
  %.063132.us = phi double [ %.1.lcssa.us, %._crit_edge.split.us.us.split ], [ 0.000000e+00, %.preheader83.us.preheader ]
  %.069129.us = phi i32 [ %102, %._crit_edge.split.us.us.split ], [ 0, %.preheader83.us.preheader ]
  %.070128.us = phi i32 [ %.171.lcssa.us, %._crit_edge.split.us.us.split ], [ 0, %.preheader83.us.preheader ]
  %.073127.us = phi double [ %.174.lcssa.us, %._crit_edge.split.us.us.split ], [ 0.000000e+00, %.preheader83.us.preheader ]
  %99 = sub nsw i32 %8, %.069129.us
  %100 = mul nsw i32 %99, %7
  %101 = icmp sgt i32 %100, 0
  br i1 %101, label %.preheader82.lr.ph.us, label %._crit_edge.split.us.us.split

._crit_edge.split.us.us.split:                    ; preds = %110, %.preheader83.us
  %.174.lcssa.us = phi double [ %.073127.us, %.preheader83.us ], [ %.275.us.us, %110 ]
  %.171.lcssa.us = phi i32 [ %.070128.us, %.preheader83.us ], [ %.272.us.us, %110 ]
  %.1.lcssa.us = phi double [ %.063132.us, %.preheader83.us ], [ %.2.us.us, %110 ]
  %102 = add nuw nsw i32 %.069129.us, 1
  %exitcond190.not = icmp eq i32 %102, %8
  br i1 %exitcond190.not, label %._crit_edge133, label %.preheader83.us, !llvm.loop !5

.preheader82.lr.ph.us:                            ; preds = %.preheader83.us
  %103 = uitofp nneg i32 %.069129.us to double
  %104 = fmul double %21, %103
  br label %.preheader81.us.us

105:                                              ; preds = %._crit_edge93.split.us104.us
  %106 = add nsw i32 %.17198.us.us, 1
  %107 = sext i32 %.17198.us.us to i64
  %108 = getelementptr inbounds double, ptr %12, i64 %107
  store double %24, ptr %108, align 8, !tbaa !7
  %109 = tail call double @llvm.maxnum.f64(double %.17497.us.us, double %25)
  br label %110

110:                                              ; preds = %._crit_edge93.split.us104.us, %105
  %.275.us.us = phi double [ %109, %105 ], [ %.17497.us.us, %._crit_edge93.split.us104.us ]
  %.272.us.us = phi i32 [ %106, %105 ], [ %.17198.us.us, %._crit_edge93.split.us104.us ]
  %.2.us.us = phi double [ %.1100.us.us, %105 ], [ %24, %._crit_edge93.split.us104.us ]
  %111 = add nuw nsw i32 %.06899.us.us, 1
  %112 = mul nuw nsw i32 %111, %8
  %113 = icmp slt i32 %112, %100
  br i1 %113, label %.preheader81.us.us, label %._crit_edge.split.us.us.split, !llvm.loop !11

.preheader81.us.us.new:                           ; preds = %.preheader81.us.us, %.preheader81.us.us.new
  %.06491.us103.us = phi i32 [ %133, %.preheader81.us.us.new ], [ 0, %.preheader81.us.us ]
  %niter231 = phi i32 [ %niter231.next.3, %.preheader81.us.us.new ], [ 0, %.preheader81.us.us ]
  %114 = uitofp nneg i32 %.06491.us103.us to double
  %115 = fadd double %114, 5.000000e-01
  %116 = fmul double %104, %115
  %117 = tail call double @cos(double noundef %116) #7
  %118 = or disjoint i32 %.06491.us103.us, 1
  %119 = uitofp nneg i32 %118 to double
  %120 = fadd double %119, 5.000000e-01
  %121 = fmul double %104, %120
  %122 = tail call double @cos(double noundef %121) #7
  %123 = or disjoint i32 %.06491.us103.us, 2
  %124 = uitofp nneg i32 %123 to double
  %125 = fadd double %124, 5.000000e-01
  %126 = fmul double %104, %125
  %127 = tail call double @cos(double noundef %126) #7
  %128 = or disjoint i32 %.06491.us103.us, 3
  %129 = uitofp nneg i32 %128 to double
  %130 = fadd double %129, 5.000000e-01
  %131 = fmul double %104, %130
  %132 = tail call double @cos(double noundef %131) #7
  %133 = add nuw nsw i32 %.06491.us103.us, 4
  %niter231.next.3 = add i32 %niter231, 4
  %niter231.ncmp.3 = icmp eq i32 %niter231.next.3, %unroll_iter230
  br i1 %niter231.ncmp.3, label %._crit_edge93.split.us104.us.unr-lcssa, label %.preheader81.us.us.new, !llvm.loop !16

.preheader81.us.us:                               ; preds = %.preheader82.lr.ph.us, %110
  %.1100.us.us = phi double [ %.063132.us, %.preheader82.lr.ph.us ], [ %.2.us.us, %110 ]
  %.06899.us.us = phi i32 [ 0, %.preheader82.lr.ph.us ], [ %111, %110 ]
  %.17198.us.us = phi i32 [ %.070128.us, %.preheader82.lr.ph.us ], [ %.272.us.us, %110 ]
  %.17497.us.us = phi double [ %.073127.us, %.preheader82.lr.ph.us ], [ %.275.us.us, %110 ]
  br i1 %26, label %._crit_edge93.split.us104.us.unr-lcssa, label %.preheader81.us.us.new

._crit_edge93.split.us104.us.unr-lcssa:           ; preds = %.preheader81.us.us.new, %.preheader81.us.us
  %.06491.us103.us.unr = phi i32 [ 0, %.preheader81.us.us ], [ %133, %.preheader81.us.us.new ]
  br i1 %lcmp.mod229.not, label %._crit_edge93.split.us104.us, label %.epil.preheader226

.epil.preheader226:                               ; preds = %._crit_edge93.split.us104.us.unr-lcssa, %.epil.preheader226
  %.06491.us103.us.epil = phi i32 [ %138, %.epil.preheader226 ], [ %.06491.us103.us.unr, %._crit_edge93.split.us104.us.unr-lcssa ]
  %epil.iter228 = phi i32 [ %epil.iter228.next, %.epil.preheader226 ], [ 0, %._crit_edge93.split.us104.us.unr-lcssa ]
  %134 = uitofp nneg i32 %.06491.us103.us.epil to double
  %135 = fadd double %134, 5.000000e-01
  %136 = fmul double %104, %135
  %137 = tail call double @cos(double noundef %136) #7
  %138 = add nuw nsw i32 %.06491.us103.us.epil, 1
  %epil.iter228.next = add i32 %epil.iter228, 1
  %epil.iter228.cmp.not = icmp eq i32 %epil.iter228.next, %xtraiter227
  br i1 %epil.iter228.cmp.not, label %._crit_edge93.split.us104.us, label %.epil.preheader226, !llvm.loop !17

._crit_edge93.split.us104.us:                     ; preds = %.epil.preheader226, %._crit_edge93.split.us104.us.unr-lcssa
  %139 = or i32 %.06899.us.us, %.069129.us
  %or.cond.not.us.us = icmp eq i32 %139, 0
  br i1 %or.cond.not.us.us, label %110, label %105

.preheader83.lr.ph.split:                         ; preds = %.preheader83.lr.ph
  br i1 %.not166, label %.preheader83, label %.preheader83.us140.preheader

.preheader83.us140.preheader:                     ; preds = %.preheader83.lr.ph.split
  %wide.trip.count194 = zext i8 %4 to i64
  %xtraiter233 = and i64 %wide.trip.count194, 1
  %140 = icmp eq i8 %4, 1
  %unroll_iter236 = and i64 %wide.trip.count194, 254
  %lcmp.mod235.not = icmp eq i64 %xtraiter233, 0
  br label %.preheader83.us140

.preheader83.us140:                               ; preds = %.preheader83.us140.preheader, %._crit_edge.split.split.us.us
  %.063132.us141 = phi double [ %.1.lcssa.us147, %._crit_edge.split.split.us.us ], [ 0.000000e+00, %.preheader83.us140.preheader ]
  %.069129.us142 = phi i32 [ %144, %._crit_edge.split.split.us.us ], [ 0, %.preheader83.us140.preheader ]
  %.070128.us143 = phi i32 [ %.171.lcssa.us146, %._crit_edge.split.split.us.us ], [ 0, %.preheader83.us140.preheader ]
  %.073127.us144 = phi double [ %.174.lcssa.us145, %._crit_edge.split.split.us.us ], [ 0.000000e+00, %.preheader83.us140.preheader ]
  %141 = sub nsw i32 %8, %.069129.us142
  %142 = mul nsw i32 %141, %7
  %143 = icmp sgt i32 %142, 0
  br i1 %143, label %.preheader82.us109.us, label %._crit_edge.split.split.us.us

._crit_edge.split.split.us.us:                    ; preds = %152, %.preheader83.us140
  %.174.lcssa.us145 = phi double [ %.073127.us144, %.preheader83.us140 ], [ %.275.us114.us, %152 ]
  %.171.lcssa.us146 = phi i32 [ %.070128.us143, %.preheader83.us140 ], [ %.272.us115.us, %152 ]
  %.1.lcssa.us147 = phi double [ %.063132.us141, %.preheader83.us140 ], [ %.2.us116.us, %152 ]
  %144 = add nuw nsw i32 %.069129.us142, 1
  %exitcond196.not = icmp eq i32 %144, %8
  br i1 %exitcond196.not, label %._crit_edge133, label %.preheader83.us140, !llvm.loop !5

.preheader82.us109.us:                            ; preds = %.preheader83.us140, %152
  %.1100.us110.us = phi double [ %.2.us116.us, %152 ], [ %.063132.us141, %.preheader83.us140 ]
  %.06899.us111.us = phi i32 [ %153, %152 ], [ 0, %.preheader83.us140 ]
  %.17198.us112.us = phi i32 [ %.272.us115.us, %152 ], [ %.070128.us143, %.preheader83.us140 ]
  %.17497.us113.us = phi double [ %.275.us114.us, %152 ], [ %.073127.us144, %.preheader83.us140 ]
  %145 = uitofp nneg i32 %.06899.us111.us to double
  %146 = fmul double %18, %145
  br i1 %140, label %..preheader81_crit_edge.us121.us.unr-lcssa, label %.preheader82.us109.us.new

147:                                              ; preds = %..preheader81_crit_edge.us121.us
  %148 = add nsw i32 %.17198.us112.us, 1
  %149 = sext i32 %.17198.us112.us to i64
  %150 = getelementptr inbounds double, ptr %12, i64 %149
  store double %24, ptr %150, align 8, !tbaa !7
  %151 = tail call double @llvm.maxnum.f64(double %.17497.us113.us, double %25)
  br label %152

152:                                              ; preds = %..preheader81_crit_edge.us121.us, %147
  %.275.us114.us = phi double [ %151, %147 ], [ %.17497.us113.us, %..preheader81_crit_edge.us121.us ]
  %.272.us115.us = phi i32 [ %148, %147 ], [ %.17198.us112.us, %..preheader81_crit_edge.us121.us ]
  %.2.us116.us = phi double [ %.1100.us110.us, %147 ], [ %24, %..preheader81_crit_edge.us121.us ]
  %153 = add nuw nsw i32 %.06899.us111.us, 1
  %154 = mul nuw nsw i32 %153, %8
  %155 = icmp slt i32 %154, %142
  br i1 %155, label %.preheader82.us109.us, label %._crit_edge.split.split.us.us, !llvm.loop !11

.preheader82.us109.us.new:                        ; preds = %.preheader82.us109.us, %.preheader82.us109.us.new
  %indvars.iv191 = phi i64 [ %indvars.iv.next192.1, %.preheader82.us109.us.new ], [ 0, %.preheader82.us109.us ]
  %niter237 = phi i64 [ %niter237.next.1, %.preheader82.us109.us.new ], [ 0, %.preheader82.us109.us ]
  %156 = trunc nuw nsw i64 %indvars.iv191 to i32
  %157 = uitofp nneg i32 %156 to double
  %158 = fadd double %157, 5.000000e-01
  %159 = fmul double %146, %158
  %160 = tail call double @cos(double noundef %159) #7
  %161 = getelementptr inbounds double, ptr %15, i64 %indvars.iv191
  store double %160, ptr %161, align 8, !tbaa !7
  %indvars.iv.next192 = or disjoint i64 %indvars.iv191, 1
  %162 = trunc nuw nsw i64 %indvars.iv.next192 to i32
  %163 = uitofp nneg i32 %162 to double
  %164 = fadd double %163, 5.000000e-01
  %165 = fmul double %146, %164
  %166 = tail call double @cos(double noundef %165) #7
  %167 = getelementptr inbounds double, ptr %15, i64 %indvars.iv.next192
  store double %166, ptr %167, align 8, !tbaa !7
  %indvars.iv.next192.1 = add nuw nsw i64 %indvars.iv191, 2
  %niter237.next.1 = add i64 %niter237, 2
  %niter237.ncmp.1 = icmp eq i64 %niter237.next.1, %unroll_iter236
  br i1 %niter237.ncmp.1, label %..preheader81_crit_edge.us121.us.unr-lcssa, label %.preheader82.us109.us.new, !llvm.loop !12

..preheader81_crit_edge.us121.us.unr-lcssa:       ; preds = %.preheader82.us109.us.new, %.preheader82.us109.us
  %indvars.iv191.unr = phi i64 [ 0, %.preheader82.us109.us ], [ %indvars.iv.next192.1, %.preheader82.us109.us.new ]
  br i1 %lcmp.mod235.not, label %..preheader81_crit_edge.us121.us, label %..preheader81_crit_edge.us121.us.epilog-lcssa

..preheader81_crit_edge.us121.us.epilog-lcssa:    ; preds = %..preheader81_crit_edge.us121.us.unr-lcssa
  %168 = trunc nuw nsw i64 %indvars.iv191.unr to i32
  %169 = uitofp nneg i32 %168 to double
  %170 = fadd double %169, 5.000000e-01
  %171 = fmul double %146, %170
  %172 = tail call double @cos(double noundef %171) #7
  %173 = getelementptr inbounds double, ptr %15, i64 %indvars.iv191.unr
  store double %172, ptr %173, align 8, !tbaa !7
  br label %..preheader81_crit_edge.us121.us

..preheader81_crit_edge.us121.us:                 ; preds = %..preheader81_crit_edge.us121.us.unr-lcssa, %..preheader81_crit_edge.us121.us.epilog-lcssa
  %174 = or i32 %.06899.us111.us, %.069129.us142
  %or.cond.not.us119.us = icmp eq i32 %174, 0
  br i1 %or.cond.not.us119.us, label %152, label %147

.preheader83:                                     ; preds = %.preheader83.lr.ph.split, %._crit_edge.split.split
  %.063132 = phi double [ %.1.lcssa, %._crit_edge.split.split ], [ 0.000000e+00, %.preheader83.lr.ph.split ]
  %.069129 = phi i32 [ %187, %._crit_edge.split.split ], [ 0, %.preheader83.lr.ph.split ]
  %.070128 = phi i32 [ %.171.lcssa, %._crit_edge.split.split ], [ 0, %.preheader83.lr.ph.split ]
  %.073127 = phi double [ %.174.lcssa, %._crit_edge.split.split ], [ 0.000000e+00, %.preheader83.lr.ph.split ]
  %175 = sub nsw i32 %8, %.069129
  %176 = mul nsw i32 %175, %7
  %177 = icmp sgt i32 %176, 0
  br i1 %177, label %.preheader82, label %._crit_edge.split.split

._crit_edge133:                                   ; preds = %._crit_edge.split.us.us.split.us.us.split.us.us, %._crit_edge.split.us.us.split, %._crit_edge.split.split.us.us, %._crit_edge.split.split
  %.073.lcssa = phi double [ %.174.lcssa, %._crit_edge.split.split ], [ %.174.lcssa.us145, %._crit_edge.split.split.us.us ], [ %.174.lcssa.us, %._crit_edge.split.us.us.split ], [ %.174.lcssa.us.us.us, %._crit_edge.split.us.us.split.us.us.split.us.us ]
  %.070.lcssa = phi i32 [ %.171.lcssa, %._crit_edge.split.split ], [ %.171.lcssa.us146, %._crit_edge.split.split.us.us ], [ %.171.lcssa.us, %._crit_edge.split.us.us.split ], [ %.171.lcssa.us.us.us, %._crit_edge.split.us.us.split.us.us.split.us.us ]
  %.063.lcssa = phi double [ %.1.lcssa, %._crit_edge.split.split ], [ %.1.lcssa.us147, %._crit_edge.split.split.us.us ], [ %.1.lcssa.us, %._crit_edge.split.us.us.split ], [ %.1.lcssa.us.us.us, %._crit_edge.split.us.us.split.us.us.split.us.us ]
  %178 = fcmp une double %.073.lcssa, 0.000000e+00
  %179 = icmp sgt i32 %.070.lcssa, 0
  %or.cond = select i1 %178, i1 %179, i1 false
  br i1 %or.cond, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %._crit_edge133
  %180 = fdiv double 5.000000e-01, %.073.lcssa
  %wide.trip.count201 = zext nneg i32 %.070.lcssa to i64
  %min.iters.check = icmp ult i32 %.070.lcssa, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv198.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count201, 2147483644
  %broadcast.splatinsert = insertelement <2 x double> poison, double %180, 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, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %181 = getelementptr inbounds double, ptr %12, i64 %index
  %182 = getelementptr inbounds i8, ptr %181, i64 16
  %wide.load = load <2 x double>, ptr %181, align 8, !tbaa !7
  %wide.load216 = load <2 x double>, ptr %182, align 8, !tbaa !7
  %183 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load, <2 x double> <double 5.000000e-01, double 5.000000e-01>)
  %184 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load216, <2 x double> <double 5.000000e-01, double 5.000000e-01>)
  store <2 x double> %183, ptr %181, align 8, !tbaa !7
  store <2 x double> %184, ptr %182, align 8, !tbaa !7
  %index.next = add nuw i64 %index, 4
  %185 = icmp eq i64 %index.next, %n.vec
  br i1 %185, label %middle.block, label %vector.body, !llvm.loop !18

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

.preheader82:                                     ; preds = %.preheader83, %193
  %.1100 = phi double [ %.2, %193 ], [ %.063132, %.preheader83 ]
  %.06899 = phi i32 [ %194, %193 ], [ 0, %.preheader83 ]
  %.17198 = phi i32 [ %.272, %193 ], [ %.070128, %.preheader83 ]
  %.17497 = phi double [ %.275, %193 ], [ %.073127, %.preheader83 ]
  %186 = or i32 %.06899, %.069129
  %or.cond.not = icmp eq i32 %186, 0
  br i1 %or.cond.not, label %193, label %188

._crit_edge.split.split:                          ; preds = %193, %.preheader83
  %.174.lcssa = phi double [ %.073127, %.preheader83 ], [ %.275, %193 ]
  %.171.lcssa = phi i32 [ %.070128, %.preheader83 ], [ %.272, %193 ]
  %.1.lcssa = phi double [ %.063132, %.preheader83 ], [ %.2, %193 ]
  %187 = add nuw nsw i32 %.069129, 1
  %exitcond197.not = icmp eq i32 %187, %8
  br i1 %exitcond197.not, label %._crit_edge133, label %.preheader83, !llvm.loop !5

188:                                              ; preds = %.preheader82
  %189 = add nsw i32 %.17198, 1
  %190 = sext i32 %.17198 to i64
  %191 = getelementptr inbounds double, ptr %12, i64 %190
  store double %24, ptr %191, align 8, !tbaa !7
  %192 = tail call double @llvm.maxnum.f64(double %.17497, double %25)
  br label %193

193:                                              ; preds = %.preheader82, %188
  %.275 = phi double [ %192, %188 ], [ %.17497, %.preheader82 ]
  %.272 = phi i32 [ %189, %188 ], [ %.17198, %.preheader82 ]
  %.2 = phi double [ %.1100, %188 ], [ %24, %.preheader82 ]
  %194 = add nuw nsw i32 %.06899, 1
  %195 = mul nuw nsw i32 %194, %8
  %196 = icmp slt i32 %195, %176
  br i1 %196, label %.preheader82, label %._crit_edge.split.split, !llvm.loop !11

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv198 = phi i64 [ %indvars.iv.next199, %scalar.ph ], [ %indvars.iv198.ph, %scalar.ph.preheader ]
  %197 = getelementptr inbounds double, ptr %12, i64 %indvars.iv198
  %198 = load double, ptr %197, align 8, !tbaa !7
  %199 = tail call double @llvm.fmuladd.f64(double %180, double %198, double 5.000000e-01)
  store double %199, ptr %197, align 8, !tbaa !7
  %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
  %exitcond202.not = icmp eq i64 %indvars.iv.next199, %wide.trip.count201
  br i1 %exitcond202.not, label %.loopexit, label %scalar.ph, !llvm.loop !21

.loopexit:                                        ; preds = %scalar.ph, %middle.block, %6, %._crit_edge133
  %.063.lcssa209 = phi double [ %.063.lcssa, %._crit_edge133 ], [ 0.000000e+00, %6 ], [ %.063.lcssa, %middle.block ], [ %.063.lcssa, %scalar.ph ]
  %.070.lcssa208 = phi i32 [ %.070.lcssa, %._crit_edge133 ], [ 0, %6 ], [ %.070.lcssa, %middle.block ], [ %.070.lcssa, %scalar.ph ]
  %.073.lcssa207 = phi double [ %.073.lcssa, %._crit_edge133 ], [ 0.000000e+00, %6 ], [ %.073.lcssa, %middle.block ], [ %.073.lcssa, %scalar.ph ]
  tail call void @free(ptr noundef %15) #7
  store double %.063.lcssa209, ptr %0, align 8, !tbaa !22
  %200 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %12, ptr %200, align 8, !tbaa !26
  %201 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %.070.lcssa208, ptr %201, align 8, !tbaa !27
  %202 = getelementptr inbounds i8, ptr %0, i64 24
  store double %.073.lcssa207, ptr %202, align 8, !tbaa !28
  ret void
}

; 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 nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.maxnum.f64(double, double) #3

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #5

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 nofree nounwind willreturn memory(write) "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !6, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !6, !20, !19}
!22 = !{!23, !8, i64 0}
!23 = !{!"encoded_channel", !8, i64 0, !24, i64 8, !25, i64 16, !8, i64 24}
!24 = !{!"any pointer", !9, i64 0}
!25 = !{!"int", !9, i64 0}
!26 = !{!23, !24, i64 8}
!27 = !{!23, !25, i64 16}
!28 = !{!23, !8, i64 24}


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