; LLVM IR from facebook/hermes :: API/hermes_sandbox/external (hermes_sandbox_impl_opt_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"

%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 void @i32_store8(ptr noundef, i64 noundef, i32 noundef) #1

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

; 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_non0x2Dvirtual0x20thunk0x20to0x20hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AMarkAcceptor0x3A0x3Aaccept0x28hermes0x3A0x3Avm0x3A0x3AGCPointerBase0x260x29(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 %6, 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 %11, align 4, !tbaa !9
  %22 = icmp ne i32 %21, 0
  %23 = xor i1 %22, true
  %24 = zext i1 %23 to i32
  store i32 %24, ptr %11, align 4, !tbaa !9
  %25 = load i32, ptr %11, align 4, !tbaa !9
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %3
  br label %138

28:                                               ; preds = %3
  %29 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %29, ptr %11, align 4, !tbaa !9
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.w2c_hermes, ptr %30, i32 0, i32 6
  %32 = load i32, ptr %11, 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 %11, align 4, !tbaa !9
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.w2c_hermes, ptr %36, i32 0, i32 6
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = zext i32 %38 to i64
  %40 = add i64 %39, 4400
  %41 = call i32 @i32_load(ptr noundef %37, i64 noundef %40)
  store i32 %41, ptr %11, align 4, !tbaa !9
  %42 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %42, ptr %8, align 4, !tbaa !9
  %43 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %43, ptr %12, align 4, !tbaa !9
  store i32 -4194304, ptr %13, align 4, !tbaa !9
  %44 = load i32, ptr %13, align 4, !tbaa !9
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = and i32 %45, %44
  store i32 %46, ptr %12, align 4, !tbaa !9
  %47 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %47, ptr %9, align 4, !tbaa !9
  %48 = load i32, ptr %11, align 4, !tbaa !9
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = icmp ne i32 %48, %49
  %51 = zext i1 %50 to i32
  store i32 %51, ptr %11, align 4, !tbaa !9
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %28
  br label %87

55:                                               ; preds = %28
  %56 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %56, ptr %11, align 4, !tbaa !9
  %57 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %57, ptr %12, align 4, !tbaa !9
  store i32 -4194304, ptr %13, align 4, !tbaa !9
  %58 = load i32, ptr %13, align 4, !tbaa !9
  %59 = load i32, ptr %12, align 4, !tbaa !9
  %60 = and i32 %59, %58
  store i32 %60, ptr %12, align 4, !tbaa !9
  %61 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %61, ptr %10, align 4, !tbaa !9
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = icmp eq i32 %62, %63
  %65 = zext i1 %64 to i32
  store i32 %65, ptr %11, align 4, !tbaa !9
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %55
  br label %87

69:                                               ; preds = %55
  %70 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %70, ptr %11, align 4, !tbaa !9
  %71 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %71, ptr %12, align 4, !tbaa !9
  store i32 9, ptr %13, align 4, !tbaa !9
  %72 = load i32, ptr %13, align 4, !tbaa !9
  %73 = and i32 %72, 31
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = lshr i32 %74, %73
  store i32 %75, ptr %12, align 4, !tbaa !9
  store i32 8191, ptr %13, align 4, !tbaa !9
  %76 = load i32, ptr %13, align 4, !tbaa !9
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = and i32 %77, %76
  store i32 %78, ptr %12, align 4, !tbaa !9
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = add i32 %80, %79
  store i32 %81, ptr %11, align 4, !tbaa !9
  store i32 1, ptr %12, align 4, !tbaa !9
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.w2c_hermes, ptr %82, i32 0, i32 6
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = zext i32 %84 to i64
  %86 = load i32, ptr %12, align 4, !tbaa !9
  call void @i32_store8(ptr noundef %83, i64 noundef %85, i32 noundef %86)
  br label %87

87:                                               ; preds = %69, %68, %54
  %88 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %88, ptr %11, align 4, !tbaa !9
  store i32 16384, ptr %12, align 4, !tbaa !9
  %89 = load i32, ptr %12, align 4, !tbaa !9
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = add i32 %90, %89
  store i32 %91, ptr %11, align 4, !tbaa !9
  %92 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %92, ptr %6, align 4, !tbaa !9
  %93 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %93, ptr %12, align 4, !tbaa !9
  %94 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %94, ptr %13, align 4, !tbaa !9
  %95 = load i32, ptr %13, align 4, !tbaa !9
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = sub i32 %96, %95
  store i32 %97, ptr %12, align 4, !tbaa !9
  %98 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %98, ptr %6, align 4, !tbaa !9
  store i32 6, ptr %13, align 4, !tbaa !9
  %99 = load i32, ptr %13, align 4, !tbaa !9
  %100 = and i32 %99, 31
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = lshr i32 %101, %100
  store i32 %102, ptr %12, align 4, !tbaa !9
  store i32 67108860, ptr %13, align 4, !tbaa !9
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = and i32 %104, %103
  store i32 %105, ptr %12, align 4, !tbaa !9
  %106 = load i32, ptr %12, align 4, !tbaa !9
  %107 = load i32, ptr %11, align 4, !tbaa !9
  %108 = add i32 %107, %106
  store i32 %108, ptr %11, align 4, !tbaa !9
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.w2c_hermes, ptr %109, i32 0, i32 6
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  %113 = call i32 @i32_load(ptr noundef %110, i64 noundef %112)
  store i32 %113, ptr %11, align 4, !tbaa !9
  %114 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %114, ptr %12, align 4, !tbaa !9
  store i32 3, ptr %13, align 4, !tbaa !9
  %115 = load i32, ptr %13, align 4, !tbaa !9
  %116 = and i32 %115, 31
  %117 = load i32, ptr %12, align 4, !tbaa !9
  %118 = lshr i32 %117, %116
  store i32 %118, ptr %12, align 4, !tbaa !9
  %119 = load i32, ptr %12, align 4, !tbaa !9
  %120 = and i32 %119, 31
  %121 = load i32, ptr %11, align 4, !tbaa !9
  %122 = lshr i32 %121, %120
  store i32 %122, ptr %11, align 4, !tbaa !9
  store i32 1, ptr %12, align 4, !tbaa !9
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = load i32, ptr %11, align 4, !tbaa !9
  %125 = and i32 %124, %123
  store i32 %125, ptr %11, align 4, !tbaa !9
  %126 = load i32, ptr %11, align 4, !tbaa !9
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %87
  br label %138

129:                                              ; preds = %87
  %130 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %130, ptr %11, align 4, !tbaa !9
  store i32 4, ptr %12, align 4, !tbaa !9
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = load i32, ptr %11, align 4, !tbaa !9
  %133 = sub i32 %132, %131
  store i32 %133, ptr %11, align 4, !tbaa !9
  %134 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %134, ptr %12, align 4, !tbaa !9
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = load i32, ptr %11, align 4, !tbaa !9
  %137 = load i32, ptr %12, align 4, !tbaa !9
  call void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AMarkAcceptor0x3A0x3Apush0x28hermes0x3A0x3Avm0x3A0x3AGCCell0x2A0x29(ptr noundef %135, i32 noundef %136, i32 noundef %137)
  br label %138

138:                                              ; preds = %129, %128, %27
  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 void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AMarkAcceptor0x3A0x3Apush0x28hermes0x3A0x3Avm0x3A0x3AGCCell0x2A0x29(ptr noundef, i32 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 void @i32_store8(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

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

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

7:                                                ; preds = %3
  %8 = zext i32 %1 to i64
  %9 = add nuw nsw i64 %8, 4
  %10 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %9)
  %11 = zext i32 %10 to i64
  %12 = add nuw nsw i64 %11, 4400
  %13 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %12)
  %14 = and i32 %6, -4194304
  %.not70 = icmp eq i32 %13, %14
  br i1 %.not70, label %15, label %23

15:                                               ; preds = %7
  %16 = and i32 %2, -4194304
  %17 = icmp eq i32 %13, %16
  br i1 %17, label %23, label %18

18:                                               ; preds = %15
  %19 = lshr i32 %2, 9
  %20 = and i32 %19, 8191
  %21 = or disjoint i32 %20, %16
  %22 = zext i32 %21 to i64
  tail call void @i32_store8(ptr noundef nonnull %4, i64 noundef %22, i32 noundef 1)
  br label %23

23:                                               ; preds = %15, %7, %18
  %24 = or disjoint i32 %14, 16384
  %25 = sub i32 %6, %24
  %26 = lshr i32 %25, 6
  %27 = and i32 %26, 67108860
  %28 = add i32 %27, %24
  %29 = zext i32 %28 to i64
  %30 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %29)
  %31 = lshr i32 %6, 3
  %32 = and i32 %31, 31
  %33 = shl nuw i32 1, %32
  %34 = and i32 %30, %33
  %.not71 = icmp eq i32 %34, 0
  br i1 %.not71, label %35, label %37

35:                                               ; preds = %23
  %36 = add i32 %1, -4
  tail call void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AMarkAcceptor0x3A0x3Apush0x28hermes0x3A0x3Avm0x3A0x3AGCCell0x2A0x29(ptr noundef %0, i32 noundef %36, i32 noundef %6) #3
  br label %37

37:                                               ; preds = %23, %3, %35
  ret void
}

declare void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AMarkAcceptor0x3A0x3Apush0x28hermes0x3A0x3Avm0x3A0x3AGCCell0x2A0x29(ptr noundef, i32 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: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass