; 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.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [20 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_for(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 i32, align 4
  %8 = alloca i32, align 4
  %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 ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.buzzparser_s, ptr %17, i32 0, i32 10
  %19 = load i32, ptr %18, align 8, !tbaa !9
  store i32 %19, ptr %4, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %20 = load i32, ptr %4, align 4, !tbaa !12
  %21 = add i32 %20, 1
  store i32 %21, ptr %5, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %22 = load i32, ptr %5, align 4, !tbaa !12
  %23 = add i32 %22, 1
  store i32 %23, ptr %6, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %24 = load i32, ptr %6, align 4, !tbaa !12
  %25 = add i32 %24, 1
  store i32 %25, ptr %7, align 4, !tbaa !12
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.buzzparser_s, ptr %26, i32 0, i32 10
  %28 = load i32, ptr %27, align 8, !tbaa !9
  %29 = add i32 %28, 4
  store i32 %29, ptr %27, align 8, !tbaa !9
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = call i32 @match(ptr noundef %30, i32 noundef 9)
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %35, label %33

33:                                               ; preds = %1
  %34 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %34, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %295

35:                                               ; preds = %1
  br label %36

36:                                               ; preds = %59, %35
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.buzzparser_s, ptr %37, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %38)
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.buzzparser_s, ptr %39, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  %42 = call ptr @buzzlex_nexttok(ptr noundef %41)
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.buzzparser_s, ptr %43, i32 0, i32 4
  store ptr %42, ptr %44, align 8, !tbaa !14
  br label %45

45:                                               ; preds = %36
  %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 ne i32 %50, 31
  br i1 %51, label %52, label %59

52:                                               ; preds = %45
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.buzzparser_s, ptr %53, i32 0, i32 4
  %55 = load ptr, ptr %54, align 8, !tbaa !14
  %56 = getelementptr inbounds %struct.buzztok_s, ptr %55, i32 0, i32 0
  %57 = load i32, ptr %56, align 8, !tbaa !15
  %58 = icmp eq i32 %57, 26
  br label %59

59:                                               ; preds = %52, %45
  %60 = phi i1 [ false, %45 ], [ %58, %52 ]
  br i1 %60, label %36, label %61, !llvm.loop !18

61:                                               ; preds = %59
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = call i32 @match(ptr noundef %62, i32 noundef 22)
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %67, label %65

65:                                               ; preds = %61
  %66 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %66, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %295

67:                                               ; preds = %61
  br label %68

68:                                               ; preds = %91, %67
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.buzzparser_s, ptr %69, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %70)
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.buzzparser_s, ptr %71, i32 0, i32 3
  %73 = load ptr, ptr %72, align 8, !tbaa !13
  %74 = call ptr @buzzlex_nexttok(ptr noundef %73)
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.buzzparser_s, ptr %75, i32 0, i32 4
  store ptr %74, ptr %76, align 8, !tbaa !14
  br label %77

77:                                               ; preds = %68
  %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 ne i32 %82, 31
  br i1 %83, label %84, label %91

84:                                               ; preds = %77
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.buzzparser_s, ptr %85, i32 0, i32 4
  %87 = load ptr, ptr %86, align 8, !tbaa !14
  %88 = getelementptr inbounds %struct.buzztok_s, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !15
  %90 = icmp eq i32 %89, 26
  br label %91

91:                                               ; preds = %84, %77
  %92 = phi i1 [ false, %77 ], [ %90, %84 ]
  br i1 %92, label %68, label %93, !llvm.loop !20

93:                                               ; preds = %91
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = call i32 @parse_command(ptr noundef %94)
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %99, label %97

97:                                               ; preds = %93
  %98 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %98, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %295

99:                                               ; preds = %93
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = call i32 @match(ptr noundef %100, i32 noundef 27)
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %105, label %103

103:                                              ; preds = %99
  %104 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %104, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %295

105:                                              ; preds = %99
  br label %106

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

115:                                              ; preds = %106
  %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 ne i32 %120, 31
  br i1 %121, label %122, label %129

122:                                              ; preds = %115
  %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 !14
  %126 = getelementptr inbounds %struct.buzztok_s, ptr %125, i32 0, i32 0
  %127 = load i32, ptr %126, align 8, !tbaa !15
  %128 = icmp eq i32 %127, 26
  br label %129

129:                                              ; preds = %122, %115
  %130 = phi i1 [ false, %115 ], [ %128, %122 ]
  br i1 %130, label %106, label %131, !llvm.loop !21

131:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %132 = load i32, ptr %4, align 4, !tbaa !12
  %133 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %9, ptr noundef @.str.28, i32 noundef %132) #4
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.buzzparser_s, ptr %134, i32 0, i32 6
  %136 = load ptr, ptr %135, align 8, !tbaa !22
  %137 = load ptr, ptr %9, align 8, !tbaa !5
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.buzzparser_s, ptr %138, i32 0, i32 4
  %140 = load ptr, ptr %139, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %136, ptr noundef %137, ptr noundef %140)
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %141) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = call i32 @parse_condition(ptr noundef %142)
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %147, label %145

145:                                              ; preds = %131
  %146 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %146, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %295

147:                                              ; preds = %131
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = call i32 @match(ptr noundef %148, i32 noundef 27)
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %153, label %151

151:                                              ; preds = %147
  %152 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %152, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %295

153:                                              ; preds = %147
  br label %154

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

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

170:                                              ; preds = %163
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.buzzparser_s, ptr %171, i32 0, i32 4
  %173 = load ptr, ptr %172, align 8, !tbaa !14
  %174 = getelementptr inbounds %struct.buzztok_s, ptr %173, i32 0, i32 0
  %175 = load i32, ptr %174, align 8, !tbaa !15
  %176 = icmp eq i32 %175, 26
  br label %177

177:                                              ; preds = %170, %163
  %178 = phi i1 [ false, %163 ], [ %176, %170 ]
  br i1 %178, label %154, label %179, !llvm.loop !23

179:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %180 = load i32, ptr %6, align 4, !tbaa !12
  %181 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %10, ptr noundef @.str.29, i32 noundef %180) #4
  %182 = load ptr, ptr %3, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.buzzparser_s, ptr %182, i32 0, i32 6
  %184 = load ptr, ptr %183, align 8, !tbaa !22
  %185 = load ptr, ptr %10, align 8, !tbaa !5
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.buzzparser_s, ptr %186, i32 0, i32 4
  %188 = load ptr, ptr %187, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %184, ptr noundef %185, ptr noundef %188)
  %189 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %189) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %190 = load i32, ptr %7, align 4, !tbaa !12
  %191 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %11, ptr noundef @.str.27, i32 noundef %190) #4
  %192 = load ptr, ptr %3, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.buzzparser_s, ptr %192, i32 0, i32 6
  %194 = load ptr, ptr %193, align 8, !tbaa !22
  %195 = load ptr, ptr %11, align 8, !tbaa !5
  %196 = load ptr, ptr %3, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.buzzparser_s, ptr %196, i32 0, i32 4
  %198 = load ptr, ptr %197, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %194, ptr noundef %195, ptr noundef %198)
  %199 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %199) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %200 = load i32, ptr %5, align 4, !tbaa !12
  %201 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %12, ptr noundef @.str.28, i32 noundef %200) #4
  %202 = load ptr, ptr %3, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.buzzparser_s, ptr %202, i32 0, i32 6
  %204 = load ptr, ptr %203, align 8, !tbaa !22
  %205 = load ptr, ptr %12, align 8, !tbaa !5
  %206 = load ptr, ptr %3, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.buzzparser_s, ptr %206, i32 0, i32 4
  %208 = load ptr, ptr %207, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %204, ptr noundef %205, ptr noundef %208)
  %209 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %209) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = call i32 @parse_command(ptr noundef %210)
  %212 = icmp ne i32 %211, 0
  br i1 %212, label %215, label %213

213:                                              ; preds = %179
  %214 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %214, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %295

215:                                              ; preds = %179
  %216 = load ptr, ptr %3, align 8, !tbaa !5
  %217 = call i32 @match(ptr noundef %216, i32 noundef 23)
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %221, label %219

219:                                              ; preds = %215
  %220 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %220, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %295

221:                                              ; preds = %215
  br label %222

222:                                              ; preds = %245, %221
  %223 = load ptr, ptr %3, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.buzzparser_s, ptr %223, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %224)
  %225 = load ptr, ptr %3, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.buzzparser_s, ptr %225, i32 0, i32 3
  %227 = load ptr, ptr %226, align 8, !tbaa !13
  %228 = call ptr @buzzlex_nexttok(ptr noundef %227)
  %229 = load ptr, ptr %3, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.buzzparser_s, ptr %229, i32 0, i32 4
  store ptr %228, ptr %230, align 8, !tbaa !14
  br label %231

231:                                              ; preds = %222
  %232 = load ptr, ptr %3, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.buzzparser_s, ptr %232, i32 0, i32 4
  %234 = load ptr, ptr %233, align 8, !tbaa !14
  %235 = getelementptr inbounds %struct.buzztok_s, ptr %234, i32 0, i32 0
  %236 = load i32, ptr %235, align 8, !tbaa !15
  %237 = icmp ne i32 %236, 31
  br i1 %237, label %238, label %245

238:                                              ; preds = %231
  %239 = load ptr, ptr %3, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.buzzparser_s, ptr %239, i32 0, i32 4
  %241 = load ptr, ptr %240, align 8, !tbaa !14
  %242 = getelementptr inbounds %struct.buzztok_s, ptr %241, i32 0, i32 0
  %243 = load i32, ptr %242, align 8, !tbaa !15
  %244 = icmp eq i32 %243, 26
  br label %245

245:                                              ; preds = %238, %231
  %246 = phi i1 [ false, %231 ], [ %244, %238 ]
  br i1 %246, label %222, label %247, !llvm.loop !24

247:                                              ; preds = %245
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %248 = load i32, ptr %4, align 4, !tbaa !12
  %249 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %13, ptr noundef @.str.27, i32 noundef %248) #4
  %250 = load ptr, ptr %3, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.buzzparser_s, ptr %250, i32 0, i32 6
  %252 = load ptr, ptr %251, align 8, !tbaa !22
  %253 = load ptr, ptr %13, align 8, !tbaa !5
  %254 = load ptr, ptr %3, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.buzzparser_s, ptr %254, i32 0, i32 4
  %256 = load ptr, ptr %255, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %252, ptr noundef %253, ptr noundef %256)
  %257 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %257) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %258 = load i32, ptr %6, align 4, !tbaa !12
  %259 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %14, ptr noundef @.str.28, i32 noundef %258) #4
  %260 = load ptr, ptr %3, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.buzzparser_s, ptr %260, i32 0, i32 6
  %262 = load ptr, ptr %261, align 8, !tbaa !22
  %263 = load ptr, ptr %14, align 8, !tbaa !5
  %264 = load ptr, ptr %3, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.buzzparser_s, ptr %264, i32 0, i32 4
  %266 = load ptr, ptr %265, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %262, ptr noundef %263, ptr noundef %266)
  %267 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %267) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %268 = load ptr, ptr %3, align 8, !tbaa !5
  %269 = call i32 @parse_blockstat(ptr noundef %268)
  %270 = icmp ne i32 %269, 0
  br i1 %270, label %273, label %271

271:                                              ; preds = %247
  %272 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !12
  store i32 %272, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %295

273:                                              ; preds = %247
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %274 = load i32, ptr %5, align 4, !tbaa !12
  %275 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %15, ptr noundef @.str.27, i32 noundef %274) #4
  %276 = load ptr, ptr %3, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.buzzparser_s, ptr %276, i32 0, i32 6
  %278 = load ptr, ptr %277, align 8, !tbaa !22
  %279 = load ptr, ptr %15, align 8, !tbaa !5
  %280 = load ptr, ptr %3, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.buzzparser_s, ptr %280, i32 0, i32 4
  %282 = load ptr, ptr %281, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %278, ptr noundef %279, ptr noundef %282)
  %283 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %283) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %284 = load i32, ptr %7, align 4, !tbaa !12
  %285 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %16, ptr noundef @.str.28, i32 noundef %284) #4
  %286 = load ptr, ptr %3, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.buzzparser_s, ptr %286, i32 0, i32 6
  %288 = load ptr, ptr %287, align 8, !tbaa !22
  %289 = load ptr, ptr %16, align 8, !tbaa !5
  %290 = load ptr, ptr %3, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.buzzparser_s, ptr %290, i32 0, i32 4
  %292 = load ptr, ptr %291, align 8, !tbaa !14
  call void @chunk_addcode(ptr noundef %288, ptr noundef %289, ptr noundef %292)
  %293 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %293) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %294 = load i32, ptr @PARSE_OK, align 4, !tbaa !12
  store i32 %294, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %295

295:                                              ; preds = %273, %271, %219, %213, %151, %145, %103, %97, %65, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %296 = load i32, ptr %2, align 4
  ret i32 %296
}

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

; 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}
!24 = distinct !{!24, !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.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [20 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_for(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 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 80
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = add i32 %11, 1
  %13 = add i32 %11, 2
  %14 = add i32 %11, 3
  %15 = add i32 %11, 4
  store i32 %15, ptr %10, align 8, !tbaa !5
  %16 = tail call i32 @match(ptr noundef %0, i32 noundef 9)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %88, label %.preheader96

.preheader96:                                     ; preds = %1
  %17 = getelementptr inbounds i8, ptr %0, i64 32
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  br label %19

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

.critedge:                                        ; preds = %19
  %23 = tail call i32 @match(ptr noundef nonnull %0, i32 noundef 22)
  %.not77 = icmp eq i32 %23, 0
  br i1 %.not77, label %88, label %.preheader95

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

.critedge2:                                       ; preds = %.preheader95
  %27 = tail call i32 @parse_command(ptr noundef nonnull %0)
  %.not79 = icmp eq i32 %27, 0
  br i1 %.not79, label %88, label %28

28:                                               ; preds = %.critedge2
  %29 = tail call i32 @match(ptr noundef nonnull %0, i32 noundef 27)
  %.not80 = icmp eq i32 %29, 0
  br i1 %.not80, label %88, label %.preheader94

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

.critedge4:                                       ; preds = %.preheader94
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %33 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.28, i32 noundef %11) #5
  %34 = getelementptr inbounds i8, ptr %0, i64 48
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  %36 = load ptr, ptr %2, align 8, !tbaa !17
  %37 = load ptr, ptr %17, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %35, ptr noundef %36, ptr noundef %37)
  %38 = load ptr, ptr %2, align 8, !tbaa !17
  call void @free(ptr noundef %38) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %39 = call i32 @parse_condition(ptr noundef nonnull %0)
  %.not82 = icmp eq i32 %39, 0
  br i1 %.not82, label %88, label %40

40:                                               ; preds = %.critedge4
  %41 = call i32 @match(ptr noundef nonnull %0, i32 noundef 27)
  %.not83 = icmp eq i32 %41, 0
  br i1 %.not83, label %88, label %.preheader93

.preheader93:                                     ; preds = %40, %.preheader93
  call void @buzzlex_destroytok(ptr noundef nonnull %17) #5
  %42 = load ptr, ptr %18, align 8, !tbaa !11
  %43 = call ptr @buzzlex_nexttok(ptr noundef %42) #5
  store ptr %43, ptr %17, align 8, !tbaa !12
  %44 = load i32, ptr %43, align 8, !tbaa !13
  %cond91 = icmp eq i32 %44, 26
  br i1 %cond91, label %.preheader93, label %.critedge6

.critedge6:                                       ; preds = %.preheader93
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %45 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.29, i32 noundef %13) #5
  %46 = load ptr, ptr %34, align 8, !tbaa !16
  %47 = load ptr, ptr %3, align 8, !tbaa !17
  %48 = load ptr, ptr %17, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %46, ptr noundef %47, ptr noundef %48)
  %49 = load ptr, ptr %3, align 8, !tbaa !17
  call void @free(ptr noundef %49) #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
  %50 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.27, i32 noundef %14) #5
  %51 = load ptr, ptr %34, align 8, !tbaa !16
  %52 = load ptr, ptr %4, align 8, !tbaa !17
  %53 = load ptr, ptr %17, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %51, ptr noundef %52, ptr noundef %53)
  %54 = load ptr, ptr %4, align 8, !tbaa !17
  call void @free(ptr noundef %54) #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
  %55 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.28, i32 noundef %12) #5
  %56 = load ptr, ptr %34, align 8, !tbaa !16
  %57 = load ptr, ptr %5, align 8, !tbaa !17
  %58 = load ptr, ptr %17, 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
  %60 = call i32 @parse_command(ptr noundef nonnull %0)
  %.not85 = icmp eq i32 %60, 0
  br i1 %.not85, label %88, label %61

61:                                               ; preds = %.critedge6
  %62 = call i32 @match(ptr noundef nonnull %0, i32 noundef 23)
  %.not86 = icmp eq i32 %62, 0
  br i1 %.not86, label %88, label %.preheader

.preheader:                                       ; preds = %61, %.preheader
  call void @buzzlex_destroytok(ptr noundef nonnull %17) #5
  %63 = load ptr, ptr %18, align 8, !tbaa !11
  %64 = call ptr @buzzlex_nexttok(ptr noundef %63) #5
  store ptr %64, ptr %17, align 8, !tbaa !12
  %65 = load i32, ptr %64, align 8, !tbaa !13
  %cond92 = icmp eq i32 %65, 26
  br i1 %cond92, label %.preheader, label %.critedge8

.critedge8:                                       ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %66 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %6, ptr noundef nonnull @.str.27, i32 noundef %11) #5
  %67 = load ptr, ptr %34, align 8, !tbaa !16
  %68 = load ptr, ptr %6, align 8, !tbaa !17
  %69 = load ptr, ptr %17, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %67, ptr noundef %68, ptr noundef %69)
  %70 = load ptr, ptr %6, align 8, !tbaa !17
  call void @free(ptr noundef %70) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %71 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.28, i32 noundef %13) #5
  %72 = load ptr, ptr %34, align 8, !tbaa !16
  %73 = load ptr, ptr %7, align 8, !tbaa !17
  %74 = load ptr, ptr %17, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %72, ptr noundef %73, ptr noundef %74)
  %75 = load ptr, ptr %7, align 8, !tbaa !17
  call void @free(ptr noundef %75) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  %76 = call i32 @parse_blockstat(ptr noundef nonnull %0)
  %.not88 = icmp eq i32 %76, 0
  br i1 %.not88, label %88, label %77

77:                                               ; preds = %.critedge8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %78 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.27, i32 noundef %12) #5
  %79 = load ptr, ptr %34, align 8, !tbaa !16
  %80 = load ptr, ptr %8, align 8, !tbaa !17
  %81 = load ptr, ptr %17, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %79, ptr noundef %80, ptr noundef %81)
  %82 = load ptr, ptr %8, align 8, !tbaa !17
  call void @free(ptr noundef %82) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %83 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %9, ptr noundef nonnull @.str.28, i32 noundef %14) #5
  %84 = load ptr, ptr %34, align 8, !tbaa !16
  %85 = load ptr, ptr %9, align 8, !tbaa !17
  %86 = load ptr, ptr %17, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %84, ptr noundef %85, ptr noundef %86)
  %87 = load ptr, ptr %9, align 8, !tbaa !17
  call void @free(ptr noundef %87) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %88

88:                                               ; preds = %.critedge8, %61, %.critedge6, %40, %.critedge4, %28, %.critedge2, %.critedge, %1, %77
  %.0.in = phi ptr [ @PARSE_OK, %77 ], [ @PARSE_ERROR, %1 ], [ @PARSE_ERROR, %.critedge ], [ @PARSE_ERROR, %.critedge2 ], [ @PARSE_ERROR, %28 ], [ @PARSE_ERROR, %.critedge4 ], [ @PARSE_ERROR, %40 ], [ @PARSE_ERROR, %.critedge6 ], [ @PARSE_ERROR, %61 ], [ @PARSE_ERROR, %.critedge8 ]
  %.0 = load i32, ptr %.0.in, align 4, !tbaa !18
  ret i32 %.0
}

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

; 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