; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/TRSTAGE/stage.ll (Z9calculatev)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@tickets = external dso_local global [8 x i32], align 16
@graph = external dso_local global [31 x [31 x i32]], align 16
@INF = external dso_local global i32, align 4
@dp = external dso_local global [31 x [256 x double]], align 16
@eps = external dso_local global double, align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9calculatev() #0 {
  %1 = alloca double, align 8
  %2 = alloca double, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  %12 = load i32, ptr @INF, align 4, !tbaa !5
  %13 = sitofp i32 %12 to double
  store double %13, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = shl i32 1, %14
  store i32 %15, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %40, %0
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %43

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %36, %21
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %39

27:                                               ; preds = %22
  %28 = load i32, ptr @INF, align 4, !tbaa !5
  %29 = sitofp i32 %28 to double
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %31
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [256 x double], ptr %32, i64 0, i64 %34
  store double %29, ptr %35, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %27
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %6, align 4, !tbaa !5
  br label %22, !llvm.loop !11

39:                                               ; preds = %26
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %4, align 4, !tbaa !5
  br label %16, !llvm.loop !13

43:                                               ; preds = %20
  %44 = load i32, ptr @a, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %45
  %47 = getelementptr inbounds [256 x double], ptr %46, i64 0, i64 0
  store double 0.000000e+00, ptr %47, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %164, %43
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %167

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %160, %53
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = load i32, ptr @m, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %163

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %156, %59
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = load i32, ptr @m, align 4, !tbaa !5
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %159

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %152, %65
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %155

71:                                               ; preds = %66
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = ashr i32 %72, %73
  %75 = and i32 %74, 1
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %71
  br label %152

78:                                               ; preds = %71
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [31 x [31 x i32]], ptr @graph, i64 0, i64 %80
  %82 = load i32, ptr %9, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [31 x i32], ptr %81, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = load i32, ptr @INF, align 4, !tbaa !5
  %87 = icmp eq i32 %85, %86
  br i1 %87, label %88, label %89

88:                                               ; preds = %78
  br label %152

89:                                               ; preds = %78
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %91
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [256 x double], ptr %92, i64 0, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = load i32, ptr @INF, align 4, !tbaa !5
  %98 = sitofp i32 %97 to double
  %99 = fsub double %96, %98
  %100 = call noundef double @_ZSt3absd(double noundef %99)
  %101 = load double, ptr @eps, align 8, !tbaa !9
  %102 = fcmp ole double %100, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %89
  br label %152

104:                                              ; preds = %89
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %106
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [256 x double], ptr %107, i64 0, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !9
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [31 x [31 x i32]], ptr @graph, i64 0, i64 %113
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [31 x i32], ptr %114, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sitofp i32 %118 to double
  %120 = load i32, ptr %10, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [8 x i32], ptr @tickets, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sitofp i32 %123 to double
  %125 = fmul double 1.000000e+00, %124
  %126 = fdiv double %119, %125
  %127 = fadd double %111, %126
  store double %127, ptr %1, align 8, !tbaa !9
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %129
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = shl i32 1, %132
  %134 = or i32 %131, %133
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [256 x double], ptr %130, i64 0, i64 %135
  %137 = load double, ptr %136, align 8, !tbaa !9
  %138 = load double, ptr %1, align 8, !tbaa !9
  %139 = fcmp ogt double %137, %138
  br i1 %139, label %140, label %151

140:                                              ; preds = %104
  %141 = load double, ptr %1, align 8, !tbaa !9
  %142 = load i32, ptr %9, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %143
  %145 = load i32, ptr %7, align 4, !tbaa !5
  %146 = load i32, ptr %10, align 4, !tbaa !5
  %147 = shl i32 1, %146
  %148 = or i32 %145, %147
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [256 x double], ptr %144, i64 0, i64 %149
  store double %141, ptr %150, align 8, !tbaa !9
  br label %151

151:                                              ; preds = %140, %104
  br label %152

152:                                              ; preds = %151, %103, %88, %77
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %10, align 4, !tbaa !5
  br label %66, !llvm.loop !14

155:                                              ; preds = %70
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %9, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %9, align 4, !tbaa !5
  br label %60, !llvm.loop !15

159:                                              ; preds = %64
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %8, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %8, align 4, !tbaa !5
  br label %54, !llvm.loop !16

163:                                              ; preds = %58
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %7, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %7, align 4, !tbaa !5
  br label %48, !llvm.loop !17

167:                                              ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %182, %167
  %169 = load i32, ptr %11, align 4, !tbaa !5
  %170 = load i32, ptr %3, align 4, !tbaa !5
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %168
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %185

173:                                              ; preds = %168
  %174 = load i32, ptr @b, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %175
  %177 = load i32, ptr %11, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [256 x double], ptr %176, i64 0, i64 %178
  %180 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %179)
  %181 = load double, ptr %180, align 8, !tbaa !9
  store double %181, ptr %2, align 8, !tbaa !9
  br label %182

182:                                              ; preds = %173
  %183 = load i32, ptr %11, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %11, align 4, !tbaa !5
  br label %168, !llvm.loop !18

185:                                              ; preds = %172
  %186 = load double, ptr %2, align 8, !tbaa !9
  %187 = load i32, ptr @INF, align 4, !tbaa !5
  %188 = sub nsw i32 %187, 1
  %189 = sitofp i32 %188 to double
  %190 = fcmp olt double %186, %189
  br i1 %190, label %191, label %194

191:                                              ; preds = %185
  %192 = load double, ptr %2, align 8, !tbaa !9
  %193 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %192)
  br label %196

194:                                              ; preds = %185
  %195 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %196

196:                                              ; preds = %194, %191
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

declare i32 @printf(ptr 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 = { inlinehint 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 #3 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !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}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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

@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local local_unnamed_addr global i32, align 4
@b = external dso_local local_unnamed_addr global i32, align 4
@tickets = external dso_local local_unnamed_addr global [8 x i32], align 16
@graph = external dso_local local_unnamed_addr global [31 x [31 x i32]], align 16
@INF = external dso_local local_unnamed_addr global i32, align 4
@dp = external dso_local global [31 x [256 x double]], align 16
@eps = external dso_local local_unnamed_addr global double, align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z9calculatev() local_unnamed_addr #0 {
  %1 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %2 = load i32, ptr @INF, align 4, !tbaa !5
  %3 = sitofp i32 %2 to double
  store double %3, ptr %1, align 8, !tbaa !9
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = shl nuw i32 1, %4
  %6 = load i32, ptr @m, align 4, !tbaa !5
  %.not56 = icmp slt i32 %6, 1
  br i1 %.not56, label %._crit_edge58.thread106, label %.preheader54.lr.ph

.preheader54.lr.ph:                               ; preds = %0
  %.not71 = icmp eq i32 %4, 31
  br i1 %.not71, label %._crit_edge58.thread, label %.preheader54.us.preheader

._crit_edge58.thread:                             ; preds = %.preheader54.lr.ph
  %7 = load i32, ptr @a, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %8
  store double 0.000000e+00, ptr %9, align 16, !tbaa !9
  br label %._crit_edge70

.preheader54.us.preheader:                        ; preds = %.preheader54.lr.ph
  %smax = tail call i32 @llvm.smax.i32(i32 %5, i32 1)
  %10 = add nuw i32 %6, 1
  %wide.trip.count81 = zext i32 %10 to i64
  %min.iters.check = icmp slt i32 %5, 4
  %11 = and i32 %smax, 2147483644
  %n.vec = zext nneg i32 %11 to i64
  %broadcast.splatinsert = insertelement <2 x double> poison, double %3, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  %exitcond.not = icmp slt i32 %5, 2
  %exitcond.not.1 = icmp eq i32 %4, 1
  br label %.preheader54.us

.preheader54.us:                                  ; preds = %.preheader54.us.preheader, %._crit_edge.us
  %indvars.iv78 = phi i64 [ 1, %.preheader54.us.preheader ], [ %indvars.iv.next79, %._crit_edge.us ]
  br i1 %min.iters.check, label %scalar.ph, label %vector.body

vector.body:                                      ; preds = %.preheader54.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader54.us ]
  %12 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %indvars.iv78, i64 %index
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  store <2 x double> %broadcast.splat, ptr %12, align 16, !tbaa !9
  store <2 x double> %broadcast.splat, ptr %13, align 16, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %14 = icmp eq i64 %index.next, %n.vec
  br i1 %14, label %._crit_edge.us, label %vector.body, !llvm.loop !11

scalar.ph:                                        ; preds = %.preheader54.us
  %15 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %indvars.iv78, i64 0
  store double %3, ptr %15, align 16, !tbaa !9
  br i1 %exitcond.not, label %._crit_edge.us, label %scalar.ph.1, !llvm.loop !15

scalar.ph.1:                                      ; preds = %scalar.ph
  %16 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %indvars.iv78, i64 1
  store double %3, ptr %16, align 8, !tbaa !9
  br i1 %exitcond.not.1, label %._crit_edge.us, label %scalar.ph.2, !llvm.loop !15

scalar.ph.2:                                      ; preds = %scalar.ph.1
  %17 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %indvars.iv78, i64 2
  store double %3, ptr %17, align 16, !tbaa !9
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %vector.body, %scalar.ph, %scalar.ph.1, %scalar.ph.2
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81
  br i1 %exitcond82.not, label %._crit_edge58, label %.preheader54.us, !llvm.loop !16

._crit_edge58:                                    ; preds = %._crit_edge.us
  %18 = load i32, ptr @a, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %19
  store double 0.000000e+00, ptr %20, align 16, !tbaa !9
  br i1 %.not56, label %.lr.ph69.preheader, label %.preheader53.preheader

._crit_edge58.thread106:                          ; preds = %0
  %21 = load i32, ptr @a, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %22
  store double 0.000000e+00, ptr %23, align 16, !tbaa !9
  %.not107 = icmp eq i32 %4, 31
  br i1 %.not107, label %._crit_edge70, label %.lr.ph69.preheader

.preheader53.preheader:                           ; preds = %._crit_edge58
  %smax95 = tail call i32 @llvm.smax.i32(i32 %5, i32 1)
  %wide.trip.count96 = zext nneg i32 %smax95 to i64
  br label %.preheader53

.preheader53:                                     ; preds = %.preheader53.preheader, %._crit_edge65
  %24 = phi i32 [ %6, %.preheader53.preheader ], [ %37, %._crit_edge65 ]
  %25 = phi i32 [ %4, %.preheader53.preheader ], [ %38, %._crit_edge65 ]
  %26 = phi i32 [ %4, %.preheader53.preheader ], [ %39, %._crit_edge65 ]
  %27 = phi i32 [ %6, %.preheader53.preheader ], [ %40, %._crit_edge65 ]
  %28 = phi i32 [ %6, %.preheader53.preheader ], [ %41, %._crit_edge65 ]
  %indvars.iv92 = phi i64 [ 0, %.preheader53.preheader ], [ %indvars.iv.next93, %._crit_edge65 ]
  %.not4863 = icmp slt i32 %28, 1
  br i1 %.not4863, label %._crit_edge65, label %.preheader52.lr.ph

.preheader52.lr.ph:                               ; preds = %.preheader53
  %29 = icmp slt i32 %27, 1
  br i1 %29, label %._crit_edge65, label %.preheader52.preheader

.preheader52.preheader:                           ; preds = %.preheader52.lr.ph
  %30 = trunc nuw nsw i64 %indvars.iv92 to i32
  br label %.preheader52

.lr.ph69.preheader:                               ; preds = %._crit_edge65, %._crit_edge58.thread106, %._crit_edge58
  %smax101 = tail call i32 @llvm.smax.i32(i32 %5, i32 1)
  %wide.trip.count102 = zext nneg i32 %smax101 to i64
  br label %.lr.ph69

.preheader52:                                     ; preds = %.preheader52.preheader, %._crit_edge62
  %31 = phi i32 [ %24, %.preheader52.preheader ], [ %47, %._crit_edge62 ]
  %32 = phi i32 [ %25, %.preheader52.preheader ], [ %48, %._crit_edge62 ]
  %33 = phi i32 [ %26, %.preheader52.preheader ], [ %49, %._crit_edge62 ]
  %34 = phi i32 [ %27, %.preheader52.preheader ], [ %47, %._crit_edge62 ]
  %indvars.iv89 = phi i64 [ 1, %.preheader52.preheader ], [ %indvars.iv.next90, %._crit_edge62 ]
  %.not4960 = icmp slt i32 %34, 1
  br i1 %.not4960, label %._crit_edge62, label %.preheader51.lr.ph

.preheader51.lr.ph:                               ; preds = %.preheader52
  %35 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %indvars.iv89, i64 %indvars.iv92
  %36 = icmp sgt i32 %33, 0
  br i1 %36, label %.preheader51, label %._crit_edge62

._crit_edge65:                                    ; preds = %._crit_edge62, %.preheader52.lr.ph, %.preheader53
  %37 = phi i32 [ %24, %.preheader53 ], [ %24, %.preheader52.lr.ph ], [ %47, %._crit_edge62 ]
  %38 = phi i32 [ %25, %.preheader53 ], [ %25, %.preheader52.lr.ph ], [ %48, %._crit_edge62 ]
  %39 = phi i32 [ %26, %.preheader53 ], [ %26, %.preheader52.lr.ph ], [ %49, %._crit_edge62 ]
  %40 = phi i32 [ %27, %.preheader53 ], [ %27, %.preheader52.lr.ph ], [ %47, %._crit_edge62 ]
  %41 = phi i32 [ %28, %.preheader53 ], [ %27, %.preheader52.lr.ph ], [ %47, %._crit_edge62 ]
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next93, %wide.trip.count96
  br i1 %exitcond97.not, label %.lr.ph69.preheader, label %.preheader53, !llvm.loop !17

.preheader51:                                     ; preds = %.preheader51.lr.ph, %._crit_edge
  %42 = phi i32 [ %51, %._crit_edge ], [ %31, %.preheader51.lr.ph ]
  %43 = phi i32 [ %52, %._crit_edge ], [ %34, %.preheader51.lr.ph ]
  %44 = phi i32 [ %53, %._crit_edge ], [ %32, %.preheader51.lr.ph ]
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %._crit_edge ], [ 1, %.preheader51.lr.ph ]
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader51
  %46 = getelementptr inbounds [31 x [31 x i32]], ptr @graph, i64 0, i64 %indvars.iv89, i64 %indvars.iv86
  br label %55

._crit_edge62:                                    ; preds = %._crit_edge, %.preheader51.lr.ph, %.preheader52
  %47 = phi i32 [ %31, %.preheader52 ], [ %31, %.preheader51.lr.ph ], [ %51, %._crit_edge ]
  %48 = phi i32 [ %32, %.preheader52 ], [ %32, %.preheader51.lr.ph ], [ %53, %._crit_edge ]
  %49 = phi i32 [ %33, %.preheader52 ], [ %33, %.preheader51.lr.ph ], [ %53, %._crit_edge ]
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %50 = sext i32 %47 to i64
  %.not48.not = icmp slt i64 %indvars.iv89, %50
  br i1 %.not48.not, label %.preheader52, label %._crit_edge65, !llvm.loop !19

._crit_edge.loopexit:                             ; preds = %85
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader51
  %51 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %42, %.preheader51 ]
  %52 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %43, %.preheader51 ]
  %53 = phi i32 [ %86, %._crit_edge.loopexit ], [ %44, %.preheader51 ]
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %54 = sext i32 %52 to i64
  %.not49.not = icmp slt i64 %indvars.iv86, %54
  br i1 %.not49.not, label %.preheader51, label %._crit_edge62, !llvm.loop !20

55:                                               ; preds = %.lr.ph, %85
  %indvars.iv83 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next84, %85 ]
  %56 = trunc nuw nsw i64 %indvars.iv83 to i32
  %57 = shl nuw i32 1, %56
  %58 = and i32 %57, %30
  %.not50 = icmp eq i32 %58, 0
  br i1 %.not50, label %59, label %85

59:                                               ; preds = %55
  %60 = load i32, ptr %46, align 4, !tbaa !5
  %61 = load i32, ptr @INF, align 4, !tbaa !5
  %62 = icmp eq i32 %60, %61
  br i1 %62, label %85, label %63

63:                                               ; preds = %59
  %64 = load double, ptr %35, align 8, !tbaa !9
  %65 = sitofp i32 %61 to double
  %66 = fsub double %64, %65
  %67 = tail call noundef double @_ZSt3absd(double noundef %66)
  %68 = load double, ptr @eps, align 8, !tbaa !9
  %69 = fcmp ugt double %67, %68
  br i1 %69, label %70, label %85

70:                                               ; preds = %63
  %71 = load double, ptr %35, align 8, !tbaa !9
  %72 = load i32, ptr %46, align 4, !tbaa !5
  %73 = sitofp i32 %72 to double
  %74 = getelementptr inbounds [8 x i32], ptr @tickets, i64 0, i64 %indvars.iv83
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sitofp i32 %75 to double
  %77 = fdiv double %73, %76
  %78 = fadd double %71, %77
  %79 = or i32 %57, %30
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %indvars.iv86, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !9
  %83 = fcmp ogt double %82, %78
  br i1 %83, label %84, label %85

84:                                               ; preds = %70
  store double %78, ptr %81, align 8, !tbaa !9
  br label %85

85:                                               ; preds = %70, %84, %63, %59, %55
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = icmp slt i64 %indvars.iv.next84, %87
  br i1 %88, label %55, label %._crit_edge.loopexit, !llvm.loop !21

._crit_edge70:                                    ; preds = %.lr.ph69, %._crit_edge58.thread106, %._crit_edge58.thread
  %89 = phi double [ %3, %._crit_edge58.thread ], [ %3, %._crit_edge58.thread106 ], [ %98, %.lr.ph69 ]
  %90 = load i32, ptr @INF, align 4, !tbaa !5
  %91 = add nsw i32 %90, -1
  %92 = sitofp i32 %91 to double
  %93 = fcmp olt double %89, %92
  br i1 %93, label %99, label %101

.lr.ph69:                                         ; preds = %.lr.ph69.preheader, %.lr.ph69
  %indvars.iv98 = phi i64 [ 0, %.lr.ph69.preheader ], [ %indvars.iv.next99, %.lr.ph69 ]
  %94 = load i32, ptr @b, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [31 x [256 x double]], ptr @dp, i64 0, i64 %95, i64 %indvars.iv98
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %96)
  %98 = load double, ptr %97, align 8, !tbaa !9
  store double %98, ptr %1, align 8, !tbaa !9
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %exitcond103.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count102
  br i1 %exitcond103.not, label %._crit_edge70, label %.lr.ph69, !llvm.loop !22

99:                                               ; preds = %._crit_edge70
  %100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %89)
  br label %103

101:                                              ; preds = %._crit_edge70
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %103

103:                                              ; preds = %101, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret void
}

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 #3 = { 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 #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 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12, !18}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !12, !18}
!20 = distinct !{!20, !12, !18}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}


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