; LLVM IR from BoysTownOrg/chapro :: agc_prepare (cha_agc_prepare)

; 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.CHA_WDRC = type { double, double, double, double, double, double, double, double, double, i32, i32, i32 }
%struct.CHA_DSL = type { double, double, double, i32, i32, [32 x double], [32 x double], [32 x double], [32 x double], [32 x double] }

; Function Attrs: nounwind uwtable
define dso_local i32 @cha_agc_prepare(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  call void @cha_prepare(ptr noundef %19)
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds ptr, ptr %20, i64 1
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds i32, ptr %22, i64 0
  %24 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %24, ptr %17, align 4, !tbaa !9
  %25 = load i32, ptr %17, align 4, !tbaa !9
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %3
  store i32 1, ptr %4, align 4
  store i32 1, ptr %18, align 4
  br label %250

28:                                               ; preds = %3
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load i32, ptr %17, align 4, !tbaa !9
  %31 = call ptr @cha_allocate(ptr noundef %29, i32 noundef %30, i32 noundef 4, i32 noundef 16)
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.CHA_WDRC, ptr %32, i32 0, i32 0
  %34 = load double, ptr %33, align 8, !tbaa !11
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.CHA_WDRC, ptr %35, i32 0, i32 1
  %37 = load double, ptr %36, align 8, !tbaa !14
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.CHA_WDRC, ptr %38, i32 0, i32 2
  %40 = load double, ptr %39, align 8, !tbaa !15
  call void @time_const(double noundef %34, double noundef %37, double noundef %40, ptr noundef %13, ptr noundef %14)
  %41 = load float, ptr %13, align 4, !tbaa !16
  %42 = fpext float %41 to double
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds ptr, ptr %43, i64 2
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = getelementptr inbounds double, ptr %45, i64 1
  store double %42, ptr %46, align 8, !tbaa !18
  %47 = load float, ptr %14, align 4, !tbaa !16
  %48 = fpext float %47 to double
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds ptr, ptr %49, i64 2
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = getelementptr inbounds double, ptr %51, i64 2
  store double %48, ptr %52, align 8, !tbaa !18
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.CHA_WDRC, ptr %53, i32 0, i32 3
  %55 = load double, ptr %54, align 8, !tbaa !19
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds ptr, ptr %56, i64 2
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds double, ptr %58, i64 3
  store double %55, ptr %59, align 8, !tbaa !18
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.CHA_WDRC, ptr %60, i32 0, i32 4
  %62 = load double, ptr %61, align 8, !tbaa !20
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds ptr, ptr %63, i64 2
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = getelementptr inbounds double, ptr %65, i64 4
  store double %62, ptr %66, align 8, !tbaa !18
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.CHA_WDRC, ptr %67, i32 0, i32 6
  %69 = load double, ptr %68, align 8, !tbaa !21
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds ptr, ptr %70, i64 2
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = getelementptr inbounds double, ptr %72, i64 6
  store double %69, ptr %73, align 8, !tbaa !18
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.CHA_WDRC, ptr %74, i32 0, i32 5
  %76 = load double, ptr %75, align 8, !tbaa !22
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds ptr, ptr %77, i64 2
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  %80 = getelementptr inbounds double, ptr %79, i64 5
  store double %76, ptr %80, align 8, !tbaa !18
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.CHA_WDRC, ptr %81, i32 0, i32 7
  %83 = load double, ptr %82, align 8, !tbaa !23
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds ptr, ptr %84, i64 2
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = getelementptr inbounds double, ptr %86, i64 7
  store double %83, ptr %87, align 8, !tbaa !18
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = call ptr @cha_allocate(ptr noundef %88, i32 noundef 2, i32 noundef 4, i32 noundef 17)
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.CHA_DSL, ptr %90, i32 0, i32 4
  %92 = load i32, ptr %91, align 4, !tbaa !24
  store i32 %92, ptr %16, align 4, !tbaa !9
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load i32, ptr %16, align 4, !tbaa !9
  %95 = call ptr @cha_allocate(ptr noundef %93, i32 noundef %94, i32 noundef 4, i32 noundef 11)
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = load i32, ptr %16, align 4, !tbaa !9
  %98 = call ptr @cha_allocate(ptr noundef %96, i32 noundef %97, i32 noundef 4, i32 noundef 12)
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = load i32, ptr %16, align 4, !tbaa !9
  %101 = call ptr @cha_allocate(ptr noundef %99, i32 noundef %100, i32 noundef 4, i32 noundef 13)
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = load i32, ptr %16, align 4, !tbaa !9
  %104 = call ptr @cha_allocate(ptr noundef %102, i32 noundef %103, i32 noundef 4, i32 noundef 14)
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = load i32, ptr %16, align 4, !tbaa !9
  %107 = call ptr @cha_allocate(ptr noundef %105, i32 noundef %106, i32 noundef 4, i32 noundef 15)
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds ptr, ptr %108, i64 11
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  store ptr %110, ptr %9, align 8, !tbaa !5
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds ptr, ptr %111, i64 12
  %113 = load ptr, ptr %112, align 8, !tbaa !5
  store ptr %113, ptr %10, align 8, !tbaa !5
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds ptr, ptr %114, i64 13
  %116 = load ptr, ptr %115, align 8, !tbaa !5
  store ptr %116, ptr %11, align 8, !tbaa !5
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds ptr, ptr %117, i64 14
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  store ptr %119, ptr %12, align 8, !tbaa !5
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.CHA_DSL, ptr %120, i32 0, i32 0
  %122 = load double, ptr %121, align 8, !tbaa !26
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.CHA_DSL, ptr %123, i32 0, i32 1
  %125 = load double, ptr %124, align 8, !tbaa !27
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.CHA_WDRC, ptr %126, i32 0, i32 2
  %128 = load double, ptr %127, align 8, !tbaa !15
  call void @time_const(double noundef %122, double noundef %125, double noundef %128, ptr noundef %13, ptr noundef %14)
  %129 = load i32, ptr %16, align 4, !tbaa !9
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds ptr, ptr %130, i64 1
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = getelementptr inbounds i32, ptr %132, i64 1
  store i32 %129, ptr %133, align 4, !tbaa !9
  %134 = load float, ptr %13, align 4, !tbaa !16
  %135 = fpext float %134 to double
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds ptr, ptr %136, i64 2
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = getelementptr inbounds double, ptr %138, i64 8
  store double %135, ptr %139, align 8, !tbaa !18
  %140 = load float, ptr %14, align 4, !tbaa !16
  %141 = fpext float %140 to double
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds ptr, ptr %142, i64 2
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  %145 = getelementptr inbounds double, ptr %144, i64 9
  store double %141, ptr %145, align 8, !tbaa !18
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %195, %28
  %147 = load i32, ptr %15, align 4, !tbaa !9
  %148 = load i32, ptr %16, align 4, !tbaa !9
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %150, label %198

150:                                              ; preds = %146
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.CHA_DSL, ptr %151, i32 0, i32 8
  %153 = load i32, ptr %15, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [32 x double], ptr %152, i64 0, i64 %154
  %156 = load double, ptr %155, align 8, !tbaa !18
  %157 = fptrunc double %156 to float
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = load i32, ptr %15, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds float, ptr %158, i64 %160
  store float %157, ptr %161, align 4, !tbaa !16
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.CHA_DSL, ptr %162, i32 0, i32 7
  %164 = load i32, ptr %15, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [32 x double], ptr %163, i64 0, i64 %165
  %167 = load double, ptr %166, align 8, !tbaa !18
  %168 = fptrunc double %167 to float
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = load i32, ptr %15, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds float, ptr %169, i64 %171
  store float %168, ptr %172, align 4, !tbaa !16
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.CHA_DSL, ptr %173, i32 0, i32 6
  %175 = load i32, ptr %15, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [32 x double], ptr %174, i64 0, i64 %176
  %178 = load double, ptr %177, align 8, !tbaa !18
  %179 = fptrunc double %178 to float
  %180 = load ptr, ptr %11, align 8, !tbaa !5
  %181 = load i32, ptr %15, align 4, !tbaa !9
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds float, ptr %180, i64 %182
  store float %179, ptr %183, align 4, !tbaa !16
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.CHA_DSL, ptr %184, i32 0, i32 9
  %186 = load i32, ptr %15, align 4, !tbaa !9
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [32 x double], ptr %185, i64 0, i64 %187
  %189 = load double, ptr %188, align 8, !tbaa !18
  %190 = fptrunc double %189 to float
  %191 = load ptr, ptr %12, align 8, !tbaa !5
  %192 = load i32, ptr %15, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds float, ptr %191, i64 %193
  store float %190, ptr %194, align 4, !tbaa !16
  br label %195

195:                                              ; preds = %150
  %196 = load i32, ptr %15, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %15, align 4, !tbaa !9
  br label %146, !llvm.loop !28

198:                                              ; preds = %146
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.CHA_WDRC, ptr %199, i32 0, i32 5
  %201 = load double, ptr %200, align 8, !tbaa !22
  store double %201, ptr %8, align 8, !tbaa !18
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %202

202:                                              ; preds = %246, %198
  %203 = load i32, ptr %15, align 4, !tbaa !9
  %204 = load i32, ptr %16, align 4, !tbaa !9
  %205 = icmp slt i32 %203, %204
  br i1 %205, label %206, label %249

206:                                              ; preds = %202
  %207 = load ptr, ptr %12, align 8, !tbaa !5
  %208 = load i32, ptr %15, align 4, !tbaa !9
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds float, ptr %207, i64 %209
  %211 = load float, ptr %210, align 4, !tbaa !16
  %212 = fpext float %211 to double
  %213 = load double, ptr %8, align 8, !tbaa !18
  %214 = fcmp ogt double %212, %213
  br i1 %214, label %215, label %222

215:                                              ; preds = %206
  %216 = load double, ptr %8, align 8, !tbaa !18
  %217 = fptrunc double %216 to float
  %218 = load ptr, ptr %12, align 8, !tbaa !5
  %219 = load i32, ptr %15, align 4, !tbaa !9
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds float, ptr %218, i64 %220
  store float %217, ptr %221, align 4, !tbaa !16
  br label %222

222:                                              ; preds = %215, %206
  %223 = load ptr, ptr %11, align 8, !tbaa !5
  %224 = load i32, ptr %15, align 4, !tbaa !9
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds float, ptr %223, i64 %225
  %227 = load float, ptr %226, align 4, !tbaa !16
  %228 = fcmp olt float %227, 0.000000e+00
  br i1 %228, label %229, label %245

229:                                              ; preds = %222
  %230 = load ptr, ptr %12, align 8, !tbaa !5
  %231 = load i32, ptr %15, align 4, !tbaa !9
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds float, ptr %230, i64 %232
  %234 = load float, ptr %233, align 4, !tbaa !16
  %235 = load ptr, ptr %11, align 8, !tbaa !5
  %236 = load i32, ptr %15, align 4, !tbaa !9
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds float, ptr %235, i64 %237
  %239 = load float, ptr %238, align 4, !tbaa !16
  %240 = fadd float %234, %239
  %241 = load ptr, ptr %12, align 8, !tbaa !5
  %242 = load i32, ptr %15, align 4, !tbaa !9
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds float, ptr %241, i64 %243
  store float %240, ptr %244, align 4, !tbaa !16
  br label %245

245:                                              ; preds = %229, %222
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %15, align 4, !tbaa !9
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %15, align 4, !tbaa !9
  br label %202, !llvm.loop !30

249:                                              ; preds = %202
  store i32 0, ptr %4, align 4
  store i32 1, ptr %18, align 4
  br label %250

250:                                              ; preds = %249, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %251 = load i32, ptr %4, align 4
  ret i32 %251
}

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

declare void @cha_prepare(ptr noundef) #2

declare ptr @cha_allocate(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @time_const(double noundef, double noundef, double noundef, ptr noundef, ptr noundef) #3

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

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 = { "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 = { inlinehint 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !10, i64 72, !10, i64 76, !10, i64 80}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!12, !13, i64 16}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!13, !13, i64 0}
!19 = !{!12, !13, i64 24}
!20 = !{!12, !13, i64 32}
!21 = !{!12, !13, i64 48}
!22 = !{!12, !13, i64 40}
!23 = !{!12, !13, i64 56}
!24 = !{!25, !10, i64 28}
!25 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !10, i64 24, !10, i64 28, !7, i64 32, !7, i64 288, !7, i64 544, !7, i64 800, !7, i64 1056}
!26 = !{!25, !13, i64 0}
!27 = !{!25, !13, i64 8}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}


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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @cha_agc_prepare(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  tail call void @cha_prepare(ptr noundef %0) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %.loopexit, label %10

10:                                               ; preds = %3
  %11 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %8, i32 noundef 4, i32 noundef 16) #4
  %12 = load double, ptr %2, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  %14 = load double, ptr %13, align 8, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %2, i64 16
  %16 = load double, ptr %15, align 8, !tbaa !15
  call void @time_const(double noundef %12, double noundef %14, double noundef %16, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %17 = load float, ptr %4, align 4, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = load float, ptr %5, align 4, !tbaa !16
  %22 = insertelement <2 x float> poison, float %17, i64 0
  %23 = insertelement <2 x float> %22, float %21, i64 1
  %24 = fpext <2 x float> %23 to <2 x double>
  store <2 x double> %24, ptr %20, align 8, !tbaa !18
  %25 = getelementptr inbounds i8, ptr %2, i64 24
  %26 = load double, ptr %25, align 8, !tbaa !19
  %27 = getelementptr inbounds i8, ptr %19, i64 24
  store double %26, ptr %27, align 8, !tbaa !18
  %28 = getelementptr inbounds i8, ptr %2, i64 32
  %29 = load double, ptr %28, align 8, !tbaa !20
  %30 = getelementptr inbounds i8, ptr %19, i64 32
  store double %29, ptr %30, align 8, !tbaa !18
  %31 = getelementptr inbounds i8, ptr %2, i64 48
  %32 = load double, ptr %31, align 8, !tbaa !21
  %33 = getelementptr inbounds i8, ptr %19, i64 48
  store double %32, ptr %33, align 8, !tbaa !18
  %34 = getelementptr inbounds i8, ptr %2, i64 40
  %35 = load double, ptr %34, align 8, !tbaa !22
  %36 = getelementptr inbounds i8, ptr %19, i64 40
  store double %35, ptr %36, align 8, !tbaa !18
  %37 = getelementptr inbounds i8, ptr %2, i64 56
  %38 = load double, ptr %37, align 8, !tbaa !23
  %39 = getelementptr inbounds i8, ptr %19, i64 56
  store double %38, ptr %39, align 8, !tbaa !18
  %40 = call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef 2, i32 noundef 4, i32 noundef 17) #4
  %41 = getelementptr inbounds i8, ptr %1, i64 28
  %42 = load i32, ptr %41, align 4, !tbaa !24
  %43 = call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %42, i32 noundef 4, i32 noundef 11) #4
  %44 = call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %42, i32 noundef 4, i32 noundef 12) #4
  %45 = call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %42, i32 noundef 4, i32 noundef 13) #4
  %46 = call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %42, i32 noundef 4, i32 noundef 14) #4
  %47 = call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %42, i32 noundef 4, i32 noundef 15) #4
  %48 = getelementptr inbounds i8, ptr %0, i64 88
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = ptrtoint ptr %49 to i64
  %51 = getelementptr inbounds i8, ptr %0, i64 96
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = ptrtoint ptr %52 to i64
  %54 = getelementptr inbounds i8, ptr %0, i64 104
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  %56 = ptrtoint ptr %55 to i64
  %57 = getelementptr inbounds i8, ptr %0, i64 112
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = ptrtoint ptr %58 to i64
  %60 = load double, ptr %1, align 8, !tbaa !26
  %61 = getelementptr inbounds i8, ptr %1, i64 8
  %62 = load double, ptr %61, align 8, !tbaa !27
  %63 = load double, ptr %15, align 8, !tbaa !15
  call void @time_const(double noundef %60, double noundef %62, double noundef %63, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 4
  store i32 %42, ptr %65, align 4, !tbaa !9
  %66 = load float, ptr %4, align 4, !tbaa !16
  %67 = load ptr, ptr %18, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 64
  %69 = load float, ptr %5, align 4, !tbaa !16
  %70 = insertelement <2 x float> poison, float %66, i64 0
  %71 = insertelement <2 x float> %70, float %69, i64 1
  %72 = fpext <2 x float> %71 to <2 x double>
  store <2 x double> %72, ptr %68, align 8, !tbaa !18
  %73 = icmp sgt i32 %42, 0
  br i1 %73, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %10
  %74 = getelementptr inbounds i8, ptr %1, i64 800
  %75 = getelementptr inbounds i8, ptr %1, i64 544
  %76 = getelementptr inbounds i8, ptr %1, i64 288
  %77 = getelementptr inbounds i8, ptr %1, i64 1056
  %wide.trip.count = zext nneg i32 %42 to i64
  %min.iters.check = icmp ult i32 %42, 14
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph
  %78 = sub i64 %53, %50
  %diff.check = icmp ult i64 %78, 8
  %79 = sub i64 %56, %50
  %diff.check95 = icmp ult i64 %79, 8
  %conflict.rdx = or i1 %diff.check, %diff.check95
  %80 = sub i64 %59, %50
  %diff.check96 = icmp ult i64 %80, 8
  %conflict.rdx97 = or i1 %conflict.rdx, %diff.check96
  %81 = sub i64 %56, %53
  %diff.check98 = icmp ult i64 %81, 8
  %conflict.rdx99 = or i1 %conflict.rdx97, %diff.check98
  %82 = sub i64 %59, %53
  %diff.check100 = icmp ult i64 %82, 8
  %conflict.rdx101 = or i1 %conflict.rdx99, %diff.check100
  %83 = sub i64 %59, %56
  %diff.check102 = icmp ult i64 %83, 8
  %conflict.rdx103 = or i1 %conflict.rdx101, %diff.check102
  br i1 %conflict.rdx103, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 2147483646
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %84 = getelementptr inbounds [32 x double], ptr %74, i64 0, i64 %index
  %wide.load = load <2 x double>, ptr %84, align 8, !tbaa !18
  %85 = fptrunc <2 x double> %wide.load to <2 x float>
  %86 = getelementptr inbounds float, ptr %49, i64 %index
  store <2 x float> %85, ptr %86, align 4, !tbaa !16
  %87 = getelementptr inbounds [32 x double], ptr %75, i64 0, i64 %index
  %wide.load104 = load <2 x double>, ptr %87, align 8, !tbaa !18
  %88 = fptrunc <2 x double> %wide.load104 to <2 x float>
  %89 = getelementptr inbounds float, ptr %52, i64 %index
  store <2 x float> %88, ptr %89, align 4, !tbaa !16
  %90 = getelementptr inbounds [32 x double], ptr %76, i64 0, i64 %index
  %wide.load105 = load <2 x double>, ptr %90, align 8, !tbaa !18
  %91 = fptrunc <2 x double> %wide.load105 to <2 x float>
  %92 = getelementptr inbounds float, ptr %55, i64 %index
  store <2 x float> %91, ptr %92, align 4, !tbaa !16
  %93 = getelementptr inbounds [32 x double], ptr %77, i64 0, i64 %index
  %wide.load106 = load <2 x double>, ptr %93, align 8, !tbaa !18
  %94 = fptrunc <2 x double> %wide.load106 to <2 x float>
  %95 = getelementptr inbounds float, ptr %58, i64 %index
  store <2 x float> %94, ptr %95, align 4, !tbaa !16
  %index.next = add nuw i64 %index, 2
  %96 = icmp eq i64 %index.next, %n.vec
  br i1 %96, label %middle.block, label %vector.body, !llvm.loop !28

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

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

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %97 = getelementptr inbounds [32 x double], ptr %74, i64 0, i64 %indvars.iv
  %98 = load double, ptr %97, align 8, !tbaa !18
  %99 = fptrunc double %98 to float
  %100 = getelementptr inbounds float, ptr %49, i64 %indvars.iv
  store float %99, ptr %100, align 4, !tbaa !16
  %101 = getelementptr inbounds [32 x double], ptr %75, i64 0, i64 %indvars.iv
  %102 = load double, ptr %101, align 8, !tbaa !18
  %103 = fptrunc double %102 to float
  %104 = getelementptr inbounds float, ptr %52, i64 %indvars.iv
  store float %103, ptr %104, align 4, !tbaa !16
  %105 = getelementptr inbounds [32 x double], ptr %76, i64 0, i64 %indvars.iv
  %106 = load double, ptr %105, align 8, !tbaa !18
  %107 = fptrunc double %106 to float
  %108 = getelementptr inbounds float, ptr %55, i64 %indvars.iv
  store float %107, ptr %108, align 4, !tbaa !16
  %109 = getelementptr inbounds [32 x double], ptr %77, i64 0, i64 %indvars.iv
  %110 = load double, ptr %109, align 8, !tbaa !18
  %111 = fptrunc double %110 to float
  %112 = getelementptr inbounds float, ptr %58, i64 %indvars.iv
  store float %111, ptr %112, align 4, !tbaa !16
  %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 %._crit_edge, label %scalar.ph, !llvm.loop !32

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %113 = load double, ptr %34, align 8, !tbaa !22
  br i1 %73, label %.lr.ph88, label %.loopexit

.lr.ph88:                                         ; preds = %._crit_edge
  %114 = fptrunc double %113 to float
  %wide.trip.count93 = zext nneg i32 %42 to i64
  br label %115

115:                                              ; preds = %.lr.ph88, %128
  %indvars.iv90 = phi i64 [ 0, %.lr.ph88 ], [ %indvars.iv.next91, %128 ]
  %116 = getelementptr inbounds float, ptr %58, i64 %indvars.iv90
  %117 = load float, ptr %116, align 4, !tbaa !16
  %118 = fpext float %117 to double
  %119 = fcmp olt double %113, %118
  br i1 %119, label %120, label %121

120:                                              ; preds = %115
  store float %114, ptr %116, align 4, !tbaa !16
  br label %121

121:                                              ; preds = %120, %115
  %122 = phi float [ %114, %120 ], [ %117, %115 ]
  %123 = getelementptr inbounds float, ptr %55, i64 %indvars.iv90
  %124 = load float, ptr %123, align 4, !tbaa !16
  %125 = fcmp olt float %124, 0.000000e+00
  br i1 %125, label %126, label %128

126:                                              ; preds = %121
  %127 = fadd float %124, %122
  store float %127, ptr %116, align 4, !tbaa !16
  br label %128

128:                                              ; preds = %121, %126
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %exitcond94.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count93
  br i1 %exitcond94.not, label %.loopexit, label %115, !llvm.loop !33

.loopexit:                                        ; preds = %128, %10, %._crit_edge, %3
  %.0 = phi i32 [ 1, %3 ], [ 0, %._crit_edge ], [ 0, %10 ], [ 0, %128 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  ret i32 %.0
}

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

declare void @cha_prepare(ptr noundef) local_unnamed_addr #2

declare ptr @cha_allocate(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @time_const(double noundef, double noundef, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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 = { "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 = { inlinehint 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !10, i64 72, !10, i64 76, !10, i64 80}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!12, !13, i64 16}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!13, !13, i64 0}
!19 = !{!12, !13, i64 24}
!20 = !{!12, !13, i64 32}
!21 = !{!12, !13, i64 48}
!22 = !{!12, !13, i64 40}
!23 = !{!12, !13, i64 56}
!24 = !{!25, !10, i64 28}
!25 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !10, i64 24, !10, i64 28, !7, i64 32, !7, i64 288, !7, i64 544, !7, i64 800, !7, i64 1056}
!26 = !{!25, !13, i64 0}
!27 = !{!25, !13, i64 8}
!28 = distinct !{!28, !29, !30, !31}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!"llvm.loop.isvectorized", i32 1}
!31 = !{!"llvm.loop.unroll.runtime.disable"}
!32 = distinct !{!32, !29, !30}
!33 = distinct !{!33, !29}


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