; LLVM IR from VT-ICAM/cfem :: cfem (cf_build_triplet_matrix)

; 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.cf_local_element_s = type { [3 x double], [3 x double], [4 x double], [2 x double], double, double, ptr }
%struct.cf_mesh_s = type { i32, ptr, i32, i32, ptr }
%struct.cf_ref_arrays_s = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double }
%struct.cf_triplet_matrix_s = type { i32, ptr, ptr, ptr }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [60 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @ipow(i32 noundef, i32 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

; Function Attrs: nounwind uwtable
declare dso_local void @cf_init_element_data(ptr dead_on_unwind noalias writable sret(%struct.cf_local_element_s) align 8, ptr noundef align 8 dereferenceable(24), ptr noundef align 8 dereferenceable(24), double noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @cf_get_corners(ptr noundef, i32 noundef, ptr noundef align 8 dereferenceable(24), ptr noundef align 8 dereferenceable(24)) #1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind uwtable
define dso_local i32 @cf_build_triplet_matrix(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.cf_local_element_s, align 8
  %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 i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca [3 x double], align 16
  %23 = alloca [3 x double], align 16
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  %26 = alloca %struct.cf_local_element_s, align 8
  %27 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 120, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #6
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.cf_mesh_s, ptr %28, i32 0, i32 3
  %30 = load i32, ptr %29, align 4, !tbaa !9
  %31 = call i32 @ipow(i32 noundef %30, i32 noundef 2)
  %32 = zext i32 %31 to i64
  %33 = call ptr @llvm.stacksave.p0()
  store ptr %33, ptr %24, align 8
  %34 = alloca double, i64 %32, align 16
  store i64 %32, ptr %25, align 8
  store i32 0, ptr %21, align 4, !tbaa !12
  store i32 0, ptr %13, align 4, !tbaa !12
  br label %35

35:                                               ; preds = %168, %5
  %36 = load i32, ptr %13, align 4, !tbaa !12
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.cf_mesh_s, ptr %37, i32 0, i32 2
  %39 = load i32, ptr %38, align 8, !tbaa !13
  %40 = icmp slt i32 %36, %39
  br i1 %40, label %41, label %171

41:                                               ; preds = %35
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = load i32, ptr %13, align 4, !tbaa !12
  %44 = getelementptr inbounds [3 x double], ptr %22, i64 0, i64 0
  %45 = getelementptr inbounds [3 x double], ptr %23, i64 0, i64 0
  %46 = call i32 @cf_get_corners(ptr noundef %42, i32 noundef %43, ptr noundef %44, ptr noundef %45)
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %41
  br label %173

49:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 120, ptr %26) #6
  %50 = getelementptr inbounds [3 x double], ptr %22, i64 0, i64 0
  %51 = getelementptr inbounds [3 x double], ptr %23, i64 0, i64 0
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %52, i32 0, i32 11
  %54 = load double, ptr %53, align 8, !tbaa !14
  call void @cf_init_element_data(ptr dead_on_unwind writable sret(%struct.cf_local_element_s) align 8 %26, ptr noundef %50, ptr noundef %51, double noundef %54)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %26, i64 120, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 120, ptr %26) #6
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = call i32 %55(ptr noundef %56, ptr noundef %12, ptr noundef %57, ptr noundef %34)
  store i32 0, ptr %19, align 4, !tbaa !12
  br label %59

59:                                               ; preds = %164, %49
  %60 = load i32, ptr %19, align 4, !tbaa !12
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.cf_mesh_s, ptr %61, i32 0, i32 3
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = icmp slt i32 %60, %63
  br i1 %64, label %65, label %167

65:                                               ; preds = %59
  %66 = load i32, ptr %13, align 4, !tbaa !12
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.cf_mesh_s, ptr %67, i32 0, i32 3
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = mul nsw i32 %66, %69
  %71 = load i32, ptr %19, align 4, !tbaa !12
  %72 = add nsw i32 %70, %71
  store i32 %72, ptr %16, align 4, !tbaa !12
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.cf_mesh_s, ptr %73, i32 0, i32 4
  %75 = load ptr, ptr %74, align 8, !tbaa !20
  %76 = load i32, ptr %16, align 4, !tbaa !12
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %75, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !12
  store i32 %79, ptr %17, align 4, !tbaa !12
  store i32 0, ptr %20, align 4, !tbaa !12
  br label %80

80:                                               ; preds = %160, %65
  %81 = load i32, ptr %20, align 4, !tbaa !12
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.cf_mesh_s, ptr %82, i32 0, i32 3
  %84 = load i32, ptr %83, align 4, !tbaa !9
  %85 = icmp slt i32 %81, %84
  br i1 %85, label %86, label %163

86:                                               ; preds = %80
  %87 = load i32, ptr %13, align 4, !tbaa !12
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.cf_mesh_s, ptr %88, i32 0, i32 3
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = mul nsw i32 %87, %90
  %92 = load i32, ptr %20, align 4, !tbaa !12
  %93 = add nsw i32 %91, %92
  store i32 %93, ptr %16, align 4, !tbaa !12
  %94 = load i32, ptr %13, align 4, !tbaa !12
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.cf_mesh_s, ptr %95, i32 0, i32 3
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = call i32 @ipow(i32 noundef %97, i32 noundef 2)
  %99 = mul nsw i32 %94, %98
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.cf_mesh_s, ptr %100, i32 0, i32 3
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = load i32, ptr %19, align 4, !tbaa !12
  %104 = mul nsw i32 %102, %103
  %105 = add nsw i32 %99, %104
  %106 = load i32, ptr %20, align 4, !tbaa !12
  %107 = add nsw i32 %105, %106
  store i32 %107, ptr %15, align 4, !tbaa !12
  %108 = load i32, ptr %15, align 4, !tbaa !12
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.cf_triplet_matrix_s, ptr %109, i32 0, i32 0
  %111 = load i32, ptr %110, align 8, !tbaa !21
  %112 = icmp sge i32 %108, %111
  br i1 %112, label %113, label %121

113:                                              ; preds = %86
  %114 = load ptr, ptr @stderr, align 8, !tbaa !5
  %115 = load i32, ptr %15, align 4, !tbaa !12
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.cf_triplet_matrix_s, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 8, !tbaa !21
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef @.str, i32 noundef %115, i32 noundef %118) #6
  store i32 0, ptr %15, align 4, !tbaa !12
  store i32 1, ptr %21, align 4, !tbaa !12
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %173

121:                                              ; preds = %86
  %122 = load i32, ptr %19, align 4, !tbaa !12
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.cf_mesh_s, ptr %123, i32 0, i32 3
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = mul nsw i32 %122, %125
  %127 = load i32, ptr %20, align 4, !tbaa !12
  %128 = add nsw i32 %126, %127
  store i32 %128, ptr %14, align 4, !tbaa !12
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.cf_mesh_s, ptr %129, i32 0, i32 4
  %131 = load ptr, ptr %130, align 8, !tbaa !20
  %132 = load i32, ptr %16, align 4, !tbaa !12
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %131, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !12
  store i32 %135, ptr %18, align 4, !tbaa !12
  %136 = load i32, ptr %14, align 4, !tbaa !12
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds double, ptr %34, i64 %137
  %139 = load double, ptr %138, align 8, !tbaa !19
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.cf_triplet_matrix_s, ptr %140, i32 0, i32 3
  %142 = load ptr, ptr %141, align 8, !tbaa !23
  %143 = load i32, ptr %15, align 4, !tbaa !12
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds double, ptr %142, i64 %144
  store double %139, ptr %145, align 8, !tbaa !19
  %146 = load i32, ptr %17, align 4, !tbaa !12
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.cf_triplet_matrix_s, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !24
  %150 = load i32, ptr %15, align 4, !tbaa !12
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds i32, ptr %149, i64 %151
  store i32 %146, ptr %152, align 4, !tbaa !12
  %153 = load i32, ptr %18, align 4, !tbaa !12
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.cf_triplet_matrix_s, ptr %154, i32 0, i32 2
  %156 = load ptr, ptr %155, align 8, !tbaa !25
  %157 = load i32, ptr %15, align 4, !tbaa !12
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds i32, ptr %156, i64 %158
  store i32 %153, ptr %159, align 4, !tbaa !12
  br label %160

160:                                              ; preds = %121
  %161 = load i32, ptr %20, align 4, !tbaa !12
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %20, align 4, !tbaa !12
  br label %80, !llvm.loop !26

163:                                              ; preds = %80
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %19, align 4, !tbaa !12
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %19, align 4, !tbaa !12
  br label %59, !llvm.loop !28

167:                                              ; preds = %59
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %13, align 4, !tbaa !12
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %13, align 4, !tbaa !12
  br label %35, !llvm.loop !29

171:                                              ; preds = %35
  %172 = load i32, ptr %21, align 4, !tbaa !12
  store i32 %172, ptr %6, align 4
  store i32 1, ptr %27, align 4
  br label %175

173:                                              ; preds = %113, %48
  %174 = load i32, ptr %21, align 4, !tbaa !12
  store i32 %174, ptr %6, align 4
  store i32 1, ptr %27, align 4
  br label %175

175:                                              ; preds = %173, %171
  %176 = load ptr, ptr %24, align 8
  call void @llvm.stackrestore.p0(ptr %176)
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %12) #6
  %177 = load i32, ptr %6, align 4
  ret i32 %177
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { "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 #6 = { 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 20}
!10 = !{!"", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 16}
!14 = !{!15, !16, i64 80}
!15 = !{!"", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !16, i64 80}
!16 = !{!"double", !7, i64 0}
!17 = !{i64 0, i64 24, !18, i64 24, i64 24, !18, i64 48, i64 32, !18, i64 80, i64 16, !18, i64 96, i64 8, !19, i64 104, i64 8, !19, i64 112, i64 8, !5}
!18 = !{!7, !7, i64 0}
!19 = !{!16, !16, i64 0}
!20 = !{!10, !6, i64 24}
!21 = !{!22, !11, i64 0}
!22 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = !{!22, !6, i64 24}
!24 = !{!22, !6, i64 8}
!25 = !{!22, !6, i64 16}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = distinct !{!29, !27}


; 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.cf_local_element_s = type { [3 x double], [3 x double], [4 x double], [2 x double], double, double, ptr }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [60 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @ipow(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

; Function Attrs: nounwind uwtable
declare dso_local void @cf_init_element_data(ptr dead_on_unwind noalias writable sret(%struct.cf_local_element_s) align 8, ptr noundef align 8 dereferenceable(24), ptr noundef align 8 dereferenceable(24), double noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @cf_get_corners(ptr noundef, i32 noundef, ptr noundef align 8 dereferenceable(24), ptr noundef align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @cf_build_triplet_matrix(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef readonly %4) local_unnamed_addr #1 {
  %6 = alloca %struct.cf_local_element_s, align 8
  %7 = alloca [3 x double], align 16
  %8 = alloca [3 x double], align 16
  %9 = alloca %struct.cf_local_element_s, align 8
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  %10 = getelementptr inbounds i8, ptr %1, i64 20
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = tail call i32 @ipow(i32 noundef %11, i32 noundef 2)
  %13 = zext i32 %12 to i64
  %14 = tail call ptr @llvm.stacksave.p0()
  %15 = alloca double, i64 %13, align 16
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph68, label %.loopexit

.lr.ph68:                                         ; preds = %5
  %19 = getelementptr inbounds i8, ptr %2, i64 80
  %20 = getelementptr inbounds i8, ptr %1, i64 24
  %21 = getelementptr inbounds i8, ptr %4, i64 24
  %22 = getelementptr inbounds i8, ptr %4, i64 8
  %23 = getelementptr inbounds i8, ptr %4, i64 16
  br label %24

24:                                               ; preds = %.lr.ph68, %._crit_edge64
  %.05065 = phi i32 [ 0, %.lr.ph68 ], [ %75, %._crit_edge64 ]
  %25 = call i32 @cf_get_corners(ptr noundef nonnull %1, i32 noundef %.05065, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %26, label %.loopexit

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %9) #5
  %27 = load double, ptr %19, align 8, !tbaa !12
  call void @cf_init_element_data(ptr dead_on_unwind nonnull writable sret(%struct.cf_local_element_s) align 8 %9, ptr noundef nonnull %7, ptr noundef nonnull %8, double noundef %27)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %6, ptr noundef nonnull align 8 dereferenceable(120) %9, i64 120, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %9) #5
  %28 = call i32 %0(ptr noundef %2, ptr noundef nonnull %6, ptr noundef %3, ptr noundef nonnull %15) #5
  %29 = load i32, ptr %10, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph63.split.preheader, label %._crit_edge64

.lr.ph63.split.preheader:                         ; preds = %26
  %.pre = load ptr, ptr %20, align 8, !tbaa !19
  br label %.lr.ph63.split

.lr.ph63.split:                                   ; preds = %.lr.ph63.split.preheader, %._crit_edge
  %31 = phi i32 [ %71, %._crit_edge ], [ %29, %.lr.ph63.split.preheader ]
  %32 = phi ptr [ %72, %._crit_edge ], [ %.pre, %.lr.ph63.split.preheader ]
  %.05361 = phi i32 [ %73, %._crit_edge ], [ 0, %.lr.ph63.split.preheader ]
  %33 = mul nsw i32 %31, %.05065
  %34 = add nsw i32 %33, %.05361
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %32, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !20
  %38 = icmp sgt i32 %31, 0
  br i1 %38, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph63.split, %51
  %39 = phi i32 [ %69, %51 ], [ %31, %.lr.ph63.split ]
  %.05260 = phi i32 [ %68, %51 ], [ 0, %.lr.ph63.split ]
  %40 = call i32 @ipow(i32 noundef %39, i32 noundef 2)
  %41 = mul nsw i32 %40, %.05065
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = mul nsw i32 %42, %.05361
  %44 = add i32 %43, %.05260
  %45 = add i32 %44, %41
  %46 = load i32, ptr %4, align 8, !tbaa !21
  %.not58 = icmp slt i32 %45, %46
  br i1 %.not58, label %51, label %47

47:                                               ; preds = %.lr.ph
  %48 = load ptr, ptr @stderr, align 8, !tbaa !18
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str, i32 noundef %45, i32 noundef %46) #6
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.loopexit

51:                                               ; preds = %.lr.ph
  %52 = mul nsw i32 %39, %.05065
  %53 = add nsw i32 %52, %.05260
  %54 = load ptr, ptr %20, align 8, !tbaa !19
  %55 = sext i32 %53 to i64
  %56 = getelementptr inbounds i32, ptr %54, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !20
  %58 = sext i32 %44 to i64
  %59 = getelementptr inbounds double, ptr %15, i64 %58
  %60 = load double, ptr %59, align 8, !tbaa !17
  %61 = load ptr, ptr %21, align 8, !tbaa !23
  %62 = sext i32 %45 to i64
  %63 = getelementptr inbounds double, ptr %61, i64 %62
  store double %60, ptr %63, align 8, !tbaa !17
  %64 = load ptr, ptr %22, align 8, !tbaa !24
  %65 = getelementptr inbounds i32, ptr %64, i64 %62
  store i32 %37, ptr %65, align 4, !tbaa !20
  %66 = load ptr, ptr %23, align 8, !tbaa !25
  %67 = getelementptr inbounds i32, ptr %66, i64 %62
  store i32 %57, ptr %67, align 4, !tbaa !20
  %68 = add nuw nsw i32 %.05260, 1
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %.lr.ph, label %._crit_edge, !llvm.loop !26

._crit_edge:                                      ; preds = %51, %.lr.ph63.split
  %71 = phi i32 [ %31, %.lr.ph63.split ], [ %69, %51 ]
  %72 = phi ptr [ %32, %.lr.ph63.split ], [ %54, %51 ]
  %73 = add nuw nsw i32 %.05361, 1
  %74 = icmp slt i32 %73, %71
  br i1 %74, label %.lr.ph63.split, label %._crit_edge64, !llvm.loop !28

._crit_edge64:                                    ; preds = %._crit_edge, %26
  %75 = add nuw nsw i32 %.05065, 1
  %76 = load i32, ptr %16, align 8, !tbaa !11
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %24, label %.loopexit, !llvm.loop !30

.loopexit:                                        ; preds = %._crit_edge64, %24, %5, %47
  %.0 = phi i32 [ 1, %47 ], [ 0, %5 ], [ 0, %24 ], [ 0, %._crit_edge64 ]
  call void @llvm.stackrestore.p0(ptr %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %6) #5
  ret i32 %.0
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { cold 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 20}
!6 = !{!"", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 16}
!12 = !{!13, !14, i64 80}
!13 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !14, i64 80}
!14 = !{!"double", !8, i64 0}
!15 = !{i64 0, i64 24, !16, i64 24, i64 24, !16, i64 48, i64 32, !16, i64 80, i64 16, !16, i64 96, i64 8, !17, i64 104, i64 8, !17, i64 112, i64 8, !18}
!16 = !{!8, !8, i64 0}
!17 = !{!14, !14, i64 0}
!18 = !{!10, !10, i64 0}
!19 = !{!6, !10, i64 24}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !7, i64 0}
!22 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!23 = !{!22, !10, i64 24}
!24 = !{!22, !10, i64 8}
!25 = !{!22, !10, i64 16}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27, !29}
!29 = !{!"llvm.loop.unswitch.partial.disable"}
!30 = distinct !{!30, !27}


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