; LLVM IR from alexzheng42/sDMD :: src (CG)

; 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.CGMatrixStr = type { [5 x double], [32 x %struct.CGBeadStr] }
%struct.CGBeadStr = type { double, double, double, double }
%struct.ConstraintStr = type { i32, double, ptr, double, ptr }
%struct.StepPotenStr = type { double, double, double, ptr }

@CGMatrix = external global %struct.CGMatrixStr, align 8
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@savedir = external global [1024 x i8], align 16
@.str.28 = external hidden unnamed_addr constant [2 x i8], align 1
@__const.PrintStepPotFun.sur_type = external hidden unnamed_addr constant [3 x ptr], align 16
@.str.32 = external hidden unnamed_addr constant [21 x i8], align 1
@potentialPairCG = external global [33 x [33 x %struct.ConstraintStr]], align 16
@.str.33 = external hidden unnamed_addr constant [16 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: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #1

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

declare i32 @AAModel(ptr noundef) #2

declare i32 @fclose(ptr 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
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @GetAAName(i32 noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @PrintStepPotFun() #4 {
  %1 = alloca ptr, align 8
  %2 = alloca [128 x i8], align 16
  %3 = alloca [3 x ptr], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.PrintStepPotFun.sur_type, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 3, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %93, %0
  %10 = load i32, ptr %5, align 4, !tbaa !5
  %11 = load i32, ptr %4, align 4, !tbaa !5
  %12 = icmp slt i32 %10, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %96

14:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %89, %14
  %16 = load i32, ptr %7, align 4, !tbaa !5
  %17 = icmp slt i32 %16, 32
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %92

19:                                               ; preds = %15
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %21
  %23 = getelementptr inbounds %struct.CGBeadStr, ptr %22, i32 0, i32 2
  %24 = load double, ptr %23, align 8, !tbaa !9
  %25 = fcmp ole double %24, 0.000000e+00
  br i1 %25, label %44, label %26

26:                                               ; preds = %19
  %27 = getelementptr inbounds [3 x ptr], ptr %3, i64 0, i64 0
  %28 = load ptr, ptr %27, align 16, !tbaa !12
  %29 = call i32 @AAModel(ptr noundef %28)
  %30 = load i32, ptr %7, align 4, !tbaa !5
  %31 = icmp eq i32 %29, %30
  br i1 %31, label %44, label %32

32:                                               ; preds = %26
  %33 = getelementptr inbounds [3 x ptr], ptr %3, i64 0, i64 1
  %34 = load ptr, ptr %33, align 8, !tbaa !12
  %35 = call i32 @AAModel(ptr noundef %34)
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = icmp eq i32 %35, %36
  br i1 %37, label %44, label %38

38:                                               ; preds = %32
  %39 = getelementptr inbounds [3 x ptr], ptr %3, i64 0, i64 2
  %40 = load ptr, ptr %39, align 16, !tbaa !12
  %41 = call i32 @AAModel(ptr noundef %40)
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = icmp eq i32 %41, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %38, %32, %26, %19
  br label %89

45:                                               ; preds = %38
  %46 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [3 x ptr], ptr %3, i64 0, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !12
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = call ptr @GetAAName(i32 noundef %51)
  %53 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %46, ptr noundef @.str.32, ptr noundef @savedir, ptr noundef %50, ptr noundef %52) #5
  %54 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %55 = call noalias ptr @fopen(ptr noundef %54, ptr noundef @.str.20)
  store ptr %55, ptr %1, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [3 x ptr], ptr %3, i64 0, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !12
  %60 = call i32 @AAModel(ptr noundef %59)
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCG, i64 0, i64 %61
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [33 x %struct.ConstraintStr], ptr %62, i64 0, i64 %64
  %66 = getelementptr inbounds %struct.ConstraintStr, ptr %65, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !14
  store ptr %67, ptr %8, align 8, !tbaa !12
  br label %68

68:                                               ; preds = %71, %45
  %69 = load ptr, ptr %8, align 8, !tbaa !12
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %84

71:                                               ; preds = %68
  %72 = load ptr, ptr %1, align 8, !tbaa !12
  %73 = load ptr, ptr %8, align 8, !tbaa !12
  %74 = getelementptr inbounds %struct.StepPotenStr, ptr %73, i32 0, i32 0
  %75 = load double, ptr %74, align 8, !tbaa !16
  %76 = call double @sqrt(double noundef %75) #5
  %77 = load ptr, ptr %8, align 8, !tbaa !12
  %78 = getelementptr inbounds %struct.StepPotenStr, ptr %77, i32 0, i32 2
  %79 = load double, ptr %78, align 8, !tbaa !18
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef @.str.33, double noundef %76, double noundef %79) #5
  %81 = load ptr, ptr %8, align 8, !tbaa !12
  %82 = getelementptr inbounds %struct.StepPotenStr, ptr %81, i32 0, i32 3
  %83 = load ptr, ptr %82, align 8, !tbaa !19
  store ptr %83, ptr %8, align 8, !tbaa !12
  br label %68, !llvm.loop !20

84:                                               ; preds = %68
  %85 = load ptr, ptr %1, align 8, !tbaa !12
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef @.str.28) #5
  %87 = load ptr, ptr %1, align 8, !tbaa !12
  %88 = call i32 @fclose(ptr noundef %87)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %89

89:                                               ; preds = %84, %44
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %7, align 4, !tbaa !5
  br label %15, !llvm.loop !22

92:                                               ; preds = %18
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %5, align 4, !tbaa !5
  br label %9, !llvm.loop !23

96:                                               ; preds = %13
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void
}

; Function Attrs: nounwind
declare double @sqrt(double noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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/C++ TBAA"}
!9 = !{!10, !11, i64 16}
!10 = !{!"CGBeadStr", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!11 = !{!"double", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!15, !13, i64 16}
!15 = !{!"ConstraintStr", !6, i64 0, !11, i64 8, !13, i64 16, !11, i64 24, !13, i64 32}
!16 = !{!17, !11, i64 0}
!17 = !{!"StepPotenStr", !11, i64 0, !11, i64 8, !11, i64 16, !13, i64 24}
!18 = !{!17, !11, i64 16}
!19 = !{!17, !13, i64 24}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}


; 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.CGMatrixStr = type { [5 x double], [32 x %struct.CGBeadStr] }
%struct.CGBeadStr = type { double, double, double, double }
%struct.ConstraintStr = type { i32, double, ptr, double, ptr }

@CGMatrix = external local_unnamed_addr global %struct.CGMatrixStr, align 8
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@savedir = external global [1024 x i8], align 16
@.str.28 = external hidden unnamed_addr constant [2 x i8], align 1
@__const.PrintStepPotFun.sur_type = external hidden unnamed_addr constant [3 x ptr], align 16
@.str.32 = external hidden unnamed_addr constant [21 x i8], align 1
@potentialPairCG = external local_unnamed_addr global [33 x [33 x %struct.ConstraintStr]], align 16
@.str.33 = external hidden unnamed_addr constant [16 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: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

declare i32 @AAModel(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @GetAAName(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @PrintStepPotFun() local_unnamed_addr #3 {
.preheader:
  %0 = alloca [128 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %0) #5
  %1 = load ptr, ptr @__const.PrintStepPotFun.sur_type, align 16
  %2 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.PrintStepPotFun.sur_type, i64 8), align 8
  %3 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.PrintStepPotFun.sur_type, i64 16), align 16
  br label %69

.preheader.1:                                     ; preds = %101, %35
  %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %35 ], [ 0, %101 ]
  %4 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %indvars.iv.1, i32 2
  %5 = load double, ptr %4, align 8, !tbaa !5
  %6 = fcmp ugt double %5, 0.000000e+00
  br i1 %6, label %7, label %35

7:                                                ; preds = %.preheader.1
  %8 = tail call i32 @AAModel(ptr noundef %1) #5
  %9 = zext i32 %8 to i64
  %10 = icmp eq i64 %indvars.iv.1, %9
  br i1 %10, label %35, label %11

11:                                               ; preds = %7
  %12 = tail call i32 @AAModel(ptr noundef %2) #5
  %13 = zext i32 %12 to i64
  %14 = icmp eq i64 %indvars.iv.1, %13
  br i1 %14, label %35, label %15

15:                                               ; preds = %11
  %16 = tail call i32 @AAModel(ptr noundef %3) #5
  %17 = zext i32 %16 to i64
  %18 = icmp eq i64 %indvars.iv.1, %17
  br i1 %18, label %35, label %19

19:                                               ; preds = %15
  %20 = trunc nuw nsw i64 %indvars.iv.1 to i32
  %21 = tail call ptr @GetAAName(i32 noundef %20)
  %22 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.32, ptr noundef nonnull @savedir, ptr noundef %2, ptr noundef %21) #5
  %23 = call noalias ptr @fopen(ptr noundef nonnull %0, ptr noundef nonnull @.str.20)
  %24 = tail call i32 @AAModel(ptr noundef %2) #5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCG, i64 0, i64 %25, i64 %indvars.iv.1, i32 2
  %.021.1 = load ptr, ptr %26, align 8, !tbaa !10
  %.not22.1 = icmp eq ptr %.021.1, null
  br i1 %.not22.1, label %._crit_edge.1, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %19, %.lr.ph.1
  %.023.1 = phi ptr [ %.0.1, %.lr.ph.1 ], [ %.021.1, %19 ]
  %27 = load double, ptr %.023.1, align 8, !tbaa !12
  %28 = tail call double @sqrt(double noundef %27) #5
  %29 = getelementptr inbounds i8, ptr %.023.1, i64 16
  %30 = load double, ptr %29, align 8, !tbaa !14
  %31 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.33, double noundef %28, double noundef %30) #5
  %32 = getelementptr inbounds i8, ptr %.023.1, i64 24
  %.0.1 = load ptr, ptr %32, align 8, !tbaa !10
  %.not.1 = icmp eq ptr %.0.1, null
  br i1 %.not.1, label %._crit_edge.1, label %.lr.ph.1, !llvm.loop !15

._crit_edge.1:                                    ; preds = %.lr.ph.1, %19
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.28) #5
  %34 = tail call i32 @fclose(ptr noundef %23)
  br label %35

35:                                               ; preds = %._crit_edge.1, %15, %11, %7, %.preheader.1
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %exitcond.1.not = icmp eq i64 %indvars.iv.next.1, 32
  br i1 %exitcond.1.not, label %.preheader.2, label %.preheader.1, !llvm.loop !17

.preheader.2:                                     ; preds = %35, %67
  %indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %67 ], [ 0, %35 ]
  %36 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %indvars.iv.2, i32 2
  %37 = load double, ptr %36, align 8, !tbaa !5
  %38 = fcmp ugt double %37, 0.000000e+00
  br i1 %38, label %39, label %67

39:                                               ; preds = %.preheader.2
  %40 = tail call i32 @AAModel(ptr noundef %1) #5
  %41 = zext i32 %40 to i64
  %42 = icmp eq i64 %indvars.iv.2, %41
  br i1 %42, label %67, label %43

43:                                               ; preds = %39
  %44 = tail call i32 @AAModel(ptr noundef %2) #5
  %45 = zext i32 %44 to i64
  %46 = icmp eq i64 %indvars.iv.2, %45
  br i1 %46, label %67, label %47

47:                                               ; preds = %43
  %48 = tail call i32 @AAModel(ptr noundef %3) #5
  %49 = zext i32 %48 to i64
  %50 = icmp eq i64 %indvars.iv.2, %49
  br i1 %50, label %67, label %51

51:                                               ; preds = %47
  %52 = trunc nuw nsw i64 %indvars.iv.2 to i32
  %53 = tail call ptr @GetAAName(i32 noundef %52)
  %54 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.32, ptr noundef nonnull @savedir, ptr noundef %3, ptr noundef %53) #5
  %55 = call noalias ptr @fopen(ptr noundef nonnull %0, ptr noundef nonnull @.str.20)
  %56 = tail call i32 @AAModel(ptr noundef %3) #5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCG, i64 0, i64 %57, i64 %indvars.iv.2, i32 2
  %.021.2 = load ptr, ptr %58, align 8, !tbaa !10
  %.not22.2 = icmp eq ptr %.021.2, null
  br i1 %.not22.2, label %._crit_edge.2, label %.lr.ph.2

.lr.ph.2:                                         ; preds = %51, %.lr.ph.2
  %.023.2 = phi ptr [ %.0.2, %.lr.ph.2 ], [ %.021.2, %51 ]
  %59 = load double, ptr %.023.2, align 8, !tbaa !12
  %60 = tail call double @sqrt(double noundef %59) #5
  %61 = getelementptr inbounds i8, ptr %.023.2, i64 16
  %62 = load double, ptr %61, align 8, !tbaa !14
  %63 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.33, double noundef %60, double noundef %62) #5
  %64 = getelementptr inbounds i8, ptr %.023.2, i64 24
  %.0.2 = load ptr, ptr %64, align 8, !tbaa !10
  %.not.2 = icmp eq ptr %.0.2, null
  br i1 %.not.2, label %._crit_edge.2, label %.lr.ph.2, !llvm.loop !15

._crit_edge.2:                                    ; preds = %.lr.ph.2, %51
  %65 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.28) #5
  %66 = tail call i32 @fclose(ptr noundef %55)
  br label %67

67:                                               ; preds = %._crit_edge.2, %47, %43, %39, %.preheader.2
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %exitcond.2.not = icmp eq i64 %indvars.iv.next.2, 32
  br i1 %exitcond.2.not, label %68, label %.preheader.2, !llvm.loop !17

68:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %0) #5
  ret void

69:                                               ; preds = %.preheader, %101
  %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %101 ]
  %70 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %indvars.iv, i32 2
  %71 = load double, ptr %70, align 8, !tbaa !5
  %72 = fcmp ugt double %71, 0.000000e+00
  br i1 %72, label %73, label %101

73:                                               ; preds = %69
  %74 = tail call i32 @AAModel(ptr noundef %1) #5
  %75 = zext i32 %74 to i64
  %76 = icmp eq i64 %indvars.iv, %75
  br i1 %76, label %101, label %77

77:                                               ; preds = %73
  %78 = tail call i32 @AAModel(ptr noundef %2) #5
  %79 = zext i32 %78 to i64
  %80 = icmp eq i64 %indvars.iv, %79
  br i1 %80, label %101, label %81

81:                                               ; preds = %77
  %82 = tail call i32 @AAModel(ptr noundef %3) #5
  %83 = zext i32 %82 to i64
  %84 = icmp eq i64 %indvars.iv, %83
  br i1 %84, label %101, label %85

85:                                               ; preds = %81
  %86 = trunc nuw nsw i64 %indvars.iv to i32
  %87 = tail call ptr @GetAAName(i32 noundef %86)
  %88 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.32, ptr noundef nonnull @savedir, ptr noundef %1, ptr noundef %87) #5
  %89 = call noalias ptr @fopen(ptr noundef nonnull %0, ptr noundef nonnull @.str.20)
  %90 = tail call i32 @AAModel(ptr noundef %1) #5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCG, i64 0, i64 %91, i64 %indvars.iv, i32 2
  %.021 = load ptr, ptr %92, align 8, !tbaa !10
  %.not22 = icmp eq ptr %.021, null
  br i1 %.not22, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %85, %.lr.ph
  %.023 = phi ptr [ %.0, %.lr.ph ], [ %.021, %85 ]
  %93 = load double, ptr %.023, align 8, !tbaa !12
  %94 = tail call double @sqrt(double noundef %93) #5
  %95 = getelementptr inbounds i8, ptr %.023, i64 16
  %96 = load double, ptr %95, align 8, !tbaa !14
  %97 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.33, double noundef %94, double noundef %96) #5
  %98 = getelementptr inbounds i8, ptr %.023, i64 24
  %.0 = load ptr, ptr %98, align 8, !tbaa !10
  %.not = icmp eq ptr %.0, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph, %85
  %99 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.28) #5
  %100 = tail call i32 @fclose(ptr noundef %89)
  br label %101

101:                                              ; preds = %69, %73, %77, %81, %._crit_edge
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 32
  br i1 %exitcond.not, label %.preheader.1, label %69, !llvm.loop !17
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { mustprogress nofree nounwind willreturn memory(write) "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, !7, i64 16}
!6 = !{!"CGBeadStr", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !7, i64 0}
!13 = !{!"StepPotenStr", !7, i64 0, !7, i64 8, !7, i64 16, !11, i64 24}
!14 = !{!13, !7, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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