; LLVM IR from facebook/hermes :: API/hermes_sandbox/external (hermes_sandbox_impl_compiled_6)

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden double @f64_reinterpret_i64(i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local double @w2c_hermes_specialcase0x2E1(ptr noundef %0, double noundef %1, i64 noundef %2, i64 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store i64 %2, ptr %7, align 8, !tbaa !11
  store i64 %3, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store double 0.000000e+00, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store double 0.000000e+00, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %22 = load i64, ptr %8, align 8, !tbaa !11
  store i64 %22, ptr %14, align 8, !tbaa !11
  store i64 2147483648, ptr %15, align 8, !tbaa !11
  %23 = load i64, ptr %15, align 8, !tbaa !11
  %24 = load i64, ptr %14, align 8, !tbaa !11
  %25 = and i64 %24, %23
  store i64 %25, ptr %14, align 8, !tbaa !11
  %26 = load i64, ptr %14, align 8, !tbaa !11
  %27 = icmp ne i64 %26, 0
  %28 = xor i1 %27, true
  %29 = zext i1 %28 to i32
  store i32 %29, ptr %12, align 4, !tbaa !13
  %30 = load i32, ptr %12, align 4, !tbaa !13
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %51

32:                                               ; preds = %4
  %33 = load i64, ptr %7, align 8, !tbaa !11
  store i64 %33, ptr %14, align 8, !tbaa !11
  store i64 4544132024016830464, ptr %15, align 8, !tbaa !11
  %34 = load i64, ptr %15, align 8, !tbaa !11
  %35 = load i64, ptr %14, align 8, !tbaa !11
  %36 = sub i64 %35, %34
  store i64 %36, ptr %14, align 8, !tbaa !11
  %37 = load i64, ptr %14, align 8, !tbaa !11
  %38 = call double @f64_reinterpret_i64(i64 noundef %37)
  store double %38, ptr %16, align 8, !tbaa !9
  %39 = load double, ptr %16, align 8, !tbaa !9
  store double %39, ptr %9, align 8, !tbaa !9
  %40 = load double, ptr %6, align 8, !tbaa !9
  store double %40, ptr %17, align 8, !tbaa !9
  %41 = load double, ptr %17, align 8, !tbaa !9
  %42 = load double, ptr %16, align 8, !tbaa !9
  %43 = fmul double %42, %41
  store double %43, ptr %16, align 8, !tbaa !9
  %44 = load double, ptr %9, align 8, !tbaa !9
  store double %44, ptr %17, align 8, !tbaa !9
  %45 = load double, ptr %17, align 8, !tbaa !9
  %46 = load double, ptr %16, align 8, !tbaa !9
  %47 = fadd double %46, %45
  store double %47, ptr %16, align 8, !tbaa !9
  store double 0x7F00000000000000, ptr %17, align 8, !tbaa !9
  %48 = load double, ptr %17, align 8, !tbaa !9
  %49 = load double, ptr %16, align 8, !tbaa !9
  %50 = fmul double %49, %48
  store double %50, ptr %16, align 8, !tbaa !9
  br label %134

51:                                               ; preds = %4
  %52 = load i64, ptr %7, align 8, !tbaa !11
  store i64 %52, ptr %14, align 8, !tbaa !11
  store i64 4602678819172646912, ptr %15, align 8, !tbaa !11
  %53 = load i64, ptr %15, align 8, !tbaa !11
  %54 = load i64, ptr %14, align 8, !tbaa !11
  %55 = add i64 %54, %53
  store i64 %55, ptr %14, align 8, !tbaa !11
  %56 = load i64, ptr %14, align 8, !tbaa !11
  %57 = call double @f64_reinterpret_i64(i64 noundef %56)
  store double %57, ptr %16, align 8, !tbaa !9
  %58 = load double, ptr %16, align 8, !tbaa !9
  store double %58, ptr %9, align 8, !tbaa !9
  %59 = load double, ptr %6, align 8, !tbaa !9
  store double %59, ptr %17, align 8, !tbaa !9
  %60 = load double, ptr %17, align 8, !tbaa !9
  %61 = load double, ptr %16, align 8, !tbaa !9
  %62 = fmul double %61, %60
  store double %62, ptr %16, align 8, !tbaa !9
  %63 = load double, ptr %16, align 8, !tbaa !9
  store double %63, ptr %10, align 8, !tbaa !9
  %64 = load double, ptr %9, align 8, !tbaa !9
  store double %64, ptr %17, align 8, !tbaa !9
  %65 = load double, ptr %17, align 8, !tbaa !9
  %66 = load double, ptr %16, align 8, !tbaa !9
  %67 = fadd double %66, %65
  store double %67, ptr %16, align 8, !tbaa !9
  %68 = load double, ptr %16, align 8, !tbaa !9
  store double %68, ptr %6, align 8, !tbaa !9
  store double 1.000000e+00, ptr %17, align 8, !tbaa !9
  %69 = load double, ptr %16, align 8, !tbaa !9
  %70 = load double, ptr %17, align 8, !tbaa !9
  %71 = fcmp olt double %69, %70
  %72 = zext i1 %71 to i32
  store i32 %72, ptr %12, align 4, !tbaa !13
  %73 = load i32, ptr %12, align 4, !tbaa !13
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %129

75:                                               ; preds = %51
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = call double @w2c_hermes_fp_barrier0x2E3(ptr noundef %76)
  store double %77, ptr %16, align 8, !tbaa !9
  store double 0x10000000000000, ptr %17, align 8, !tbaa !9
  %78 = load double, ptr %17, align 8, !tbaa !9
  %79 = load double, ptr %16, align 8, !tbaa !9
  %80 = fmul double %79, %78
  store double %80, ptr %16, align 8, !tbaa !9
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load double, ptr %16, align 8, !tbaa !9
  call void @w2c_hermes_fp_force_eval0x2E1(ptr noundef %81, double noundef %82)
  store double 0.000000e+00, ptr %16, align 8, !tbaa !9
  %83 = load double, ptr %6, align 8, !tbaa !9
  store double %83, ptr %17, align 8, !tbaa !9
  store double 1.000000e+00, ptr %18, align 8, !tbaa !9
  %84 = load double, ptr %18, align 8, !tbaa !9
  %85 = load double, ptr %17, align 8, !tbaa !9
  %86 = fadd double %85, %84
  store double %86, ptr %17, align 8, !tbaa !9
  %87 = load double, ptr %17, align 8, !tbaa !9
  store double %87, ptr %11, align 8, !tbaa !9
  %88 = load double, ptr %10, align 8, !tbaa !9
  store double %88, ptr %18, align 8, !tbaa !9
  %89 = load double, ptr %9, align 8, !tbaa !9
  store double %89, ptr %19, align 8, !tbaa !9
  %90 = load double, ptr %6, align 8, !tbaa !9
  store double %90, ptr %20, align 8, !tbaa !9
  %91 = load double, ptr %20, align 8, !tbaa !9
  %92 = load double, ptr %19, align 8, !tbaa !9
  %93 = fsub double %92, %91
  store double %93, ptr %19, align 8, !tbaa !9
  %94 = load double, ptr %19, align 8, !tbaa !9
  %95 = load double, ptr %18, align 8, !tbaa !9
  %96 = fadd double %95, %94
  store double %96, ptr %18, align 8, !tbaa !9
  %97 = load double, ptr %6, align 8, !tbaa !9
  store double %97, ptr %19, align 8, !tbaa !9
  store double 1.000000e+00, ptr %20, align 8, !tbaa !9
  %98 = load double, ptr %11, align 8, !tbaa !9
  store double %98, ptr %21, align 8, !tbaa !9
  %99 = load double, ptr %21, align 8, !tbaa !9
  %100 = load double, ptr %20, align 8, !tbaa !9
  %101 = fsub double %100, %99
  store double %101, ptr %20, align 8, !tbaa !9
  %102 = load double, ptr %20, align 8, !tbaa !9
  %103 = load double, ptr %19, align 8, !tbaa !9
  %104 = fadd double %103, %102
  store double %104, ptr %19, align 8, !tbaa !9
  %105 = load double, ptr %19, align 8, !tbaa !9
  %106 = load double, ptr %18, align 8, !tbaa !9
  %107 = fadd double %106, %105
  store double %107, ptr %18, align 8, !tbaa !9
  %108 = load double, ptr %18, align 8, !tbaa !9
  %109 = load double, ptr %17, align 8, !tbaa !9
  %110 = fadd double %109, %108
  store double %110, ptr %17, align 8, !tbaa !9
  store double -1.000000e+00, ptr %18, align 8, !tbaa !9
  %111 = load double, ptr %18, align 8, !tbaa !9
  %112 = load double, ptr %17, align 8, !tbaa !9
  %113 = fadd double %112, %111
  store double %113, ptr %17, align 8, !tbaa !9
  %114 = load double, ptr %17, align 8, !tbaa !9
  store double %114, ptr %6, align 8, !tbaa !9
  %115 = load double, ptr %6, align 8, !tbaa !9
  store double %115, ptr %18, align 8, !tbaa !9
  store double 0.000000e+00, ptr %19, align 8, !tbaa !9
  %116 = load double, ptr %18, align 8, !tbaa !9
  %117 = load double, ptr %19, align 8, !tbaa !9
  %118 = fcmp oeq double %116, %117
  %119 = zext i1 %118 to i32
  store i32 %119, ptr %13, align 4, !tbaa !13
  %120 = load i32, ptr %13, align 4, !tbaa !13
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %124

122:                                              ; preds = %75
  %123 = load double, ptr %16, align 8, !tbaa !9
  br label %126

124:                                              ; preds = %75
  %125 = load double, ptr %17, align 8, !tbaa !9
  br label %126

126:                                              ; preds = %124, %122
  %127 = phi double [ %123, %122 ], [ %125, %124 ]
  store double %127, ptr %16, align 8, !tbaa !9
  %128 = load double, ptr %16, align 8, !tbaa !9
  store double %128, ptr %6, align 8, !tbaa !9
  br label %129

129:                                              ; preds = %126, %51
  %130 = load double, ptr %6, align 8, !tbaa !9
  store double %130, ptr %16, align 8, !tbaa !9
  store double 0x10000000000000, ptr %17, align 8, !tbaa !9
  %131 = load double, ptr %17, align 8, !tbaa !9
  %132 = load double, ptr %16, align 8, !tbaa !9
  %133 = fmul double %132, %131
  store double %133, ptr %16, align 8, !tbaa !9
  br label %134

134:                                              ; preds = %129, %32
  %135 = load double, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret double %135
}

declare double @w2c_hermes_fp_barrier0x2E3(ptr noundef) #3

declare void @w2c_hermes_fp_force_eval0x2E1(ptr noundef, double noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { 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 = { "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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}


; 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: inlinehint nounwind uwtable
declare hidden double @f64_reinterpret_i64(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local double @w2c_hermes_specialcase0x2E1(ptr noundef %0, double noundef %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #1 {
  %5 = and i64 %3, 2147483648
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %6, label %12

6:                                                ; preds = %4
  %7 = add i64 %2, -4544132024016830464
  %8 = tail call double @f64_reinterpret_i64(i64 noundef %7)
  %9 = fmul double %8, %1
  %10 = fadd double %8, %9
  %11 = fmul double %10, 0x7F00000000000000
  br label %33

12:                                               ; preds = %4
  %13 = add i64 %2, 4602678819172646912
  %14 = tail call double @f64_reinterpret_i64(i64 noundef %13)
  %15 = fmul double %14, %1
  %16 = fadd double %14, %15
  %17 = fcmp olt double %16, 1.000000e+00
  br i1 %17, label %18, label %31

18:                                               ; preds = %12
  %19 = tail call double @w2c_hermes_fp_barrier0x2E3(ptr noundef %0) #3
  %20 = fmul double %19, 0x10000000000000
  tail call void @w2c_hermes_fp_force_eval0x2E1(ptr noundef %0, double noundef %20) #3
  %21 = fadd double %16, 1.000000e+00
  %22 = fsub double %14, %16
  %23 = fadd double %15, %22
  %24 = fsub double 1.000000e+00, %21
  %25 = fadd double %16, %24
  %26 = fadd double %23, %25
  %27 = fadd double %21, %26
  %28 = fadd double %27, -1.000000e+00
  %29 = fcmp oeq double %28, 0.000000e+00
  %30 = select i1 %29, double 0.000000e+00, double %28
  br label %31

31:                                               ; preds = %18, %12
  %.0 = phi double [ %30, %18 ], [ %16, %12 ]
  %32 = fmul double %.0, 0x10000000000000
  br label %33

33:                                               ; preds = %31, %6
  %.073 = phi double [ %11, %6 ], [ %32, %31 ]
  ret double %.073
}

declare double @w2c_hermes_fp_barrier0x2E3(ptr noundef) local_unnamed_addr #2

declare void @w2c_hermes_fp_force_eval0x2E1(ptr noundef, double noundef) local_unnamed_addr #2

attributes #0 = { inlinehint 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 = { 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 #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 = { 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)"}


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