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

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

%struct.w2c_hermes = type { ptr, ptr, ptr, i32, i32, i32, %struct.wasm_rt_memory_t, %struct.wasm_rt_funcref_table_t }
%struct.wasm_rt_memory_t = type { ptr, i64, i64, i64, i8 }
%struct.wasm_rt_funcref_table_t = type { ptr, i32, i32 }

; 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 i32 @i32_load16_u(ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden double @wasm_floor(double noundef) #2

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

31:                                               ; preds = %2
  store i32 79152, ptr %7, align 4, !tbaa !11
  br label %67

32:                                               ; preds = %2
  store i32 79184, ptr %7, align 4, !tbaa !11
  store i32 79184, ptr %8, align 4, !tbaa !11
  store i32 79152, ptr %9, align 4, !tbaa !11
  %33 = load double, ptr %6, align 8, !tbaa !9
  store double %33, ptr %14, align 8, !tbaa !9
  store double 4.000000e+02, ptr %15, align 8, !tbaa !9
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = load double, ptr %14, align 8, !tbaa !9
  %36 = load double, ptr %15, align 8, !tbaa !9
  %37 = call double @w2c_hermes_fmod(ptr noundef %34, double noundef %35, double noundef %36)
  store double %37, ptr %14, align 8, !tbaa !9
  store double 0.000000e+00, ptr %15, align 8, !tbaa !9
  %38 = load double, ptr %14, align 8, !tbaa !9
  %39 = load double, ptr %15, align 8, !tbaa !9
  %40 = fcmp oeq double %38, %39
  %41 = zext i1 %40 to i32
  store i32 %41, ptr %10, align 4, !tbaa !11
  %42 = load i32, ptr %10, align 4, !tbaa !11
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %32
  %45 = load i32, ptr %8, align 4, !tbaa !11
  br label %48

46:                                               ; preds = %32
  %47 = load i32, ptr %9, align 4, !tbaa !11
  br label %48

48:                                               ; preds = %46, %44
  %49 = phi i32 [ %45, %44 ], [ %47, %46 ]
  store i32 %49, ptr %8, align 4, !tbaa !11
  %50 = load double, ptr %6, align 8, !tbaa !9
  store double %50, ptr %13, align 8, !tbaa !9
  store double 1.000000e+02, ptr %14, align 8, !tbaa !9
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = load double, ptr %13, align 8, !tbaa !9
  %53 = load double, ptr %14, align 8, !tbaa !9
  %54 = call double @w2c_hermes_fmod(ptr noundef %51, double noundef %52, double noundef %53)
  store double %54, ptr %13, align 8, !tbaa !9
  store double 0.000000e+00, ptr %14, align 8, !tbaa !9
  %55 = load double, ptr %13, align 8, !tbaa !9
  %56 = load double, ptr %14, align 8, !tbaa !9
  %57 = fcmp une double %55, %56
  %58 = zext i1 %57 to i32
  store i32 %58, ptr %9, align 4, !tbaa !11
  %59 = load i32, ptr %9, align 4, !tbaa !11
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %63

61:                                               ; preds = %48
  %62 = load i32, ptr %7, align 4, !tbaa !11
  br label %65

63:                                               ; preds = %48
  %64 = load i32, ptr %8, align 4, !tbaa !11
  br label %65

65:                                               ; preds = %63, %61
  %66 = phi i32 [ %62, %61 ], [ %64, %63 ]
  store i32 %66, ptr %7, align 4, !tbaa !11
  br label %67

67:                                               ; preds = %65, %31
  %68 = load i32, ptr %7, align 4, !tbaa !11
  store i32 %68, ptr %5, align 4, !tbaa !11
  %69 = load double, ptr %4, align 8, !tbaa !9
  store double %69, ptr %11, align 8, !tbaa !9
  store double 8.640000e+07, ptr %12, align 8, !tbaa !9
  %70 = load double, ptr %12, align 8, !tbaa !9
  %71 = load double, ptr %11, align 8, !tbaa !9
  %72 = fdiv double %71, %70
  store double %72, ptr %11, align 8, !tbaa !9
  %73 = load double, ptr %11, align 8, !tbaa !9
  %74 = call double @wasm_floor(double noundef %73)
  store double %74, ptr %11, align 8, !tbaa !9
  %75 = load double, ptr %6, align 8, !tbaa !9
  store double %75, ptr %12, align 8, !tbaa !9
  store double -1.601000e+03, ptr %13, align 8, !tbaa !9
  %76 = load double, ptr %13, align 8, !tbaa !9
  %77 = load double, ptr %12, align 8, !tbaa !9
  %78 = fadd double %77, %76
  store double %78, ptr %12, align 8, !tbaa !9
  store double 4.000000e+02, ptr %13, align 8, !tbaa !9
  %79 = load double, ptr %13, align 8, !tbaa !9
  %80 = load double, ptr %12, align 8, !tbaa !9
  %81 = fdiv double %80, %79
  store double %81, ptr %12, align 8, !tbaa !9
  %82 = load double, ptr %12, align 8, !tbaa !9
  %83 = call double @wasm_floor(double noundef %82)
  store double %83, ptr %12, align 8, !tbaa !9
  %84 = load double, ptr %6, align 8, !tbaa !9
  store double %84, ptr %13, align 8, !tbaa !9
  store double -1.970000e+03, ptr %14, align 8, !tbaa !9
  %85 = load double, ptr %14, align 8, !tbaa !9
  %86 = load double, ptr %13, align 8, !tbaa !9
  %87 = fadd double %86, %85
  store double %87, ptr %13, align 8, !tbaa !9
  store double 3.650000e+02, ptr %14, align 8, !tbaa !9
  %88 = load double, ptr %14, align 8, !tbaa !9
  %89 = load double, ptr %13, align 8, !tbaa !9
  %90 = fmul double %89, %88
  store double %90, ptr %13, align 8, !tbaa !9
  %91 = load double, ptr %6, align 8, !tbaa !9
  store double %91, ptr %14, align 8, !tbaa !9
  store double -1.969000e+03, ptr %15, align 8, !tbaa !9
  %92 = load double, ptr %15, align 8, !tbaa !9
  %93 = load double, ptr %14, align 8, !tbaa !9
  %94 = fadd double %93, %92
  store double %94, ptr %14, align 8, !tbaa !9
  store double 2.500000e-01, ptr %15, align 8, !tbaa !9
  %95 = load double, ptr %15, align 8, !tbaa !9
  %96 = load double, ptr %14, align 8, !tbaa !9
  %97 = fmul double %96, %95
  store double %97, ptr %14, align 8, !tbaa !9
  %98 = load double, ptr %14, align 8, !tbaa !9
  %99 = call double @wasm_floor(double noundef %98)
  store double %99, ptr %14, align 8, !tbaa !9
  %100 = load double, ptr %14, align 8, !tbaa !9
  %101 = load double, ptr %13, align 8, !tbaa !9
  %102 = fadd double %101, %100
  store double %102, ptr %13, align 8, !tbaa !9
  %103 = load double, ptr %6, align 8, !tbaa !9
  store double %103, ptr %14, align 8, !tbaa !9
  store double -1.901000e+03, ptr %15, align 8, !tbaa !9
  %104 = load double, ptr %15, align 8, !tbaa !9
  %105 = load double, ptr %14, align 8, !tbaa !9
  %106 = fadd double %105, %104
  store double %106, ptr %14, align 8, !tbaa !9
  store double 1.000000e+02, ptr %15, align 8, !tbaa !9
  %107 = load double, ptr %15, align 8, !tbaa !9
  %108 = load double, ptr %14, align 8, !tbaa !9
  %109 = fdiv double %108, %107
  store double %109, ptr %14, align 8, !tbaa !9
  %110 = load double, ptr %14, align 8, !tbaa !9
  %111 = call double @wasm_floor(double noundef %110)
  store double %111, ptr %14, align 8, !tbaa !9
  %112 = load double, ptr %14, align 8, !tbaa !9
  %113 = load double, ptr %13, align 8, !tbaa !9
  %114 = fsub double %113, %112
  store double %114, ptr %13, align 8, !tbaa !9
  %115 = load double, ptr %13, align 8, !tbaa !9
  %116 = load double, ptr %12, align 8, !tbaa !9
  %117 = fadd double %116, %115
  store double %117, ptr %12, align 8, !tbaa !9
  %118 = load double, ptr %12, align 8, !tbaa !9
  %119 = load double, ptr %11, align 8, !tbaa !9
  %120 = fsub double %119, %118
  store double %120, ptr %11, align 8, !tbaa !9
  %121 = load i32, ptr %5, align 4, !tbaa !11
  store i32 %121, ptr %8, align 4, !tbaa !11
  %122 = load double, ptr %4, align 8, !tbaa !9
  store double %122, ptr %13, align 8, !tbaa !9
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = load double, ptr %13, align 8, !tbaa !9
  %125 = call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AmonthFromTime0x28double0x29(ptr noundef %123, double noundef %124)
  store i32 %125, ptr %9, align 4, !tbaa !11
  store i32 1, ptr %10, align 4, !tbaa !11
  %126 = load i32, ptr %10, align 4, !tbaa !11
  %127 = and i32 %126, 31
  %128 = load i32, ptr %9, align 4, !tbaa !11
  %129 = shl i32 %128, %127
  store i32 %129, ptr %9, align 4, !tbaa !11
  %130 = load i32, ptr %9, align 4, !tbaa !11
  %131 = load i32, ptr %8, align 4, !tbaa !11
  %132 = add i32 %131, %130
  store i32 %132, ptr %8, align 4, !tbaa !11
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.w2c_hermes, ptr %133, i32 0, i32 6
  %135 = load i32, ptr %8, align 4, !tbaa !11
  %136 = zext i32 %135 to i64
  %137 = call i32 @i32_load16_u(ptr noundef %134, i64 noundef %136)
  store i32 %137, ptr %8, align 4, !tbaa !11
  %138 = load i32, ptr %8, align 4, !tbaa !11
  %139 = uitofp i32 %138 to double
  store double %139, ptr %12, align 8, !tbaa !9
  %140 = load double, ptr %12, align 8, !tbaa !9
  %141 = load double, ptr %11, align 8, !tbaa !9
  %142 = fsub double %141, %140
  store double %142, ptr %11, align 8, !tbaa !9
  store double 1.000000e+00, ptr %12, align 8, !tbaa !9
  %143 = load double, ptr %12, align 8, !tbaa !9
  %144 = load double, ptr %11, align 8, !tbaa !9
  %145 = fadd double %144, %143
  store double %145, ptr %11, align 8, !tbaa !9
  %146 = load double, ptr %11, align 8, !tbaa !9
  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 8, 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 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 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret double %146
}

declare double @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AyearFromTime0x28double0x29(ptr noundef, double noundef) #3

declare double @w2c_hermes_fmod(ptr noundef, double noundef, double noundef) #3

declare i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AmonthFromTime0x28double0x29(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 = !{!"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 i32 @i32_load16_u(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden double @wasm_floor(double noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local double @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AdateFromTime0x28double0x29(ptr noundef %0, double noundef %1) local_unnamed_addr #1 {
  %3 = tail call double @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AyearFromTime0x28double0x29(ptr noundef %0, double noundef %1) #3
  %4 = tail call double @w2c_hermes_fmod(ptr noundef %0, double noundef %3, double noundef 4.000000e+00) #3
  %5 = fcmp une double %4, 0.000000e+00
  br i1 %5, label %13, label %6

6:                                                ; preds = %2
  %7 = tail call double @w2c_hermes_fmod(ptr noundef %0, double noundef %3, double noundef 4.000000e+02) #3
  %8 = fcmp oeq double %7, 0.000000e+00
  %9 = tail call double @w2c_hermes_fmod(ptr noundef %0, double noundef %3, double noundef 1.000000e+02) #3
  %10 = fcmp une double %9, 0.000000e+00
  %11 = select i1 %10, i1 true, i1 %8
  %12 = select i1 %11, i32 79184, i32 79152
  br label %13

13:                                               ; preds = %2, %6
  %.0 = phi i32 [ %12, %6 ], [ 79152, %2 ]
  %14 = fdiv double %1, 8.640000e+07
  %15 = tail call double @wasm_floor(double noundef %14)
  %16 = fadd double %3, -1.601000e+03
  %17 = fdiv double %16, 4.000000e+02
  %18 = tail call double @wasm_floor(double noundef %17)
  %19 = fadd double %3, -1.970000e+03
  %20 = fmul double %19, 3.650000e+02
  %21 = fadd double %3, -1.969000e+03
  %22 = fmul double %21, 2.500000e-01
  %23 = tail call double @wasm_floor(double noundef %22)
  %24 = fadd double %20, %23
  %25 = fadd double %3, -1.901000e+03
  %26 = fdiv double %25, 1.000000e+02
  %27 = tail call double @wasm_floor(double noundef %26)
  %28 = fsub double %24, %27
  %29 = fadd double %18, %28
  %30 = fsub double %15, %29
  %31 = tail call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AmonthFromTime0x28double0x29(ptr noundef %0, double noundef %1) #3
  %32 = shl i32 %31, 1
  %33 = add i32 %32, %.0
  %34 = getelementptr inbounds i8, ptr %0, i64 40
  %35 = zext i32 %33 to i64
  %36 = tail call i32 @i32_load16_u(ptr noundef nonnull %34, i64 noundef %35)
  %37 = uitofp i32 %36 to double
  %38 = fsub double %30, %37
  %39 = fadd double %38, 1.000000e+00
  ret double %39
}

declare double @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AyearFromTime0x28double0x29(ptr noundef, double noundef) local_unnamed_addr #2

declare double @w2c_hermes_fmod(ptr noundef, double noundef, double noundef) local_unnamed_addr #2

declare i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AmonthFromTime0x28double0x29(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