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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ARuntime0x3A0x3AgcStableHashHermesValue0x28hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue0x3E0x29(ptr noundef, i32 noundef, i32 noundef) #2

declare i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AisSameValueZero0x28hermes0x3A0x3Avm0x3A0x3AHermesValue0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue0x29(ptr noundef, i64 noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AOrderedHashMap0x3A0x3Ahas0x28hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AOrderedHashMap0x3E0x2C0x20hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue0x3E0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  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 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %16 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %16, ptr %10, align 4, !tbaa !9
  %17 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %17, ptr %11, align 4, !tbaa !9
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = load i32, ptr %10, align 4, !tbaa !9
  %20 = load i32, ptr %11, align 4, !tbaa !9
  %21 = call i64 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ARuntime0x3A0x3AgcStableHashHermesValue0x28hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue0x3E0x29(ptr noundef %18, i32 noundef %19, i32 noundef %20)
  store i64 %21, ptr %14, align 8, !tbaa !11
  %22 = load i64, ptr %14, align 8, !tbaa !11
  store i64 %22, ptr %9, align 8, !tbaa !11
  %23 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %23, ptr %10, align 4, !tbaa !9
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.w2c_hermes, ptr %24, i32 0, i32 6
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = zext i32 %26 to i64
  %28 = call i32 @i32_load(ptr noundef %25, i64 noundef %27)
  store i32 %28, ptr %10, align 4, !tbaa !9
  %29 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %29, ptr %6, 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 = add i64 %33, 4
  %35 = call i32 @i32_load(ptr noundef %31, i64 noundef %34)
  store i32 %35, ptr %10, align 4, !tbaa !9
  %36 = load i64, ptr %9, align 8, !tbaa !11
  store i64 %36, ptr %15, align 8, !tbaa !11
  %37 = load i64, ptr %15, align 8, !tbaa !11
  %38 = trunc i64 %37 to i32
  store i32 %38, ptr %11, align 4, !tbaa !9
  %39 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %39, ptr %12, align 4, !tbaa !9
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.w2c_hermes, ptr %40, i32 0, i32 6
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = zext i32 %42 to i64
  %44 = add i64 %43, 16
  %45 = call i32 @i32_load(ptr noundef %41, i64 noundef %44)
  store i32 %45, ptr %12, align 4, !tbaa !9
  store i32 1, ptr %13, align 4, !tbaa !9
  %46 = load i32, ptr %13, align 4, !tbaa !9
  %47 = load i32, ptr %12, align 4, !tbaa !9
  %48 = sub i32 %47, %46
  store i32 %48, ptr %12, align 4, !tbaa !9
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = load i32, ptr %11, align 4, !tbaa !9
  %51 = and i32 %50, %49
  store i32 %51, ptr %11, align 4, !tbaa !9
  store i32 2, ptr %12, align 4, !tbaa !9
  %52 = load i32, ptr %12, align 4, !tbaa !9
  %53 = and i32 %52, 31
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = shl i32 %54, %53
  store i32 %55, ptr %11, align 4, !tbaa !9
  %56 = load i32, ptr %11, align 4, !tbaa !9
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = add i32 %57, %56
  store i32 %58, ptr %10, align 4, !tbaa !9
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.w2c_hermes, ptr %59, i32 0, i32 6
  %61 = load i32, ptr %10, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = add i64 %62, 8
  %64 = call i32 @i32_load(ptr noundef %60, i64 noundef %63)
  store i32 %64, ptr %10, align 4, !tbaa !9
  %65 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %65, ptr %6, align 4, !tbaa !9
  %66 = load i32, ptr %10, align 4, !tbaa !9
  switch i32 %66, label %75 [
    i32 0, label %67
    i32 1, label %68
    i32 2, label %69
    i32 3, label %70
    i32 4, label %71
    i32 5, label %72
    i32 6, label %73
    i32 7, label %74
  ]

67:                                               ; preds = %4
  br label %118

68:                                               ; preds = %4
  br label %76

69:                                               ; preds = %4
  br label %76

70:                                               ; preds = %4
  br label %76

71:                                               ; preds = %4
  br label %76

72:                                               ; preds = %4
  br label %76

73:                                               ; preds = %4
  br label %76

74:                                               ; preds = %4
  br label %118

75:                                               ; preds = %4
  br label %76

76:                                               ; preds = %75, %73, %72, %71, %70, %69, %68
  %77 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %77, ptr %10, align 4, !tbaa !9
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.w2c_hermes, ptr %78, i32 0, i32 6
  %80 = load i32, ptr %10, align 4, !tbaa !9
  %81 = zext i32 %80 to i64
  %82 = call i64 @i64_load(ptr noundef %79, i64 noundef %81)
  store i64 %82, ptr %14, align 8, !tbaa !11
  %83 = load i64, ptr %14, align 8, !tbaa !11
  store i64 %83, ptr %9, align 8, !tbaa !11
  br label %84

84:                                               ; preds = %116, %76
  %85 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %85, ptr %10, align 4, !tbaa !9
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.w2c_hermes, ptr %86, i32 0, i32 6
  %88 = load i32, ptr %10, align 4, !tbaa !9
  %89 = zext i32 %88 to i64
  %90 = add i64 %89, 8
  %91 = call i64 @i64_load(ptr noundef %87, i64 noundef %90)
  store i64 %91, ptr %14, align 8, !tbaa !11
  %92 = load i64, ptr %9, align 8, !tbaa !11
  store i64 %92, ptr %15, align 8, !tbaa !11
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load i64, ptr %14, align 8, !tbaa !11
  %95 = load i64, ptr %15, align 8, !tbaa !11
  %96 = call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AisSameValueZero0x28hermes0x3A0x3Avm0x3A0x3AHermesValue0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue0x29(ptr noundef %93, i64 noundef %94, i64 noundef %95)
  store i32 %96, ptr %10, align 4, !tbaa !9
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %105

99:                                               ; preds = %84
  %100 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %100, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !9
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = load i32, ptr %11, align 4, !tbaa !9
  %103 = icmp ne i32 %101, %102
  %104 = zext i1 %103 to i32
  store i32 %104, ptr %10, align 4, !tbaa !9
  br label %119

105:                                              ; preds = %84
  %106 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %106, ptr %10, align 4, !tbaa !9
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.w2c_hermes, ptr %107, i32 0, i32 6
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = zext i32 %109 to i64
  %111 = add i64 %110, 32
  %112 = call i32 @i32_load(ptr noundef %108, i64 noundef %111)
  store i32 %112, ptr %10, align 4, !tbaa !9
  %113 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %113, ptr %6, align 4, !tbaa !9
  %114 = load i32, ptr %10, align 4, !tbaa !9
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %117

116:                                              ; preds = %105
  br label %84

117:                                              ; preds = %105
  br label %118

118:                                              ; preds = %117, %74, %67
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %118, %99
  %120 = load i32, ptr %10, align 4, !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 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 8, ptr %9) #4
  ret i32 %120
}

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}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !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 i64 @i64_load(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ARuntime0x3A0x3AgcStableHashHermesValue0x28hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue0x3E0x29(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AisSameValueZero0x28hermes0x3A0x3Avm0x3A0x3AHermesValue0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue0x29(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AOrderedHashMap0x3A0x3Ahas0x28hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AOrderedHashMap0x3E0x2C0x20hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue0x3E0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #1 {
  %5 = tail call i64 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ARuntime0x3A0x3AgcStableHashHermesValue0x28hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue0x3E0x29(ptr noundef %0, i32 noundef %2, i32 noundef %3)
  %6 = getelementptr inbounds i8, ptr %0, i64 40
  %7 = zext i32 %1 to i64
  %8 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %7)
  %9 = zext i32 %8 to i64
  %10 = add nuw nsw i64 %9, 4
  %11 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %10)
  %12 = trunc i64 %5 to i32
  %13 = add nuw nsw i64 %9, 16
  %14 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %13)
  %15 = add i32 %14, 1073741823
  %16 = and i32 %15, %12
  %17 = shl i32 %16, 2
  %18 = add i32 %17, %11
  %19 = zext i32 %18 to i64
  %20 = add nuw nsw i64 %19, 8
  %21 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %20)
  switch i32 %21, label %22 [
    i32 0, label %.loopexit
    i32 7, label %.loopexit
  ]

22:                                               ; preds = %4
  %23 = zext i32 %3 to i64
  %24 = tail call i64 @i64_load(ptr noundef nonnull %6, i64 noundef %23)
  br label %25

25:                                               ; preds = %33, %22
  %.0 = phi i32 [ %21, %22 ], [ %35, %33 ]
  %26 = zext i32 %.0 to i64
  %27 = add nuw nsw i64 %26, 8
  %28 = tail call i64 @i64_load(ptr noundef nonnull %6, i64 noundef %27)
  %29 = tail call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AisSameValueZero0x28hermes0x3A0x3Avm0x3A0x3AHermesValue0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue0x29(ptr noundef %0, i64 noundef %28, i64 noundef %24) #3
  %.not = icmp eq i32 %29, 0
  br i1 %.not, label %33, label %30

30:                                               ; preds = %25
  %31 = icmp ne i32 %.0, 0
  %32 = zext i1 %31 to i32
  br label %.loopexit

33:                                               ; preds = %25
  %34 = add nuw nsw i64 %26, 32
  %35 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %34)
  %.not51 = icmp eq i32 %35, 0
  br i1 %.not51, label %.loopexit, label %25

.loopexit:                                        ; preds = %33, %4, %4, %30
  %.049 = phi i32 [ %32, %30 ], [ 0, %4 ], [ 0, %4 ], [ 0, %33 ]
  ret i32 %.049
}

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,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass