; LLVM IR from BitFunnel/NativeJIT :: test/CodeGen/ML64Verifier.ll (ZN9NativeJIT12ML64Verifier18AdvanceToDataFieldEv)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN9NativeJIT12ML64Verifier18AdvanceToDataFieldEv(ptr noundef nonnull align 8 dereferenceable(432) %0) #0 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  %8 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  %9 = sext i8 %8 to i32
  %10 = icmp eq i32 %9, 9
  br i1 %10, label %11, label %30

11:                                               ; preds = %1
  %12 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %24, %11
  %14 = load i32, ptr %4, align 4, !tbaa !9
  %15 = icmp ult i32 %14, 3
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  store i32 2, ptr %5, align 4
  br label %27

17:                                               ; preds = %13
  %18 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  %19 = sext i8 %18 to i32
  %20 = icmp ne i32 %19, 32
  br i1 %20, label %21, label %22

21:                                               ; preds = %17
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %27

22:                                               ; preds = %17
  %23 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  br label %24

24:                                               ; preds = %22
  %25 = load i32, ptr %4, align 4, !tbaa !9
  %26 = add i32 %25, 1
  store i32 %26, ptr %4, align 4, !tbaa !9
  br label %13, !llvm.loop !11

27:                                               ; preds = %21, %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %28 = load i32, ptr %5, align 4
  switch i32 %28, label %78 [
    i32 2, label %29
    i32 1, label %76
  ]

29:                                               ; preds = %27
  br label %71

30:                                               ; preds = %1
  %31 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  %32 = sext i8 %31 to i32
  %33 = icmp eq i32 %32, 32
  br i1 %33, label %34, label %70

34:                                               ; preds = %30
  %35 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %52, %34
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = icmp ult i32 %37, 8
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  store i32 5, ptr %5, align 4
  br label %55

40:                                               ; preds = %36
  %41 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  %42 = sext i8 %41 to i32
  %43 = call i32 @isxdigit(i32 noundef %42) #5
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %50, label %45

45:                                               ; preds = %40
  %46 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  %47 = sext i8 %46 to i32
  %48 = icmp ne i32 %47, 32
  br i1 %48, label %49, label %50

49:                                               ; preds = %45
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %55

50:                                               ; preds = %45, %40
  %51 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  br label %52

52:                                               ; preds = %50
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = add i32 %53, 1
  store i32 %54, ptr %6, align 4, !tbaa !9
  br label %36, !llvm.loop !13

55:                                               ; preds = %49, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %56 = load i32, ptr %5, align 4
  switch i32 %56, label %78 [
    i32 5, label %57
    i32 1, label %76
  ]

57:                                               ; preds = %55
  %58 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  %59 = sext i8 %58 to i32
  %60 = icmp ne i32 %59, 32
  br i1 %60, label %61, label %62

61:                                               ; preds = %57
  store i1 false, ptr %2, align 1
  br label %76

62:                                               ; preds = %57
  %63 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  %64 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  %65 = sext i8 %64 to i32
  %66 = icmp ne i32 %65, 32
  br i1 %66, label %67, label %68

67:                                               ; preds = %62
  store i1 false, ptr %2, align 1
  br label %76

68:                                               ; preds = %62
  %69 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  br label %70

70:                                               ; preds = %68, %30
  br label %71

71:                                               ; preds = %70, %29
  %72 = call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %7)
  %73 = sext i8 %72 to i32
  %74 = call i32 @isxdigit(i32 noundef %73) #5
  %75 = icmp ne i32 %74, 0
  store i1 %75, ptr %2, align 1
  br label %76

76:                                               ; preds = %71, %67, %61, %55, %27
  %77 = load i1, ptr %2, align 1
  ret i1 %77

78:                                               ; preds = %55, %27
  unreachable
}

; Function Attrs: nounwind willreturn memory(read)
declare i32 @isxdigit(i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432)) #2 align 2

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

; 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 noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432)) #2 align 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 = { nounwind willreturn memory(read) "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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

!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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN9NativeJIT12ML64Verifier18AdvanceToDataFieldEv(ptr noundef nonnull align 8 dereferenceable(432) %0) local_unnamed_addr #0 align 2 {
  %2 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %3 = icmp eq i8 %2, 9
  br i1 %3, label %4, label %13

4:                                                ; preds = %1
  %5 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %6 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not14 = icmp eq i8 %6, 32
  br i1 %.not14, label %7, label %.loopexit

7:                                                ; preds = %4
  %8 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %9 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not14.1 = icmp eq i8 %9, 32
  br i1 %.not14.1, label %10, label %.loopexit

10:                                               ; preds = %7
  %11 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %12 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not14.2 = icmp eq i8 %12, 32
  br i1 %.not14.2, label %.thread.sink.split, label %.loopexit

13:                                               ; preds = %1
  %14 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %15 = icmp eq i8 %14, 32
  br i1 %15, label %16, label %.thread

16:                                               ; preds = %13
  %17 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %18 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %19 = sext i8 %18 to i32
  %20 = tail call i32 @isxdigit(i32 noundef %19) #2
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %21, label %23

21:                                               ; preds = %16
  %22 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not11 = icmp eq i8 %22, 32
  br i1 %.not11, label %23, label %.loopexit

23:                                               ; preds = %21, %16
  %24 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %25 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %26 = sext i8 %25 to i32
  %27 = tail call i32 @isxdigit(i32 noundef %26) #2
  %.not.1 = icmp eq i32 %27, 0
  br i1 %.not.1, label %28, label %30

28:                                               ; preds = %23
  %29 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not11.1 = icmp eq i8 %29, 32
  br i1 %.not11.1, label %30, label %.loopexit

30:                                               ; preds = %28, %23
  %31 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %32 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %33 = sext i8 %32 to i32
  %34 = tail call i32 @isxdigit(i32 noundef %33) #2
  %.not.2 = icmp eq i32 %34, 0
  br i1 %.not.2, label %35, label %37

35:                                               ; preds = %30
  %36 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not11.2 = icmp eq i8 %36, 32
  br i1 %.not11.2, label %37, label %.loopexit

37:                                               ; preds = %35, %30
  %38 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %39 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %40 = sext i8 %39 to i32
  %41 = tail call i32 @isxdigit(i32 noundef %40) #2
  %.not.3 = icmp eq i32 %41, 0
  br i1 %.not.3, label %42, label %44

42:                                               ; preds = %37
  %43 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not11.3 = icmp eq i8 %43, 32
  br i1 %.not11.3, label %44, label %.loopexit

44:                                               ; preds = %42, %37
  %45 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %46 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %47 = sext i8 %46 to i32
  %48 = tail call i32 @isxdigit(i32 noundef %47) #2
  %.not.4 = icmp eq i32 %48, 0
  br i1 %.not.4, label %49, label %51

49:                                               ; preds = %44
  %50 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not11.4 = icmp eq i8 %50, 32
  br i1 %.not11.4, label %51, label %.loopexit

51:                                               ; preds = %49, %44
  %52 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %53 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %54 = sext i8 %53 to i32
  %55 = tail call i32 @isxdigit(i32 noundef %54) #2
  %.not.5 = icmp eq i32 %55, 0
  br i1 %.not.5, label %56, label %58

56:                                               ; preds = %51
  %57 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not11.5 = icmp eq i8 %57, 32
  br i1 %.not11.5, label %58, label %.loopexit

58:                                               ; preds = %56, %51
  %59 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %60 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %61 = sext i8 %60 to i32
  %62 = tail call i32 @isxdigit(i32 noundef %61) #2
  %.not.6 = icmp eq i32 %62, 0
  br i1 %.not.6, label %63, label %65

63:                                               ; preds = %58
  %64 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not11.6 = icmp eq i8 %64, 32
  br i1 %.not11.6, label %65, label %.loopexit

65:                                               ; preds = %63, %58
  %66 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %67 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %68 = sext i8 %67 to i32
  %69 = tail call i32 @isxdigit(i32 noundef %68) #2
  %.not.7 = icmp eq i32 %69, 0
  br i1 %.not.7, label %70, label %72

70:                                               ; preds = %65
  %71 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not11.7 = icmp eq i8 %71, 32
  br i1 %.not11.7, label %72, label %.loopexit

72:                                               ; preds = %70, %65
  %73 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %74 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not12 = icmp eq i8 %74, 32
  br i1 %.not12, label %75, label %.loopexit

75:                                               ; preds = %72
  %76 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %77 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %.not13 = icmp eq i8 %77, 32
  br i1 %.not13, label %.thread.sink.split, label %.loopexit

.thread.sink.split:                               ; preds = %75, %10
  %78 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  br label %.thread

.thread:                                          ; preds = %.thread.sink.split, %13
  %79 = tail call noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432) %0)
  %80 = sext i8 %79 to i32
  %81 = tail call i32 @isxdigit(i32 noundef %80) #2
  %82 = icmp ne i32 %81, 0
  br label %.loopexit

.loopexit:                                        ; preds = %21, %28, %35, %42, %49, %56, %63, %70, %4, %7, %10, %75, %72, %.thread
  %.2 = phi i1 [ %82, %.thread ], [ false, %72 ], [ false, %75 ], [ false, %10 ], [ false, %7 ], [ false, %4 ], [ false, %70 ], [ false, %63 ], [ false, %56 ], [ false, %49 ], [ false, %42 ], [ false, %35 ], [ false, %28 ], [ false, %21 ]
  ret i1 %.2
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @isxdigit(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_ZN9NativeJIT12ML64Verifier8PeekCharEv(ptr noundef nonnull align 8 dereferenceable(432)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i8 @_ZN9NativeJIT12ML64Verifier7GetCharEv(ptr noundef nonnull align 8 dereferenceable(432)) local_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 = { mustprogress nofree nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind willreturn memory(read) }

!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: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass