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

; 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_store16(ptr noundef, i64 noundef, i32 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 i32 @i32_load8_u(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_hermes0x3A0x3AOptValue0x3Cchar0x3E0x20hermes0x3A0x3Abigint0x3A0x3A0x28anonymous0x20namespace0x290x3A0x3ABigIntLiteralParsingToolBox0x3Chermes0x3A0x3Abigint0x3A0x3A0x28anonymous0x20namespace0x290x3A0x3ANumericValueParser0x3E0x3A0x3AlookaheadAndEatIfAnyOf0x3C0x28char0x29480x2C0x200x28char0x29490x2C0x200x28char0x29500x2C0x200x28char0x29510x2C0x200x28char0x29520x2C0x200x28char0x29530x2C0x200x28char0x29540x2C0x200x28char0x29550x2C0x200x28char0x29560x2C0x200x28char0x29570x2C0x200x28char0x29650x2C0x200x28char0x29660x2C0x200x28char0x29670x2C0x200x28char0x29680x2C0x200x28char0x29690x2C0x200x28char0x29700x2C0x200x28char0x29970x2C0x200x28char0x29980x2C0x200x28char0x29990x2C0x200x28char0x291000x2C0x200x28char0x291010x2C0x200x28char0x291020x3E0x280x29(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
  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) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %12 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %12, ptr %9, align 4, !tbaa !9
  store i32 0, ptr %10, align 4, !tbaa !9
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.w2c_hermes, ptr %13, i32 0, i32 6
  %15 = load i32, ptr %9, align 4, !tbaa !9
  %16 = zext i32 %15 to i64
  %17 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store16(ptr noundef %14, i64 noundef %16, i32 noundef %17)
  %18 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %18, ptr %9, align 4, !tbaa !9
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.w2c_hermes, ptr %19, i32 0, i32 6
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = zext i32 %21 to i64
  %23 = call i32 @i32_load(ptr noundef %20, i64 noundef %22)
  store i32 %23, ptr %9, align 4, !tbaa !9
  %24 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %24, ptr %7, align 4, !tbaa !9
  %25 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %25, ptr %10, align 4, !tbaa !9
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.w2c_hermes, ptr %26, i32 0, i32 6
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = zext i32 %28 to i64
  %30 = add i64 %29, 8
  %31 = call i32 @i32_load(ptr noundef %27, i64 noundef %30)
  store i32 %31, ptr %10, align 4, !tbaa !9
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = load i32, ptr %10, align 4, !tbaa !9
  %34 = icmp uge i32 %32, %33
  %35 = zext i1 %34 to i32
  store i32 %35, ptr %9, align 4, !tbaa !9
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %3
  br label %128

39:                                               ; preds = %3
  %40 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %40, ptr %9, align 4, !tbaa !9
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.w2c_hermes, ptr %41, i32 0, i32 6
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = zext i32 %43 to i64
  %45 = call i32 @i32_load8_u(ptr noundef %42, i64 noundef %44)
  store i32 %45, ptr %9, align 4, !tbaa !9
  %46 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %46, ptr %8, align 4, !tbaa !9
  store i32 48, ptr %10, align 4, !tbaa !9
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = sub i32 %48, %47
  store i32 %49, ptr %9, align 4, !tbaa !9
  %50 = load i32, ptr %9, align 4, !tbaa !9
  switch i32 %50, label %106 [
    i32 0, label %51
    i32 1, label %52
    i32 2, label %53
    i32 3, label %54
    i32 4, label %55
    i32 5, label %56
    i32 6, label %57
    i32 7, label %58
    i32 8, label %59
    i32 9, label %60
    i32 10, label %61
    i32 11, label %62
    i32 12, label %63
    i32 13, label %64
    i32 14, label %65
    i32 15, label %66
    i32 16, label %67
    i32 17, label %68
    i32 18, label %69
    i32 19, label %70
    i32 20, label %71
    i32 21, label %72
    i32 22, label %73
    i32 23, label %74
    i32 24, label %75
    i32 25, label %76
    i32 26, label %77
    i32 27, label %78
    i32 28, label %79
    i32 29, label %80
    i32 30, label %81
    i32 31, label %82
    i32 32, label %83
    i32 33, label %84
    i32 34, label %85
    i32 35, label %86
    i32 36, label %87
    i32 37, label %88
    i32 38, label %89
    i32 39, label %90
    i32 40, label %91
    i32 41, label %92
    i32 42, label %93
    i32 43, label %94
    i32 44, label %95
    i32 45, label %96
    i32 46, label %97
    i32 47, label %98
    i32 48, label %99
    i32 49, label %100
    i32 50, label %101
    i32 51, label %102
    i32 52, label %103
    i32 53, label %104
    i32 54, label %105
  ]

51:                                               ; preds = %39
  br label %107

52:                                               ; preds = %39
  br label %107

53:                                               ; preds = %39
  br label %107

54:                                               ; preds = %39
  br label %107

55:                                               ; preds = %39
  br label %107

56:                                               ; preds = %39
  br label %107

57:                                               ; preds = %39
  br label %107

58:                                               ; preds = %39
  br label %107

59:                                               ; preds = %39
  br label %107

60:                                               ; preds = %39
  br label %107

61:                                               ; preds = %39
  br label %128

62:                                               ; preds = %39
  br label %128

63:                                               ; preds = %39
  br label %128

64:                                               ; preds = %39
  br label %128

65:                                               ; preds = %39
  br label %128

66:                                               ; preds = %39
  br label %128

67:                                               ; preds = %39
  br label %128

68:                                               ; preds = %39
  br label %107

69:                                               ; preds = %39
  br label %107

70:                                               ; preds = %39
  br label %107

71:                                               ; preds = %39
  br label %107

72:                                               ; preds = %39
  br label %107

73:                                               ; preds = %39
  br label %107

74:                                               ; preds = %39
  br label %128

75:                                               ; preds = %39
  br label %128

76:                                               ; preds = %39
  br label %128

77:                                               ; preds = %39
  br label %128

78:                                               ; preds = %39
  br label %128

79:                                               ; preds = %39
  br label %128

80:                                               ; preds = %39
  br label %128

81:                                               ; preds = %39
  br label %128

82:                                               ; preds = %39
  br label %128

83:                                               ; preds = %39
  br label %128

84:                                               ; preds = %39
  br label %128

85:                                               ; preds = %39
  br label %128

86:                                               ; preds = %39
  br label %128

87:                                               ; preds = %39
  br label %128

88:                                               ; preds = %39
  br label %128

89:                                               ; preds = %39
  br label %128

90:                                               ; preds = %39
  br label %128

91:                                               ; preds = %39
  br label %128

92:                                               ; preds = %39
  br label %128

93:                                               ; preds = %39
  br label %128

94:                                               ; preds = %39
  br label %128

95:                                               ; preds = %39
  br label %128

96:                                               ; preds = %39
  br label %128

97:                                               ; preds = %39
  br label %128

98:                                               ; preds = %39
  br label %128

99:                                               ; preds = %39
  br label %128

100:                                              ; preds = %39
  br label %107

101:                                              ; preds = %39
  br label %107

102:                                              ; preds = %39
  br label %107

103:                                              ; preds = %39
  br label %107

104:                                              ; preds = %39
  br label %107

105:                                              ; preds = %39
  br label %107

106:                                              ; preds = %39
  br label %128

107:                                              ; preds = %105, %104, %103, %102, %101, %100, %73, %72, %71, %70, %69, %68, %60, %59, %58, %57, %56, %55, %54, %53, %52, %51
  %108 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %108, ptr %9, align 4, !tbaa !9
  %109 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %109, ptr %10, align 4, !tbaa !9
  store i32 1, ptr %11, align 4, !tbaa !9
  %110 = load i32, ptr %11, align 4, !tbaa !9
  %111 = load i32, ptr %10, align 4, !tbaa !9
  %112 = add i32 %111, %110
  store i32 %112, ptr %10, align 4, !tbaa !9
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.w2c_hermes, ptr %113, i32 0, i32 6
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = zext i32 %115 to i64
  %117 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store(ptr noundef %114, i64 noundef %116, i32 noundef %117)
  %118 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %118, ptr %9, align 4, !tbaa !9
  %119 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %119, ptr %10, align 4, !tbaa !9
  store i32 256, ptr %11, align 4, !tbaa !9
  %120 = load i32, ptr %11, align 4, !tbaa !9
  %121 = load i32, ptr %10, align 4, !tbaa !9
  %122 = or i32 %121, %120
  store i32 %122, ptr %10, align 4, !tbaa !9
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.w2c_hermes, ptr %123, i32 0, i32 6
  %125 = load i32, ptr %9, align 4, !tbaa !9
  %126 = zext i32 %125 to i64
  %127 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store16(ptr noundef %124, i64 noundef %126, i32 noundef %127)
  br label %128

128:                                              ; preds = %107, %106, %99, %98, %97, %96, %95, %94, %93, %92, %91, %90, %89, %88, %87, %86, %85, %84, %83, %82, %81, %80, %79, %78, %77, %76, %75, %74, %67, %66, %65, %64, %63, %62, %61, %38
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #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_store16(ptr noundef, i64 noundef, i32 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 i32 @i32_load8_u(ptr noundef, i64 noundef) local_unnamed_addr #0

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

10:                                               ; preds = %3
  %11 = zext i32 %7 to i64
  %12 = tail call i32 @i32_load8_u(ptr noundef nonnull %4, i64 noundef %11)
  switch i32 %12, label %16 [
    i32 48, label %13
    i32 49, label %13
    i32 50, label %13
    i32 51, label %13
    i32 52, label %13
    i32 53, label %13
    i32 54, label %13
    i32 55, label %13
    i32 56, label %13
    i32 57, label %13
    i32 102, label %13
    i32 101, label %13
    i32 100, label %13
    i32 99, label %13
    i32 98, label %13
    i32 97, label %13
    i32 70, label %13
    i32 65, label %13
    i32 66, label %13
    i32 67, label %13
    i32 68, label %13
    i32 69, label %13
  ]

13:                                               ; preds = %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10
  %14 = add nuw i32 %7, 1
  tail call void @i32_store(ptr noundef nonnull %4, i64 noundef %6, i32 noundef %14)
  %15 = or i32 %12, 256
  tail call void @i32_store16(ptr noundef nonnull %4, i64 noundef %5, i32 noundef %15)
  br label %16

16:                                               ; preds = %10, %3, %13
  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: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass