; LLVM IR from facebook/redex :: libresource (Visitor)

; 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.arsc::ResChunkPullParser" = type { i32, ptr, i64, ptr }
%"struct.android::ResTable_header" = type { %"struct.android::ResChunk_header", i32 }
%"struct.android::ResChunk_header" = type { i16, i16, i32 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [23 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: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4arsc20ResourceTableVisitor5validEPKN7android16ResTable_packageE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #1 align 2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4arsc20ResourceTableVisitor11visit_tableEPN7android15ResTable_headerE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) unnamed_addr #1 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.arsc::ResChunkPullParser", align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8
  br label %11

11:                                               ; preds = %2
  br label %12

12:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %"struct.android::ResTable_header", ptr %13, i32 0, i32 0
  %15 = call noundef ptr @_ZN4arscL8get_dataEPN7android15ResChunk_headerE(ptr noundef %14)
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %"struct.android::ResTable_header", ptr %16, i32 0, i32 0
  %18 = call noundef i32 @_ZN4arscL12get_data_lenEPN7android15ResChunk_headerE(ptr noundef %17)
  %19 = zext i32 %18 to i64
  call void @_ZN4arsc18ResChunkPullParserC2EPvm(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef %15, i64 noundef %19)
  br label %20

20:                                               ; preds = %102, %12
  %21 = call noundef i32 @_ZN4arsc18ResChunkPullParser4NextEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %22 = call noundef zeroext i1 @_ZN4arsc18ResChunkPullParser11IsGoodEventENS0_5EventE(i32 noundef %21)
  br i1 %22, label %23, label %103

23:                                               ; preds = %20
  %24 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %25 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %24, i32 0, i32 0
  %26 = load i16, ptr %25, align 4, !tbaa !9
  %27 = zext i16 %26 to i32
  switch i32 %27, label %88 [
    i32 1, label %28
    i32 512, label %65
  ]

28:                                               ; preds = %23
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %54

31:                                               ; preds = %28
  %32 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %33 = call noundef ptr @_ZN4arscL13convert_chunkIN7android20ResStringPool_headerELm28EEEPT_PNS1_15ResChunk_headerE(ptr noundef %32)
  store ptr %33, ptr %6, align 8, !tbaa !5
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = icmp eq ptr %34, null
  br i1 %35, label %36, label %46

36:                                               ; preds = %31
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef @.str) #5
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str.12) #5
  %42 = load ptr, ptr @stderr, align 8, !tbaa !5
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.5) #5
  br label %44

44:                                               ; preds = %37
  br label %45

45:                                               ; preds = %44
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %117

46:                                               ; preds = %31
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = load ptr, ptr %10, align 8, !tbaa !13
  %49 = getelementptr inbounds ptr, ptr %48, i64 4
  %50 = load ptr, ptr %49, align 8
  %51 = call noundef zeroext i1 %50(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef %47)
  br i1 %51, label %53, label %52

52:                                               ; preds = %46
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %117

53:                                               ; preds = %46
  br label %64

54:                                               ; preds = %28
  br label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr @stderr, align 8, !tbaa !5
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str) #5
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.13) #5
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.5) #5
  br label %62

62:                                               ; preds = %55
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63, %53
  br label %102

65:                                               ; preds = %23
  %66 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %67 = call noundef ptr @_ZN4arscL13convert_chunkIN7android16ResTable_packageELm284EEEPT_PNS1_15ResChunk_headerE(ptr noundef %66)
  store ptr %67, ptr %7, align 8, !tbaa !5
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = call noundef zeroext i1 @_ZN4arsc20ResourceTableVisitor5validEPKN7android16ResTable_packageE(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef %68)
  br i1 %69, label %80, label %70

70:                                               ; preds = %65
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr @stderr, align 8, !tbaa !5
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef @.str) #5
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.14) #5
  %76 = load ptr, ptr @stderr, align 8, !tbaa !5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str.5) #5
  br label %78

78:                                               ; preds = %71
  br label %79

79:                                               ; preds = %78
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %117

80:                                               ; preds = %65
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = load ptr, ptr %10, align 8, !tbaa !13
  %83 = getelementptr inbounds ptr, ptr %82, i64 5
  %84 = load ptr, ptr %83, align 8
  %85 = call noundef zeroext i1 %84(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef %81)
  br i1 %85, label %87, label %86

86:                                               ; preds = %80
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %117

87:                                               ; preds = %80
  br label %102

88:                                               ; preds = %23
  br label %89

89:                                               ; preds = %88
  %90 = load ptr, ptr @stderr, align 8, !tbaa !5
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str) #5
  %92 = load ptr, ptr @stderr, align 8, !tbaa !5
  %93 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %94 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %93, i32 0, i32 0
  %95 = load i16, ptr %94, align 4, !tbaa !9
  %96 = zext i16 %95 to i32
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef @.str.15, i32 noundef %96) #5
  %98 = load ptr, ptr @stderr, align 8, !tbaa !5
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef @.str.5) #5
  br label %100

100:                                              ; preds = %89
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101, %87, %64
  br label %20, !llvm.loop !15

103:                                              ; preds = %20
  %104 = call noundef i32 @_ZN4arsc18ResChunkPullParser5eventEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %105 = icmp eq i32 %104, 2
  br i1 %105, label %106, label %116

106:                                              ; preds = %103
  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) #5
  %110 = load ptr, ptr @stderr, align 8, !tbaa !5
  %111 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef @.str.16) #5
  %112 = load ptr, ptr @stderr, align 8, !tbaa !5
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %112, ptr noundef @.str.5) #5
  br label %114

114:                                              ; preds = %107
  br label %115

115:                                              ; preds = %114
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %117

116:                                              ; preds = %103
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %117

117:                                              ; preds = %116, %115, %86, %79, %52, %45
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %118 = load i1, ptr %3, align 1
  ret i1 %118
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN4arscL8get_dataEPN7android15ResChunk_headerE(ptr noundef) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4arsc18ResChunkPullParser11IsGoodEventENS0_5EventE(i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4arsc18ResChunkPullParser4NextEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN4arscL13convert_chunkIN7android20ResStringPool_headerELm28EEEPT_PNS1_15ResChunk_headerE(ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN4arscL13convert_chunkIN7android16ResTable_packageELm284EEEPT_PNS1_15ResChunk_headerE(ptr noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { 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 0}
!10 = !{!"_ZTSN7android15ResChunk_headerE", !11, i64 0, !11, i64 2, !12, i64 4}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"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.arsc::ResChunkPullParser" = type { i32, ptr, i64, ptr }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [23 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: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4arsc20ResourceTableVisitor5validEPKN7android16ResTable_packageE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4arsc20ResourceTableVisitor11visit_tableEPN7android15ResTable_headerE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) unnamed_addr #1 align 2 {
  %3 = alloca %"class.arsc::ResChunkPullParser", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  %4 = tail call noundef ptr @_ZN4arscL8get_dataEPN7android15ResChunk_headerE(ptr noundef %1)
  %5 = tail call noundef i32 @_ZN4arscL12get_data_lenEPN7android15ResChunk_headerE(ptr noundef %1)
  %6 = zext i32 %5 to i64
  call void @_ZN4arsc18ResChunkPullParserC2EPvm(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %4, i64 noundef %6)
  %7 = call noundef i32 @_ZN4arsc18ResChunkPullParser4NextEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %8 = call noundef zeroext i1 @_ZN4arsc18ResChunkPullParser11IsGoodEventENS0_5EventE(i32 noundef %7)
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %46
  %.011 = phi ptr [ %.1, %46 ], [ null, %2 ]
  %9 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %10 = load i16, ptr %9, align 4, !tbaa !5
  switch i16 %10, label %36 [
    i16 1, label %11
    i16 512, label %27
  ]

11:                                               ; preds = %.lr.ph
  %12 = icmp eq ptr %.011, null
  br i1 %12, label %13, label %22

13:                                               ; preds = %11
  %14 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %15 = call noundef ptr @_ZN4arscL13convert_chunkIN7android20ResStringPool_headerELm28EEEPT_PNS1_15ResChunk_headerE(ptr noundef %14)
  %16 = icmp eq ptr %15, null
  br i1 %16, label %.loopexit.sink.split, label %17

17:                                               ; preds = %13
  %18 = load ptr, ptr %0, align 8, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %18, i64 32
  %20 = load ptr, ptr %19, align 8
  %21 = call noundef zeroext i1 %20(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %15)
  br i1 %21, label %46, label %.loopexit

22:                                               ; preds = %11
  %23 = load ptr, ptr @stderr, align 8, !tbaa !13
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str) #6
  %25 = load ptr, ptr @stderr, align 8, !tbaa !13
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.13) #6
  br label %.sink.split

27:                                               ; preds = %.lr.ph
  %28 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %29 = call noundef ptr @_ZN4arscL13convert_chunkIN7android16ResTable_packageELm284EEEPT_PNS1_15ResChunk_headerE(ptr noundef %28)
  %30 = call noundef zeroext i1 @_ZN4arsc20ResourceTableVisitor5validEPKN7android16ResTable_packageE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %29)
  br i1 %30, label %31, label %.loopexit.sink.split

31:                                               ; preds = %27
  %32 = load ptr, ptr %0, align 8, !tbaa !11
  %33 = getelementptr inbounds i8, ptr %32, i64 40
  %34 = load ptr, ptr %33, align 8
  %35 = call noundef zeroext i1 %34(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %29)
  br i1 %35, label %46, label %.loopexit

36:                                               ; preds = %.lr.ph
  %37 = load ptr, ptr @stderr, align 8, !tbaa !13
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str) #6
  %39 = load ptr, ptr @stderr, align 8, !tbaa !13
  %40 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %41 = load i16, ptr %40, align 4, !tbaa !5
  %42 = zext i16 %41 to i32
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.15, i32 noundef %42) #6
  br label %.sink.split

.sink.split:                                      ; preds = %36, %22
  %44 = load ptr, ptr @stderr, align 8, !tbaa !13
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.5) #6
  br label %46

46:                                               ; preds = %.sink.split, %31, %17
  %.1 = phi ptr [ %.011, %31 ], [ %15, %17 ], [ %.011, %.sink.split ]
  %47 = call noundef i32 @_ZN4arsc18ResChunkPullParser4NextEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %48 = call noundef zeroext i1 @_ZN4arsc18ResChunkPullParser11IsGoodEventENS0_5EventE(i32 noundef %47)
  br i1 %48, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %46, %2
  %49 = call noundef i32 @_ZN4arsc18ResChunkPullParser5eventEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %50 = icmp eq i32 %49, 2
  br i1 %50, label %.loopexit.sink.split, label %.loopexit

.loopexit.sink.split:                             ; preds = %27, %13, %._crit_edge
  %.str.16.sink = phi ptr [ @.str.16, %._crit_edge ], [ @.str.12, %13 ], [ @.str.14, %27 ]
  %51 = load ptr, ptr @stderr, align 8, !tbaa !13
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str) #6
  %53 = load ptr, ptr @stderr, align 8, !tbaa !13
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull %.str.16.sink) #6
  %55 = load ptr, ptr @stderr, align 8, !tbaa !13
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.5) #6
  br label %.loopexit

.loopexit:                                        ; preds = %31, %17, %.loopexit.sink.split, %._crit_edge
  %.09 = phi i1 [ true, %._crit_edge ], [ false, %.loopexit.sink.split ], [ false, %17 ], [ false, %31 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  ret i1 %.09
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN4arscL8get_dataEPN7android15ResChunk_headerE(ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4arsc18ResChunkPullParser11IsGoodEventENS0_5EventE(i32 noundef) local_unnamed_addr #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN4arscL13convert_chunkIN7android20ResStringPool_headerELm28EEEPT_PNS1_15ResChunk_headerE(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN4arscL13convert_chunkIN7android16ResTable_packageELm284EEEPT_PNS1_15ResChunk_headerE(ptr noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { nounwind }
attributes #6 = { 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, !7, i64 0}
!6 = !{!"_ZTSN7android15ResChunk_headerE", !7, i64 0, !7, i64 2, !10, i64 4}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !9, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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