; LLVM IR from ShahjalalShohag/code-library :: Math (Lagrange Multiplier)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::_Setprecision" = type { i32 }

@p = external dso_local global [1010 x double], align 16
@b = external dso_local global [1010 x i32], align 16
@c = external dso_local global [1010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::_Setprecision", align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::_Setprecision", align 4
  store i32 0, ptr %1, align 4
  %17 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %24

24:                                               ; preds = %40, %0
  %25 = load i32, ptr %4, align 4, !tbaa !8
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = icmp sle i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %43

29:                                               ; preds = %24
  %30 = load i32, ptr %4, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1010 x i32], ptr @b, i64 0, i64 %31
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %32)
  %34 = load i32, ptr %4, align 4, !tbaa !8
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1010 x i32], ptr @b, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !8
  %38 = load i32, ptr %3, align 4, !tbaa !8
  %39 = add nsw i32 %38, %37
  store i32 %39, ptr %3, align 4, !tbaa !8
  br label %40

40:                                               ; preds = %29
  %41 = load i32, ptr %4, align 4, !tbaa !8
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %4, align 4, !tbaa !8
  br label %24, !llvm.loop !11

43:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %44

44:                                               ; preds = %60, %43
  %45 = load i32, ptr %6, align 4, !tbaa !8
  %46 = load i32, ptr %2, align 4, !tbaa !8
  %47 = icmp sle i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %63

49:                                               ; preds = %44
  %50 = load i32, ptr %6, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [1010 x i32], ptr @c, i64 0, i64 %51
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %52)
  %54 = load i32, ptr %6, align 4, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1010 x i32], ptr @c, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !8
  %58 = load i32, ptr %5, align 4, !tbaa !8
  %59 = add nsw i32 %58, %57
  store i32 %59, ptr %5, align 4, !tbaa !8
  br label %60

60:                                               ; preds = %49
  %61 = load i32, ptr %6, align 4, !tbaa !8
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %6, align 4, !tbaa !8
  br label %44, !llvm.loop !13

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

64:                                               ; preds = %82, %63
  %65 = load i32, ptr %7, align 4, !tbaa !8
  %66 = load i32, ptr %2, align 4, !tbaa !8
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %85

69:                                               ; preds = %64
  %70 = load i32, ptr %7, align 4, !tbaa !8
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [1010 x i32], ptr @c, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !8
  %74 = sitofp i32 %73 to double
  %75 = fmul double 1.000000e+00, %74
  %76 = load i32, ptr %5, align 4, !tbaa !8
  %77 = sitofp i32 %76 to double
  %78 = fdiv double %75, %77
  %79 = load i32, ptr %7, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %80
  store double %78, ptr %81, align 8, !tbaa !14
  br label %82

82:                                               ; preds = %69
  %83 = load i32, ptr %7, align 4, !tbaa !8
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %7, align 4, !tbaa !8
  br label %64, !llvm.loop !16

85:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store double 0.000000e+00, ptr %8, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store double 2.000000e+06, ptr %9, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 100, ptr %10, align 4, !tbaa !8
  br label %86

86:                                               ; preds = %126, %85
  %87 = load i32, ptr %10, align 4, !tbaa !8
  %88 = add nsw i32 %87, -1
  store i32 %88, ptr %10, align 4, !tbaa !8
  %89 = icmp ne i32 %87, 0
  br i1 %89, label %90, label %127

90:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %91 = load double, ptr %8, align 8, !tbaa !14
  %92 = load double, ptr %9, align 8, !tbaa !14
  %93 = fadd double %91, %92
  %94 = fmul double %93, 5.000000e-01
  store double %94, ptr %11, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store double 0.000000e+00, ptr %12, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 1, ptr %13, align 4, !tbaa !8
  br label %95

95:                                               ; preds = %116, %90
  %96 = load i32, ptr %13, align 4, !tbaa !8
  %97 = load i32, ptr %2, align 4, !tbaa !8
  %98 = icmp sle i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %119

100:                                              ; preds = %95
  %101 = load i32, ptr %13, align 4, !tbaa !8
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %102
  %104 = load double, ptr %103, align 8, !tbaa !14
  %105 = load i32, ptr %13, align 4, !tbaa !8
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1010 x i32], ptr @b, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !8
  %109 = sitofp i32 %108 to double
  %110 = fmul double %104, %109
  %111 = load double, ptr %11, align 8, !tbaa !14
  %112 = fdiv double %110, %111
  %113 = call double @sqrt(double noundef %112) #8
  %114 = load double, ptr %12, align 8, !tbaa !14
  %115 = fadd double %114, %113
  store double %115, ptr %12, align 8, !tbaa !14
  br label %116

116:                                              ; preds = %100
  %117 = load i32, ptr %13, align 4, !tbaa !8
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %13, align 4, !tbaa !8
  br label %95, !llvm.loop !17

119:                                              ; preds = %99
  %120 = load double, ptr %12, align 8, !tbaa !14
  %121 = fcmp ole double %120, 1.000000e+00
  br i1 %121, label %122, label %124

122:                                              ; preds = %119
  %123 = load double, ptr %11, align 8, !tbaa !14
  store double %123, ptr %9, align 8, !tbaa !14
  br label %126

124:                                              ; preds = %119
  %125 = load double, ptr %11, align 8, !tbaa !14
  store double %125, ptr %8, align 8, !tbaa !14
  br label %126

126:                                              ; preds = %124, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %86, !llvm.loop !18

127:                                              ; preds = %86
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt5fixedRSt8ios_base)
  %129 = call i32 @_ZSt12setprecisioni(i32 noundef 10)
  %130 = getelementptr inbounds %"struct.std::_Setprecision", ptr %14, i32 0, i32 0
  store i32 %129, ptr %130, align 4
  %131 = getelementptr inbounds %"struct.std::_Setprecision", ptr %14, i32 0, i32 0
  %132 = load i32, ptr %131, align 4
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %128, i32 %132)
  %134 = load i32, ptr %3, align 4, !tbaa !8
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %133, i32 noundef %134)
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %135, i8 noundef signext 32)
  %137 = load double, ptr %8, align 8, !tbaa !14
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %136, double noundef %137)
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %138, i8 noundef signext 10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 1, ptr %15, align 4, !tbaa !8
  br label %140

140:                                              ; preds = %167, %127
  %141 = load i32, ptr %15, align 4, !tbaa !8
  %142 = load i32, ptr %2, align 4, !tbaa !8
  %143 = icmp sle i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %170

145:                                              ; preds = %140
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt5fixedRSt8ios_base)
  %147 = call i32 @_ZSt12setprecisioni(i32 noundef 10)
  %148 = getelementptr inbounds %"struct.std::_Setprecision", ptr %16, i32 0, i32 0
  store i32 %147, ptr %148, align 4
  %149 = getelementptr inbounds %"struct.std::_Setprecision", ptr %16, i32 0, i32 0
  %150 = load i32, ptr %149, align 4
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %146, i32 %150)
  %152 = load i32, ptr %15, align 4, !tbaa !8
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %153
  %155 = load double, ptr %154, align 8, !tbaa !14
  %156 = load i32, ptr %15, align 4, !tbaa !8
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [1010 x i32], ptr @b, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !8
  %160 = sitofp i32 %159 to double
  %161 = fmul double %155, %160
  %162 = load double, ptr %8, align 8, !tbaa !14
  %163 = fdiv double %161, %162
  %164 = call double @sqrt(double noundef %163) #8
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %151, double noundef %164)
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %165, i8 noundef signext 32)
  br label %167

167:                                              ; preds = %145
  %168 = load i32, ptr %15, align 4, !tbaa !8
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %15, align 4, !tbaa !8
  br label %140, !llvm.loop !19

170:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt5fixedRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) #7

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #6 align 2

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 = { 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 willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { 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 #7 = { 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 #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !10, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !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"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@p = external dso_local local_unnamed_addr global [1010 x double], align 16
@b = external dso_local global [1010 x i32], align 16
@c = external dso_local global [1010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %9 = load i32, ptr %1, align 4, !tbaa !8
  %.not52 = icmp slt i32 %9, 1
  br i1 %.not52, label %.split.us, label %.lr.ph

.preheader51:                                     ; preds = %.lr.ph
  %.not4555 = icmp slt i32 %14, 1
  br i1 %.not4555, label %.split.us, label %.lr.ph58

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %.054 = phi i32 [ %13, %.lr.ph ], [ 0, %0 ]
  %10 = getelementptr inbounds [1010 x i32], ptr @b, i64 0, i64 %indvars.iv
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %12 = load i32, ptr %10, align 4, !tbaa !8
  %13 = add nsw i32 %12, %.054
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr %1, align 4, !tbaa !8
  %15 = sext i32 %14 to i64
  %.not.not = icmp slt i64 %indvars.iv, %15
  br i1 %.not.not, label %.lr.ph, label %.preheader51, !llvm.loop !11

.preheader50:                                     ; preds = %.lr.ph58
  %16 = sitofp i32 %27 to double
  %.not4661 = icmp slt i32 %28, 1
  br i1 %.not4661, label %.split.us, label %.lr.ph63

.lr.ph63:                                         ; preds = %.preheader50
  %17 = add nuw i32 %28, 1
  %wide.trip.count = zext i32 %17 to i64
  %18 = zext nneg i32 %28 to i64
  %min.iters.check = icmp eq i32 %28, 1
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph63
  %indvars.iv85.ph = phi i64 [ 1, %.lr.ph63 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph63
  %n.vec = and i64 %18, 2147483646
  %ind.end = or i64 %18, 1
  %broadcast.splatinsert = insertelement <2 x double> poison, double %16, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %19 = getelementptr inbounds [1010 x i32], ptr @c, i64 0, i64 %offset.idx
  %wide.load = load <2 x i32>, ptr %19, align 4, !tbaa !8
  %20 = sitofp <2 x i32> %wide.load to <2 x double>
  %21 = fdiv <2 x double> %20, %broadcast.splat
  %22 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %offset.idx
  store <2 x double> %21, ptr %22, align 8, !tbaa !13
  %index.next = add nuw i64 %index, 2
  %23 = icmp eq i64 %index.next, %n.vec
  br i1 %23, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %18
  br i1 %cmp.n, label %.preheader, label %scalar.ph.preheader

.lr.ph58:                                         ; preds = %.preheader51, %.lr.ph58
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %.lr.ph58 ], [ 1, %.preheader51 ]
  %.03857 = phi i32 [ %27, %.lr.ph58 ], [ 0, %.preheader51 ]
  %24 = getelementptr inbounds [1010 x i32], ptr @c, i64 0, i64 %indvars.iv82
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %26 = load i32, ptr %24, align 4, !tbaa !8
  %27 = add nsw i32 %26, %.03857
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %28 = load i32, ptr %1, align 4, !tbaa !8
  %29 = sext i32 %28 to i64
  %.not45.not = icmp slt i64 %indvars.iv82, %29
  br i1 %.not45.not, label %.lr.ph58, label %.preheader50, !llvm.loop !18

.preheader:                                       ; preds = %scalar.ph, %middle.block
  br i1 %.not4661, label %.split.us, label %.preheader.split

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %scalar.ph ], [ %indvars.iv85.ph, %scalar.ph.preheader ]
  %30 = getelementptr inbounds [1010 x i32], ptr @c, i64 0, i64 %indvars.iv85
  %31 = load i32, ptr %30, align 4, !tbaa !8
  %32 = sitofp i32 %31 to double
  %33 = fdiv double %32, %16
  %34 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %indvars.iv85
  store double %33, ptr %34, align 8, !tbaa !13
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %scalar.ph, !llvm.loop !19

.preheader.split:                                 ; preds = %.preheader, %._crit_edge
  %35 = phi i32 [ %39, %._crit_edge ], [ %28, %.preheader ]
  %36 = phi i32 [ %41, %._crit_edge ], [ 99, %.preheader ]
  %.04070 = phi double [ %.040., %._crit_edge ], [ 2.000000e+06, %.preheader ]
  %.04169 = phi double [ %..041, %._crit_edge ], [ 0.000000e+00, %.preheader ]
  %37 = fadd double %.04169, %.04070
  %38 = fmul double %37, 5.000000e-01
  %.not4964 = icmp slt i32 %35, 1
  br i1 %.not4964, label %._crit_edge, label %.lr.ph67

._crit_edge:                                      ; preds = %.lr.ph67, %.preheader.split
  %39 = phi i32 [ %35, %.preheader.split ], [ %51, %.lr.ph67 ]
  %.037.lcssa = phi double [ 0.000000e+00, %.preheader.split ], [ %50, %.lr.ph67 ]
  %40 = fcmp ugt double %.037.lcssa, 1.000000e+00
  %..041 = select i1 %40, double %38, double %.04169
  %.040. = select i1 %40, double %.04070, double %38
  %41 = add nsw i32 %36, -1
  %.not47 = icmp eq i32 %36, 0
  br i1 %.not47, label %.split.us, label %.preheader.split, !llvm.loop !20

.lr.ph67:                                         ; preds = %.preheader.split, %.lr.ph67
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph67 ], [ 1, %.preheader.split ]
  %.03765 = phi double [ %50, %.lr.ph67 ], [ 0.000000e+00, %.preheader.split ]
  %42 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %indvars.iv88
  %43 = load double, ptr %42, align 8, !tbaa !13
  %44 = getelementptr inbounds [1010 x i32], ptr @b, i64 0, i64 %indvars.iv88
  %45 = load i32, ptr %44, align 4, !tbaa !8
  %46 = sitofp i32 %45 to double
  %47 = fmul double %43, %46
  %48 = fdiv double %47, %38
  %49 = call double @sqrt(double noundef %48) #8
  %50 = fadd double %.03765, %49
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %51 = load i32, ptr %1, align 4, !tbaa !8
  %52 = sext i32 %51 to i64
  %.not49.not = icmp slt i64 %indvars.iv88, %52
  br i1 %.not49.not, label %.lr.ph67, label %._crit_edge, !llvm.loop !22

.split.us:                                        ; preds = %._crit_edge, %.preheader50, %0, %.preheader51, %.preheader
  %.0.lcssa96100104 = phi i32 [ %13, %.preheader ], [ %13, %.preheader51 ], [ 0, %0 ], [ %13, %.preheader50 ], [ %13, %._crit_edge ]
  %.us-phi = phi double [ 0.000000e+00, %.preheader ], [ 0.000000e+00, %.preheader51 ], [ 0.000000e+00, %0 ], [ 0.000000e+00, %.preheader50 ], [ %..041, %._crit_edge ]
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt5fixedRSt8ios_base)
  %54 = call i32 @_ZSt12setprecisioni(i32 noundef 10)
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %53, i32 %54)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %55, i32 noundef %.0.lcssa96100104)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %56, i8 noundef signext 32)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %57, double noundef %.us-phi)
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %58, i8 noundef signext 10)
  %60 = load i32, ptr %1, align 4, !tbaa !8
  %.not4871 = icmp slt i32 %60, 1
  br i1 %.not4871, label %._crit_edge75, label %.lr.ph74

._crit_edge75:                                    ; preds = %.lr.ph74, %.split.us
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

.lr.ph74:                                         ; preds = %.split.us, %.lr.ph74
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %.lr.ph74 ], [ 1, %.split.us ]
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt5fixedRSt8ios_base)
  %62 = call i32 @_ZSt12setprecisioni(i32 noundef 10)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %61, i32 %62)
  %64 = getelementptr inbounds [1010 x double], ptr @p, i64 0, i64 %indvars.iv91
  %65 = load double, ptr %64, align 8, !tbaa !13
  %66 = getelementptr inbounds [1010 x i32], ptr @b, i64 0, i64 %indvars.iv91
  %67 = load i32, ptr %66, align 4, !tbaa !8
  %68 = sitofp i32 %67 to double
  %69 = fmul double %65, %68
  %70 = fdiv double %69, %.us-phi
  %71 = call double @sqrt(double noundef %70) #8
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %63, double noundef %71)
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %72, i8 noundef signext 32)
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %74 = load i32, ptr %1, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %.not48.not = icmp slt i64 %indvars.iv91, %75
  br i1 %.not48.not, label %.lr.ph74, label %._crit_edge75, !llvm.loop !23
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt5fixedRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) local_unnamed_addr #7

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #6 align 2

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 = { 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 willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 #7 = { 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 #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !10, i64 0}
!15 = distinct !{!15, !12, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12, !17, !16}
!20 = distinct !{!20, !12, !21}
!21 = !{!"llvm.loop.unswitch.partial.disable"}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


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