; 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

declare double @w2c_hermes_fp_barrier0x2E1(ptr noundef, double noundef) #2

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

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

53:                                               ; preds = %4
  %54 = load i64, ptr %7, align 8, !tbaa !11
  store i64 %54, ptr %16, align 8, !tbaa !11
  store i64 4602678819172646912, ptr %17, align 8, !tbaa !11
  %55 = load i64, ptr %17, align 8, !tbaa !11
  %56 = load i64, ptr %16, align 8, !tbaa !11
  %57 = add i64 %56, %55
  store i64 %57, ptr %16, align 8, !tbaa !11
  %58 = load i64, ptr %16, align 8, !tbaa !11
  store i64 %58, ptr %8, align 8, !tbaa !11
  %59 = load i64, ptr %16, align 8, !tbaa !11
  %60 = call double @f64_reinterpret_i64(i64 noundef %59)
  store double %60, ptr %18, align 8, !tbaa !9
  %61 = load double, ptr %18, align 8, !tbaa !9
  store double %61, ptr %9, align 8, !tbaa !9
  %62 = load double, ptr %6, align 8, !tbaa !9
  store double %62, ptr %19, align 8, !tbaa !9
  %63 = load double, ptr %19, align 8, !tbaa !9
  %64 = load double, ptr %18, align 8, !tbaa !9
  %65 = fmul double %64, %63
  store double %65, ptr %18, align 8, !tbaa !9
  %66 = load double, ptr %18, align 8, !tbaa !9
  store double %66, ptr %11, align 8, !tbaa !9
  %67 = load double, ptr %9, align 8, !tbaa !9
  store double %67, ptr %19, align 8, !tbaa !9
  %68 = load double, ptr %19, align 8, !tbaa !9
  %69 = load double, ptr %18, align 8, !tbaa !9
  %70 = fadd double %69, %68
  store double %70, ptr %18, align 8, !tbaa !9
  %71 = load double, ptr %18, align 8, !tbaa !9
  store double %71, ptr %6, align 8, !tbaa !9
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = load double, ptr %18, align 8, !tbaa !9
  %74 = call double @w2c_hermes_fabs(ptr noundef %72, double noundef %73)
  store double %74, ptr %18, align 8, !tbaa !9
  store double 1.000000e+00, ptr %19, align 8, !tbaa !9
  %75 = load double, ptr %18, align 8, !tbaa !9
  %76 = load double, ptr %19, align 8, !tbaa !9
  %77 = fcmp olt double %75, %76
  %78 = zext i1 %77 to i32
  store i32 %78, ptr %13, align 4, !tbaa !13
  %79 = load i32, ptr %13, align 4, !tbaa !13
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %158

81:                                               ; preds = %53
  store double 0x10000000000000, ptr %18, align 8, !tbaa !9
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = load double, ptr %18, align 8, !tbaa !9
  %84 = call double @w2c_hermes_fp_barrier0x2E1(ptr noundef %82, double noundef %83)
  store double %84, ptr %18, align 8, !tbaa !9
  store double 0x10000000000000, ptr %19, align 8, !tbaa !9
  %85 = load double, ptr %19, align 8, !tbaa !9
  %86 = load double, ptr %18, align 8, !tbaa !9
  %87 = fmul double %86, %85
  store double %87, ptr %18, align 8, !tbaa !9
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = load double, ptr %18, align 8, !tbaa !9
  call void @w2c_hermes_fp_force_eval(ptr noundef %88, double noundef %89)
  %90 = load i64, ptr %8, align 8, !tbaa !11
  store i64 %90, ptr %16, align 8, !tbaa !11
  store i64 -9223372036854775808, ptr %17, align 8, !tbaa !11
  %91 = load i64, ptr %17, align 8, !tbaa !11
  %92 = load i64, ptr %16, align 8, !tbaa !11
  %93 = and i64 %92, %91
  store i64 %93, ptr %16, align 8, !tbaa !11
  %94 = load i64, ptr %16, align 8, !tbaa !11
  %95 = call double @f64_reinterpret_i64(i64 noundef %94)
  store double %95, ptr %18, align 8, !tbaa !9
  %96 = load double, ptr %6, align 8, !tbaa !9
  store double %96, ptr %19, align 8, !tbaa !9
  store double -1.000000e+00, ptr %20, align 8, !tbaa !9
  store double 1.000000e+00, ptr %21, align 8, !tbaa !9
  %97 = load double, ptr %6, align 8, !tbaa !9
  store double %97, ptr %22, align 8, !tbaa !9
  store double 0.000000e+00, ptr %23, align 8, !tbaa !9
  %98 = load double, ptr %22, align 8, !tbaa !9
  %99 = load double, ptr %23, align 8, !tbaa !9
  %100 = fcmp olt double %98, %99
  %101 = zext i1 %100 to i32
  store i32 %101, ptr %15, align 4, !tbaa !13
  %102 = load i32, ptr %15, align 4, !tbaa !13
  %103 = icmp ne i32 %102, 0
  br i1 %103, label %104, label %106

104:                                              ; preds = %81
  %105 = load double, ptr %20, align 8, !tbaa !9
  br label %108

106:                                              ; preds = %81
  %107 = load double, ptr %21, align 8, !tbaa !9
  br label %108

108:                                              ; preds = %106, %104
  %109 = phi double [ %105, %104 ], [ %107, %106 ]
  store double %109, ptr %20, align 8, !tbaa !9
  %110 = load double, ptr %20, align 8, !tbaa !9
  store double %110, ptr %10, align 8, !tbaa !9
  %111 = load double, ptr %20, align 8, !tbaa !9
  %112 = load double, ptr %19, align 8, !tbaa !9
  %113 = fadd double %112, %111
  store double %113, ptr %19, align 8, !tbaa !9
  %114 = load double, ptr %19, align 8, !tbaa !9
  store double %114, ptr %12, align 8, !tbaa !9
  %115 = load double, ptr %11, align 8, !tbaa !9
  store double %115, ptr %20, align 8, !tbaa !9
  %116 = load double, ptr %9, align 8, !tbaa !9
  store double %116, ptr %21, align 8, !tbaa !9
  %117 = load double, ptr %6, align 8, !tbaa !9
  store double %117, ptr %22, align 8, !tbaa !9
  %118 = load double, ptr %22, align 8, !tbaa !9
  %119 = load double, ptr %21, align 8, !tbaa !9
  %120 = fsub double %119, %118
  store double %120, ptr %21, align 8, !tbaa !9
  %121 = load double, ptr %21, align 8, !tbaa !9
  %122 = load double, ptr %20, align 8, !tbaa !9
  %123 = fadd double %122, %121
  store double %123, ptr %20, align 8, !tbaa !9
  %124 = load double, ptr %6, align 8, !tbaa !9
  store double %124, ptr %21, align 8, !tbaa !9
  %125 = load double, ptr %10, align 8, !tbaa !9
  store double %125, ptr %22, align 8, !tbaa !9
  %126 = load double, ptr %12, align 8, !tbaa !9
  store double %126, ptr %23, align 8, !tbaa !9
  %127 = load double, ptr %23, align 8, !tbaa !9
  %128 = load double, ptr %22, align 8, !tbaa !9
  %129 = fsub double %128, %127
  store double %129, ptr %22, align 8, !tbaa !9
  %130 = load double, ptr %22, align 8, !tbaa !9
  %131 = load double, ptr %21, align 8, !tbaa !9
  %132 = fadd double %131, %130
  store double %132, ptr %21, align 8, !tbaa !9
  %133 = load double, ptr %21, align 8, !tbaa !9
  %134 = load double, ptr %20, align 8, !tbaa !9
  %135 = fadd double %134, %133
  store double %135, ptr %20, align 8, !tbaa !9
  %136 = load double, ptr %20, align 8, !tbaa !9
  %137 = load double, ptr %19, align 8, !tbaa !9
  %138 = fadd double %137, %136
  store double %138, ptr %19, align 8, !tbaa !9
  %139 = load double, ptr %10, align 8, !tbaa !9
  store double %139, ptr %20, align 8, !tbaa !9
  %140 = load double, ptr %20, align 8, !tbaa !9
  %141 = load double, ptr %19, align 8, !tbaa !9
  %142 = fsub double %141, %140
  store double %142, ptr %19, align 8, !tbaa !9
  %143 = load double, ptr %19, align 8, !tbaa !9
  store double %143, ptr %6, align 8, !tbaa !9
  %144 = load double, ptr %6, align 8, !tbaa !9
  store double %144, ptr %20, align 8, !tbaa !9
  store double 0.000000e+00, ptr %21, align 8, !tbaa !9
  %145 = load double, ptr %20, align 8, !tbaa !9
  %146 = load double, ptr %21, align 8, !tbaa !9
  %147 = fcmp oeq double %145, %146
  %148 = zext i1 %147 to i32
  store i32 %148, ptr %14, align 4, !tbaa !13
  %149 = load i32, ptr %14, align 4, !tbaa !13
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %153

151:                                              ; preds = %108
  %152 = load double, ptr %18, align 8, !tbaa !9
  br label %155

153:                                              ; preds = %108
  %154 = load double, ptr %19, align 8, !tbaa !9
  br label %155

155:                                              ; preds = %153, %151
  %156 = phi double [ %152, %151 ], [ %154, %153 ]
  store double %156, ptr %18, align 8, !tbaa !9
  %157 = load double, ptr %18, align 8, !tbaa !9
  store double %157, ptr %6, align 8, !tbaa !9
  br label %158

158:                                              ; preds = %155, %53
  %159 = load double, ptr %6, align 8, !tbaa !9
  store double %159, ptr %18, align 8, !tbaa !9
  store double 0x10000000000000, ptr %19, align 8, !tbaa !9
  %160 = load double, ptr %19, align 8, !tbaa !9
  %161 = load double, ptr %18, align 8, !tbaa !9
  %162 = fmul double %161, %160
  store double %162, ptr %18, align 8, !tbaa !9
  br label %163

163:                                              ; preds = %158, %34
  %164 = load double, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  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 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, 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 %164
}

declare double @w2c_hermes_fabs(ptr noundef, double noundef) #2

declare void @w2c_hermes_fp_force_eval(ptr noundef, double noundef) #2

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 = { "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 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 #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

declare double @w2c_hermes_fp_barrier0x2E1(ptr noundef, double noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local double @w2c_hermes_specialcase(ptr noundef %0, double noundef %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #2 {
  %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 %38

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 = tail call double @w2c_hermes_fabs(ptr noundef %0, double noundef %16) #3
  %18 = fcmp olt double %17, 1.000000e+00
  br i1 %18, label %19, label %36

19:                                               ; preds = %12
  %20 = tail call double @w2c_hermes_fp_barrier0x2E1(ptr noundef %0, double noundef 0x10000000000000) #3
  %21 = fmul double %20, 0x10000000000000
  tail call void @w2c_hermes_fp_force_eval(ptr noundef %0, double noundef %21) #3
  %22 = and i64 %13, -9223372036854775808
  %23 = tail call double @f64_reinterpret_i64(i64 noundef %22)
  %24 = fcmp olt double %16, 0.000000e+00
  %25 = select i1 %24, double -1.000000e+00, double 1.000000e+00
  %26 = fadd double %16, %25
  %27 = fsub double %14, %16
  %28 = fadd double %15, %27
  %29 = fsub double %25, %26
  %30 = fadd double %16, %29
  %31 = fadd double %28, %30
  %32 = fadd double %26, %31
  %33 = fsub double %32, %25
  %34 = fcmp oeq double %33, 0.000000e+00
  %35 = select i1 %34, double %23, double %33
  br label %36

36:                                               ; preds = %19, %12
  %.0 = phi double [ %35, %19 ], [ %16, %12 ]
  %37 = fmul double %.0, 0x10000000000000
  br label %38

38:                                               ; preds = %36, %6
  %.090 = phi double [ %11, %6 ], [ %37, %36 ]
  ret double %.090
}

declare double @w2c_hermes_fabs(ptr noundef, double noundef) local_unnamed_addr #1

declare void @w2c_hermes_fp_force_eval(ptr noundef, double noundef) local_unnamed_addr #1

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 = { "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 = { 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