; LLVM IR from emathew1/3DCompactSolver :: VisitWriter.ll (Z23write_unstructured_meshPKciiPfiPiS2_iS2_S2_PKS0_PS1_)

; 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"

@_ZL9useBinary = external hidden global i32, align 4
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15write_variablesiPiS_PKPKcPPfii(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #0

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11new_sectionv() #0

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL12write_stringPKc(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11write_floatf(float noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL8end_linev() #3

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL9open_filePKc(ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL12write_headerv() #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL9write_inti(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL10close_filev() #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z23write_unstructured_meshPKciiPfiPiS2_iS2_S2_PKS0_PS1_(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, i32 noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11) #0 {
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca [128 x i8], align 16
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  store ptr %0, ptr %13, align 8, !tbaa !5
  store i32 %1, ptr %14, align 4, !tbaa !9
  store i32 %2, ptr %15, align 4, !tbaa !9
  store ptr %3, ptr %16, align 8, !tbaa !5
  store i32 %4, ptr %17, align 4, !tbaa !9
  store ptr %5, ptr %18, align 8, !tbaa !5
  store ptr %6, ptr %19, align 8, !tbaa !5
  store i32 %7, ptr %20, align 4, !tbaa !9
  store ptr %8, ptr %21, align 8, !tbaa !5
  store ptr %9, ptr %22, align 8, !tbaa !5
  store ptr %10, ptr %23, align 8, !tbaa !5
  store ptr %11, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  store i32 0, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %32 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %32, ptr %29, align 8, !tbaa !5
  %33 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %33, ptr @_ZL9useBinary, align 4, !tbaa !9
  %34 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZL9open_filePKc(ptr noundef %34)
  call void @_ZL12write_headerv()
  call void @_ZL12write_stringPKc(ptr noundef @.str.10)
  %35 = getelementptr inbounds [128 x i8], ptr %27, i64 0, i64 0
  %36 = load i32, ptr %15, align 4, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %35, ptr noundef @.str.11, i32 noundef %36) #4
  %38 = getelementptr inbounds [128 x i8], ptr %27, i64 0, i64 0
  call void @_ZL12write_stringPKc(ptr noundef %38)
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %50, %12
  %40 = load i32, ptr %25, align 4, !tbaa !9
  %41 = load i32, ptr %15, align 4, !tbaa !9
  %42 = mul nsw i32 3, %41
  %43 = icmp slt i32 %40, %42
  br i1 %43, label %44, label %53

44:                                               ; preds = %39
  %45 = load ptr, ptr %16, align 8, !tbaa !5
  %46 = load i32, ptr %25, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds float, ptr %45, i64 %47
  %49 = load float, ptr %48, align 4, !tbaa !11
  call void @_ZL11write_floatf(float noundef %49)
  br label %50

50:                                               ; preds = %44
  %51 = load i32, ptr %25, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %25, align 4, !tbaa !9
  br label %39, !llvm.loop !13

53:                                               ; preds = %39
  call void @_ZL11new_sectionv()
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %69, %53
  %55 = load i32, ptr %25, align 4, !tbaa !9
  %56 = load i32, ptr %17, align 4, !tbaa !9
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %58, label %72

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  %59 = load ptr, ptr %18, align 8, !tbaa !5
  %60 = load i32, ptr %25, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr %59, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = call noundef i32 @_ZL19num_points_for_celli(i32 noundef %63)
  store i32 %64, ptr %30, align 4, !tbaa !9
  %65 = load i32, ptr %30, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  %67 = load i32, ptr %28, align 4, !tbaa !9
  %68 = add nsw i32 %67, %66
  store i32 %68, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  br label %69

69:                                               ; preds = %58
  %70 = load i32, ptr %25, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %25, align 4, !tbaa !9
  br label %54, !llvm.loop !15

72:                                               ; preds = %54
  %73 = getelementptr inbounds [128 x i8], ptr %27, i64 0, i64 0
  %74 = load i32, ptr %17, align 4, !tbaa !9
  %75 = load i32, ptr %28, align 4, !tbaa !9
  %76 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %73, ptr noundef @.str.12, i32 noundef %74, i32 noundef %75) #4
  %77 = getelementptr inbounds [128 x i8], ptr %27, i64 0, i64 0
  call void @_ZL12write_stringPKc(ptr noundef %77)
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %102, %72
  %79 = load i32, ptr %25, align 4, !tbaa !9
  %80 = load i32, ptr %17, align 4, !tbaa !9
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %82, label %105

82:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #4
  %83 = load ptr, ptr %18, align 8, !tbaa !5
  %84 = load i32, ptr %25, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i32, ptr %83, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = call noundef i32 @_ZL19num_points_for_celli(i32 noundef %87)
  store i32 %88, ptr %31, align 4, !tbaa !9
  %89 = load i32, ptr %31, align 4, !tbaa !9
  call void @_ZL9write_inti(i32 noundef %89)
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %98, %82
  %91 = load i32, ptr %26, align 4, !tbaa !9
  %92 = load i32, ptr %31, align 4, !tbaa !9
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %94, label %101

94:                                               ; preds = %90
  %95 = load ptr, ptr %29, align 8, !tbaa !5
  %96 = getelementptr inbounds i32, ptr %95, i32 1
  store ptr %96, ptr %29, align 8, !tbaa !5
  %97 = load i32, ptr %95, align 4, !tbaa !9
  call void @_ZL9write_inti(i32 noundef %97)
  br label %98

98:                                               ; preds = %94
  %99 = load i32, ptr %26, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %26, align 4, !tbaa !9
  br label %90, !llvm.loop !16

101:                                              ; preds = %90
  call void @_ZL8end_linev()
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #4
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %25, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %25, align 4, !tbaa !9
  br label %78, !llvm.loop !17

105:                                              ; preds = %78
  call void @_ZL11new_sectionv()
  %106 = getelementptr inbounds [128 x i8], ptr %27, i64 0, i64 0
  %107 = load i32, ptr %17, align 4, !tbaa !9
  %108 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %106, ptr noundef @.str.13, i32 noundef %107) #4
  %109 = getelementptr inbounds [128 x i8], ptr %27, i64 0, i64 0
  call void @_ZL12write_stringPKc(ptr noundef %109)
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %110

110:                                              ; preds = %120, %105
  %111 = load i32, ptr %25, align 4, !tbaa !9
  %112 = load i32, ptr %17, align 4, !tbaa !9
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %114, label %123

114:                                              ; preds = %110
  %115 = load ptr, ptr %18, align 8, !tbaa !5
  %116 = load i32, ptr %25, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %115, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !9
  call void @_ZL9write_inti(i32 noundef %119)
  call void @_ZL8end_linev()
  br label %120

120:                                              ; preds = %114
  %121 = load i32, ptr %25, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %25, align 4, !tbaa !9
  br label %110, !llvm.loop !18

123:                                              ; preds = %110
  %124 = load i32, ptr %20, align 4, !tbaa !9
  %125 = load ptr, ptr %21, align 8, !tbaa !5
  %126 = load ptr, ptr %22, align 8, !tbaa !5
  %127 = load ptr, ptr %23, align 8, !tbaa !5
  %128 = load ptr, ptr %24, align 8, !tbaa !5
  %129 = load i32, ptr %15, align 4, !tbaa !9
  %130 = load i32, ptr %17, align 4, !tbaa !9
  call void @_Z15write_variablesiPiS_PKPKcPPfii(i32 noundef %124, ptr noundef %125, ptr noundef %126, ptr noundef %127, ptr noundef %128, i32 noundef %129, i32 noundef %130)
  call void @_ZL10close_filev()
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL19num_points_for_celli(i32 noundef) #3

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "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 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


; 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"

@_ZL9useBinary = external hidden local_unnamed_addr global i32, align 4
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15write_variablesiPiS_PKPKcPPfii(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11new_sectionv() local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL12write_stringPKc(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL11write_floatf(float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL8end_linev() 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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL9open_filePKc(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL12write_headerv() local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL9write_inti(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL10close_filev() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z23write_unstructured_meshPKciiPfiPiS2_iS2_S2_PKS0_PS1_(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef readonly %3, i32 noundef %4, ptr nocapture noundef readonly %5, ptr nocapture noundef readonly %6, i32 noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11) local_unnamed_addr #0 {
  %13 = alloca [128 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %13) #5
  store i32 %1, ptr @_ZL9useBinary, align 4, !tbaa !5
  tail call void @_ZL9open_filePKc(ptr noundef %0)
  tail call void @_ZL12write_headerv()
  tail call void @_ZL12write_stringPKc(ptr noundef nonnull @.str.10)
  %14 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %2) #5
  call void @_ZL12write_stringPKc(ptr noundef nonnull %13)
  %15 = icmp sgt i32 %2, 0
  br i1 %15, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %12
  %16 = mul i32 %2, 3
  %smax = call i32 @llvm.smax.i32(i32 %16, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %17 = getelementptr inbounds float, ptr %3, i64 %indvars.iv
  %18 = load float, ptr %17, align 4, !tbaa !9
  call void @_ZL11write_floatf(float noundef %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 %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %12
  call void @_ZL11new_sectionv()
  %19 = icmp sgt i32 %4, 0
  br i1 %19, label %.lr.ph49.preheader, label %._crit_edge61.critedge

.lr.ph49.preheader:                               ; preds = %._crit_edge
  %wide.trip.count71 = zext nneg i32 %4 to i64
  br label %.lr.ph49

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %.lr.ph49
  %indvars.iv68 = phi i64 [ 0, %.lr.ph49.preheader ], [ %indvars.iv.next69, %.lr.ph49 ]
  %.04346 = phi i32 [ 0, %.lr.ph49.preheader ], [ %24, %.lr.ph49 ]
  %20 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv68
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = call noundef i32 @_ZL19num_points_for_celli(i32 noundef %21)
  %23 = add i32 %.04346, 1
  %24 = add i32 %23, %22
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count71
  br i1 %exitcond72.not, label %._crit_edge50, label %.lr.ph49, !llvm.loop !13

._crit_edge50:                                    ; preds = %.lr.ph49
  %25 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) @.str.12, i32 noundef %4, i32 noundef %24) #5
  call void @_ZL12write_stringPKc(ptr noundef nonnull %13)
  br i1 %19, label %.lr.ph60.preheader, label %._crit_edge65.critedge

.lr.ph60.preheader:                               ; preds = %._crit_edge50
  %wide.trip.count77 = zext nneg i32 %4 to i64
  br label %.lr.ph60

.lr.ph60:                                         ; preds = %.lr.ph60.preheader, %._crit_edge55
  %indvars.iv74 = phi i64 [ 0, %.lr.ph60.preheader ], [ %indvars.iv.next75, %._crit_edge55 ]
  %.04157 = phi ptr [ %6, %.lr.ph60.preheader ], [ %.142.lcssa, %._crit_edge55 ]
  %26 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv74
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = call noundef i32 @_ZL19num_points_for_celli(i32 noundef %27)
  call void @_ZL9write_inti(i32 noundef %28)
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph54, label %._crit_edge55

.lr.ph54:                                         ; preds = %.lr.ph60, %.lr.ph54
  %.04052 = phi i32 [ %32, %.lr.ph54 ], [ 0, %.lr.ph60 ]
  %.14251 = phi ptr [ %30, %.lr.ph54 ], [ %.04157, %.lr.ph60 ]
  %30 = getelementptr inbounds i8, ptr %.14251, i64 4
  %31 = load i32, ptr %.14251, align 4, !tbaa !5
  call void @_ZL9write_inti(i32 noundef %31)
  %32 = add nuw nsw i32 %.04052, 1
  %exitcond73.not = icmp eq i32 %32, %28
  br i1 %exitcond73.not, label %._crit_edge55, label %.lr.ph54, !llvm.loop !14

._crit_edge55:                                    ; preds = %.lr.ph54, %.lr.ph60
  %.142.lcssa = phi ptr [ %.04157, %.lr.ph60 ], [ %30, %.lr.ph54 ]
  call void @_ZL8end_linev()
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77
  br i1 %exitcond78.not, label %._crit_edge61, label %.lr.ph60, !llvm.loop !15

._crit_edge61.critedge:                           ; preds = %._crit_edge
  %33 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) @.str.12, i32 noundef %4, i32 noundef 0) #5
  call void @_ZL12write_stringPKc(ptr noundef nonnull %13)
  br label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge55, %._crit_edge61.critedge
  call void @_ZL11new_sectionv()
  %34 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef %4) #5
  call void @_ZL12write_stringPKc(ptr noundef nonnull %13)
  br i1 %19, label %.lr.ph64.preheader, label %._crit_edge65

.lr.ph64.preheader:                               ; preds = %._crit_edge61
  %wide.trip.count82 = zext nneg i32 %4 to i64
  br label %.lr.ph64

.lr.ph64:                                         ; preds = %.lr.ph64.preheader, %.lr.ph64
  %indvars.iv79 = phi i64 [ 0, %.lr.ph64.preheader ], [ %indvars.iv.next80, %.lr.ph64 ]
  %35 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv79
  %36 = load i32, ptr %35, align 4, !tbaa !5
  call void @_ZL9write_inti(i32 noundef %36)
  call void @_ZL8end_linev()
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count82
  br i1 %exitcond83.not, label %._crit_edge65, label %.lr.ph64, !llvm.loop !16

._crit_edge65.critedge:                           ; preds = %._crit_edge50
  call void @_ZL11new_sectionv()
  %37 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef %4) #5
  call void @_ZL12write_stringPKc(ptr noundef nonnull %13)
  br label %._crit_edge65

._crit_edge65:                                    ; preds = %.lr.ph64, %._crit_edge65.critedge, %._crit_edge61
  call void @_Z15write_variablesiPiS_PKPKcPPfii(i32 noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11, i32 noundef %2, i32 noundef %4)
  call void @_ZL10close_filev()
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %13) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL19num_points_for_celli(i32 noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress 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 = { 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 #3 = { mustprogress 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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