; LLVM IR from buzz-lang/Buzz :: src/buzz (buzzparser)

; 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.idrefinfo_s = type { i32, i32 }
%struct.buzzparser_s = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.buzztok_s = type { i32, ptr, i64, i64, ptr }
%struct.buzzdarray_s = type { ptr, i64, i32, i32, ptr }
%struct.buzzlex_file_s = type { i64, i64, i64, i64, ptr, ptr }

@stderr = external global ptr, align 8
@buzztok_desc = external global [0 x ptr], align 8
@PARSE_ERROR = external hidden global i32, align 4
@PARSE_OK = external hidden global i32, align 4
@.str.75 = external hidden unnamed_addr constant [53 x i8], align 1

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

declare ptr @buzzlex_nexttok(ptr noundef) #2

declare void @buzzlex_destroytok(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse_idref(ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @parse_idreflist(ptr noundef %0) #3 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %struct.idrefinfo_s, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  br label %6

6:                                                ; preds = %29, %1
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.buzzparser_s, ptr %7, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %8)
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.buzzparser_s, ptr %9, i32 0, i32 3
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = call ptr @buzzlex_nexttok(ptr noundef %11)
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.buzzparser_s, ptr %13, i32 0, i32 4
  store ptr %12, ptr %14, align 8, !tbaa !12
  br label %15

15:                                               ; preds = %6
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.buzzparser_s, ptr %16, i32 0, i32 4
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  %19 = getelementptr inbounds %struct.buzztok_s, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !13
  %21 = icmp ne i32 %20, 31
  br i1 %21, label %22, label %29

22:                                               ; preds = %15
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.buzzparser_s, ptr %23, i32 0, i32 4
  %25 = load ptr, ptr %24, align 8, !tbaa !12
  %26 = getelementptr inbounds %struct.buzztok_s, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 8, !tbaa !13
  %28 = icmp eq i32 %27, 26
  br label %29

29:                                               ; preds = %22, %15
  %30 = phi i1 [ false, %15 ], [ %28, %22 ]
  br i1 %30, label %6, label %31, !llvm.loop !16

31:                                               ; preds = %29
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.buzzparser_s, ptr %32, i32 0, i32 4
  %34 = load ptr, ptr %33, align 8, !tbaa !12
  %35 = getelementptr inbounds %struct.buzztok_s, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 8, !tbaa !13
  %37 = icmp eq i32 %36, 23
  br i1 %37, label %38, label %40

38:                                               ; preds = %31
  %39 = load i32, ptr @PARSE_OK, align 4, !tbaa !18
  store i32 %39, ptr %2, align 4
  br label %191

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = call i32 @parse_idref(ptr noundef %41, i32 noundef 0, ptr noundef %4)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %46, label %44

44:                                               ; preds = %40
  %45 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !18
  store i32 %45, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %190

46:                                               ; preds = %40
  br label %47

47:                                               ; preds = %70, %46
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.buzzparser_s, ptr %48, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %49)
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.buzzparser_s, ptr %50, i32 0, i32 3
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = call ptr @buzzlex_nexttok(ptr noundef %52)
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.buzzparser_s, ptr %54, i32 0, i32 4
  store ptr %53, ptr %55, align 8, !tbaa !12
  br label %56

56:                                               ; preds = %47
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.buzzparser_s, ptr %57, i32 0, i32 4
  %59 = load ptr, ptr %58, align 8, !tbaa !12
  %60 = getelementptr inbounds %struct.buzztok_s, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !13
  %62 = icmp ne i32 %61, 31
  br i1 %62, label %63, label %70

63:                                               ; preds = %56
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.buzzparser_s, ptr %64, i32 0, i32 4
  %66 = load ptr, ptr %65, align 8, !tbaa !12
  %67 = getelementptr inbounds %struct.buzztok_s, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !13
  %69 = icmp eq i32 %68, 26
  br label %70

70:                                               ; preds = %63, %56
  %71 = phi i1 [ false, %56 ], [ %69, %63 ]
  br i1 %71, label %47, label %72, !llvm.loop !19

72:                                               ; preds = %70
  br label %73

73:                                               ; preds = %138, %72
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.buzzparser_s, ptr %74, i32 0, i32 4
  %76 = load ptr, ptr %75, align 8, !tbaa !12
  %77 = getelementptr inbounds %struct.buzztok_s, ptr %76, i32 0, i32 0
  %78 = load i32, ptr %77, align 8, !tbaa !13
  %79 = icmp eq i32 %78, 27
  br i1 %79, label %80, label %139

80:                                               ; preds = %73
  br label %81

81:                                               ; preds = %104, %80
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.buzzparser_s, ptr %82, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %83)
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.buzzparser_s, ptr %84, i32 0, i32 3
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  %87 = call ptr @buzzlex_nexttok(ptr noundef %86)
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.buzzparser_s, ptr %88, i32 0, i32 4
  store ptr %87, ptr %89, align 8, !tbaa !12
  br label %90

90:                                               ; preds = %81
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.buzzparser_s, ptr %91, i32 0, i32 4
  %93 = load ptr, ptr %92, align 8, !tbaa !12
  %94 = getelementptr inbounds %struct.buzztok_s, ptr %93, i32 0, i32 0
  %95 = load i32, ptr %94, align 8, !tbaa !13
  %96 = icmp ne i32 %95, 31
  br i1 %96, label %97, label %104

97:                                               ; preds = %90
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.buzzparser_s, ptr %98, i32 0, i32 4
  %100 = load ptr, ptr %99, align 8, !tbaa !12
  %101 = getelementptr inbounds %struct.buzztok_s, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 8, !tbaa !13
  %103 = icmp eq i32 %102, 26
  br label %104

104:                                              ; preds = %97, %90
  %105 = phi i1 [ false, %90 ], [ %103, %97 ]
  br i1 %105, label %81, label %106, !llvm.loop !20

106:                                              ; preds = %104
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = call i32 @parse_idref(ptr noundef %107, i32 noundef 0, ptr noundef %4)
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %112, label %110

110:                                              ; preds = %106
  %111 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !18
  store i32 %111, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %190

112:                                              ; preds = %106
  br label %113

113:                                              ; preds = %136, %112
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.buzzparser_s, ptr %114, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %115)
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.buzzparser_s, ptr %116, i32 0, i32 3
  %118 = load ptr, ptr %117, align 8, !tbaa !9
  %119 = call ptr @buzzlex_nexttok(ptr noundef %118)
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.buzzparser_s, ptr %120, i32 0, i32 4
  store ptr %119, ptr %121, align 8, !tbaa !12
  br label %122

122:                                              ; preds = %113
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.buzzparser_s, ptr %123, i32 0, i32 4
  %125 = load ptr, ptr %124, align 8, !tbaa !12
  %126 = getelementptr inbounds %struct.buzztok_s, ptr %125, i32 0, i32 0
  %127 = load i32, ptr %126, align 8, !tbaa !13
  %128 = icmp ne i32 %127, 31
  br i1 %128, label %129, label %136

129:                                              ; preds = %122
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.buzzparser_s, ptr %130, i32 0, i32 4
  %132 = load ptr, ptr %131, align 8, !tbaa !12
  %133 = getelementptr inbounds %struct.buzztok_s, ptr %132, i32 0, i32 0
  %134 = load i32, ptr %133, align 8, !tbaa !13
  %135 = icmp eq i32 %134, 26
  br label %136

136:                                              ; preds = %129, %122
  %137 = phi i1 [ false, %122 ], [ %135, %129 ]
  br i1 %137, label %113, label %138, !llvm.loop !21

138:                                              ; preds = %136
  br label %73, !llvm.loop !22

139:                                              ; preds = %73
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.buzzparser_s, ptr %140, i32 0, i32 4
  %142 = load ptr, ptr %141, align 8, !tbaa !12
  %143 = icmp ne ptr %142, null
  br i1 %143, label %144, label %153

144:                                              ; preds = %139
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.buzzparser_s, ptr %145, i32 0, i32 4
  %147 = load ptr, ptr %146, align 8, !tbaa !12
  %148 = getelementptr inbounds %struct.buzztok_s, ptr %147, i32 0, i32 0
  %149 = load i32, ptr %148, align 8, !tbaa !13
  %150 = icmp eq i32 %149, 23
  br i1 %150, label %151, label %153

151:                                              ; preds = %144
  %152 = load i32, ptr @PARSE_OK, align 4, !tbaa !18
  store i32 %152, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %190

153:                                              ; preds = %144, %139
  %154 = load ptr, ptr @stderr, align 8, !tbaa !5
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.buzzparser_s, ptr %155, i32 0, i32 3
  %157 = load ptr, ptr %156, align 8, !tbaa !9
  %158 = getelementptr inbounds %struct.buzzdarray_s, ptr %157, i32 0, i32 0
  %159 = load ptr, ptr %158, align 8, !tbaa !23
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.buzzparser_s, ptr %160, i32 0, i32 3
  %162 = load ptr, ptr %161, align 8, !tbaa !9
  %163 = getelementptr inbounds %struct.buzzdarray_s, ptr %162, i32 0, i32 1
  %164 = load i64, ptr %163, align 8, !tbaa !25
  %165 = sub nsw i64 %164, 1
  %166 = getelementptr inbounds ptr, ptr %159, i64 %165
  %167 = load ptr, ptr %166, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.buzzlex_file_s, ptr %167, i32 0, i32 5
  %169 = load ptr, ptr %168, align 8, !tbaa !26
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.buzzparser_s, ptr %170, i32 0, i32 4
  %172 = load ptr, ptr %171, align 8, !tbaa !12
  %173 = getelementptr inbounds %struct.buzztok_s, ptr %172, i32 0, i32 2
  %174 = load i64, ptr %173, align 8, !tbaa !28
  %175 = load ptr, ptr %3, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.buzzparser_s, ptr %175, i32 0, i32 4
  %177 = load ptr, ptr %176, align 8, !tbaa !12
  %178 = getelementptr inbounds %struct.buzztok_s, ptr %177, i32 0, i32 3
  %179 = load i64, ptr %178, align 8, !tbaa !29
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.buzzparser_s, ptr %180, i32 0, i32 4
  %182 = load ptr, ptr %181, align 8, !tbaa !12
  %183 = getelementptr inbounds %struct.buzztok_s, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %183, align 8, !tbaa !13
  %185 = zext i32 %184 to i64
  %186 = getelementptr inbounds [0 x ptr], ptr @buzztok_desc, i64 0, i64 %185
  %187 = load ptr, ptr %186, align 8, !tbaa !5
  %188 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %154, ptr noundef @.str.75, ptr noundef %169, i64 noundef %174, i64 noundef %179, ptr noundef %187) #4
  %189 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !18
  store i32 %189, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %190

190:                                              ; preds = %153, %151, %110, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %191

191:                                              ; preds = %190, %38
  %192 = load i32, ptr %2, align 4
  ret i32 %192
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 }

!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, !6, i64 24}
!10 = !{!"buzzparser_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !11, i64 80}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 32}
!13 = !{!14, !11, i64 0}
!14 = !{!"buzztok_s", !11, i64 0, !6, i64 8, !15, i64 16, !15, i64 24, !6, i64 32}
!15 = !{!"long", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!11, !11, i64 0}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
!23 = !{!24, !6, i64 0}
!24 = !{!"buzzdarray_s", !6, i64 0, !15, i64 8, !11, i64 16, !11, i64 20, !6, i64 24}
!25 = !{!24, !15, i64 8}
!26 = !{!27, !6, i64 40}
!27 = !{!"buzzlex_file_s", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !6, i64 32, !6, i64 40}
!28 = !{!14, !15, i64 16}
!29 = !{!14, !15, i64 24}


; 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.idrefinfo_s = type { i32, i32 }

@stderr = external local_unnamed_addr global ptr, align 8
@buzztok_desc = external local_unnamed_addr global [0 x ptr], align 8
@PARSE_ERROR = external hidden local_unnamed_addr global i32, align 4
@PARSE_OK = external hidden local_unnamed_addr global i32, align 4
@.str.75 = external hidden unnamed_addr constant [53 x i8], align 1

; 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare ptr @buzzlex_nexttok(ptr noundef) local_unnamed_addr #2

declare void @buzzlex_destroytok(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse_idref(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i32 @parse_idreflist(ptr noundef %0) local_unnamed_addr #3 {
  %2 = alloca %struct.idrefinfo_s, align 4
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  br label %5

5:                                                ; preds = %5, %1
  tail call void @buzzlex_destroytok(ptr noundef nonnull %3) #4
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = tail call ptr @buzzlex_nexttok(ptr noundef %6) #4
  store ptr %7, ptr %3, align 8, !tbaa !11
  %8 = load i32, ptr %7, align 8, !tbaa !12
  switch i32 %8, label %11 [
    i32 26, label %5
    i32 23, label %9
  ]

9:                                                ; preds = %5
  %10 = load i32, ptr @PARSE_OK, align 4, !tbaa !15
  br label %44

11:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %12 = call i32 @parse_idref(ptr noundef nonnull %0, i32 noundef 0, ptr noundef nonnull %2)
  %.not42 = icmp eq i32 %12, 0
  br i1 %.not42, label %.loopexit, label %.preheader51

.preheader51:                                     ; preds = %11, %.preheader51
  call void @buzzlex_destroytok(ptr noundef nonnull %3) #4
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = call ptr @buzzlex_nexttok(ptr noundef %13) #4
  store ptr %14, ptr %3, align 8, !tbaa !11
  %15 = load i32, ptr %14, align 8, !tbaa !12
  %cond47 = icmp eq i32 %15, 26
  br i1 %cond47, label %.preheader51, label %.critedge2

.critedge2.loopexit:                              ; preds = %.preheader
  br label %.critedge2, !llvm.loop !16

.critedge2:                                       ; preds = %.preheader51, %.critedge2.loopexit
  %16 = phi i32 [ %24, %.critedge2.loopexit ], [ %15, %.preheader51 ]
  %17 = phi ptr [ %23, %.critedge2.loopexit ], [ %14, %.preheader51 ]
  switch i32 %16, label %25 [
    i32 27, label %.preheader50
    i32 23, label %.loopexit
  ]

.preheader50:                                     ; preds = %.critedge2, %.preheader50
  call void @buzzlex_destroytok(ptr noundef nonnull %3) #4
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call ptr @buzzlex_nexttok(ptr noundef %18) #4
  store ptr %19, ptr %3, align 8, !tbaa !11
  %20 = load i32, ptr %19, align 8, !tbaa !12
  %cond48 = icmp eq i32 %20, 26
  br i1 %cond48, label %.preheader50, label %.critedge4

.critedge4:                                       ; preds = %.preheader50
  %21 = call i32 @parse_idref(ptr noundef nonnull %0, i32 noundef 0, ptr noundef nonnull %2)
  %.not45 = icmp eq i32 %21, 0
  br i1 %.not45, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.critedge4, %.preheader
  call void @buzzlex_destroytok(ptr noundef nonnull %3) #4
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call ptr @buzzlex_nexttok(ptr noundef %22) #4
  store ptr %23, ptr %3, align 8, !tbaa !11
  %24 = load i32, ptr %23, align 8, !tbaa !12
  %cond49 = icmp eq i32 %24, 26
  br i1 %cond49, label %.preheader, label %.critedge2.loopexit, !llvm.loop !16

25:                                               ; preds = %.critedge2
  %26 = load ptr, ptr @stderr, align 8, !tbaa !18
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = getelementptr inbounds i8, ptr %27, i64 8
  %30 = load i64, ptr %29, align 8, !tbaa !21
  %31 = getelementptr ptr, ptr %28, i64 %30
  %32 = getelementptr i8, ptr %31, i64 -8
  %33 = load ptr, ptr %32, align 8, !tbaa !18
  %34 = getelementptr inbounds i8, ptr %33, i64 40
  %35 = load ptr, ptr %34, align 8, !tbaa !22
  %36 = getelementptr inbounds i8, ptr %17, i64 16
  %37 = load i64, ptr %36, align 8, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %17, i64 24
  %39 = load i64, ptr %38, align 8, !tbaa !25
  %40 = zext i32 %16 to i64
  %41 = getelementptr inbounds [0 x ptr], ptr @buzztok_desc, i64 0, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef nonnull @.str.75, ptr noundef %35, i64 noundef %37, i64 noundef %39, ptr noundef %42) #5
  br label %.loopexit

.loopexit:                                        ; preds = %.critedge2, %.critedge4, %11, %25
  %.0.in = phi ptr [ @PARSE_ERROR, %25 ], [ @PARSE_ERROR, %11 ], [ @PARSE_OK, %.critedge2 ], [ @PARSE_ERROR, %.critedge4 ]
  %.0 = load i32, ptr %.0.in, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  br label %44

44:                                               ; preds = %.loopexit, %9
  %.1 = phi i32 [ %10, %9 ], [ %.0, %.loopexit ]
  ret i32 %.1
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 }
attributes #5 = { 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, !7, i64 24}
!6 = !{!"buzzparser_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !10, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 32}
!12 = !{!13, !10, i64 0}
!13 = !{!"buzztok_s", !10, i64 0, !7, i64 8, !14, i64 16, !14, i64 24, !7, i64 32}
!14 = !{!"long", !8, i64 0}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !7, i64 0}
!20 = !{!"buzzdarray_s", !7, i64 0, !14, i64 8, !10, i64 16, !10, i64 20, !7, i64 24}
!21 = !{!20, !14, i64 8}
!22 = !{!23, !7, i64 40}
!23 = !{!"buzzlex_file_s", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !7, i64 32, !7, i64 40}
!24 = !{!13, !14, i64 16}
!25 = !{!13, !14, i64 24}


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