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

; 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_vector_s = type { i32, ptr }
%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

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

43:                                               ; preds = %224, %6
  %44 = load i32, ptr %15, align 4, !tbaa !15
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.cf_mesh_s, ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !16
  %48 = icmp slt i32 %44, %47
  br i1 %48, label %49, label %227

49:                                               ; preds = %43
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = load i32, ptr %15, align 4, !tbaa !15
  %52 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 0
  %53 = getelementptr inbounds [3 x double], ptr %25, i64 0, i64 0
  %54 = call i32 @cf_get_corners(ptr noundef %50, i32 noundef %51, ptr noundef %52, ptr noundef %53)
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %49
  br label %229

57:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 120, ptr %29) #5
  %58 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 0
  %59 = getelementptr inbounds [3 x double], ptr %25, i64 0, i64 0
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.cf_ref_arrays_s, ptr %60, i32 0, i32 11
  %62 = load double, ptr %61, align 8, !tbaa !17
  call void @cf_init_element_data(ptr dead_on_unwind writable sret(%struct.cf_local_element_s) align 8 %29, ptr noundef %58, ptr noundef %59, double noundef %62)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %29, i64 120, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 120, ptr %29) #5
  store i32 0, ptr %21, align 4, !tbaa !15
  br label %63

63:                                               ; preds = %107, %57
  %64 = load i32, ptr %21, align 4, !tbaa !15
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.cf_mesh_s, ptr %65, i32 0, i32 3
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = icmp slt i32 %64, %67
  br i1 %68, label %69, label %110

69:                                               ; preds = %63
  %70 = load i32, ptr %15, align 4, !tbaa !15
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.cf_mesh_s, ptr %71, i32 0, i32 3
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %74 = mul nsw i32 %70, %73
  %75 = load i32, ptr %21, align 4, !tbaa !15
  %76 = add nsw i32 %74, %75
  store i32 %76, ptr %18, align 4, !tbaa !15
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.cf_mesh_s, ptr %77, i32 0, i32 4
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = load i32, ptr %18, align 4, !tbaa !15
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i32, ptr %79, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !15
  store i32 %83, ptr %19, align 4, !tbaa !15
  %84 = load i32, ptr %19, align 4, !tbaa !15
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.cf_vector_s, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !22
  %88 = icmp sge i32 %84, %87
  br i1 %88, label %89, label %96

89:                                               ; preds = %69
  %90 = load ptr, ptr @stderr, align 8, !tbaa !5
  %91 = load i32, ptr %17, align 4, !tbaa !15
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.cf_vector_s, ptr %92, i32 0, i32 0
  %94 = load i32, ptr %93, align 8, !tbaa !22
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str, i32 noundef %91, i32 noundef %94) #5
  store i32 0, ptr %17, align 4, !tbaa !15
  store i32 1, ptr %23, align 4, !tbaa !15
  br label %229

96:                                               ; preds = %69
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.cf_vector_s, ptr %97, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !24
  %100 = load i32, ptr %19, align 4, !tbaa !15
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds double, ptr %99, i64 %101
  %103 = load double, ptr %102, align 8, !tbaa !20
  %104 = load i32, ptr %21, align 4, !tbaa !15
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds double, ptr %42, i64 %105
  store double %103, ptr %106, align 8, !tbaa !20
  br label %107

107:                                              ; preds = %96
  %108 = load i32, ptr %21, align 4, !tbaa !15
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %21, align 4, !tbaa !15
  br label %63, !llvm.loop !25

110:                                              ; preds = %63
  %111 = getelementptr inbounds %struct.cf_local_element_s, ptr %14, i32 0, i32 6
  store ptr %42, ptr %111, align 8, !tbaa !27
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = call i32 %112(ptr noundef %113, ptr noundef %14, ptr noundef %114, ptr noundef %37)
  store i32 0, ptr %21, align 4, !tbaa !15
  br label %116

116:                                              ; preds = %220, %110
  %117 = load i32, ptr %21, align 4, !tbaa !15
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.cf_mesh_s, ptr %118, i32 0, i32 3
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = icmp slt i32 %117, %120
  br i1 %121, label %122, label %223

122:                                              ; preds = %116
  %123 = load i32, ptr %15, align 4, !tbaa !15
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.cf_mesh_s, ptr %124, i32 0, i32 3
  %126 = load i32, ptr %125, align 4, !tbaa !9
  %127 = mul nsw i32 %123, %126
  %128 = load i32, ptr %21, align 4, !tbaa !15
  %129 = add nsw i32 %127, %128
  store i32 %129, ptr %18, align 4, !tbaa !15
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.cf_mesh_s, ptr %130, i32 0, i32 4
  %132 = load ptr, ptr %131, align 8, !tbaa !21
  %133 = load i32, ptr %18, align 4, !tbaa !15
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds i32, ptr %132, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !15
  store i32 %136, ptr %19, align 4, !tbaa !15
  store i32 0, ptr %22, align 4, !tbaa !15
  br label %137

137:                                              ; preds = %216, %122
  %138 = load i32, ptr %22, align 4, !tbaa !15
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.cf_mesh_s, ptr %139, i32 0, i32 3
  %141 = load i32, ptr %140, align 4, !tbaa !9
  %142 = icmp slt i32 %138, %141
  br i1 %142, label %143, label %219

143:                                              ; preds = %137
  %144 = load i32, ptr %15, align 4, !tbaa !15
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.cf_mesh_s, ptr %145, i32 0, i32 3
  %147 = load i32, ptr %146, align 4, !tbaa !9
  %148 = mul nsw i32 %144, %147
  %149 = load i32, ptr %22, align 4, !tbaa !15
  %150 = add nsw i32 %148, %149
  store i32 %150, ptr %18, align 4, !tbaa !15
  %151 = load i32, ptr %15, align 4, !tbaa !15
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.cf_mesh_s, ptr %152, i32 0, i32 3
  %154 = load i32, ptr %153, align 4, !tbaa !9
  %155 = call i32 @ipow(i32 noundef %154, i32 noundef 2)
  %156 = mul nsw i32 %151, %155
  %157 = load ptr, ptr %9, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.cf_mesh_s, ptr %157, i32 0, i32 3
  %159 = load i32, ptr %158, align 4, !tbaa !9
  %160 = load i32, ptr %21, align 4, !tbaa !15
  %161 = mul nsw i32 %159, %160
  %162 = add nsw i32 %156, %161
  %163 = load i32, ptr %22, align 4, !tbaa !15
  %164 = add nsw i32 %162, %163
  store i32 %164, ptr %17, align 4, !tbaa !15
  %165 = load i32, ptr %17, align 4, !tbaa !15
  %166 = load ptr, ptr %13, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.cf_triplet_matrix_s, ptr %166, i32 0, i32 0
  %168 = load i32, ptr %167, align 8, !tbaa !29
  %169 = icmp sge i32 %165, %168
  br i1 %169, label %170, label %177

170:                                              ; preds = %143
  %171 = load ptr, ptr @stderr, align 8, !tbaa !5
  %172 = load i32, ptr %17, align 4, !tbaa !15
  %173 = load ptr, ptr %13, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.cf_triplet_matrix_s, ptr %173, i32 0, i32 0
  %175 = load i32, ptr %174, align 8, !tbaa !29
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %171, ptr noundef @.str, i32 noundef %172, i32 noundef %175) #5
  store i32 0, ptr %17, align 4, !tbaa !15
  store i32 1, ptr %23, align 4, !tbaa !15
  br label %229

177:                                              ; preds = %143
  %178 = load i32, ptr %21, align 4, !tbaa !15
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.cf_mesh_s, ptr %179, i32 0, i32 3
  %181 = load i32, ptr %180, align 4, !tbaa !9
  %182 = mul nsw i32 %178, %181
  %183 = load i32, ptr %22, align 4, !tbaa !15
  %184 = add nsw i32 %182, %183
  store i32 %184, ptr %16, align 4, !tbaa !15
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.cf_mesh_s, ptr %185, i32 0, i32 4
  %187 = load ptr, ptr %186, align 8, !tbaa !21
  %188 = load i32, ptr %18, align 4, !tbaa !15
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %187, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !15
  store i32 %191, ptr %20, align 4, !tbaa !15
  %192 = load i32, ptr %16, align 4, !tbaa !15
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds double, ptr %37, i64 %193
  %195 = load double, ptr %194, align 8, !tbaa !20
  %196 = load ptr, ptr %13, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.cf_triplet_matrix_s, ptr %196, i32 0, i32 3
  %198 = load ptr, ptr %197, align 8, !tbaa !31
  %199 = load i32, ptr %17, align 4, !tbaa !15
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds double, ptr %198, i64 %200
  store double %195, ptr %201, align 8, !tbaa !20
  %202 = load i32, ptr %19, align 4, !tbaa !15
  %203 = load ptr, ptr %13, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.cf_triplet_matrix_s, ptr %203, i32 0, i32 1
  %205 = load ptr, ptr %204, align 8, !tbaa !32
  %206 = load i32, ptr %17, align 4, !tbaa !15
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds i32, ptr %205, i64 %207
  store i32 %202, ptr %208, align 4, !tbaa !15
  %209 = load i32, ptr %20, align 4, !tbaa !15
  %210 = load ptr, ptr %13, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.cf_triplet_matrix_s, ptr %210, i32 0, i32 2
  %212 = load ptr, ptr %211, align 8, !tbaa !33
  %213 = load i32, ptr %17, align 4, !tbaa !15
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds i32, ptr %212, i64 %214
  store i32 %209, ptr %215, align 4, !tbaa !15
  br label %216

216:                                              ; preds = %177
  %217 = load i32, ptr %22, align 4, !tbaa !15
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %22, align 4, !tbaa !15
  br label %137, !llvm.loop !34

219:                                              ; preds = %137
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %21, align 4, !tbaa !15
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %21, align 4, !tbaa !15
  br label %116, !llvm.loop !35

223:                                              ; preds = %116
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %15, align 4, !tbaa !15
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %15, align 4, !tbaa !15
  br label %43, !llvm.loop !36

227:                                              ; preds = %43
  %228 = load i32, ptr %23, align 4, !tbaa !15
  store i32 %228, ptr %7, align 4
  store i32 1, ptr %30, align 4
  br label %231

229:                                              ; preds = %170, %89, %56
  %230 = load i32, ptr %23, align 4, !tbaa !15
  store i32 %230, ptr %7, align 4
  store i32 1, ptr %30, align 4
  br label %231

231:                                              ; preds = %229, %227
  %232 = load ptr, ptr %26, align 8
  call void @llvm.stackrestore.p0(ptr %232)
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, 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 120, ptr %14) #5
  %233 = load i32, ptr %7, align 4
  ret i32 %233
}

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 = { 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 = !{!13, !11, i64 4}
!13 = !{!"", !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, !14, i64 80}
!14 = !{!"double", !7, i64 0}
!15 = !{!11, !11, i64 0}
!16 = !{!10, !11, i64 16}
!17 = !{!13, !14, i64 80}
!18 = !{i64 0, i64 24, !19, i64 24, i64 24, !19, i64 48, i64 32, !19, i64 80, i64 16, !19, i64 96, i64 8, !20, i64 104, i64 8, !20, i64 112, i64 8, !5}
!19 = !{!7, !7, i64 0}
!20 = !{!14, !14, i64 0}
!21 = !{!10, !6, i64 24}
!22 = !{!23, !11, i64 0}
!23 = !{!"", !11, i64 0, !6, i64 8}
!24 = !{!23, !6, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !6, i64 112}
!28 = !{!"", !7, i64 0, !7, i64 24, !7, i64 48, !7, i64 80, !14, i64 96, !14, i64 104, !6, i64 112}
!29 = !{!30, !11, i64 0}
!30 = !{!"", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!31 = !{!30, !6, i64 24}
!32 = !{!30, !6, i64 8}
!33 = !{!30, !6, i64 16}
!34 = distinct !{!34, !26}
!35 = distinct !{!35, !26}
!36 = distinct !{!36, !26}


; 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

; 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_linearized(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr nocapture noundef readonly %4, ptr nocapture noundef readonly %5) local_unnamed_addr #1 {
  %7 = alloca %struct.cf_local_element_s, align 8
  %8 = alloca [3 x double], align 16
  %9 = alloca [3 x double], align 16
  %10 = alloca %struct.cf_local_element_s, align 8
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %11 = getelementptr inbounds i8, ptr %1, i64 20
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = tail call i32 @ipow(i32 noundef %12, i32 noundef 2)
  %14 = zext i32 %13 to i64
  %15 = tail call ptr @llvm.stacksave.p0()
  %16 = alloca double, i64 %14, align 16
  %17 = getelementptr inbounds i8, ptr %2, i64 4
  %18 = load i32, ptr %17, align 4, !tbaa !11
  %19 = zext i32 %18 to i64
  %20 = alloca double, i64 %19, align 16
  %21 = getelementptr inbounds i8, ptr %1, i64 16
  %22 = load i32, ptr %21, align 8, !tbaa !14
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph103, label %.loopexit

.lr.ph103:                                        ; preds = %6
  %24 = getelementptr inbounds i8, ptr %2, i64 80
  %25 = getelementptr inbounds i8, ptr %1, i64 24
  %26 = getelementptr inbounds i8, ptr %4, i64 8
  %27 = getelementptr inbounds i8, ptr %7, i64 112
  %28 = getelementptr inbounds i8, ptr %5, i64 24
  %29 = getelementptr inbounds i8, ptr %5, i64 8
  %30 = getelementptr inbounds i8, ptr %5, i64 16
  br label %31

31:                                               ; preds = %.lr.ph103, %._crit_edge97
  %.066100 = phi i32 [ 0, %.lr.ph103 ], [ %98, %._crit_edge97 ]
  %.06799 = phi i32 [ undef, %.lr.ph103 ], [ %.1.lcssa, %._crit_edge97 ]
  %32 = call i32 @cf_get_corners(ptr noundef nonnull %1, i32 noundef %.066100, ptr noundef nonnull %8, ptr noundef nonnull %9)
  %.not = icmp eq i32 %32, 0
  br i1 %.not, label %33, label %.loopexit

33:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %10) #5
  %34 = load double, ptr %24, align 8, !tbaa !15
  call void @cf_init_element_data(ptr dead_on_unwind nonnull writable sret(%struct.cf_local_element_s) align 8 %10, ptr noundef nonnull %8, ptr noundef nonnull %9, double noundef %34)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %7, ptr noundef nonnull align 8 dereferenceable(120) %10, i64 120, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %10) #5
  %35 = load i32, ptr %11, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %33
  %37 = mul nuw nsw i32 %35, %.066100
  %38 = load ptr, ptr %25, align 8, !tbaa !20
  %39 = load i32, ptr %4, align 8, !tbaa !21
  %40 = zext nneg i32 %37 to i64
  %wide.trip.count = zext nneg i32 %35 to i64
  %invariant.gep = getelementptr inbounds i32, ptr %38, i64 %40
  br label %41

41:                                               ; preds = %.lr.ph, %46
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %46 ]
  %gep = getelementptr inbounds i32, ptr %invariant.gep, i64 %indvars.iv
  %42 = load i32, ptr %gep, align 4, !tbaa !23
  %.not81 = icmp slt i32 %42, %39
  br i1 %.not81, label %46, label %43

43:                                               ; preds = %41
  %44 = load ptr, ptr @stderr, align 8, !tbaa !19
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str, i32 noundef %.06799, i32 noundef %39) #6
  br label %.loopexit

46:                                               ; preds = %41
  %47 = load ptr, ptr %26, align 8, !tbaa !24
  %48 = sext i32 %42 to i64
  %49 = getelementptr inbounds double, ptr %47, i64 %48
  %50 = load double, ptr %49, align 8, !tbaa !18
  %51 = getelementptr inbounds double, ptr %20, i64 %indvars.iv
  store double %50, ptr %51, align 8, !tbaa !18
  %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 %41, !llvm.loop !25

._crit_edge:                                      ; preds = %46, %33
  store ptr %20, ptr %27, align 8, !tbaa !27
  %52 = call i32 %0(ptr noundef %2, ptr noundef nonnull %7, ptr noundef %3, ptr noundef nonnull %16) #5
  %53 = load i32, ptr %11, align 4, !tbaa !5
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %.lr.ph96.split.preheader, label %._crit_edge97

.lr.ph96.split.preheader:                         ; preds = %._crit_edge
  %.pre = load ptr, ptr %25, align 8, !tbaa !20
  br label %.lr.ph96.split

.lr.ph96.split:                                   ; preds = %.lr.ph96.split.preheader, %._crit_edge92
  %55 = phi i32 [ %94, %._crit_edge92 ], [ %53, %.lr.ph96.split.preheader ]
  %56 = phi ptr [ %95, %._crit_edge92 ], [ %.pre, %.lr.ph96.split.preheader ]
  %.194 = phi i32 [ %.2.lcssa, %._crit_edge92 ], [ %.06799, %.lr.ph96.split.preheader ]
  %.17193 = phi i32 [ %96, %._crit_edge92 ], [ 0, %.lr.ph96.split.preheader ]
  %57 = mul nsw i32 %55, %.066100
  %58 = add nsw i32 %57, %.17193
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %56, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !23
  %62 = icmp sgt i32 %55, 0
  br i1 %62, label %.lr.ph91, label %._crit_edge92

.lr.ph91:                                         ; preds = %.lr.ph96.split, %74
  %63 = phi i32 [ %92, %74 ], [ %55, %.lr.ph96.split ]
  %.06989 = phi i32 [ %91, %74 ], [ 0, %.lr.ph96.split ]
  %64 = call i32 @ipow(i32 noundef %63, i32 noundef 2)
  %65 = mul nsw i32 %64, %.066100
  %66 = load i32, ptr %11, align 4, !tbaa !5
  %67 = mul nsw i32 %66, %.17193
  %68 = add i32 %67, %.06989
  %69 = add i32 %68, %65
  %70 = load i32, ptr %5, align 8, !tbaa !29
  %.not80 = icmp slt i32 %69, %70
  br i1 %.not80, label %74, label %71

71:                                               ; preds = %.lr.ph91
  %72 = load ptr, ptr @stderr, align 8, !tbaa !19
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str, i32 noundef %69, i32 noundef %70) #6
  br label %.loopexit

74:                                               ; preds = %.lr.ph91
  %75 = mul nsw i32 %63, %.066100
  %76 = add nsw i32 %75, %.06989
  %77 = load ptr, ptr %25, align 8, !tbaa !20
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds i32, ptr %77, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !23
  %81 = sext i32 %68 to i64
  %82 = getelementptr inbounds double, ptr %16, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !18
  %84 = load ptr, ptr %28, align 8, !tbaa !31
  %85 = sext i32 %69 to i64
  %86 = getelementptr inbounds double, ptr %84, i64 %85
  store double %83, ptr %86, align 8, !tbaa !18
  %87 = load ptr, ptr %29, align 8, !tbaa !32
  %88 = getelementptr inbounds i32, ptr %87, i64 %85
  store i32 %61, ptr %88, align 4, !tbaa !23
  %89 = load ptr, ptr %30, align 8, !tbaa !33
  %90 = getelementptr inbounds i32, ptr %89, i64 %85
  store i32 %80, ptr %90, align 4, !tbaa !23
  %91 = add nuw nsw i32 %.06989, 1
  %92 = load i32, ptr %11, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %.lr.ph91, label %._crit_edge92, !llvm.loop !34

._crit_edge92:                                    ; preds = %74, %.lr.ph96.split
  %94 = phi i32 [ %55, %.lr.ph96.split ], [ %92, %74 ]
  %95 = phi ptr [ %56, %.lr.ph96.split ], [ %77, %74 ]
  %.2.lcssa = phi i32 [ %.194, %.lr.ph96.split ], [ %69, %74 ]
  %96 = add nuw nsw i32 %.17193, 1
  %97 = icmp slt i32 %96, %94
  br i1 %97, label %.lr.ph96.split, label %._crit_edge97, !llvm.loop !35

._crit_edge97:                                    ; preds = %._crit_edge92, %._crit_edge
  %.1.lcssa = phi i32 [ %.06799, %._crit_edge ], [ %.2.lcssa, %._crit_edge92 ]
  %98 = add nuw nsw i32 %.066100, 1
  %99 = load i32, ptr %21, align 8, !tbaa !14
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %31, label %.loopexit, !llvm.loop !37

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

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 = !{!12, !7, i64 4}
!12 = !{!"", !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, !13, i64 80}
!13 = !{!"double", !8, i64 0}
!14 = !{!6, !7, i64 16}
!15 = !{!12, !13, i64 80}
!16 = !{i64 0, i64 24, !17, i64 24, i64 24, !17, i64 48, i64 32, !17, i64 80, i64 16, !17, i64 96, i64 8, !18, i64 104, i64 8, !18, i64 112, i64 8, !19}
!17 = !{!8, !8, i64 0}
!18 = !{!13, !13, i64 0}
!19 = !{!10, !10, i64 0}
!20 = !{!6, !10, i64 24}
!21 = !{!22, !7, i64 0}
!22 = !{!"", !7, i64 0, !10, i64 8}
!23 = !{!7, !7, i64 0}
!24 = !{!22, !10, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !10, i64 112}
!28 = !{!"", !8, i64 0, !8, i64 24, !8, i64 48, !8, i64 80, !13, i64 96, !13, i64 104, !10, i64 112}
!29 = !{!30, !7, i64 0}
!30 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!31 = !{!30, !10, i64 24}
!32 = !{!30, !10, i64 8}
!33 = !{!30, !10, i64 16}
!34 = distinct !{!34, !26}
!35 = distinct !{!35, !26, !36}
!36 = !{!"llvm.loop.unswitch.partial.disable"}
!37 = distinct !{!37, !26}


; 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