; 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.symdeldata_s = type { ptr, i32 }
%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.buzzdict_s = type { ptr, i32, i32, ptr, ptr, ptr, i32, i32 }

@PARSE_ERROR = external hidden global i32, align 4
@PARSE_OK = external hidden global i32, align 4
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

; 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 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_statlist(ptr noundef) #3

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @parse_block(ptr noundef %0, i32 noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.symdeldata_s, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = call i32 @match(ptr noundef %11, i32 noundef 20)
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %16, label %14

14:                                               ; preds = %2
  %15 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %15, ptr %3, align 4
  br label %247

16:                                               ; preds = %2
  br label %17

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

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

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

40:                                               ; preds = %33, %26
  %41 = phi i1 [ false, %26 ], [ %39, %33 ]
  br i1 %41, label %17, label %42, !llvm.loop !17

42:                                               ; preds = %40
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.buzzparser_s, ptr %43, i32 0, i32 4
  %45 = load ptr, ptr %44, align 8, !tbaa !13
  %46 = getelementptr inbounds %struct.buzztok_s, ptr %45, i32 0, i32 0
  %47 = load i32, ptr %46, align 8, !tbaa !14
  %48 = icmp eq i32 %47, 21
  br i1 %48, label %49, label %77

49:                                               ; preds = %42
  br label %50

50:                                               ; preds = %73, %49
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.buzzparser_s, ptr %51, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %52)
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.buzzparser_s, ptr %53, i32 0, i32 3
  %55 = load ptr, ptr %54, align 8, !tbaa !11
  %56 = call ptr @buzzlex_nexttok(ptr noundef %55)
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.buzzparser_s, ptr %57, i32 0, i32 4
  store ptr %56, ptr %58, align 8, !tbaa !13
  br label %59

59:                                               ; preds = %50
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.buzzparser_s, ptr %60, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  %63 = getelementptr inbounds %struct.buzztok_s, ptr %62, i32 0, i32 0
  %64 = load i32, ptr %63, align 8, !tbaa !14
  %65 = icmp ne i32 %64, 31
  br i1 %65, label %66, label %73

66:                                               ; preds = %59
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.buzzparser_s, ptr %67, i32 0, i32 4
  %69 = load ptr, ptr %68, align 8, !tbaa !13
  %70 = getelementptr inbounds %struct.buzztok_s, ptr %69, i32 0, i32 0
  %71 = load i32, ptr %70, align 8, !tbaa !14
  %72 = icmp eq i32 %71, 26
  br label %73

73:                                               ; preds = %66, %59
  %74 = phi i1 [ false, %59 ], [ %72, %66 ]
  br i1 %74, label %50, label %75, !llvm.loop !19

75:                                               ; preds = %73
  %76 = load i32, ptr @PARSE_OK, align 4, !tbaa !9
  store i32 %76, ptr %3, align 4
  br label %247

77:                                               ; preds = %42
  %78 = load i32, ptr %5, align 4, !tbaa !9
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %133

80:                                               ; preds = %77
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.buzzparser_s, ptr %81, i32 0, i32 7
  %83 = load ptr, ptr %82, align 8, !tbaa !20
  %84 = getelementptr inbounds %struct.buzzdarray_s, ptr %83, i32 0, i32 1
  %85 = load i64, ptr %84, align 8, !tbaa !21
  %86 = icmp eq i64 %85, 1
  br i1 %86, label %87, label %102

87:                                               ; preds = %80
  %88 = 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)
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.buzzparser_s, ptr %89, i32 0, i32 8
  store ptr %88, ptr %90, align 8, !tbaa !23
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.buzzparser_s, ptr %91, i32 0, i32 7
  %93 = load ptr, ptr %92, align 8, !tbaa !20
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.buzzparser_s, ptr %94, i32 0, i32 7
  %96 = load ptr, ptr %95, align 8, !tbaa !20
  %97 = getelementptr inbounds %struct.buzzdarray_s, ptr %96, i32 0, i32 1
  %98 = load i64, ptr %97, align 8, !tbaa !21
  %99 = trunc i64 %98 to i32
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.buzzparser_s, ptr %100, i32 0, i32 8
  call void @buzzdarray_insert(ptr noundef %93, i32 noundef %99, ptr noundef %101)
  br label %132

102:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.buzzparser_s, ptr %103, i32 0, i32 7
  %105 = load ptr, ptr %104, align 8, !tbaa !20
  %106 = getelementptr inbounds %struct.buzzdarray_s, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !24
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.buzzparser_s, ptr %108, i32 0, i32 7
  %110 = load ptr, ptr %109, align 8, !tbaa !20
  %111 = getelementptr inbounds %struct.buzzdarray_s, ptr %110, i32 0, i32 1
  %112 = load i64, ptr %111, align 8, !tbaa !21
  %113 = sub nsw i64 %112, 1
  %114 = getelementptr inbounds ptr, ptr %107, i64 %113
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  store ptr %115, ptr %6, align 8, !tbaa !5
  %116 = 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)
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.buzzparser_s, ptr %117, i32 0, i32 8
  store ptr %116, ptr %118, align 8, !tbaa !23
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.buzzparser_s, ptr %119, i32 0, i32 7
  %121 = load ptr, ptr %120, align 8, !tbaa !20
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.buzzparser_s, ptr %122, i32 0, i32 7
  %124 = load ptr, ptr %123, align 8, !tbaa !20
  %125 = getelementptr inbounds %struct.buzzdarray_s, ptr %124, i32 0, i32 1
  %126 = load i64, ptr %125, align 8, !tbaa !21
  %127 = trunc i64 %126 to i32
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.buzzparser_s, ptr %128, i32 0, i32 8
  call void @buzzdarray_insert(ptr noundef %121, i32 noundef %127, ptr noundef %129)
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  call void @buzzdict_foreach(ptr noundef %130, ptr noundef @sym_clone, ptr noundef %131)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %132

132:                                              ; preds = %102, %87
  br label %133

133:                                              ; preds = %132, %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.buzzparser_s, ptr %134, i32 0, i32 8
  %136 = load ptr, ptr %135, align 8, !tbaa !23
  %137 = getelementptr inbounds %struct.buzzdict_s, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 8, !tbaa !25
  store i32 %138, ptr %7, align 4, !tbaa !9
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = call i32 @parse_statlist(ptr noundef %139)
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %244

142:                                              ; preds = %133
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = call i32 @match(ptr noundef %143, i32 noundef 21)
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %148, label %146

146:                                              ; preds = %142
  %147 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %147, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %246

148:                                              ; preds = %142
  br label %149

149:                                              ; preds = %172, %148
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.buzzparser_s, ptr %150, i32 0, i32 4
  call void @buzzlex_destroytok(ptr noundef %151)
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.buzzparser_s, ptr %152, i32 0, i32 3
  %154 = load ptr, ptr %153, align 8, !tbaa !11
  %155 = call ptr @buzzlex_nexttok(ptr noundef %154)
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.buzzparser_s, ptr %156, i32 0, i32 4
  store ptr %155, ptr %157, align 8, !tbaa !13
  br label %158

158:                                              ; preds = %149
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.buzzparser_s, ptr %159, i32 0, i32 4
  %161 = load ptr, ptr %160, align 8, !tbaa !13
  %162 = getelementptr inbounds %struct.buzztok_s, ptr %161, i32 0, i32 0
  %163 = load i32, ptr %162, align 8, !tbaa !14
  %164 = icmp ne i32 %163, 31
  br i1 %164, label %165, label %172

165:                                              ; preds = %158
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.buzzparser_s, ptr %166, i32 0, i32 4
  %168 = load ptr, ptr %167, align 8, !tbaa !13
  %169 = getelementptr inbounds %struct.buzztok_s, ptr %168, i32 0, i32 0
  %170 = load i32, ptr %169, align 8, !tbaa !14
  %171 = icmp eq i32 %170, 26
  br label %172

172:                                              ; preds = %165, %158
  %173 = phi i1 [ false, %158 ], [ %171, %165 ]
  br i1 %173, label %149, label %174, !llvm.loop !27

174:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #4
  %175 = getelementptr inbounds %struct.symdeldata_s, ptr %9, i32 0, i32 0
  %176 = call ptr @buzzdarray_new(i32 noundef 1, i32 noundef 8, ptr noundef null)
  store ptr %176, ptr %175, align 8, !tbaa !28
  %177 = getelementptr inbounds %struct.symdeldata_s, ptr %9, i32 0, i32 1
  %178 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %178, ptr %177, align 8, !tbaa !30
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.buzzparser_s, ptr %179, i32 0, i32 8
  %181 = load ptr, ptr %180, align 8, !tbaa !23
  %182 = getelementptr inbounds %struct.buzzdict_s, ptr %181, i32 0, i32 1
  %183 = load i32, ptr %182, align 8, !tbaa !25
  %184 = load i32, ptr %7, align 4, !tbaa !9
  %185 = sub i32 %183, %184
  %186 = icmp ne i32 %185, 0
  br i1 %186, label %187, label %204

187:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %188 = load ptr, ptr %4, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.buzzparser_s, ptr %188, i32 0, i32 8
  %190 = load ptr, ptr %189, align 8, !tbaa !23
  %191 = getelementptr inbounds %struct.buzzdict_s, ptr %190, i32 0, i32 1
  %192 = load i32, ptr %191, align 8, !tbaa !25
  %193 = load i32, ptr %7, align 4, !tbaa !9
  %194 = sub i32 %192, %193
  %195 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %10, ptr noundef @.str.17, i32 noundef %194) #4
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.buzzparser_s, ptr %196, i32 0, i32 6
  %198 = load ptr, ptr %197, align 8, !tbaa !31
  %199 = load ptr, ptr %10, align 8, !tbaa !5
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.buzzparser_s, ptr %200, i32 0, i32 4
  %202 = load ptr, ptr %201, align 8, !tbaa !13
  call void @chunk_addcode(ptr noundef %198, ptr noundef %199, ptr noundef %202)
  %203 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %203) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %204

204:                                              ; preds = %187, %174
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.buzzparser_s, ptr %205, i32 0, i32 8
  %207 = load ptr, ptr %206, align 8, !tbaa !23
  call void @buzzdict_foreach(ptr noundef %207, ptr noundef @buzzparser_symtodel, ptr noundef %9)
  %208 = getelementptr inbounds %struct.symdeldata_s, ptr %9, i32 0, i32 0
  %209 = load ptr, ptr %208, align 8, !tbaa !28
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.buzzparser_s, ptr %210, i32 0, i32 8
  %212 = load ptr, ptr %211, align 8, !tbaa !23
  call void @buzzdarray_foreach(ptr noundef %209, ptr noundef @buzzparser_symdel, ptr noundef %212)
  %213 = getelementptr inbounds %struct.symdeldata_s, ptr %9, i32 0, i32 0
  call void @buzzdarray_destroy(ptr noundef %213)
  %214 = load i32, ptr %5, align 4, !tbaa !9
  %215 = icmp ne i32 %214, 0
  br i1 %215, label %216, label %242

216:                                              ; preds = %204
  %217 = load ptr, ptr %4, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.buzzparser_s, ptr %217, i32 0, i32 7
  %219 = load ptr, ptr %218, align 8, !tbaa !20
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.buzzparser_s, ptr %220, i32 0, i32 7
  %222 = load ptr, ptr %221, align 8, !tbaa !20
  %223 = getelementptr inbounds %struct.buzzdarray_s, ptr %222, i32 0, i32 1
  %224 = load i64, ptr %223, align 8, !tbaa !21
  %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 %4, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.buzzparser_s, ptr %227, i32 0, i32 7
  %229 = load ptr, ptr %228, align 8, !tbaa !20
  %230 = getelementptr inbounds %struct.buzzdarray_s, ptr %229, i32 0, i32 0
  %231 = load ptr, ptr %230, align 8, !tbaa !24
  %232 = load ptr, ptr %4, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.buzzparser_s, ptr %232, i32 0, i32 7
  %234 = load ptr, ptr %233, align 8, !tbaa !20
  %235 = getelementptr inbounds %struct.buzzdarray_s, ptr %234, i32 0, i32 1
  %236 = load i64, ptr %235, align 8, !tbaa !21
  %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 %4, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.buzzparser_s, ptr %240, i32 0, i32 8
  store ptr %239, ptr %241, align 8, !tbaa !23
  br label %242

242:                                              ; preds = %216, %204
  %243 = load i32, ptr @PARSE_OK, align 4, !tbaa !9
  store i32 %243, ptr %3, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #4
  br label %246

244:                                              ; preds = %133
  %245 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !9
  store i32 %245, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %246

246:                                              ; preds = %244, %242, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %247

247:                                              ; preds = %246, %75, %14
  %248 = load i32, ptr %3, align 4
  ret i32 %248
}

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

declare void @buzzdarray_destroy(ptr noundef) #1

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

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 = distinct !{!19, !18}
!20 = !{!12, !6, i64 56}
!21 = !{!22, !16, i64 8}
!22 = !{!"buzzdarray_s", !6, i64 0, !16, i64 8, !10, i64 16, !10, i64 20, !6, i64 24}
!23 = !{!12, !6, i64 64}
!24 = !{!22, !6, i64 0}
!25 = !{!26, !10, i64 8}
!26 = !{!"buzzdict_s", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44}
!27 = distinct !{!27, !18}
!28 = !{!29, !6, i64 0}
!29 = !{!"symdeldata_s", !6, i64 0, !10, i64 8}
!30 = !{!29, !10, i64 8}
!31 = !{!12, !6, i64 48}


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

%struct.symdeldata_s = type { ptr, i32 }

@PARSE_ERROR = external hidden local_unnamed_addr global i32, align 4
@PARSE_OK = external hidden local_unnamed_addr global i32, align 4
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

; 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 #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_statlist(ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @parse_block(ptr noundef %0, i32 noundef %1) local_unnamed_addr #3 {
  %3 = alloca %struct.symdeldata_s, align 8
  %4 = alloca ptr, align 8
  %5 = tail call i32 @match(ptr noundef %0, i32 noundef 20)
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %8, label %.preheader67

.preheader67:                                     ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  br label %10

8:                                                ; preds = %2
  %9 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !5
  br label %91

10:                                               ; preds = %.preheader67, %10
  tail call void @buzzlex_destroytok(ptr noundef nonnull %6) #5
  %11 = load ptr, ptr %7, align 8, !tbaa !9
  %12 = tail call ptr @buzzlex_nexttok(ptr noundef %11) #5
  store ptr %12, ptr %6, align 8, !tbaa !12
  %13 = load i32, ptr %12, align 8, !tbaa !13
  switch i32 %13, label %18 [
    i32 26, label %10
    i32 21, label %.preheader66
  ]

.preheader66:                                     ; preds = %10, %.preheader66
  tail call void @buzzlex_destroytok(ptr noundef nonnull %6) #5
  %14 = load ptr, ptr %7, align 8, !tbaa !9
  %15 = tail call ptr @buzzlex_nexttok(ptr noundef %14) #5
  store ptr %15, ptr %6, align 8, !tbaa !12
  %16 = load i32, ptr %15, align 8, !tbaa !13
  %cond64 = icmp eq i32 %16, 26
  br i1 %cond64, label %.preheader66, label %.critedge2

.critedge2:                                       ; preds = %.preheader66
  %17 = load i32, ptr @PARSE_OK, align 4, !tbaa !5
  br label %91

18:                                               ; preds = %10
  %.not58 = icmp eq i32 %1, 0
  br i1 %.not58, label %43, label %19

19:                                               ; preds = %18
  %20 = getelementptr inbounds i8, ptr %0, i64 56
  %21 = load ptr, ptr %20, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = load i64, ptr %22, align 8, !tbaa !17
  %24 = icmp eq i64 %23, 1
  br i1 %24, label %25, label %32

25:                                               ; preds = %19
  %26 = 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
  %27 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %26, ptr %27, align 8, !tbaa !19
  %28 = load ptr, ptr %20, align 8, !tbaa !16
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = load i64, ptr %29, align 8, !tbaa !17
  %31 = trunc i64 %30 to i32
  tail call void @buzzdarray_insert(ptr noundef %28, i32 noundef %31, ptr noundef nonnull %27) #5
  br label %43

32:                                               ; preds = %19
  %33 = load ptr, ptr %21, align 8, !tbaa !20
  %34 = getelementptr ptr, ptr %33, i64 %23
  %35 = getelementptr i8, ptr %34, i64 -8
  %36 = load ptr, ptr %35, align 8, !tbaa !21
  %37 = 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
  %38 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %37, ptr %38, align 8, !tbaa !19
  %39 = load ptr, ptr %20, align 8, !tbaa !16
  %40 = getelementptr inbounds i8, ptr %39, i64 8
  %41 = load i64, ptr %40, align 8, !tbaa !17
  %42 = trunc i64 %41 to i32
  tail call void @buzzdarray_insert(ptr noundef %39, i32 noundef %42, ptr noundef nonnull %38) #5
  tail call void @buzzdict_foreach(ptr noundef %36, ptr noundef nonnull @sym_clone, ptr noundef nonnull %0) #5
  br label %43

43:                                               ; preds = %25, %32, %18
  %44 = getelementptr inbounds i8, ptr %0, i64 64
  %45 = load ptr, ptr %44, align 8, !tbaa !19
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %47 = load i32, ptr %46, align 8, !tbaa !22
  %48 = tail call i32 @parse_statlist(ptr noundef nonnull %0)
  %.not59 = icmp eq i32 %48, 0
  br i1 %.not59, label %89, label %49

49:                                               ; preds = %43
  %50 = tail call i32 @match(ptr noundef nonnull %0, i32 noundef 21)
  %.not60 = icmp eq i32 %50, 0
  br i1 %.not60, label %51, label %.preheader

51:                                               ; preds = %49
  %52 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !5
  br label %91

.preheader:                                       ; preds = %49, %.preheader
  tail call void @buzzlex_destroytok(ptr noundef nonnull %6) #5
  %53 = load ptr, ptr %7, align 8, !tbaa !9
  %54 = tail call ptr @buzzlex_nexttok(ptr noundef %53) #5
  store ptr %54, ptr %6, align 8, !tbaa !12
  %55 = load i32, ptr %54, align 8, !tbaa !13
  %cond65 = icmp eq i32 %55, 26
  br i1 %cond65, label %.preheader, label %.critedge4

.critedge4:                                       ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  %56 = tail call ptr @buzzdarray_new(i32 noundef 1, i32 noundef 8, ptr noundef null) #5
  store ptr %56, ptr %3, align 8, !tbaa !24
  %57 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %47, ptr %57, align 8, !tbaa !26
  %58 = load ptr, ptr %44, align 8, !tbaa !19
  %59 = getelementptr inbounds i8, ptr %58, i64 8
  %60 = load i32, ptr %59, align 8, !tbaa !22
  %.not62 = icmp eq i32 %60, %47
  br i1 %.not62, label %69, label %61

61:                                               ; preds = %.critedge4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %62 = sub i32 %60, %47
  %63 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.17, i32 noundef %62) #5
  %64 = getelementptr inbounds i8, ptr %0, i64 48
  %65 = load ptr, ptr %64, align 8, !tbaa !27
  %66 = load ptr, ptr %4, align 8, !tbaa !21
  %67 = load ptr, ptr %6, align 8, !tbaa !12
  call void @chunk_addcode(ptr noundef %65, ptr noundef %66, ptr noundef %67)
  %68 = load ptr, ptr %4, align 8, !tbaa !21
  call void @free(ptr noundef %68) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %.pre = load ptr, ptr %44, align 8, !tbaa !19
  br label %69

69:                                               ; preds = %61, %.critedge4
  %70 = phi ptr [ %.pre, %61 ], [ %58, %.critedge4 ]
  call void @buzzdict_foreach(ptr noundef %70, ptr noundef nonnull @buzzparser_symtodel, ptr noundef nonnull %3) #5
  %71 = load ptr, ptr %3, align 8, !tbaa !24
  %72 = load ptr, ptr %44, align 8, !tbaa !19
  call void @buzzdarray_foreach(ptr noundef %71, ptr noundef nonnull @buzzparser_symdel, ptr noundef %72) #5
  call void @buzzdarray_destroy(ptr noundef nonnull %3) #5
  br i1 %.not58, label %87, label %73

73:                                               ; preds = %69
  %74 = getelementptr inbounds i8, ptr %0, i64 56
  %75 = load ptr, ptr %74, align 8, !tbaa !16
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %77 = load i64, ptr %76, align 8, !tbaa !17
  %78 = trunc i64 %77 to i32
  %79 = add i32 %78, -1
  call void @buzzdarray_remove(ptr noundef %75, i32 noundef %79) #5
  %80 = load ptr, ptr %74, align 8, !tbaa !16
  %81 = load ptr, ptr %80, align 8, !tbaa !20
  %82 = getelementptr inbounds i8, ptr %80, i64 8
  %83 = load i64, ptr %82, align 8, !tbaa !17
  %84 = getelementptr ptr, ptr %81, i64 %83
  %85 = getelementptr i8, ptr %84, i64 -8
  %86 = load ptr, ptr %85, align 8, !tbaa !21
  store ptr %86, ptr %44, align 8, !tbaa !19
  br label %87

87:                                               ; preds = %73, %69
  %88 = load i32, ptr @PARSE_OK, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  br label %91

89:                                               ; preds = %43
  %90 = load i32, ptr @PARSE_ERROR, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %51, %87, %89, %.critedge2, %8
  %.1 = phi i32 [ %17, %.critedge2 ], [ %9, %8 ], [ %88, %87 ], [ %52, %51 ], [ %90, %89 ]
  ret i32 %.1
}

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

declare void @buzzdarray_destroy(ptr noundef) local_unnamed_addr #1

declare void @buzzdarray_remove(ptr noundef, i32 noundef) local_unnamed_addr #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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 24}
!10 = !{!"buzzparser_s", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !6, i64 80}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !11, i64 32}
!13 = !{!14, !6, i64 0}
!14 = !{!"buzztok_s", !6, i64 0, !11, i64 8, !15, i64 16, !15, i64 24, !11, i64 32}
!15 = !{!"long", !7, i64 0}
!16 = !{!10, !11, i64 56}
!17 = !{!18, !15, i64 8}
!18 = !{!"buzzdarray_s", !11, i64 0, !15, i64 8, !6, i64 16, !6, i64 20, !11, i64 24}
!19 = !{!10, !11, i64 64}
!20 = !{!18, !11, i64 0}
!21 = !{!11, !11, i64 0}
!22 = !{!23, !6, i64 8}
!23 = !{!"buzzdict_s", !11, i64 0, !6, i64 8, !6, i64 12, !11, i64 16, !11, i64 24, !11, i64 32, !6, i64 40, !6, i64 44}
!24 = !{!25, !11, i64 0}
!25 = !{!"symdeldata_s", !11, i64 0, !6, i64 8}
!26 = !{!25, !6, i64 8}
!27 = !{!10, !11, i64 48}


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