; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (2993（斜率优化+fread）)

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

@sum = external dso_local global [100010 x i32], align 16
@tot = external dso_local global i32, align 4
@Buf = external dso_local global [25000000 x i8], align 16
@buf = external dso_local global ptr, align 8
@que = external dso_local global [100010 x i32], align 16
@head = external dso_local global i32, align 4
@tail = external dso_local global i32, align 4
@stdin = external global ptr, align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  store i32 0, ptr %1, align 4
  %8 = load ptr, ptr @stdin, align 8, !tbaa !5
  %9 = call i64 @fread(ptr noundef @Buf, i64 noundef 1, i64 noundef 25000000, ptr noundef %8)
  %10 = trunc i64 %9 to i32
  store i32 %10, ptr @tot, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  br label %11

11:                                               ; preds = %134, %0
  br label %12

12:                                               ; preds = %11
  %13 = load ptr, ptr @buf, align 8, !tbaa !5
  %14 = ptrtoint ptr %13 to i64
  %15 = sub i64 %14, ptrtoint (ptr @Buf to i64)
  %16 = add nsw i64 %15, 1
  %17 = load i32, ptr @tot, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = icmp sge i64 %16, %18
  br i1 %19, label %20, label %21

20:                                               ; preds = %12
  br label %137

21:                                               ; preds = %12
  call void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %41, %21
  %23 = load i32, ptr %4, align 4, !tbaa !9
  %24 = load i32, ptr %2, align 4, !tbaa !9
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %44

27:                                               ; preds = %22
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %29
  call void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4) %30)
  %31 = load i32, ptr %4, align 4, !tbaa !9
  %32 = sub nsw i32 %31, 1
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = load i32, ptr %4, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = add nsw i32 %39, %35
  store i32 %40, ptr %38, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %27
  %42 = load i32, ptr %4, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %4, align 4, !tbaa !9
  br label %22, !llvm.loop !11

44:                                               ; preds = %26
  store i32 1, ptr @head, align 4, !tbaa !9
  store i32 0, ptr @tail, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store double 0.000000e+00, ptr %5, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %45 = load i32, ptr %3, align 4, !tbaa !9
  store i32 %45, ptr %6, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %131, %44
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = load i32, ptr %2, align 4, !tbaa !9
  %49 = icmp sle i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %134

51:                                               ; preds = %46
  br label %52

52:                                               ; preds = %73, %51
  %53 = load i32, ptr @head, align 4, !tbaa !9
  %54 = load i32, ptr @tail, align 4, !tbaa !9
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %56, label %71

56:                                               ; preds = %52
  %57 = load i32, ptr @tail, align 4, !tbaa !9
  %58 = sub nsw i32 %57, 1
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = load i32, ptr @tail, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = load i32, ptr %3, align 4, !tbaa !9
  %68 = sub nsw i32 %66, %67
  %69 = call noundef i32 @_Z4calciii(i32 noundef %61, i32 noundef %65, i32 noundef %68)
  %70 = icmp ne i32 %69, 0
  br label %71

71:                                               ; preds = %56, %52
  %72 = phi i1 [ false, %52 ], [ %70, %56 ]
  br i1 %72, label %73, label %76

73:                                               ; preds = %71
  %74 = load i32, ptr @tail, align 4, !tbaa !9
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr @tail, align 4, !tbaa !9
  br label %52, !llvm.loop !15

76:                                               ; preds = %71
  %77 = load i32, ptr %6, align 4, !tbaa !9
  %78 = load i32, ptr %3, align 4, !tbaa !9
  %79 = sub nsw i32 %77, %78
  %80 = load i32, ptr @tail, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr @tail, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %82
  store i32 %79, ptr %83, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %103, %76
  %85 = load i32, ptr @head, align 4, !tbaa !9
  %86 = load i32, ptr @tail, align 4, !tbaa !9
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %88, label %101

88:                                               ; preds = %84
  %89 = load i32, ptr @head, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = load i32, ptr @head, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = load i32, ptr %6, align 4, !tbaa !9
  %99 = call noundef i32 @_Z4calciii(i32 noundef %93, i32 noundef %97, i32 noundef %98)
  %100 = icmp ne i32 %99, 0
  br label %101

101:                                              ; preds = %88, %84
  %102 = phi i1 [ false, %84 ], [ %100, %88 ]
  br i1 %102, label %103, label %106

103:                                              ; preds = %101
  %104 = load i32, ptr @head, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr @head, align 4, !tbaa !9
  br label %84, !llvm.loop !16

106:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %107 = load i32, ptr %6, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = load i32, ptr @head, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = sub nsw i32 %110, %117
  %119 = sitofp i32 %118 to double
  %120 = fmul double %119, 1.000000e+00
  %121 = load i32, ptr %6, align 4, !tbaa !9
  %122 = load i32, ptr @head, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = sub nsw i32 %121, %125
  %127 = sitofp i32 %126 to double
  %128 = fdiv double %120, %127
  store double %128, ptr %7, align 8, !tbaa !13
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %130 = load double, ptr %129, align 8, !tbaa !13
  store double %130, ptr %5, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %131

131:                                              ; preds = %106
  %132 = load i32, ptr %6, align 4, !tbaa !9
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %6, align 4, !tbaa !9
  br label %46, !llvm.loop !17

134:                                              ; preds = %50
  %135 = load double, ptr %5, align 8, !tbaa !13
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %135)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %11, !llvm.loop !18

137:                                              ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret i32 0
}

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4)) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4calciii(i32 noundef, i32 noundef, i32 noundef) #3

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

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

attributes #0 = { mustprogress norecurse 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 = { "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 memory(argmem: readwrite) }
attributes #3 = { 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 #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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!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"

@sum = external dso_local global [100010 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@Buf = external dso_local global [25000000 x i8], align 16
@buf = external dso_local local_unnamed_addr global ptr, align 8
@que = external dso_local local_unnamed_addr global [100010 x i32], align 16
@head = external dso_local local_unnamed_addr global i32, align 4
@tail = external dso_local local_unnamed_addr global i32, align 4
@stdin = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = load ptr, ptr @stdin, align 8, !tbaa !5
  %6 = tail call i64 @fread(ptr noundef nonnull @Buf, i64 noundef 1, i64 noundef 25000000, ptr noundef %5)
  %7 = trunc i64 %6 to i32
  store i32 %7, ptr @tot, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %8 = load ptr, ptr @buf, align 8, !tbaa !5
  %9 = ptrtoint ptr %8 to i64
  %10 = add i64 %9, add (i64 sub (i64 0, i64 ptrtoint (ptr @Buf to i64)), i64 1)
  %sext = shl i64 %6, 32
  %11 = ashr exact i64 %sext, 32
  %.not30 = icmp slt i64 %10, %11
  br i1 %.not30, label %.lr.ph32, label %._crit_edge33

.lr.ph32:                                         ; preds = %0, %._crit_edge29
  call void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4) %2)
  %12 = load i32, ptr %1, align 4, !tbaa !9
  %.not1721 = icmp slt i32 %12, 1
  br i1 %.not1721, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph32
  %13 = phi i32 [ %12, %.lr.ph32 ], [ %22, %.lr.ph ]
  store i32 1, ptr @head, align 4, !tbaa !9
  store i32 0, ptr @tail, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  store double 0.000000e+00, ptr %3, align 8, !tbaa !11
  %14 = load i32, ptr %2, align 4, !tbaa !9
  %.not1827 = icmp sgt i32 %14, %13
  br i1 %.not1827, label %._crit_edge29, label %.preheader.preheader

.preheader.preheader:                             ; preds = %._crit_edge
  %15 = sext i32 %14 to i64
  br label %.preheader

.lr.ph:                                           ; preds = %.lr.ph32, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph32 ]
  %16 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %indvars.iv
  call void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4) %16)
  %17 = add nsw i64 %indvars.iv, -1
  %18 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !9
  %20 = load i32, ptr %16, align 4, !tbaa !9
  %21 = add nsw i32 %20, %19
  store i32 %21, ptr %16, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr %1, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %.not17.not = icmp slt i64 %indvars.iv, %23
  br i1 %.not17.not, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader:                                       ; preds = %.preheader.preheader, %.critedge2
  %indvars.iv36 = phi i64 [ %15, %.preheader.preheader ], [ %indvars.iv.next37, %.critedge2 ]
  %24 = load i32, ptr @head, align 4, !tbaa !9
  %25 = load i32, ptr @tail, align 4, !tbaa !9
  %26 = icmp slt i32 %24, %25
  %27 = trunc nsw i64 %indvars.iv36 to i32
  br i1 %26, label %.lr.ph23, label %.critedge

._crit_edge29:                                    ; preds = %.critedge2, %._crit_edge
  %28 = phi double [ 0.000000e+00, %._crit_edge ], [ %84, %.critedge2 ]
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %28)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %30 = load ptr, ptr @buf, align 8, !tbaa !5
  %31 = ptrtoint ptr %30 to i64
  %32 = add i64 %31, add (i64 sub (i64 0, i64 ptrtoint (ptr @Buf to i64)), i64 1)
  %33 = load i32, ptr @tot, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %.not = icmp slt i64 %32, %34
  br i1 %.not, label %.lr.ph32, label %._crit_edge33, !llvm.loop !15

.lr.ph23:                                         ; preds = %.preheader, %46
  %35 = phi i32 [ %47, %46 ], [ %25, %.preheader ]
  %36 = add nsw i32 %35, -1
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = sext i32 %35 to i64
  %41 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = load i32, ptr %2, align 4, !tbaa !9
  %44 = sub nsw i32 %27, %43
  %45 = call noundef i32 @_Z4calciii(i32 noundef %39, i32 noundef %42, i32 noundef %44)
  %.not19 = icmp eq i32 %45, 0
  %.pre.pre = load i32, ptr @tail, align 4, !tbaa !9
  %.pre39.pre = load i32, ptr @head, align 4, !tbaa !9
  br i1 %.not19, label %.critedge, label %46

46:                                               ; preds = %.lr.ph23
  %47 = add nsw i32 %.pre.pre, -1
  store i32 %47, ptr @tail, align 4, !tbaa !9
  %48 = icmp slt i32 %.pre39.pre, %47
  br i1 %48, label %.lr.ph23, label %.critedge, !llvm.loop !16

.critedge:                                        ; preds = %.lr.ph23, %46, %.preheader
  %49 = phi i32 [ %24, %.preheader ], [ %.pre39.pre, %46 ], [ %.pre39.pre, %.lr.ph23 ]
  %50 = phi i32 [ %25, %.preheader ], [ %.pre.pre, %.lr.ph23 ], [ %47, %46 ]
  %51 = load i32, ptr %2, align 4, !tbaa !9
  %52 = sub nsw i32 %27, %51
  %53 = add nsw i32 %50, 1
  store i32 %53, ptr @tail, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %54
  store i32 %52, ptr %55, align 4, !tbaa !9
  %.not34 = icmp sgt i32 %49, %50
  br i1 %.not34, label %.critedge2, label %.lr.ph25

.lr.ph25:                                         ; preds = %.critedge, %65
  %56 = phi i32 [ %66, %65 ], [ %49, %.critedge ]
  %57 = add nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = sext i32 %56 to i64
  %62 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = call noundef i32 @_Z4calciii(i32 noundef %60, i32 noundef %63, i32 noundef %27)
  %.not20 = icmp eq i32 %64, 0
  %.pre40.pre = load i32, ptr @head, align 4, !tbaa !9
  br i1 %.not20, label %.critedge2, label %65

65:                                               ; preds = %.lr.ph25
  %66 = add nsw i32 %.pre40.pre, 1
  store i32 %66, ptr @head, align 4, !tbaa !9
  %67 = load i32, ptr @tail, align 4, !tbaa !9
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %.lr.ph25, label %.critedge2, !llvm.loop !17

.critedge2:                                       ; preds = %.lr.ph25, %65, %.critedge
  %69 = phi i32 [ %49, %.critedge ], [ %.pre40.pre, %.lr.ph25 ], [ %66, %65 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %70 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %indvars.iv36
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %72 = sext i32 %69 to i64
  %73 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100010 x i32], ptr @sum, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = sub nsw i32 %71, %77
  %79 = sitofp i32 %78 to double
  %80 = sub nsw i32 %27, %74
  %81 = sitofp i32 %80 to double
  %82 = fdiv double %79, %81
  store double %82, ptr %4, align 8, !tbaa !11
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %84 = load double, ptr %83, align 8, !tbaa !11
  store double %84, ptr %3, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  %indvars.iv.next37 = add nsw i64 %indvars.iv36, 1
  %85 = load i32, ptr %1, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %.not18.not = icmp slt i64 %indvars.iv36, %86
  br i1 %.not18.not, label %.preheader, label %._crit_edge29, !llvm.loop !18

._crit_edge33:                                    ; preds = %._crit_edge29, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z4readRi(ptr noundef nonnull align 4 dereferenceable(4)) 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) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4calciii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

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

attributes #0 = { mustprogress norecurse 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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!"double", !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}


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