; LLVM IR from facebook/redex :: libresource/TypeWrappers.ll (ZNK7android11TypeVariant8iteratordeEv)

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

%"union.android::ResTable_sparseTypeEntry" = type { i32 }
%"class.android::TypeVariant::iterator" = type <{ ptr, i32, [4 x i8] }>
%"struct.android::TypeVariant" = type { ptr, i64 }
%"struct.android::ResTable_type" = type { %"struct.android::ResChunk_header", i8, i8, i16, i32, i32, %"struct.android::ResTable_config" }
%"struct.android::ResChunk_header" = type { i16, i16, i32 }
%"struct.android::ResTable_config" = type { i32, %union.anon, %union.anon.0, %union.anon.2, %union.anon.4, %union.anon.6, %union.anon.8, %union.anon.10, %union.anon.12, [4 x i8], [8 x i8], %union.anon.14, i8, [8 x i8] }
%union.anon = type { i32 }
%union.anon.0 = type { i32 }
%union.anon.2 = type { i32 }
%union.anon.4 = type { i32 }
%union.anon.6 = type { i32 }
%union.anon.8 = type { i32 }
%union.anon.10 = type { i32 }
%union.anon.12 = type { i32 }
%union.anon.14 = type { i32 }
%struct.anon.16 = type { i16, i16 }
%"struct.android::ResTable_entry" = type { i16, i16, %"struct.android::ResStringPool_ref" }
%"struct.android::ResStringPool_ref" = type { i32 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [36 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; 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
define dso_local noundef ptr @_ZNK7android11TypeVariant8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(12) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"union.android::ResTable_sparseTypeEntry", align 4
  %12 = alloca %"union.android::ResTable_sparseTypeEntry", align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %15 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds %"struct.android::TypeVariant", ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  store ptr %18, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 1
  %20 = load i32, ptr %19, align 8, !tbaa !15
  %21 = zext i32 %20 to i64
  %22 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds %"struct.android::TypeVariant", ptr %23, i32 0, i32 1
  %25 = load i64, ptr %24, align 8, !tbaa !16
  %26 = icmp uge i64 %21, %25
  br i1 %26, label %27, label %28

27:                                               ; preds = %1
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %221

28:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %29 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds %"struct.android::TypeVariant", ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !12
  %33 = getelementptr inbounds %"struct.android::ResTable_type", ptr %32, i32 0, i32 4
  %34 = load i32, ptr %33, align 4, !tbaa !17
  store i32 %34, ptr %6, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = ptrtoint ptr %35 to i64
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.android::ResTable_type", ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 4, !tbaa !24
  %41 = zext i32 %40 to i64
  %42 = add i64 %36, %41
  store i64 %42, ptr %7, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = ptrtoint ptr %43 to i64
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.android::ResTable_type", ptr %45, i32 0, i32 0
  %47 = getelementptr inbounds %"struct.android::ResChunk_header", ptr %46, i32 0, i32 1
  %48 = load i16, ptr %47, align 2, !tbaa !26
  %49 = zext i16 %48 to i64
  %50 = add i64 %44, %49
  %51 = inttoptr i64 %50 to ptr
  store ptr %51, ptr %8, align 8, !tbaa !5
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = ptrtoint ptr %52 to i64
  %54 = load i32, ptr %6, align 4, !tbaa !23
  %55 = zext i32 %54 to i64
  %56 = mul i64 4, %55
  %57 = add i64 %53, %56
  %58 = load i64, ptr %7, align 8, !tbaa !25
  %59 = icmp ugt i64 %57, %58
  br i1 %59, label %60, label %70

60:                                               ; preds = %28
  br label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr @stderr, align 8, !tbaa !5
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef @.str) #5
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef @.str.1) #5
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef @.str.2) #5
  br label %68

68:                                               ; preds = %61
  br label %69

69:                                               ; preds = %68
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %220

70:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.android::ResTable_type", ptr %71, i32 0, i32 2
  %73 = load i8, ptr %72, align 1, !tbaa !27
  %74 = zext i8 %73 to i32
  %75 = and i32 %74, 1
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %113

77:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !23
  %81 = zext i32 %80 to i64
  %82 = getelementptr inbounds i32, ptr %79, i64 %81
  %83 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 1
  %84 = call noundef ptr @_ZSt11lower_boundIPKjjPFbjtEET_S4_S4_RKT0_T1_(ptr noundef %78, ptr noundef %82, ptr noundef nonnull align 4 dereferenceable(4) %83, ptr noundef @_ZN7androidL10keyCompareEjt)
  store ptr %84, ptr %10, align 8, !tbaa !5
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = load i32, ptr %6, align 4, !tbaa !23
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %86, i64 %88
  %90 = icmp eq ptr %85, %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  br i1 %90, label %100, label %91

91:                                               ; preds = %77
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = load i32, ptr %92, align 4, !tbaa !23
  store i32 %93, ptr %11, align 4, !tbaa !28
  %94 = getelementptr inbounds %struct.anon.16, ptr %11, i32 0, i32 0
  %95 = load i16, ptr %94, align 4, !tbaa !28
  %96 = zext i16 %95 to i32
  %97 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 1
  %98 = load i32, ptr %97, align 8, !tbaa !15
  %99 = icmp ne i32 %96, %98
  br label %100

100:                                              ; preds = %91, %77
  %101 = phi i1 [ true, %77 ], [ %99, %91 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br i1 %101, label %102, label %103

102:                                              ; preds = %100
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %110

103:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = load i32, ptr %104, align 4, !tbaa !23
  store i32 %105, ptr %12, align 4, !tbaa !28
  %106 = getelementptr inbounds %struct.anon.16, ptr %12, i32 0, i32 1
  %107 = load i16, ptr %106, align 2, !tbaa !28
  %108 = zext i16 %107 to i32
  %109 = mul i32 %108, 4
  store i32 %109, ptr %9, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  store i32 0, ptr %5, align 4
  br label %110

110:                                              ; preds = %103, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %111 = load i32, ptr %5, align 4
  switch i32 %111, label %219 [
    i32 0, label %112
  ]

112:                                              ; preds = %110
  br label %120

113:                                              ; preds = %70
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 1
  %116 = load i32, ptr %115, align 8, !tbaa !15
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %114, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !23
  store i32 %119, ptr %9, align 4, !tbaa !23
  br label %120

120:                                              ; preds = %113, %112
  %121 = load i32, ptr %9, align 4, !tbaa !23
  %122 = icmp eq i32 %121, -1
  br i1 %122, label %123, label %124

123:                                              ; preds = %120
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %219

124:                                              ; preds = %120
  %125 = load i32, ptr %9, align 4, !tbaa !23
  %126 = and i32 %125, 3
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %141

128:                                              ; preds = %124
  br label %129

129:                                              ; preds = %128
  %130 = load ptr, ptr @stderr, align 8, !tbaa !5
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef @.str) #5
  %132 = load ptr, ptr @stderr, align 8, !tbaa !5
  %133 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 1
  %134 = load i32, ptr %133, align 8, !tbaa !15
  %135 = load i32, ptr %9, align 4, !tbaa !23
  %136 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %132, ptr noundef @.str.3, i32 noundef %134, i32 noundef %135) #5
  %137 = load ptr, ptr @stderr, align 8, !tbaa !5
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %137, ptr noundef @.str.2) #5
  br label %139

139:                                              ; preds = %129
  br label %140

140:                                              ; preds = %139
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %219

141:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = ptrtoint ptr %142 to i64
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.android::ResTable_type", ptr %144, i32 0, i32 5
  %146 = load i32, ptr %145, align 4, !tbaa !29
  %147 = zext i32 %146 to i64
  %148 = add i64 %143, %147
  %149 = load i32, ptr %9, align 4, !tbaa !23
  %150 = zext i32 %149 to i64
  %151 = add i64 %148, %150
  %152 = inttoptr i64 %151 to ptr
  store ptr %152, ptr %13, align 8, !tbaa !5
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  %154 = ptrtoint ptr %153 to i64
  %155 = load i64, ptr %7, align 8, !tbaa !25
  %156 = sub i64 %155, 8
  %157 = icmp ugt i64 %154, %156
  br i1 %157, label %158, label %170

158:                                              ; preds = %141
  br label %159

159:                                              ; preds = %158
  %160 = load ptr, ptr @stderr, align 8, !tbaa !5
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %160, ptr noundef @.str) #5
  %162 = load ptr, ptr @stderr, align 8, !tbaa !5
  %163 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 1
  %164 = load i32, ptr %163, align 8, !tbaa !15
  %165 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %162, ptr noundef @.str.4, i32 noundef %164) #5
  %166 = load ptr, ptr @stderr, align 8, !tbaa !5
  %167 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %166, ptr noundef @.str.2) #5
  br label %168

168:                                              ; preds = %159
  br label %169

169:                                              ; preds = %168
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %218

170:                                              ; preds = %141
  %171 = load ptr, ptr %13, align 8, !tbaa !5
  %172 = ptrtoint ptr %171 to i64
  %173 = load ptr, ptr %13, align 8, !tbaa !5
  %174 = getelementptr inbounds %"struct.android::ResTable_entry", ptr %173, i32 0, i32 0
  %175 = load i16, ptr %174, align 4, !tbaa !30
  %176 = zext i16 %175 to i64
  %177 = add i64 %172, %176
  %178 = load i64, ptr %7, align 8, !tbaa !25
  %179 = icmp ugt i64 %177, %178
  br i1 %179, label %180, label %192

180:                                              ; preds = %170
  br label %181

181:                                              ; preds = %180
  %182 = load ptr, ptr @stderr, align 8, !tbaa !5
  %183 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %182, ptr noundef @.str) #5
  %184 = load ptr, ptr @stderr, align 8, !tbaa !5
  %185 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 1
  %186 = load i32, ptr %185, align 8, !tbaa !15
  %187 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %184, ptr noundef @.str.5, i32 noundef %186) #5
  %188 = load ptr, ptr @stderr, align 8, !tbaa !5
  %189 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %188, ptr noundef @.str.2) #5
  br label %190

190:                                              ; preds = %181
  br label %191

191:                                              ; preds = %190
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %218

192:                                              ; preds = %170
  %193 = load ptr, ptr %13, align 8, !tbaa !5
  %194 = getelementptr inbounds %"struct.android::ResTable_entry", ptr %193, i32 0, i32 0
  %195 = load i16, ptr %194, align 4, !tbaa !30
  %196 = zext i16 %195 to i64
  %197 = icmp ult i64 %196, 8
  br i1 %197, label %198, label %214

198:                                              ; preds = %192
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr @stderr, align 8, !tbaa !5
  %201 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %200, ptr noundef @.str) #5
  %202 = load ptr, ptr @stderr, align 8, !tbaa !5
  %203 = getelementptr inbounds %"class.android::TypeVariant::iterator", ptr %14, i32 0, i32 1
  %204 = load i32, ptr %203, align 8, !tbaa !15
  %205 = load ptr, ptr %13, align 8, !tbaa !5
  %206 = getelementptr inbounds %"struct.android::ResTable_entry", ptr %205, i32 0, i32 0
  %207 = load i16, ptr %206, align 4, !tbaa !30
  %208 = zext i16 %207 to i32
  %209 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %202, ptr noundef @.str.6, i32 noundef %204, i32 noundef %208) #5
  %210 = load ptr, ptr @stderr, align 8, !tbaa !5
  %211 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %210, ptr noundef @.str.2) #5
  br label %212

212:                                              ; preds = %199
  br label %213

213:                                              ; preds = %212
  store ptr null, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %218

214:                                              ; preds = %192
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215
  %217 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %217, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %218

218:                                              ; preds = %216, %213, %191, %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %219

219:                                              ; preds = %218, %140, %123, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %220

220:                                              ; preds = %219, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %221

221:                                              ; preds = %220, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %222 = load ptr, ptr %2, align 8
  ret ptr %222
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIPKjjPFbjtEET_S4_S4_RKT0_T1_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN7androidL10keyCompareEjt(i32 noundef, i16 noundef zeroext) #4

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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !6, i64 0}
!10 = !{!"_ZTSN7android11TypeVariant8iteratorE", !6, i64 0, !11, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTSN7android11TypeVariantE", !6, i64 0, !14, i64 8}
!14 = !{!"long", !7, i64 0}
!15 = !{!10, !11, i64 8}
!16 = !{!13, !14, i64 8}
!17 = !{!18, !11, i64 12}
!18 = !{!"_ZTSN7android13ResTable_typeE", !19, i64 0, !7, i64 8, !7, i64 9, !20, i64 10, !11, i64 12, !11, i64 16, !21, i64 20}
!19 = !{!"_ZTSN7android15ResChunk_headerE", !20, i64 0, !20, i64 2, !11, i64 4}
!20 = !{!"short", !7, i64 0}
!21 = !{!"_ZTSN7android15ResTable_configE", !11, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 48, !22, i64 52, !7, i64 53}
!22 = !{!"bool", !7, i64 0}
!23 = !{!11, !11, i64 0}
!24 = !{!18, !11, i64 4}
!25 = !{!14, !14, i64 0}
!26 = !{!18, !20, i64 2}
!27 = !{!18, !7, i64 9}
!28 = !{!7, !7, i64 0}
!29 = !{!18, !11, i64 16}
!30 = !{!31, !20, i64 0}
!31 = !{!"_ZTSN7android14ResTable_entryE", !20, i64 0, !20, i64 2, !32, i64 4}
!32 = !{!"_ZTSN7android17ResStringPool_refE", !11, i64 0}


; 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 [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [36 x i8], align 1

; 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 ptr @_ZNK7android11TypeVariant8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(12) %0) local_unnamed_addr #1 align 2 {
  %2 = load ptr, ptr %0, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !11
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load i32, ptr %4, align 8, !tbaa !14
  %6 = zext i32 %5 to i64
  %7 = getelementptr inbounds i8, ptr %2, i64 8
  %8 = load i64, ptr %7, align 8, !tbaa !15
  %.not = icmp ugt i64 %8, %6
  br i1 %.not, label %9, label %.critedge.thread

9:                                                ; preds = %1
  %10 = getelementptr inbounds i8, ptr %3, i64 12
  %11 = load i32, ptr %10, align 4, !tbaa !16
  %12 = ptrtoint ptr %3 to i64
  %13 = getelementptr inbounds i8, ptr %3, i64 4
  %14 = load i32, ptr %13, align 4, !tbaa !22
  %15 = zext i32 %14 to i64
  %16 = add i64 %15, %12
  %17 = getelementptr inbounds i8, ptr %3, i64 2
  %18 = load i16, ptr %17, align 2, !tbaa !23
  %19 = zext i16 %18 to i64
  %20 = add i64 %19, %12
  %21 = inttoptr i64 %20 to ptr
  %22 = zext i32 %11 to i64
  %23 = shl nuw nsw i64 %22, 2
  %24 = add i64 %20, %23
  %25 = icmp ugt i64 %24, %16
  br i1 %25, label %26, label %31

26:                                               ; preds = %9
  %27 = load ptr, ptr @stderr, align 8, !tbaa !24
  %28 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str) #4
  %29 = load ptr, ptr @stderr, align 8, !tbaa !24
  %30 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.1) #4
  br label %.critedge.thread.sink.split

31:                                               ; preds = %9
  %32 = getelementptr inbounds i8, ptr %3, i64 9
  %33 = load i8, ptr %32, align 1, !tbaa !25
  %34 = and i8 %33, 1
  %.not40 = icmp eq i8 %34, 0
  br i1 %.not40, label %45, label %35

35:                                               ; preds = %31
  %36 = getelementptr inbounds i32, ptr %21, i64 %22
  %37 = tail call noundef ptr @_ZSt11lower_boundIPKjjPFbjtEET_S4_S4_RKT0_T1_(ptr noundef %21, ptr noundef %36, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull @_ZN7androidL10keyCompareEjt)
  %38 = icmp eq ptr %37, %36
  br i1 %38, label %.critedge.thread, label %39

39:                                               ; preds = %35
  %40 = load i32, ptr %37, align 4, !tbaa !26
  %41 = and i32 %40, 65535
  %42 = load i32, ptr %4, align 8, !tbaa !14
  %.not41 = icmp eq i32 %41, %42
  br i1 %.not41, label %.thread, label %.critedge.thread

.thread:                                          ; preds = %39
  %43 = lshr i32 %40, 14
  %44 = and i32 %43, 262140
  br label %49

45:                                               ; preds = %31
  %46 = getelementptr inbounds i32, ptr %21, i64 %6
  %47 = load i32, ptr %46, align 4, !tbaa !26
  %48 = icmp eq i32 %47, -1
  br i1 %48, label %.critedge.thread, label %49

49:                                               ; preds = %.thread, %45
  %.13646 = phi i32 [ %44, %.thread ], [ %47, %45 ]
  %50 = and i32 %.13646, 3
  %.not42 = icmp eq i32 %50, 0
  br i1 %.not42, label %57, label %51

51:                                               ; preds = %49
  %52 = load ptr, ptr @stderr, align 8, !tbaa !24
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str) #4
  %54 = load ptr, ptr @stderr, align 8, !tbaa !24
  %55 = load i32, ptr %4, align 8, !tbaa !14
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.3, i32 noundef %55, i32 noundef %.13646) #4
  br label %.critedge.thread.sink.split

57:                                               ; preds = %49
  %58 = getelementptr inbounds i8, ptr %3, i64 16
  %59 = load i32, ptr %58, align 4, !tbaa !27
  %60 = zext i32 %59 to i64
  %61 = zext i32 %.13646 to i64
  %62 = add i64 %61, %12
  %63 = add i64 %62, %60
  %64 = inttoptr i64 %63 to ptr
  %65 = add i64 %16, -8
  %66 = icmp ugt i64 %63, %65
  br i1 %66, label %67, label %73

67:                                               ; preds = %57
  %68 = load ptr, ptr @stderr, align 8, !tbaa !24
  %69 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str) #4
  %70 = load ptr, ptr @stderr, align 8, !tbaa !24
  %71 = load i32, ptr %4, align 8, !tbaa !14
  %72 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str.4, i32 noundef %71) #4
  br label %.critedge.thread.sink.split

73:                                               ; preds = %57
  %74 = load i16, ptr %64, align 4, !tbaa !28
  %75 = zext i16 %74 to i64
  %76 = add i64 %63, %75
  %77 = icmp ugt i64 %76, %16
  br i1 %77, label %78, label %84

78:                                               ; preds = %73
  %79 = load ptr, ptr @stderr, align 8, !tbaa !24
  %80 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef nonnull @.str) #4
  %81 = load ptr, ptr @stderr, align 8, !tbaa !24
  %82 = load i32, ptr %4, align 8, !tbaa !14
  %83 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef nonnull @.str.5, i32 noundef %82) #4
  br label %.critedge.thread.sink.split

84:                                               ; preds = %73
  %85 = icmp ult i16 %74, 8
  br i1 %85, label %86, label %.critedge.thread

86:                                               ; preds = %84
  %87 = load ptr, ptr @stderr, align 8, !tbaa !24
  %88 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef nonnull @.str) #4
  %89 = load ptr, ptr @stderr, align 8, !tbaa !24
  %90 = load i32, ptr %4, align 8, !tbaa !14
  %91 = load i16, ptr %64, align 4, !tbaa !28
  %92 = zext i16 %91 to i32
  %93 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.6, i32 noundef %90, i32 noundef %92) #4
  br label %.critedge.thread.sink.split

.critedge.thread.sink.split:                      ; preds = %51, %86, %78, %67, %26
  %94 = load ptr, ptr @stderr, align 8, !tbaa !24
  %95 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef nonnull @.str.2) #4
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %.critedge.thread.sink.split, %39, %35, %84, %45, %1
  %.4 = phi ptr [ null, %1 ], [ null, %45 ], [ %64, %84 ], [ null, %35 ], [ null, %39 ], [ null, %.critedge.thread.sink.split ]
  ret ptr %.4
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIPKjjPFbjtEET_S4_S4_RKT0_T1_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN7androidL10keyCompareEjt(i32 noundef, i16 noundef zeroext) #3

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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 = !{!"_ZTSN7android11TypeVariant8iteratorE", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"_ZTSN7android11TypeVariantE", !7, i64 0, !13, i64 8}
!13 = !{!"long", !8, i64 0}
!14 = !{!6, !10, i64 8}
!15 = !{!12, !13, i64 8}
!16 = !{!17, !10, i64 12}
!17 = !{!"_ZTSN7android13ResTable_typeE", !18, i64 0, !8, i64 8, !8, i64 9, !19, i64 10, !10, i64 12, !10, i64 16, !20, i64 20}
!18 = !{!"_ZTSN7android15ResChunk_headerE", !19, i64 0, !19, i64 2, !10, i64 4}
!19 = !{!"short", !8, i64 0}
!20 = !{!"_ZTSN7android15ResTable_configE", !10, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28, !8, i64 32, !8, i64 36, !8, i64 40, !8, i64 48, !21, i64 52, !8, i64 53}
!21 = !{!"bool", !8, i64 0}
!22 = !{!17, !10, i64 4}
!23 = !{!17, !19, i64 2}
!24 = !{!7, !7, i64 0}
!25 = !{!17, !8, i64 9}
!26 = !{!10, !10, i64 0}
!27 = !{!17, !10, i64 16}
!28 = !{!29, !19, i64 0}
!29 = !{!"_ZTSN7android14ResTable_entryE", !19, i64 0, !19, i64 2, !30, i64 4}
!30 = !{!"_ZTSN7android17ResStringPool_refE", !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass