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

; 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: noreturn
declare void @wasm_rt_trap(i32 noundef) #2

declare void @w2c_hermes_abort(ptr noundef) #3

; 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_store(ptr noundef, i64 noundef, i32 noundef) #1

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

41:                                               ; preds = %2
  %42 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %42, ptr %9, align 4, !tbaa !9
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.w2c_hermes, ptr %43, i32 0, i32 6
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = zext i32 %45 to i64
  %47 = add i64 %46, 8
  %48 = call i32 @i32_load(ptr noundef %44, i64 noundef %47)
  store i32 %48, ptr %9, align 4, !tbaa !9
  %49 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %49, ptr %4, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %132, %41
  %51 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %51, ptr %9, align 4, !tbaa !9
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.w2c_hermes, ptr %52, i32 0, i32 6
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = zext i32 %54 to i64
  %56 = add i64 %55, 4
  %57 = call i32 @i32_load(ptr noundef %53, i64 noundef %56)
  store i32 %57, ptr %9, align 4, !tbaa !9
  %58 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %58, ptr %8, align 4, !tbaa !9
  %59 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %59, ptr %10, align 4, !tbaa !9
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.w2c_hermes, ptr %60, i32 0, i32 6
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = zext i32 %62 to i64
  %64 = call i32 @i32_load(ptr noundef %61, i64 noundef %63)
  store i32 %64, ptr %10, align 4, !tbaa !9
  %65 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %65, ptr %7, align 4, !tbaa !9
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.w2c_hermes, ptr %66, i32 0, i32 6
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = zext i32 %68 to i64
  %70 = add i64 %69, 4
  %71 = call i32 @i32_load(ptr noundef %67, i64 noundef %70)
  store i32 %71, ptr %10, align 4, !tbaa !9
  %72 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %72, ptr %11, align 4, !tbaa !9
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.w2c_hermes, ptr %73, i32 0, i32 6
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = zext i32 %75 to i64
  %77 = call i32 @i32_load(ptr noundef %74, i64 noundef %76)
  store i32 %77, ptr %11, align 4, !tbaa !9
  %78 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %78, ptr %7, align 4, !tbaa !9
  %79 = load i32, ptr %11, align 4, !tbaa !9
  %80 = load i32, ptr %10, align 4, !tbaa !9
  %81 = sub i32 %80, %79
  store i32 %81, ptr %10, align 4, !tbaa !9
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = icmp uge i32 %82, %83
  %85 = zext i1 %84 to i32
  store i32 %85, ptr %9, align 4, !tbaa !9
  %86 = load i32, ptr %9, align 4, !tbaa !9
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %89

88:                                               ; preds = %50
  br label %135

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

132:                                              ; preds = %89
  br label %50

133:                                              ; preds = %89
  br label %134

134:                                              ; preds = %133, %2
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %137

135:                                              ; preds = %88
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  call void @w2c_hermes_abort(ptr noundef %136)
  call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

137:                                              ; preds = %134
  %138 = load i32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret i32 %138
}

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 = { noreturn "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 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 #5 = { nounwind }
attributes #6 = { noreturn }

!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: noreturn
declare void @wasm_rt_trap(i32 noundef) local_unnamed_addr #1

declare void @w2c_hermes_abort(ptr noundef) local_unnamed_addr #2

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

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

12:                                               ; preds = %2
  %13 = add nuw nsw i64 %4, 8
  %14 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %13)
  %15 = zext i32 %14 to i64
  %16 = add nuw nsw i64 %15, 4
  br label %17

17:                                               ; preds = %27, %12
  %.0 = phi i32 [ %9, %12 ], [ %35, %27 ]
  %18 = zext i32 %.0 to i64
  %19 = add nuw nsw i64 %18, 4
  %20 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %19)
  %21 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %18)
  %22 = zext i32 %21 to i64
  %23 = add nuw nsw i64 %22, 4
  %24 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %23)
  %25 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %22)
  %26 = sub i32 %24, %25
  %.not67 = icmp ult i32 %20, %26
  br i1 %.not67, label %27, label %36

27:                                               ; preds = %17
  %28 = add i32 %25, %20
  %29 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %16)
  %30 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %15)
  %31 = add i32 %29, -6
  %32 = sub i32 %31, %30
  %33 = zext i32 %28 to i64
  %34 = add nuw nsw i64 %33, 1
  tail call void @i32_store(ptr noundef nonnull %3, i64 noundef %34, i32 noundef %32)
  %35 = add i32 %.0, 8
  %.not68 = icmp eq i32 %35, %11
  br i1 %.not68, label %.loopexit, label %17

.loopexit:                                        ; preds = %27, %2
  ret i32 1

36:                                               ; preds = %17
  tail call void @w2c_hermes_abort(ptr noundef %0) #4
  tail call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable
}

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 = { noreturn "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 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 #4 = { nounwind }
attributes #5 = { noreturn 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,JumpThreadingPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass