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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ADroppingAcceptor0x3Chermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AMarkAcceptor0x3E0x3A0x3Aaccept0x28hermes0x3A0x3Avm0x3A0x3AGCPointerBase0x260x2C0x20char0x20const0x2A0x29(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 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) #3
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %15 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %15, ptr %12, 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 %12, align 4, !tbaa !9
  %19 = zext i32 %18 to i64
  %20 = call i32 @i32_load(ptr noundef %17, i64 noundef %19)
  store i32 %20, ptr %12, align 4, !tbaa !9
  %21 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %21, ptr %8, align 4, !tbaa !9
  %22 = load i32, ptr %12, align 4, !tbaa !9
  %23 = icmp ne i32 %22, 0
  %24 = xor i1 %23, true
  %25 = zext i1 %24 to i32
  store i32 %25, ptr %12, align 4, !tbaa !9
  %26 = load i32, ptr %12, align 4, !tbaa !9
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %4
  br label %143

29:                                               ; preds = %4
  %30 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %30, ptr %12, align 4, !tbaa !9
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.w2c_hermes, ptr %31, i32 0, i32 6
  %33 = load i32, ptr %12, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = add i64 %34, 8
  %36 = call i32 @i32_load(ptr noundef %32, i64 noundef %35)
  store i32 %36, ptr %12, align 4, !tbaa !9
  %37 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %37, ptr %6, align 4, !tbaa !9
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.w2c_hermes, ptr %38, i32 0, i32 6
  %40 = load i32, ptr %12, align 4, !tbaa !9
  %41 = zext i32 %40 to i64
  %42 = add i64 %41, 8
  %43 = call i32 @i32_load(ptr noundef %39, i64 noundef %42)
  store i32 %43, ptr %12, align 4, !tbaa !9
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.w2c_hermes, ptr %44, i32 0, i32 6
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = zext i32 %46 to i64
  %48 = add i64 %47, 4400
  %49 = call i32 @i32_load(ptr noundef %45, i64 noundef %48)
  store i32 %49, ptr %12, align 4, !tbaa !9
  %50 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %50, ptr %9, align 4, !tbaa !9
  %51 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %51, ptr %13, align 4, !tbaa !9
  store i32 -4194304, ptr %14, align 4, !tbaa !9
  %52 = load i32, ptr %14, align 4, !tbaa !9
  %53 = load i32, ptr %13, align 4, !tbaa !9
  %54 = and i32 %53, %52
  store i32 %54, ptr %13, align 4, !tbaa !9
  %55 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %55, ptr %10, align 4, !tbaa !9
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = load i32, ptr %13, align 4, !tbaa !9
  %58 = icmp ne i32 %56, %57
  %59 = zext i1 %58 to i32
  store i32 %59, ptr %12, align 4, !tbaa !9
  %60 = load i32, ptr %12, align 4, !tbaa !9
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %29
  br label %95

63:                                               ; preds = %29
  %64 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %64, ptr %12, align 4, !tbaa !9
  %65 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %65, ptr %13, align 4, !tbaa !9
  store i32 -4194304, ptr %14, align 4, !tbaa !9
  %66 = load i32, ptr %14, align 4, !tbaa !9
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = and i32 %67, %66
  store i32 %68, ptr %13, align 4, !tbaa !9
  %69 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %69, ptr %11, align 4, !tbaa !9
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = load i32, ptr %13, align 4, !tbaa !9
  %72 = icmp eq i32 %70, %71
  %73 = zext i1 %72 to i32
  store i32 %73, ptr %12, align 4, !tbaa !9
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %63
  br label %95

77:                                               ; preds = %63
  %78 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %78, ptr %12, align 4, !tbaa !9
  %79 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %79, ptr %13, align 4, !tbaa !9
  store i32 9, ptr %14, align 4, !tbaa !9
  %80 = load i32, ptr %14, align 4, !tbaa !9
  %81 = and i32 %80, 31
  %82 = load i32, ptr %13, align 4, !tbaa !9
  %83 = lshr i32 %82, %81
  store i32 %83, ptr %13, align 4, !tbaa !9
  store i32 8191, ptr %14, align 4, !tbaa !9
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = and i32 %85, %84
  store i32 %86, ptr %13, align 4, !tbaa !9
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = add i32 %88, %87
  store i32 %89, ptr %12, align 4, !tbaa !9
  store i32 1, ptr %13, align 4, !tbaa !9
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.w2c_hermes, ptr %90, i32 0, i32 6
  %92 = load i32, ptr %12, align 4, !tbaa !9
  %93 = zext i32 %92 to i64
  %94 = load i32, ptr %13, align 4, !tbaa !9
  call void @i32_store8(ptr noundef %91, i64 noundef %93, i32 noundef %94)
  br label %95

95:                                               ; preds = %77, %76, %62
  %96 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %96, ptr %12, align 4, !tbaa !9
  store i32 16384, ptr %13, align 4, !tbaa !9
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = add i32 %98, %97
  store i32 %99, ptr %12, align 4, !tbaa !9
  %100 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %100, ptr %7, align 4, !tbaa !9
  %101 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %101, ptr %13, align 4, !tbaa !9
  %102 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %102, ptr %14, align 4, !tbaa !9
  %103 = load i32, ptr %14, align 4, !tbaa !9
  %104 = load i32, ptr %13, align 4, !tbaa !9
  %105 = sub i32 %104, %103
  store i32 %105, ptr %13, align 4, !tbaa !9
  %106 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %106, ptr %7, align 4, !tbaa !9
  store i32 6, ptr %14, align 4, !tbaa !9
  %107 = load i32, ptr %14, align 4, !tbaa !9
  %108 = and i32 %107, 31
  %109 = load i32, ptr %13, align 4, !tbaa !9
  %110 = lshr i32 %109, %108
  store i32 %110, ptr %13, align 4, !tbaa !9
  store i32 67108860, ptr %14, align 4, !tbaa !9
  %111 = load i32, ptr %14, align 4, !tbaa !9
  %112 = load i32, ptr %13, align 4, !tbaa !9
  %113 = and i32 %112, %111
  store i32 %113, ptr %13, align 4, !tbaa !9
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = add i32 %115, %114
  store i32 %116, ptr %12, align 4, !tbaa !9
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.w2c_hermes, ptr %117, i32 0, i32 6
  %119 = load i32, ptr %12, align 4, !tbaa !9
  %120 = zext i32 %119 to i64
  %121 = call i32 @i32_load(ptr noundef %118, i64 noundef %120)
  store i32 %121, ptr %12, align 4, !tbaa !9
  %122 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %122, ptr %13, align 4, !tbaa !9
  store i32 3, ptr %14, align 4, !tbaa !9
  %123 = load i32, ptr %14, align 4, !tbaa !9
  %124 = and i32 %123, 31
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = lshr i32 %125, %124
  store i32 %126, ptr %13, align 4, !tbaa !9
  %127 = load i32, ptr %13, align 4, !tbaa !9
  %128 = and i32 %127, 31
  %129 = load i32, ptr %12, align 4, !tbaa !9
  %130 = lshr i32 %129, %128
  store i32 %130, ptr %12, align 4, !tbaa !9
  store i32 1, ptr %13, align 4, !tbaa !9
  %131 = load i32, ptr %13, align 4, !tbaa !9
  %132 = load i32, ptr %12, align 4, !tbaa !9
  %133 = and i32 %132, %131
  store i32 %133, ptr %12, align 4, !tbaa !9
  %134 = load i32, ptr %12, align 4, !tbaa !9
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %137

136:                                              ; preds = %95
  br label %143

137:                                              ; preds = %95
  %138 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %138, ptr %12, align 4, !tbaa !9
  %139 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %139, ptr %13, align 4, !tbaa !9
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = load i32, ptr %12, align 4, !tbaa !9
  %142 = load i32, ptr %13, align 4, !tbaa !9
  call void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AMarkAcceptor0x3A0x3Apush0x28hermes0x3A0x3Avm0x3A0x3AGCCell0x2A0x29(ptr noundef %140, i32 noundef %141, i32 noundef %142)
  br label %143

143:                                              ; preds = %137, %136, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  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 = { 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 = { 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_store8(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

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

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

8:                                                ; preds = %4
  %9 = zext i32 %1 to i64
  %10 = add nuw nsw i64 %9, 8
  %11 = tail call i32 @i32_load(ptr noundef nonnull %5, i64 noundef %10)
  %12 = zext i32 %11 to i64
  %13 = add nuw nsw i64 %12, 8
  %14 = tail call i32 @i32_load(ptr noundef nonnull %5, i64 noundef %13)
  %15 = zext i32 %14 to i64
  %16 = add nuw nsw i64 %15, 4400
  %17 = tail call i32 @i32_load(ptr noundef nonnull %5, i64 noundef %16)
  %18 = and i32 %7, -4194304
  %.not71 = icmp eq i32 %17, %18
  br i1 %.not71, label %19, label %27

19:                                               ; preds = %8
  %20 = and i32 %2, -4194304
  %21 = icmp eq i32 %17, %20
  br i1 %21, label %27, label %22

22:                                               ; preds = %19
  %23 = lshr i32 %2, 9
  %24 = and i32 %23, 8191
  %25 = or disjoint i32 %24, %20
  %26 = zext i32 %25 to i64
  tail call void @i32_store8(ptr noundef nonnull %5, i64 noundef %26, i32 noundef 1)
  br label %27

27:                                               ; preds = %19, %8, %22
  %28 = or disjoint i32 %18, 16384
  %29 = sub i32 %7, %28
  %30 = lshr i32 %29, 6
  %31 = and i32 %30, 67108860
  %32 = add i32 %31, %28
  %33 = zext i32 %32 to i64
  %34 = tail call i32 @i32_load(ptr noundef nonnull %5, i64 noundef %33)
  %35 = lshr i32 %7, 3
  %36 = and i32 %35, 31
  %37 = shl nuw i32 1, %36
  %38 = and i32 %34, %37
  %.not72 = icmp eq i32 %38, 0
  br i1 %.not72, label %39, label %40

39:                                               ; preds = %27
  tail call void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AMarkAcceptor0x3A0x3Apush0x28hermes0x3A0x3Avm0x3A0x3AGCCell0x2A0x29(ptr noundef %0, i32 noundef %11, i32 noundef %7)
  br label %40

40:                                               ; preds = %27, %4, %39
  ret void
}

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

!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