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

; 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: inlinehint nounwind uwtable
declare hidden i64 @i64_load(ptr noundef, i64 noundef) #1

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

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

52:                                               ; preds = %5
  %53 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %53, ptr %13, align 4, !tbaa !9
  store i32 1, ptr %14, align 4, !tbaa !9
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.w2c_hermes, ptr %54, i32 0, i32 6
  %56 = load i32, ptr %13, align 4, !tbaa !9
  %57 = zext i32 %56 to i64
  %58 = add i64 %57, 24
  %59 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store(ptr noundef %55, i64 noundef %58, i32 noundef %59)
  %60 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %60, ptr %13, align 4, !tbaa !9
  store i32 49, ptr %14, align 4, !tbaa !9
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.w2c_hermes, ptr %61, i32 0, i32 6
  %63 = load i32, ptr %13, align 4, !tbaa !9
  %64 = zext i32 %63 to i64
  %65 = add i64 %64, 28
  %66 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store(ptr noundef %62, i64 noundef %65, i32 noundef %66)
  %67 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %67, ptr %13, align 4, !tbaa !9
  %68 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %68, ptr %14, align 4, !tbaa !9
  store i32 28, ptr %15, align 4, !tbaa !9
  %69 = load i32, ptr %15, align 4, !tbaa !9
  %70 = load i32, ptr %14, align 4, !tbaa !9
  %71 = add i32 %70, %69
  store i32 %71, ptr %14, align 4, !tbaa !9
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.w2c_hermes, ptr %72, i32 0, i32 6
  %74 = load i32, ptr %13, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = add i64 %75, 20
  %77 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store(ptr noundef %73, i64 noundef %76, i32 noundef %77)
  %78 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %78, ptr %13, align 4, !tbaa !9
  %79 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %79, ptr %14, align 4, !tbaa !9
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.w2c_hermes, ptr %80, i32 0, i32 6
  %82 = load i32, ptr %14, align 4, !tbaa !9
  %83 = zext i32 %82 to i64
  %84 = add i64 %83, 20
  %85 = call i64 @i64_load(ptr noundef %81, i64 noundef %84)
  store i64 %85, ptr %18, align 8, !tbaa !17
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.w2c_hermes, ptr %86, i32 0, i32 6
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = zext i32 %88 to i64
  %90 = add i64 %89, 8
  %91 = load i64, ptr %18, align 8, !tbaa !17
  call void @i64_store(ptr noundef %87, i64 noundef %90, i64 noundef %91)
  %92 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %92, ptr %13, align 4, !tbaa !9
  %93 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %93, ptr %14, align 4, !tbaa !9
  store i32 8, ptr %15, align 4, !tbaa !9
  %94 = load i32, ptr %15, align 4, !tbaa !9
  %95 = load i32, ptr %14, align 4, !tbaa !9
  %96 = add i32 %95, %94
  store i32 %96, ptr %14, align 4, !tbaa !9
  %97 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %97, ptr %15, align 4, !tbaa !9
  %98 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %98, ptr %16, align 4, !tbaa !9
  %99 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %99, ptr %17, align 4, !tbaa !9
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = load i32, ptr %13, align 4, !tbaa !9
  %102 = load i32, ptr %14, align 4, !tbaa !9
  %103 = load i32, ptr %15, align 4, !tbaa !9
  %104 = load i32, ptr %16, align 4, !tbaa !9
  %105 = load i32, ptr %17, align 4, !tbaa !9
  call void @w2c_hermes_hermes0x3A0x3Aparser0x3A0x3Adetail0x3A0x3AJSParserImpl0x3A0x3AerrorExpected0x28llvh0x3A0x3AArrayRef0x3Chermes0x3A0x3Aparser0x3A0x3ATokenKind0x3E0x2C0x20char0x20const0x2A0x2C0x20char0x20const0x2A0x2C0x20llvh0x3A0x3ASMLoc0x29(ptr noundef %100, i32 noundef %101, i32 noundef %102, i32 noundef %103, i32 noundef %104, i32 noundef %105)
  br label %106

106:                                              ; preds = %52, %5
  %107 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %107, ptr %13, align 4, !tbaa !9
  store i32 32, ptr %14, align 4, !tbaa !9
  %108 = load i32, ptr %14, align 4, !tbaa !9
  %109 = load i32, ptr %13, align 4, !tbaa !9
  %110 = add i32 %109, %108
  store i32 %110, ptr %13, align 4, !tbaa !9
  %111 = load i32, ptr %13, align 4, !tbaa !9
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.w2c_hermes, ptr %112, i32 0, i32 3
  store i32 %111, ptr %113, align 8, !tbaa !11
  %114 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %114, ptr %13, align 4, !tbaa !9
  %115 = load i32, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 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
  ret i32 %115
}

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, !10, i64 24}
!12 = !{!"w2c_hermes", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !13, i64 40, !16, i64 80}
!13 = !{!"", !6, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !15, i64 32}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12}
!17 = !{!14, !14, 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: inlinehint nounwind uwtable
declare hidden i64 @i64_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: nounwind uwtable
declare dso_local void @w2c_hermes_hermes0x3A0x3Aparser0x3A0x3Adetail0x3A0x3AJSParserImpl0x3A0x3AerrorExpected0x28llvh0x3A0x3AArrayRef0x3Chermes0x3A0x3Aparser0x3A0x3ATokenKind0x3E0x2C0x20char0x20const0x2A0x2C0x20char0x20const0x2A0x2C0x20llvh0x3A0x3ASMLoc0x29(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @w2c_hermes_hermes0x3A0x3Aparser0x3A0x3Adetail0x3A0x3AJSParserImpl0x3A0x3Aneed0x28hermes0x3A0x3Aparser0x3A0x3ATokenKind0x2C0x20char0x20const0x2A0x2C0x20char0x20const0x2A0x2C0x20llvh0x3A0x3ASMLoc0x29(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 24
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = add i32 %7, -32
  store i32 %8, ptr %6, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 40
  %10 = zext i32 %1 to i64
  %11 = add nuw nsw i64 %10, 864
  %12 = tail call i32 @i32_load(ptr noundef nonnull %9, i64 noundef %11)
  %13 = zext i32 %12 to i64
  %14 = tail call i32 @i32_load(ptr noundef nonnull %9, i64 noundef %13)
  %15 = icmp eq i32 %14, 49
  br i1 %15, label %25, label %16

16:                                               ; preds = %5
  %17 = zext i32 %8 to i64
  %18 = add nuw nsw i64 %17, 24
  tail call void @i32_store(ptr noundef nonnull %9, i64 noundef %18, i32 noundef 1)
  %19 = add nuw nsw i64 %17, 28
  tail call void @i32_store(ptr noundef nonnull %9, i64 noundef %19, i32 noundef 49)
  %20 = add i32 %7, -4
  %21 = add nuw nsw i64 %17, 20
  tail call void @i32_store(ptr noundef nonnull %9, i64 noundef %21, i32 noundef %20)
  %22 = tail call i64 @i64_load(ptr noundef nonnull %9, i64 noundef %21)
  %23 = add nuw nsw i64 %17, 8
  tail call void @i64_store(ptr noundef nonnull %9, i64 noundef %23, i64 noundef %22)
  %24 = add i32 %7, -24
  tail call void @w2c_hermes_hermes0x3A0x3Aparser0x3A0x3Adetail0x3A0x3AJSParserImpl0x3A0x3AerrorExpected0x28llvh0x3A0x3AArrayRef0x3Chermes0x3A0x3Aparser0x3A0x3ATokenKind0x3E0x2C0x20char0x20const0x2A0x2C0x20char0x20const0x2A0x2C0x20llvh0x3A0x3ASMLoc0x29(ptr noundef nonnull %0, i32 noundef %1, i32 noundef %24, i32 noundef %2, i32 noundef %3, i32 noundef %4)
  br label %25

25:                                               ; preds = %16, %5
  %26 = zext i1 %15 to i32
  store i32 %7, ptr %6, align 8, !tbaa !5
  ret i32 %26
}

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)"}
!5 = !{!6, !10, i64 24}
!6 = !{!"w2c_hermes", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !11, i64 40, !14, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"", !7, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !13, i64 32}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!"", !7, i64 0, !10, i64 8, !10, i64 12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass