; LLVM IR from nickmqb/muon :: bootstrap/mu.ll_Parser (readNumberSuffix__)

; 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.tag_____ParserState__ = type { %struct.string__, i32, ptr, ptr, i32, i32, i32, i32, i32, ptr, %struct.tag_____IntRange__, i32, i32, ptr, i32, ptr, ptr, ptr }
%struct.string__ = type { ptr, i32 }
%struct.tag_____IntRange__ = type { i32, i32 }

@top_____abandonFn__ = external dso_local thread_local global ptr, align 8

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @Parser__readNumberSuffix__(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.tag_____ParserState__, ptr %11, i32 0, i32 0
  store ptr %12, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.tag_____ParserState__, ptr %13, i32 0, i32 1
  %15 = load i32, ptr %14, align 8, !tbaa !9
  store i32 %15, ptr %4, align 4, !tbaa !14
  %16 = load i32, ptr %4, align 4, !tbaa !14
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.string__, ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 8, !tbaa !15
  %20 = icmp ult i32 %16, %19
  br i1 %20, label %24, label %21

21:                                               ; preds = %1
  %22 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  call void %23(i32 noundef -3)
  br label %24

24:                                               ; preds = %21, %1
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.string__, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !16
  %28 = load i32, ptr %4, align 4, !tbaa !14
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds i8, ptr %27, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !17
  store i8 %31, ptr %5, align 1, !tbaa !17
  %32 = load i8, ptr %5, align 1, !tbaa !17
  %33 = sext i8 %32 to i32
  %34 = icmp ne i32 %33, 95
  br i1 %34, label %35, label %36

35:                                               ; preds = %24
  store i32 1, ptr %6, align 4
  br label %99

36:                                               ; preds = %24
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.tag_____ParserState__, ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 8, !tbaa !9
  %40 = add nsw i32 %39, 1
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.tag_____ParserState__, ptr %41, i32 0, i32 1
  store i32 %40, ptr %42, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.tag_____ParserState__, ptr %43, i32 0, i32 0
  store ptr %44, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.tag_____ParserState__, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 8, !tbaa !9
  store i32 %47, ptr %8, align 4, !tbaa !14
  %48 = load i32, ptr %8, align 4, !tbaa !14
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.string__, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 8, !tbaa !15
  %52 = icmp ult i32 %48, %51
  br i1 %52, label %56, label %53

53:                                               ; preds = %36
  %54 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  call void %55(i32 noundef -3)
  br label %56

56:                                               ; preds = %53, %36
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.string__, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = load i32, ptr %8, align 4, !tbaa !14
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds i8, ptr %59, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !17
  store i8 %63, ptr %5, align 1, !tbaa !17
  br label %64

64:                                               ; preds = %90, %56
  br label %65

65:                                               ; preds = %64
  %66 = load i8, ptr %5, align 1, !tbaa !17
  %67 = call zeroext i8 @Parser__isIdentifierChar__(i8 noundef signext %66)
  %68 = icmp ne i8 %67, 0
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  br label %98

70:                                               ; preds = %65
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.tag_____ParserState__, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 8, !tbaa !9
  %74 = add nsw i32 %73, 1
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.tag_____ParserState__, ptr %75, i32 0, i32 1
  store i32 %74, ptr %76, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.tag_____ParserState__, ptr %77, i32 0, i32 0
  store ptr %78, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.tag_____ParserState__, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 8, !tbaa !9
  store i32 %81, ptr %10, align 4, !tbaa !14
  %82 = load i32, ptr %10, align 4, !tbaa !14
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.string__, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !15
  %86 = icmp ult i32 %82, %85
  br i1 %86, label %90, label %87

87:                                               ; preds = %70
  %88 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  call void %89(i32 noundef -3)
  br label %90

90:                                               ; preds = %87, %70
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.string__, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !16
  %94 = load i32, ptr %10, align 4, !tbaa !14
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %93, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !17
  store i8 %97, ptr %5, align 1, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %64

98:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  store i32 0, ptr %6, align 4
  br label %99

99:                                               ; preds = %98, %35
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %100 = load i32, ptr %6, align 4
  switch i32 %100, label %102 [
    i32 0, label %101
    i32 1, label %101
  ]

101:                                              ; preds = %99, %99
  ret void

102:                                              ; preds = %99
  unreachable
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Parser__isIdentifierChar__(i8 noundef signext) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = { 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/C++ TBAA"}
!9 = !{!10, !12, i64 16}
!10 = !{!"tag_____ParserState__", !11, i64 0, !12, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !6, i64 64, !13, i64 72, !12, i64 80, !12, i64 84, !6, i64 88, !12, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!11 = !{!"", !6, i64 0, !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"tag_____IntRange__", !12, i64 0, !12, i64 4}
!14 = !{!12, !12, i64 0}
!15 = !{!11, !12, i64 8}
!16 = !{!11, !6, i64 0}
!17 = !{!7, !7, 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"

@top_____abandonFn__ = external dso_local thread_local local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

; Function Attrs: nounwind uwtable
define dso_local void @Parser__readNumberSuffix__(ptr nocapture noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load i32, ptr %4, align 8, !tbaa !13
  %6 = icmp ult i32 %3, %5
  br i1 %6, label %10, label %7

7:                                                ; preds = %1
  %8 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %9 = load ptr, ptr %8, align 8, !tbaa !14
  tail call void %9(i32 noundef -3) #2
  br label %10

10:                                               ; preds = %7, %1
  %11 = load ptr, ptr %0, align 8, !tbaa !15
  %12 = zext i32 %3 to i64
  %13 = getelementptr inbounds i8, ptr %11, i64 %12
  %14 = load i8, ptr %13, align 1, !tbaa !16
  %.not = icmp eq i8 %14, 95
  br i1 %.not, label %15, label %.loopexit

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 8, !tbaa !5
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr %2, align 8, !tbaa !5
  %18 = load i32, ptr %4, align 8, !tbaa !13
  %19 = icmp ult i32 %17, %18
  br i1 %19, label %23, label %20

20:                                               ; preds = %15
  %21 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  tail call void %22(i32 noundef -3) #2
  %.pre = load ptr, ptr %0, align 8, !tbaa !15
  br label %23

23:                                               ; preds = %20, %15
  %24 = phi ptr [ %.pre, %20 ], [ %11, %15 ]
  %25 = zext i32 %17 to i64
  %26 = getelementptr inbounds i8, ptr %24, i64 %25
  %.024 = load i8, ptr %26, align 1, !tbaa !16
  %27 = tail call zeroext i8 @Parser__isIdentifierChar__(i8 noundef signext %.024)
  %.not2325 = icmp eq i8 %27, 0
  br i1 %.not2325, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %23
  %28 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  br label %29

29:                                               ; preds = %.lr.ph, %36
  %30 = load i32, ptr %2, align 8, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 8, !tbaa !5
  %32 = load i32, ptr %4, align 8, !tbaa !13
  %33 = icmp ult i32 %31, %32
  br i1 %33, label %36, label %34

34:                                               ; preds = %29
  %35 = load ptr, ptr %28, align 8, !tbaa !14
  tail call void %35(i32 noundef -3) #2
  br label %36

36:                                               ; preds = %34, %29
  %37 = load ptr, ptr %0, align 8, !tbaa !15
  %38 = zext i32 %31 to i64
  %39 = getelementptr inbounds i8, ptr %37, i64 %38
  %.0 = load i8, ptr %39, align 1, !tbaa !16
  %40 = tail call zeroext i8 @Parser__isIdentifierChar__(i8 noundef signext %.0)
  %.not23 = icmp eq i8 %40, 0
  br i1 %.not23, label %.loopexit, label %29

.loopexit:                                        ; preds = %36, %23, %10
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Parser__isIdentifierChar__(i8 noundef signext) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 = { 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, !11, i64 16}
!6 = !{!"tag_____ParserState__", !7, i64 0, !11, i64 16, !8, i64 24, !8, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !8, i64 64, !12, i64 72, !11, i64 80, !11, i64 84, !8, i64 88, !11, i64 96, !8, i64 104, !8, i64 112, !8, i64 120}
!7 = !{!"", !8, i64 0, !11, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"tag_____IntRange__", !11, i64 0, !11, i64 4}
!13 = !{!7, !11, i64 8}
!14 = !{!8, !8, i64 0}
!15 = !{!7, !8, i64 0}
!16 = !{!9, !9, i64 0}


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