; LLVM IR from ShahjalalShohag/code-library :: Math/Integration (Simpsons).ll (Z5solveeeeeee)

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef x86_fp80 @_Z1fe(x86_fp80 noundef) #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef x86_fp80 @_Z5solveeeeeee(x86_fp80 noundef %0, x86_fp80 noundef %1, x86_fp80 noundef %2, x86_fp80 noundef %3, x86_fp80 noundef %4, x86_fp80 noundef %5) #0 {
  %7 = alloca x86_fp80, align 16
  %8 = alloca x86_fp80, align 16
  %9 = alloca x86_fp80, align 16
  %10 = alloca x86_fp80, align 16
  %11 = alloca x86_fp80, align 16
  %12 = alloca x86_fp80, align 16
  %13 = alloca x86_fp80, align 16
  %14 = alloca x86_fp80, align 16
  %15 = alloca x86_fp80, align 16
  %16 = alloca x86_fp80, align 16
  %17 = alloca x86_fp80, align 16
  %18 = alloca x86_fp80, align 16
  %19 = alloca i32, align 4
  store x86_fp80 %0, ptr %8, align 16, !tbaa !5
  store x86_fp80 %1, ptr %9, align 16, !tbaa !5
  store x86_fp80 %2, ptr %10, align 16, !tbaa !5
  store x86_fp80 %3, ptr %11, align 16, !tbaa !5
  store x86_fp80 %4, ptr %12, align 16, !tbaa !5
  store x86_fp80 %5, ptr %13, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #3
  %20 = load x86_fp80, ptr %12, align 16, !tbaa !5
  %21 = load x86_fp80, ptr %13, align 16, !tbaa !5
  %22 = fadd x86_fp80 %20, %21
  %23 = fdiv x86_fp80 %22, 0xK40008000000000000000
  store x86_fp80 %23, ptr %14, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #3
  %24 = load x86_fp80, ptr %12, align 16, !tbaa !5
  %25 = load x86_fp80, ptr %14, align 16, !tbaa !5
  %26 = fadd x86_fp80 %24, %25
  %27 = fdiv x86_fp80 %26, 0xK40008000000000000000
  %28 = call noundef x86_fp80 @_Z1fe(x86_fp80 noundef %27)
  store x86_fp80 %28, ptr %15, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #3
  %29 = load x86_fp80, ptr %14, align 16, !tbaa !5
  %30 = load x86_fp80, ptr %13, align 16, !tbaa !5
  %31 = fadd x86_fp80 %29, %30
  %32 = fdiv x86_fp80 %31, 0xK40008000000000000000
  %33 = call noundef x86_fp80 @_Z1fe(x86_fp80 noundef %32)
  store x86_fp80 %33, ptr %16, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #3
  %34 = load x86_fp80, ptr %9, align 16, !tbaa !5
  %35 = load x86_fp80, ptr %11, align 16, !tbaa !5
  %36 = load x86_fp80, ptr %15, align 16, !tbaa !5
  %37 = load x86_fp80, ptr %12, align 16, !tbaa !5
  %38 = load x86_fp80, ptr %14, align 16, !tbaa !5
  %39 = call noundef x86_fp80 @_Z7simpsoneeeee(x86_fp80 noundef %34, x86_fp80 noundef %35, x86_fp80 noundef %36, x86_fp80 noundef %37, x86_fp80 noundef %38)
  store x86_fp80 %39, ptr %17, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #3
  %40 = load x86_fp80, ptr %11, align 16, !tbaa !5
  %41 = load x86_fp80, ptr %10, align 16, !tbaa !5
  %42 = load x86_fp80, ptr %16, align 16, !tbaa !5
  %43 = load x86_fp80, ptr %14, align 16, !tbaa !5
  %44 = load x86_fp80, ptr %13, align 16, !tbaa !5
  %45 = call noundef x86_fp80 @_Z7simpsoneeeee(x86_fp80 noundef %40, x86_fp80 noundef %41, x86_fp80 noundef %42, x86_fp80 noundef %43, x86_fp80 noundef %44)
  store x86_fp80 %45, ptr %18, align 16, !tbaa !5
  %46 = load x86_fp80, ptr %8, align 16, !tbaa !5
  %47 = load x86_fp80, ptr %17, align 16, !tbaa !5
  %48 = fsub x86_fp80 %46, %47
  %49 = load x86_fp80, ptr %18, align 16, !tbaa !5
  %50 = fsub x86_fp80 %48, %49
  %51 = call noundef x86_fp80 @_ZSt4fabse(x86_fp80 noundef %50)
  %52 = fcmp olt x86_fp80 %51, 0xK3FEB8637BD05AF6C6800
  br i1 %52, label %53, label %57

53:                                               ; preds = %6
  %54 = load x86_fp80, ptr %17, align 16, !tbaa !5
  %55 = load x86_fp80, ptr %18, align 16, !tbaa !5
  %56 = fadd x86_fp80 %54, %55
  store x86_fp80 %56, ptr %7, align 16
  store i32 1, ptr %19, align 4
  br label %73

57:                                               ; preds = %6
  %58 = load x86_fp80, ptr %17, align 16, !tbaa !5
  %59 = load x86_fp80, ptr %9, align 16, !tbaa !5
  %60 = load x86_fp80, ptr %11, align 16, !tbaa !5
  %61 = load x86_fp80, ptr %15, align 16, !tbaa !5
  %62 = load x86_fp80, ptr %12, align 16, !tbaa !5
  %63 = load x86_fp80, ptr %14, align 16, !tbaa !5
  %64 = call noundef x86_fp80 @_Z5solveeeeeee(x86_fp80 noundef %58, x86_fp80 noundef %59, x86_fp80 noundef %60, x86_fp80 noundef %61, x86_fp80 noundef %62, x86_fp80 noundef %63)
  %65 = load x86_fp80, ptr %18, align 16, !tbaa !5
  %66 = load x86_fp80, ptr %11, align 16, !tbaa !5
  %67 = load x86_fp80, ptr %10, align 16, !tbaa !5
  %68 = load x86_fp80, ptr %16, align 16, !tbaa !5
  %69 = load x86_fp80, ptr %14, align 16, !tbaa !5
  %70 = load x86_fp80, ptr %13, align 16, !tbaa !5
  %71 = call noundef x86_fp80 @_Z5solveeeeeee(x86_fp80 noundef %65, x86_fp80 noundef %66, x86_fp80 noundef %67, x86_fp80 noundef %68, x86_fp80 noundef %69, x86_fp80 noundef %70)
  %72 = fadd x86_fp80 %64, %71
  store x86_fp80 %72, ptr %7, align 16
  store i32 1, ptr %19, align 4
  br label %73

73:                                               ; preds = %57, %53
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #3
  %74 = load x86_fp80, ptr %7, align 16
  ret x86_fp80 %74
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_Z7simpsoneeeee(x86_fp80 noundef, x86_fp80 noundef, x86_fp80 noundef, x86_fp80 noundef, x86_fp80 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt4fabse(x86_fp80 noundef) #2

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


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

; Function Attrs: mustprogress uwtable
declare dso_local noundef x86_fp80 @_Z1fe(x86_fp80 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef x86_fp80 @_Z5solveeeeeee(x86_fp80 noundef %0, x86_fp80 noundef %1, x86_fp80 noundef %2, x86_fp80 noundef %3, x86_fp80 noundef %4, x86_fp80 noundef %5) local_unnamed_addr #0 {
  %7 = fadd x86_fp80 %4, %5
  %8 = fmul x86_fp80 %7, 0xK3FFE8000000000000000
  %9 = fadd x86_fp80 %8, %4
  %10 = fmul x86_fp80 %9, 0xK3FFE8000000000000000
  %11 = tail call noundef x86_fp80 @_Z1fe(x86_fp80 noundef %10)
  %12 = fadd x86_fp80 %8, %5
  %13 = fmul x86_fp80 %12, 0xK3FFE8000000000000000
  %14 = tail call noundef x86_fp80 @_Z1fe(x86_fp80 noundef %13)
  %15 = tail call noundef x86_fp80 @_Z7simpsoneeeee(x86_fp80 noundef %1, x86_fp80 noundef %3, x86_fp80 noundef %11, x86_fp80 noundef %4, x86_fp80 noundef %8)
  %16 = tail call noundef x86_fp80 @_Z7simpsoneeeee(x86_fp80 noundef %3, x86_fp80 noundef %2, x86_fp80 noundef %14, x86_fp80 noundef %8, x86_fp80 noundef %5)
  %17 = fsub x86_fp80 %0, %15
  %18 = fsub x86_fp80 %17, %16
  %19 = tail call noundef x86_fp80 @_ZSt4fabse(x86_fp80 noundef %18)
  %20 = fcmp olt x86_fp80 %19, 0xK3FEB8637BD05AF6C6800
  br i1 %20, label %common.ret, label %22

common.ret:                                       ; preds = %6
  %21 = fadd x86_fp80 %15, %16
  br label %common.ret36

common.ret36:                                     ; preds = %22, %common.ret
  %common.ret36.op = phi x86_fp80 [ %21, %common.ret ], [ %25, %22 ]
  ret x86_fp80 %common.ret36.op

22:                                               ; preds = %6
  %23 = tail call noundef x86_fp80 @_Z5solveeeeeee(x86_fp80 noundef %15, x86_fp80 noundef %1, x86_fp80 noundef %3, x86_fp80 noundef %11, x86_fp80 noundef %4, x86_fp80 noundef %8)
  %24 = tail call noundef x86_fp80 @_Z5solveeeeeee(x86_fp80 noundef %16, x86_fp80 noundef %3, x86_fp80 noundef %2, x86_fp80 noundef %14, x86_fp80 noundef %8, x86_fp80 noundef %5)
  %25 = fadd x86_fp80 %23, %24
  br label %common.ret36
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_Z7simpsoneeeee(x86_fp80 noundef, x86_fp80 noundef, x86_fp80 noundef, x86_fp80 noundef, x86_fp80 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt4fabse(x86_fp80 noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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)"}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass