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

; 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: 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: noreturn
declare void @wasm_rt_trap(i32 noundef) #2

declare void @w2c_hermes_0x5F_assert_fail(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Ahbc0x3A0x3ABCProviderFromBuffer0x3A0x3AgetStringTableEntry0x28unsigned0x20int0x290x20const(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #4 {
  %5 = alloca ptr, align 8
  %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
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %15 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %15, ptr %10, align 4, !tbaa !9
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.w2c_hermes, ptr %16, i32 0, i32 6
  %18 = load i32, ptr %10, align 4, !tbaa !9
  %19 = zext i32 %18 to i64
  %20 = add i64 %19, 156
  %21 = call i32 @i32_load(ptr noundef %17, i64 noundef %20)
  store i32 %21, ptr %10, align 4, !tbaa !9
  %22 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %22, ptr %11, align 4, !tbaa !9
  store i32 2, ptr %12, align 4, !tbaa !9
  %23 = load i32, ptr %12, align 4, !tbaa !9
  %24 = and i32 %23, 31
  %25 = load i32, ptr %11, align 4, !tbaa !9
  %26 = shl i32 %25, %24
  store i32 %26, ptr %11, align 4, !tbaa !9
  %27 = load i32, ptr %11, align 4, !tbaa !9
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = add i32 %28, %27
  store i32 %29, ptr %10, align 4, !tbaa !9
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.w2c_hermes, ptr %30, i32 0, i32 6
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = zext i32 %32 to i64
  %34 = call i32 @i32_load(ptr noundef %31, i64 noundef %33)
  store i32 %34, ptr %10, align 4, !tbaa !9
  %35 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %35, ptr %8, align 4, !tbaa !9
  store i32 1, ptr %11, align 4, !tbaa !9
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = and i32 %36, 31
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = lshr i32 %38, %37
  store i32 %39, ptr %10, align 4, !tbaa !9
  store i32 8388607, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = and i32 %41, %40
  store i32 %42, ptr %10, align 4, !tbaa !9
  %43 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %43, ptr %9, align 4, !tbaa !9
  %44 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %44, ptr %10, align 4, !tbaa !9
  store i32 -16777216, ptr %11, align 4, !tbaa !9
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = load i32, ptr %11, align 4, !tbaa !9
  %47 = icmp uge i32 %45, %46
  %48 = zext i1 %47 to i32
  store i32 %48, ptr %10, align 4, !tbaa !9
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %108

51:                                               ; preds = %4
  %52 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %52, ptr %10, align 4, !tbaa !9
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.w2c_hermes, ptr %53, i32 0, i32 6
  %55 = load i32, ptr %10, align 4, !tbaa !9
  %56 = zext i32 %55 to i64
  %57 = add i64 %56, 164
  %58 = call i32 @i32_load(ptr noundef %54, i64 noundef %57)
  store i32 %58, ptr %10, align 4, !tbaa !9
  %59 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %59, ptr %11, align 4, !tbaa !9
  %60 = load i32, ptr %10, align 4, !tbaa !9
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = icmp ule i32 %60, %61
  %63 = zext i1 %62 to i32
  store i32 %63, ptr %10, align 4, !tbaa !9
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %51
  br label %141

67:                                               ; preds = %51
  %68 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %68, ptr %10, align 4, !tbaa !9
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.w2c_hermes, ptr %69, i32 0, i32 6
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  %73 = add i64 %72, 160
  %74 = call i32 @i32_load(ptr noundef %70, i64 noundef %73)
  store i32 %74, ptr %10, align 4, !tbaa !9
  %75 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %75, ptr %11, align 4, !tbaa !9
  store i32 3, ptr %12, align 4, !tbaa !9
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = and i32 %76, 31
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = shl i32 %78, %77
  store i32 %79, ptr %11, align 4, !tbaa !9
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = add i32 %81, %80
  store i32 %82, ptr %10, align 4, !tbaa !9
  %83 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %83, ptr %9, align 4, !tbaa !9
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.w2c_hermes, ptr %84, i32 0, i32 6
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = zext i32 %86 to i64
  %88 = add i64 %87, 4
  %89 = call i32 @i32_load(ptr noundef %85, i64 noundef %88)
  store i32 %89, ptr %10, align 4, !tbaa !9
  %90 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %90, ptr %7, align 4, !tbaa !9
  %91 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %91, ptr %10, align 4, !tbaa !9
  %92 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %92, ptr %11, align 4, !tbaa !9
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.w2c_hermes, ptr %93, i32 0, i32 6
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = zext i32 %95 to i64
  %97 = call i32 @i32_load(ptr noundef %94, i64 noundef %96)
  store i32 %97, ptr %11, align 4, !tbaa !9
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.w2c_hermes, ptr %98, i32 0, i32 6
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = zext i32 %100 to i64
  %102 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %99, i64 noundef %101, i32 noundef %102)
  %103 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %103, ptr %10, align 4, !tbaa !9
  store i32 31, ptr %11, align 4, !tbaa !9
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = and i32 %104, 31
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = shl i32 %106, %105
  store i32 %107, ptr %10, align 4, !tbaa !9
  br label %127

108:                                              ; preds = %4
  %109 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %109, ptr %10, align 4, !tbaa !9
  %110 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %110, ptr %11, align 4, !tbaa !9
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.w2c_hermes, ptr %111, i32 0, i32 6
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = zext i32 %113 to i64
  %115 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %112, i64 noundef %114, i32 noundef %115)
  %116 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %116, ptr %10, align 4, !tbaa !9
  store i32 31, ptr %11, align 4, !tbaa !9
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = and i32 %117, 31
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = shl i32 %119, %118
  store i32 %120, ptr %10, align 4, !tbaa !9
  %121 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %121, ptr %7, align 4, !tbaa !9
  %122 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %122, ptr %10, align 4, !tbaa !9
  store i32 24, ptr %11, align 4, !tbaa !9
  %123 = load i32, ptr %11, align 4, !tbaa !9
  %124 = and i32 %123, 31
  %125 = load i32, ptr %10, align 4, !tbaa !9
  %126 = lshr i32 %125, %124
  store i32 %126, ptr %10, align 4, !tbaa !9
  br label %127

127:                                              ; preds = %108, %67
  %128 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %128, ptr %8, align 4, !tbaa !9
  %129 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %129, ptr %10, align 4, !tbaa !9
  %130 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %130, ptr %11, align 4, !tbaa !9
  %131 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %131, ptr %12, align 4, !tbaa !9
  %132 = load i32, ptr %12, align 4, !tbaa !9
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = or i32 %133, %132
  store i32 %134, ptr %11, align 4, !tbaa !9
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.w2c_hermes, ptr %135, i32 0, i32 6
  %137 = load i32, ptr %10, align 4, !tbaa !9
  %138 = zext i32 %137 to i64
  %139 = add i64 %138, 4
  %140 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %136, i64 noundef %139, i32 noundef %140)
  br label %159

141:                                              ; preds = %66
  store i32 0, ptr %10, align 4, !tbaa !9
  %142 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %142, ptr %8, align 4, !tbaa !9
  store i32 202939, ptr %11, align 4, !tbaa !9
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = load i32, ptr %10, align 4, !tbaa !9
  %145 = add i32 %144, %143
  store i32 %145, ptr %10, align 4, !tbaa !9
  %146 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %146, ptr %11, align 4, !tbaa !9
  store i32 82833, ptr %12, align 4, !tbaa !9
  %147 = load i32, ptr %12, align 4, !tbaa !9
  %148 = load i32, ptr %11, align 4, !tbaa !9
  %149 = add i32 %148, %147
  store i32 %149, ptr %11, align 4, !tbaa !9
  store i32 241, ptr %12, align 4, !tbaa !9
  %150 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %150, ptr %13, align 4, !tbaa !9
  store i32 108367, ptr %14, align 4, !tbaa !9
  %151 = load i32, ptr %14, align 4, !tbaa !9
  %152 = load i32, ptr %13, align 4, !tbaa !9
  %153 = add i32 %152, %151
  store i32 %153, ptr %13, align 4, !tbaa !9
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = load i32, ptr %10, align 4, !tbaa !9
  %156 = load i32, ptr %11, align 4, !tbaa !9
  %157 = load i32, ptr %12, align 4, !tbaa !9
  %158 = load i32, ptr %13, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %154, i32 noundef %155, i32 noundef %156, i32 noundef %157, i32 noundef %158)
  call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

159:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

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 = { noreturn "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 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 #5 = { nounwind }
attributes #6 = { noreturn }

!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: noreturn
declare void @wasm_rt_trap(i32 noundef) local_unnamed_addr #1

declare void @w2c_hermes_0x5F_assert_fail(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Ahbc0x3A0x3ABCProviderFromBuffer0x3A0x3AgetStringTableEntry0x28unsigned0x20int0x290x20const(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = getelementptr inbounds i8, ptr %0, i64 40
  %6 = zext i32 %2 to i64
  %7 = add nuw nsw i64 %6, 156
  %8 = tail call i32 @i32_load(ptr noundef nonnull %5, i64 noundef %7)
  %9 = shl i32 %3, 2
  %10 = add i32 %8, %9
  %11 = zext i32 %10 to i64
  %12 = tail call i32 @i32_load(ptr noundef nonnull %5, i64 noundef %11)
  %13 = lshr i32 %12, 1
  %14 = and i32 %13, 8388607
  %15 = icmp ugt i32 %12, -16777217
  br i1 %15, label %16, label %30

16:                                               ; preds = %4
  %17 = add nuw nsw i64 %6, 164
  %18 = tail call i32 @i32_load(ptr noundef nonnull %5, i64 noundef %17)
  %.not = icmp ugt i32 %18, %14
  br i1 %.not, label %19, label %37

19:                                               ; preds = %16
  %20 = add nuw nsw i64 %6, 160
  %21 = tail call i32 @i32_load(ptr noundef nonnull %5, i64 noundef %20)
  %22 = shl nuw nsw i32 %14, 3
  %23 = add i32 %21, %22
  %24 = zext i32 %23 to i64
  %25 = add nuw nsw i64 %24, 4
  %26 = tail call i32 @i32_load(ptr noundef nonnull %5, i64 noundef %25)
  %27 = tail call i32 @i32_load(ptr noundef nonnull %5, i64 noundef %24)
  %28 = zext i32 %1 to i64
  tail call void @i32_store(ptr noundef nonnull %5, i64 noundef %28, i32 noundef %27)
  %29 = shl i32 %12, 31
  br label %34

30:                                               ; preds = %4
  %31 = zext i32 %1 to i64
  tail call void @i32_store(ptr noundef nonnull %5, i64 noundef %31, i32 noundef %14)
  %32 = shl i32 %12, 31
  %33 = lshr i32 %12, 24
  br label %34

34:                                               ; preds = %30, %19
  %.pre-phi = phi i64 [ %31, %30 ], [ %28, %19 ]
  %.083 = phi i32 [ %33, %30 ], [ %29, %19 ]
  %.0 = phi i32 [ %32, %30 ], [ %26, %19 ]
  %35 = or i32 %.0, %.083
  %36 = add nuw nsw i64 %.pre-phi, 4
  tail call void @i32_store(ptr noundef nonnull %5, i64 noundef %36, i32 noundef %35)
  ret void

37:                                               ; preds = %16
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef %0, i32 noundef 202939, i32 noundef 82833, i32 noundef 241, i32 noundef 108367) #4
  tail call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable
}

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 = { noreturn "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 }
attributes #5 = { noreturn 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,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass