; LLVM IR from facebook/redex :: libresource/ResourceTypes.ll (ZN7android12ResXMLParser8nextNodeEv)

; 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.android::ResXMLParser" = type <{ ptr, i32, [4 x i8], ptr, ptr, i32, [4 x i8] }>
%"struct.android::ResXMLTree_node" = type { %"struct.android::ResChunk_header", i32, %"struct.android::ResStringPool_ref" }
%"struct.android::ResChunk_header" = type { i16, i16, i32 }
%"struct.android::ResStringPool_ref" = type { i32 }
%"class.android::ResXMLTree" = type <{ %"class.android::ResXMLParser.base", [4 x i8], %"class.std::shared_ptr", i32, [4 x i8], ptr, ptr, i64, ptr, %"class.android::ResStringPool", ptr, i64, ptr, ptr, i32, [4 x i8] }>
%"class.android::ResXMLParser.base" = type <{ ptr, i32, [4 x i8], ptr, ptr, i32 }>
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.android::ResStringPool" = type <{ ptr, i32, [4 x i8], ptr, ptr, i64, %"class.std::mutex", ptr, ptr, ptr, ptr, i32, [4 x i8], ptr, i32, [4 x i8] }>
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [70 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7android12ResXMLParser8nextNodeEv(ptr noundef nonnull align 8 dereferenceable(36) %0) #2 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i16, align 2
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  %11 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 1
  %12 = load i32, ptr %11, align 8, !tbaa !9
  %13 = icmp slt i32 %12, 0
  br i1 %13, label %14, label %17

14:                                               ; preds = %1
  %15 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 1
  %16 = load i32, ptr %15, align 8, !tbaa !9
  store i32 %16, ptr %2, align 4
  br label %144

17:                                               ; preds = %1
  br label %18

18:                                               ; preds = %142, %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %19 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 3
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = getelementptr inbounds %"struct.android::ResXMLTree_node", ptr %22, i32 0, i32 0
  %24 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %23, i32 0, i32 2
  %25 = load i32, ptr %24, align 4, !tbaa !14
  %26 = zext i32 %25 to i64
  %27 = getelementptr inbounds i8, ptr %20, i64 %26
  store ptr %27, ptr %4, align 8, !tbaa !5
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !19
  %31 = getelementptr inbounds %"class.android::ResXMLTree", ptr %30, i32 0, i32 8
  %32 = load ptr, ptr %31, align 8, !tbaa !20
  %33 = icmp uge ptr %28, %32
  br i1 %33, label %34, label %37

34:                                               ; preds = %18
  %35 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 3
  store ptr null, ptr %35, align 8, !tbaa !13
  %36 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 1
  store i32 1, ptr %36, align 8, !tbaa !9
  store i32 1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %140

37:                                               ; preds = %18
  %38 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !19
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = call noundef i32 @_ZNK7android10ResXMLTree12validateNodeEPKNS_15ResXMLTree_nodeE(ptr noundef nonnull align 8 dereferenceable(268) %39, ptr noundef %40)
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %37
  %44 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 3
  store ptr null, ptr %44, align 8, !tbaa !13
  %45 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 1
  store i32 -1, ptr %45, align 8, !tbaa !9
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %140

46:                                               ; preds = %37
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 3
  store ptr %47, ptr %48, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #3
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.android::ResXMLTree_node", ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %50, i32 0, i32 1
  %52 = load i16, ptr %51, align 2, !tbaa !29
  store i16 %52, ptr %6, align 2, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.android::ResXMLTree_node", ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %54, i32 0, i32 2
  %56 = load i32, ptr %55, align 4, !tbaa !14
  store i32 %56, ptr %7, align 4, !tbaa !31
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load i16, ptr %6, align 2, !tbaa !30
  %59 = zext i16 %58 to i32
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %57, i64 %60
  %62 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 4
  store ptr %61, ptr %62, align 8, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store i64 0, ptr %8, align 8, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.android::ResXMLTree_node", ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %64, i32 0, i32 0
  %66 = load i16, ptr %65, align 4, !tbaa !34
  %67 = zext i16 %66 to i32
  store i32 %67, ptr %9, align 4, !tbaa !35
  %68 = load i32, ptr %9, align 4, !tbaa !35
  %69 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 1
  store i32 %68, ptr %69, align 8, !tbaa !9
  switch i32 %68, label %74 [
    i32 256, label %70
    i32 257, label %70
    i32 258, label %71
    i32 259, label %72
    i32 260, label %73
  ]

70:                                               ; preds = %46, %46
  store i64 8, ptr %8, align 8, !tbaa !33
  br label %98

71:                                               ; preds = %46
  store i64 20, ptr %8, align 8, !tbaa !33
  br label %98

72:                                               ; preds = %46
  store i64 8, ptr %8, align 8, !tbaa !33
  br label %98

73:                                               ; preds = %46
  store i64 12, ptr %8, align 8, !tbaa !33
  br label %98

74:                                               ; preds = %46
  br label %75

75:                                               ; preds = %74
  %76 = load ptr, ptr @stderr, align 8, !tbaa !5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str) #3
  %78 = load ptr, ptr @stderr, align 8, !tbaa !5
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.android::ResXMLTree_node", ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %80, i32 0, i32 0
  %82 = load i16, ptr %81, align 4, !tbaa !34
  %83 = zext i16 %82 to i32
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !19
  %87 = getelementptr inbounds %"class.android::ResXMLTree", ptr %86, i32 0, i32 6
  %88 = load ptr, ptr %87, align 8, !tbaa !36
  %89 = ptrtoint ptr %84 to i64
  %90 = ptrtoint ptr %88 to i64
  %91 = sub i64 %89, %90
  %92 = trunc i64 %91 to i32
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef @.str.26, i32 noundef %83, i32 noundef %92) #3
  %94 = load ptr, ptr @stderr, align 8, !tbaa !5
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef @.str.2) #3
  br label %96

96:                                               ; preds = %75
  br label %97

97:                                               ; preds = %96
  store i32 3, ptr %5, align 4
  br label %139

98:                                               ; preds = %73, %72, %71, %70
  %99 = load i32, ptr %7, align 4, !tbaa !31
  %100 = load i16, ptr %6, align 2, !tbaa !30
  %101 = zext i16 %100 to i32
  %102 = sub i32 %99, %101
  %103 = zext i32 %102 to i64
  %104 = load i64, ptr %8, align 8, !tbaa !33
  %105 = icmp ult i64 %103, %104
  br i1 %105, label %106, label %137

106:                                              ; preds = %98
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr @stderr, align 8, !tbaa !5
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef @.str) #3
  %110 = load ptr, ptr @stderr, align 8, !tbaa !5
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.android::ResXMLTree_node", ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %112, i32 0, i32 0
  %114 = load i16, ptr %113, align 4, !tbaa !34
  %115 = zext i16 %114 to i32
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !19
  %119 = getelementptr inbounds %"class.android::ResXMLTree", ptr %118, i32 0, i32 6
  %120 = load ptr, ptr %119, align 8, !tbaa !36
  %121 = ptrtoint ptr %116 to i64
  %122 = ptrtoint ptr %120 to i64
  %123 = sub i64 %121, %122
  %124 = trunc i64 %123 to i32
  %125 = load i32, ptr %7, align 4, !tbaa !31
  %126 = load i16, ptr %6, align 2, !tbaa !30
  %127 = zext i16 %126 to i32
  %128 = sub i32 %125, %127
  %129 = load i64, ptr %8, align 8, !tbaa !33
  %130 = trunc i64 %129 to i32
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef @.str.27, i32 noundef %115, i32 noundef %124, i32 noundef %128, i32 noundef %130) #3
  %132 = load ptr, ptr @stderr, align 8, !tbaa !5
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %132, ptr noundef @.str.2) #3
  br label %134

134:                                              ; preds = %107
  br label %135

135:                                              ; preds = %134
  %136 = getelementptr inbounds %"class.android::ResXMLParser", ptr %10, i32 0, i32 1
  store i32 -1, ptr %136, align 8, !tbaa !9
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %139

137:                                              ; preds = %98
  %138 = load i32, ptr %9, align 4, !tbaa !35
  store i32 %138, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %139

139:                                              ; preds = %137, %135, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #3
  br label %140

140:                                              ; preds = %139, %43, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %141 = load i32, ptr %5, align 4
  switch i32 %141, label %146 [
    i32 1, label %144
    i32 3, label %142
  ]

142:                                              ; preds = %140
  br i1 true, label %18, label %143, !llvm.loop !37

143:                                              ; preds = %142
  unreachable

144:                                              ; preds = %140, %14
  %145 = load i32, ptr %2, align 4
  ret i32 %145

146:                                              ; preds = %140
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7android10ResXMLTree12validateNodeEPKNS_15ResXMLTree_nodeE(ptr noundef nonnull align 8 dereferenceable(268), ptr noundef) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTSN7android12ResXMLParserE", !6, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !12, i64 32}
!11 = !{!"_ZTSN7android12ResXMLParser12event_code_tE", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !6, i64 16}
!14 = !{!15, !12, i64 4}
!15 = !{!"_ZTSN7android15ResXMLTree_nodeE", !16, i64 0, !12, i64 8, !18, i64 12}
!16 = !{!"_ZTSN7android15ResChunk_headerE", !17, i64 0, !17, i64 2, !12, i64 4}
!17 = !{!"short", !7, i64 0}
!18 = !{!"_ZTSN7android17ResStringPool_refE", !12, i64 0}
!19 = !{!10, !6, i64 0}
!20 = !{!21, !6, i64 88}
!21 = !{!"_ZTSN7android10ResXMLTreeE", !10, i64 0, !22, i64 40, !12, i64 56, !6, i64 64, !6, i64 72, !25, i64 80, !6, i64 88, !26, i64 96, !6, i64 232, !25, i64 240, !6, i64 248, !6, i64 256, !11, i64 264}
!22 = !{!"_ZTSSt10shared_ptrIKN7android15DynamicRefTableEE", !23, i64 0}
!23 = !{!"_ZTSSt12__shared_ptrIKN7android15DynamicRefTableELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !24, i64 8}
!24 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!25 = !{!"long", !7, i64 0}
!26 = !{!"_ZTSN7android13ResStringPoolE", !12, i64 8, !6, i64 16, !6, i64 24, !25, i64 32, !27, i64 40, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !12, i64 112, !6, i64 120, !12, i64 128}
!27 = !{!"_ZTSSt5mutex", !28, i64 0}
!28 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!29 = !{!15, !17, i64 2}
!30 = !{!17, !17, i64 0}
!31 = !{!12, !12, i64 0}
!32 = !{!10, !6, i64 24}
!33 = !{!25, !25, i64 0}
!34 = !{!15, !17, i64 0}
!35 = !{!11, !11, i64 0}
!36 = !{!21, !6, i64 72}
!37 = distinct !{!37, !38}
!38 = !{!"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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [70 x i8], align 1
@switch.table._ZN7android12ResXMLParser8nextNodeEv = private unnamed_addr constant [5 x i64] [i64 8, i64 8, i64 20, i64 8, i64 12], align 8

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7android12ResXMLParser8nextNodeEv(ptr nocapture noundef nonnull align 8 dereferenceable(36) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = icmp slt i32 %3, 0
  br i1 %4, label %.thread, label %.preheader

.preheader:                                       ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = load ptr, ptr %5, align 8, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %6, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !13
  %9 = zext i32 %8 to i64
  %10 = getelementptr inbounds i8, ptr %6, i64 %9
  %11 = load ptr, ptr %0, align 8, !tbaa !18
  %12 = getelementptr inbounds i8, ptr %11, i64 88
  %13 = load ptr, ptr %12, align 8, !tbaa !19
  %.not52 = icmp ult ptr %10, %13
  br i1 %.not52, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %14 = getelementptr inbounds i8, ptr %0, i64 24
  br label %15

._crit_edge:                                      ; preds = %52, %.preheader
  store ptr null, ptr %5, align 8, !tbaa !12
  br label %.thread.sink.split

15:                                               ; preds = %.lr.ph, %52
  %16 = phi ptr [ %11, %.lr.ph ], [ %73, %52 ]
  %17 = phi ptr [ %10, %.lr.ph ], [ %72, %52 ]
  %18 = tail call noundef i32 @_ZNK7android10ResXMLTree12validateNodeEPKNS_15ResXMLTree_nodeE(ptr noundef nonnull align 8 dereferenceable(268) %16, ptr noundef nonnull %17)
  %.not27 = icmp eq i32 %18, 0
  br i1 %.not27, label %20, label %19

19:                                               ; preds = %15
  store ptr null, ptr %5, align 8, !tbaa !12
  br label %.thread.sink.split

20:                                               ; preds = %15
  store ptr %17, ptr %5, align 8, !tbaa !12
  %21 = getelementptr inbounds i8, ptr %17, i64 2
  %22 = load i16, ptr %21, align 2, !tbaa !28
  %23 = getelementptr inbounds i8, ptr %17, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !13
  %25 = zext i16 %22 to i64
  %26 = getelementptr inbounds i8, ptr %17, i64 %25
  store ptr %26, ptr %14, align 8, !tbaa !29
  %27 = load i16, ptr %17, align 4, !tbaa !30
  %28 = zext i16 %27 to i32
  store i32 %28, ptr %2, align 8, !tbaa !5
  %switch.tableidx = add i16 %27, -256
  %29 = icmp ult i16 %switch.tableidx, 5
  br i1 %29, label %switch.lookup, label %52

switch.lookup:                                    ; preds = %20
  %30 = zext nneg i16 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [5 x i64], ptr @switch.table._ZN7android12ResXMLParser8nextNodeEv, i64 0, i64 %30
  %switch.load = load i64, ptr %switch.gep, align 8
  %31 = zext i16 %22 to i32
  %32 = sub i32 %24, %31
  %33 = zext i32 %32 to i64
  %34 = icmp ugt i64 %switch.load, %33
  br i1 %34, label %35, label %.thread

35:                                               ; preds = %switch.lookup
  %36 = load ptr, ptr @stderr, align 8, !tbaa !31
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str) #2
  %38 = load ptr, ptr @stderr, align 8, !tbaa !31
  %39 = load i16, ptr %17, align 4, !tbaa !30
  %40 = zext i16 %39 to i32
  %41 = load ptr, ptr %0, align 8, !tbaa !18
  %42 = getelementptr inbounds i8, ptr %41, i64 72
  %43 = load ptr, ptr %42, align 8, !tbaa !32
  %44 = ptrtoint ptr %17 to i64
  %45 = ptrtoint ptr %43 to i64
  %46 = sub i64 %44, %45
  %47 = trunc i64 %46 to i32
  %48 = trunc nuw nsw i64 %switch.load to i32
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.27, i32 noundef %40, i32 noundef %47, i32 noundef %32, i32 noundef %48) #2
  %50 = load ptr, ptr @stderr, align 8, !tbaa !31
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.2) #2
  br label %.thread.sink.split

52:                                               ; preds = %20
  %53 = load ptr, ptr @stderr, align 8, !tbaa !31
  %54 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str) #2
  %55 = load ptr, ptr @stderr, align 8, !tbaa !31
  %56 = load i16, ptr %17, align 4, !tbaa !30
  %57 = zext i16 %56 to i32
  %58 = load ptr, ptr %0, align 8, !tbaa !18
  %59 = getelementptr inbounds i8, ptr %58, i64 72
  %60 = load ptr, ptr %59, align 8, !tbaa !32
  %61 = ptrtoint ptr %17 to i64
  %62 = ptrtoint ptr %60 to i64
  %63 = sub i64 %61, %62
  %64 = trunc i64 %63 to i32
  %65 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.26, i32 noundef %57, i32 noundef %64) #2
  %66 = load ptr, ptr @stderr, align 8, !tbaa !31
  %67 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.2) #2
  %68 = load ptr, ptr %5, align 8, !tbaa !12
  %69 = getelementptr inbounds i8, ptr %68, i64 4
  %70 = load i32, ptr %69, align 4, !tbaa !13
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %68, i64 %71
  %73 = load ptr, ptr %0, align 8, !tbaa !18
  %74 = getelementptr inbounds i8, ptr %73, i64 88
  %75 = load ptr, ptr %74, align 8, !tbaa !19
  %.not = icmp ult ptr %72, %75
  br i1 %.not, label %15, label %._crit_edge

.thread.sink.split:                               ; preds = %._crit_edge, %19, %35
  %.sink = phi i32 [ -1, %35 ], [ -1, %19 ], [ 1, %._crit_edge ]
  store i32 %.sink, ptr %2, align 8, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %.thread.sink.split, %switch.lookup, %1
  %.3 = phi i32 [ %3, %1 ], [ %28, %switch.lookup ], [ %.sink, %.thread.sink.split ]
  ret i32 %.3
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK7android10ResXMLTree12validateNodeEPKNS_15ResXMLTree_nodeE(ptr noundef nonnull align 8 dereferenceable(268), ptr noundef) local_unnamed_addr #1 align 2

attributes #0 = { nofree 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 #1 = { 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 #2 = { cold 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 = !{!"_ZTSN7android12ResXMLParserE", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !11, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN7android12ResXMLParser12event_code_tE", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !7, i64 16}
!13 = !{!14, !11, i64 4}
!14 = !{!"_ZTSN7android15ResXMLTree_nodeE", !15, i64 0, !11, i64 8, !17, i64 12}
!15 = !{!"_ZTSN7android15ResChunk_headerE", !16, i64 0, !16, i64 2, !11, i64 4}
!16 = !{!"short", !8, i64 0}
!17 = !{!"_ZTSN7android17ResStringPool_refE", !11, i64 0}
!18 = !{!6, !7, i64 0}
!19 = !{!20, !7, i64 88}
!20 = !{!"_ZTSN7android10ResXMLTreeE", !6, i64 0, !21, i64 40, !11, i64 56, !7, i64 64, !7, i64 72, !24, i64 80, !7, i64 88, !25, i64 96, !7, i64 232, !24, i64 240, !7, i64 248, !7, i64 256, !10, i64 264}
!21 = !{!"_ZTSSt10shared_ptrIKN7android15DynamicRefTableEE", !22, i64 0}
!22 = !{!"_ZTSSt12__shared_ptrIKN7android15DynamicRefTableELN9__gnu_cxx12_Lock_policyE2EE", !7, i64 0, !23, i64 8}
!23 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !7, i64 0}
!24 = !{!"long", !8, i64 0}
!25 = !{!"_ZTSN7android13ResStringPoolE", !11, i64 8, !7, i64 16, !7, i64 24, !24, i64 32, !26, i64 40, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !11, i64 112, !7, i64 120, !11, i64 128}
!26 = !{!"_ZTSSt5mutex", !27, i64 0}
!27 = !{!"_ZTSSt12__mutex_base", !8, i64 0}
!28 = !{!14, !16, i64 2}
!29 = !{!6, !7, i64 24}
!30 = !{!14, !16, i64 0}
!31 = !{!7, !7, i64 0}
!32 = !{!20, !7, i64 72}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass