; LLVM IR from facebook/redex :: libredex/TypeUtil.ll (ZN4type28get_unboxing_method_for_typeEPK7DexType)

; 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.std::basic_string_view" = type { i64, ptr }

@.str.17 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type17java_lang_BooleanEv() #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type14java_lang_ByteEv() #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type15java_lang_ShortEv() #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type19java_lang_CharacterEv() #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type17java_lang_IntegerEv() #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type14java_lang_LongEv() #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type15java_lang_FloatEv() #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type16java_lang_DoubleEv() #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4type28get_unboxing_method_for_typeEPK7DexType(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.std::basic_string_view", align 8
  %5 = alloca %"class.std::basic_string_view", align 8
  %6 = alloca %"class.std::basic_string_view", align 8
  %7 = alloca %"class.std::basic_string_view", align 8
  %8 = alloca %"class.std::basic_string_view", align 8
  %9 = alloca %"class.std::basic_string_view", align 8
  %10 = alloca %"class.std::basic_string_view", align 8
  %11 = alloca %"class.std::basic_string_view", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = call noundef ptr @_ZN4type17java_lang_BooleanEv()
  %14 = icmp eq ptr %12, %13
  br i1 %14, label %15, label %21

15:                                               ; preds = %1
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef @.str.17) #3
  %16 = getelementptr inbounds { i64, ptr }, ptr %4, i32 0, i32 0
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds { i64, ptr }, ptr %4, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8
  %20 = call noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64 %17, ptr %19)
  store ptr %20, ptr %2, align 8
  br label %99

21:                                               ; preds = %1
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = call noundef ptr @_ZN4type14java_lang_ByteEv()
  %24 = icmp eq ptr %22, %23
  br i1 %24, label %25, label %31

25:                                               ; preds = %21
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef @.str.18) #3
  %26 = getelementptr inbounds { i64, ptr }, ptr %5, i32 0, i32 0
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds { i64, ptr }, ptr %5, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8
  %30 = call noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64 %27, ptr %29)
  store ptr %30, ptr %2, align 8
  br label %99

31:                                               ; preds = %21
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = call noundef ptr @_ZN4type15java_lang_ShortEv()
  %34 = icmp eq ptr %32, %33
  br i1 %34, label %35, label %41

35:                                               ; preds = %31
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef @.str.19) #3
  %36 = getelementptr inbounds { i64, ptr }, ptr %6, i32 0, i32 0
  %37 = load i64, ptr %36, align 8
  %38 = getelementptr inbounds { i64, ptr }, ptr %6, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8
  %40 = call noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64 %37, ptr %39)
  store ptr %40, ptr %2, align 8
  br label %99

41:                                               ; preds = %31
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = call noundef ptr @_ZN4type19java_lang_CharacterEv()
  %44 = icmp eq ptr %42, %43
  br i1 %44, label %45, label %51

45:                                               ; preds = %41
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef @.str.20) #3
  %46 = getelementptr inbounds { i64, ptr }, ptr %7, i32 0, i32 0
  %47 = load i64, ptr %46, align 8
  %48 = getelementptr inbounds { i64, ptr }, ptr %7, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8
  %50 = call noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64 %47, ptr %49)
  store ptr %50, ptr %2, align 8
  br label %99

51:                                               ; preds = %41
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = call noundef ptr @_ZN4type17java_lang_IntegerEv()
  %54 = icmp eq ptr %52, %53
  br i1 %54, label %55, label %61

55:                                               ; preds = %51
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef @.str.21) #3
  %56 = getelementptr inbounds { i64, ptr }, ptr %8, i32 0, i32 0
  %57 = load i64, ptr %56, align 8
  %58 = getelementptr inbounds { i64, ptr }, ptr %8, i32 0, i32 1
  %59 = load ptr, ptr %58, align 8
  %60 = call noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64 %57, ptr %59)
  store ptr %60, ptr %2, align 8
  br label %99

61:                                               ; preds = %51
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = call noundef ptr @_ZN4type14java_lang_LongEv()
  %64 = icmp eq ptr %62, %63
  br i1 %64, label %65, label %71

65:                                               ; preds = %61
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef @.str.22) #3
  %66 = getelementptr inbounds { i64, ptr }, ptr %9, i32 0, i32 0
  %67 = load i64, ptr %66, align 8
  %68 = getelementptr inbounds { i64, ptr }, ptr %9, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8
  %70 = call noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64 %67, ptr %69)
  store ptr %70, ptr %2, align 8
  br label %99

71:                                               ; preds = %61
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = call noundef ptr @_ZN4type15java_lang_FloatEv()
  %74 = icmp eq ptr %72, %73
  br i1 %74, label %75, label %81

75:                                               ; preds = %71
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef @.str.23) #3
  %76 = getelementptr inbounds { i64, ptr }, ptr %10, i32 0, i32 0
  %77 = load i64, ptr %76, align 8
  %78 = getelementptr inbounds { i64, ptr }, ptr %10, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8
  %80 = call noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64 %77, ptr %79)
  store ptr %80, ptr %2, align 8
  br label %99

81:                                               ; preds = %71
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = call noundef ptr @_ZN4type16java_lang_DoubleEv()
  %84 = icmp eq ptr %82, %83
  br i1 %84, label %85, label %91

85:                                               ; preds = %81
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef @.str.24) #3
  %86 = getelementptr inbounds { i64, ptr }, ptr %11, i32 0, i32 0
  %87 = load i64, ptr %86, align 8
  %88 = getelementptr inbounds { i64, ptr }, ptr %11, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8
  %90 = call noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64 %87, ptr %89)
  store ptr %90, ptr %2, align 8
  br label %99

91:                                               ; preds = %81
  br label %92

92:                                               ; preds = %91
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  store ptr null, ptr %2, align 8
  br label %99

99:                                               ; preds = %98, %85, %75, %65, %55, %45, %35, %25, %15
  %100 = load ptr, ptr %2, align 8
  ret ptr %100
}

declare noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64, ptr) #2

attributes #0 = { 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 #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; 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.std::basic_string_view" = type { i64, ptr }

@.str.17 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type17java_lang_BooleanEv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type14java_lang_ByteEv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type15java_lang_ShortEv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type19java_lang_CharacterEv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type17java_lang_IntegerEv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type14java_lang_LongEv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type15java_lang_FloatEv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4type16java_lang_DoubleEv() local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4type28get_unboxing_method_for_typeEPK7DexType(ptr noundef readnone %0) local_unnamed_addr #0 {
  %2 = alloca %"class.std::basic_string_view", align 8
  %3 = alloca %"class.std::basic_string_view", align 8
  %4 = alloca %"class.std::basic_string_view", align 8
  %5 = alloca %"class.std::basic_string_view", align 8
  %6 = alloca %"class.std::basic_string_view", align 8
  %7 = alloca %"class.std::basic_string_view", align 8
  %8 = alloca %"class.std::basic_string_view", align 8
  %9 = alloca %"class.std::basic_string_view", align 8
  %10 = tail call noundef ptr @_ZN4type17java_lang_BooleanEv()
  %11 = icmp eq ptr %10, %0
  %.sink12.sroa.gep = getelementptr inbounds i8, ptr %9, i64 8
  %.sink12.sroa.gep13 = getelementptr inbounds i8, ptr %8, i64 8
  %.sink12.sroa.gep14 = getelementptr inbounds i8, ptr %7, i64 8
  %.sink12.sroa.gep15 = getelementptr inbounds i8, ptr %6, i64 8
  %.sink12.sroa.gep16 = getelementptr inbounds i8, ptr %5, i64 8
  %.sink12.sroa.gep17 = getelementptr inbounds i8, ptr %4, i64 8
  %.sink12.sroa.gep18 = getelementptr inbounds i8, ptr %3, i64 8
  br i1 %11, label %12, label %13

12:                                               ; preds = %1
  %.sink12.sroa.gep19 = getelementptr inbounds i8, ptr %2, i64 8
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef @.str.17) #3
  br label %.sink.split

13:                                               ; preds = %1
  %14 = tail call noundef ptr @_ZN4type14java_lang_ByteEv()
  %15 = icmp eq ptr %14, %0
  br i1 %15, label %16, label %17

16:                                               ; preds = %13
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef @.str.18) #3
  br label %.sink.split

17:                                               ; preds = %13
  %18 = tail call noundef ptr @_ZN4type15java_lang_ShortEv()
  %19 = icmp eq ptr %18, %0
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef @.str.19) #3
  br label %.sink.split

21:                                               ; preds = %17
  %22 = tail call noundef ptr @_ZN4type19java_lang_CharacterEv()
  %23 = icmp eq ptr %22, %0
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef @.str.20) #3
  br label %.sink.split

25:                                               ; preds = %21
  %26 = tail call noundef ptr @_ZN4type17java_lang_IntegerEv()
  %27 = icmp eq ptr %26, %0
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef @.str.21) #3
  br label %.sink.split

29:                                               ; preds = %25
  %30 = tail call noundef ptr @_ZN4type14java_lang_LongEv()
  %31 = icmp eq ptr %30, %0
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef @.str.22) #3
  br label %.sink.split

33:                                               ; preds = %29
  %34 = tail call noundef ptr @_ZN4type15java_lang_FloatEv()
  %35 = icmp eq ptr %34, %0
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef @.str.23) #3
  br label %.sink.split

37:                                               ; preds = %33
  %38 = tail call noundef ptr @_ZN4type16java_lang_DoubleEv()
  %39 = icmp eq ptr %38, %0
  br i1 %39, label %40, label %43

40:                                               ; preds = %37
  call void @_ZNSt17basic_string_viewIcSt11char_traitsIcEEC2EPKc(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef @.str.24) #3
  br label %.sink.split

.sink.split:                                      ; preds = %12, %16, %20, %24, %28, %32, %36, %40
  %.sink12.sroa.phi = phi ptr [ %.sink12.sroa.gep, %40 ], [ %.sink12.sroa.gep13, %36 ], [ %.sink12.sroa.gep14, %32 ], [ %.sink12.sroa.gep15, %28 ], [ %.sink12.sroa.gep16, %24 ], [ %.sink12.sroa.gep17, %20 ], [ %.sink12.sroa.gep18, %16 ], [ %.sink12.sroa.gep19, %12 ]
  %.sink12 = phi ptr [ %9, %40 ], [ %8, %36 ], [ %7, %32 ], [ %6, %28 ], [ %5, %24 ], [ %4, %20 ], [ %3, %16 ], [ %2, %12 ]
  %.sink = load i64, ptr %.sink12, align 8
  %41 = load ptr, ptr %.sink12.sroa.phi, align 8
  %42 = call noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64 %.sink, ptr %41)
  br label %43

43:                                               ; preds = %.sink.split, %37
  %.0 = phi ptr [ null, %37 ], [ %42, %.sink.split ]
  ret ptr %.0
}

declare noundef ptr @_ZN9DexMethod11make_methodESt17basic_string_viewIcSt11char_traitsIcEE(i64, ptr) local_unnamed_addr #2

attributes #0 = { 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 #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass