; LLVM IR from BoysTownOrg/chapro :: nfc_prepare (cha_nfc_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_NFC = type { i32, i32, i32, i32, double, double, double, ptr, ptr, ptr }

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

; Function Attrs: nounwind uwtable
define dso_local i32 @cha_nfc_prepare(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.CHA_NFC, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !9
  store i32 %22, ptr %12, align 4, !tbaa !13
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.CHA_NFC, ptr %23, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !14
  store i32 %25, ptr %14, align 4, !tbaa !13
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.CHA_NFC, ptr %26, i32 0, i32 3
  %28 = load i32, ptr %27, align 4, !tbaa !15
  store i32 %28, ptr %17, align 4, !tbaa !13
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.CHA_NFC, ptr %29, i32 0, i32 2
  %31 = load i32, ptr %30, align 8, !tbaa !16
  store i32 %31, ptr %16, align 4, !tbaa !13
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.CHA_NFC, ptr %32, i32 0, i32 4
  %34 = load double, ptr %33, align 8, !tbaa !17
  store double %34, ptr %6, align 8, !tbaa !18
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.CHA_NFC, ptr %35, i32 0, i32 5
  %37 = load double, ptr %36, align 8, !tbaa !19
  store double %37, ptr %7, align 8, !tbaa !18
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.CHA_NFC, ptr %38, i32 0, i32 6
  %40 = load double, ptr %39, align 8, !tbaa !20
  store double %40, ptr %8, align 8, !tbaa !18
  %41 = load i32, ptr %14, align 4, !tbaa !13
  %42 = load double, ptr %7, align 8, !tbaa !18
  %43 = load double, ptr %8, align 8, !tbaa !18
  %44 = load i32, ptr %17, align 4, !tbaa !13
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %41, double noundef %42, double noundef %43, i32 noundef %44)
  %46 = load i32, ptr %12, align 4, !tbaa !13
  %47 = icmp sle i32 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %2
  store i32 1, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %204

49:                                               ; preds = %2
  %50 = load i32, ptr %12, align 4, !tbaa !13
  %51 = srem i32 %50, 2
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %57, label %53

53:                                               ; preds = %49
  %54 = load i32, ptr %14, align 4, !tbaa !13
  %55 = srem i32 %54, 2
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %53, %49
  store i32 1, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %204

58:                                               ; preds = %53
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  call void @cha_prepare(ptr noundef %59)
  %60 = load i32, ptr %12, align 4, !tbaa !13
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds ptr, ptr %61, i64 1
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  %64 = getelementptr inbounds i32, ptr %63, i64 0
  store i32 %60, ptr %64, align 4, !tbaa !13
  %65 = load double, ptr %6, align 8, !tbaa !18
  %66 = fdiv double %65, 1.000000e+03
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds ptr, ptr %67, i64 2
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  %70 = getelementptr inbounds double, ptr %69, i64 0
  store double %66, ptr %70, align 8, !tbaa !18
  %71 = load i32, ptr %14, align 4, !tbaa !13
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds ptr, ptr %72, i64 1
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds i32, ptr %74, i64 20
  store i32 %71, ptr %75, align 4, !tbaa !13
  %76 = load i32, ptr %16, align 4, !tbaa !13
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds ptr, ptr %77, i64 1
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  %80 = getelementptr inbounds i32, ptr %79, i64 22
  store i32 %76, ptr %80, align 4, !tbaa !13
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.CHA_NFC, ptr %81, i32 0, i32 7
  %83 = load ptr, ptr %82, align 8, !tbaa !21
  %84 = icmp ne ptr %83, null
  br i1 %84, label %85, label %108

85:                                               ; preds = %58
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.CHA_NFC, ptr %86, i32 0, i32 3
  %88 = load i32, ptr %87, align 4, !tbaa !15
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %108

90:                                               ; preds = %85
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.CHA_NFC, ptr %91, i32 0, i32 3
  %93 = load i32, ptr %92, align 4, !tbaa !15
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds ptr, ptr %94, i64 1
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = getelementptr inbounds i32, ptr %96, i64 21
  store i32 %93, ptr %97, align 4, !tbaa !13
  store i32 %93, ptr %17, align 4, !tbaa !13
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = load i32, ptr %17, align 4, !tbaa !13
  %100 = call ptr @cha_allocate(ptr noundef %98, i32 noundef %99, i32 noundef 4, i32 noundef 42)
  store ptr %100, ptr %18, align 8, !tbaa !5
  %101 = load ptr, ptr %18, align 8, !tbaa !5
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.CHA_NFC, ptr %102, i32 0, i32 7
  %104 = load ptr, ptr %103, align 8, !tbaa !21
  %105 = load i32, ptr %17, align 4, !tbaa !13
  %106 = sext i32 %105 to i64
  %107 = mul i64 %106, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %101, ptr align 4 %104, i64 %107, i1 false)
  br label %127

108:                                              ; preds = %85, %58
  %109 = load i32, ptr %14, align 4, !tbaa !13
  %110 = load double, ptr %7, align 8, !tbaa !18
  %111 = load double, ptr %8, align 8, !tbaa !18
  %112 = load double, ptr %6, align 8, !tbaa !18
  %113 = call i32 @nfc_map(i32 noundef %109, double noundef %110, double noundef %111, double noundef %112, ptr noundef null)
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds ptr, ptr %114, i64 1
  %116 = load ptr, ptr %115, align 8, !tbaa !5
  %117 = getelementptr inbounds i32, ptr %116, i64 21
  store i32 %113, ptr %117, align 4, !tbaa !13
  store i32 %113, ptr %17, align 4, !tbaa !13
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = load i32, ptr %17, align 4, !tbaa !13
  %120 = call ptr @cha_allocate(ptr noundef %118, i32 noundef %119, i32 noundef 4, i32 noundef 42)
  store ptr %120, ptr %18, align 8, !tbaa !5
  %121 = load i32, ptr %14, align 4, !tbaa !13
  %122 = load double, ptr %7, align 8, !tbaa !18
  %123 = load double, ptr %8, align 8, !tbaa !18
  %124 = load double, ptr %6, align 8, !tbaa !18
  %125 = load ptr, ptr %18, align 8, !tbaa !5
  %126 = call i32 @nfc_map(i32 noundef %121, double noundef %122, double noundef %123, double noundef %124, ptr noundef %125)
  br label %127

127:                                              ; preds = %108, %90
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds ptr, ptr %128, i64 1
  %130 = load ptr, ptr %129, align 8, !tbaa !5
  %131 = getelementptr inbounds i32, ptr %130, i64 24
  store i32 0, ptr %131, align 4, !tbaa !13
  %132 = load i32, ptr %14, align 4, !tbaa !13
  %133 = sdiv i32 %132, 2
  %134 = load i32, ptr %12, align 4, !tbaa !13
  %135 = sdiv i32 %133, %134
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds ptr, ptr %136, i64 1
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = getelementptr inbounds i32, ptr %138, i64 23
  store i32 %135, ptr %139, align 4, !tbaa !13
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = load i32, ptr %14, align 4, !tbaa !13
  %142 = call ptr @cha_allocate(ptr noundef %140, i32 noundef %141, i32 noundef 4, i32 noundef 43)
  store ptr %142, ptr %9, align 8, !tbaa !5
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = load i32, ptr %14, align 4, !tbaa !13
  %145 = load i32, ptr %16, align 4, !tbaa !13
  call void @nfc_window(ptr noundef %143, i32 noundef %144, i32 noundef %145, i32 noundef 2)
  %146 = load i32, ptr %14, align 4, !tbaa !13
  %147 = mul nsw i32 %146, 2
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %13, align 4, !tbaa !13
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = load i32, ptr %14, align 4, !tbaa !13
  %151 = call ptr @cha_allocate(ptr noundef %149, i32 noundef %150, i32 noundef 4, i32 noundef 44)
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = load i32, ptr %13, align 4, !tbaa !13
  %154 = mul nsw i32 %153, 2
  %155 = call ptr @cha_allocate(ptr noundef %152, i32 noundef %154, i32 noundef 4, i32 noundef 46)
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = load i32, ptr %13, align 4, !tbaa !13
  %158 = mul nsw i32 %157, 2
  %159 = call ptr @cha_allocate(ptr noundef %156, i32 noundef %158, i32 noundef 4, i32 noundef 45)
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = load i32, ptr %13, align 4, !tbaa !13
  %162 = mul nsw i32 %161, 2
  %163 = call ptr @cha_allocate(ptr noundef %160, i32 noundef %162, i32 noundef 4, i32 noundef 47)
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.CHA_NFC, ptr %164, i32 0, i32 8
  %166 = load ptr, ptr %165, align 8, !tbaa !22
  %167 = icmp ne ptr %166, null
  br i1 %167, label %168, label %179

168:                                              ; preds = %127
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = load i32, ptr %14, align 4, !tbaa !13
  %171 = call ptr @cha_allocate(ptr noundef %169, i32 noundef %170, i32 noundef 4, i32 noundef 48)
  store ptr %171, ptr %10, align 8, !tbaa !5
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.CHA_NFC, ptr %173, i32 0, i32 8
  %175 = load ptr, ptr %174, align 8, !tbaa !22
  %176 = load i32, ptr %14, align 4, !tbaa !13
  %177 = sext i32 %176 to i64
  %178 = mul i64 %177, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %172, ptr align 4 %175, i64 %178, i1 false)
  br label %179

179:                                              ; preds = %168, %127
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.CHA_NFC, ptr %180, i32 0, i32 9
  %182 = load ptr, ptr %181, align 8, !tbaa !23
  %183 = icmp ne ptr %182, null
  br i1 %183, label %184, label %203

184:                                              ; preds = %179
  %185 = load double, ptr %8, align 8, !tbaa !18
  %186 = fmul double 2.000000e+00, %185
  %187 = load double, ptr %6, align 8, !tbaa !18
  %188 = fdiv double %186, %187
  %189 = fptrunc double %188 to float
  %190 = fadd float %189, 5.000000e-01
  %191 = call float @llvm.floor.f32(float %190)
  %192 = fptosi float %191 to i32
  store i32 %192, ptr %15, align 4, !tbaa !13
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = load i32, ptr %15, align 4, !tbaa !13
  %195 = call ptr @cha_allocate(ptr noundef %193, i32 noundef %194, i32 noundef 4, i32 noundef 49)
  store ptr %195, ptr %11, align 8, !tbaa !5
  %196 = load ptr, ptr %11, align 8, !tbaa !5
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.CHA_NFC, ptr %197, i32 0, i32 9
  %199 = load ptr, ptr %198, align 8, !tbaa !23
  %200 = load i32, ptr %15, align 4, !tbaa !13
  %201 = sext i32 %200 to i64
  %202 = mul i64 %201, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %196, ptr align 4 %199, i64 %202, i1 false)
  br label %203

203:                                              ; preds = %184, %179
  store i32 0, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %204

204:                                              ; preds = %203, %57, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #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 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %205 = load i32, ptr %3, align 4
  ret i32 %205
}

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

declare i32 @printf(ptr noundef, ...) #2

declare void @cha_prepare(ptr noundef) #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @nfc_map(i32 noundef, double noundef, double noundef, double noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @nfc_window(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.floor.f32(float) #4

; 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 24, !12, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 4}
!15 = !{!10, !11, i64 12}
!16 = !{!10, !11, i64 8}
!17 = !{!10, !12, i64 16}
!18 = !{!12, !12, i64 0}
!19 = !{!10, !12, i64 24}
!20 = !{!10, !12, i64 32}
!21 = !{!10, !6, i64 40}
!22 = !{!10, !6, i64 48}
!23 = !{!10, !6, i64 56}


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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @cha_nfc_prepare(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = load i32, ptr %1, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !12
  %6 = getelementptr inbounds i8, ptr %1, i64 12
  %7 = load i32, ptr %6, align 4, !tbaa !13
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %1, i64 16
  %11 = load double, ptr %10, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %1, i64 24
  %13 = load double, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %1, i64 32
  %15 = load double, ptr %14, align 8, !tbaa !17
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5, double noundef %13, double noundef %15, i32 noundef %7)
  %17 = icmp slt i32 %3, 1
  br i1 %17, label %79, label %18

18:                                               ; preds = %2
  %19 = or i32 %5, %3
  %20 = and i32 %19, 1
  %or.cond = icmp eq i32 %20, 0
  br i1 %or.cond, label %21, label %79

21:                                               ; preds = %18
  tail call void @cha_prepare(ptr noundef %0) #5
  %22 = getelementptr inbounds i8, ptr %0, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  store i32 %3, ptr %23, align 4, !tbaa !19
  %24 = fdiv double %11, 1.000000e+03
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  store double %24, ptr %26, align 8, !tbaa !20
  %27 = getelementptr inbounds i8, ptr %23, i64 80
  store i32 %5, ptr %27, align 4, !tbaa !19
  %28 = getelementptr inbounds i8, ptr %23, i64 88
  store i32 %9, ptr %28, align 4, !tbaa !19
  %29 = getelementptr inbounds i8, ptr %1, i64 40
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %.not79 = icmp eq ptr %30, null
  br i1 %.not79, label %39, label %31

31:                                               ; preds = %21
  %32 = load i32, ptr %6, align 4, !tbaa !13
  %.not80 = icmp eq i32 %32, 0
  br i1 %.not80, label %39, label %33

33:                                               ; preds = %31
  %34 = getelementptr inbounds i8, ptr %23, i64 84
  store i32 %32, ptr %34, align 4, !tbaa !19
  %35 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %32, i32 noundef 4, i32 noundef 42) #5
  %36 = load ptr, ptr %29, align 8, !tbaa !21
  %37 = sext i32 %32 to i64
  %38 = shl nsw i64 %37, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %36, i64 %38, i1 false)
  br label %45

39:                                               ; preds = %31, %21
  %40 = tail call i32 @nfc_map(i32 noundef %5, double noundef %13, double noundef %15, double noundef %11, ptr noundef null)
  %41 = load ptr, ptr %22, align 8, !tbaa !18
  %42 = getelementptr inbounds i8, ptr %41, i64 84
  store i32 %40, ptr %42, align 4, !tbaa !19
  %43 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %40, i32 noundef 4, i32 noundef 42) #5
  %44 = tail call i32 @nfc_map(i32 noundef %5, double noundef %13, double noundef %15, double noundef %11, ptr noundef %43)
  br label %45

45:                                               ; preds = %39, %33
  %46 = load ptr, ptr %22, align 8, !tbaa !18
  %47 = getelementptr inbounds i8, ptr %46, i64 96
  store i32 0, ptr %47, align 4, !tbaa !19
  %48 = ashr exact i32 %5, 1
  %49 = sdiv i32 %48, %3
  %50 = getelementptr inbounds i8, ptr %46, i64 92
  store i32 %49, ptr %50, align 4, !tbaa !19
  %51 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %5, i32 noundef 4, i32 noundef 43) #5
  tail call void @nfc_window(ptr noundef %51, i32 noundef %5, i32 noundef %9, i32 noundef 2)
  %52 = shl i32 %5, 2
  %53 = or disjoint i32 %52, 2
  %54 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %5, i32 noundef 4, i32 noundef 44) #5
  %55 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %53, i32 noundef 4, i32 noundef 46) #5
  %56 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %53, i32 noundef 4, i32 noundef 45) #5
  %57 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %53, i32 noundef 4, i32 noundef 47) #5
  %58 = getelementptr inbounds i8, ptr %1, i64 48
  %59 = load ptr, ptr %58, align 8, !tbaa !22
  %.not81 = icmp eq ptr %59, null
  br i1 %.not81, label %65, label %60

60:                                               ; preds = %45
  %61 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %5, i32 noundef 4, i32 noundef 48) #5
  %62 = load ptr, ptr %58, align 8, !tbaa !22
  %63 = sext i32 %5 to i64
  %64 = shl nsw i64 %63, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %61, ptr align 4 %62, i64 %64, i1 false)
  br label %65

65:                                               ; preds = %60, %45
  %66 = getelementptr inbounds i8, ptr %1, i64 56
  %67 = load ptr, ptr %66, align 8, !tbaa !23
  %.not82 = icmp eq ptr %67, null
  br i1 %.not82, label %79, label %68

68:                                               ; preds = %65
  %69 = fmul double %15, 2.000000e+00
  %70 = fdiv double %69, %11
  %71 = fptrunc double %70 to float
  %72 = fadd float %71, 5.000000e-01
  %73 = tail call float @llvm.floor.f32(float %72)
  %74 = fptosi float %73 to i32
  %75 = tail call ptr @cha_allocate(ptr noundef nonnull %0, i32 noundef %74, i32 noundef 4, i32 noundef 49) #5
  %76 = load ptr, ptr %66, align 8, !tbaa !23
  %77 = sext i32 %74 to i64
  %78 = shl nsw i64 %77, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %75, ptr align 4 %76, i64 %78, i1 false)
  br label %79

79:                                               ; preds = %65, %68, %18, %2
  %.0 = phi i32 [ 1, %2 ], [ 1, %18 ], [ 0, %68 ], [ 0, %65 ]
  ret i32 %.0
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @nfc_map(i32 noundef, double noundef, double noundef, double noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @nfc_window(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.floor.f32(float) #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 = { nofree 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !7, i64 12}
!14 = !{!6, !7, i64 8}
!15 = !{!6, !10, i64 16}
!16 = !{!6, !10, i64 24}
!17 = !{!6, !10, i64 32}
!18 = !{!11, !11, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!10, !10, i64 0}
!21 = !{!6, !11, i64 40}
!22 = !{!6, !11, i64 48}
!23 = !{!6, !11, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass