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

; 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 }
%"class.arsc::VisitorBase" = type { ptr, ptr, i64 }
%"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.15 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [17 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: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN4arscL8get_dataEPN7android15ResChunk_headerE(ptr noundef) #2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4arsc14XmlFileVisitor5visitEPvm(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, i64 noundef %2) unnamed_addr #4 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"class.arsc::ResChunkPullParser", align 8
  %16 = alloca i16, align 2
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  %17 = load ptr, ptr %5, align 8
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.arsc::VisitorBase", ptr %17, i32 0, i32 1
  store ptr %18, ptr %19, align 8, !tbaa !11
  %20 = load i64, ptr %7, align 8, !tbaa !9
  %21 = getelementptr inbounds %"class.arsc::VisitorBase", ptr %17, i32 0, i32 2
  store i64 %20, ptr %21, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call noundef ptr @_ZN4arscL13convert_chunkIN7android15ResChunk_headerELm8EEEPT_PS2_(ptr noundef %22)
  store ptr %23, ptr %8, align 8, !tbaa !5
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %36, label %26

26:                                               ; preds = %3
  br label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str) #5
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str.25) #5
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.5) #5
  br label %34

34:                                               ; preds = %27
  br label %35

35:                                               ; preds = %34
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %215

36:                                               ; preds = %3
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %37, i32 0, i32 0
  %39 = load i16, ptr %38, align 4, !tbaa !14
  %40 = zext i16 %39 to i32
  %41 = icmp ne i32 %40, 3
  br i1 %41, label %42, label %52

42:                                               ; preds = %36
  br label %43

43:                                               ; preds = %42
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str) #5
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef @.str.26) #5
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str.5) #5
  br label %50

50:                                               ; preds = %43
  br label %51

51:                                               ; preds = %50
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %215

52:                                               ; preds = %36
  %53 = load i64, ptr %7, align 8, !tbaa !9
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %54, i32 0, i32 2
  %56 = load i32, ptr %55, align 4, !tbaa !18
  %57 = zext i32 %56 to i64
  %58 = icmp ne i64 %53, %57
  br i1 %58, label %59, label %72

59:                                               ; preds = %52
  br label %60

60:                                               ; preds = %59
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str) #5
  %63 = load ptr, ptr @stderr, align 8, !tbaa !5
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %64, i32 0, i32 2
  %66 = load i32, ptr %65, align 4, !tbaa !18
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.27, i32 noundef %66) #5
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str.5) #5
  br label %70

70:                                               ; preds = %60
  br label %71

71:                                               ; preds = %70
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %215

72:                                               ; preds = %52
  %73 = load i64, ptr %7, align 8, !tbaa !9
  %74 = icmp ule i64 %73, 8
  br i1 %74, label %75, label %79

75:                                               ; preds = %72
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %215

79:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = call noundef ptr @_ZN4arscL8get_dataEPN7android15ResChunk_headerE(ptr noundef %80)
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = call noundef i32 @_ZN4arscL12get_data_lenEPN7android15ResChunk_headerE(ptr noundef %82)
  %84 = zext i32 %83 to i64
  call void @_ZN4arsc18ResChunkPullParserC2EPvm(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef %81, i64 noundef %84)
  br label %85

85:                                               ; preds = %199, %79
  %86 = call noundef i32 @_ZN4arsc18ResChunkPullParser4NextEv(ptr noundef nonnull align 8 dereferenceable(32) %15)
  %87 = call noundef zeroext i1 @_ZN4arsc18ResChunkPullParser11IsGoodEventENS0_5EventE(i32 noundef %86)
  br i1 %87, label %88, label %200

88:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #5
  %89 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %15)
  %90 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %89, i32 0, i32 0
  %91 = load i16, ptr %90, align 4, !tbaa !14
  store i16 %91, ptr %16, align 2, !tbaa !19
  %92 = load i16, ptr %16, align 2, !tbaa !19
  %93 = zext i16 %92 to i32
  switch i32 %93, label %165 [
    i32 1, label %94
    i32 384, label %131
  ]

94:                                               ; preds = %88
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = icmp eq ptr %95, null
  br i1 %96, label %97, label %120

97:                                               ; preds = %94
  %98 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %15)
  %99 = call noundef ptr @_ZN4arscL13convert_chunkIN7android20ResStringPool_headerELm28EEEPT_PNS1_15ResChunk_headerE(ptr noundef %98)
  store ptr %99, ptr %10, align 8, !tbaa !5
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = icmp eq ptr %100, null
  br i1 %101, label %102, label %112

102:                                              ; preds = %97
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str) #5
  %106 = load ptr, ptr @stderr, align 8, !tbaa !5
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.12) #5
  %108 = load ptr, ptr @stderr, align 8, !tbaa !5
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef @.str.5) #5
  br label %110

110:                                              ; preds = %103
  br label %111

111:                                              ; preds = %110
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %197

112:                                              ; preds = %97
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = load ptr, ptr %17, align 8, !tbaa !20
  %115 = getelementptr inbounds ptr, ptr %114, i64 3
  %116 = load ptr, ptr %115, align 8
  %117 = call noundef zeroext i1 %116(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef %113)
  br i1 %117, label %119, label %118

118:                                              ; preds = %112
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %197

119:                                              ; preds = %112
  br label %130

120:                                              ; preds = %94
  br label %121

121:                                              ; preds = %120
  %122 = load ptr, ptr @stderr, align 8, !tbaa !5
  %123 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef @.str) #5
  %124 = load ptr, ptr @stderr, align 8, !tbaa !5
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef @.str.13) #5
  %126 = load ptr, ptr @stderr, align 8, !tbaa !5
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef @.str.5) #5
  br label %128

128:                                              ; preds = %121
  br label %129

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129, %119
  br label %196

131:                                              ; preds = %88
  %132 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %15)
  %133 = call noundef ptr @_ZN4arscL13convert_chunkIN7android15ResChunk_headerELm8EEEPT_PS2_(ptr noundef %132)
  store ptr %133, ptr %11, align 8, !tbaa !5
  %134 = load ptr, ptr %11, align 8, !tbaa !5
  %135 = icmp eq ptr %134, null
  br i1 %135, label %136, label %137

136:                                              ; preds = %131
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %197

137:                                              ; preds = %131
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %138, i32 0, i32 2
  %140 = load i32, ptr %139, align 4, !tbaa !18
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %141, i32 0, i32 1
  %143 = load i16, ptr %142, align 2, !tbaa !22
  %144 = zext i16 %143 to i32
  %145 = sub i32 %140, %144
  %146 = zext i32 %145 to i64
  %147 = udiv i64 %146, 4
  store i64 %147, ptr %13, align 8, !tbaa !9
  %148 = load i64, ptr %13, align 8, !tbaa !9
  %149 = icmp ugt i64 %148, 0
  br i1 %149, label %150, label %153

150:                                              ; preds = %137
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = call noundef ptr @_ZN4arscL8get_dataEPN7android15ResChunk_headerE(ptr noundef %151)
  br label %154

153:                                              ; preds = %137
  br label %154

154:                                              ; preds = %153, %150
  %155 = phi ptr [ %152, %150 ], [ null, %153 ]
  store ptr %155, ptr %12, align 8, !tbaa !5
  %156 = load ptr, ptr %11, align 8, !tbaa !5
  %157 = load ptr, ptr %12, align 8, !tbaa !5
  %158 = load i64, ptr %13, align 8, !tbaa !9
  %159 = load ptr, ptr %17, align 8, !tbaa !20
  %160 = getelementptr inbounds ptr, ptr %159, i64 4
  %161 = load ptr, ptr %160, align 8
  %162 = call noundef zeroext i1 %161(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef %156, ptr noundef %157, i64 noundef %158)
  br i1 %162, label %164, label %163

163:                                              ; preds = %154
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %197

164:                                              ; preds = %154
  br label %196

165:                                              ; preds = %88
  %166 = load i16, ptr %16, align 2, !tbaa !19
  %167 = zext i16 %166 to i32
  %168 = icmp sge i32 %167, 256
  br i1 %168, label %169, label %183

169:                                              ; preds = %165
  %170 = load i16, ptr %16, align 2, !tbaa !19
  %171 = zext i16 %170 to i32
  %172 = icmp sle i32 %171, 383
  br i1 %172, label %173, label %183

173:                                              ; preds = %169
  %174 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %15)
  %175 = call noundef ptr @_ZN4arscL13convert_chunkIN7android15ResXMLTree_nodeELm16EEEPT_PNS1_15ResChunk_headerE(ptr noundef %174)
  store ptr %175, ptr %14, align 8, !tbaa !5
  %176 = load ptr, ptr %14, align 8, !tbaa !5
  %177 = load ptr, ptr %17, align 8, !tbaa !20
  %178 = getelementptr inbounds ptr, ptr %177, i64 5
  %179 = load ptr, ptr %178, align 8
  %180 = call noundef zeroext i1 %179(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef %176)
  br i1 %180, label %182, label %181

181:                                              ; preds = %173
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %197

182:                                              ; preds = %173
  br label %195

183:                                              ; preds = %169, %165
  br label %184

184:                                              ; preds = %183
  %185 = load ptr, ptr @stderr, align 8, !tbaa !5
  %186 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %185, ptr noundef @.str) #5
  %187 = load ptr, ptr @stderr, align 8, !tbaa !5
  %188 = load i16, ptr %16, align 2, !tbaa !19
  %189 = zext i16 %188 to i32
  %190 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %187, ptr noundef @.str.15, i32 noundef %189) #5
  %191 = load ptr, ptr @stderr, align 8, !tbaa !5
  %192 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %191, ptr noundef @.str.5) #5
  br label %193

193:                                              ; preds = %184
  br label %194

194:                                              ; preds = %193
  br label %195

195:                                              ; preds = %194, %182
  br label %196

196:                                              ; preds = %195, %164, %130
  store i32 0, ptr %9, align 4
  br label %197

197:                                              ; preds = %196, %181, %163, %136, %118, %111
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #5
  %198 = load i32, ptr %9, align 4
  switch i32 %198, label %214 [
    i32 0, label %199
  ]

199:                                              ; preds = %197
  br label %85, !llvm.loop !23

200:                                              ; preds = %85
  %201 = call noundef i32 @_ZN4arsc18ResChunkPullParser5eventEv(ptr noundef nonnull align 8 dereferenceable(32) %15)
  %202 = icmp eq i32 %201, 2
  br i1 %202, label %203, label %213

203:                                              ; preds = %200
  br label %204

204:                                              ; preds = %203
  %205 = load ptr, ptr @stderr, align 8, !tbaa !5
  %206 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %205, ptr noundef @.str) #5
  %207 = load ptr, ptr @stderr, align 8, !tbaa !5
  %208 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %207, ptr noundef @.str.28) #5
  %209 = load ptr, ptr @stderr, align 8, !tbaa !5
  %210 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %209, ptr noundef @.str.5) #5
  br label %211

211:                                              ; preds = %204
  br label %212

212:                                              ; preds = %211
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %214

213:                                              ; preds = %200
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %214

214:                                              ; preds = %213, %212, %197
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %215

215:                                              ; preds = %214, %78, %71, %51, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %216 = load i1, ptr %4, align 1
  ret i1 %216
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN4arscL13convert_chunkIN7android15ResXMLTree_nodeELm16EEEPT_PNS1_15ResChunk_headerE(ptr noundef) #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 = { 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 #3 = { 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 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTSN4arsc11VisitorBaseE", !6, i64 8, !10, i64 16}
!13 = !{!12, !10, i64 16}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTSN7android15ResChunk_headerE", !16, i64 0, !16, i64 2, !17, i64 4}
!16 = !{!"short", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!15, !17, i64 4}
!19 = !{!16, !16, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !8, i64 0}
!22 = !{!15, !16, i64 2}
!23 = distinct !{!23, !24}
!24 = !{!"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.15 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [17 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4arsc14XmlFileVisitor5visitEPvm(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, i64 noundef %2) unnamed_addr #4 align 2 {
  %4 = alloca %"class.arsc::ResChunkPullParser", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %2, ptr %6, align 8, !tbaa !11
  %7 = tail call noundef ptr @_ZN4arscL13convert_chunkIN7android15ResChunk_headerELm8EEEPT_PS2_(ptr noundef %1)
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %15

8:                                                ; preds = %3
  %9 = load ptr, ptr @stderr, align 8, !tbaa !12
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str) #5
  %11 = load ptr, ptr @stderr, align 8, !tbaa !12
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.25) #5
  %13 = load ptr, ptr @stderr, align 8, !tbaa !12
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.5) #5
  br label %111

15:                                               ; preds = %3
  %16 = load i16, ptr %7, align 4, !tbaa !13
  %.not40 = icmp eq i16 %16, 3
  br i1 %.not40, label %24, label %17

17:                                               ; preds = %15
  %18 = load ptr, ptr @stderr, align 8, !tbaa !12
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str) #5
  %20 = load ptr, ptr @stderr, align 8, !tbaa !12
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.26) #5
  %22 = load ptr, ptr @stderr, align 8, !tbaa !12
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.5) #5
  br label %111

24:                                               ; preds = %15
  %25 = getelementptr inbounds i8, ptr %7, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !17
  %27 = zext i32 %26 to i64
  %.not41 = icmp eq i64 %27, %2
  br i1 %.not41, label %36, label %28

28:                                               ; preds = %24
  %29 = load ptr, ptr @stderr, align 8, !tbaa !12
  %30 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str) #5
  %31 = load ptr, ptr @stderr, align 8, !tbaa !12
  %32 = load i32, ptr %25, align 4, !tbaa !17
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.27, i32 noundef %32) #5
  %34 = load ptr, ptr @stderr, align 8, !tbaa !12
  %35 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.5) #5
  br label %111

36:                                               ; preds = %24
  %37 = icmp ult i64 %2, 9
  br i1 %37, label %111, label %38

38:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  %39 = tail call noundef ptr @_ZN4arscL8get_dataEPN7android15ResChunk_headerE(ptr noundef nonnull %7)
  %40 = tail call noundef i32 @_ZN4arscL12get_data_lenEPN7android15ResChunk_headerE(ptr noundef nonnull %7)
  %41 = zext i32 %40 to i64
  call void @_ZN4arsc18ResChunkPullParserC2EPvm(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef %39, i64 noundef %41)
  %42 = call noundef i32 @_ZN4arsc18ResChunkPullParser4NextEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %43 = call noundef zeroext i1 @_ZN4arsc18ResChunkPullParser11IsGoodEventENS0_5EventE(i32 noundef %42)
  br i1 %43, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %38, %100
  %.03245 = phi ptr [ %.133, %100 ], [ null, %38 ]
  %44 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %45 = load i16, ptr %44, align 4, !tbaa !13
  %46 = zext i16 %45 to i32
  switch i16 %45, label %84 [
    i16 1, label %47
    i16 384, label %63
  ]

47:                                               ; preds = %.lr.ph
  %48 = icmp eq ptr %.03245, null
  br i1 %48, label %49, label %58

49:                                               ; preds = %47
  %50 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %51 = call noundef ptr @_ZN4arscL13convert_chunkIN7android20ResStringPool_headerELm28EEEPT_PNS1_15ResChunk_headerE(ptr noundef %50)
  %52 = icmp eq ptr %51, null
  br i1 %52, label %.thread.sink.split, label %53

53:                                               ; preds = %49
  %54 = load ptr, ptr %0, align 8, !tbaa !18
  %55 = getelementptr inbounds i8, ptr %54, i64 24
  %56 = load ptr, ptr %55, align 8
  %57 = call noundef zeroext i1 %56(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %51)
  br i1 %57, label %100, label %.thread

58:                                               ; preds = %47
  %59 = load ptr, ptr @stderr, align 8, !tbaa !12
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef nonnull @.str) #5
  %61 = load ptr, ptr @stderr, align 8, !tbaa !12
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.13) #5
  br label %.sink.split

63:                                               ; preds = %.lr.ph
  %64 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %65 = call noundef ptr @_ZN4arscL13convert_chunkIN7android15ResChunk_headerELm8EEEPT_PS2_(ptr noundef %64)
  %66 = icmp eq ptr %65, null
  br i1 %66, label %.thread, label %67

67:                                               ; preds = %63
  %68 = getelementptr inbounds i8, ptr %65, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !17
  %70 = getelementptr inbounds i8, ptr %65, i64 2
  %71 = load i16, ptr %70, align 2, !tbaa !20
  %72 = zext i16 %71 to i32
  %73 = sub i32 %69, %72
  %74 = lshr i32 %73, 2
  %75 = zext nneg i32 %74 to i64
  %.not42 = icmp ult i32 %73, 4
  br i1 %.not42, label %78, label %76

76:                                               ; preds = %67
  %77 = call noundef ptr @_ZN4arscL8get_dataEPN7android15ResChunk_headerE(ptr noundef nonnull %65)
  br label %78

78:                                               ; preds = %67, %76
  %79 = phi ptr [ %77, %76 ], [ null, %67 ]
  %80 = load ptr, ptr %0, align 8, !tbaa !18
  %81 = getelementptr inbounds i8, ptr %80, i64 32
  %82 = load ptr, ptr %81, align 8
  %83 = call noundef zeroext i1 %82(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull %65, ptr noundef %79, i64 noundef %75)
  br i1 %83, label %100, label %.thread

84:                                               ; preds = %.lr.ph
  %85 = and i16 %45, -128
  %or.cond = icmp eq i16 %85, 256
  br i1 %or.cond, label %86, label %93

86:                                               ; preds = %84
  %87 = call noundef ptr @_ZN4arsc18ResChunkPullParser5chunkEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %88 = call noundef ptr @_ZN4arscL13convert_chunkIN7android15ResXMLTree_nodeELm16EEEPT_PNS1_15ResChunk_headerE(ptr noundef %87)
  %89 = load ptr, ptr %0, align 8, !tbaa !18
  %90 = getelementptr inbounds i8, ptr %89, i64 40
  %91 = load ptr, ptr %90, align 8
  %92 = call noundef zeroext i1 %91(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %88)
  br i1 %92, label %100, label %.thread

93:                                               ; preds = %84
  %94 = load ptr, ptr @stderr, align 8, !tbaa !12
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef nonnull @.str) #5
  %96 = load ptr, ptr @stderr, align 8, !tbaa !12
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef nonnull @.str.15, i32 noundef %46) #5
  br label %.sink.split

.sink.split:                                      ; preds = %93, %58
  %98 = load ptr, ptr @stderr, align 8, !tbaa !12
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.5) #5
  br label %100

100:                                              ; preds = %.sink.split, %53, %78, %86
  %.133 = phi ptr [ %.03245, %86 ], [ %.03245, %78 ], [ %51, %53 ], [ %.03245, %.sink.split ]
  %101 = call noundef i32 @_ZN4arsc18ResChunkPullParser4NextEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %102 = call noundef zeroext i1 @_ZN4arsc18ResChunkPullParser11IsGoodEventENS0_5EventE(i32 noundef %101)
  br i1 %102, label %.lr.ph, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %100, %38
  %103 = call noundef i32 @_ZN4arsc18ResChunkPullParser5eventEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %104 = icmp eq i32 %103, 2
  br i1 %104, label %.thread.sink.split, label %.thread

.thread.sink.split:                               ; preds = %49, %._crit_edge
  %.str.12.sink = phi ptr [ @.str.28, %._crit_edge ], [ @.str.12, %49 ]
  %105 = load ptr, ptr @stderr, align 8, !tbaa !12
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef nonnull @.str) #5
  %107 = load ptr, ptr @stderr, align 8, !tbaa !12
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef nonnull %.str.12.sink) #5
  %109 = load ptr, ptr @stderr, align 8, !tbaa !12
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef nonnull @.str.5) #5
  br label %.thread

.thread:                                          ; preds = %86, %78, %63, %53, %.thread.sink.split, %._crit_edge
  %.2 = phi i1 [ true, %._crit_edge ], [ false, %.thread.sink.split ], [ false, %53 ], [ false, %63 ], [ false, %78 ], [ false, %86 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  br label %111

111:                                              ; preds = %36, %.thread, %28, %17, %8
  %.3 = phi i1 [ false, %17 ], [ false, %28 ], [ %.2, %.thread ], [ false, %8 ], [ true, %36 ]
  ret i1 %.3
}

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

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

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


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