; LLVM IR from thepowersgang/mrustc :: src/parse/lex.ll (ZN5Lexer9getSymbolEv)

; 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.anon = type { i8, ptr, i32 }
%struct.Codepoint = type { i32 }
%"class.Lexer::EndOfFile" = type { i8 }

@_ZL8TOKENMAP = external hidden constant [58 x %struct.anon], align 16
@_ZTIN5Lexer9EndOfFileE = external dso_local constant { ptr, ptr }, align 8

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5Lexer9getSymbolEv(ptr noundef nonnull align 8 dereferenceable(256) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.Codepoint, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca %struct.Codepoint, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.Lexer::EndOfFile", align 1
  %15 = alloca %struct.Codepoint, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %16 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %17 = call i32 @_ZN5Lexer4getcEv(ptr noundef nonnull align 8 dereferenceable(256) %16)
  %18 = getelementptr inbounds %struct.Codepoint, ptr %3, i32 0, i32 0
  store i32 %17, ptr %18, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  store i8 0, ptr %6, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %110, %1
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = zext i32 %20 to i64
  %22 = icmp ult i64 %21, 58
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 2, ptr %8, align 4
  br label %114

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = zext i32 %25 to i64
  %27 = getelementptr inbounds [58 x %struct.anon], ptr @_ZL8TOKENMAP, i64 0, i64 %26
  %28 = getelementptr inbounds %struct.anon, ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  store ptr %29, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds [58 x %struct.anon], ptr @_ZL8TOKENMAP, i64 0, i64 %31
  %33 = getelementptr inbounds %struct.anon, ptr %32, i32 0, i32 0
  %34 = load i8, ptr %33, align 8, !tbaa !15
  %35 = zext i8 %34 to i64
  store i64 %35, ptr %10, align 8, !tbaa !16
  %36 = load i32, ptr %4, align 4, !tbaa !9
  %37 = zext i32 %36 to i64
  %38 = load i64, ptr %10, align 8, !tbaa !16
  %39 = icmp uge i64 %37, %38
  br i1 %39, label %50, label %40

40:                                               ; preds = %24
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = load i32, ptr %4, align 4, !tbaa !9
  %43 = zext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %41, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !18
  %46 = sext i8 %45 to i32
  %47 = getelementptr inbounds %struct.Codepoint, ptr %3, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !19
  %49 = icmp ugt i32 %46, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %40, %24
  store i32 2, ptr %8, align 4
  br label %107

51:                                               ; preds = %40
  br label %52

52:                                               ; preds = %84, %51
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load i32, ptr %4, align 4, !tbaa !9
  %55 = zext i32 %54 to i64
  %56 = getelementptr inbounds i8, ptr %53, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !18
  %58 = icmp ne i8 %57, 0
  br i1 %58, label %59, label %66

59:                                               ; preds = %52
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = load i32, ptr %4, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds i8, ptr %60, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !18
  %65 = call noundef zeroext i1 @_ZN9CodepointeqEc(ptr noundef nonnull align 4 dereferenceable(4) %3, i8 noundef signext %64)
  br label %66

66:                                               ; preds = %59, %52
  %67 = phi i1 [ false, %52 ], [ %65, %59 ]
  br i1 %67, label %68, label %92

68:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %69 = invoke i32 @_ZN5Lexer4getcEv(ptr noundef nonnull align 8 dereferenceable(256) %16)
          to label %70 unwind label %72

70:                                               ; preds = %68
  %71 = getelementptr inbounds %struct.Codepoint, ptr %11, i32 0, i32 0
  store i32 %69, ptr %71, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 %11, i64 4, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %84

72:                                               ; preds = %68
  %73 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN5Lexer9EndOfFileE
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %12, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %76

76:                                               ; preds = %72
  %77 = load i32, ptr %13, align 4
  %78 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIN5Lexer9EndOfFileE) #6
  %79 = icmp eq i32 %77, %78
  br i1 %79, label %80, label %113

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #6
  %81 = load ptr, ptr %12, align 8
  %82 = call ptr @__cxa_begin_catch(ptr %81) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  invoke void @_ZN9CodepointC2Ej(ptr noundef nonnull align 4 dereferenceable(4) %15, i32 noundef 0)
          to label %83 unwind label %87

83:                                               ; preds = %80
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 %15, i64 4, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  store i8 1, ptr %6, align 1, !tbaa !11
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #6
  br label %84

84:                                               ; preds = %83, %70
  %85 = load i32, ptr %4, align 4, !tbaa !9
  %86 = add i32 %85, 1
  store i32 %86, ptr %4, align 4, !tbaa !9
  br label %52, !llvm.loop !22

87:                                               ; preds = %80
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %12, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  invoke void @__cxa_end_catch()
          to label %91 unwind label %126

91:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #6
  br label %113

92:                                               ; preds = %66
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = load i32, ptr %4, align 4, !tbaa !9
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %93, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !18
  %98 = sext i8 %97 to i32
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %100, label %106

100:                                              ; preds = %92
  %101 = load i32, ptr %7, align 4, !tbaa !9
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds [58 x %struct.anon], ptr @_ZL8TOKENMAP, i64 0, i64 %102
  %104 = getelementptr inbounds %struct.anon, ptr %103, i32 0, i32 2
  %105 = load i32, ptr %104, align 8, !tbaa !24
  store i32 %105, ptr %5, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %100, %92
  store i32 0, ptr %8, align 4
  br label %107

107:                                              ; preds = %106, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %108 = load i32, ptr %8, align 4
  switch i32 %108, label %114 [
    i32 0, label %109
  ]

109:                                              ; preds = %107
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %7, align 4, !tbaa !9
  %112 = add i32 %111, 1
  store i32 %112, ptr %7, align 4, !tbaa !9
  br label %19, !llvm.loop !25

113:                                              ; preds = %91, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %121

114:                                              ; preds = %107, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %115

115:                                              ; preds = %114
  %116 = load i8, ptr %6, align 1, !tbaa !11, !range !26, !noundef !27
  %117 = trunc i8 %116 to i1
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  call void @_ZN5Lexer6ungetcEv(ptr noundef nonnull align 8 dereferenceable(256) %16)
  br label %119

119:                                              ; preds = %118, %115
  %120 = load i32, ptr %5, align 4, !tbaa !9
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret i32 %120

121:                                              ; preds = %113
  %122 = load ptr, ptr %12, align 8
  %123 = load i32, ptr %13, align 4
  %124 = insertvalue { ptr, i32 } poison, ptr %122, 0
  %125 = insertvalue { ptr, i32 } %124, i32 %123, 1
  resume { ptr, i32 } %125

126:                                              ; preds = %87
  %127 = landingpad { ptr, i32 }
          catch ptr null
  %128 = extractvalue { ptr, i32 } %127, 0
  call void @__clang_call_terminate(ptr %128) #7
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN5Lexer4getcEv(ptr noundef nonnull align 8 dereferenceable(256)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9CodepointeqEc(ptr noundef nonnull align 4 dereferenceable(4), i8 noundef signext) #3 align 2

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #4

declare ptr @__cxa_begin_catch(ptr)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9CodepointC2Ej(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #3 align 2

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Lexer6ungetcEv(ptr noundef nonnull align 8 dereferenceable(256)) #3 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nounwind memory(none) }
attributes #5 = { noinline noreturn nounwind uwtable "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 = { nounwind }
attributes #7 = { noreturn 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTS3$_0", !7, i64 0, !6, i64 8, !10, i64 16}
!15 = !{!14, !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !10, i64 0}
!20 = !{!"_ZTS9Codepoint", !10, i64 0}
!21 = !{i64 0, i64 4, !9}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!14, !10, i64 16}
!25 = distinct !{!25, !23}
!26 = !{i8 0, i8 2}
!27 = !{}


; 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.anon = type { i8, ptr, i32 }
%struct.Codepoint = type { i32 }

@_ZL8TOKENMAP = external hidden local_unnamed_addr constant [58 x %struct.anon], align 16
@_ZTIN5Lexer9EndOfFileE = external dso_local constant { ptr, ptr }, align 8

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress 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 i32 @_ZN5Lexer9getSymbolEv(ptr noundef nonnull align 8 dereferenceable(256) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.Codepoint, align 4
  %3 = alloca %struct.Codepoint, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %4 = tail call i32 @_ZN5Lexer4getcEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  store i32 %4, ptr %2, align 4
  br label %5

5:                                                ; preds = %1, %40
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next, %40 ]
  %.064 = phi i32 [ 0, %1 ], [ %.148, %40 ]
  %.02463 = phi i32 [ 0, %1 ], [ %.226.ph, %40 ]
  %.02762 = phi i1 [ false, %1 ], [ %.12852, %40 ]
  %6 = getelementptr inbounds [58 x %struct.anon], ptr @_ZL8TOKENMAP, i64 0, i64 %indvars.iv
  %7 = getelementptr inbounds i8, ptr %6, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = load i8, ptr %6, align 8, !tbaa !11
  %10 = zext i8 %9 to i32
  %.not = icmp ult i32 %.064, %10
  br i1 %.not, label %11, label %42

11:                                               ; preds = %5
  %12 = zext nneg i32 %.064 to i64
  %13 = getelementptr inbounds i8, ptr %8, i64 %12
  %14 = load i8, ptr %13, align 1, !tbaa !12
  %15 = sext i8 %14 to i32
  %16 = load i32, ptr %2, align 4, !tbaa !13
  %17 = icmp ult i32 %16, %15
  br i1 %17, label %42, label %.preheader

.preheader:                                       ; preds = %11
  %.not3657 = icmp eq i8 %14, 0
  br i1 %.not3657, label %.critedge.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %18 = call noundef zeroext i1 @_ZN9CodepointeqEc(ptr noundef nonnull align 4 dereferenceable(4) %2, i8 noundef signext %14)
  br i1 %18, label %.lr.ph91, label %.critedge

.lr.ph:                                           ; preds = %31
  %19 = call noundef zeroext i1 @_ZN9CodepointeqEc(ptr noundef nonnull align 4 dereferenceable(4) %2, i8 noundef signext %35)
  br i1 %19, label %.lr.ph91, label %.critedge, !llvm.loop !15

.lr.ph91:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %.1285890 = phi i1 [ %.229, %.lr.ph ], [ %.02762, %.lr.ph.preheader ]
  %.15989 = phi i32 [ %32, %.lr.ph ], [ %.064, %.lr.ph.preheader ]
  %20 = invoke i32 @_ZN5Lexer4getcEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
          to label %21 unwind label %22

21:                                               ; preds = %.lr.ph91
  store i32 %20, ptr %2, align 4, !tbaa !17
  br label %31

22:                                               ; preds = %.lr.ph91
  %23 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN5Lexer9EndOfFileE
  %24 = extractvalue { ptr, i32 } %23, 1
  %25 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTIN5Lexer9EndOfFileE) #4
  %26 = icmp eq i32 %24, %25
  br i1 %26, label %27, label %41

27:                                               ; preds = %22
  %28 = extractvalue { ptr, i32 } %23, 0
  %29 = call ptr @__cxa_begin_catch(ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @_ZN9CodepointC2Ej(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef 0)
  %30 = load i32, ptr %3, align 4, !tbaa !17
  store i32 %30, ptr %2, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @__cxa_end_catch()
  br label %31

31:                                               ; preds = %27, %21
  %.229 = phi i1 [ %.1285890, %21 ], [ true, %27 ]
  %32 = add i32 %.15989, 1
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds i8, ptr %8, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !12
  %.not36 = icmp eq i8 %35, 0
  br i1 %.not36, label %.critedge.thread, label %.lr.ph, !llvm.loop !15

.critedge:                                        ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa85 = phi i64 [ %12, %.lr.ph.preheader ], [ %33, %.lr.ph ]
  %.159.lcssa = phi i32 [ %.064, %.lr.ph.preheader ], [ %32, %.lr.ph ]
  %.12858.lcssa = phi i1 [ %.02762, %.lr.ph.preheader ], [ %.229, %.lr.ph ]
  %36 = getelementptr inbounds i8, ptr %8, i64 %.lcssa85
  %.pr = load i8, ptr %36, align 1, !tbaa !12
  %37 = icmp eq i8 %.pr, 0
  br i1 %37, label %.critedge.thread, label %40

.critedge.thread:                                 ; preds = %31, %.preheader, %.critedge
  %.12853 = phi i1 [ %.12858.lcssa, %.critedge ], [ %.02762, %.preheader ], [ %.229, %31 ]
  %.149 = phi i32 [ %.159.lcssa, %.critedge ], [ %.064, %.preheader ], [ %32, %31 ]
  %38 = getelementptr inbounds i8, ptr %6, i64 16
  %39 = load i32, ptr %38, align 8, !tbaa !18
  br label %40

40:                                               ; preds = %.critedge.thread, %.critedge
  %.12852 = phi i1 [ %.12858.lcssa, %.critedge ], [ %.12853, %.critedge.thread ]
  %.148 = phi i32 [ %.159.lcssa, %.critedge ], [ %.149, %.critedge.thread ]
  %.226.ph = phi i32 [ %.02463, %.critedge ], [ %39, %.critedge.thread ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 58
  br i1 %exitcond.not, label %42, label %5, !llvm.loop !19

41:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  resume { ptr, i32 } %23

42:                                               ; preds = %11, %5, %40
  %.027.lcssa = phi i1 [ %.02762, %11 ], [ %.02762, %5 ], [ %.12852, %40 ]
  %.024.lcssa = phi i32 [ %.02463, %11 ], [ %.02463, %5 ], [ %.226.ph, %40 ]
  br i1 %.027.lcssa, label %44, label %43

43:                                               ; preds = %42
  call void @_ZN5Lexer6ungetcEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  br label %44

44:                                               ; preds = %43, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  ret i32 %.024.lcssa
}

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN5Lexer4getcEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9CodepointeqEc(ptr noundef nonnull align 4 dereferenceable(4), i8 noundef signext) local_unnamed_addr #2 align 2

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #3

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Lexer6ungetcEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nofree nosync nounwind memory(none) }
attributes #4 = { 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, !9, i64 8}
!6 = !{!"_ZTS3$_0", !7, i64 0, !9, i64 8, !10, i64 16}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTS9Codepoint", !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!10, !10, i64 0}
!18 = !{!6, !10, i64 16}
!19 = distinct !{!19, !16}


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