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

@SCOPE_AUTO = external hidden global i32, align 4
@stderr = external global ptr, align 8
@PARSE_ERROR = external hidden global i32, align 4
@PARSE_OK = external hidden global i32, align 4
@SCOPE_LOCAL = external hidden global i32, align 4
@.str.18 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [8 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
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

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

; 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_var(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %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
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = call i32 @match(ptr noundef %12, i32 noundef 3)
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %17, label %15

15:                                               ; preds = %1
  %16 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %16, ptr %2, align 4
  br label %269

17:                                               ; preds = %1
  br label %18

18:                                               ; preds = %41, %17
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.buzzparser_s, ptr %19, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %20)
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.buzzparser_s, ptr %21, i32 0, i32 3
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = call ptr @buzzlex_nexttok(ptr noundef %23)
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.buzzparser_s, ptr %25, i32 0, i32 4
  store ptr %24, ptr %26, align 8, !tbaa !13
  br label %27

27:                                               ; preds = %18
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.buzzparser_s, ptr %28, i32 0, i32 4
  %30 = load ptr, ptr %29, align 8, !tbaa !13
  %31 = getelementptr inbounds %struct.buzztok_s, ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !14
  %33 = icmp ne i32 %32, 31
  br i1 %33, label %34, label %41

34:                                               ; preds = %27
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.buzzparser_s, ptr %35, i32 0, i32 4
  %37 = load ptr, ptr %36, align 8, !tbaa !13
  %38 = getelementptr inbounds %struct.buzztok_s, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !14
  %40 = icmp eq i32 %39, 26
  br label %41

41:                                               ; preds = %34, %27
  %42 = phi i1 [ false, %27 ], [ %40, %34 ]
  br i1 %42, label %18, label %43, !llvm.loop !17

43:                                               ; preds = %41
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = call i32 @match(ptr noundef %44, i32 noundef 0)
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %49, label %47

47:                                               ; preds = %43
  %48 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %48, ptr %2, align 4
  br label %269

49:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.buzzparser_s, ptr %50, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  %53 = getelementptr inbounds %struct.buzztok_s, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !19
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.buzzparser_s, ptr %55, i32 0, i32 7
  %57 = load ptr, ptr %56, align 8, !tbaa !20
  %58 = call ptr @sym_lookup(ptr noundef %54, ptr noundef %57)
  store ptr %58, ptr %4, align 8, !tbaa !5
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %101

61:                                               ; preds = %49
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.sym_s, ptr %62, i32 0, i32 2
  %64 = load i32, ptr %63, align 4, !tbaa !21
  %65 = load i32, ptr @SCOPE_LOCAL, align 4, !tbaa !9
  %66 = icmp eq i32 %64, %65
  br i1 %66, label %67, label %101

67:                                               ; preds = %61
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.buzzparser_s, ptr %69, i32 0, i32 3
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  %72 = getelementptr inbounds %struct.buzzdarray_s, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !23
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.buzzparser_s, ptr %74, i32 0, i32 3
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = getelementptr inbounds %struct.buzzdarray_s, ptr %76, i32 0, i32 1
  %78 = load i64, ptr %77, align 8, !tbaa !25
  %79 = sub nsw i64 %78, 1
  %80 = getelementptr inbounds ptr, ptr %73, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.buzzlex_file_s, ptr %81, i32 0, i32 5
  %83 = load ptr, ptr %82, align 8, !tbaa !26
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.buzzparser_s, ptr %84, i32 0, i32 4
  %86 = load ptr, ptr %85, align 8, !tbaa !13
  %87 = getelementptr inbounds %struct.buzztok_s, ptr %86, i32 0, i32 2
  %88 = load i64, ptr %87, align 8, !tbaa !28
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.buzzparser_s, ptr %89, i32 0, i32 4
  %91 = load ptr, ptr %90, align 8, !tbaa !13
  %92 = getelementptr inbounds %struct.buzztok_s, ptr %91, i32 0, i32 3
  %93 = load i64, ptr %92, align 8, !tbaa !29
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.buzzparser_s, ptr %94, i32 0, i32 4
  %96 = load ptr, ptr %95, align 8, !tbaa !13
  %97 = getelementptr inbounds %struct.buzztok_s, ptr %96, i32 0, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !19
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str.18, ptr noundef %83, i64 noundef %88, i64 noundef %93, ptr noundef %98) #4
  %100 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %100, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %268

101:                                              ; preds = %61, %49
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.buzzparser_s, ptr %103, i32 0, i32 4
  %105 = load ptr, ptr %104, align 8, !tbaa !13
  %106 = getelementptr inbounds %struct.buzztok_s, ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !19
  %108 = load i32, ptr @SCOPE_AUTO, align 4, !tbaa !9
  call void @sym_add(ptr noundef %102, ptr noundef %107, i32 noundef %108)
  %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 !13
  %112 = getelementptr inbounds %struct.buzztok_s, ptr %111, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !19
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.buzzparser_s, ptr %114, i32 0, i32 7
  %116 = load ptr, ptr %115, align 8, !tbaa !20
  %117 = call ptr @sym_lookup(ptr noundef %113, ptr noundef %116)
  store ptr %117, ptr %4, align 8, !tbaa !5
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.sym_s, ptr %118, i32 0, i32 2
  %120 = load i32, ptr %119, align 4, !tbaa !21
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %135

122:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.sym_s, ptr %123, i32 0, i32 0
  %125 = load i64, ptr %124, align 8, !tbaa !30
  %126 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %6, ptr noundef @.str.19, i64 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 !31
  %130 = load ptr, ptr %6, 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 !13
  call void @chunk_addcode(ptr noundef %129, ptr noundef %130, ptr noundef %133)
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free(ptr noundef %134) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %135

135:                                              ; preds = %122, %101
  br label %136

136:                                              ; preds = %159, %135
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.buzzparser_s, ptr %137, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %138)
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.buzzparser_s, ptr %139, i32 0, i32 3
  %141 = load ptr, ptr %140, align 8, !tbaa !11
  %142 = call ptr @buzzlex_nexttok(ptr noundef %141)
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.buzzparser_s, ptr %143, i32 0, i32 4
  store ptr %142, ptr %144, align 8, !tbaa !13
  br label %145

145:                                              ; preds = %136
  %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 !13
  %149 = getelementptr inbounds %struct.buzztok_s, ptr %148, i32 0, i32 0
  %150 = load i32, ptr %149, align 8, !tbaa !14
  %151 = icmp ne i32 %150, 31
  br i1 %151, label %152, label %159

152:                                              ; preds = %145
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.buzzparser_s, ptr %153, i32 0, i32 4
  %155 = load ptr, ptr %154, align 8, !tbaa !13
  %156 = getelementptr inbounds %struct.buzztok_s, ptr %155, i32 0, i32 0
  %157 = load i32, ptr %156, align 8, !tbaa !14
  %158 = icmp eq i32 %157, 26
  br label %159

159:                                              ; preds = %152, %145
  %160 = phi i1 [ false, %145 ], [ %158, %152 ]
  br i1 %160, label %136, label %161, !llvm.loop !32

161:                                              ; preds = %159
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.buzzparser_s, ptr %162, i32 0, i32 4
  %164 = load ptr, ptr %163, align 8, !tbaa !13
  %165 = getelementptr inbounds %struct.buzztok_s, ptr %164, i32 0, i32 0
  %166 = load i32, ptr %165, align 8, !tbaa !14
  %167 = icmp eq i32 %166, 28
  br i1 %167, label %168, label %228

168:                                              ; preds = %161
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.sym_s, ptr %169, i32 0, i32 2
  %171 = load i32, ptr %170, align 4, !tbaa !21
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %195, label %173

173:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %174 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %7, ptr noundef @.str.20) #4
  %175 = load ptr, ptr %3, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.buzzparser_s, ptr %175, i32 0, i32 6
  %177 = load ptr, ptr %176, align 8, !tbaa !31
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.buzzparser_s, ptr %179, i32 0, i32 4
  %181 = load ptr, ptr %180, align 8, !tbaa !13
  call void @chunk_addcode(ptr noundef %177, ptr noundef %178, ptr noundef %181)
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %182) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.sym_s, ptr %183, i32 0, i32 0
  %185 = load i64, ptr %184, align 8, !tbaa !30
  %186 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %8, ptr noundef @.str.21, i64 noundef %185) #4
  %187 = load ptr, ptr %3, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.buzzparser_s, ptr %187, i32 0, i32 6
  %189 = load ptr, ptr %188, align 8, !tbaa !31
  %190 = load ptr, ptr %8, align 8, !tbaa !5
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.buzzparser_s, ptr %191, i32 0, i32 4
  %193 = load ptr, ptr %192, align 8, !tbaa !13
  call void @chunk_addcode(ptr noundef %189, ptr noundef %190, ptr noundef %193)
  %194 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %194) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %195

195:                                              ; preds = %173, %168
  br label %196

196:                                              ; preds = %219, %195
  %197 = load ptr, ptr %3, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.buzzparser_s, ptr %197, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %198)
  %199 = load ptr, ptr %3, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.buzzparser_s, ptr %199, i32 0, i32 3
  %201 = load ptr, ptr %200, align 8, !tbaa !11
  %202 = call ptr @buzzlex_nexttok(ptr noundef %201)
  %203 = load ptr, ptr %3, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.buzzparser_s, ptr %203, i32 0, i32 4
  store ptr %202, ptr %204, align 8, !tbaa !13
  br label %205

205:                                              ; preds = %196
  %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 !13
  %209 = getelementptr inbounds %struct.buzztok_s, ptr %208, i32 0, i32 0
  %210 = load i32, ptr %209, align 8, !tbaa !14
  %211 = icmp ne i32 %210, 31
  br i1 %211, label %212, label %219

212:                                              ; preds = %205
  %213 = load ptr, ptr %3, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.buzzparser_s, ptr %213, i32 0, i32 4
  %215 = load ptr, ptr %214, align 8, !tbaa !13
  %216 = getelementptr inbounds %struct.buzztok_s, ptr %215, i32 0, i32 0
  %217 = load i32, ptr %216, align 8, !tbaa !14
  %218 = icmp eq i32 %217, 26
  br label %219

219:                                              ; preds = %212, %205
  %220 = phi i1 [ false, %205 ], [ %218, %212 ]
  br i1 %220, label %196, label %221, !llvm.loop !33

221:                                              ; preds = %219
  %222 = load ptr, ptr %3, align 8, !tbaa !5
  %223 = call i32 @parse_expression(ptr noundef %222)
  %224 = icmp ne i32 %223, 0
  br i1 %224, label %227, label %225

225:                                              ; preds = %221
  %226 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %226, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %268

227:                                              ; preds = %221
  br label %238

228:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %229 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %9, ptr noundef @.str.20) #4
  %230 = load ptr, ptr %3, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.buzzparser_s, ptr %230, i32 0, i32 6
  %232 = load ptr, ptr %231, align 8, !tbaa !31
  %233 = load ptr, ptr %9, align 8, !tbaa !5
  %234 = load ptr, ptr %3, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.buzzparser_s, ptr %234, i32 0, i32 4
  %236 = load ptr, ptr %235, align 8, !tbaa !13
  call void @chunk_addcode(ptr noundef %232, ptr noundef %233, ptr noundef %236)
  %237 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %237) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %238

238:                                              ; preds = %228, %227
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.sym_s, ptr %239, i32 0, i32 2
  %241 = load i32, ptr %240, align 4, !tbaa !21
  %242 = icmp ne i32 %241, 0
  br i1 %242, label %243, label %253

243:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %244 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %10, ptr noundef @.str.22) #4
  %245 = load ptr, ptr %3, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.buzzparser_s, ptr %245, i32 0, i32 6
  %247 = load ptr, ptr %246, align 8, !tbaa !31
  %248 = load ptr, ptr %10, align 8, !tbaa !5
  %249 = load ptr, ptr %3, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.buzzparser_s, ptr %249, i32 0, i32 4
  %251 = load ptr, ptr %250, align 8, !tbaa !13
  call void @chunk_addcode(ptr noundef %247, ptr noundef %248, ptr noundef %251)
  %252 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %252) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %266

253:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %254 = load ptr, ptr %4, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.sym_s, ptr %254, i32 0, i32 0
  %256 = load i64, ptr %255, align 8, !tbaa !30
  %257 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %11, ptr noundef @.str.21, i64 noundef %256) #4
  %258 = load ptr, ptr %3, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.buzzparser_s, ptr %258, i32 0, i32 6
  %260 = load ptr, ptr %259, align 8, !tbaa !31
  %261 = load ptr, ptr %11, align 8, !tbaa !5
  %262 = load ptr, ptr %3, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.buzzparser_s, ptr %262, i32 0, i32 4
  %264 = load ptr, ptr %263, align 8, !tbaa !13
  call void @chunk_addcode(ptr noundef %260, ptr noundef %261, ptr noundef %264)
  %265 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %265) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %266

266:                                              ; preds = %253, %243
  %267 = load i32, ptr @PARSE_OK, align 4, !tbaa !9
  store i32 %267, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %268

268:                                              ; preds = %266, %225, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %269

269:                                              ; preds = %268, %47, %15
  %270 = load i32, ptr %2, align 4
  ret i32 %270
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse_expression(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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"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, !10, i64 80}
!13 = !{!12, !6, i64 32}
!14 = !{!15, !10, i64 0}
!15 = !{!"buzztok_s", !10, i64 0, !6, i64 8, !16, i64 16, !16, i64 24, !6, i64 32}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!15, !6, i64 8}
!20 = !{!12, !6, i64 56}
!21 = !{!22, !10, i64 12}
!22 = !{!"sym_s", !16, i64 0, !10, i64 8, !10, i64 12}
!23 = !{!24, !6, i64 0}
!24 = !{!"buzzdarray_s", !6, i64 0, !16, i64 8, !10, i64 16, !10, i64 20, !6, i64 24}
!25 = !{!24, !16, i64 8}
!26 = !{!27, !6, i64 40}
!27 = !{!"buzzlex_file_s", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !6, i64 32, !6, i64 40}
!28 = !{!15, !16, i64 16}
!29 = !{!15, !16, i64 24}
!30 = !{!22, !16, i64 0}
!31 = !{!12, !6, i64 48}
!32 = distinct !{!32, !18}
!33 = distinct !{!33, !18}


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

@SCOPE_AUTO = external hidden local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@PARSE_ERROR = external hidden local_unnamed_addr global i32, align 4
@PARSE_OK = external hidden local_unnamed_addr global i32, align 4
@SCOPE_LOCAL = external hidden local_unnamed_addr global i32, align 4
@.str.18 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [8 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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

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

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

declare ptr @buzzlex_nexttok(ptr noundef) local_unnamed_addr #5

declare void @buzzlex_destroytok(ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local i32 @parse_var(ptr noundef %0) local_unnamed_addr #3 {
  %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 = tail call i32 @match(ptr noundef %0, i32 noundef 3)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %115, label %.preheader

.preheader:                                       ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  br label %11

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

.critedge:                                        ; preds = %11
  %15 = tail call i32 @match(ptr noundef nonnull %0, i32 noundef 0)
  %.not59 = icmp eq i32 %15, 0
  br i1 %.not59, label %115, label %16

16:                                               ; preds = %.critedge
  %17 = load ptr, ptr %9, align 8, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %17, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %0, i64 56
  %21 = load ptr, ptr %20, align 8, !tbaa !16
  %22 = tail call ptr @sym_lookup(ptr noundef %19, ptr noundef %21)
  %.not60 = icmp eq ptr %22, null
  br i1 %.not60, label %47, label %23

23:                                               ; preds = %16
  %24 = getelementptr inbounds i8, ptr %22, i64 12
  %25 = load i32, ptr %24, align 4, !tbaa !17
  %26 = load i32, ptr @SCOPE_LOCAL, align 4, !tbaa !19
  %27 = icmp eq i32 %25, %26
  br i1 %27, label %28, label %47

28:                                               ; preds = %23
  %29 = load ptr, ptr @stderr, align 8, !tbaa !20
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = load ptr, ptr %30, align 8, !tbaa !21
  %32 = getelementptr inbounds i8, ptr %30, i64 8
  %33 = load i64, ptr %32, align 8, !tbaa !23
  %34 = getelementptr ptr, ptr %31, i64 %33
  %35 = getelementptr i8, ptr %34, i64 -8
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  %37 = getelementptr inbounds i8, ptr %36, i64 40
  %38 = load ptr, ptr %37, align 8, !tbaa !24
  %39 = load ptr, ptr %9, align 8, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %39, i64 16
  %41 = load i64, ptr %40, align 8, !tbaa !26
  %42 = getelementptr inbounds i8, ptr %39, i64 24
  %43 = load i64, ptr %42, align 8, !tbaa !27
  %44 = getelementptr inbounds i8, ptr %39, i64 8
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  %46 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.18, ptr noundef %38, i64 noundef %41, i64 noundef %43, ptr noundef %45) #7
  br label %115

47:                                               ; preds = %23, %16
  %48 = load ptr, ptr %9, align 8, !tbaa !11
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !15
  %51 = load i32, ptr @SCOPE_AUTO, align 4, !tbaa !19
  tail call void @sym_add(ptr noundef nonnull %0, ptr noundef %50, i32 noundef %51)
  %52 = load ptr, ptr %9, align 8, !tbaa !11
  %53 = getelementptr inbounds i8, ptr %52, i64 8
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  %55 = load ptr, ptr %20, align 8, !tbaa !16
  %56 = tail call ptr @sym_lookup(ptr noundef %54, ptr noundef %55)
  %57 = getelementptr inbounds i8, ptr %56, i64 12
  %58 = load i32, ptr %57, align 4, !tbaa !17
  %.not61 = icmp eq i32 %58, 0
  br i1 %.not61, label %.preheader71, label %59

59:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %60 = load i64, ptr %56, align 8, !tbaa !28
  %61 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.19, i64 noundef %60) #6
  %62 = getelementptr inbounds i8, ptr %0, i64 48
  %63 = load ptr, ptr %62, align 8, !tbaa !29
  %64 = load ptr, ptr %2, align 8, !tbaa !20
  %65 = load ptr, ptr %9, align 8, !tbaa !11
  call void @chunk_addcode(ptr noundef %63, ptr noundef %64, ptr noundef %65)
  %66 = load ptr, ptr %2, align 8, !tbaa !20
  call void @free(ptr noundef %66) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %.preheader71

.preheader71:                                     ; preds = %59, %47
  br label %67

67:                                               ; preds = %.preheader71, %67
  call void @buzzlex_destroytok(ptr noundef nonnull %9) #6
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = call ptr @buzzlex_nexttok(ptr noundef %68) #6
  store ptr %69, ptr %9, align 8, !tbaa !11
  %70 = load i32, ptr %69, align 8, !tbaa !12
  switch i32 %70, label %91 [
    i32 26, label %67
    i32 28, label %71
  ]

71:                                               ; preds = %67
  %72 = load i32, ptr %57, align 4, !tbaa !17
  %.not63 = icmp eq i32 %72, 0
  br i1 %.not63, label %73, label %.preheader70

73:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %74 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.20) #6
  %75 = getelementptr inbounds i8, ptr %0, i64 48
  %76 = load ptr, ptr %75, align 8, !tbaa !29
  %77 = load ptr, ptr %3, align 8, !tbaa !20
  %78 = load ptr, ptr %9, align 8, !tbaa !11
  call void @chunk_addcode(ptr noundef %76, ptr noundef %77, ptr noundef %78)
  %79 = load ptr, ptr %3, align 8, !tbaa !20
  call void @free(ptr noundef %79) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %80 = load i64, ptr %56, align 8, !tbaa !28
  %81 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.21, i64 noundef %80) #6
  %82 = load ptr, ptr %75, align 8, !tbaa !29
  %83 = load ptr, ptr %4, align 8, !tbaa !20
  %84 = load ptr, ptr %9, align 8, !tbaa !11
  call void @chunk_addcode(ptr noundef %82, ptr noundef %83, ptr noundef %84)
  %85 = load ptr, ptr %4, align 8, !tbaa !20
  call void @free(ptr noundef %85) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %.preheader70

.preheader70:                                     ; preds = %73, %71
  br label %86

86:                                               ; preds = %.preheader70, %86
  call void @buzzlex_destroytok(ptr noundef nonnull %9) #6
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = call ptr @buzzlex_nexttok(ptr noundef %87) #6
  store ptr %88, ptr %9, align 8, !tbaa !11
  %89 = load i32, ptr %88, align 8, !tbaa !12
  %cond68 = icmp eq i32 %89, 26
  br i1 %cond68, label %86, label %.critedge4

.critedge4:                                       ; preds = %86
  %90 = call i32 @parse_expression(ptr noundef nonnull %0)
  %.not65 = icmp eq i32 %90, 0
  br i1 %.not65, label %115, label %98

91:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %92 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.20) #6
  %93 = getelementptr inbounds i8, ptr %0, i64 48
  %94 = load ptr, ptr %93, align 8, !tbaa !29
  %95 = load ptr, ptr %5, align 8, !tbaa !20
  %96 = load ptr, ptr %9, align 8, !tbaa !11
  call void @chunk_addcode(ptr noundef %94, ptr noundef %95, ptr noundef %96)
  %97 = load ptr, ptr %5, align 8, !tbaa !20
  call void @free(ptr noundef %97) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %98

98:                                               ; preds = %.critedge4, %91
  %99 = load i32, ptr %57, align 4, !tbaa !17
  %.not66 = icmp eq i32 %99, 0
  br i1 %.not66, label %107, label %100

100:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %101 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %6, ptr noundef nonnull @.str.22) #6
  %102 = getelementptr inbounds i8, ptr %0, i64 48
  %103 = load ptr, ptr %102, align 8, !tbaa !29
  %104 = load ptr, ptr %6, align 8, !tbaa !20
  %105 = load ptr, ptr %9, align 8, !tbaa !11
  call void @chunk_addcode(ptr noundef %103, ptr noundef %104, ptr noundef %105)
  %106 = load ptr, ptr %6, align 8, !tbaa !20
  call void @free(ptr noundef %106) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %115

107:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %108 = load i64, ptr %56, align 8, !tbaa !28
  %109 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.21, i64 noundef %108) #6
  %110 = getelementptr inbounds i8, ptr %0, i64 48
  %111 = load ptr, ptr %110, align 8, !tbaa !29
  %112 = load ptr, ptr %7, align 8, !tbaa !20
  %113 = load ptr, ptr %9, align 8, !tbaa !11
  call void @chunk_addcode(ptr noundef %111, ptr noundef %112, ptr noundef %113)
  %114 = load ptr, ptr %7, align 8, !tbaa !20
  call void @free(ptr noundef %114) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %115

115:                                              ; preds = %28, %.critedge4, %107, %100, %.critedge, %1
  %.1.in = phi ptr [ @PARSE_ERROR, %1 ], [ @PARSE_ERROR, %.critedge ], [ @PARSE_ERROR, %28 ], [ @PARSE_ERROR, %.critedge4 ], [ @PARSE_OK, %107 ], [ @PARSE_OK, %100 ]
  %.1 = load i32, ptr %.1.in, align 4, !tbaa !19
  ret i32 %.1
}

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

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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 = { "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 #6 = { nounwind }
attributes #7 = { cold nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 24}
!6 = !{!"buzzparser_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !10, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 32}
!12 = !{!13, !10, i64 0}
!13 = !{!"buzztok_s", !10, i64 0, !7, i64 8, !14, i64 16, !14, i64 24, !7, i64 32}
!14 = !{!"long", !8, i64 0}
!15 = !{!13, !7, i64 8}
!16 = !{!6, !7, i64 56}
!17 = !{!18, !10, i64 12}
!18 = !{!"sym_s", !14, i64 0, !10, i64 8, !10, i64 12}
!19 = !{!10, !10, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !7, i64 0}
!22 = !{!"buzzdarray_s", !7, i64 0, !14, i64 8, !10, i64 16, !10, i64 20, !7, i64 24}
!23 = !{!22, !14, i64 8}
!24 = !{!25, !7, i64 40}
!25 = !{!"buzzlex_file_s", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !7, i64 32, !7, i64 40}
!26 = !{!13, !14, i64 16}
!27 = !{!13, !14, i64 24}
!28 = !{!18, !14, i64 0}
!29 = !{!6, !7, i64 48}


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