; LLVM IR from NishkarshRaj/Design-and-Analysis-of-Algorithms :: greedy (fractionalknapsack)

; 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 [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [41 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 i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %2)
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = zext i32 %16 to i64
  %18 = call ptr @llvm.stacksave.p0()
  store ptr %18, ptr %7, align 8
  %19 = alloca i32, i64 %17, align 16
  store i64 %17, ptr %8, align 8
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = zext i32 %20 to i64
  %22 = alloca i32, i64 %21, align 16
  store i64 %21, ptr %9, align 8
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = zext i32 %23 to i64
  %25 = alloca i32, i64 %24, align 16
  store i64 %24, ptr %10, align 8
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = zext i32 %26 to i64
  %28 = alloca float, i64 %27, align 16
  store i64 %27, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store float 0.000000e+00, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %65, %0
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %33, label %68

33:                                               ; preds = %29
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %35)
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %25, i64 %39
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %40)
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr %19, i64 %44
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %45)
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i32, ptr %22, i64 %49
  %51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %50)
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %19, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i32, ptr %22, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sdiv i32 %55, %59
  %61 = sitofp i32 %60 to float
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds float, ptr %28, i64 %63
  store float %61, ptr %64, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %33
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %3, align 4, !tbaa !5
  br label %29, !llvm.loop !11

68:                                               ; preds = %29
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %71 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4)
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %159, %68
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %77, label %162

77:                                               ; preds = %73
  %78 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %78, ptr %6, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %155, %77
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %83, label %158

83:                                               ; preds = %79
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds float, ptr %28, i64 %85
  %87 = load float, ptr %86, align 4, !tbaa !9
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds float, ptr %28, i64 %89
  %91 = load float, ptr %90, align 4, !tbaa !9
  %92 = fcmp olt float %87, %91
  br i1 %92, label %93, label %154

93:                                               ; preds = %83
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds float, ptr %28, i64 %95
  %97 = load float, ptr %96, align 4, !tbaa !9
  store float %97, ptr %12, align 4, !tbaa !9
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds float, ptr %28, i64 %99
  %101 = load float, ptr %100, align 4, !tbaa !9
  %102 = load i32, ptr %3, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds float, ptr %28, i64 %103
  store float %101, ptr %104, align 4, !tbaa !9
  %105 = load float, ptr %12, align 4, !tbaa !9
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds float, ptr %28, i64 %107
  store float %105, ptr %108, align 4, !tbaa !9
  %109 = load i32, ptr %3, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds i32, ptr %19, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  store i32 %112, ptr %5, align 4, !tbaa !5
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %19, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i32, ptr %19, i64 %118
  store i32 %116, ptr %119, align 4, !tbaa !5
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i32, ptr %19, i64 %122
  store i32 %120, ptr %123, align 4, !tbaa !5
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i32, ptr %22, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  store i32 %127, ptr %5, align 4, !tbaa !5
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr %22, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = load i32, ptr %3, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %22, i64 %133
  store i32 %131, ptr %134, align 4, !tbaa !5
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = load i32, ptr %6, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds i32, ptr %22, i64 %137
  store i32 %135, ptr %138, align 4, !tbaa !5
  %139 = load i32, ptr %3, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds i32, ptr %25, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  store i32 %142, ptr %5, align 4, !tbaa !5
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %25, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = load i32, ptr %3, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i32, ptr %25, i64 %148
  store i32 %146, ptr %149, align 4, !tbaa !5
  %150 = load i32, ptr %5, align 4, !tbaa !5
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds i32, ptr %25, i64 %152
  store i32 %150, ptr %153, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %93, %83
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %6, align 4, !tbaa !5
  br label %79, !llvm.loop !13

158:                                              ; preds = %79
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %3, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %3, align 4, !tbaa !5
  br label %73, !llvm.loop !14

162:                                              ; preds = %73
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %188, %162
  %166 = load i32, ptr %3, align 4, !tbaa !5
  %167 = load i32, ptr %2, align 4, !tbaa !5
  %168 = icmp slt i32 %166, %167
  br i1 %168, label %169, label %191

169:                                              ; preds = %165
  %170 = load i32, ptr %3, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds i32, ptr %25, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = load i32, ptr %3, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds i32, ptr %19, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = load i32, ptr %3, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i32, ptr %22, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = load i32, ptr %3, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds float, ptr %28, i64 %183
  %185 = load float, ptr %184, align 4, !tbaa !9
  %186 = fpext float %185 to double
  %187 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %173, i32 noundef %177, i32 noundef %181, double noundef %186)
  br label %188

188:                                              ; preds = %169
  %189 = load i32, ptr %3, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %3, align 4, !tbaa !5
  br label %165, !llvm.loop !15

191:                                              ; preds = %165
  br label %192

192:                                              ; preds = %239, %191
  %193 = load i32, ptr %4, align 4, !tbaa !5
  %194 = icmp sgt i32 %193, 0
  br i1 %194, label %195, label %240

195:                                              ; preds = %192
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %236, %195
  %197 = load i32, ptr %3, align 4, !tbaa !5
  %198 = load i32, ptr %2, align 4, !tbaa !5
  %199 = icmp slt i32 %197, %198
  br i1 %199, label %200, label %239

200:                                              ; preds = %196
  %201 = load i32, ptr %4, align 4, !tbaa !5
  %202 = icmp eq i32 %201, 0
  br i1 %202, label %203, label %204

203:                                              ; preds = %200
  br label %239

204:                                              ; preds = %200
  %205 = load i32, ptr %4, align 4, !tbaa !5
  %206 = load i32, ptr %3, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds i32, ptr %22, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = icmp sgt i32 %205, %209
  br i1 %210, label %211, label %225

211:                                              ; preds = %204
  %212 = load i32, ptr %4, align 4, !tbaa !5
  %213 = load i32, ptr %3, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds i32, ptr %22, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = sub nsw i32 %212, %216
  store i32 %217, ptr %4, align 4, !tbaa !5
  %218 = load float, ptr %13, align 4, !tbaa !9
  %219 = load i32, ptr %3, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds i32, ptr %19, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = sitofp i32 %222 to float
  %224 = fadd float %218, %223
  store float %224, ptr %13, align 4, !tbaa !9
  br label %234

225:                                              ; preds = %204
  %226 = load float, ptr %13, align 4, !tbaa !9
  %227 = load i32, ptr %3, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds float, ptr %28, i64 %228
  %230 = load float, ptr %229, align 4, !tbaa !9
  %231 = load i32, ptr %4, align 4, !tbaa !5
  %232 = sitofp i32 %231 to float
  %233 = call float @llvm.fmuladd.f32(float %230, float %232, float %226)
  store float %233, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %234

234:                                              ; preds = %225, %211
  br label %235

235:                                              ; preds = %234
  br label %236

236:                                              ; preds = %235
  %237 = load i32, ptr %3, align 4, !tbaa !5
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %3, align 4, !tbaa !5
  br label %196, !llvm.loop !16

239:                                              ; preds = %203, %196
  br label %192, !llvm.loop !17

240:                                              ; preds = %192
  %241 = load float, ptr %13, align 4, !tbaa !9
  %242 = fpext float %241 to double
  %243 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, double noundef %242)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %244 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %244)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %245 = load i32, ptr %1, align 4
  ret i32 %245
}

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

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

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

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

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

; 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) #3

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


; 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 [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = zext i32 %5 to i64
  %7 = call ptr @llvm.stacksave.p0()
  %8 = alloca i32, i64 %6, align 16
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = zext i32 %9 to i64
  %11 = alloca i32, i64 %10, align 16
  %12 = alloca i32, i64 %10, align 16
  %13 = alloca float, i64 %10, align 16
  %14 = icmp sgt i32 %9, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = trunc nuw nsw i64 %indvars.iv.next to i32
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %18 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %18)
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %21 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %21)
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %24 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %24)
  %26 = load i32, ptr %21, align 4, !tbaa !5
  %27 = load i32, ptr %24, align 4, !tbaa !5
  %28 = sdiv i32 %26, %27
  %29 = sitofp i32 %28 to float
  %30 = getelementptr inbounds float, ptr %13, i64 %indvars.iv
  store float %29, ptr %30, align 4, !tbaa !9
  %31 = load i32, ptr %1, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next, %32
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %0
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2)
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.preheader61.preheader, label %._crit_edge66

.preheader61.preheader:                           ; preds = %._crit_edge
  %wide.trip.count92 = zext nneg i32 %38 to i64
  br label %.preheader61

.preheader61:                                     ; preds = %.preheader61.preheader, %60
  %indvars.iv86 = phi i64 [ 0, %.preheader61.preheader ], [ %indvars.iv.next87, %60 ]
  %40 = getelementptr inbounds float, ptr %13, i64 %indvars.iv86
  %41 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv86
  %42 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv86
  %43 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv86
  br label %44

44:                                               ; preds = %.preheader61, %59
  %indvars.iv88 = phi i64 [ %indvars.iv86, %.preheader61 ], [ %indvars.iv.next89, %59 ]
  %45 = load float, ptr %40, align 4, !tbaa !9
  %46 = getelementptr inbounds float, ptr %13, i64 %indvars.iv88
  %47 = load float, ptr %46, align 4, !tbaa !9
  %48 = fcmp olt float %45, %47
  br i1 %48, label %49, label %59

49:                                               ; preds = %44
  store float %47, ptr %40, align 4, !tbaa !9
  store float %45, ptr %46, align 4, !tbaa !9
  %50 = load i32, ptr %41, align 4, !tbaa !5
  %51 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv88
  %52 = load i32, ptr %51, align 4, !tbaa !5
  store i32 %52, ptr %41, align 4, !tbaa !5
  store i32 %50, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr %42, align 4, !tbaa !5
  %54 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv88
  %55 = load i32, ptr %54, align 4, !tbaa !5
  store i32 %55, ptr %42, align 4, !tbaa !5
  store i32 %53, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %43, align 4, !tbaa !5
  %57 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv88
  %58 = load i32, ptr %57, align 4, !tbaa !5
  store i32 %58, ptr %43, align 4, !tbaa !5
  store i32 %56, ptr %57, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %44, %49
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count92
  br i1 %exitcond.not, label %60, label %44, !llvm.loop !13

60:                                               ; preds = %59
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %exitcond93.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count92
  br i1 %exitcond93.not, label %._crit_edge66, label %.preheader61, !llvm.loop !14

._crit_edge66:                                    ; preds = %60, %._crit_edge
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %63 = load i32, ptr %1, align 4, !tbaa !5
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.lr.ph69, label %thread-pre-split

.lr.ph69:                                         ; preds = %._crit_edge66, %.lr.ph69
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.lr.ph69 ], [ 0, %._crit_edge66 ]
  %65 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv94
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv94
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv94
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = getelementptr inbounds float, ptr %13, i64 %indvars.iv94
  %72 = load float, ptr %71, align 4, !tbaa !9
  %73 = fpext float %72 to double
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %66, i32 noundef %68, i32 noundef %70, double noundef %73)
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %75 = load i32, ptr %1, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next95, %76
  br i1 %77, label %.lr.ph69, label %thread-pre-split, !llvm.loop !15

thread-pre-split:                                 ; preds = %.lr.ph69, %._crit_edge66
  %.lcssa62 = phi i32 [ %63, %._crit_edge66 ], [ %75, %.lr.ph69 ]
  %.lcssa62.fr = freeze i32 %.lcssa62
  %.pr = load i32, ptr %2, align 4
  %78 = icmp sgt i32 %.pr, 0
  br i1 %78, label %.preheader.lr.ph, label %._crit_edge82

.preheader.lr.ph:                                 ; preds = %thread-pre-split
  %79 = icmp slt i32 %.lcssa62.fr, 1
  br i1 %79, label %.preheader.us, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %80 = zext nneg i32 %.lcssa62.fr to i64
  br label %.lr.ph73

.preheader.us:                                    ; preds = %.preheader.lr.ph, %.preheader.us
  br label %.preheader.us

.loopexit:                                        ; preds = %86
  %81 = icmp sgt i32 %87, 0
  br i1 %81, label %.lr.ph73.backedge, label %._crit_edge82.loopexit

.lr.ph73:                                         ; preds = %.lr.ph73.backedge, %.preheader.preheader
  %indvars.iv97 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv97.be, %.lr.ph73.backedge ]
  %.172 = phi float [ 0.000000e+00, %.preheader.preheader ], [ %91, %.lr.ph73.backedge ]
  %82 = phi i32 [ %.pr, %.preheader.preheader ], [ %87, %.lr.ph73.backedge ]
  %83 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv97
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp sgt i32 %82, %84
  br i1 %85, label %86, label %.loopexit.thread

86:                                               ; preds = %.lr.ph73
  %87 = sub nsw i32 %82, %84
  %88 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv97
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sitofp i32 %89 to float
  %91 = fadd float %.172, %90
  store i32 %87, ptr %2, align 4
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %92 = icmp uge i64 %indvars.iv.next98, %80
  %93 = icmp eq i32 %87, 0
  %or.cond = select i1 %92, i1 true, i1 %93
  br i1 %or.cond, label %.loopexit, label %.lr.ph73.backedge

.lr.ph73.backedge:                                ; preds = %86, %.loopexit
  %indvars.iv97.be = phi i64 [ %indvars.iv.next98, %86 ], [ 0, %.loopexit ]
  br label %.lr.ph73, !llvm.loop !16

.loopexit.thread:                                 ; preds = %.lr.ph73
  %94 = getelementptr inbounds float, ptr %13, i64 %indvars.iv97
  %95 = load float, ptr %94, align 4, !tbaa !9
  %96 = sitofp i32 %82 to float
  %97 = call float @llvm.fmuladd.f32(float %95, float %96, float %.172)
  store i32 0, ptr %2, align 4
  br label %._crit_edge82.loopexit

._crit_edge82.loopexit:                           ; preds = %.loopexit, %.loopexit.thread
  %.2105108 = phi float [ %97, %.loopexit.thread ], [ %91, %.loopexit ]
  %98 = fpext float %.2105108 to double
  br label %._crit_edge82

._crit_edge82:                                    ; preds = %._crit_edge82.loopexit, %thread-pre-split
  %.0.lcssa = phi double [ 0.000000e+00, %thread-pre-split ], [ %98, %._crit_edge82.loopexit ]
  %99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, double noundef %.0.lcssa)
  call void @llvm.stackrestore.p0(ptr %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

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

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

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

; 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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass