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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store(ptr noundef, i64 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Aunique_ptr0x3Cllvh0x3A0x3AAPFloat0x200x5B0x5D0x2C0x20std0x3A0x3A_0x5F20x3A0x3Adefault_delete0x3Cllvh0x3A0x3AAPFloat0x200x5B0x5D0x3E0x3E0x3A0x3Areset0x5Babi0x3Av150070x5D0x28std0x3A0x3Anullptr_t0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %14 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %14, ptr %11, align 4, !tbaa !9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.w2c_hermes, ptr %15, i32 0, i32 6
  %17 = load i32, ptr %11, align 4, !tbaa !9
  %18 = zext i32 %17 to i64
  %19 = call i32 @i32_load(ptr noundef %16, i64 noundef %18)
  store i32 %19, ptr %11, align 4, !tbaa !9
  %20 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %20, ptr %7, align 4, !tbaa !9
  %21 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %21, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.w2c_hermes, ptr %22, i32 0, i32 6
  %24 = load i32, ptr %11, align 4, !tbaa !9
  %25 = zext i32 %24 to i64
  %26 = load i32, ptr %12, align 4, !tbaa !9
  call void @i32_store(ptr noundef %23, i64 noundef %25, i32 noundef %26)
  %27 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %27, ptr %11, align 4, !tbaa !9
  %28 = load i32, ptr %11, align 4, !tbaa !9
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %112

30:                                               ; preds = %3
  %31 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %31, ptr %11, align 4, !tbaa !9
  store i32 4, ptr %12, align 4, !tbaa !9
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = load i32, ptr %11, align 4, !tbaa !9
  %34 = sub i32 %33, %32
  store i32 %34, ptr %11, align 4, !tbaa !9
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.w2c_hermes, ptr %35, i32 0, i32 6
  %37 = load i32, ptr %11, align 4, !tbaa !9
  %38 = zext i32 %37 to i64
  %39 = call i32 @i32_load(ptr noundef %36, i64 noundef %38)
  store i32 %39, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %40, ptr %5, align 4, !tbaa !9
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %105

43:                                               ; preds = %30
  %44 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %44, ptr %11, align 4, !tbaa !9
  %45 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %45, ptr %12, align 4, !tbaa !9
  store i32 5, ptr %13, align 4, !tbaa !9
  %46 = load i32, ptr %13, align 4, !tbaa !9
  %47 = and i32 %46, 31
  %48 = load i32, ptr %12, align 4, !tbaa !9
  %49 = shl i32 %48, %47
  store i32 %49, ptr %12, align 4, !tbaa !9
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = add i32 %51, %50
  store i32 %52, ptr %11, align 4, !tbaa !9
  %53 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %53, ptr %8, align 4, !tbaa !9
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = call i32 @w2c_hermes_llvh0x3A0x3AAPFloatBase0x3A0x3APPCDoubleDouble0x280x29(ptr noundef %54)
  store i32 %55, ptr %11, align 4, !tbaa !9
  %56 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %56, ptr %9, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %103, %43
  %58 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %58, ptr %11, align 4, !tbaa !9
  store i32 32, ptr %12, align 4, !tbaa !9
  %59 = load i32, ptr %12, align 4, !tbaa !9
  %60 = load i32, ptr %11, align 4, !tbaa !9
  %61 = sub i32 %60, %59
  store i32 %61, ptr %11, align 4, !tbaa !9
  %62 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %62, ptr %5, align 4, !tbaa !9
  store i32 8, ptr %12, align 4, !tbaa !9
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = add i32 %64, %63
  store i32 %65, ptr %11, align 4, !tbaa !9
  %66 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %66, ptr %10, align 4, !tbaa !9
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.w2c_hermes, ptr %67, i32 0, i32 6
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = zext i32 %69 to i64
  %71 = call i32 @i32_load(ptr noundef %68, i64 noundef %70)
  store i32 %71, ptr %11, align 4, !tbaa !9
  %72 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %72, ptr %12, align 4, !tbaa !9
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = icmp ne i32 %73, %74
  %76 = zext i1 %75 to i32
  store i32 %76, ptr %11, align 4, !tbaa !9
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %84

79:                                               ; preds = %57
  %80 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %80, ptr %11, align 4, !tbaa !9
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = call i32 @w2c_hermes_llvh0x3A0x3Adetail0x3A0x3AIEEEFloat0x3A0x3A0x7EIEEEFloat0x280x29(ptr noundef %81, i32 noundef %82)
  store i32 %83, ptr %11, align 4, !tbaa !9
  br label %92

84:                                               ; preds = %57
  %85 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %85, ptr %11, align 4, !tbaa !9
  store i32 20, ptr %12, align 4, !tbaa !9
  %86 = load i32, ptr %12, align 4, !tbaa !9
  %87 = load i32, ptr %11, align 4, !tbaa !9
  %88 = sub i32 %87, %86
  store i32 %88, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = load i32, ptr %12, align 4, !tbaa !9
  call void @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Aunique_ptr0x3Cllvh0x3A0x3AAPFloat0x200x5B0x5D0x2C0x20std0x3A0x3A_0x5F20x3A0x3Adefault_delete0x3Cllvh0x3A0x3AAPFloat0x200x5B0x5D0x3E0x3E0x3A0x3Areset0x5Babi0x3Av150070x5D0x28std0x3A0x3Anullptr_t0x29(ptr noundef %89, i32 noundef %90, i32 noundef %91)
  br label %92

92:                                               ; preds = %84, %79
  %93 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %93, ptr %11, align 4, !tbaa !9
  %94 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %94, ptr %8, align 4, !tbaa !9
  %95 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %95, ptr %11, align 4, !tbaa !9
  %96 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %96, ptr %12, align 4, !tbaa !9
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = icmp ne i32 %97, %98
  %100 = zext i1 %99 to i32
  store i32 %100, ptr %11, align 4, !tbaa !9
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %92
  br label %57

104:                                              ; preds = %92
  br label %105

105:                                              ; preds = %104, %30
  %106 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %106, ptr %11, align 4, !tbaa !9
  store i32 8, ptr %12, align 4, !tbaa !9
  %107 = load i32, ptr %12, align 4, !tbaa !9
  %108 = load i32, ptr %11, align 4, !tbaa !9
  %109 = sub i32 %108, %107
  store i32 %109, ptr %11, align 4, !tbaa !9
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = load i32, ptr %11, align 4, !tbaa !9
  call void @w2c_hermes_operator0x20delete0x5B0x5D0x28void0x2A0x29(ptr noundef %110, i32 noundef %111)
  br label %112

112:                                              ; preds = %105, %3
  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 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
  ret void
}

declare i32 @w2c_hermes_llvh0x3A0x3AAPFloatBase0x3A0x3APPCDoubleDouble0x280x29(ptr noundef) #3

declare i32 @w2c_hermes_llvh0x3A0x3Adetail0x3A0x3AIEEEFloat0x3A0x3A0x7EIEEEFloat0x280x29(ptr noundef, i32 noundef) #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Aunique_ptr0x3Cllvh0x3A0x3AAPFloat0x200x5B0x5D0x2C0x20std0x3A0x3A_0x5F20x3A0x3Adefault_delete0x3Cllvh0x3A0x3AAPFloat0x200x5B0x5D0x3E0x3E0x3A0x3Areset0x5Babi0x3Av150070x5D0x28std0x3A0x3Anullptr_t0x29(ptr noundef %0, i32 noundef %1, i32 %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  %5 = zext i32 %1 to i64
  %6 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %5)
  tail call void @i32_store(ptr noundef nonnull %4, i64 noundef %5, i32 noundef 0)
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %26, label %7

7:                                                ; preds = %3
  %8 = add i32 %6, -4
  %9 = zext i32 %8 to i64
  %10 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %9)
  %.not62 = icmp eq i32 %10, 0
  br i1 %.not62, label %.loopexit, label %11

11:                                               ; preds = %7
  %12 = shl i32 %10, 5
  %13 = add i32 %12, %6
  %14 = tail call i32 @w2c_hermes_llvh0x3A0x3AAPFloatBase0x3A0x3APPCDoubleDouble0x280x29(ptr noundef %0) #3
  br label %15

15:                                               ; preds = %24, %11
  %.0 = phi i32 [ %13, %11 ], [ %16, %24 ]
  %16 = add i32 %.0, -32
  %17 = add i32 %.0, -24
  %18 = zext i32 %17 to i64
  %19 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %18)
  %.not63 = icmp eq i32 %19, %14
  br i1 %.not63, label %22, label %20

20:                                               ; preds = %15
  %21 = tail call i32 @w2c_hermes_llvh0x3A0x3Adetail0x3A0x3AIEEEFloat0x3A0x3A0x7EIEEEFloat0x280x29(ptr noundef %0, i32 noundef %17) #3
  br label %24

22:                                               ; preds = %15
  %23 = add i32 %.0, -20
  tail call void @w2c_hermes_std0x3A0x3A_0x5F20x3A0x3Aunique_ptr0x3Cllvh0x3A0x3AAPFloat0x200x5B0x5D0x2C0x20std0x3A0x3A_0x5F20x3A0x3Adefault_delete0x3Cllvh0x3A0x3AAPFloat0x200x5B0x5D0x3E0x3E0x3A0x3Areset0x5Babi0x3Av150070x5D0x28std0x3A0x3Anullptr_t0x29(ptr noundef %0, i32 noundef %23, i32 poison)
  br label %24

24:                                               ; preds = %22, %20
  %.not64 = icmp eq i32 %16, %6
  br i1 %.not64, label %.loopexit, label %15

.loopexit:                                        ; preds = %24, %7
  %25 = add i32 %6, -8
  tail call void @w2c_hermes_operator0x20delete0x5B0x5D0x28void0x2A0x29(ptr noundef %0, i32 noundef %25) #3
  br label %26

26:                                               ; preds = %.loopexit, %3
  ret void
}

declare i32 @w2c_hermes_llvh0x3A0x3AAPFloatBase0x3A0x3APPCDoubleDouble0x280x29(ptr noundef) local_unnamed_addr #2

declare i32 @w2c_hermes_llvh0x3A0x3Adetail0x3A0x3AIEEEFloat0x3A0x3A0x7EIEEEFloat0x280x29(ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @w2c_hermes_operator0x20delete0x5B0x5D0x28void0x2A0x29(ptr noundef, i32 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: DeadArgumentEliminationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass