; LLVM IR from softmin/ReHLine-SVM :: liblinear/newton.ll (ZN6NEWTON6newtonEPd)

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

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [52 x i8], align 1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, ...) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6NEWTON6newtonEPd(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %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 double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca double, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %24 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %25 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 3
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds ptr, ptr %27, i64 3
  %29 = load ptr, ptr %28, align 8
  %30 = call noundef i32 %29(ptr noundef nonnull align 8 dereferenceable(8) %26)
  store i32 %30, ptr %5, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store double 1.000000e+00, ptr %12, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 1, ptr %13, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1, ptr %14, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 1, ptr %15, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %31 = load i32, ptr %5, align 4, !tbaa !15
  %32 = sext i32 %31 to i64
  %33 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %32, i64 8)
  %34 = extractvalue { i64, i1 } %33, 1
  %35 = extractvalue { i64, i1 } %33, 0
  %36 = select i1 %34, i64 -1, i64 %35
  %37 = call noalias noundef nonnull ptr @_Znam(i64 noundef %36) #7
  store ptr %37, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %38 = load i32, ptr %5, align 4, !tbaa !15
  %39 = sext i32 %38 to i64
  %40 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %39, i64 8)
  %41 = extractvalue { i64, i1 } %40, 1
  %42 = extractvalue { i64, i1 } %40, 0
  %43 = select i1 %41, i64 -1, i64 %42
  %44 = call noalias noundef nonnull ptr @_Znam(i64 noundef %43) #7
  store ptr %44, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %45 = load i32, ptr %5, align 4, !tbaa !15
  %46 = sext i32 %45 to i64
  %47 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %46, i64 8)
  %48 = extractvalue { i64, i1 } %47, 1
  %49 = extractvalue { i64, i1 } %47, 0
  %50 = select i1 %48, i64 -1, i64 %49
  %51 = call noalias noundef nonnull ptr @_Znam(i64 noundef %50) #7
  store ptr %51, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store double 1.000000e-02, ptr %19, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %52 = load i32, ptr %5, align 4, !tbaa !15
  %53 = sext i32 %52 to i64
  %54 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %53, i64 8)
  %55 = extractvalue { i64, i1 } %54, 1
  %56 = extractvalue { i64, i1 } %54, 0
  %57 = select i1 %55, i64 -1, i64 %56
  %58 = call noalias noundef nonnull ptr @_Znam(i64 noundef %57) #7
  store ptr %58, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %59 = load i32, ptr %5, align 4, !tbaa !15
  %60 = sext i32 %59 to i64
  %61 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %60, i64 8)
  %62 = extractvalue { i64, i1 } %61, 1
  %63 = extractvalue { i64, i1 } %61, 0
  %64 = select i1 %62, i64 -1, i64 %63
  %65 = call noalias noundef nonnull ptr @_Znam(i64 noundef %64) #7
  store ptr %65, ptr %21, align 8, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !15
  br label %66

66:                                               ; preds = %75, %2
  %67 = load i32, ptr %6, align 4, !tbaa !15
  %68 = load i32, ptr %5, align 4, !tbaa !15
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %70, label %78

70:                                               ; preds = %66
  %71 = load ptr, ptr %21, align 8, !tbaa !5
  %72 = load i32, ptr %6, align 4, !tbaa !15
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds double, ptr %71, i64 %73
  store double 0.000000e+00, ptr %74, align 8, !tbaa !16
  br label %75

75:                                               ; preds = %70
  %76 = load i32, ptr %6, align 4, !tbaa !15
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %6, align 4, !tbaa !15
  br label %66, !llvm.loop !17

78:                                               ; preds = %66
  %79 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = load ptr, ptr %21, align 8, !tbaa !5
  %82 = load ptr, ptr %80, align 8, !tbaa !13
  %83 = getelementptr inbounds ptr, ptr %82, i64 0
  %84 = load ptr, ptr %83, align 8
  %85 = call noundef double %84(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef %81)
  %86 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 3
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = load ptr, ptr %21, align 8, !tbaa !5
  %89 = load ptr, ptr %18, align 8, !tbaa !5
  %90 = load ptr, ptr %87, align 8, !tbaa !13
  %91 = getelementptr inbounds ptr, ptr %90, i64 1
  %92 = load ptr, ptr %91, align 8
  call void %92(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef %88, ptr noundef %89)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %93 = load ptr, ptr %18, align 8, !tbaa !5
  %94 = call double @dnrm2_(ptr noundef %5, ptr noundef %93, ptr noundef %15)
  store double %94, ptr %22, align 8, !tbaa !16
  %95 = load ptr, ptr %21, align 8, !tbaa !5
  %96 = icmp eq ptr %95, null
  br i1 %96, label %98, label %97

97:                                               ; preds = %78
  call void @_ZdaPv(ptr noundef %95) #8
  br label %98

98:                                               ; preds = %97, %78
  %99 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 3
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = load ptr, ptr %100, align 8, !tbaa !13
  %103 = getelementptr inbounds ptr, ptr %102, i64 0
  %104 = load ptr, ptr %103, align 8
  %105 = call noundef double %104(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef %101)
  store double %105, ptr %9, align 8, !tbaa !16
  %106 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 3
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = load ptr, ptr %18, align 8, !tbaa !5
  %110 = load ptr, ptr %107, align 8, !tbaa !13
  %111 = getelementptr inbounds ptr, ptr %110, i64 1
  %112 = load ptr, ptr %111, align 8
  call void %112(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef %108, ptr noundef %109)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %113 = load ptr, ptr %18, align 8, !tbaa !5
  %114 = call double @dnrm2_(ptr noundef %5, ptr noundef %113, ptr noundef %15)
  store double %114, ptr %23, align 8, !tbaa !16
  %115 = load double, ptr %9, align 8, !tbaa !16
  %116 = load double, ptr %23, align 8, !tbaa !16
  call void (ptr, ptr, ...) @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef @.str, double noundef %115, double noundef %116)
  %117 = load double, ptr %23, align 8, !tbaa !16
  %118 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 0
  %119 = load double, ptr %118, align 8, !tbaa !19
  %120 = load double, ptr %22, align 8, !tbaa !16
  %121 = fmul double %119, %120
  %122 = fcmp ole double %117, %121
  br i1 %122, label %123, label %124

123:                                              ; preds = %98
  store i32 0, ptr %13, align 4, !tbaa !15
  br label %124

124:                                              ; preds = %123, %98
  br label %125

125:                                              ; preds = %217, %124
  %126 = load i32, ptr %14, align 4, !tbaa !15
  %127 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 2
  %128 = load i32, ptr %127, align 8, !tbaa !20
  %129 = icmp sle i32 %126, %128
  br i1 %129, label %130, label %133

130:                                              ; preds = %125
  %131 = load i32, ptr %13, align 4, !tbaa !15
  %132 = icmp ne i32 %131, 0
  br label %133

133:                                              ; preds = %130, %125
  %134 = phi i1 [ false, %125 ], [ %132, %130 ]
  br i1 %134, label %135, label %220

135:                                              ; preds = %133
  %136 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 3
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  %138 = load ptr, ptr %20, align 8, !tbaa !5
  %139 = load ptr, ptr %137, align 8, !tbaa !13
  %140 = getelementptr inbounds ptr, ptr %139, i64 4
  %141 = load ptr, ptr %140, align 8
  call void %141(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef %138)
  store i32 0, ptr %6, align 4, !tbaa !15
  br label %142

142:                                              ; preds = %157, %135
  %143 = load i32, ptr %6, align 4, !tbaa !15
  %144 = load i32, ptr %5, align 4, !tbaa !15
  %145 = icmp slt i32 %143, %144
  br i1 %145, label %146, label %160

146:                                              ; preds = %142
  %147 = load ptr, ptr %20, align 8, !tbaa !5
  %148 = load i32, ptr %6, align 4, !tbaa !15
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds double, ptr %147, i64 %149
  %151 = load double, ptr %150, align 8, !tbaa !16
  %152 = call double @llvm.fmuladd.f64(double 1.000000e-02, double %151, double 0x3FEFAE147AE147AE)
  %153 = load ptr, ptr %20, align 8, !tbaa !5
  %154 = load i32, ptr %6, align 4, !tbaa !15
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds double, ptr %153, i64 %155
  store double %152, ptr %156, align 8, !tbaa !16
  br label %157

157:                                              ; preds = %146
  %158 = load i32, ptr %6, align 4, !tbaa !15
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %6, align 4, !tbaa !15
  br label %142, !llvm.loop !21

160:                                              ; preds = %142
  %161 = load ptr, ptr %18, align 8, !tbaa !5
  %162 = load ptr, ptr %20, align 8, !tbaa !5
  %163 = load ptr, ptr %16, align 8, !tbaa !5
  %164 = load ptr, ptr %17, align 8, !tbaa !5
  %165 = call noundef i32 @_ZN6NEWTON3pcgEPdS0_S0_S0_(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef %161, ptr noundef %162, ptr noundef %163, ptr noundef %164)
  store i32 %165, ptr %7, align 4, !tbaa !15
  %166 = load double, ptr %9, align 8, !tbaa !16
  store double %166, ptr %10, align 8, !tbaa !16
  %167 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 3
  %168 = load ptr, ptr %167, align 8, !tbaa !9
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = load ptr, ptr %16, align 8, !tbaa !5
  %171 = load ptr, ptr %18, align 8, !tbaa !5
  %172 = load double, ptr %12, align 8, !tbaa !16
  %173 = load ptr, ptr %168, align 8, !tbaa !13
  %174 = getelementptr inbounds ptr, ptr %173, i64 7
  %175 = load ptr, ptr %174, align 8
  %176 = call noundef double %175(ptr noundef nonnull align 8 dereferenceable(8) %168, ptr noundef %169, ptr noundef %170, ptr noundef %9, ptr noundef %171, double noundef %172)
  store double %176, ptr %8, align 8, !tbaa !16
  %177 = load double, ptr %8, align 8, !tbaa !16
  %178 = fcmp oeq double %177, 0.000000e+00
  br i1 %178, label %179, label %180

179:                                              ; preds = %160
  call void (ptr, ptr, ...) @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef @.str.1)
  br label %220

180:                                              ; preds = %160
  %181 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 3
  %182 = load ptr, ptr %181, align 8, !tbaa !9
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = load ptr, ptr %18, align 8, !tbaa !5
  %185 = load ptr, ptr %182, align 8, !tbaa !13
  %186 = getelementptr inbounds ptr, ptr %185, i64 1
  %187 = load ptr, ptr %186, align 8
  call void %187(ptr noundef nonnull align 8 dereferenceable(8) %182, ptr noundef %183, ptr noundef %184)
  %188 = load ptr, ptr %18, align 8, !tbaa !5
  %189 = call double @dnrm2_(ptr noundef %5, ptr noundef %188, ptr noundef %15)
  store double %189, ptr %23, align 8, !tbaa !16
  %190 = load i32, ptr %14, align 4, !tbaa !15
  %191 = load double, ptr %9, align 8, !tbaa !16
  %192 = load double, ptr %23, align 8, !tbaa !16
  %193 = load i32, ptr %7, align 4, !tbaa !15
  %194 = load double, ptr %8, align 8, !tbaa !16
  call void (ptr, ptr, ...) @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef @.str.2, i32 noundef %190, double noundef %191, double noundef %192, i32 noundef %193, double noundef %194)
  %195 = load double, ptr %23, align 8, !tbaa !16
  %196 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 0
  %197 = load double, ptr %196, align 8, !tbaa !19
  %198 = load double, ptr %22, align 8, !tbaa !16
  %199 = fmul double %197, %198
  %200 = fcmp ole double %195, %199
  br i1 %200, label %201, label %202

201:                                              ; preds = %180
  br label %220

202:                                              ; preds = %180
  %203 = load double, ptr %9, align 8, !tbaa !16
  %204 = fcmp olt double %203, -1.000000e+32
  br i1 %204, label %205, label %206

205:                                              ; preds = %202
  call void (ptr, ptr, ...) @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef @.str.3)
  br label %220

206:                                              ; preds = %202
  %207 = load double, ptr %10, align 8, !tbaa !16
  %208 = load double, ptr %9, align 8, !tbaa !16
  %209 = fsub double %207, %208
  store double %209, ptr %11, align 8, !tbaa !16
  %210 = load double, ptr %11, align 8, !tbaa !16
  %211 = call double @llvm.fabs.f64(double %210)
  %212 = load double, ptr %9, align 8, !tbaa !16
  %213 = call double @llvm.fabs.f64(double %212)
  %214 = fmul double 0x3D719799812DEA11, %213
  %215 = fcmp ole double %211, %214
  br i1 %215, label %216, label %217

216:                                              ; preds = %206
  call void (ptr, ptr, ...) @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef @.str.4)
  br label %220

217:                                              ; preds = %206
  %218 = load i32, ptr %14, align 4, !tbaa !15
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %14, align 4, !tbaa !15
  br label %125, !llvm.loop !22

220:                                              ; preds = %216, %205, %201, %179, %133
  %221 = load i32, ptr %14, align 4, !tbaa !15
  %222 = getelementptr inbounds %class.NEWTON, ptr %24, i32 0, i32 2
  %223 = load i32, ptr %222, align 8, !tbaa !20
  %224 = icmp sge i32 %221, %223
  br i1 %224, label %225, label %226

225:                                              ; preds = %220
  call void (ptr, ptr, ...) @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef @.str.5)
  br label %226

226:                                              ; preds = %225, %220
  %227 = load ptr, ptr %18, align 8, !tbaa !5
  %228 = icmp eq ptr %227, null
  br i1 %228, label %230, label %229

229:                                              ; preds = %226
  call void @_ZdaPv(ptr noundef %227) #8
  br label %230

230:                                              ; preds = %229, %226
  %231 = load ptr, ptr %17, align 8, !tbaa !5
  %232 = icmp eq ptr %231, null
  br i1 %232, label %234, label %233

233:                                              ; preds = %230
  call void @_ZdaPv(ptr noundef %231) #8
  br label %234

234:                                              ; preds = %233, %230
  %235 = load ptr, ptr %16, align 8, !tbaa !5
  %236 = icmp eq ptr %235, null
  br i1 %236, label %238, label %237

237:                                              ; preds = %234
  call void @_ZdaPv(ptr noundef %235) #8
  br label %238

238:                                              ; preds = %237, %234
  %239 = load ptr, ptr %20, align 8, !tbaa !5
  %240 = icmp eq ptr %239, null
  br i1 %240, label %242, label %241

241:                                              ; preds = %238
  call void @_ZdaPv(ptr noundef %239) #8
  br label %242

242:                                              ; preds = %241, %238
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret void
}

declare double @dnrm2_(ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN6NEWTON3pcgEPdS0_S0_S0_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { nobuiltin 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 = { 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 = { "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 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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, !6, i64 24}
!10 = !{!"_ZTS6NEWTON", !11, i64 0, !11, i64 8, !12, i64 16, !6, i64 24, !6, i64 32}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!12, !12, i64 0}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !11, i64 0}
!20 = !{!10, !12, i64 16}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}


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

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [52 x i8], align 1

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, ...) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6NEWTON6newtonEPd(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1) local_unnamed_addr #4 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr %7, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %8, i64 24
  %10 = load ptr, ptr %9, align 8
  %11 = tail call noundef i32 %10(ptr noundef nonnull align 8 dereferenceable(8) %7)
  store i32 %11, ptr %3, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 1, ptr %5, align 4, !tbaa !14
  %12 = zext i32 %11 to i64
  %13 = icmp slt i32 %11, 0
  %14 = shl nuw nsw i64 %12, 3
  %15 = select i1 %13, i64 -1, i64 %14
  %16 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %15) #9
  %17 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %15) #9
  %18 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %15) #9
  %19 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %15) #9
  %20 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %15) #9
  %21 = icmp sgt i32 %11, 0
  br i1 %21, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 %20, i8 0, i64 %14, i1 false), !tbaa !15
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %2
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %22, align 8, !tbaa !12
  %24 = load ptr, ptr %23, align 8
  %25 = tail call noundef double %24(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull %20)
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %26, align 8, !tbaa !12
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %29 = load ptr, ptr %28, align 8
  tail call void %29(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull %20, ptr noundef nonnull %18)
  %30 = call double @dnrm2_(ptr noundef nonnull %3, ptr noundef nonnull %18, ptr noundef nonnull %5)
  call void @_ZdaPv(ptr noundef nonnull %20) #10
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %31, align 8, !tbaa !12
  %33 = load ptr, ptr %32, align 8
  %34 = call noundef double %33(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef %1)
  store double %34, ptr %4, align 8, !tbaa !15
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %35, align 8, !tbaa !12
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = load ptr, ptr %37, align 8
  call void %38(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef %1, ptr noundef nonnull %18)
  %39 = call double @dnrm2_(ptr noundef nonnull %3, ptr noundef nonnull %18, ptr noundef nonnull %5)
  call void (ptr, ptr, ...) @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull @.str, double noundef %34, double noundef %39)
  %40 = load double, ptr %0, align 8, !tbaa !16
  %41 = fmul double %30, %40
  %42 = fcmp ugt double %39, %41
  %43 = getelementptr inbounds i8, ptr %0, i64 16
  %44 = load i32, ptr %43, align 8, !tbaa !17
  %45 = icmp sgt i32 %44, 0
  %46 = and i1 %42, %45
  br i1 %46, label %.lr.ph69, label %.loopexit

.lr.ph69:                                         ; preds = %._crit_edge, %88
  %.05267 = phi i32 [ %89, %88 ], [ 1, %._crit_edge ]
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = load ptr, ptr %47, align 8, !tbaa !12
  %49 = getelementptr inbounds i8, ptr %48, i64 32
  %50 = load ptr, ptr %49, align 8
  call void %50(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef nonnull %19)
  %51 = load i32, ptr %3, align 4, !tbaa !14
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph65.preheader, label %._crit_edge66

.lr.ph65.preheader:                               ; preds = %.lr.ph69
  %wide.trip.count = zext nneg i32 %51 to i64
  %min.iters.check = icmp ult i32 %51, 4
  br i1 %min.iters.check, label %.lr.ph65.preheader82, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph65.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %53 = getelementptr inbounds double, ptr %19, i64 %index
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  %wide.load = load <2 x double>, ptr %53, align 8, !tbaa !15
  %wide.load81 = load <2 x double>, ptr %54, align 8, !tbaa !15
  %55 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load, <2 x double> <double 1.000000e-02, double 1.000000e-02>, <2 x double> <double 0x3FEFAE147AE147AE, double 0x3FEFAE147AE147AE>)
  %56 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %wide.load81, <2 x double> <double 1.000000e-02, double 1.000000e-02>, <2 x double> <double 0x3FEFAE147AE147AE, double 0x3FEFAE147AE147AE>)
  store <2 x double> %55, ptr %53, align 8, !tbaa !15
  store <2 x double> %56, ptr %54, align 8, !tbaa !15
  %index.next = add nuw i64 %index, 4
  %57 = icmp eq i64 %index.next, %n.vec
  br i1 %57, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge66, label %.lr.ph65.preheader82

.lr.ph65.preheader82:                             ; preds = %middle.block, %.lr.ph65.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph65.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph65

.lr.ph65:                                         ; preds = %.lr.ph65.preheader82, %.lr.ph65
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph65 ], [ %indvars.iv.ph, %.lr.ph65.preheader82 ]
  %58 = getelementptr inbounds double, ptr %19, i64 %indvars.iv
  %59 = load double, ptr %58, align 8, !tbaa !15
  %60 = call double @llvm.fmuladd.f64(double %59, double 1.000000e-02, double 0x3FEFAE147AE147AE)
  store double %60, ptr %58, align 8, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge66, label %.lr.ph65, !llvm.loop !22

._crit_edge66:                                    ; preds = %.lr.ph65, %middle.block, %.lr.ph69
  %61 = call noundef i32 @_ZN6NEWTON3pcgEPdS0_S0_S0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull %18, ptr noundef nonnull %19, ptr noundef nonnull %16, ptr noundef nonnull %17)
  %62 = load double, ptr %4, align 8, !tbaa !15
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = load ptr, ptr %63, align 8, !tbaa !12
  %65 = getelementptr inbounds i8, ptr %64, i64 56
  %66 = load ptr, ptr %65, align 8
  %67 = call noundef double %66(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef %1, ptr noundef nonnull %16, ptr noundef nonnull %4, ptr noundef nonnull %18, double noundef 1.000000e+00)
  %68 = fcmp oeq double %67, 0.000000e+00
  br i1 %68, label %.loopexit.sink.split, label %69

69:                                               ; preds = %._crit_edge66
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load ptr, ptr %70, align 8, !tbaa !12
  %72 = getelementptr inbounds i8, ptr %71, i64 8
  %73 = load ptr, ptr %72, align 8
  call void %73(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef %1, ptr noundef nonnull %18)
  %74 = call double @dnrm2_(ptr noundef nonnull %3, ptr noundef nonnull %18, ptr noundef nonnull %5)
  %75 = load double, ptr %4, align 8, !tbaa !15
  call void (ptr, ptr, ...) @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull @.str.2, i32 noundef %.05267, double noundef %75, double noundef %74, i32 noundef %61, double noundef %67)
  %76 = load double, ptr %0, align 8, !tbaa !16
  %77 = fmul double %30, %76
  %78 = fcmp ugt double %74, %77
  br i1 %78, label %79, label %.loopexit

79:                                               ; preds = %69
  %80 = load double, ptr %4, align 8, !tbaa !15
  %81 = fcmp olt double %80, -1.000000e+32
  br i1 %81, label %.loopexit.sink.split, label %82

82:                                               ; preds = %79
  %83 = fsub double %62, %80
  %84 = call double @llvm.fabs.f64(double %83)
  %85 = call double @llvm.fabs.f64(double %80)
  %86 = fmul double %85, 0x3D719799812DEA11
  %87 = fcmp ugt double %84, %86
  br i1 %87, label %88, label %.loopexit.sink.split

88:                                               ; preds = %82
  %89 = add nuw nsw i32 %.05267, 1
  %90 = load i32, ptr %43, align 8, !tbaa !17
  %91 = icmp slt i32 %.05267, %90
  br i1 %91, label %.lr.ph69, label %.loopexit, !llvm.loop !23

.loopexit.sink.split:                             ; preds = %82, %79, %._crit_edge66
  %.str.4.sink = phi ptr [ @.str.1, %._crit_edge66 ], [ @.str.3, %79 ], [ @.str.4, %82 ]
  call void (ptr, ptr, ...) @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull %.str.4.sink)
  br label %.loopexit

.loopexit:                                        ; preds = %88, %69, %.loopexit.sink.split, %._crit_edge
  %.05261 = phi i32 [ 1, %._crit_edge ], [ %.05267, %.loopexit.sink.split ], [ %89, %88 ], [ %.05267, %69 ]
  %92 = load i32, ptr %43, align 8, !tbaa !17
  %.not = icmp slt i32 %.05261, %92
  br i1 %.not, label %94, label %93

93:                                               ; preds = %.loopexit
  call void (ptr, ptr, ...) @_ZN6NEWTON4infoEPKcz(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull @.str.5)
  br label %94

94:                                               ; preds = %.loopexit, %93
  call void @_ZdaPv(ptr noundef nonnull %18) #10
  call void @_ZdaPv(ptr noundef nonnull %17) #10
  call void @_ZdaPv(ptr noundef nonnull %16) #10
  call void @_ZdaPv(ptr noundef nonnull %19) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  ret void
}

declare double @dnrm2_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN6NEWTON3pcgEPdS0_S0_S0_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nobuiltin 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 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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, !11, i64 24}
!6 = !{!"_ZTS6NEWTON", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !11, i64 32}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"vtable pointer", !9, i64 0}
!14 = !{!10, !10, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!6, !7, i64 0}
!17 = !{!6, !10, i64 16}
!18 = distinct !{!18, !19, !20, !21}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !19, !21, !20}
!23 = distinct !{!23, !19}


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