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

@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.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 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

declare void @buzzdarray_insert(ptr noundef, i32 noundef, ptr noundef) #1

; 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) #2

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

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

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

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

declare void @buzzdict_foreach(ptr noundef, ptr noundef, ptr noundef) #1

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

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

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

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

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

declare ptr @buzzlex_nexttok(ptr noundef) #1

declare void @buzzlex_destroytok(ptr noundef) #1

declare ptr @buzzdict_new(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @buzzdict_strkeyhash(ptr noundef) #1

declare i32 @buzzdict_strkeycmp(ptr noundef, ptr noundef) #1

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

declare void @buzzdarray_remove(ptr noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @parse_lambda(ptr noundef %0) #3 {
  %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
  store ptr %0, ptr %3, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = call i32 @match(ptr noundef %9, i32 noundef 7)
  %11 = icmp ne i32 %10, 0
  br i1 %11, label %14, label %12

12:                                               ; preds = %1
  %13 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %13, ptr %2, align 4
  br label %250

14:                                               ; preds = %1
  br label %15

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

24:                                               ; preds = %15
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.buzzparser_s, ptr %25, i32 0, i32 4
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds %struct.buzztok_s, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !14
  %30 = icmp ne i32 %29, 31
  br i1 %30, label %31, label %38

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

38:                                               ; preds = %31, %24
  %39 = phi i1 [ false, %24 ], [ %37, %31 ]
  br i1 %39, label %15, label %40, !llvm.loop !17

40:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.buzzparser_s, ptr %41, i32 0, i32 6
  %43 = load ptr, ptr %42, align 8, !tbaa !19
  store ptr %43, ptr %4, align 8, !tbaa !5
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.buzzparser_s, ptr %44, i32 0, i32 10
  %46 = load i32, ptr %45, align 8, !tbaa !20
  %47 = call ptr @chunk_new(i32 noundef %46, ptr noundef null)
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.buzzparser_s, ptr %48, i32 0, i32 6
  store ptr %47, ptr %49, align 8, !tbaa !19
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.buzzparser_s, ptr %50, i32 0, i32 5
  %52 = load ptr, ptr %51, align 8, !tbaa !21
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.buzzparser_s, ptr %53, i32 0, i32 5
  %55 = load ptr, ptr %54, align 8, !tbaa !21
  %56 = getelementptr inbounds %struct.buzzdarray_s, ptr %55, i32 0, i32 1
  %57 = load i64, ptr %56, align 8, !tbaa !22
  %58 = trunc i64 %57 to i32
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.buzzparser_s, ptr %59, i32 0, i32 6
  call void @buzzdarray_insert(ptr noundef %52, i32 noundef %58, ptr noundef %60)
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.buzzparser_s, ptr %61, i32 0, i32 10
  %63 = load i32, ptr %62, align 8, !tbaa !20
  %64 = add i32 %63, 1
  store i32 %64, ptr %62, align 8, !tbaa !20
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = call i32 @match(ptr noundef %65, i32 noundef 22)
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %70, label %68

68:                                               ; preds = %40
  %69 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %69, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %249

70:                                               ; preds = %40
  br label %71

71:                                               ; preds = %94, %70
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.buzzparser_s, ptr %72, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %73)
  %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 = call ptr @buzzlex_nexttok(ptr noundef %76)
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.buzzparser_s, ptr %78, i32 0, i32 4
  store ptr %77, ptr %79, align 8, !tbaa !13
  br label %80

80:                                               ; preds = %71
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.buzzparser_s, ptr %81, i32 0, i32 4
  %83 = load ptr, ptr %82, align 8, !tbaa !13
  %84 = getelementptr inbounds %struct.buzztok_s, ptr %83, i32 0, i32 0
  %85 = load i32, ptr %84, align 8, !tbaa !14
  %86 = icmp ne i32 %85, 31
  br i1 %86, label %87, label %94

87:                                               ; preds = %80
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.buzzparser_s, ptr %88, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !13
  %91 = getelementptr inbounds %struct.buzztok_s, ptr %90, i32 0, i32 0
  %92 = load i32, ptr %91, align 8, !tbaa !14
  %93 = icmp eq i32 %92, 26
  br label %94

94:                                               ; preds = %87, %80
  %95 = phi i1 [ false, %80 ], [ %93, %87 ]
  br i1 %95, label %71, label %96, !llvm.loop !24

96:                                               ; preds = %94
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.buzzparser_s, ptr %97, i32 0, i32 7
  %99 = load ptr, ptr %98, align 8, !tbaa !25
  %100 = getelementptr inbounds %struct.buzzdarray_s, ptr %99, i32 0, i32 1
  %101 = load i64, ptr %100, align 8, !tbaa !22
  %102 = icmp eq i64 %101, 1
  br i1 %102, label %103, label %133

103:                                              ; preds = %96
  %104 = call ptr @buzzdict_new(i32 noundef 100, i32 noundef 8, i32 noundef 16, ptr noundef @buzzdict_strkeyhash, ptr noundef @buzzdict_strkeycmp, ptr noundef @sym_destroy)
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.buzzparser_s, ptr %105, i32 0, i32 8
  store ptr %104, ptr %106, align 8, !tbaa !26
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.buzzparser_s, ptr %107, i32 0, i32 7
  %109 = load ptr, ptr %108, align 8, !tbaa !25
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.buzzparser_s, ptr %110, i32 0, i32 7
  %112 = load ptr, ptr %111, align 8, !tbaa !25
  %113 = getelementptr inbounds %struct.buzzdarray_s, ptr %112, i32 0, i32 1
  %114 = load i64, ptr %113, align 8, !tbaa !22
  %115 = trunc i64 %114 to i32
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.buzzparser_s, ptr %116, i32 0, i32 8
  call void @buzzdarray_insert(ptr noundef %109, i32 noundef %115, ptr noundef %117)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.buzzparser_s, ptr %118, i32 0, i32 7
  %120 = load ptr, ptr %119, align 8, !tbaa !25
  %121 = call ptr @sym_lookup(ptr noundef @.str.24, ptr noundef %120)
  store ptr %121, ptr %6, align 8, !tbaa !5
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %129

124:                                              ; preds = %103
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.sym_s, ptr %125, i32 0, i32 2
  %127 = load i32, ptr %126, align 4, !tbaa !27
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %132

129:                                              ; preds = %124, %103
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = load i32, ptr @SCOPE_LOCAL, align 4, !tbaa !9
  call void @sym_add(ptr noundef %130, ptr noundef @.str.24, i32 noundef %131)
  br label %132

132:                                              ; preds = %129, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %163

133:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.buzzparser_s, ptr %134, i32 0, i32 7
  %136 = load ptr, ptr %135, align 8, !tbaa !25
  %137 = getelementptr inbounds %struct.buzzdarray_s, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !29
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.buzzparser_s, ptr %139, i32 0, i32 7
  %141 = load ptr, ptr %140, align 8, !tbaa !25
  %142 = getelementptr inbounds %struct.buzzdarray_s, ptr %141, i32 0, i32 1
  %143 = load i64, ptr %142, align 8, !tbaa !22
  %144 = sub nsw i64 %143, 1
  %145 = getelementptr inbounds ptr, ptr %138, i64 %144
  %146 = load ptr, ptr %145, align 8, !tbaa !5
  store ptr %146, ptr %7, align 8, !tbaa !5
  %147 = call ptr @buzzdict_new(i32 noundef 100, i32 noundef 8, i32 noundef 16, ptr noundef @buzzdict_strkeyhash, ptr noundef @buzzdict_strkeycmp, ptr noundef @sym_destroy)
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.buzzparser_s, ptr %148, i32 0, i32 8
  store ptr %147, ptr %149, align 8, !tbaa !26
  %150 = load ptr, ptr %3, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.buzzparser_s, ptr %150, i32 0, i32 7
  %152 = load ptr, ptr %151, align 8, !tbaa !25
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.buzzparser_s, ptr %153, i32 0, i32 7
  %155 = load ptr, ptr %154, align 8, !tbaa !25
  %156 = getelementptr inbounds %struct.buzzdarray_s, ptr %155, i32 0, i32 1
  %157 = load i64, ptr %156, align 8, !tbaa !22
  %158 = trunc i64 %157 to i32
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.buzzparser_s, ptr %159, i32 0, i32 8
  call void @buzzdarray_insert(ptr noundef %152, i32 noundef %158, ptr noundef %160)
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  call void @buzzdict_foreach(ptr noundef %161, ptr noundef @sym_clone, ptr noundef %162)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %163

163:                                              ; preds = %133, %132
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = call i32 @parse_idlist(ptr noundef %164)
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %169, label %167

167:                                              ; preds = %163
  %168 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %168, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %249

169:                                              ; preds = %163
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = call i32 @match(ptr noundef %170, i32 noundef 23)
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %175, label %173

173:                                              ; preds = %169
  %174 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %174, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %249

175:                                              ; preds = %169
  br label %176

176:                                              ; preds = %199, %175
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.buzzparser_s, ptr %177, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %178)
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.buzzparser_s, ptr %179, i32 0, i32 3
  %181 = load ptr, ptr %180, align 8, !tbaa !11
  %182 = call ptr @buzzlex_nexttok(ptr noundef %181)
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.buzzparser_s, ptr %183, i32 0, i32 4
  store ptr %182, ptr %184, align 8, !tbaa !13
  br label %185

185:                                              ; preds = %176
  %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 !13
  %189 = getelementptr inbounds %struct.buzztok_s, ptr %188, i32 0, i32 0
  %190 = load i32, ptr %189, align 8, !tbaa !14
  %191 = icmp ne i32 %190, 31
  br i1 %191, label %192, label %199

192:                                              ; preds = %185
  %193 = load ptr, ptr %3, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.buzzparser_s, ptr %193, i32 0, i32 4
  %195 = load ptr, ptr %194, align 8, !tbaa !13
  %196 = getelementptr inbounds %struct.buzztok_s, ptr %195, i32 0, i32 0
  %197 = load i32, ptr %196, align 8, !tbaa !14
  %198 = icmp eq i32 %197, 26
  br label %199

199:                                              ; preds = %192, %185
  %200 = phi i1 [ false, %185 ], [ %198, %192 ]
  br i1 %200, label %176, label %201, !llvm.loop !30

201:                                              ; preds = %199
  %202 = load ptr, ptr %3, align 8, !tbaa !5
  %203 = call i32 @parse_block(ptr noundef %202, i32 noundef 0)
  %204 = icmp ne i32 %203, 0
  br i1 %204, label %207, label %205

205:                                              ; preds = %201
  %206 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %206, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %249

207:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %208 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %8, ptr noundef @.str.25) #4
  %209 = load ptr, ptr %3, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.buzzparser_s, ptr %209, i32 0, i32 6
  %211 = load ptr, ptr %210, align 8, !tbaa !19
  %212 = load ptr, ptr %8, align 8, !tbaa !5
  %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
  call void @chunk_addcode(ptr noundef %211, ptr noundef %212, ptr noundef %215)
  %216 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %216) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %217 = load ptr, ptr %3, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.buzzparser_s, ptr %217, i32 0, i32 7
  %219 = load ptr, ptr %218, align 8, !tbaa !25
  %220 = load ptr, ptr %3, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.buzzparser_s, ptr %220, i32 0, i32 7
  %222 = load ptr, ptr %221, align 8, !tbaa !25
  %223 = getelementptr inbounds %struct.buzzdarray_s, ptr %222, i32 0, i32 1
  %224 = load i64, ptr %223, align 8, !tbaa !22
  %225 = sub nsw i64 %224, 1
  %226 = trunc i64 %225 to i32
  call void @buzzdarray_remove(ptr noundef %219, i32 noundef %226)
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.buzzparser_s, ptr %227, i32 0, i32 7
  %229 = load ptr, ptr %228, align 8, !tbaa !25
  %230 = getelementptr inbounds %struct.buzzdarray_s, ptr %229, i32 0, i32 0
  %231 = load ptr, ptr %230, align 8, !tbaa !29
  %232 = load ptr, ptr %3, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.buzzparser_s, ptr %232, i32 0, i32 7
  %234 = load ptr, ptr %233, align 8, !tbaa !25
  %235 = getelementptr inbounds %struct.buzzdarray_s, ptr %234, i32 0, i32 1
  %236 = load i64, ptr %235, align 8, !tbaa !22
  %237 = sub nsw i64 %236, 1
  %238 = getelementptr inbounds ptr, ptr %231, i64 %237
  %239 = load ptr, ptr %238, align 8, !tbaa !5
  %240 = load ptr, ptr %3, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.buzzparser_s, ptr %240, i32 0, i32 8
  store ptr %239, ptr %241, align 8, !tbaa !26
  %242 = load ptr, ptr %3, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.buzzparser_s, ptr %242, i32 0, i32 6
  %244 = load ptr, ptr %243, align 8, !tbaa !19
  call void @chunk_finalize(ptr noundef %244)
  %245 = load ptr, ptr %4, align 8, !tbaa !5
  %246 = load ptr, ptr %3, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.buzzparser_s, ptr %246, i32 0, i32 6
  store ptr %245, ptr %247, align 8, !tbaa !19
  %248 = load i32, ptr @PARSE_OK, align 4, !tbaa !9
  store i32 %248, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %249

249:                                              ; preds = %207, %205, %173, %167, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %250

250:                                              ; preds = %249, %12
  %251 = load i32, ptr %2, align 4
  ret i32 %251
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !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 = !{!12, !6, i64 48}
!20 = !{!12, !10, i64 80}
!21 = !{!12, !6, i64 40}
!22 = !{!23, !16, i64 8}
!23 = !{!"buzzdarray_s", !6, i64 0, !16, i64 8, !10, i64 16, !10, i64 20, !6, i64 24}
!24 = distinct !{!24, !18}
!25 = !{!12, !6, i64 56}
!26 = !{!12, !6, i64 64}
!27 = !{!28, !10, i64 12}
!28 = !{!"sym_s", !16, i64 0, !10, i64 8, !10, i64 12}
!29 = !{!23, !6, i64 0}
!30 = distinct !{!30, !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"

@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.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 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

declare void @buzzdarray_insert(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; 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 #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 @sym_clone(ptr noundef, ptr noundef, ptr noundef) #3

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

declare void @buzzdict_foreach(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @chunk_new(i32 noundef, ptr 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 void @chunk_finalize(ptr noundef) local_unnamed_addr #3

; 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 #1

declare void @buzzlex_destroytok(ptr noundef) local_unnamed_addr #1

declare ptr @buzzdict_new(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @buzzdict_strkeyhash(ptr noundef) #1

declare i32 @buzzdict_strkeycmp(ptr noundef, ptr noundef) #1

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

declare void @buzzdarray_remove(ptr noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @parse_lambda(ptr noundef %0) local_unnamed_addr #3 {
  %2 = alloca ptr, align 8
  %3 = tail call i32 @match(ptr noundef %0, i32 noundef 7)
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %84, label %.preheader75

.preheader75:                                     ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  br label %6

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

.critedge:                                        ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 48
  %11 = load ptr, ptr %10, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %0, i64 80
  %13 = load i32, ptr %12, align 8, !tbaa !16
  %14 = tail call ptr @chunk_new(i32 noundef %13, ptr noundef null)
  store ptr %14, ptr %10, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  %16 = load ptr, ptr %15, align 8, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load i64, ptr %17, align 8, !tbaa !18
  %19 = trunc i64 %18 to i32
  tail call void @buzzdarray_insert(ptr noundef %16, i32 noundef %19, ptr noundef nonnull %10) #5
  %20 = load i32, ptr %12, align 8, !tbaa !16
  %21 = add i32 %20, 1
  store i32 %21, ptr %12, align 8, !tbaa !16
  %22 = tail call i32 @match(ptr noundef nonnull %0, i32 noundef 22)
  %.not64 = icmp eq i32 %22, 0
  br i1 %.not64, label %84, label %.preheader74

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

.critedge2:                                       ; preds = %.preheader74
  %26 = getelementptr inbounds i8, ptr %0, i64 56
  %27 = load ptr, ptr %26, align 8, !tbaa !20
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  %29 = load i64, ptr %28, align 8, !tbaa !18
  %30 = icmp eq i64 %29, 1
  br i1 %30, label %31, label %45

31:                                               ; preds = %.critedge2
  %32 = tail call ptr @buzzdict_new(i32 noundef 100, i32 noundef 8, i32 noundef 16, ptr noundef nonnull @buzzdict_strkeyhash, ptr noundef nonnull @buzzdict_strkeycmp, ptr noundef nonnull @sym_destroy) #5
  %33 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %32, ptr %33, align 8, !tbaa !21
  %34 = load ptr, ptr %26, align 8, !tbaa !20
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = load i64, ptr %35, align 8, !tbaa !18
  %37 = trunc i64 %36 to i32
  tail call void @buzzdarray_insert(ptr noundef %34, i32 noundef %37, ptr noundef nonnull %33) #5
  %38 = load ptr, ptr %26, align 8, !tbaa !20
  %39 = tail call ptr @sym_lookup(ptr noundef nonnull @.str.24, ptr noundef %38)
  %.not66 = icmp eq ptr %39, null
  br i1 %.not66, label %43, label %40

40:                                               ; preds = %31
  %41 = getelementptr inbounds i8, ptr %39, i64 12
  %42 = load i32, ptr %41, align 4, !tbaa !22
  %.not67 = icmp eq i32 %42, 0
  br i1 %.not67, label %56, label %43

43:                                               ; preds = %40, %31
  %44 = load i32, ptr @SCOPE_LOCAL, align 4, !tbaa !24
  tail call void @sym_add(ptr noundef nonnull %0, ptr noundef nonnull @.str.24, i32 noundef %44)
  br label %56

45:                                               ; preds = %.critedge2
  %46 = load ptr, ptr %27, align 8, !tbaa !25
  %47 = getelementptr ptr, ptr %46, i64 %29
  %48 = getelementptr i8, ptr %47, i64 -8
  %49 = load ptr, ptr %48, align 8, !tbaa !26
  %50 = tail call ptr @buzzdict_new(i32 noundef 100, i32 noundef 8, i32 noundef 16, ptr noundef nonnull @buzzdict_strkeyhash, ptr noundef nonnull @buzzdict_strkeycmp, ptr noundef nonnull @sym_destroy) #5
  %51 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %50, ptr %51, align 8, !tbaa !21
  %52 = load ptr, ptr %26, align 8, !tbaa !20
  %53 = getelementptr inbounds i8, ptr %52, i64 8
  %54 = load i64, ptr %53, align 8, !tbaa !18
  %55 = trunc i64 %54 to i32
  tail call void @buzzdarray_insert(ptr noundef %52, i32 noundef %55, ptr noundef nonnull %51) #5
  tail call void @buzzdict_foreach(ptr noundef %49, ptr noundef nonnull @sym_clone, ptr noundef nonnull %0) #5
  br label %56

56:                                               ; preds = %40, %43, %45
  %57 = tail call i32 @parse_idlist(ptr noundef nonnull %0)
  %.not68 = icmp eq i32 %57, 0
  br i1 %.not68, label %84, label %58

58:                                               ; preds = %56
  %59 = tail call i32 @match(ptr noundef nonnull %0, i32 noundef 23)
  %.not69 = icmp eq i32 %59, 0
  br i1 %.not69, label %84, label %.preheader

.preheader:                                       ; preds = %58, %.preheader
  tail call void @buzzlex_destroytok(ptr noundef nonnull %4) #5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = tail call ptr @buzzlex_nexttok(ptr noundef %60) #5
  store ptr %61, ptr %4, align 8, !tbaa !11
  %62 = load i32, ptr %61, align 8, !tbaa !12
  %cond73 = icmp eq i32 %62, 26
  br i1 %cond73, label %.preheader, label %.critedge4

.critedge4:                                       ; preds = %.preheader
  %63 = tail call i32 @parse_block(ptr noundef nonnull %0, i32 noundef 0)
  %.not71 = icmp eq i32 %63, 0
  br i1 %.not71, label %84, label %64

64:                                               ; preds = %.critedge4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %65 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str.25) #5
  %66 = load ptr, ptr %10, align 8, !tbaa !15
  %67 = load ptr, ptr %2, align 8, !tbaa !26
  %68 = load ptr, ptr %4, align 8, !tbaa !11
  call void @chunk_addcode(ptr noundef %66, ptr noundef %67, ptr noundef %68)
  %69 = load ptr, ptr %2, align 8, !tbaa !26
  call void @free(ptr noundef %69) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %70 = load ptr, ptr %26, align 8, !tbaa !20
  %71 = getelementptr inbounds i8, ptr %70, i64 8
  %72 = load i64, ptr %71, align 8, !tbaa !18
  %73 = trunc i64 %72 to i32
  %74 = add i32 %73, -1
  call void @buzzdarray_remove(ptr noundef %70, i32 noundef %74) #5
  %75 = load ptr, ptr %26, align 8, !tbaa !20
  %76 = load ptr, ptr %75, align 8, !tbaa !25
  %77 = getelementptr inbounds i8, ptr %75, i64 8
  %78 = load i64, ptr %77, align 8, !tbaa !18
  %79 = getelementptr ptr, ptr %76, i64 %78
  %80 = getelementptr i8, ptr %79, i64 -8
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  %82 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %81, ptr %82, align 8, !tbaa !21
  %83 = load ptr, ptr %10, align 8, !tbaa !15
  call void @chunk_finalize(ptr noundef %83)
  store ptr %11, ptr %10, align 8, !tbaa !15
  br label %84

84:                                               ; preds = %64, %.critedge, %56, %58, %.critedge4, %1
  %.1.in = phi ptr [ @PARSE_ERROR, %1 ], [ @PARSE_OK, %64 ], [ @PARSE_ERROR, %.critedge ], [ @PARSE_ERROR, %56 ], [ @PARSE_ERROR, %58 ], [ @PARSE_ERROR, %.critedge4 ]
  %.1 = load i32, ptr %.1.in, align 4, !tbaa !24
  ret i32 %.1
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #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 = { 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 = !{!6, !7, i64 48}
!16 = !{!6, !10, i64 80}
!17 = !{!6, !7, i64 40}
!18 = !{!19, !14, i64 8}
!19 = !{!"buzzdarray_s", !7, i64 0, !14, i64 8, !10, i64 16, !10, i64 20, !7, i64 24}
!20 = !{!6, !7, i64 56}
!21 = !{!6, !7, i64 64}
!22 = !{!23, !10, i64 12}
!23 = !{!"sym_s", !14, i64 0, !10, i64 8, !10, i64 12}
!24 = !{!10, !10, i64 0}
!25 = !{!19, !7, i64 0}
!26 = !{!7, !7, i64 0}


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