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

; 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_store(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: inlinehint nounwind uwtable
declare hidden void @i64_store(ptr noundef, i64 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 i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AisSameValue0x28hermes0x3A0x3Avm0x3A0x3AHermesValue0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue0x29(ptr noundef, i64 noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AobjectIs0x28void0x2A0x2C0x20hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20hermes0x3A0x3Avm0x3A0x3ANativeArgs0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #2 {
  %6 = alloca ptr, align 8
  %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 i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, 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 8, ptr %12) #3
  store i64 0, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store i64 0, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  store i64 -1688849860263936, ptr %16, align 8, !tbaa !11
  %19 = load i64, ptr %16, align 8, !tbaa !11
  store i64 %19, ptr %12, align 8, !tbaa !11
  %20 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %20, ptr %14, align 4, !tbaa !9
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.w2c_hermes, ptr %21, i32 0, i32 6
  %23 = load i32, ptr %14, align 4, !tbaa !9
  %24 = zext i32 %23 to i64
  %25 = add i64 %24, 4
  %26 = call i32 @i32_load(ptr noundef %22, i64 noundef %25)
  store i32 %26, ptr %14, align 4, !tbaa !9
  %27 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %27, ptr %11, align 4, !tbaa !9
  %28 = load i32, ptr %14, align 4, !tbaa !9
  %29 = icmp ne i32 %28, 0
  %30 = xor i1 %29, true
  %31 = zext i1 %30 to i32
  store i32 %31, ptr %14, align 4, !tbaa !9
  %32 = load i32, ptr %14, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %5
  store i64 -1688849860263936, ptr %16, align 8, !tbaa !11
  %35 = load i64, ptr %16, align 8, !tbaa !11
  store i64 %35, ptr %13, align 8, !tbaa !11
  br label %72

36:                                               ; preds = %5
  %37 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %37, ptr %14, align 4, !tbaa !9
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.w2c_hermes, ptr %38, i32 0, i32 6
  %40 = load i32, ptr %14, align 4, !tbaa !9
  %41 = zext i32 %40 to i64
  %42 = call i32 @i32_load(ptr noundef %39, i64 noundef %41)
  store i32 %42, ptr %14, align 4, !tbaa !9
  %43 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %43, ptr %10, align 4, !tbaa !9
  store i32 8, ptr %15, align 4, !tbaa !9
  %44 = load i32, ptr %15, align 4, !tbaa !9
  %45 = load i32, ptr %14, align 4, !tbaa !9
  %46 = sub i32 %45, %44
  store i32 %46, ptr %14, align 4, !tbaa !9
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.w2c_hermes, ptr %47, i32 0, i32 6
  %49 = load i32, ptr %14, align 4, !tbaa !9
  %50 = zext i32 %49 to i64
  %51 = call i64 @i64_load(ptr noundef %48, i64 noundef %50)
  store i64 %51, ptr %16, align 8, !tbaa !11
  %52 = load i64, ptr %16, align 8, !tbaa !11
  store i64 %52, ptr %13, align 8, !tbaa !11
  %53 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %53, ptr %14, align 4, !tbaa !9
  store i32 1, ptr %15, align 4, !tbaa !9
  %54 = load i32, ptr %14, align 4, !tbaa !9
  %55 = load i32, ptr %15, align 4, !tbaa !9
  %56 = icmp eq i32 %54, %55
  %57 = zext i1 %56 to i32
  store i32 %57, ptr %14, align 4, !tbaa !9
  %58 = load i32, ptr %14, align 4, !tbaa !9
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %36
  br label %72

61:                                               ; preds = %36
  %62 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %62, ptr %14, align 4, !tbaa !9
  store i32 16, ptr %15, align 4, !tbaa !9
  %63 = load i32, ptr %15, align 4, !tbaa !9
  %64 = load i32, ptr %14, align 4, !tbaa !9
  %65 = sub i32 %64, %63
  store i32 %65, ptr %14, align 4, !tbaa !9
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.w2c_hermes, ptr %66, i32 0, i32 6
  %68 = load i32, ptr %14, align 4, !tbaa !9
  %69 = zext i32 %68 to i64
  %70 = call i64 @i64_load(ptr noundef %67, i64 noundef %69)
  store i64 %70, ptr %16, align 8, !tbaa !11
  %71 = load i64, ptr %16, align 8, !tbaa !11
  store i64 %71, ptr %12, align 8, !tbaa !11
  br label %72

72:                                               ; preds = %61, %60, %34
  %73 = load i64, ptr %13, align 8, !tbaa !11
  store i64 %73, ptr %16, align 8, !tbaa !11
  %74 = load i64, ptr %12, align 8, !tbaa !11
  store i64 %74, ptr %17, align 8, !tbaa !11
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load i64, ptr %16, align 8, !tbaa !11
  %77 = load i64, ptr %17, align 8, !tbaa !11
  %78 = call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AisSameValue0x28hermes0x3A0x3Avm0x3A0x3AHermesValue0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue0x29(ptr noundef %75, i64 noundef %76, i64 noundef %77)
  store i32 %78, ptr %14, align 4, !tbaa !9
  %79 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %79, ptr %10, align 4, !tbaa !9
  %80 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %80, ptr %14, align 4, !tbaa !9
  store i32 1, ptr %15, align 4, !tbaa !9
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.w2c_hermes, ptr %81, i32 0, i32 6
  %83 = load i32, ptr %14, align 4, !tbaa !9
  %84 = zext i32 %83 to i64
  %85 = load i32, ptr %15, align 4, !tbaa !9
  call void @i32_store(ptr noundef %82, i64 noundef %84, i32 noundef %85)
  %86 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %86, ptr %14, align 4, !tbaa !9
  %87 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %87, ptr %15, align 4, !tbaa !9
  %88 = load i32, ptr %15, align 4, !tbaa !9
  %89 = zext i32 %88 to i64
  store i64 %89, ptr %17, align 8, !tbaa !11
  store i64 -1407374883553280, ptr %18, align 8, !tbaa !11
  %90 = load i64, ptr %18, align 8, !tbaa !11
  %91 = load i64, ptr %17, align 8, !tbaa !11
  %92 = or i64 %91, %90
  store i64 %92, ptr %17, align 8, !tbaa !11
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.w2c_hermes, ptr %93, i32 0, i32 6
  %95 = load i32, ptr %14, align 4, !tbaa !9
  %96 = zext i32 %95 to i64
  %97 = add i64 %96, 8
  %98 = load i64, ptr %17, align 8, !tbaa !11
  call void @i64_store(ptr noundef %94, i64 noundef %97, i64 noundef %98)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #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}
!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 void @i32_store(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: inlinehint nounwind uwtable
declare hidden void @i64_store(ptr noundef, i64 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 i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AisSameValue0x28hermes0x3A0x3Avm0x3A0x3AHermesValue0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue0x29(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

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

10:                                               ; preds = %5
  %11 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %7)
  %12 = add i32 %11, -8
  %13 = zext i32 %12 to i64
  %14 = tail call i64 @i64_load(ptr noundef nonnull %6, i64 noundef %13)
  %15 = icmp eq i32 %9, 1
  br i1 %15, label %20, label %16

16:                                               ; preds = %10
  %17 = add i32 %11, -16
  %18 = zext i32 %17 to i64
  %19 = tail call i64 @i64_load(ptr noundef nonnull %6, i64 noundef %18)
  br label %20

20:                                               ; preds = %5, %10, %16
  %.044 = phi i64 [ -1688849860263936, %10 ], [ %19, %16 ], [ -1688849860263936, %5 ]
  %.0 = phi i64 [ %14, %10 ], [ %14, %16 ], [ -1688849860263936, %5 ]
  %21 = tail call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AisSameValue0x28hermes0x3A0x3Avm0x3A0x3AHermesValue0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue0x29(ptr noundef %0, i64 noundef %.0, i64 noundef %.044)
  %22 = zext i32 %1 to i64
  tail call void @i32_store(ptr noundef nonnull %6, i64 noundef %22, i32 noundef 1)
  %23 = zext i32 %21 to i64
  %24 = or disjoint i64 %23, -1407374883553280
  %25 = add nuw nsw i64 %22, 8
  tail call void @i64_store(ptr noundef nonnull %6, i64 noundef %25, i64 noundef %24)
  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,SROAPass,SimplifyCFGPass,TailCallElimPass