; LLVM IR from 0r-gh0/NUMERICAL_ANALYSIS :: CODES (tempo)

; 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 [18 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = 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 float, align 4
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %13 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %2, ptr noundef %3, ptr noundef %12, ptr noundef %11)
  %15 = load float, ptr %2, align 4, !tbaa !5
  store float %15, ptr %10, align 4, !tbaa !5
  %16 = load float, ptr %3, align 4, !tbaa !5
  store float %16, ptr %9, align 4, !tbaa !5
  %17 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %18

18:                                               ; preds = %22, %0
  %19 = load float, ptr %10, align 4, !tbaa !5
  %20 = load float, ptr %12, align 4, !tbaa !5
  %21 = fcmp olt float %19, %20
  br i1 %21, label %22, label %88

22:                                               ; preds = %18
  %23 = load float, ptr %2, align 4, !tbaa !5
  %24 = load float, ptr %3, align 4, !tbaa !5
  %25 = call float @f(float noundef %23, float noundef %24)
  store float %25, ptr %4, align 4, !tbaa !5
  %26 = load float, ptr %2, align 4, !tbaa !5
  %27 = fpext float %26 to double
  %28 = load float, ptr %11, align 4, !tbaa !5
  %29 = fpext float %28 to double
  %30 = fdiv double %29, 2.000000e+00
  %31 = fadd double %27, %30
  %32 = fptrunc double %31 to float
  %33 = load float, ptr %3, align 4, !tbaa !5
  %34 = fpext float %33 to double
  %35 = load float, ptr %4, align 4, !tbaa !5
  %36 = load float, ptr %11, align 4, !tbaa !5
  %37 = fmul float %35, %36
  %38 = fpext float %37 to double
  %39 = fdiv double %38, 2.000000e+00
  %40 = fadd double %34, %39
  %41 = fptrunc double %40 to float
  %42 = call float @f(float noundef %32, float noundef %41)
  store float %42, ptr %5, align 4, !tbaa !5
  %43 = load float, ptr %2, align 4, !tbaa !5
  %44 = fpext float %43 to double
  %45 = load float, ptr %11, align 4, !tbaa !5
  %46 = fpext float %45 to double
  %47 = fdiv double %46, 2.000000e+00
  %48 = fadd double %44, %47
  %49 = fptrunc double %48 to float
  %50 = load float, ptr %3, align 4, !tbaa !5
  %51 = fpext float %50 to double
  %52 = load float, ptr %5, align 4, !tbaa !5
  %53 = load float, ptr %11, align 4, !tbaa !5
  %54 = fmul float %52, %53
  %55 = fpext float %54 to double
  %56 = fdiv double %55, 2.000000e+00
  %57 = fadd double %51, %56
  %58 = fptrunc double %57 to float
  %59 = call float @f(float noundef %49, float noundef %58)
  store float %59, ptr %6, align 4, !tbaa !5
  %60 = load float, ptr %2, align 4, !tbaa !5
  %61 = load float, ptr %11, align 4, !tbaa !5
  %62 = fadd float %60, %61
  %63 = load float, ptr %3, align 4, !tbaa !5
  %64 = load float, ptr %6, align 4, !tbaa !5
  %65 = load float, ptr %11, align 4, !tbaa !5
  %66 = call float @llvm.fmuladd.f32(float %64, float %65, float %63)
  %67 = call float @f(float noundef %62, float noundef %66)
  store float %67, ptr %7, align 4, !tbaa !5
  %68 = load float, ptr %4, align 4, !tbaa !5
  %69 = load float, ptr %5, align 4, !tbaa !5
  %70 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %69, float %68)
  %71 = load float, ptr %6, align 4, !tbaa !5
  %72 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %71, float %70)
  %73 = load float, ptr %7, align 4, !tbaa !5
  %74 = fadd float %72, %73
  %75 = fdiv float %74, 6.000000e+00
  store float %75, ptr %8, align 4, !tbaa !5
  %76 = load float, ptr %9, align 4, !tbaa !5
  %77 = load float, ptr %8, align 4, !tbaa !5
  %78 = load float, ptr %11, align 4, !tbaa !5
  %79 = call float @llvm.fmuladd.f32(float %77, float %78, float %76)
  store float %79, ptr %9, align 4, !tbaa !5
  %80 = load float, ptr %10, align 4, !tbaa !5
  %81 = load float, ptr %11, align 4, !tbaa !5
  %82 = fadd float %80, %81
  store float %82, ptr %10, align 4, !tbaa !5
  %83 = load float, ptr %10, align 4, !tbaa !5
  %84 = fpext float %83 to double
  %85 = load float, ptr %9, align 4, !tbaa !5
  %86 = fpext float %85 to double
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %84, double noundef %86)
  br label %18, !llvm.loop !9

88:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %89 = load i32, ptr %1, align 4
  ret i32 %89
}

; 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: nounwind uwtable
declare dso_local float @f(float noundef, float noundef) #0

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; 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 [18 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

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

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.015 = phi float [ %57, %.lr.ph ], [ %7, %0 ]
  %.01314 = phi float [ %56, %.lr.ph ], [ %8, %0 ]
  %12 = load float, ptr %1, align 4, !tbaa !5
  %13 = load float, ptr %2, align 4, !tbaa !5
  %14 = call float @f(float noundef %12, float noundef %13)
  %15 = load float, ptr %1, align 4, !tbaa !5
  %16 = fpext float %15 to double
  %17 = load float, ptr %3, align 4, !tbaa !5
  %18 = fpext float %17 to double
  %19 = fmul double %18, 5.000000e-01
  %20 = fadd double %19, %16
  %21 = fptrunc double %20 to float
  %22 = load float, ptr %2, align 4, !tbaa !5
  %23 = fpext float %22 to double
  %24 = fmul float %14, %17
  %25 = fpext float %24 to double
  %26 = fmul double %25, 5.000000e-01
  %27 = fadd double %26, %23
  %28 = fptrunc double %27 to float
  %29 = call float @f(float noundef %21, float noundef %28)
  %30 = load float, ptr %1, align 4, !tbaa !5
  %31 = fpext float %30 to double
  %32 = load float, ptr %3, align 4, !tbaa !5
  %33 = fpext float %32 to double
  %34 = fmul double %33, 5.000000e-01
  %35 = fadd double %34, %31
  %36 = fptrunc double %35 to float
  %37 = load float, ptr %2, align 4, !tbaa !5
  %38 = fpext float %37 to double
  %39 = fmul float %29, %32
  %40 = fpext float %39 to double
  %41 = fmul double %40, 5.000000e-01
  %42 = fadd double %41, %38
  %43 = fptrunc double %42 to float
  %44 = call float @f(float noundef %36, float noundef %43)
  %45 = load float, ptr %1, align 4, !tbaa !5
  %46 = load float, ptr %3, align 4, !tbaa !5
  %47 = fadd float %45, %46
  %48 = load float, ptr %2, align 4, !tbaa !5
  %49 = call float @llvm.fmuladd.f32(float %44, float %46, float %48)
  %50 = call float @f(float noundef %47, float noundef %49)
  %51 = call float @llvm.fmuladd.f32(float %29, float 2.000000e+00, float %14)
  %52 = call float @llvm.fmuladd.f32(float %44, float 2.000000e+00, float %51)
  %53 = fadd float %52, %50
  %54 = fdiv float %53, 6.000000e+00
  %55 = load float, ptr %3, align 4, !tbaa !5
  %56 = call float @llvm.fmuladd.f32(float %54, float %55, float %.01314)
  %57 = fadd float %.015, %55
  %58 = fpext float %57 to double
  %59 = fpext float %56 to double
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %58, double noundef %59)
  %61 = load float, ptr %4, align 4, !tbaa !5
  %62 = fcmp olt float %57, %61
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  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: nounwind uwtable
declare dso_local float @f(float noundef, float noundef) local_unnamed_addr #0

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass