; LLVM IR from jgaeddert/liquid-dsp :: sandbox (quasinewton_test)

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

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca i32, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 4, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 10, ptr %3, align 4, !tbaa !5
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = zext i32 %25 to i64
  %27 = call ptr @llvm.stacksave.p0()
  store ptr %27, ptr %4, align 8
  %28 = alloca float, i64 %26, align 16
  store i64 %26, ptr %5, align 8
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = zext i32 %29 to i64
  %31 = alloca float, i64 %30, align 16
  store i64 %30, ptr %6, align 8
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = zext i32 %32 to i64
  %34 = alloca float, i64 %33, align 16
  store i64 %33, ptr %7, align 8
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = zext i32 %35 to i64
  %37 = alloca float, i64 %36, align 16
  store i64 %36, ptr %8, align 8
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = zext i32 %38 to i64
  %40 = alloca float, i64 %39, align 16
  store i64 %39, ptr %9, align 8
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = zext i32 %41 to i64
  %43 = alloca float, i64 %42, align 16
  store i64 %42, ptr %10, align 8
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = mul i32 %44, %45
  %47 = zext i32 %46 to i64
  %48 = alloca float, i64 %47, align 16
  store i64 %47, ptr %11, align 8
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = mul i32 %49, %50
  %52 = zext i32 %51 to i64
  %53 = alloca float, i64 %52, align 16
  store i64 %52, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store float 0x3FC99999A0000000, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %62, %0
  %55 = load i32, ptr %14, align 4, !tbaa !5
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = icmp ult i32 %55, %56
  br i1 %57, label %58, label %65

58:                                               ; preds = %54
  %59 = load i32, ptr %14, align 4, !tbaa !5
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds float, ptr %28, i64 %60
  store float 5.000000e-01, ptr %61, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %58
  %63 = load i32, ptr %14, align 4, !tbaa !5
  %64 = add i32 %63, 1
  store i32 %64, ptr %14, align 4, !tbaa !5
  br label %54, !llvm.loop !11

65:                                               ; preds = %54
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %74, %65
  %67 = load i32, ptr %14, align 4, !tbaa !5
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = icmp ult i32 %67, %68
  br i1 %69, label %70, label %77

70:                                               ; preds = %66
  %71 = load i32, ptr %14, align 4, !tbaa !5
  %72 = zext i32 %71 to i64
  %73 = getelementptr inbounds float, ptr %40, i64 %72
  store float 0.000000e+00, ptr %73, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %70
  %75 = load i32, ptr %14, align 4, !tbaa !5
  %76 = add i32 %75, 1
  store i32 %76, ptr %14, align 4, !tbaa !5
  br label %66, !llvm.loop !13

77:                                               ; preds = %66
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = call i32 @matrixf_eye(ptr noundef %48, i32 noundef %78)
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = call i32 @matrixf_eye(ptr noundef %53, i32 noundef %80)
  %82 = load i32, ptr %2, align 4, !tbaa !5
  call void @estimate_gradient(ptr noundef %28, i32 noundef %82, ptr noundef @myutility, ptr noundef %40)
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = call float @myutility(ptr noundef %28, i32 noundef %84)
  store float %85, ptr %15, align 4, !tbaa !9
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %98, %77
  %88 = load i32, ptr %14, align 4, !tbaa !5
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = icmp ult i32 %88, %89
  br i1 %90, label %91, label %101

91:                                               ; preds = %87
  %92 = load i32, ptr %14, align 4, !tbaa !5
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds float, ptr %28, i64 %93
  %95 = load float, ptr %94, align 4, !tbaa !9
  %96 = fpext float %95 to double
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %96)
  br label %98

98:                                               ; preds = %91
  %99 = load i32, ptr %14, align 4, !tbaa !5
  %100 = add i32 %99, 1
  store i32 %100, ptr %14, align 4, !tbaa !5
  br label %87, !llvm.loop !14

101:                                              ; preds = %87
  %102 = load float, ptr %15, align 4, !tbaa !9
  %103 = fpext float %102 to double
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %103)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %284, %101
  %106 = load i32, ptr %16, align 4, !tbaa !5
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = icmp ult i32 %106, %107
  br i1 %108, label %109, label %287

109:                                              ; preds = %105
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = zext i32 %110 to i64
  %112 = mul i64 %111, 4
  call void @llvm.memmove.p0.p0.i64(ptr align 16 %37, ptr align 16 %40, i64 %112, i1 false)
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = load i32, ptr %2, align 4, !tbaa !5
  %115 = mul i32 %113, %114
  %116 = zext i32 %115 to i64
  %117 = mul i64 %116, 4
  call void @llvm.memmove.p0.p0.i64(ptr align 16 %48, ptr align 16 %53, i64 %117, i1 false)
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = load i32, ptr %2, align 4, !tbaa !5
  %120 = load i32, ptr %2, align 4, !tbaa !5
  %121 = load i32, ptr %2, align 4, !tbaa !5
  %122 = call i32 @matrixf_mul(ptr noundef %48, i32 noundef %118, i32 noundef %119, ptr noundef %37, i32 noundef %120, i32 noundef 1, ptr noundef %31, i32 noundef %121, i32 noundef 1)
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %136, %109
  %124 = load i32, ptr %14, align 4, !tbaa !5
  %125 = load i32, ptr %2, align 4, !tbaa !5
  %126 = icmp ult i32 %124, %125
  br i1 %126, label %127, label %139

127:                                              ; preds = %123
  %128 = load i32, ptr %14, align 4, !tbaa !5
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds float, ptr %31, i64 %129
  %131 = load float, ptr %130, align 4, !tbaa !9
  %132 = fneg float %131
  %133 = load i32, ptr %14, align 4, !tbaa !5
  %134 = zext i32 %133 to i64
  %135 = getelementptr inbounds float, ptr %31, i64 %134
  store float %132, ptr %135, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %127
  %137 = load i32, ptr %14, align 4, !tbaa !5
  %138 = add i32 %137, 1
  store i32 %138, ptr %14, align 4, !tbaa !5
  br label %123, !llvm.loop !15

139:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store float 0.000000e+00, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store float 0.000000e+00, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %140 = load i32, ptr %2, align 4, !tbaa !5
  %141 = call float @myutility(ptr noundef %28, i32 noundef %140)
  store float %141, ptr %19, align 4, !tbaa !9
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %191, %139
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = icmp ult i32 %143, 100
  br i1 %144, label %145, label %194

145:                                              ; preds = %142
  %146 = load i32, ptr %14, align 4, !tbaa !5
  %147 = uitofp i32 %146 to float
  %148 = call float @llvm.fmuladd.f32(float 0x3F847AE140000000, float %147, float 0x3F50624DE0000000)
  store float %148, ptr %13, align 4, !tbaa !9
  %149 = load i32, ptr %2, align 4, !tbaa !5
  %150 = zext i32 %149 to i64
  %151 = call ptr @llvm.stacksave.p0()
  store ptr %151, ptr %20, align 8
  %152 = alloca float, i64 %150, align 16
  store i64 %150, ptr %21, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %171, %145
  %154 = load i32, ptr %22, align 4, !tbaa !5
  %155 = load i32, ptr %2, align 4, !tbaa !5
  %156 = icmp ult i32 %154, %155
  br i1 %156, label %157, label %174

157:                                              ; preds = %153
  %158 = load i32, ptr %22, align 4, !tbaa !5
  %159 = zext i32 %158 to i64
  %160 = getelementptr inbounds float, ptr %28, i64 %159
  %161 = load float, ptr %160, align 4, !tbaa !9
  %162 = load float, ptr %13, align 4, !tbaa !9
  %163 = load i32, ptr %22, align 4, !tbaa !5
  %164 = zext i32 %163 to i64
  %165 = getelementptr inbounds float, ptr %31, i64 %164
  %166 = load float, ptr %165, align 4, !tbaa !9
  %167 = call float @llvm.fmuladd.f32(float %162, float %166, float %161)
  %168 = load i32, ptr %22, align 4, !tbaa !5
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds float, ptr %152, i64 %169
  store float %167, ptr %170, align 4, !tbaa !9
  br label %171

171:                                              ; preds = %157
  %172 = load i32, ptr %22, align 4, !tbaa !5
  %173 = add i32 %172, 1
  store i32 %173, ptr %22, align 4, !tbaa !5
  br label %153, !llvm.loop !16

174:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %175 = load i32, ptr %2, align 4, !tbaa !5
  %176 = call float @myutility(ptr noundef %152, i32 noundef %175)
  store float %176, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %177 = load float, ptr %23, align 4, !tbaa !9
  %178 = load float, ptr %19, align 4, !tbaa !9
  %179 = fsub float %177, %178
  store float %179, ptr %24, align 4, !tbaa !9
  %180 = load i32, ptr %14, align 4, !tbaa !5
  %181 = icmp eq i32 %180, 0
  br i1 %181, label %186, label %182

182:                                              ; preds = %174
  %183 = load float, ptr %24, align 4, !tbaa !9
  %184 = load float, ptr %18, align 4, !tbaa !9
  %185 = fcmp olt float %183, %184
  br i1 %185, label %186, label %189

186:                                              ; preds = %182, %174
  %187 = load float, ptr %13, align 4, !tbaa !9
  store float %187, ptr %17, align 4, !tbaa !9
  %188 = load float, ptr %24, align 4, !tbaa !9
  store float %188, ptr %18, align 4, !tbaa !9
  br label %189

189:                                              ; preds = %186, %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  %190 = load ptr, ptr %20, align 8
  call void @llvm.stackrestore.p0(ptr %190)
  br label %191

191:                                              ; preds = %189
  %192 = load i32, ptr %14, align 4, !tbaa !5
  %193 = add i32 %192, 1
  store i32 %193, ptr %14, align 4, !tbaa !5
  br label %142, !llvm.loop !17

194:                                              ; preds = %142
  %195 = load float, ptr %17, align 4, !tbaa !9
  store float %195, ptr %13, align 4, !tbaa !9
  %196 = load i32, ptr %2, align 4, !tbaa !5
  %197 = load float, ptr %13, align 4, !tbaa !9
  %198 = call i32 @check_wolfe_conditions2(ptr noundef %28, ptr noundef %31, i32 noundef %196, float noundef %197, ptr noundef @myutility)
  %199 = icmp eq i32 %198, 0
  br i1 %199, label %200, label %202

200:                                              ; preds = %194
  %201 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %202

202:                                              ; preds = %200, %194
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %217, %202
  %204 = load i32, ptr %14, align 4, !tbaa !5
  %205 = load i32, ptr %2, align 4, !tbaa !5
  %206 = icmp ult i32 %204, %205
  br i1 %206, label %207, label %220

207:                                              ; preds = %203
  %208 = load float, ptr %13, align 4, !tbaa !9
  %209 = load i32, ptr %14, align 4, !tbaa !5
  %210 = zext i32 %209 to i64
  %211 = getelementptr inbounds float, ptr %31, i64 %210
  %212 = load float, ptr %211, align 4, !tbaa !9
  %213 = fmul float %208, %212
  %214 = load i32, ptr %14, align 4, !tbaa !5
  %215 = zext i32 %214 to i64
  %216 = getelementptr inbounds float, ptr %34, i64 %215
  store float %213, ptr %216, align 4, !tbaa !9
  br label %217

217:                                              ; preds = %207
  %218 = load i32, ptr %14, align 4, !tbaa !5
  %219 = add i32 %218, 1
  store i32 %219, ptr %14, align 4, !tbaa !5
  br label %203, !llvm.loop !18

220:                                              ; preds = %203
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %221

221:                                              ; preds = %235, %220
  %222 = load i32, ptr %14, align 4, !tbaa !5
  %223 = load i32, ptr %2, align 4, !tbaa !5
  %224 = icmp ult i32 %222, %223
  br i1 %224, label %225, label %238

225:                                              ; preds = %221
  %226 = load i32, ptr %14, align 4, !tbaa !5
  %227 = zext i32 %226 to i64
  %228 = getelementptr inbounds float, ptr %34, i64 %227
  %229 = load float, ptr %228, align 4, !tbaa !9
  %230 = load i32, ptr %14, align 4, !tbaa !5
  %231 = zext i32 %230 to i64
  %232 = getelementptr inbounds float, ptr %28, i64 %231
  %233 = load float, ptr %232, align 4, !tbaa !9
  %234 = fadd float %233, %229
  store float %234, ptr %232, align 4, !tbaa !9
  br label %235

235:                                              ; preds = %225
  %236 = load i32, ptr %14, align 4, !tbaa !5
  %237 = add i32 %236, 1
  store i32 %237, ptr %14, align 4, !tbaa !5
  br label %221, !llvm.loop !19

238:                                              ; preds = %221
  %239 = load i32, ptr %2, align 4, !tbaa !5
  call void @estimate_gradient(ptr noundef %28, i32 noundef %239, ptr noundef @myutility, ptr noundef %40)
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %240

240:                                              ; preds = %257, %238
  %241 = load i32, ptr %14, align 4, !tbaa !5
  %242 = load i32, ptr %2, align 4, !tbaa !5
  %243 = icmp ult i32 %241, %242
  br i1 %243, label %244, label %260

244:                                              ; preds = %240
  %245 = load i32, ptr %14, align 4, !tbaa !5
  %246 = zext i32 %245 to i64
  %247 = getelementptr inbounds float, ptr %40, i64 %246
  %248 = load float, ptr %247, align 4, !tbaa !9
  %249 = load i32, ptr %14, align 4, !tbaa !5
  %250 = zext i32 %249 to i64
  %251 = getelementptr inbounds float, ptr %37, i64 %250
  %252 = load float, ptr %251, align 4, !tbaa !9
  %253 = fsub float %248, %252
  %254 = load i32, ptr %14, align 4, !tbaa !5
  %255 = zext i32 %254 to i64
  %256 = getelementptr inbounds float, ptr %43, i64 %255
  store float %253, ptr %256, align 4, !tbaa !9
  br label %257

257:                                              ; preds = %244
  %258 = load i32, ptr %14, align 4, !tbaa !5
  %259 = add i32 %258, 1
  store i32 %259, ptr %14, align 4, !tbaa !5
  br label %240, !llvm.loop !20

260:                                              ; preds = %240
  %261 = load i32, ptr %2, align 4, !tbaa !5
  call void @bfgs_update(i32 noundef %261, ptr noundef %34, ptr noundef %43, ptr noundef %48, ptr noundef %53)
  %262 = load i32, ptr %2, align 4, !tbaa !5
  %263 = call float @myutility(ptr noundef %28, i32 noundef %262)
  store float %263, ptr %15, align 4, !tbaa !9
  %264 = load i32, ptr %16, align 4, !tbaa !5
  %265 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %264)
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %266

266:                                              ; preds = %277, %260
  %267 = load i32, ptr %14, align 4, !tbaa !5
  %268 = load i32, ptr %2, align 4, !tbaa !5
  %269 = icmp ult i32 %267, %268
  br i1 %269, label %270, label %280

270:                                              ; preds = %266
  %271 = load i32, ptr %14, align 4, !tbaa !5
  %272 = zext i32 %271 to i64
  %273 = getelementptr inbounds float, ptr %28, i64 %272
  %274 = load float, ptr %273, align 4, !tbaa !9
  %275 = fpext float %274 to double
  %276 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %275)
  br label %277

277:                                              ; preds = %270
  %278 = load i32, ptr %14, align 4, !tbaa !5
  %279 = add i32 %278, 1
  store i32 %279, ptr %14, align 4, !tbaa !5
  br label %266, !llvm.loop !21

280:                                              ; preds = %266
  %281 = load float, ptr %15, align 4, !tbaa !9
  %282 = fpext float %281 to double
  %283 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %282)
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %284

284:                                              ; preds = %280
  %285 = load i32, ptr %16, align 4, !tbaa !5
  %286 = add i32 %285, 1
  store i32 %286, ptr %16, align 4, !tbaa !5
  br label %105, !llvm.loop !22

287:                                              ; preds = %105
  %288 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, 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
  %289 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %289)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %290 = load i32, ptr %1, align 4
  ret i32 %290
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

declare i32 @matrixf_eye(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @estimate_gradient(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local float @myutility(ptr noundef, i32 noundef) #0

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #4

declare i32 @matrixf_mul(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #3

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

; 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 willreturn
declare void @llvm.stackrestore.p0(ptr) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @check_wolfe_conditions2(ptr noundef, ptr noundef, i32 noundef, float noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @bfgs_update(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !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"

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader99.preheader:
  %0 = alloca [4 x float], align 16
  %1 = alloca [4 x float], align 16
  %2 = alloca [4 x float], align 16
  %3 = alloca [4 x float], align 16
  %4 = alloca [4 x float], align 16
  %5 = alloca [4 x float], align 16
  %6 = alloca [16 x float], align 16
  %7 = alloca [16 x float], align 16
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = getelementptr inbounds i8, ptr %0, i64 12
  store <4 x float> <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>, ptr %0, align 16, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, i8 0, i64 16, i1 false), !tbaa !5
  %11 = call i32 @matrixf_eye(ptr noundef nonnull %6, i32 noundef 4) #8
  %12 = call i32 @matrixf_eye(ptr noundef nonnull %7, i32 noundef 4) #8
  call void @estimate_gradient(ptr noundef nonnull %0, i32 noundef 4, ptr noundef nonnull @myutility, ptr noundef nonnull %4)
  %13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %14 = call float @myutility(ptr noundef nonnull %0, i32 noundef 4)
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %16 = load float, ptr %0, align 16, !tbaa !5
  %17 = fpext float %16 to double
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %17)
  %19 = load float, ptr %8, align 4, !tbaa !5
  %20 = fpext float %19 to double
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %20)
  %22 = load float, ptr %9, align 8, !tbaa !5
  %23 = fpext float %22 to double
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %23)
  %25 = load float, ptr %10, align 4, !tbaa !5
  %26 = fpext float %25 to double
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %26)
  %28 = fpext float %14 to double
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %28)
  br label %.peel.next

.peel.next:                                       ; preds = %.preheader.preheader, %.preheader99.preheader
  %.094112 = phi i32 [ 0, %.preheader99.preheader ], [ %84, %.preheader.preheader ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 16 dereferenceable(16) %4, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %6, ptr noundef nonnull align 16 dereferenceable(64) %7, i64 64, i1 false)
  %30 = call i32 @matrixf_mul(ptr noundef nonnull %6, i32 noundef 4, i32 noundef 4, ptr noundef nonnull %3, i32 noundef 4, i32 noundef 1, ptr noundef nonnull %1, i32 noundef 4, i32 noundef 1) #8
  %31 = load <4 x float>, ptr %1, align 16, !tbaa !5
  %32 = fneg <4 x float> %31
  store <4 x float> %32, ptr %1, align 16, !tbaa !5
  %33 = call float @myutility(ptr noundef nonnull %0, i32 noundef 4)
  %34 = call ptr @llvm.stacksave.p0()
  %35 = alloca [4 x float], align 16
  %36 = load <4 x float>, ptr %0, align 16, !tbaa !5
  %37 = load <4 x float>, ptr %1, align 16, !tbaa !5
  %38 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %37, <4 x float> <float 0x3F50624DE0000000, float 0x3F50624DE0000000, float 0x3F50624DE0000000, float 0x3F50624DE0000000>, <4 x float> %36)
  store <4 x float> %38, ptr %35, align 16, !tbaa !5
  %39 = call float @myutility(ptr noundef nonnull %35, i32 noundef 4)
  call void @llvm.stackrestore.p0(ptr %34)
  %40 = fsub float %39, %33
  br label %41

41:                                               ; preds = %.peel.next, %41
  %.4107 = phi i32 [ 1, %.peel.next ], [ %54, %41 ]
  %.095106 = phi float [ %40, %.peel.next ], [ %.196, %41 ]
  %.097105 = phi float [ 0x3F50624DE0000000, %.peel.next ], [ %.198, %41 ]
  %42 = uitofp nneg i32 %.4107 to float
  %43 = call float @llvm.fmuladd.f32(float %42, float 0x3F847AE140000000, float 0x3F50624DE0000000)
  %44 = call ptr @llvm.stacksave.p0()
  %45 = alloca [4 x float], align 16
  %46 = load <4 x float>, ptr %0, align 16, !tbaa !5
  %47 = load <4 x float>, ptr %1, align 16, !tbaa !5
  %48 = insertelement <4 x float> poison, float %43, i64 0
  %49 = shufflevector <4 x float> %48, <4 x float> poison, <4 x i32> zeroinitializer
  %50 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %49, <4 x float> %47, <4 x float> %46)
  store <4 x float> %50, ptr %45, align 16, !tbaa !5
  %51 = call float @myutility(ptr noundef nonnull %45, i32 noundef 4)
  %52 = fsub float %51, %33
  %53 = fcmp olt float %52, %.095106
  %.198 = select i1 %53, float %43, float %.097105
  %.196 = select i1 %53, float %52, float %.095106
  call void @llvm.stackrestore.p0(ptr %44)
  %54 = add nuw nsw i32 %.4107, 1
  %exitcond.not = icmp eq i32 %54, 100
  br i1 %exitcond.not, label %.loopexit, label %41, !llvm.loop !9

.loopexit:                                        ; preds = %41
  %55 = call i32 @check_wolfe_conditions2(ptr noundef nonnull %0, ptr noundef nonnull %1, i32 noundef 4, float noundef %.198, ptr noundef nonnull @myutility)
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %.preheader.preheader

57:                                               ; preds = %.loopexit
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %.preheader.preheader

.preheader.preheader:                             ; preds = %57, %.loopexit
  %59 = load <4 x float>, ptr %1, align 16, !tbaa !5
  %60 = insertelement <4 x float> poison, float %.198, i64 0
  %61 = shufflevector <4 x float> %60, <4 x float> poison, <4 x i32> zeroinitializer
  %62 = fmul <4 x float> %61, %59
  store <4 x float> %62, ptr %2, align 16, !tbaa !5
  %63 = load <4 x float>, ptr %0, align 16, !tbaa !5
  %64 = fadd <4 x float> %62, %63
  store <4 x float> %64, ptr %0, align 16, !tbaa !5
  call void @estimate_gradient(ptr noundef nonnull %0, i32 noundef 4, ptr noundef nonnull @myutility, ptr noundef nonnull %4)
  %65 = load <4 x float>, ptr %4, align 16, !tbaa !5
  %66 = load <4 x float>, ptr %3, align 16, !tbaa !5
  %67 = fsub <4 x float> %65, %66
  store <4 x float> %67, ptr %5, align 16, !tbaa !5
  call void @bfgs_update(i32 noundef 4, ptr noundef nonnull %2, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %68 = call float @myutility(ptr noundef nonnull %0, i32 noundef 4)
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %.094112)
  %70 = load float, ptr %0, align 16, !tbaa !5
  %71 = fpext float %70 to double
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %71)
  %73 = load float, ptr %8, align 4, !tbaa !5
  %74 = fpext float %73 to double
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %74)
  %76 = load float, ptr %9, align 8, !tbaa !5
  %77 = fpext float %76 to double
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %77)
  %79 = load float, ptr %10, align 4, !tbaa !5
  %80 = fpext float %79 to double
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %80)
  %82 = fpext float %68 to double
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %82)
  %84 = add nuw nsw i32 %.094112, 1
  %exitcond127.not = icmp eq i32 %84, 10
  br i1 %exitcond127.not, label %85, label %.peel.next, !llvm.loop !12

85:                                               ; preds = %.preheader.preheader
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #1

declare i32 @matrixf_eye(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @estimate_gradient(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local float @myutility(ptr noundef, i32 noundef) #0

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

declare i32 @matrixf_mul(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @check_wolfe_conditions2(ptr noundef, ptr noundef, i32 noundef, float noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @bfgs_update(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

attributes #0 = { 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 }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass