; 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_if(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
  %11 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.buzzparser_s, ptr %12, i32 0, i32 10
  %14 = load i32, ptr %13, align 8, !tbaa !9
  store i32 %14, ptr %4, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.buzzparser_s, ptr %15, i32 0, i32 10
  %17 = load i32, ptr %16, align 8, !tbaa !9
  %18 = add i32 %17, 1
  store i32 %18, ptr %5, align 4, !tbaa !12
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.buzzparser_s, ptr %19, i32 0, i32 10
  %21 = load i32, ptr %20, align 8, !tbaa !9
  %22 = add i32 %21, 2
  store i32 %22, ptr %20, align 8, !tbaa !9
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = call i32 @match(ptr noundef %23, i32 noundef 5)
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %28, label %26

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

28:                                               ; preds = %1
  br label %29

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

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

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

52:                                               ; preds = %45, %38
  %53 = phi i1 [ false, %38 ], [ %51, %45 ]
  br i1 %53, label %29, label %54, !llvm.loop !18

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

58:                                               ; preds = %54
  %59 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %59, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %228

60:                                               ; preds = %54
  br label %61

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

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

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

84:                                               ; preds = %77, %70
  %85 = phi i1 [ false, %70 ], [ %83, %77 ]
  br i1 %85, label %61, label %86, !llvm.loop !20

86:                                               ; preds = %84
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = call i32 @parse_condition(ptr noundef %87)
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %92, label %90

90:                                               ; preds = %86
  %91 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %91, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %228

92:                                               ; preds = %86
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = call i32 @match(ptr noundef %93, i32 noundef 23)
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %98, label %96

96:                                               ; preds = %92
  %97 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %97, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %228

98:                                               ; preds = %92
  br label %99

99:                                               ; preds = %122, %98
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.buzzparser_s, ptr %100, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %101)
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.buzzparser_s, ptr %102, i32 0, i32 3
  %104 = load ptr, ptr %103, align 8, !tbaa !13
  %105 = call ptr @buzzlex_nexttok(ptr noundef %104)
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.buzzparser_s, ptr %106, i32 0, i32 4
  store ptr %105, ptr %107, align 8, !tbaa !14
  br label %108

108:                                              ; preds = %99
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.buzzparser_s, ptr %109, i32 0, i32 4
  %111 = load ptr, ptr %110, align 8, !tbaa !14
  %112 = getelementptr inbounds %struct.buzztok_s, ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !15
  %114 = icmp ne i32 %113, 31
  br i1 %114, label %115, label %122

115:                                              ; preds = %108
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.buzzparser_s, ptr %116, i32 0, i32 4
  %118 = load ptr, ptr %117, align 8, !tbaa !14
  %119 = getelementptr inbounds %struct.buzztok_s, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 8, !tbaa !15
  %121 = icmp eq i32 %120, 26
  br label %122

122:                                              ; preds = %115, %108
  %123 = phi i1 [ false, %108 ], [ %121, %115 ]
  br i1 %123, label %99, label %124, !llvm.loop !21

124:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %125 = load i32, ptr %4, align 4, !tbaa !12
  %126 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %7, ptr noundef @.str.26, i32 noundef %125) #4
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.buzzparser_s, ptr %127, i32 0, i32 6
  %129 = load ptr, ptr %128, align 8, !tbaa !22
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.buzzparser_s, ptr %131, i32 0, i32 4
  %133 = load ptr, ptr %132, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %129, ptr noundef %130, ptr noundef %133)
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %134) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = call i32 @parse_blockstat(ptr noundef %135)
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %140, label %138

138:                                              ; preds = %124
  %139 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %139, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %228

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

145:                                              ; preds = %140
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.buzzparser_s, ptr %146, i32 0, i32 4
  %148 = load ptr, ptr %147, align 8, !tbaa !14
  %149 = getelementptr inbounds %struct.buzztok_s, ptr %148, i32 0, i32 0
  %150 = load i32, ptr %149, align 8, !tbaa !15
  %151 = icmp eq i32 %150, 6
  br i1 %151, label %152, label %215

152:                                              ; preds = %145
  br label %153

153:                                              ; preds = %176, %152
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.buzzparser_s, ptr %154, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %155)
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.buzzparser_s, ptr %156, i32 0, i32 3
  %158 = load ptr, ptr %157, align 8, !tbaa !13
  %159 = call ptr @buzzlex_nexttok(ptr noundef %158)
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.buzzparser_s, ptr %160, i32 0, i32 4
  store ptr %159, ptr %161, align 8, !tbaa !14
  br label %162

162:                                              ; preds = %153
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.buzzparser_s, ptr %163, i32 0, i32 4
  %165 = load ptr, ptr %164, align 8, !tbaa !14
  %166 = getelementptr inbounds %struct.buzztok_s, ptr %165, i32 0, i32 0
  %167 = load i32, ptr %166, align 8, !tbaa !15
  %168 = icmp ne i32 %167, 31
  br i1 %168, label %169, label %176

169:                                              ; preds = %162
  %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 !14
  %173 = getelementptr inbounds %struct.buzztok_s, ptr %172, i32 0, i32 0
  %174 = load i32, ptr %173, align 8, !tbaa !15
  %175 = icmp eq i32 %174, 26
  br label %176

176:                                              ; preds = %169, %162
  %177 = phi i1 [ false, %162 ], [ %175, %169 ]
  br i1 %177, label %153, label %178, !llvm.loop !23

178:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %179 = load i32, ptr %5, align 4, !tbaa !12
  %180 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %8, ptr noundef @.str.27, i32 noundef %179) #4
  %181 = load ptr, ptr %3, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.buzzparser_s, ptr %181, i32 0, i32 6
  %183 = load ptr, ptr %182, align 8, !tbaa !22
  %184 = load ptr, ptr %8, align 8, !tbaa !5
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.buzzparser_s, ptr %185, i32 0, i32 4
  %187 = load ptr, ptr %186, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %183, ptr noundef %184, ptr noundef %187)
  %188 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %188) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %189 = load i32, ptr %4, align 4, !tbaa !12
  %190 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %9, ptr noundef @.str.28, i32 noundef %189) #4
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.buzzparser_s, ptr %191, i32 0, i32 6
  %193 = load ptr, ptr %192, align 8, !tbaa !22
  %194 = load ptr, ptr %9, align 8, !tbaa !5
  %195 = load ptr, ptr %3, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.buzzparser_s, ptr %195, i32 0, i32 4
  %197 = load ptr, ptr %196, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %193, ptr noundef %194, ptr noundef %197)
  %198 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %198) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %199 = load ptr, ptr %3, align 8, !tbaa !5
  %200 = call i32 @parse_blockstat(ptr noundef %199)
  %201 = icmp ne i32 %200, 0
  br i1 %201, label %204, label %202

202:                                              ; preds = %178
  %203 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %203, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %228

204:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %205 = load i32, ptr %5, align 4, !tbaa !12
  %206 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %10, ptr noundef @.str.28, i32 noundef %205) #4
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.buzzparser_s, ptr %207, i32 0, i32 6
  %209 = load ptr, ptr %208, align 8, !tbaa !22
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = load ptr, ptr %3, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.buzzparser_s, ptr %211, i32 0, i32 4
  %213 = load ptr, ptr %212, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %209, ptr noundef %210, ptr noundef %213)
  %214 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %214) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %226

215:                                              ; preds = %145, %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %216 = load i32, ptr %4, align 4, !tbaa !12
  %217 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %11, ptr noundef @.str.28, i32 noundef %216) #4
  %218 = load ptr, ptr %3, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.buzzparser_s, ptr %218, i32 0, i32 6
  %220 = load ptr, ptr %219, align 8, !tbaa !22
  %221 = load ptr, ptr %11, align 8, !tbaa !5
  %222 = load ptr, ptr %3, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.buzzparser_s, ptr %222, i32 0, i32 4
  %224 = load ptr, ptr %223, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %220, ptr noundef %221, ptr noundef %224)
  %225 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %225) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %226

226:                                              ; preds = %215, %204
  %227 = load i32, ptr @PARSE_OK, align 4, !tbaa !12
  store i32 %227, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %228

228:                                              ; preds = %226, %202, %138, %96, %90, %58, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %229 = load i32, ptr %2, align 4
  ret i32 %229
}

; 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 = distinct !{!21, !19}
!22 = !{!10, !6, i64 48}
!23 = distinct !{!23, !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_if(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 = alloca ptr, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 80
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = add i32 %8, 1
  %10 = add i32 %8, 2
  store i32 %10, ptr %7, align 8, !tbaa !5
  %11 = tail call i32 @match(ptr noundef %0, i32 noundef 5)
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %66, label %.preheader72

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

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

.critedge:                                        ; preds = %14
  %18 = tail call i32 @match(ptr noundef nonnull %0, i32 noundef 22)
  %.not58 = icmp eq i32 %18, 0
  br i1 %.not58, label %66, label %.preheader71

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

.critedge2:                                       ; preds = %.preheader71
  %22 = tail call i32 @parse_condition(ptr noundef nonnull %0)
  %.not60 = icmp eq i32 %22, 0
  br i1 %.not60, label %66, label %23

23:                                               ; preds = %.critedge2
  %24 = tail call i32 @match(ptr noundef nonnull %0, i32 noundef 23)
  %.not61 = icmp eq i32 %24, 0
  br i1 %.not61, label %66, label %.preheader70

.preheader70:                                     ; preds = %23, %.preheader70
  tail call void @buzzlex_destroytok(ptr noundef nonnull %12) #5
  %25 = load ptr, ptr %13, align 8, !tbaa !11
  %26 = tail call ptr @buzzlex_nexttok(ptr noundef %25) #5
  store ptr %26, ptr %12, align 8, !tbaa !12
  %27 = load i32, ptr %26, align 8, !tbaa !13
  %cond68 = icmp eq i32 %27, 26
  br i1 %cond68, label %.preheader70, label %.critedge4

.critedge4:                                       ; preds = %.preheader70
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %28 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.26, i32 noundef %8) #5
  %29 = getelementptr inbounds i8, ptr %0, i64 48
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  %31 = load ptr, ptr %2, align 8, !tbaa !17
  %32 = load ptr, ptr %12, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %30, ptr noundef %31, ptr noundef %32)
  %33 = load ptr, ptr %2, align 8, !tbaa !17
  call void @free(ptr noundef %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %34 = call i32 @parse_blockstat(ptr noundef nonnull %0)
  %.not63 = icmp eq i32 %34, 0
  br i1 %.not63, label %66, label %35

35:                                               ; preds = %.critedge4
  %36 = load ptr, ptr %12, align 8, !tbaa !12
  %.not64 = icmp eq ptr %36, null
  br i1 %.not64, label %60, label %37

37:                                               ; preds = %35
  %38 = load i32, ptr %36, align 8, !tbaa !13
  %39 = icmp eq i32 %38, 6
  br i1 %39, label %.preheader, label %60

.preheader:                                       ; preds = %37, %.preheader
  call void @buzzlex_destroytok(ptr noundef nonnull %12) #5
  %40 = load ptr, ptr %13, align 8, !tbaa !11
  %41 = call ptr @buzzlex_nexttok(ptr noundef %40) #5
  store ptr %41, ptr %12, align 8, !tbaa !12
  %42 = load i32, ptr %41, align 8, !tbaa !13
  %cond69 = icmp eq i32 %42, 26
  br i1 %cond69, label %.preheader, label %.critedge6

.critedge6:                                       ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %43 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.27, i32 noundef %9) #5
  %44 = load ptr, ptr %29, align 8, !tbaa !16
  %45 = load ptr, ptr %3, align 8, !tbaa !17
  %46 = load ptr, ptr %12, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %44, ptr noundef %45, ptr noundef %46)
  %47 = load ptr, ptr %3, align 8, !tbaa !17
  call void @free(ptr noundef %47) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %48 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.28, i32 noundef %8) #5
  %49 = load ptr, ptr %29, align 8, !tbaa !16
  %50 = load ptr, ptr %4, align 8, !tbaa !17
  %51 = load ptr, ptr %12, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %49, ptr noundef %50, ptr noundef %51)
  %52 = load ptr, ptr %4, align 8, !tbaa !17
  call void @free(ptr noundef %52) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %53 = call i32 @parse_blockstat(ptr noundef nonnull %0)
  %.not66 = icmp eq i32 %53, 0
  br i1 %.not66, label %66, label %54

54:                                               ; preds = %.critedge6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %55 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.28, i32 noundef %9) #5
  %56 = load ptr, ptr %29, align 8, !tbaa !16
  %57 = load ptr, ptr %5, align 8, !tbaa !17
  %58 = load ptr, ptr %12, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %56, ptr noundef %57, ptr noundef %58)
  %59 = load ptr, ptr %5, align 8, !tbaa !17
  call void @free(ptr noundef %59) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %66

60:                                               ; preds = %37, %35
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %61 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %6, ptr noundef nonnull @.str.28, i32 noundef %8) #5
  %62 = load ptr, ptr %29, align 8, !tbaa !16
  %63 = load ptr, ptr %6, align 8, !tbaa !17
  %64 = load ptr, ptr %12, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %62, ptr noundef %63, ptr noundef %64)
  %65 = load ptr, ptr %6, align 8, !tbaa !17
  call void @free(ptr noundef %65) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %66

66:                                               ; preds = %54, %60, %.critedge6, %.critedge4, %23, %.critedge2, %.critedge, %1
  %.0.in = phi ptr [ @PARSE_ERROR, %1 ], [ @PARSE_ERROR, %.critedge ], [ @PARSE_ERROR, %.critedge2 ], [ @PARSE_ERROR, %23 ], [ @PARSE_ERROR, %.critedge4 ], [ @PARSE_ERROR, %.critedge6 ], [ @PARSE_OK, %60 ], [ @PARSE_OK, %54 ]
  %.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