; LLVM IR from ponylang/ponyc :: src/libponyc/ast (parserapi)

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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.parse_token_set = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@stderr = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [16 x i8], align 1

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #0

declare i64 @token_line_number(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @default_builder(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @parse_token_set(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i1 noundef zeroext %5, ptr noundef %6) #1 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i8, align 1
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i8, align 1
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  %22 = zext i1 %5 to i8
  store i8 %22, ptr %14, align 1, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !5
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %26

25:                                               ; preds = %7
  br label %27

26:                                               ; preds = %7
  call void @ponyint_assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i64 noundef 410, ptr noundef @__func__.parse_token_set)
  br label %27

27:                                               ; preds = %26, %25
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  br label %32

31:                                               ; preds = %27
  call void @ponyint_assert_fail(ptr noundef @.str, ptr noundef @.str.1, i64 noundef 411, ptr noundef @__func__.parse_token_set)
  br label %32

32:                                               ; preds = %31, %30
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %36

35:                                               ; preds = %32
  br label %37

36:                                               ; preds = %32
  call void @ponyint_assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i64 noundef 412, ptr noundef @__func__.parse_token_set)
  br label %37

37:                                               ; preds = %36, %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = call i32 @current_token_id(ptr noundef %38)
  store i32 %39, ptr %16, align 4, !tbaa !11
  %40 = load i32, ptr %16, align 4, !tbaa !11
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %46

42:                                               ; preds = %37
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = call ptr @propogate_error(ptr noundef %43, ptr noundef %44)
  store ptr %45, ptr %8, align 8
  store i32 1, ptr %17, align 4
  br label %191

46:                                               ; preds = %37
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = icmp eq ptr %47, null
  br i1 %48, label %49, label %54

49:                                               ; preds = %46
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = getelementptr inbounds i32, ptr %50, i64 0
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = call ptr @token_id_desc(i32 noundef %52)
  store ptr %53, ptr %11, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %49, %46
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.parser_t, ptr %55, i32 0, i32 9
  %57 = load i8, ptr %56, align 8, !tbaa !13, !range !15, !noundef !16
  %58 = trunc i8 %57 to i1
  br i1 %58, label %59, label %82

59:                                               ; preds = %54
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.rule_state_t, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !17
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.rule_state_t, ptr %64, i32 0, i32 5
  %66 = load i32, ptr %65, align 8, !tbaa !20
  %67 = icmp eq i32 %66, 1
  %68 = zext i1 %67 to i64
  %69 = select i1 %67, ptr @.str.7, ptr @.str.8
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = getelementptr inbounds i32, ptr %70, i64 1
  %72 = load i32, ptr %71, align 4, !tbaa !11
  %73 = icmp eq i32 %72, 2
  %74 = zext i1 %73 to i64
  %75 = select i1 %73, ptr @.str.9, ptr @.str.10
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.parser_t, ptr %77, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = call ptr @token_print(ptr noundef %79)
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.6, ptr noundef %63, ptr noundef %69, ptr noundef %75, ptr noundef %76, ptr noundef %80) #4
  br label %82

82:                                               ; preds = %59, %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %83, ptr %18, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %171, %82
  %85 = load ptr, ptr %18, align 8, !tbaa !5
  %86 = load i32, ptr %85, align 4, !tbaa !11
  %87 = icmp ne i32 %86, 2
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 2, ptr %17, align 4
  br label %174

89:                                               ; preds = %84
  %90 = load ptr, ptr %18, align 8, !tbaa !5
  %91 = load i32, ptr %90, align 4, !tbaa !11
  %92 = icmp eq i32 %91, 207
  br i1 %92, label %93, label %135

93:                                               ; preds = %89
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.parser_t, ptr %94, i32 0, i32 2
  %96 = load ptr, ptr %95, align 8, !tbaa !21
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %99

98:                                               ; preds = %93
  br label %100

99:                                               ; preds = %93
  call void @ponyint_assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i64 noundef 436, ptr noundef @__func__.parse_token_set)
  br label %100

100:                                              ; preds = %99, %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.parser_t, ptr %101, i32 0, i32 3
  %103 = load ptr, ptr %102, align 8, !tbaa !22
  %104 = call i64 @token_line_number(ptr noundef %103)
  store i64 %104, ptr %19, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.parser_t, ptr %105, i32 0, i32 2
  %107 = load ptr, ptr %106, align 8, !tbaa !21
  %108 = call i64 @token_line_number(ptr noundef %107)
  store i64 %108, ptr %20, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #4
  %109 = load i64, ptr %20, align 8, !tbaa !23
  %110 = load i64, ptr %19, align 8, !tbaa !23
  %111 = icmp ne i64 %109, %110
  %112 = zext i1 %111 to i8
  store i8 %112, ptr %21, align 1, !tbaa !9
  %113 = load ptr, ptr %15, align 8, !tbaa !5
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %120

115:                                              ; preds = %100
  %116 = load i8, ptr %21, align 1, !tbaa !9, !range !15, !noundef !16
  %117 = trunc i8 %116 to i1
  %118 = load ptr, ptr %15, align 8, !tbaa !5
  %119 = zext i1 %117 to i8
  store i8 %119, ptr %118, align 1, !tbaa !9
  br label %120

120:                                              ; preds = %115, %100
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.parser_t, ptr %121, i32 0, i32 9
  %123 = load i8, ptr %122, align 8, !tbaa !13, !range !15, !noundef !16
  %124 = trunc i8 %123 to i1
  br i1 %124, label %125, label %132

125:                                              ; preds = %120
  %126 = load ptr, ptr @stderr, align 8, !tbaa !5
  %127 = load i8, ptr %21, align 1, !tbaa !9, !range !15, !noundef !16
  %128 = trunc i8 %127 to i1
  %129 = zext i1 %128 to i64
  %130 = select i1 %128, ptr @.str.9, ptr @.str.13
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef @.str.12, ptr noundef %130) #4
  br label %132

132:                                              ; preds = %125, %120
  %133 = load ptr, ptr %10, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.rule_state_t, ptr %133, i32 0, i32 5
  store i32 1, ptr %134, align 8, !tbaa !20
  store ptr inttoptr (i64 1 to ptr), ptr %8, align 8
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %174

135:                                              ; preds = %89
  %136 = load i32, ptr %16, align 4, !tbaa !11
  %137 = load ptr, ptr %18, align 8, !tbaa !5
  %138 = load i32, ptr %137, align 4, !tbaa !11
  %139 = icmp eq i32 %136, %138
  br i1 %139, label %140, label %170

140:                                              ; preds = %135
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.parser_t, ptr %141, i32 0, i32 9
  %143 = load i8, ptr %142, align 8, !tbaa !13, !range !15, !noundef !16
  %144 = trunc i8 %143 to i1
  br i1 %144, label %145, label %148

145:                                              ; preds = %140
  %146 = load ptr, ptr @stderr, align 8, !tbaa !5
  %147 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef @.str.14) #4
  br label %148

148:                                              ; preds = %145, %140
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.parser_t, ptr %149, i32 0, i32 2
  %151 = load ptr, ptr %150, align 8, !tbaa !21
  %152 = call ptr @token_print(ptr noundef %151)
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.parser_t, ptr %153, i32 0, i32 4
  store ptr %152, ptr %154, align 8, !tbaa !24
  %155 = load i8, ptr %14, align 1, !tbaa !9, !range !15, !noundef !16
  %156 = trunc i8 %155 to i1
  br i1 %156, label %157, label %164

157:                                              ; preds = %148
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = call ptr @consume_token(ptr noundef %160)
  %162 = load ptr, ptr %15, align 8, !tbaa !5
  %163 = call ptr @handle_found(ptr noundef %158, ptr noundef %159, ptr noundef %161, ptr noundef @default_builder, ptr noundef %162)
  store ptr %163, ptr %8, align 8
  store i32 1, ptr %17, align 4
  br label %174

164:                                              ; preds = %148
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  call void @consume_token_no_ast(ptr noundef %165)
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = load ptr, ptr %10, align 8, !tbaa !5
  %168 = load ptr, ptr %15, align 8, !tbaa !5
  %169 = call ptr @handle_found(ptr noundef %166, ptr noundef %167, ptr noundef null, ptr noundef null, ptr noundef %168)
  store ptr %169, ptr %8, align 8
  store i32 1, ptr %17, align 4
  br label %174

170:                                              ; preds = %135
  br label %171

171:                                              ; preds = %170
  %172 = load ptr, ptr %18, align 8, !tbaa !5
  %173 = getelementptr inbounds i32, ptr %172, i32 1
  store ptr %173, ptr %18, align 8, !tbaa !5
  br label %84, !llvm.loop !25

174:                                              ; preds = %164, %157, %132, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  %175 = load i32, ptr %17, align 4
  switch i32 %175, label %191 [
    i32 2, label %176
  ]

176:                                              ; preds = %174
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.parser_t, ptr %177, i32 0, i32 9
  %179 = load i8, ptr %178, align 8, !tbaa !13, !range !15, !noundef !16
  %180 = trunc i8 %179 to i1
  br i1 %180, label %181, label %184

181:                                              ; preds = %176
  %182 = load ptr, ptr @stderr, align 8, !tbaa !5
  %183 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %182, ptr noundef @.str.15) #4
  br label %184

184:                                              ; preds = %181, %176
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = load ptr, ptr %10, align 8, !tbaa !5
  %187 = load ptr, ptr %11, align 8, !tbaa !5
  %188 = load ptr, ptr %12, align 8, !tbaa !5
  %189 = load ptr, ptr %15, align 8, !tbaa !5
  %190 = call ptr @handle_not_found(ptr noundef %185, ptr noundef %186, ptr noundef %187, ptr noundef %188, ptr noundef %189)
  store ptr %190, ptr %8, align 8
  store i32 1, ptr %17, align 4
  br label %191

191:                                              ; preds = %184, %174, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %192 = load ptr, ptr %8, align 8
  ret ptr %192
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @current_token_id(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @propogate_error(ptr noundef, ptr noundef) #1

declare ptr @token_id_desc(i32 noundef) #0

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

declare ptr @token_print(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare hidden ptr @handle_found(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @consume_token(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @consume_token_no_ast(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @handle_not_found(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

attributes #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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 56}
!14 = !{!"parser_t", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !10, i64 44, !10, i64 45, !6, i64 48, !10, i64 56}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !6, i64 0}
!18 = !{!"rule_state_t", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !10, i64 44, !10, i64 45, !10, i64 46, !12, i64 48, !19, i64 56, !19, i64 64}
!19 = !{!"long", !7, i64 0}
!20 = !{!18, !12, i64 40}
!21 = !{!14, !6, i64 16}
!22 = !{!14, !6, i64 24}
!23 = !{!19, !19, i64 0}
!24 = !{!14, !6, i64 32}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.parse_token_set = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [16 x i8], align 1

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

declare i64 @token_line_number(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @default_builder(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @parse_token_set(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef readonly %4, i1 noundef zeroext %5, ptr noundef %6) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %8, label %9

8:                                                ; preds = %7
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i64 noundef 410, ptr noundef nonnull @__func__.parse_token_set) #3
  br label %9

9:                                                ; preds = %7, %8
  %.not58 = icmp eq ptr %1, null
  br i1 %.not58, label %10, label %11

10:                                               ; preds = %9
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 411, ptr noundef nonnull @__func__.parse_token_set) #3
  br label %11

11:                                               ; preds = %9, %10
  %.not59 = icmp eq ptr %4, null
  br i1 %.not59, label %12, label %13

12:                                               ; preds = %11
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i64 noundef 412, ptr noundef nonnull @__func__.parse_token_set) #3
  br label %13

13:                                               ; preds = %11, %12
  %14 = tail call i32 @current_token_id(ptr noundef %0)
  %15 = icmp eq i32 %14, 1
  br i1 %15, label %16, label %18

16:                                               ; preds = %13
  %17 = tail call ptr @propogate_error(ptr noundef %0, ptr noundef %1)
  br label %.thread

18:                                               ; preds = %13
  %19 = icmp eq ptr %2, null
  br i1 %19, label %20, label %23

20:                                               ; preds = %18
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = tail call ptr @token_id_desc(i32 noundef %21) #3
  br label %23

23:                                               ; preds = %20, %18
  %.051 = phi ptr [ %22, %20 ], [ %2, %18 ]
  %24 = getelementptr inbounds i8, ptr %0, i64 56
  %25 = load i8, ptr %24, align 8, !tbaa !9, !range !13, !noundef !14
  %26 = trunc nuw i8 %25 to i1
  br i1 %26, label %27, label %.preheader

27:                                               ; preds = %23
  %28 = load ptr, ptr @stderr, align 8, !tbaa !15
  %29 = load ptr, ptr %1, align 8, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %1, i64 40
  %31 = load i32, ptr %30, align 8, !tbaa !19
  %32 = icmp eq i32 %31, 1
  %33 = select i1 %32, ptr @.str.7, ptr @.str.8
  %34 = getelementptr inbounds i8, ptr %4, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = icmp eq i32 %35, 2
  %37 = select i1 %36, ptr @.str.9, ptr @.str.10
  %38 = getelementptr inbounds i8, ptr %0, i64 16
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  %40 = tail call ptr @token_print(ptr noundef %39) #3
  %41 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str.6, ptr noundef %29, ptr noundef nonnull %33, ptr noundef nonnull %37, ptr noundef %.051, ptr noundef %40) #4
  br label %.preheader

.preheader:                                       ; preds = %27, %23
  br label %42

42:                                               ; preds = %.preheader, %66
  %.053 = phi ptr [ %68, %66 ], [ %4, %.preheader ]
  %43 = load i32, ptr %.053, align 4, !tbaa !5
  switch i32 %43, label %66 [
    i32 2, label %85
    i32 207, label %44
  ]

44:                                               ; preds = %42
  %45 = getelementptr inbounds i8, ptr %0, i64 16
  %46 = load ptr, ptr %45, align 8, !tbaa !20
  %.not61 = icmp eq ptr %46, null
  br i1 %.not61, label %47, label %48

47:                                               ; preds = %44
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i64 noundef 436, ptr noundef nonnull @__func__.parse_token_set) #3
  br label %48

48:                                               ; preds = %44, %47
  %49 = getelementptr inbounds i8, ptr %0, i64 24
  %50 = load ptr, ptr %49, align 8, !tbaa !21
  %51 = tail call i64 @token_line_number(ptr noundef %50) #3
  %52 = load ptr, ptr %45, align 8, !tbaa !20
  %53 = tail call i64 @token_line_number(ptr noundef %52) #3
  %54 = icmp ne i64 %53, %51
  %.not62 = icmp eq ptr %6, null
  br i1 %.not62, label %57, label %55

55:                                               ; preds = %48
  %56 = zext i1 %54 to i8
  store i8 %56, ptr %6, align 1, !tbaa !22
  br label %57

57:                                               ; preds = %55, %48
  %58 = load i8, ptr %24, align 8, !tbaa !9, !range !13, !noundef !14
  %59 = trunc nuw i8 %58 to i1
  br i1 %59, label %60, label %64

60:                                               ; preds = %57
  %61 = load ptr, ptr @stderr, align 8, !tbaa !15
  %62 = select i1 %54, ptr @.str.9, ptr @.str.13
  %63 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.12, ptr noundef nonnull %62) #4
  br label %64

64:                                               ; preds = %60, %57
  %65 = getelementptr inbounds i8, ptr %1, i64 40
  store i32 1, ptr %65, align 8, !tbaa !19
  br label %.thread

66:                                               ; preds = %42
  %67 = icmp eq i32 %14, %43
  %68 = getelementptr inbounds i8, ptr %.053, i64 4
  br i1 %67, label %69, label %42, !llvm.loop !23

69:                                               ; preds = %66
  %70 = load i8, ptr %24, align 8, !tbaa !9, !range !13, !noundef !14
  %71 = trunc nuw i8 %70 to i1
  br i1 %71, label %72, label %75

72:                                               ; preds = %69
  %73 = load ptr, ptr @stderr, align 8, !tbaa !15
  %74 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef nonnull @.str.14) #4
  br label %75

75:                                               ; preds = %72, %69
  %76 = getelementptr inbounds i8, ptr %0, i64 16
  %77 = load ptr, ptr %76, align 8, !tbaa !20
  %78 = tail call ptr @token_print(ptr noundef %77) #3
  %79 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %78, ptr %79, align 8, !tbaa !25
  br i1 %5, label %80, label %83

80:                                               ; preds = %75
  %81 = tail call ptr @consume_token(ptr noundef nonnull %0)
  %82 = tail call ptr @handle_found(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %81, ptr noundef nonnull @default_builder, ptr noundef %6)
  br label %.thread

83:                                               ; preds = %75
  tail call void @consume_token_no_ast(ptr noundef nonnull %0)
  %84 = tail call ptr @handle_found(ptr noundef nonnull %0, ptr noundef %1, ptr noundef null, ptr noundef null, ptr noundef %6)
  br label %.thread

85:                                               ; preds = %42
  %86 = load i8, ptr %24, align 8, !tbaa !9, !range !13, !noundef !14
  %87 = trunc nuw i8 %86 to i1
  br i1 %87, label %88, label %91

88:                                               ; preds = %85
  %89 = load ptr, ptr @stderr, align 8, !tbaa !15
  %90 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.15) #4
  br label %91

91:                                               ; preds = %88, %85
  %92 = tail call ptr @handle_not_found(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %.051, ptr noundef %3, ptr noundef %6)
  br label %.thread

.thread:                                          ; preds = %64, %80, %83, %91, %16
  %.1 = phi ptr [ %17, %16 ], [ %92, %91 ], [ %84, %83 ], [ %82, %80 ], [ inttoptr (i64 1 to ptr), %64 ]
  ret ptr %.1
}

; Function Attrs: nounwind uwtable
declare hidden i32 @current_token_id(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @propogate_error(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @token_id_desc(i32 noundef) local_unnamed_addr #0

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

declare ptr @token_print(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @handle_found(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @consume_token(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @consume_token_no_ast(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @handle_not_found(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #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 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 = { 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 #3 = { nounwind }
attributes #4 = { 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 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 56}
!10 = !{!"parser_t", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !6, i64 40, !12, i64 44, !12, i64 45, !11, i64 48, !12, i64 56}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !11, i64 0}
!17 = !{!"rule_state_t", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !6, i64 40, !12, i64 44, !12, i64 45, !12, i64 46, !6, i64 48, !18, i64 56, !18, i64 64}
!18 = !{!"long", !7, i64 0}
!19 = !{!17, !6, i64 40}
!20 = !{!10, !11, i64 16}
!21 = !{!10, !11, i64 24}
!22 = !{!12, !12, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!10, !11, i64 32}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass