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

@PARSE_ERROR = external hidden global i32, align 4
@PARSE_OK = external hidden global i32, align 4
@.str.26 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [12 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 void @free(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @chunk_addcode(ptr noundef, ptr noundef, ptr noundef) #2

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

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

declare ptr @buzzlex_nexttok(ptr noundef) #3

declare void @buzzlex_destroytok(ptr noundef) #3

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

25:                                               ; preds = %1
  %26 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %26, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %171

27:                                               ; preds = %1
  br label %28

28:                                               ; preds = %51, %27
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.buzzparser_s, ptr %29, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %30)
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.buzzparser_s, ptr %31, i32 0, i32 3
  %33 = load ptr, ptr %32, align 8, !tbaa !13
  %34 = call ptr @buzzlex_nexttok(ptr noundef %33)
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.buzzparser_s, ptr %35, i32 0, i32 4
  store ptr %34, ptr %36, align 8, !tbaa !14
  br label %37

37:                                               ; preds = %28
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.buzzparser_s, ptr %38, i32 0, i32 4
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = getelementptr inbounds %struct.buzztok_s, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !15
  %43 = icmp ne i32 %42, 31
  br i1 %43, label %44, label %51

44:                                               ; preds = %37
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.buzzparser_s, ptr %45, i32 0, i32 4
  %47 = load ptr, ptr %46, align 8, !tbaa !14
  %48 = getelementptr inbounds %struct.buzztok_s, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !15
  %50 = icmp eq i32 %49, 26
  br label %51

51:                                               ; preds = %44, %37
  %52 = phi i1 [ false, %37 ], [ %50, %44 ]
  br i1 %52, label %28, label %53, !llvm.loop !18

53:                                               ; preds = %51
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = call i32 @match(ptr noundef %54, i32 noundef 22)
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %59, label %57

57:                                               ; preds = %53
  %58 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %58, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %171

59:                                               ; preds = %53
  br label %60

60:                                               ; preds = %83, %59
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.buzzparser_s, ptr %61, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %62)
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.buzzparser_s, ptr %63, i32 0, i32 3
  %65 = load ptr, ptr %64, align 8, !tbaa !13
  %66 = call ptr @buzzlex_nexttok(ptr noundef %65)
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.buzzparser_s, ptr %67, i32 0, i32 4
  store ptr %66, ptr %68, align 8, !tbaa !14
  br label %69

69:                                               ; preds = %60
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.buzzparser_s, ptr %70, i32 0, i32 4
  %72 = load ptr, ptr %71, align 8, !tbaa !14
  %73 = getelementptr inbounds %struct.buzztok_s, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 8, !tbaa !15
  %75 = icmp ne i32 %74, 31
  br i1 %75, label %76, label %83

76:                                               ; preds = %69
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.buzzparser_s, ptr %77, i32 0, i32 4
  %79 = load ptr, ptr %78, align 8, !tbaa !14
  %80 = getelementptr inbounds %struct.buzztok_s, ptr %79, i32 0, i32 0
  %81 = load i32, ptr %80, align 8, !tbaa !15
  %82 = icmp eq i32 %81, 26
  br label %83

83:                                               ; preds = %76, %69
  %84 = phi i1 [ false, %69 ], [ %82, %76 ]
  br i1 %84, label %60, label %85, !llvm.loop !20

85:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %86 = load i32, ptr %4, align 4, !tbaa !12
  %87 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %7, ptr noundef @.str.28, i32 noundef %86) #4
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.buzzparser_s, ptr %88, i32 0, i32 6
  %90 = load ptr, ptr %89, align 8, !tbaa !21
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.buzzparser_s, ptr %92, i32 0, i32 4
  %94 = load ptr, ptr %93, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %90, ptr noundef %91, ptr noundef %94)
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %95) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = call i32 @parse_condition(ptr noundef %96)
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %101, label %99

99:                                               ; preds = %85
  %100 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %100, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %171

101:                                              ; preds = %85
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = call i32 @match(ptr noundef %102, i32 noundef 23)
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %107, label %105

105:                                              ; preds = %101
  %106 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %106, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %171

107:                                              ; preds = %101
  br label %108

108:                                              ; preds = %131, %107
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.buzzparser_s, ptr %109, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %110)
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.buzzparser_s, ptr %111, i32 0, i32 3
  %113 = load ptr, ptr %112, align 8, !tbaa !13
  %114 = call ptr @buzzlex_nexttok(ptr noundef %113)
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.buzzparser_s, ptr %115, i32 0, i32 4
  store ptr %114, ptr %116, align 8, !tbaa !14
  br label %117

117:                                              ; preds = %108
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.buzzparser_s, ptr %118, i32 0, i32 4
  %120 = load ptr, ptr %119, align 8, !tbaa !14
  %121 = getelementptr inbounds %struct.buzztok_s, ptr %120, i32 0, i32 0
  %122 = load i32, ptr %121, align 8, !tbaa !15
  %123 = icmp ne i32 %122, 31
  br i1 %123, label %124, label %131

124:                                              ; preds = %117
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.buzzparser_s, ptr %125, i32 0, i32 4
  %127 = load ptr, ptr %126, align 8, !tbaa !14
  %128 = getelementptr inbounds %struct.buzztok_s, ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 8, !tbaa !15
  %130 = icmp eq i32 %129, 26
  br label %131

131:                                              ; preds = %124, %117
  %132 = phi i1 [ false, %117 ], [ %130, %124 ]
  br i1 %132, label %108, label %133, !llvm.loop !22

133:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %134 = load i32, ptr %5, align 4, !tbaa !12
  %135 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %8, ptr noundef @.str.26, i32 noundef %134) #4
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.buzzparser_s, ptr %136, i32 0, i32 6
  %138 = load ptr, ptr %137, align 8, !tbaa !21
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %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 !14
  call void @chunk_addcode(ptr noundef %138, ptr noundef %139, ptr noundef %142)
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %143) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = call i32 @parse_blockstat(ptr noundef %144)
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %149, label %147

147:                                              ; preds = %133
  %148 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %148, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %171

149:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %150 = load i32, ptr %4, align 4, !tbaa !12
  %151 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %9, ptr noundef @.str.27, i32 noundef %150) #4
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.buzzparser_s, ptr %152, i32 0, i32 6
  %154 = load ptr, ptr %153, align 8, !tbaa !21
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.buzzparser_s, ptr %156, i32 0, i32 4
  %158 = load ptr, ptr %157, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %154, ptr noundef %155, ptr noundef %158)
  %159 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %159) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %160 = load i32, ptr %5, align 4, !tbaa !12
  %161 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %10, ptr noundef @.str.28, i32 noundef %160) #4
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.buzzparser_s, ptr %162, i32 0, i32 6
  %164 = load ptr, ptr %163, align 8, !tbaa !21
  %165 = load ptr, ptr %10, align 8, !tbaa !5
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.buzzparser_s, ptr %166, i32 0, i32 4
  %168 = load ptr, ptr %167, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %164, ptr noundef %165, ptr noundef %168)
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %169) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %170 = load i32, ptr @PARSE_OK, align 4, !tbaa !12
  store i32 %170, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %171

171:                                              ; preds = %149, %147, %105, %99, %57, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %172 = load i32, ptr %2, align 4
  ret i32 %172
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse_blockstat(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse_condition(ptr noundef) #2

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 = { 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 = { "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, !11, i64 80}
!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 = !{!11, !11, i64 0}
!13 = !{!10, !6, i64 24}
!14 = !{!10, !6, i64 32}
!15 = !{!16, !11, i64 0}
!16 = !{!"buzztok_s", !11, i64 0, !6, i64 8, !17, i64 16, !17, i64 24, !6, i64 32}
!17 = !{!"long", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!10, !6, i64 48}
!22 = distinct !{!22, !19}


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

@PARSE_ERROR = external hidden local_unnamed_addr global i32, align 4
@PARSE_OK = external hidden local_unnamed_addr global i32, align 4
@.str.26 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [12 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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @chunk_addcode(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare ptr @buzzlex_nexttok(ptr noundef) local_unnamed_addr #4

declare void @buzzlex_destroytok(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local i32 @parse_while(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 80
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = add i32 %7, 1
  %9 = add i32 %7, 2
  store i32 %9, ptr %6, align 8, !tbaa !5
  %10 = tail call i32 @match(ptr noundef %0, i32 noundef 10)
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %50, label %.preheader52

.preheader52:                                     ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  br label %13

13:                                               ; preds = %.preheader52, %13
  tail call void @buzzlex_destroytok(ptr noundef nonnull %11) #5
  %14 = load ptr, ptr %12, align 8, !tbaa !11
  %15 = tail call ptr @buzzlex_nexttok(ptr noundef %14) #5
  store ptr %15, ptr %11, align 8, !tbaa !12
  %16 = load i32, ptr %15, align 8, !tbaa !13
  %cond = icmp eq i32 %16, 26
  br i1 %cond, label %13, label %.critedge

.critedge:                                        ; preds = %13
  %17 = tail call i32 @match(ptr noundef nonnull %0, i32 noundef 22)
  %.not43 = icmp eq i32 %17, 0
  br i1 %.not43, label %50, label %.preheader51

.preheader51:                                     ; preds = %.critedge, %.preheader51
  tail call void @buzzlex_destroytok(ptr noundef nonnull %11) #5
  %18 = load ptr, ptr %12, align 8, !tbaa !11
  %19 = tail call ptr @buzzlex_nexttok(ptr noundef %18) #5
  store ptr %19, ptr %11, align 8, !tbaa !12
  %20 = load i32, ptr %19, align 8, !tbaa !13
  %cond49 = icmp eq i32 %20, 26
  br i1 %cond49, label %.preheader51, label %.critedge2

.critedge2:                                       ; preds = %.preheader51
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %21 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.28, i32 noundef %7) #5
  %22 = getelementptr inbounds i8, ptr %0, i64 48
  %23 = load ptr, ptr %22, align 8, !tbaa !16
  %24 = load ptr, ptr %2, align 8, !tbaa !17
  %25 = load ptr, ptr %11, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %23, ptr noundef %24, ptr noundef %25)
  %26 = load ptr, ptr %2, align 8, !tbaa !17
  call void @free(ptr noundef %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %27 = call i32 @parse_condition(ptr noundef nonnull %0)
  %.not45 = icmp eq i32 %27, 0
  br i1 %.not45, label %50, label %28

28:                                               ; preds = %.critedge2
  %29 = call i32 @match(ptr noundef nonnull %0, i32 noundef 23)
  %.not46 = icmp eq i32 %29, 0
  br i1 %.not46, label %50, label %.preheader

.preheader:                                       ; preds = %28, %.preheader
  call void @buzzlex_destroytok(ptr noundef nonnull %11) #5
  %30 = load ptr, ptr %12, align 8, !tbaa !11
  %31 = call ptr @buzzlex_nexttok(ptr noundef %30) #5
  store ptr %31, ptr %11, align 8, !tbaa !12
  %32 = load i32, ptr %31, align 8, !tbaa !13
  %cond50 = icmp eq i32 %32, 26
  br i1 %cond50, label %.preheader, label %.critedge4

.critedge4:                                       ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %33 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.26, i32 noundef %8) #5
  %34 = load ptr, ptr %22, align 8, !tbaa !16
  %35 = load ptr, ptr %3, align 8, !tbaa !17
  %36 = load ptr, ptr %11, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %34, ptr noundef %35, ptr noundef %36)
  %37 = load ptr, ptr %3, align 8, !tbaa !17
  call void @free(ptr noundef %37) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %38 = call i32 @parse_blockstat(ptr noundef nonnull %0)
  %.not48 = icmp eq i32 %38, 0
  br i1 %.not48, label %50, label %39

39:                                               ; preds = %.critedge4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %40 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.27, i32 noundef %7) #5
  %41 = load ptr, ptr %22, align 8, !tbaa !16
  %42 = load ptr, ptr %4, align 8, !tbaa !17
  %43 = load ptr, ptr %11, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %41, ptr noundef %42, ptr noundef %43)
  %44 = load ptr, ptr %4, align 8, !tbaa !17
  call void @free(ptr noundef %44) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %45 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.28, i32 noundef %8) #5
  %46 = load ptr, ptr %22, align 8, !tbaa !16
  %47 = load ptr, ptr %5, align 8, !tbaa !17
  %48 = load ptr, ptr %11, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %46, ptr noundef %47, ptr noundef %48)
  %49 = load ptr, ptr %5, align 8, !tbaa !17
  call void @free(ptr noundef %49) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %50

50:                                               ; preds = %.critedge4, %28, %.critedge2, %.critedge, %1, %39
  %.0.in = phi ptr [ @PARSE_OK, %39 ], [ @PARSE_ERROR, %1 ], [ @PARSE_ERROR, %.critedge ], [ @PARSE_ERROR, %.critedge2 ], [ @PARSE_ERROR, %28 ], [ @PARSE_ERROR, %.critedge4 ]
  %.0 = load i32, ptr %.0.in, align 4, !tbaa !18
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse_blockstat(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse_condition(ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 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 "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 = { "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 #5 = { 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, !10, i64 80}
!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 24}
!12 = !{!6, !7, i64 32}
!13 = !{!14, !10, i64 0}
!14 = !{!"buzztok_s", !10, i64 0, !7, i64 8, !15, i64 16, !15, i64 24, !7, i64 32}
!15 = !{!"long", !8, i64 0}
!16 = !{!6, !7, i64 48}
!17 = !{!7, !7, i64 0}
!18 = !{!10, !10, i64 0}


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