; LLVM IR from facebook/redex :: tools/dexgrep (DexGrep)

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

%struct.option = type { ptr, i32, ptr, i32 }
%"class.std::__cxx11::basic_regex" = type { i32, %"class.std::locale", %"class.std::shared_ptr" }
%"class.std::locale" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%struct.ddump_data = type { i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.dex_header = type { [8 x i8], i32, [20 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.dex_class_def = type { i32, i32, i32, i32, i32, i32, i32, i32 }

@stderr = external global ptr, align 8
@_ZZ4mainE7options = external hidden constant [1 x %struct.option], align 16
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@optind = external global i32, align 4
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11print_usagev() #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::__cxx11::basic_regex", align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %struct.ddump_data, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #7
  store i8 0, ptr %6, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  br label %20

20:                                               ; preds = %33, %2
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = call i32 @getopt_long(i32 noundef %21, ptr noundef %22, ptr noundef @.str.2, ptr noundef @_ZZ4mainE7options, ptr noundef null) #7
  %24 = trunc i32 %23 to i8
  store i8 %24, ptr %7, align 1, !tbaa !13
  %25 = sext i8 %24 to i32
  %26 = icmp ne i32 %25, -1
  br i1 %26, label %27, label %34

27:                                               ; preds = %20
  %28 = load i8, ptr %7, align 1, !tbaa !13
  %29 = sext i8 %28 to i32
  switch i32 %29, label %32 [
    i32 108, label %30
    i32 104, label %31
  ]

30:                                               ; preds = %27
  store i8 1, ptr %6, align 1, !tbaa !11
  br label %33

31:                                               ; preds = %27
  call void @_Z11print_usagev()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %121

32:                                               ; preds = %27
  call void @_Z11print_usagev()
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %121

33:                                               ; preds = %30
  br label %20, !llvm.loop !14

34:                                               ; preds = %20
  %35 = load i32, ptr @optind, align 4, !tbaa !5
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = icmp eq i32 %35, %36
  br i1 %37, label %38, label %44

38:                                               ; preds = %34
  %39 = load ptr, ptr @stderr, align 8, !tbaa !9
  %40 = load ptr, ptr %5, align 8, !tbaa !9
  %41 = getelementptr inbounds ptr, ptr %40, i64 0
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.3, ptr noundef %42) #7
  call void @_Z11print_usagev()
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %121

44:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = load i32, ptr @optind, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds ptr, ptr %45, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  store ptr %49, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #7
  %50 = load ptr, ptr %9, align 8, !tbaa !9
  call void @_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEEC2EPKcNSt15regex_constants18syntax_option_typeE(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef %50, i32 noundef 16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %51 = load i32, ptr @optind, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %11, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %116, %44
  %54 = load i32, ptr %11, align 4, !tbaa !5
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %120

58:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %59 = load ptr, ptr %5, align 8, !tbaa !9
  %60 = load i32, ptr %11, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds ptr, ptr %59, i64 %61
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  store ptr %63, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 104, ptr %13) #7
  %64 = load ptr, ptr %12, align 8, !tbaa !9
  invoke void @_Z13open_dex_filePKcP10ddump_data(ptr noundef %64, ptr noundef %13)
          to label %65 unwind label %75

65:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %66 = getelementptr inbounds %struct.ddump_data, ptr %13, i32 0, i32 4
  %67 = load ptr, ptr %66, align 8, !tbaa !16
  %68 = getelementptr inbounds %struct.dex_header, ptr %67, i32 0, i32 19
  %69 = load i32, ptr %68, align 1, !tbaa !19
  store i32 %69, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %112, %65
  %71 = load i32, ptr %17, align 4, !tbaa !5
  %72 = load i32, ptr %16, align 4, !tbaa !5
  %73 = icmp ult i32 %71, %72
  br i1 %73, label %79, label %74

74:                                               ; preds = %70
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %115

75:                                               ; preds = %58
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %14, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %15, align 4
  br label %119

79:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %80 = getelementptr inbounds %struct.ddump_data, ptr %13, i32 0, i32 8
  %81 = load ptr, ptr %80, align 8, !tbaa !21
  %82 = load i32, ptr %17, align 4, !tbaa !5
  %83 = zext i32 %82 to i64
  %84 = getelementptr inbounds %struct.dex_class_def, ptr %81, i64 %83
  store ptr %84, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %85 = load ptr, ptr %18, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.dex_class_def, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 1, !tbaa !22
  %88 = trunc i32 %87 to i16
  %89 = invoke noundef ptr @_Z22dex_string_by_type_idxP10ddump_datat(ptr noundef %13, i16 noundef zeroext %88)
          to label %90 unwind label %101

90:                                               ; preds = %79
  store ptr %89, ptr %19, align 8, !tbaa !9
  %91 = load ptr, ptr %19, align 8, !tbaa !9
  %92 = invoke noundef zeroext i1 @_ZSt12regex_searchIcNSt7__cxx1112regex_traitsIcEEEbPKT_RKNS0_11basic_regexIS3_T0_EENSt15regex_constants15match_flag_typeE(ptr noundef %91, ptr noundef nonnull align 8 dereferenceable(32) %10, i32 noundef 0)
          to label %93 unwind label %101

93:                                               ; preds = %90
  br i1 %92, label %94, label %111

94:                                               ; preds = %93
  %95 = load i8, ptr %6, align 1, !tbaa !11, !range !24, !noundef !25
  %96 = trunc i8 %95 to i1
  br i1 %96, label %97, label %105

97:                                               ; preds = %94
  %98 = load ptr, ptr %12, align 8, !tbaa !9
  %99 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %98)
          to label %100 unwind label %101

100:                                              ; preds = %97
  br label %110

101:                                              ; preds = %105, %97, %90, %79
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %14, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %119

105:                                              ; preds = %94
  %106 = load ptr, ptr %12, align 8, !tbaa !9
  %107 = load ptr, ptr %19, align 8, !tbaa !9
  %108 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %106, ptr noundef %107)
          to label %109 unwind label %101

109:                                              ; preds = %105
  br label %110

110:                                              ; preds = %109, %100
  br label %111

111:                                              ; preds = %110, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %17, align 4, !tbaa !5
  %114 = add i32 %113, 1
  store i32 %114, ptr %17, align 4, !tbaa !5
  br label %70, !llvm.loop !26

115:                                              ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 104, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %11, align 4, !tbaa !5
  br label %53, !llvm.loop !27

119:                                              ; preds = %101, %75
  call void @llvm.lifetime.end.p0(i64 104, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  br label %125

120:                                              ; preds = %57
  call void @_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  store i32 0, ptr %8, align 4
  br label %121

121:                                              ; preds = %120, %38, %32, %31
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  %122 = load i32, ptr %8, align 4
  switch i32 %122, label %130 [
    i32 0, label %123
    i32 1, label %123
  ]

123:                                              ; preds = %121, %121
  %124 = load i32, ptr %3, align 4
  ret i32 %124

125:                                              ; preds = %119
  %126 = load ptr, ptr %14, align 8
  %127 = load i32, ptr %15, align 4
  %128 = insertvalue { ptr, i32 } poison, ptr %126, 0
  %129 = insertvalue { ptr, i32 } %128, i32 %127, 1
  resume { ptr, i32 } %129

130:                                              ; preds = %121
  unreachable
}

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

; Function Attrs: nounwind
declare i32 @getopt_long(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

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

declare void @_Z13open_dex_filePKcP10ddump_data(ptr noundef, ptr noundef) #5

declare i32 @__gxx_personality_v0(...)

declare noundef ptr @_Z22dex_string_by_type_idxP10ddump_datat(ptr noundef, i16 noundef zeroext) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt12regex_searchIcNSt7__cxx1112regex_traitsIcEEEbPKT_RKNS0_11basic_regexIS3_T0_EENSt15regex_constants15match_flag_typeE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #6

declare i32 @printf(ptr noundef, ...) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

attributes #0 = { 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 #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 norecurse 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 #6 = { 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 #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !10, i64 32}
!17 = !{!"_ZTS10ddump_data", !18, i64 0, !18, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96}
!18 = !{!"long", !7, i64 0}
!19 = !{!20, !6, i64 96}
!20 = !{!"_ZTS10dex_header", !7, i64 0, !6, i64 8, !7, i64 12, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108}
!21 = !{!17, !10, i64 64}
!22 = !{!23, !6, i64 0}
!23 = !{!"_ZTS13dex_class_def", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = distinct !{!26, !15}
!27 = distinct !{!27, !15}


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

%struct.option = type { ptr, i32, ptr, i32 }
%"class.std::__cxx11::basic_regex" = type { i32, %"class.std::locale", %"class.std::shared_ptr" }
%"class.std::locale" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%struct.ddump_data = type { i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.dex_class_def = type { i32, i32, i32, i32, i32, i32, i32, i32 }

@stderr = external local_unnamed_addr global ptr, align 8
@_ZZ4mainE7options = external hidden constant [1 x %struct.option], align 16
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@optind = external local_unnamed_addr global i32, align 4
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11print_usagev() local_unnamed_addr #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_regex", align 8
  %4 = alloca %struct.ddump_data, align 8
  %5 = tail call i32 @getopt_long(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.2, ptr noundef nonnull @_ZZ4mainE7options, ptr noundef null) #8
  %sext36 = shl i32 %5, 24
  %.not37.not = icmp eq i32 %sext36, -16777216
  br i1 %.not37.not, label %._crit_edge, label %.lr.ph

6:                                                ; preds = %.lr.ph
  %7 = tail call i32 @getopt_long(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.2, ptr noundef nonnull @_ZZ4mainE7options, ptr noundef null) #8
  %sext = shl i32 %7, 24
  %.not = icmp eq i32 %sext, -16777216
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

.lr.ph:                                           ; preds = %2, %6
  %sext38 = phi i32 [ %sext, %6 ], [ %sext36, %2 ]
  %8 = ashr exact i32 %sext38, 24
  switch i32 %8, label %10 [
    i32 108, label %6
    i32 104, label %9
  ], !llvm.loop !5

9:                                                ; preds = %.lr.ph
  tail call void @_Z11print_usagev()
  br label %66

10:                                               ; preds = %.lr.ph
  tail call void @_Z11print_usagev()
  br label %66

._crit_edge:                                      ; preds = %6, %2
  %11 = load i32, ptr @optind, align 4, !tbaa !7
  %12 = icmp eq i32 %11, %0
  br i1 %12, label %13, label %17

13:                                               ; preds = %._crit_edge
  %14 = load ptr, ptr @stderr, align 8, !tbaa !11
  %15 = load ptr, ptr %1, align 8, !tbaa !11
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.3, ptr noundef %15) #9
  tail call void @_Z11print_usagev()
  br label %66

17:                                               ; preds = %._crit_edge
  %18 = sext i32 %11 to i64
  %19 = getelementptr inbounds ptr, ptr %1, i64 %18
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #8
  call void @_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEEC2EPKcNSt15regex_constants18syntax_option_typeE(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %20, i32 noundef 16)
  %21 = load i32, ptr @optind, align 4, !tbaa !7
  %.02943 = add nsw i32 %21, 1
  %22 = icmp slt i32 %.02943, %0
  br i1 %22, label %.lr.ph46, label %._crit_edge47

.lr.ph46:                                         ; preds = %17
  %23 = getelementptr inbounds i8, ptr %4, i64 32
  %24 = getelementptr inbounds i8, ptr %4, i64 64
  %25 = sext i32 %21 to i64
  %26 = add nsw i64 %25, 1
  br i1 %.not37.not, label %.lr.ph46.split, label %.lr.ph46.split.us

.lr.ph46.split.us:                                ; preds = %.lr.ph46, %._crit_edge42.split.us.us
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %._crit_edge42.split.us.us ], [ %26, %.lr.ph46 ]
  %27 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv56
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %4) #8
  invoke void @_Z13open_dex_filePKcP10ddump_data(ptr noundef %28, ptr noundef nonnull %4)
          to label %29 unwind label %.split49.us

29:                                               ; preds = %.lr.ph46.split.us
  %30 = load ptr, ptr %23, align 8, !tbaa !13
  %31 = getelementptr inbounds i8, ptr %30, i64 96
  %32 = load i32, ptr %31, align 1, !tbaa !16
  %.not53 = icmp eq i32 %32, 0
  br i1 %.not53, label %._crit_edge42.split.us.us, label %.lr.ph41.us.preheader

.lr.ph41.us.preheader:                            ; preds = %29
  %wide.trip.count = zext i32 %32 to i64
  br label %.lr.ph41.us

._crit_edge42.split.us.us:                        ; preds = %43, %29
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #8
  %indvars.iv.next57 = add nsw i64 %indvars.iv56, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next57 to i32
  %exitcond59.not = icmp eq i32 %lftr.wideiv, %0
  br i1 %exitcond59.not, label %._crit_edge47, label %.lr.ph46.split.us, !llvm.loop !18

.lr.ph41.us:                                      ; preds = %.lr.ph41.us.preheader, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph41.us.preheader ], [ %indvars.iv.next, %43 ]
  %33 = load ptr, ptr %24, align 8, !tbaa !19
  %34 = getelementptr inbounds %struct.dex_class_def, ptr %33, i64 %indvars.iv
  %35 = load i32, ptr %34, align 1, !tbaa !20
  %36 = trunc i32 %35 to i16
  %37 = invoke noundef ptr @_Z22dex_string_by_type_idxP10ddump_datat(ptr noundef nonnull %4, i16 noundef zeroext %36)
          to label %38 unwind label %.split.us.split.us

38:                                               ; preds = %.lr.ph41.us
  %39 = invoke noundef zeroext i1 @_ZSt12regex_searchIcNSt7__cxx1112regex_traitsIcEEEbPKT_RKNS0_11basic_regexIS3_T0_EENSt15regex_constants15match_flag_typeE(ptr noundef %37, ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef 0)
          to label %40 unwind label %.split.us.split.us

40:                                               ; preds = %38
  br i1 %39, label %41, label %43

41:                                               ; preds = %40
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %28)
  br label %43

43:                                               ; preds = %41, %40
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge42.split.us.us, label %.lr.ph41.us, !llvm.loop !22

.split49.us:                                      ; preds = %.lr.ph46.split.us
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %65

.split.us.split.us:                               ; preds = %38, %.lr.ph41.us
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %65

._crit_edge47:                                    ; preds = %._crit_edge42.split.us.us, %._crit_edge42.split, %17
  call void @_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #8
  br label %66

.lr.ph46.split:                                   ; preds = %.lr.ph46, %._crit_edge42.split
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %._crit_edge42.split ], [ %26, %.lr.ph46 ]
  %46 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv65
  %47 = load ptr, ptr %46, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %4) #8
  invoke void @_Z13open_dex_filePKcP10ddump_data(ptr noundef %47, ptr noundef nonnull %4)
          to label %48 unwind label %.split49

48:                                               ; preds = %.lr.ph46.split
  %49 = load ptr, ptr %23, align 8, !tbaa !13
  %50 = getelementptr inbounds i8, ptr %49, i64 96
  %51 = load i32, ptr %50, align 1, !tbaa !16
  %.not52 = icmp eq i32 %51, 0
  br i1 %.not52, label %._crit_edge42.split, label %.lr.ph41.preheader

.lr.ph41.preheader:                               ; preds = %48
  %wide.trip.count63 = zext i32 %51 to i64
  br label %.lr.ph41

._crit_edge42.split:                              ; preds = %64, %48
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #8
  %indvars.iv.next66 = add nsw i64 %indvars.iv65, 1
  %lftr.wideiv68 = trunc i64 %indvars.iv.next66 to i32
  %exitcond69.not = icmp eq i32 %lftr.wideiv68, %0
  br i1 %exitcond69.not, label %._crit_edge47, label %.lr.ph46.split, !llvm.loop !18

.split49:                                         ; preds = %.lr.ph46.split
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %65

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %64
  %indvars.iv60 = phi i64 [ 0, %.lr.ph41.preheader ], [ %indvars.iv.next61, %64 ]
  %53 = load ptr, ptr %24, align 8, !tbaa !19
  %54 = getelementptr inbounds %struct.dex_class_def, ptr %53, i64 %indvars.iv60
  %55 = load i32, ptr %54, align 1, !tbaa !20
  %56 = trunc i32 %55 to i16
  %57 = invoke noundef ptr @_Z22dex_string_by_type_idxP10ddump_datat(ptr noundef nonnull %4, i16 noundef zeroext %56)
          to label %58 unwind label %.split

58:                                               ; preds = %.lr.ph41
  %59 = invoke noundef zeroext i1 @_ZSt12regex_searchIcNSt7__cxx1112regex_traitsIcEEEbPKT_RKNS0_11basic_regexIS3_T0_EENSt15regex_constants15match_flag_typeE(ptr noundef %57, ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef 0)
          to label %60 unwind label %.split

60:                                               ; preds = %58
  br i1 %59, label %61, label %64

61:                                               ; preds = %60
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef %47, ptr noundef %57)
  br label %64

.split:                                           ; preds = %58, %.lr.ph41
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %65

64:                                               ; preds = %61, %60
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count63
  br i1 %exitcond64.not, label %._crit_edge42.split, label %.lr.ph41, !llvm.loop !22

65:                                               ; preds = %.split, %.split.us.split.us, %.split49, %.split49.us
  %.pn = phi { ptr, i32 } [ %52, %.split49 ], [ %44, %.split49.us ], [ %63, %.split ], [ %45, %.split.us.split.us ]
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #8
  call void @_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn

66:                                               ; preds = %._crit_edge47, %13, %10, %9
  %.0 = phi i32 [ 1, %10 ], [ 0, %9 ], [ 1, %13 ], [ 0, %._crit_edge47 ]
  ret i32 %.0
}

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

; Function Attrs: nounwind
declare i32 @getopt_long(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEEC2EPKcNSt15regex_constants18syntax_option_typeE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef) unnamed_addr #5 align 2

declare void @_Z13open_dex_filePKcP10ddump_data(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @__gxx_personality_v0(...)

declare noundef ptr @_Z22dex_string_by_type_idxP10ddump_datat(ptr noundef, i16 noundef zeroext) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt12regex_searchIcNSt7__cxx1112regex_traitsIcEEEbPKT_RKNS0_11basic_regexIS3_T0_EENSt15regex_constants15match_flag_typeE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #7

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx1111basic_regexIcNS_12regex_traitsIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

attributes #0 = { 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 #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 = { mustprogress norecurse 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { "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 #7 = { 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 #8 = { nounwind }
attributes #9 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!14, !12, i64 32}
!14 = !{!"_ZTS10ddump_data", !15, i64 0, !15, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96}
!15 = !{!"long", !9, i64 0}
!16 = !{!17, !8, i64 96}
!17 = !{!"_ZTS10dex_header", !9, i64 0, !8, i64 8, !9, i64 12, !8, i64 32, !8, i64 36, !8, i64 40, !8, i64 44, !8, i64 48, !8, i64 52, !8, i64 56, !8, i64 60, !8, i64 64, !8, i64 68, !8, i64 72, !8, i64 76, !8, i64 80, !8, i64 84, !8, i64 88, !8, i64 92, !8, i64 96, !8, i64 100, !8, i64 104, !8, i64 108}
!18 = distinct !{!18, !6}
!19 = !{!14, !12, i64 64}
!20 = !{!21, !8, i64 0}
!21 = !{!"_ZTS13dex_class_def", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28}
!22 = distinct !{!22, !6}


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