; LLVM IR from Try/Tempest :: Engine/libspirv/libspirv.ll (ZN8libspirv15MutableBytecode8Iterator6insertEN3spv2OpEPKjm)

; 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.libspirv::Bytecode::OpCode" = type { i16, i16 }
%"struct.libspirv::Bytecode::Iterator" = type <{ ptr, i32, [4 x i8] }>
%"struct.libspirv::MutableBytecode::Iterator" = type { %"struct.libspirv::Bytecode::Iterator.base", ptr }
%"struct.libspirv::Bytecode::Iterator.base" = type <{ ptr, i32 }>
%"class.libspirv::Bytecode" = type <{ ptr, i64, i32, [4 x i8] }>
%"class.libspirv::MutableBytecode" = type { %"class.libspirv::Bytecode.base", %"class.std::vector" }
%"class.libspirv::Bytecode.base" = type <{ ptr, i64, i32 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<libspirv::Bytecode::OpCode, std::allocator<libspirv::Bytecode::OpCode>>::_Vector_impl" }
%"struct.std::_Vector_base<libspirv::Bytecode::OpCode, std::allocator<libspirv::Bytecode::OpCode>>::_Vector_impl" = type { %"struct.std::_Vector_base<libspirv::Bytecode::OpCode, std::allocator<libspirv::Bytecode::OpCode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<libspirv::Bytecode::OpCode, std::allocator<libspirv::Bytecode::OpCode>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN8libspirv15MutableBytecode8Iterator6insertEN3spv2OpEPKjm = external hidden unnamed_addr constant [90 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt8distanceIPKN8libspirv8Bytecode6OpCodeEENSt15iterator_traitsIT_E15difference_typeES6_S6_(ptr noundef, ptr noundef) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8libspirv15MutableBytecode8Iterator18invalidateIteratorEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8libspirv15MutableBytecode8Iterator6insertEN3spv2OpEPKjm(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, ptr noundef %2, i64 noundef %3) #5 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i16, align 2
  %10 = alloca %"struct.libspirv::Bytecode::OpCode", align 4
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i64 %3, ptr %8, align 8, !tbaa !11
  %15 = load ptr, ptr %5, align 8
  %16 = getelementptr inbounds %"struct.libspirv::Bytecode::Iterator", ptr %15, i32 0, i32 1
  %17 = load i32, ptr %16, align 8, !tbaa !13
  %18 = getelementptr inbounds %"struct.libspirv::MutableBytecode::Iterator", ptr %15, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %20 = getelementptr inbounds %"class.libspirv::Bytecode", ptr %19, i32 0, i32 2
  %21 = load i32, ptr %20, align 8, !tbaa !18
  %22 = icmp eq i32 %17, %21
  br i1 %22, label %23, label %24

23:                                               ; preds = %4
  br label %26

24:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 661, ptr noundef @__PRETTY_FUNCTION__._ZN8libspirv15MutableBytecode8Iterator6insertEN3spv2OpEPKjm) #6
  unreachable

25:                                               ; No predecessors!
  br label %26

26:                                               ; preds = %25, %23
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #7
  %27 = load i64, ptr %8, align 8, !tbaa !11
  %28 = add i64 %27, 1
  %29 = trunc i64 %28 to i16
  store i16 %29, ptr %9, align 2, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %30 = getelementptr inbounds %"struct.libspirv::Bytecode::OpCode", ptr %10, i32 0, i32 0
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = trunc i32 %31 to i16
  store i16 %32, ptr %30, align 4, !tbaa !22
  %33 = getelementptr inbounds %"struct.libspirv::Bytecode::OpCode", ptr %10, i32 0, i32 1
  %34 = load i16, ptr %9, align 2, !tbaa !20
  store i16 %34, ptr %33, align 2, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %35 = getelementptr inbounds %"struct.libspirv::MutableBytecode::Iterator", ptr %15, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  %37 = getelementptr inbounds %"class.libspirv::MutableBytecode", ptr %36, i32 0, i32 1
  %38 = call noundef ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #7
  %39 = getelementptr inbounds %"struct.libspirv::Bytecode::Iterator", ptr %15, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !25
  %41 = call noundef i64 @_ZSt8distanceIPKN8libspirv8Bytecode6OpCodeEENSt15iterator_traitsIT_E15difference_typeES6_S6_(ptr noundef %38, ptr noundef %40)
  store i64 %41, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %42 = getelementptr inbounds %"struct.libspirv::MutableBytecode::Iterator", ptr %15, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  %44 = getelementptr inbounds %"class.libspirv::MutableBytecode", ptr %43, i32 0, i32 1
  store ptr %44, ptr %12, align 8, !tbaa !5
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = call noundef i64 @_ZNKSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #7
  %48 = getelementptr inbounds %"struct.libspirv::Bytecode::OpCode", ptr %10, i32 0, i32 1
  %49 = load i16, ptr %48, align 2, !tbaa !24
  %50 = zext i16 %49 to i64
  %51 = add i64 %47, %50
  call void @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %51)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = call noundef i64 @_ZNKSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #7
  %54 = getelementptr inbounds %"struct.libspirv::Bytecode::OpCode", ptr %10, i32 0, i32 1
  %55 = load i16, ptr %54, align 2, !tbaa !24
  %56 = zext i16 %55 to i64
  %57 = sub i64 %53, %56
  store i64 %57, ptr %13, align 8, !tbaa !11
  br label %58

58:                                               ; preds = %63, %26
  %59 = load i64, ptr %13, align 8, !tbaa !11
  %60 = load i64, ptr %11, align 8, !tbaa !11
  %61 = icmp ugt i64 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %76

63:                                               ; preds = %58
  %64 = load i64, ptr %13, align 8, !tbaa !11
  %65 = add i64 %64, -1
  store i64 %65, ptr %13, align 8, !tbaa !11
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = load i64, ptr %13, align 8, !tbaa !11
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %67) #7
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = load i64, ptr %13, align 8, !tbaa !11
  %71 = getelementptr inbounds %"struct.libspirv::Bytecode::OpCode", ptr %10, i32 0, i32 1
  %72 = load i16, ptr %71, align 2, !tbaa !24
  %73 = zext i16 %72 to i64
  %74 = add i64 %70, %73
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %74) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %75, ptr align 4 %68, i64 4, i1 false), !tbaa.struct !26
  br label %58, !llvm.loop !27

76:                                               ; preds = %62
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = load i64, ptr %11, align 8, !tbaa !11
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %77, i64 noundef %78) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %79, ptr align 4 %10, i64 4, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !29
  br label %80

80:                                               ; preds = %99, %76
  %81 = load i32, ptr %14, align 4, !tbaa !29
  %82 = sext i32 %81 to i64
  %83 = load i64, ptr %8, align 8, !tbaa !11
  %84 = icmp ult i64 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %102

86:                                               ; preds = %80
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = load i32, ptr %14, align 4, !tbaa !29
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %87, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !29
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = load i64, ptr %11, align 8, !tbaa !11
  %94 = load i32, ptr %14, align 4, !tbaa !29
  %95 = sext i32 %94 to i64
  %96 = add i64 %93, %95
  %97 = add i64 %96, 1
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %92, i64 noundef %97) #7
  store i32 %91, ptr %98, align 4, !tbaa !29
  br label %99

99:                                               ; preds = %86
  %100 = load i32, ptr %14, align 4, !tbaa !29
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %14, align 4, !tbaa !29
  br label %80, !llvm.loop !30

102:                                              ; preds = %85
  %103 = load i64, ptr %11, align 8, !tbaa !11
  %104 = load i16, ptr %9, align 2, !tbaa !20
  %105 = zext i16 %104 to i64
  %106 = add i64 %103, %105
  call void @_ZN8libspirv15MutableBytecode8Iterator18invalidateIteratorEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %106)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #7
  ret void
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress 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 = { noreturn nounwind "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 = { mustprogress 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 = { mustprogress 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 #6 = { noreturn nounwind }
attributes #7 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTSN3spv2OpE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !15, i64 8}
!14 = !{!"_ZTSN8libspirv8Bytecode8IteratorE", !6, i64 0, !15, i64 8}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !6, i64 16}
!17 = !{!"_ZTSN8libspirv15MutableBytecode8IteratorE", !14, i64 0, !6, i64 16}
!18 = !{!19, !15, i64 16}
!19 = !{!"_ZTSN8libspirv8BytecodeE", !6, i64 0, !12, i64 8, !15, i64 16}
!20 = !{!21, !21, i64 0}
!21 = !{!"short", !7, i64 0}
!22 = !{!23, !21, i64 0}
!23 = !{!"_ZTSN8libspirv8Bytecode6OpCodeE", !21, i64 0, !21, i64 2}
!24 = !{!23, !21, i64 2}
!25 = !{!14, !6, i64 0}
!26 = !{i64 0, i64 2, !20, i64 2, i64 2, !20}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!15, !15, i64 0}
!30 = distinct !{!30, !28}


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

@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN8libspirv15MutableBytecode8Iterator6insertEN3spv2OpEPKjm = external hidden unnamed_addr constant [90 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt8distanceIPKN8libspirv8Bytecode6OpCodeEENSt15iterator_traitsIT_E15difference_typeES6_S6_(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8libspirv15MutableBytecode8Iterator18invalidateIteratorEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8libspirv15MutableBytecode8Iterator6insertEN3spv2OpEPKjm(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, ptr nocapture noundef readonly %2, i64 noundef %3) local_unnamed_addr #3 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %10 = load i32, ptr %9, align 8, !tbaa !13
  %11 = icmp eq i32 %6, %10
  br i1 %11, label %13, label %12

12:                                               ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 661, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8libspirv15MutableBytecode8Iterator6insertEN3spv2OpEPKjm) #4
  unreachable

13:                                               ; preds = %4
  %14 = trunc i64 %3 to i16
  %15 = add i16 %14, 1
  %16 = trunc i32 %1 to i16
  %17 = getelementptr inbounds i8, ptr %8, i64 24
  %18 = tail call noundef ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  %19 = load ptr, ptr %0, align 8, !tbaa !16
  %20 = tail call noundef i64 @_ZSt8distanceIPKN8libspirv8Bytecode6OpCodeEENSt15iterator_traitsIT_E15difference_typeES6_S6_(ptr noundef %18, ptr noundef %19)
  %21 = load ptr, ptr %7, align 8, !tbaa !11
  %22 = getelementptr inbounds i8, ptr %21, i64 24
  %23 = tail call noundef i64 @_ZNKSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  %24 = zext i16 %15 to i64
  %25 = add i64 %23, %24
  tail call void @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %25)
  %26 = tail call noundef i64 @_ZNKSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  %27 = sub i64 %26, %24
  %28 = icmp ugt i64 %27, %20
  br i1 %28, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %13
  %29 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %20) #5
  store i16 %16, ptr %29, align 4, !tbaa !17
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %29, i64 2
  store i16 %15, ptr %.sroa.4.0..sroa_idx, align 2, !tbaa !17
  %.not = icmp eq i64 %3, 0
  br i1 %.not, label %._crit_edge34, label %.lr.ph33

.lr.ph33:                                         ; preds = %._crit_edge
  %30 = add i64 %20, 1
  br label %38

.lr.ph:                                           ; preds = %13, %.lr.ph
  %.02730 = phi i64 [ %31, %.lr.ph ], [ %27, %13 ]
  %31 = add i64 %.02730, -1
  %32 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %31) #5
  %33 = add i64 %31, %24
  %34 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %33) #5
  %35 = load i32, ptr %32, align 4
  store i32 %35, ptr %34, align 4
  %36 = icmp ugt i64 %31, %20
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !19

._crit_edge34:                                    ; preds = %38, %._crit_edge
  %37 = add i64 %20, %24
  tail call void @_ZN8libspirv15MutableBytecode8Iterator18invalidateIteratorEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %37)
  ret void

38:                                               ; preds = %.lr.ph33, %38
  %indvars.iv = phi i64 [ 0, %.lr.ph33 ], [ %indvars.iv.next, %38 ]
  %39 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv
  %40 = load i32, ptr %39, align 4, !tbaa !21
  %41 = add i64 %30, %indvars.iv
  %42 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIN8libspirv8Bytecode6OpCodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %41) #5
  store i32 %40, ptr %42, align 4, !tbaa !21
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %3
  br i1 %exitcond.not, label %._crit_edge34, label %38, !llvm.loop !22
}

attributes #0 = { inlinehint mustprogress 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 nounwind "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 = { mustprogress 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 = { mustprogress 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 = { noreturn nounwind }
attributes #5 = { 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, !10, i64 8}
!6 = !{!"_ZTSN8libspirv8Bytecode8IteratorE", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 16}
!12 = !{!"_ZTSN8libspirv15MutableBytecode8IteratorE", !6, i64 0, !7, i64 16}
!13 = !{!14, !10, i64 16}
!14 = !{!"_ZTSN8libspirv8BytecodeE", !7, i64 0, !15, i64 8, !10, i64 16}
!15 = !{!"long", !8, i64 0}
!16 = !{!6, !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"short", !8, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!10, !10, i64 0}
!22 = distinct !{!22, !20}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass