; LLVM IR from facebook/redex :: libredex/DexIdx.ll (ZNK6DexIdx15get_string_dataEjPj)

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

%"class.std::basic_string_view" = type { i64, ptr }
%class.DexIdx = type { ptr, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, %"class.std::vector", %"class.std::vector.3", %"class.std::vector.8", %"class.std::vector.13", %"class.std::vector.18", %"class.std::vector.23", %"class.std::vector.28" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<const DexString *, std::allocator<const DexString *>>::_Vector_impl" }
%"struct.std::_Vector_base<const DexString *, std::allocator<const DexString *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const DexString *, std::allocator<const DexString *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const DexString *, std::allocator<const DexString *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<DexType *, std::allocator<DexType *>>::_Vector_impl" }
%"struct.std::_Vector_base<DexType *, std::allocator<DexType *>>::_Vector_impl" = type { %"struct.std::_Vector_base<DexType *, std::allocator<DexType *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DexType *, std::allocator<DexType *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<DexFieldRef *, std::allocator<DexFieldRef *>>::_Vector_impl" }
%"struct.std::_Vector_base<DexFieldRef *, std::allocator<DexFieldRef *>>::_Vector_impl" = type { %"struct.std::_Vector_base<DexFieldRef *, std::allocator<DexFieldRef *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DexFieldRef *, std::allocator<DexFieldRef *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<DexMethodRef *, std::allocator<DexMethodRef *>>::_Vector_impl" }
%"struct.std::_Vector_base<DexMethodRef *, std::allocator<DexMethodRef *>>::_Vector_impl" = type { %"struct.std::_Vector_base<DexMethodRef *, std::allocator<DexMethodRef *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DexMethodRef *, std::allocator<DexMethodRef *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<DexProto *, std::allocator<DexProto *>>::_Vector_impl" }
%"struct.std::_Vector_base<DexProto *, std::allocator<DexProto *>>::_Vector_impl" = type { %"struct.std::_Vector_base<DexProto *, std::allocator<DexProto *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DexProto *, std::allocator<DexProto *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.23" = type { %"struct.std::_Vector_base.24" }
%"struct.std::_Vector_base.24" = type { %"struct.std::_Vector_base<DexCallSite *, std::allocator<DexCallSite *>>::_Vector_impl" }
%"struct.std::_Vector_base<DexCallSite *, std::allocator<DexCallSite *>>::_Vector_impl" = type { %"struct.std::_Vector_base<DexCallSite *, std::allocator<DexCallSite *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DexCallSite *, std::allocator<DexCallSite *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.28" = type { %"struct.std::_Vector_base.29" }
%"struct.std::_Vector_base.29" = type { %"struct.std::_Vector_base<DexMethodHandle *, std::allocator<DexMethodHandle *>>::_Vector_impl" }
%"struct.std::_Vector_base<DexMethodHandle *, std::allocator<DexMethodHandle *>>::_Vector_impl" = type { %"struct.std::_Vector_base<DexMethodHandle *, std::allocator<DexMethodHandle *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DexMethodHandle *, std::allocator<DexMethodHandle *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.dex_string_id = type { i32 }
%struct.dex_header = type { [8 x i8], i32, [20 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@.str.8 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__._ZNK6DexIdx15get_string_dataEjPj = external hidden unnamed_addr constant [69 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [24 x i8], align 1

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

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

; Function Attrs: noreturn
declare void @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
define dso_local { i64, ptr } @_ZNK6DexIdx15get_string_dataEjPj(ptr noundef nonnull align 8 dereferenceable(288) %0, i32 noundef %1, ptr noundef %2) #2 align 2 {
  %4 = alloca %"class.std::basic_string_view", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  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
  %12 = load ptr, ptr %5, align 8
  %13 = load i32, ptr %6, align 4, !tbaa !9
  %14 = getelementptr inbounds %class.DexIdx, ptr %12, i32 0, i32 2
  %15 = load i32, ptr %14, align 8, !tbaa !11
  %16 = icmp ult i32 %13, %15
  br i1 %16, label %17, label %18

17:                                               ; preds = %3
  br label %20

18:                                               ; preds = %3
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef @.str.29, ptr noundef @.str.8, i32 noundef 120, ptr noundef @__PRETTY_FUNCTION__._ZNK6DexIdx15get_string_dataEjPj, i32 noundef 2, ptr noundef @.str.19) #5
  unreachable

19:                                               ; No predecessors!
  br label %20

20:                                               ; preds = %19, %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %21 = getelementptr inbounds %class.DexIdx, ptr %12, i32 0, i32 1
  %22 = load ptr, ptr %21, align 8, !tbaa !41
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds %struct.dex_string_id, ptr %22, i64 %24
  %26 = getelementptr inbounds %struct.dex_string_id, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 1, !tbaa !42
  store i32 %27, ptr %8, align 4, !tbaa !9
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = getelementptr inbounds %class.DexIdx, ptr %12, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !44
  %31 = getelementptr inbounds %struct.dex_header, ptr %30, i32 0, i32 3
  %32 = load i32, ptr %31, align 1, !tbaa !45
  %33 = sub i32 %32, 6
  %34 = icmp ult i32 %28, %33
  br i1 %34, label %35, label %36

35:                                               ; preds = %20
  br label %38

36:                                               ; preds = %20
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef @.str.30, ptr noundef @.str.8, i32 noundef 125, ptr noundef @__PRETTY_FUNCTION__._ZNK6DexIdx15get_string_dataEjPj, i32 noundef 12, ptr noundef @.str.31) #5
  unreachable

37:                                               ; No predecessors!
  br label %38

38:                                               ; preds = %37, %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %39 = getelementptr inbounds %class.DexIdx, ptr %12, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !44
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %40, i64 %42
  store ptr %43, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %44 = call noundef i32 @_Z12read_uleb128PPKh(ptr noundef %9)
  store i32 %44, ptr %10, align 4, !tbaa !9
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %50

47:                                               ; preds = %38
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %48, ptr %49, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %47, %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %51, ptr %11, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %67, %50
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = load i8, ptr %53, align 1, !tbaa !47
  %55 = zext i8 %54 to i32
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %65

57:                                               ; preds = %52
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = getelementptr inbounds %class.DexIdx, ptr %12, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !44
  %61 = call noundef i32 @_ZNK6DexIdx13get_file_sizeEv(ptr noundef nonnull align 8 dereferenceable(288) %12)
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds i8, ptr %60, i64 %62
  %64 = icmp ult ptr %58, %63
  br label %65

65:                                               ; preds = %57, %52
  %66 = phi i1 [ false, %52 ], [ %64, %57 ]
  br i1 %66, label %67, label %70

67:                                               ; preds = %65
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i32 1
  store ptr %69, ptr %11, align 8, !tbaa !5
  br label %52, !llvm.loop !48

70:                                               ; preds = %65
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = getelementptr inbounds %class.DexIdx, ptr %12, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !44
  %74 = call noundef i32 @_ZNK6DexIdx13get_file_sizeEv(ptr noundef nonnull align 8 dereferenceable(288) %12)
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds i8, ptr %73, i64 %75
  %77 = icmp ult ptr %71, %76
  br i1 %77, label %78, label %79

78:                                               ; preds = %70
  br label %81

79:                                               ; preds = %70
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef @.str.32, ptr noundef @.str.8, i32 noundef 139, ptr noundef @__PRETTY_FUNCTION__._ZNK6DexIdx15get_string_dataEjPj, i32 noundef 12, ptr noundef @.str.33) #5
  unreachable

80:                                               ; No predecessors!
  br label %81

81:                                               ; preds = %80, %78
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = ptrtoint ptr %83 to i64
  %86 = ptrtoint ptr %84 to i64
  %87 = sub i64 %85, %86
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKcm(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef %82, i64 noundef %87) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %88 = load { i64, ptr }, ptr %4, align 8
  ret { i64, ptr } %88
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12read_uleb128PPKh(ptr noundef) #3

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { inlinehint 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 #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 = { noreturn }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTS6DexIdx", !6, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !6, i64 40, !10, i64 48, !6, i64 56, !10, i64 64, !6, i64 72, !10, i64 80, !6, i64 88, !10, i64 96, !6, i64 104, !10, i64 112, !13, i64 120, !17, i64 144, !21, i64 168, !25, i64 192, !29, i64 216, !33, i64 240, !37, i64 264}
!13 = !{!"_ZTSSt6vectorIPK9DexStringSaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIPK9DexStringSaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPK9DexStringSaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPK9DexStringSaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSSt6vectorIP7DexTypeSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIP7DexTypeSaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIP7DexTypeSaIS1_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIP7DexTypeSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSSt6vectorIP11DexFieldRefSaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseIP11DexFieldRefSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIP11DexFieldRefSaIS1_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIP11DexFieldRefSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSSt6vectorIP12DexMethodRefSaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIP12DexMethodRefSaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIP12DexMethodRefSaIS1_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIP12DexMethodRefSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSSt6vectorIP8DexProtoSaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIP8DexProtoSaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIP8DexProtoSaIS1_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIP8DexProtoSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"_ZTSSt6vectorIP11DexCallSiteSaIS1_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseIP11DexCallSiteSaIS1_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIP11DexCallSiteSaIS1_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIP11DexCallSiteSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!"_ZTSSt6vectorIP15DexMethodHandleSaIS1_EE", !38, i64 0}
!38 = !{!"_ZTSSt12_Vector_baseIP15DexMethodHandleSaIS1_EE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIP15DexMethodHandleSaIS1_EE12_Vector_implE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseIP15DexMethodHandleSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!41 = !{!12, !6, i64 8}
!42 = !{!43, !10, i64 0}
!43 = !{!"_ZTS13dex_string_id", !10, i64 0}
!44 = !{!12, !6, i64 0}
!45 = !{!46, !10, i64 32}
!46 = !{!"_ZTS10dex_header", !7, i64 0, !10, i64 8, !7, i64 12, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108}
!47 = !{!7, !7, i64 0}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


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

%"class.std::basic_string_view" = type { i64, ptr }
%struct.dex_string_id = type { i32 }

@.str.8 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__._ZNK6DexIdx15get_string_dataEjPj = external hidden unnamed_addr constant [69 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [24 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local { i64, ptr } @_ZNK6DexIdx15get_string_dataEjPj(ptr noundef nonnull align 8 dereferenceable(288) %0, i32 noundef %1, ptr noundef writeonly %2) local_unnamed_addr #2 align 2 {
  %4 = alloca %"class.std::basic_string_view", align 8
  %5 = alloca ptr, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = icmp ugt i32 %7, %1
  br i1 %8, label %10, label %9

9:                                                ; preds = %3
  tail call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef nonnull @.str.29, ptr noundef nonnull @.str.8, i32 noundef 120, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK6DexIdx15get_string_dataEjPj, i32 noundef 2, ptr noundef nonnull @.str.19) #5
  unreachable

10:                                               ; preds = %3
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !39
  %13 = zext i32 %1 to i64
  %14 = getelementptr inbounds %struct.dex_string_id, ptr %12, i64 %13
  %15 = load i32, ptr %14, align 1, !tbaa !40
  %16 = load ptr, ptr %0, align 8, !tbaa !42
  %17 = getelementptr inbounds i8, ptr %16, i64 32
  %18 = load i32, ptr %17, align 1, !tbaa !43
  %19 = add i32 %18, -6
  %20 = icmp ult i32 %15, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %10
  tail call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef nonnull @.str.30, ptr noundef nonnull @.str.8, i32 noundef 125, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK6DexIdx15get_string_dataEjPj, i32 noundef 12, ptr noundef nonnull @.str.31) #5
  unreachable

22:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %23 = zext i32 %15 to i64
  %24 = getelementptr inbounds i8, ptr %16, i64 %23
  store ptr %24, ptr %5, align 8, !tbaa !45
  %25 = call noundef i32 @_Z12read_uleb128PPKh(ptr noundef nonnull %5)
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %27, label %26

26:                                               ; preds = %22
  store i32 %25, ptr %2, align 4, !tbaa !46
  br label %27

27:                                               ; preds = %26, %22
  %28 = load ptr, ptr %5, align 8, !tbaa !45
  %29 = load i8, ptr %28, align 1, !tbaa !47
  %.not1516 = icmp eq i8 %29, 0
  br i1 %.not1516, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %27, %35
  %.017 = phi ptr [ %36, %35 ], [ %28, %27 ]
  %30 = load ptr, ptr %0, align 8, !tbaa !42
  %31 = call noundef i32 @_ZNK6DexIdx13get_file_sizeEv(ptr noundef nonnull align 8 dereferenceable(288) %0)
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds i8, ptr %30, i64 %32
  %34 = icmp ult ptr %.017, %33
  br i1 %34, label %35, label %.critedge

35:                                               ; preds = %.lr.ph
  %36 = getelementptr inbounds i8, ptr %.017, i64 1
  %37 = load i8, ptr %36, align 1, !tbaa !47
  %.not15 = icmp eq i8 %37, 0
  br i1 %.not15, label %.critedge, label %.lr.ph, !llvm.loop !48

.critedge:                                        ; preds = %.lr.ph, %35, %27
  %.0.lcssa = phi ptr [ %28, %27 ], [ %36, %35 ], [ %.017, %.lr.ph ]
  %38 = load ptr, ptr %0, align 8, !tbaa !42
  %39 = call noundef i32 @_ZNK6DexIdx13get_file_sizeEv(ptr noundef nonnull align 8 dereferenceable(288) %0)
  %40 = zext i32 %39 to i64
  %41 = getelementptr inbounds i8, ptr %38, i64 %40
  %42 = icmp ult ptr %.0.lcssa, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %.critedge
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef nonnull @.str.32, ptr noundef nonnull @.str.8, i32 noundef 139, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK6DexIdx15get_string_dataEjPj, i32 noundef 12, ptr noundef nonnull @.str.33) #5
  unreachable

44:                                               ; preds = %.critedge
  %45 = load ptr, ptr %5, align 8, !tbaa !45
  %46 = ptrtoint ptr %.0.lcssa to i64
  %47 = ptrtoint ptr %45 to i64
  %48 = sub i64 %46, %47
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKcm(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef %45, i64 noundef %48) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %.fca.0.load = load i64, ptr %4, align 8
  %.fca.0.insert = insertvalue { i64, ptr } poison, i64 %.fca.0.load, 0
  %.fca.1.gep = getelementptr inbounds i8, ptr %4, i64 8
  %.fca.1.load = load ptr, ptr %.fca.1.gep, align 8
  %.fca.1.insert = insertvalue { i64, ptr } %.fca.0.insert, ptr %.fca.1.load, 1
  ret { i64, ptr } %.fca.1.insert
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12read_uleb128PPKh(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6DexIdx13get_file_sizeEv(ptr noundef nonnull align 8 dereferenceable(288)) local_unnamed_addr #4 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { inlinehint 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 #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 = { noreturn }
attributes #6 = { 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 16}
!6 = !{!"_ZTS6DexIdx", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !10, i64 48, !7, i64 56, !10, i64 64, !7, i64 72, !10, i64 80, !7, i64 88, !10, i64 96, !7, i64 104, !10, i64 112, !11, i64 120, !15, i64 144, !19, i64 168, !23, i64 192, !27, i64 216, !31, i64 240, !35, i64 264}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIPK9DexStringSaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIPK9DexStringSaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIPK9DexStringSaIS2_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPK9DexStringSaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!"_ZTSSt6vectorIP7DexTypeSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIP7DexTypeSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIP7DexTypeSaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP7DexTypeSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!19 = !{!"_ZTSSt6vectorIP11DexFieldRefSaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIP11DexFieldRefSaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIP11DexFieldRefSaIS1_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIP11DexFieldRefSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!23 = !{!"_ZTSSt6vectorIP12DexMethodRefSaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIP12DexMethodRefSaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIP12DexMethodRefSaIS1_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIP12DexMethodRefSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!27 = !{!"_ZTSSt6vectorIP8DexProtoSaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIP8DexProtoSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIP8DexProtoSaIS1_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIP8DexProtoSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!31 = !{!"_ZTSSt6vectorIP11DexCallSiteSaIS1_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIP11DexCallSiteSaIS1_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIP11DexCallSiteSaIS1_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIP11DexCallSiteSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!35 = !{!"_ZTSSt6vectorIP15DexMethodHandleSaIS1_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIP15DexMethodHandleSaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIP15DexMethodHandleSaIS1_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIP15DexMethodHandleSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!39 = !{!6, !7, i64 8}
!40 = !{!41, !10, i64 0}
!41 = !{!"_ZTS13dex_string_id", !10, i64 0}
!42 = !{!6, !7, i64 0}
!43 = !{!44, !10, i64 32}
!44 = !{!"_ZTS10dex_header", !8, i64 0, !10, i64 8, !8, i64 12, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108}
!45 = !{!7, !7, i64 0}
!46 = !{!10, !10, i64 0}
!47 = !{!8, !8, i64 0}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


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