; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-10-21 (B - Burrito King - tjz)

; 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.Node = type { i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@A = external dso_local global i32, align 4
@B = external dso_local global i32, align 4
@sb = external dso_local global i32, align 4
@sa = external dso_local global double, align 8
@ans = external dso_local global [100010 x double], align 16
@p = external dso_local global [100010 x %struct.Node], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %5 = load ptr, ptr @stdin, align 8, !tbaa !5
  %6 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %5)
  %7 = load ptr, ptr @stdout, align 8, !tbaa !5
  %8 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %7)
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @n, ptr noundef @A, ptr noundef @B)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %34, %0
  %11 = load i32, ptr %2, align 4, !tbaa !9
  %12 = load i32, ptr @n, align 4, !tbaa !9
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %37

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !9
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %17
  %19 = getelementptr inbounds %struct.Node, ptr %18, i32 0, i32 1
  %20 = load i32, ptr %2, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %21
  %23 = getelementptr inbounds %struct.Node, ptr %22, i32 0, i32 2
  %24 = load i32, ptr %2, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %25
  %27 = getelementptr inbounds %struct.Node, ptr %26, i32 0, i32 3
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %19, ptr noundef %23, ptr noundef %27)
  %29 = load i32, ptr %2, align 4, !tbaa !9
  %30 = load i32, ptr %2, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %31
  %33 = getelementptr inbounds %struct.Node, ptr %32, i32 0, i32 0
  store i32 %29, ptr %33, align 16, !tbaa !11
  br label %34

34:                                               ; preds = %15
  %35 = load i32, ptr %2, align 4, !tbaa !9
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !9
  br label %10, !llvm.loop !13

37:                                               ; preds = %14
  %38 = load i32, ptr @n, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds %struct.Node, ptr @p, i64 %39
  call void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef @p, ptr noundef %40)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %140, %37
  %42 = load i32, ptr %3, align 4, !tbaa !9
  %43 = load i32, ptr @n, align 4, !tbaa !9
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %143

46:                                               ; preds = %41
  %47 = load i32, ptr %3, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %48
  %50 = getelementptr inbounds %struct.Node, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 4, !tbaa !15
  %52 = load i32, ptr %3, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %53
  %55 = getelementptr inbounds %struct.Node, ptr %54, i32 0, i32 3
  %56 = load i32, ptr %55, align 4, !tbaa !16
  %57 = mul nsw i32 %51, %56
  %58 = load i32, ptr @sb, align 4, !tbaa !9
  %59 = add nsw i32 %57, %58
  %60 = load i32, ptr @B, align 4, !tbaa !9
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %62, label %103

62:                                               ; preds = %46
  %63 = load i32, ptr %3, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %64
  %66 = getelementptr inbounds %struct.Node, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !15
  %68 = sitofp i32 %67 to double
  %69 = load i32, ptr %3, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %70
  %72 = getelementptr inbounds %struct.Node, ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 16, !tbaa !11
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100010 x double], ptr @ans, i64 0, i64 %74
  store double %68, ptr %75, align 8, !tbaa !17
  %76 = load i32, ptr %3, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %77
  %79 = getelementptr inbounds %struct.Node, ptr %78, i32 0, i32 1
  %80 = load i32, ptr %79, align 4, !tbaa !15
  %81 = load i32, ptr %3, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.Node, ptr %83, i32 0, i32 2
  %85 = load i32, ptr %84, align 8, !tbaa !19
  %86 = mul nsw i32 %80, %85
  %87 = sitofp i32 %86 to double
  %88 = load double, ptr @sa, align 8, !tbaa !17
  %89 = fadd double %88, %87
  store double %89, ptr @sa, align 8, !tbaa !17
  %90 = load i32, ptr %3, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.Node, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !15
  %95 = load i32, ptr %3, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %96
  %98 = getelementptr inbounds %struct.Node, ptr %97, i32 0, i32 3
  %99 = load i32, ptr %98, align 4, !tbaa !16
  %100 = mul nsw i32 %94, %99
  %101 = load i32, ptr @sb, align 4, !tbaa !9
  %102 = add nsw i32 %101, %100
  store i32 %102, ptr @sb, align 4, !tbaa !9
  br label %139

103:                                              ; preds = %46
  %104 = load i32, ptr @B, align 4, !tbaa !9
  %105 = load i32, ptr @sb, align 4, !tbaa !9
  %106 = sub nsw i32 %104, %105
  %107 = sitofp i32 %106 to double
  %108 = load i32, ptr %3, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %109
  %111 = getelementptr inbounds %struct.Node, ptr %110, i32 0, i32 3
  %112 = load i32, ptr %111, align 4, !tbaa !16
  %113 = sitofp i32 %112 to double
  %114 = fdiv double %107, %113
  %115 = load i32, ptr %3, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %116
  %118 = getelementptr inbounds %struct.Node, ptr %117, i32 0, i32 0
  %119 = load i32, ptr %118, align 16, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100010 x double], ptr @ans, i64 0, i64 %120
  store double %114, ptr %121, align 8, !tbaa !17
  %122 = load i32, ptr %3, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %123
  %125 = getelementptr inbounds %struct.Node, ptr %124, i32 0, i32 0
  %126 = load i32, ptr %125, align 16, !tbaa !11
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100010 x double], ptr @ans, i64 0, i64 %127
  %129 = load double, ptr %128, align 8, !tbaa !17
  %130 = load i32, ptr %3, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %131
  %133 = getelementptr inbounds %struct.Node, ptr %132, i32 0, i32 2
  %134 = load i32, ptr %133, align 8, !tbaa !19
  %135 = sitofp i32 %134 to double
  %136 = load double, ptr @sa, align 8, !tbaa !17
  %137 = call double @llvm.fmuladd.f64(double %129, double %135, double %136)
  store double %137, ptr @sa, align 8, !tbaa !17
  %138 = load i32, ptr @B, align 4, !tbaa !9
  store i32 %138, ptr @sb, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %103, %62
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %3, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %3, align 4, !tbaa !9
  br label %41, !llvm.loop !20

143:                                              ; preds = %45
  %144 = load i32, ptr @A, align 4, !tbaa !9
  %145 = sitofp i32 %144 to double
  %146 = load double, ptr @sa, align 8, !tbaa !17
  %147 = fsub double %145, %146
  %148 = call noundef i32 @_Z3sgnd(double noundef %147)
  %149 = icmp sgt i32 %148, 0
  br i1 %149, label %150, label %152

150:                                              ; preds = %143
  %151 = call i32 @puts(ptr noundef @.str.5)
  br label %179

152:                                              ; preds = %143
  %153 = load double, ptr @sa, align 8, !tbaa !17
  %154 = load i32, ptr @sb, align 4, !tbaa !9
  %155 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, double noundef %153, i32 noundef %154)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %156

156:                                              ; preds = %175, %152
  %157 = load i32, ptr %4, align 4, !tbaa !9
  %158 = load i32, ptr @n, align 4, !tbaa !9
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %178

161:                                              ; preds = %156
  %162 = load i32, ptr %4, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100010 x double], ptr @ans, i64 0, i64 %163
  %165 = load double, ptr %164, align 8, !tbaa !17
  %166 = load i32, ptr %4, align 4, !tbaa !9
  %167 = load i32, ptr @n, align 4, !tbaa !9
  %168 = sub nsw i32 %167, 1
  %169 = icmp eq i32 %166, %168
  %170 = zext i1 %169 to i64
  %171 = getelementptr inbounds [3 x i8], ptr @.str.8, i64 0, i64 %170
  %172 = load i8, ptr %171, align 1, !tbaa !21
  %173 = sext i8 %172 to i32
  %174 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, double noundef %165, i32 noundef %173)
  br label %175

175:                                              ; preds = %161
  %176 = load i32, ptr %4, align 4, !tbaa !9
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %4, align 4, !tbaa !9
  br label %156, !llvm.loop !22

178:                                              ; preds = %160
  br label %179

179:                                              ; preds = %178, %150
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef, ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

declare i32 @puts(ptr noundef) #2

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

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 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 #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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !10, i64 0}
!12 = !{!"_ZTS4Node", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!12, !10, i64 4}
!16 = !{!12, !10, i64 12}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!12, !10, i64 8}
!20 = distinct !{!20, !14}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !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"

%struct.Node = type { i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@A = external dso_local global i32, align 4
@B = external dso_local global i32, align 4
@sb = external dso_local local_unnamed_addr global i32, align 4
@sa = external dso_local local_unnamed_addr global double, align 8
@ans = external dso_local local_unnamed_addr global [100010 x double], align 16
@p = external dso_local global [100010 x %struct.Node], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = load ptr, ptr @stdin, align 8, !tbaa !5
  %2 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %1)
  %3 = load ptr, ptr @stdout, align 8, !tbaa !5
  %4 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %3)
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @n, ptr noundef nonnull @A, ptr noundef nonnull @B)
  %6 = load i32, ptr @n, align 4, !tbaa !9
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre51 = sext i32 %6 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre51, %.._crit_edge_crit_edge ], [ %19, %.lr.ph ]
  %8 = getelementptr inbounds %struct.Node, ptr @p, i64 %.pre-phi
  tail call void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef nonnull @p, ptr noundef nonnull %8)
  %9 = load i32, ptr @n, align 4, !tbaa !9
  %10 = icmp sgt i32 %9, 0
  %sa.promoted = load double, ptr @sa, align 8, !tbaa !11
  br i1 %10, label %.lr.ph38, label %._crit_edge._crit_edge

.lr.ph38:                                         ; preds = %._crit_edge
  %sb.promoted = load i32, ptr @sb, align 4, !tbaa !9
  %11 = load i32, ptr @B, align 4, !tbaa !9
  %wide.trip.count = zext nneg i32 %9 to i64
  br label %27

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %indvars.iv
  %13 = getelementptr inbounds i8, ptr %12, i64 4
  %14 = getelementptr inbounds i8, ptr %12, i64 8
  %15 = getelementptr inbounds i8, ptr %12, i64 12
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %15)
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %17, ptr %12, align 16, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @n, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge39:                                    ; preds = %57
  store double %storemerge30, ptr @sa, align 8, !tbaa !11
  store i32 %storemerge, ptr @sb, align 4, !tbaa !9
  br label %._crit_edge._crit_edge

._crit_edge._crit_edge:                           ; preds = %._crit_edge, %._crit_edge39
  %21 = phi double [ %storemerge30, %._crit_edge39 ], [ %sa.promoted, %._crit_edge ]
  %22 = load i32, ptr @A, align 4, !tbaa !9
  %23 = sitofp i32 %22 to double
  %24 = fsub double %23, %21
  %25 = tail call noundef i32 @_Z3sgnd(double noundef %24)
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %58, label %60

27:                                               ; preds = %.lr.ph38, %57
  %indvars.iv45 = phi i64 [ 0, %.lr.ph38 ], [ %indvars.iv.next46, %57 ]
  %storemerge3235 = phi i32 [ %sb.promoted, %.lr.ph38 ], [ %storemerge, %57 ]
  %storemerge303334 = phi double [ %sa.promoted, %.lr.ph38 ], [ %storemerge30, %57 ]
  %28 = getelementptr inbounds [100010 x %struct.Node], ptr @p, i64 0, i64 %indvars.iv45
  %29 = getelementptr inbounds i8, ptr %28, i64 4
  %30 = load i32, ptr %29, align 4, !tbaa !17
  %31 = getelementptr inbounds i8, ptr %28, i64 12
  %32 = load i32, ptr %31, align 4, !tbaa !18
  %33 = mul nsw i32 %32, %30
  %34 = add nsw i32 %33, %storemerge3235
  %.not = icmp sgt i32 %34, %11
  br i1 %.not, label %45, label %35

35:                                               ; preds = %27
  %36 = sitofp i32 %30 to double
  %37 = load i32, ptr %28, align 16, !tbaa !13
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100010 x double], ptr @ans, i64 0, i64 %38
  store double %36, ptr %39, align 8, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %28, i64 8
  %41 = load i32, ptr %40, align 8, !tbaa !19
  %42 = mul nsw i32 %41, %30
  %43 = sitofp i32 %42 to double
  %44 = fadd double %storemerge303334, %43
  br label %57

45:                                               ; preds = %27
  %46 = sub nsw i32 %11, %storemerge3235
  %47 = sitofp i32 %46 to double
  %48 = sitofp i32 %32 to double
  %49 = fdiv double %47, %48
  %50 = load i32, ptr %28, align 16, !tbaa !13
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100010 x double], ptr @ans, i64 0, i64 %51
  store double %49, ptr %52, align 8, !tbaa !11
  %53 = getelementptr inbounds i8, ptr %28, i64 8
  %54 = load i32, ptr %53, align 8, !tbaa !19
  %55 = sitofp i32 %54 to double
  %56 = tail call double @llvm.fmuladd.f64(double %49, double %55, double %storemerge303334)
  br label %57

57:                                               ; preds = %35, %45
  %storemerge30 = phi double [ %44, %35 ], [ %56, %45 ]
  %storemerge = phi i32 [ %34, %35 ], [ %11, %45 ]
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge39, label %27, !llvm.loop !20

58:                                               ; preds = %._crit_edge._crit_edge
  %59 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %.loopexit

60:                                               ; preds = %._crit_edge._crit_edge
  %61 = load double, ptr @sa, align 8, !tbaa !11
  %62 = load i32, ptr @sb, align 4, !tbaa !9
  %63 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %61, i32 noundef %62)
  %64 = load i32, ptr @n, align 4, !tbaa !9
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %.lr.ph42, label %.loopexit

.lr.ph42:                                         ; preds = %60, %.lr.ph42
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %.lr.ph42 ], [ 0, %60 ]
  %66 = phi i32 [ %77, %.lr.ph42 ], [ %64, %60 ]
  %67 = getelementptr inbounds [100010 x double], ptr @ans, i64 0, i64 %indvars.iv48
  %68 = load double, ptr %67, align 8, !tbaa !11
  %69 = add nsw i32 %66, -1
  %70 = zext i32 %69 to i64
  %71 = icmp eq i64 %indvars.iv48, %70
  %72 = zext i1 %71 to i64
  %73 = getelementptr inbounds [3 x i8], ptr @.str.8, i64 0, i64 %72
  %74 = load i8, ptr %73, align 1, !tbaa !21
  %75 = sext i8 %74 to i32
  %76 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %68, i32 noundef %75)
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %77 = load i32, ptr @n, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next49, %78
  br i1 %79, label %.lr.ph42, label %.loopexit, !llvm.loop !22

.loopexit:                                        ; preds = %.lr.ph42, %60, %58
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4NodeEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

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

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 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 #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 = { 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 = { inlinehint 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!14, !10, i64 0}
!14 = !{!"_ZTS4Node", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!14, !10, i64 4}
!18 = !{!14, !10, i64 12}
!19 = !{!14, !10, i64 8}
!20 = distinct !{!20, !16}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !16}


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