; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/331 Division 2/Problem D/D.ll (Z2goiiii)

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

@h = external dso_local global i32, align 4
@x = external dso_local global [2002 x i32], align 16
@l = external dso_local global [2002 x i32], align 16
@r = external dso_local global [2002 x i32], align 16
@dp = external dso_local global [2002 x [2002 x [2 x [2 x x86_fp80]]]], align 16
@p = external dso_local global x86_fp80, align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef x86_fp80 @_Z2goiiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #0 {
  %5 = alloca x86_fp80, align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !5
  %18 = load i32, ptr %6, align 4, !tbaa !5
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = icmp sgt i32 %18, %19
  br i1 %20, label %21, label %22

21:                                               ; preds = %4
  store x86_fp80 0xK00000000000000000000, ptr %5, align 16
  br label %237

22:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [2002 x [2002 x [2 x [2 x x86_fp80]]]], ptr @dp, i64 0, i64 %24
  %26 = load i32, ptr %7, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [2002 x [2 x [2 x x86_fp80]]], ptr %25, i64 0, i64 %27
  %29 = load i32, ptr %8, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [2 x [2 x x86_fp80]], ptr %28, i64 0, i64 %30
  %32 = load i32, ptr %9, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [2 x x86_fp80], ptr %31, i64 0, i64 %33
  store ptr %34, ptr %10, align 8, !tbaa !9
  %35 = load ptr, ptr %10, align 8, !tbaa !9
  %36 = load x86_fp80, ptr %35, align 16, !tbaa !11
  %37 = fcmp ogt x86_fp80 %36, 0xK00000000000000000000
  br i1 %37, label %38, label %41

38:                                               ; preds = %22
  %39 = load ptr, ptr %10, align 8, !tbaa !9
  %40 = load x86_fp80, ptr %39, align 16, !tbaa !11
  store x86_fp80 %40, ptr %5, align 16
  store i32 1, ptr %11, align 4
  br label %236

41:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %50

44:                                               ; preds = %41
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = sub nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  br label %58

50:                                               ; preds = %41
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = sub nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr @h, align 4, !tbaa !5
  %57 = add nsw i32 %55, %56
  br label %58

58:                                               ; preds = %50, %44
  %59 = phi i32 [ %49, %44 ], [ %57, %50 ]
  store i32 %59, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %68

62:                                               ; preds = %58
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  br label %76

68:                                               ; preds = %58
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr @h, align 4, !tbaa !5
  %75 = sub nsw i32 %73, %74
  br label %76

76:                                               ; preds = %68, %62
  %77 = phi i32 [ %67, %62 ], [ %75, %68 ]
  store i32 %77, ptr %13, align 4, !tbaa !5
  %78 = load x86_fp80, ptr @p, align 16, !tbaa !11
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = load i32, ptr %9, align 4, !tbaa !5
  %83 = call noundef x86_fp80 @_Z2goiiii(i32 noundef %80, i32 noundef %81, i32 noundef 0, i32 noundef %82)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr %12, align 4, !tbaa !5
  %89 = sub nsw i32 %87, %88
  store i32 %89, ptr %14, align 4, !tbaa !5
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @h, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sitofp i32 %91 to x86_fp80
  %93 = fadd x86_fp80 %83, %92
  %94 = fmul x86_fp80 %78, %93
  %95 = load ptr, ptr %10, align 8, !tbaa !9
  store x86_fp80 %94, ptr %95, align 16, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [2002 x i32], ptr @r, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %102, label %134

102:                                              ; preds = %76
  %103 = load x86_fp80, ptr @p, align 16, !tbaa !11
  %104 = fsub x86_fp80 0xK3FFF8000000000000000, %103
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [2002 x i32], ptr @r, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  %110 = load i32, ptr %7, align 4, !tbaa !5
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = call noundef x86_fp80 @_Z2goiiii(i32 noundef %109, i32 noundef %110, i32 noundef 1, i32 noundef %111)
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [2002 x i32], ptr @r, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = sitofp i32 %119 to x86_fp80
  %121 = fadd x86_fp80 %112, %120
  %122 = load i32, ptr @h, align 4, !tbaa !5
  %123 = sitofp i32 %122 to x86_fp80
  %124 = fadd x86_fp80 %121, %123
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = sitofp i32 %128 to x86_fp80
  %130 = fsub x86_fp80 %124, %129
  %131 = load ptr, ptr %10, align 8, !tbaa !9
  %132 = load x86_fp80, ptr %131, align 16, !tbaa !11
  %133 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %104, x86_fp80 %130, x86_fp80 %132)
  store x86_fp80 %133, ptr %131, align 16, !tbaa !11
  br label %154

134:                                              ; preds = %76
  %135 = load x86_fp80, ptr @p, align 16, !tbaa !11
  %136 = fsub x86_fp80 0xK3FFF8000000000000000, %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = load i32, ptr @h, align 4, !tbaa !5
  %142 = add nsw i32 %140, %141
  store i32 %142, ptr %15, align 4, !tbaa !5
  %143 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = load i32, ptr %6, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = sub nsw i32 %144, %148
  %150 = sitofp i32 %149 to x86_fp80
  %151 = load ptr, ptr %10, align 8, !tbaa !9
  %152 = load x86_fp80, ptr %151, align 16, !tbaa !11
  %153 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %136, x86_fp80 %150, x86_fp80 %152)
  store x86_fp80 %153, ptr %151, align 16, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %154

154:                                              ; preds = %134, %102
  %155 = load x86_fp80, ptr @p, align 16, !tbaa !11
  %156 = fsub x86_fp80 0xK3FFF8000000000000000, %155
  %157 = load i32, ptr %6, align 4, !tbaa !5
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = sub nsw i32 %158, 1
  %160 = load i32, ptr %8, align 4, !tbaa !5
  %161 = call noundef x86_fp80 @_Z2goiiii(i32 noundef %157, i32 noundef %159, i32 noundef %160, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %162 = load i32, ptr %13, align 4, !tbaa !5
  %163 = load i32, ptr %7, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = sub nsw i32 %162, %166
  store i32 %167, ptr %16, align 4, !tbaa !5
  %168 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @h, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = sitofp i32 %169 to x86_fp80
  %171 = fadd x86_fp80 %161, %170
  %172 = load ptr, ptr %10, align 8, !tbaa !9
  %173 = load x86_fp80, ptr %172, align 16, !tbaa !11
  %174 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %156, x86_fp80 %171, x86_fp80 %173)
  store x86_fp80 %174, ptr %172, align 16, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %175 = load i32, ptr %7, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = load i32, ptr %6, align 4, !tbaa !5
  %180 = icmp sgt i32 %178, %179
  br i1 %180, label %181, label %211

181:                                              ; preds = %154
  %182 = load x86_fp80, ptr @p, align 16, !tbaa !11
  %183 = load i32, ptr %6, align 4, !tbaa !5
  %184 = load i32, ptr %7, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = sub nsw i32 %187, 1
  %189 = load i32, ptr %8, align 4, !tbaa !5
  %190 = call noundef x86_fp80 @_Z2goiiii(i32 noundef %183, i32 noundef %188, i32 noundef %189, i32 noundef 0)
  %191 = load i32, ptr %7, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = sitofp i32 %194 to x86_fp80
  %196 = fadd x86_fp80 %190, %195
  %197 = load i32, ptr %7, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = load i32, ptr @h, align 4, !tbaa !5
  %205 = sub nsw i32 %203, %204
  %206 = sitofp i32 %205 to x86_fp80
  %207 = fsub x86_fp80 %196, %206
  %208 = load ptr, ptr %10, align 8, !tbaa !9
  %209 = load x86_fp80, ptr %208, align 16, !tbaa !11
  %210 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %182, x86_fp80 %207, x86_fp80 %209)
  store x86_fp80 %210, ptr %208, align 16, !tbaa !11
  br label %230

211:                                              ; preds = %154
  %212 = load x86_fp80, ptr @p, align 16, !tbaa !11
  %213 = load i32, ptr %7, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %217 = load i32, ptr %6, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !5
  %221 = load i32, ptr @h, align 4, !tbaa !5
  %222 = sub nsw i32 %220, %221
  store i32 %222, ptr %17, align 4, !tbaa !5
  %223 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = sub nsw i32 %216, %224
  %226 = sitofp i32 %225 to x86_fp80
  %227 = load ptr, ptr %10, align 8, !tbaa !9
  %228 = load x86_fp80, ptr %227, align 16, !tbaa !11
  %229 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %212, x86_fp80 %226, x86_fp80 %228)
  store x86_fp80 %229, ptr %227, align 16, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %230

230:                                              ; preds = %211, %181
  %231 = load ptr, ptr %10, align 8, !tbaa !9
  %232 = load x86_fp80, ptr %231, align 16, !tbaa !11
  %233 = fdiv x86_fp80 %232, 0xK40008000000000000000
  store x86_fp80 %233, ptr %231, align 16, !tbaa !11
  %234 = load ptr, ptr %10, align 8, !tbaa !9
  %235 = load x86_fp80, ptr %234, align 16, !tbaa !11
  store x86_fp80 %235, ptr %5, align 16
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %236

236:                                              ; preds = %230, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %237

237:                                              ; preds = %236, %21
  %238 = load x86_fp80, ptr %5, align 16
  ret x86_fp80 %238
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare x86_fp80 @llvm.fmuladd.f80(x86_fp80, x86_fp80, x86_fp80) #3

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long double", !7, i64 0}


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

@h = external dso_local global i32, align 4
@x = external dso_local local_unnamed_addr global [2002 x i32], align 16
@l = external dso_local local_unnamed_addr global [2002 x i32], align 16
@r = external dso_local local_unnamed_addr global [2002 x i32], align 16
@dp = external dso_local local_unnamed_addr global [2002 x [2002 x [2 x [2 x x86_fp80]]]], align 16
@p = external dso_local local_unnamed_addr global x86_fp80, align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef x86_fp80 @_Z2goiiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %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 = icmp sgt i32 %0, %1
  br i1 %11, label %128, label %12

12:                                               ; preds = %4
  %13 = sext i32 %0 to i64
  %14 = sext i32 %1 to i64
  %15 = sext i32 %2 to i64
  %16 = sext i32 %3 to i64
  %17 = getelementptr inbounds [2002 x [2002 x [2 x [2 x x86_fp80]]]], ptr @dp, i64 0, i64 %13, i64 %14, i64 %15, i64 %16
  %18 = load x86_fp80, ptr %17, align 16, !tbaa !5
  %19 = fcmp ogt x86_fp80 %18, 0xK00000000000000000000
  br i1 %19, label %128, label %.split

.split:                                           ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %20 = icmp eq i32 %2, 0
  %21 = add nsw i32 %0, -1
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !9
  %25 = load i32, ptr @h, align 4
  %26 = select i1 %20, i32 0, i32 %25
  %27 = add nsw i32 %24, %26
  store i32 %27, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %28 = icmp eq i32 %3, 1
  %29 = add nsw i32 %1, 1
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = load i32, ptr @h, align 4
  %34 = select i1 %28, i32 0, i32 %33
  %.sink = sub nsw i32 %32, %34
  %35 = load x86_fp80, ptr @p, align 16, !tbaa !5
  %36 = add nsw i32 %0, 1
  %37 = tail call noundef x86_fp80 @_Z2goiiii(i32 noundef %36, i32 noundef %1, i32 noundef 0, i32 noundef %3)
  store i32 %.sink, ptr %6, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %38 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %13
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = sub nsw i32 %39, %27
  store i32 %40, ptr %7, align 4, !tbaa !9
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @h, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = sitofp i32 %42 to x86_fp80
  %44 = fadd x86_fp80 %37, %43
  %45 = fmul x86_fp80 %35, %44
  store x86_fp80 %45, ptr %17, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %46 = getelementptr inbounds [2002 x i32], ptr @r, i64 0, i64 %13
  %47 = load i32, ptr %46, align 4, !tbaa !9
  %48 = icmp slt i32 %47, %1
  %49 = load x86_fp80, ptr @p, align 16, !tbaa !5
  %50 = fsub x86_fp80 0xK3FFF8000000000000000, %49
  br i1 %48, label %51, label %68

51:                                               ; preds = %.split
  %52 = add nsw i32 %47, 1
  %53 = call noundef x86_fp80 @_Z2goiiii(i32 noundef %52, i32 noundef %1, i32 noundef 1, i32 noundef %3)
  %54 = load i32, ptr %46, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = sitofp i32 %57 to x86_fp80
  %59 = fadd x86_fp80 %53, %58
  %60 = load i32, ptr @h, align 4, !tbaa !9
  %61 = sitofp i32 %60 to x86_fp80
  %62 = fadd x86_fp80 %59, %61
  %63 = load i32, ptr %38, align 4, !tbaa !9
  %64 = sitofp i32 %63 to x86_fp80
  %65 = fsub x86_fp80 %62, %64
  %66 = load x86_fp80, ptr %17, align 16, !tbaa !5
  %67 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %50, x86_fp80 %65, x86_fp80 %66)
  br label %80

68:                                               ; preds = %.split
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %69 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %14
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = load i32, ptr @h, align 4, !tbaa !9
  %72 = add nsw i32 %71, %70
  store i32 %72, ptr %8, align 4, !tbaa !9
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = load i32, ptr %38, align 4, !tbaa !9
  %76 = sub nsw i32 %74, %75
  %77 = sitofp i32 %76 to x86_fp80
  %78 = load x86_fp80, ptr %17, align 16, !tbaa !5
  %79 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %50, x86_fp80 %77, x86_fp80 %78)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br label %80

80:                                               ; preds = %68, %51
  %.sink56 = phi x86_fp80 [ %67, %51 ], [ %79, %68 ]
  store x86_fp80 %.sink56, ptr %17, align 16
  %81 = load x86_fp80, ptr @p, align 16, !tbaa !5
  %82 = fsub x86_fp80 0xK3FFF8000000000000000, %81
  %83 = add nsw i32 %1, -1
  %84 = call noundef x86_fp80 @_Z2goiiii(i32 noundef %0, i32 noundef %83, i32 noundef %2, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %85 = load i32, ptr %6, align 4, !tbaa !9
  %86 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %14
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = sub nsw i32 %85, %87
  store i32 %88, ptr %9, align 4, !tbaa !9
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @h, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = sitofp i32 %90 to x86_fp80
  %92 = fadd x86_fp80 %84, %91
  %93 = load x86_fp80, ptr %17, align 16, !tbaa !5
  %94 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %82, x86_fp80 %92, x86_fp80 %93)
  store x86_fp80 %94, ptr %17, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  %95 = getelementptr inbounds [2002 x i32], ptr @l, i64 0, i64 %14
  %96 = load i32, ptr %95, align 4, !tbaa !9
  %97 = icmp sgt i32 %96, %0
  %98 = load x86_fp80, ptr @p, align 16, !tbaa !5
  br i1 %97, label %99, label %115

99:                                               ; preds = %80
  %100 = add nsw i32 %96, -1
  %101 = call noundef x86_fp80 @_Z2goiiii(i32 noundef %0, i32 noundef %100, i32 noundef %2, i32 noundef 0)
  %102 = load i32, ptr %86, align 4, !tbaa !9
  %103 = sitofp i32 %102 to x86_fp80
  %104 = fadd x86_fp80 %101, %103
  %105 = load i32, ptr %95, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [2002 x i32], ptr @x, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = load i32, ptr @h, align 4, !tbaa !9
  %110 = sub nsw i32 %108, %109
  %111 = sitofp i32 %110 to x86_fp80
  %112 = fsub x86_fp80 %104, %111
  %113 = load x86_fp80, ptr %17, align 16, !tbaa !5
  %114 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %98, x86_fp80 %112, x86_fp80 %113)
  br label %126

115:                                              ; preds = %80
  %116 = load i32, ptr %86, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  %117 = load i32, ptr %38, align 4, !tbaa !9
  %118 = load i32, ptr @h, align 4, !tbaa !9
  %119 = sub nsw i32 %117, %118
  store i32 %119, ptr %10, align 4, !tbaa !9
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %121 = load i32, ptr %120, align 4, !tbaa !9
  %122 = sub nsw i32 %116, %121
  %123 = sitofp i32 %122 to x86_fp80
  %124 = load x86_fp80, ptr %17, align 16, !tbaa !5
  %125 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %98, x86_fp80 %123, x86_fp80 %124)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  br label %126

126:                                              ; preds = %115, %99
  %.sink57 = phi x86_fp80 [ %114, %99 ], [ %125, %115 ]
  %127 = fmul x86_fp80 %.sink57, 0xK3FFE8000000000000000
  store x86_fp80 %127, ptr %17, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %128

128:                                              ; preds = %126, %12, %4
  %.1 = phi x86_fp80 [ 0xK00000000000000000000, %4 ], [ %127, %126 ], [ %18, %12 ]
  ret x86_fp80 %.1
}

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare x86_fp80 @llvm.fmuladd.f80(x86_fp80, x86_fp80, x86_fp80) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}


; Effective O3 passes: CallSiteSplittingPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass