; LLVM IR from libtcod/libtcod :: src/libtcod (parser_c)

; 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.TCOD_parser_listener_t = type { ptr, ptr, ptr, ptr, ptr }
%struct.TCOD_lex_t = type { i32, i32, i32, i32, float, ptr, i32, i8, ptr, ptr, ptr, ptr, i32, i32, i32, [100 x [5 x i8]], [100 x [20 x i8]], ptr, ptr, ptr, ptr, ptr, i8, i8, i8 }
%struct.TCOD_Parser = type { ptr, [16 x ptr], i8, ptr }
%struct.TCOD_ParserStruct = type { ptr, ptr, ptr, ptr, ptr }

@lex = external hidden global ptr, align 8
@listener = external hidden global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@default_listener = external hidden global %struct.TCOD_parser_listener_t, align 8
@default_props = external hidden global ptr, align 8
@symbols = external hidden global [11 x ptr], align 16
@keywords = external hidden global [9 x ptr], align 16
@.str.24 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @TCOD_parser_error(ptr noundef, ...) #0

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

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

declare ptr @TCOD_list_begin(ptr noundef) #2

declare ptr @TCOD_list_end(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

declare ptr @TCOD_list_new() #2

declare void @TCOD_lex_savepoint(ptr noundef, ptr noundef) #2

declare i32 @TCOD_lex_parse(ptr noundef) #2

declare void @TCOD_lex_restore(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

; Function Attrs: nounwind
declare ptr @strcat(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strchr(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @TCOD_parser_new_struct(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @TCOD_parser_run(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [1024 x i8], align 16
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca [128 x i8], align 16
  %11 = alloca [258 x i8], align 16
  %12 = alloca %struct.TCOD_lex_t, align 8
  %13 = alloca i8, align 1
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %28, label %19

19:                                               ; preds = %3
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.TCOD_Parser, ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = icmp ne ptr %22, null
  br i1 %23, label %28, label %24

24:                                               ; preds = %19
  %25 = call ptr @TCOD_list_new()
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.TCOD_Parser, ptr %26, i32 0, i32 3
  store ptr %25, ptr %27, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %24, %19, %3
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %33

31:                                               ; preds = %28
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  br label %34

33:                                               ; preds = %28
  br label %34

34:                                               ; preds = %33, %31
  %35 = phi ptr [ %32, %31 ], [ @default_listener, %33 ]
  store ptr %35, ptr @listener, align 8, !tbaa !5
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.TCOD_Parser, ptr %36, i32 0, i32 3
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  store ptr %38, ptr @default_props, align 8, !tbaa !5
  %39 = call ptr @TCOD_lex_new(ptr noundef @symbols, ptr noundef @keywords, ptr noundef @.str.24, ptr noundef @.str.25, ptr noundef @.str.26, ptr noundef null, ptr noundef @.str.27, i32 noundef 2)
  store ptr %39, ptr @lex, align 8, !tbaa !5
  %40 = load ptr, ptr @lex, align 8, !tbaa !5
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = call zeroext i1 @TCOD_lex_set_data_file(ptr noundef %40, ptr noundef %41)
  br i1 %42, label %51, label %43

43:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 1024, ptr %7) #5
  %44 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  %45 = call ptr @TCOD_get_error()
  %46 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %44, ptr noundef @.str.28, ptr noundef %45) #5
  %47 = load ptr, ptr @listener, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.TCOD_parser_listener_t, ptr %47, i32 0, i32 4
  %49 = load ptr, ptr %48, align 8, !tbaa !12
  %50 = getelementptr inbounds [1024 x i8], ptr %7, i64 0, i64 0
  call void %49(ptr noundef %50)
  call void @llvm.lifetime.end.p0(i64 1024, ptr %7) #5
  br label %248

51:                                               ; preds = %34
  br label %52

52:                                               ; preds = %239, %51
  %53 = load ptr, ptr @lex, align 8, !tbaa !5
  %54 = call i32 @TCOD_lex_parse(ptr noundef %53)
  %55 = load ptr, ptr @lex, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.TCOD_lex_t, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !14
  %58 = icmp eq i32 %57, 8
  br i1 %58, label %64, label %59

59:                                               ; preds = %52
  %60 = load ptr, ptr @lex, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.TCOD_lex_t, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !14
  %63 = icmp eq i32 %62, -1
  br i1 %63, label %64, label %65

64:                                               ; preds = %59, %52
  br label %240

65:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  store i8 0, ptr %8, align 1, !tbaa !18
  %66 = load ptr, ptr @lex, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.TCOD_lex_t, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !14
  %69 = icmp eq i32 %68, 2
  br i1 %69, label %70, label %84

70:                                               ; preds = %65
  %71 = load ptr, ptr @lex, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.TCOD_lex_t, ptr %71, i32 0, i32 5
  %73 = load ptr, ptr %72, align 8, !tbaa !19
  %74 = call i32 @strcmp(ptr noundef %73, ptr noundef @.str.29) #6
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %79

76:                                               ; preds = %70
  store i8 1, ptr %8, align 1, !tbaa !18
  %77 = load ptr, ptr @lex, align 8, !tbaa !5
  %78 = call i32 @TCOD_lex_parse(ptr noundef %77)
  br label %83

79:                                               ; preds = %70
  %80 = load ptr, ptr @lex, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.TCOD_lex_t, ptr %80, i32 0, i32 5
  %82 = load ptr, ptr %81, align 8, !tbaa !19
  call void (ptr, ...) @TCOD_parser_error(ptr noundef @.str.30, ptr noundef %82)
  store i32 1, ptr %9, align 4
  br label %237

83:                                               ; preds = %76
  br label %84

84:                                               ; preds = %83, %65
  %85 = load ptr, ptr @lex, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.TCOD_lex_t, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !14
  %88 = icmp ne i32 %87, 3
  br i1 %88, label %89, label %90

89:                                               ; preds = %84
  call void (ptr, ...) @TCOD_parser_error(ptr noundef @.str.31)
  store i32 1, ptr %9, align 4
  br label %237

90:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 128, ptr %10) #5
  %91 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %92 = load ptr, ptr @lex, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.TCOD_lex_t, ptr %92, i32 0, i32 5
  %94 = load ptr, ptr %93, align 8, !tbaa !19
  %95 = call zeroext i1 @string_copy(ptr noundef %91, ptr noundef %94, i32 noundef 128)
  call void @llvm.lifetime.start.p0(i64 258, ptr %11) #5
  %96 = getelementptr inbounds [258 x i8], ptr %11, i64 0, i64 0
  %97 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %98 = call ptr @strcpy(ptr noundef %96, ptr noundef %97) #5
  call void @llvm.lifetime.start.p0(i64 2632, ptr %12) #5
  %99 = load ptr, ptr @lex, align 8, !tbaa !5
  call void @TCOD_lex_savepoint(ptr noundef %99, ptr noundef %12)
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  store i8 0, ptr %13, align 1, !tbaa !18
  %100 = load ptr, ptr @lex, align 8, !tbaa !5
  %101 = call i32 @TCOD_lex_parse(ptr noundef %100)
  %102 = icmp eq i32 %101, 4
  br i1 %102, label %103, label %121

103:                                              ; preds = %90
  %104 = getelementptr inbounds [258 x i8], ptr %11, i64 0, i64 0
  %105 = call ptr @strcat(ptr noundef %104, ptr noundef @.str.9) #5
  %106 = load ptr, ptr @lex, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.TCOD_lex_t, ptr %106, i32 0, i32 5
  %108 = load ptr, ptr %107, align 8, !tbaa !19
  %109 = call i64 @strlen(ptr noundef %108) #6
  %110 = icmp uge i64 %109, 128
  br i1 %110, label %111, label %115

111:                                              ; preds = %103
  %112 = load ptr, ptr @lex, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.TCOD_lex_t, ptr %112, i32 0, i32 5
  %114 = load ptr, ptr %113, align 8, !tbaa !19
  call void (ptr, ...) @TCOD_parser_error(ptr noundef @.str.32, ptr noundef %114, i32 noundef 127)
  store i32 1, ptr %9, align 4
  br label %236

115:                                              ; preds = %103
  %116 = getelementptr inbounds [258 x i8], ptr %11, i64 0, i64 0
  %117 = load ptr, ptr @lex, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.TCOD_lex_t, ptr %117, i32 0, i32 5
  %119 = load ptr, ptr %118, align 8, !tbaa !19
  %120 = call ptr @strcat(ptr noundef %116, ptr noundef %119) #5
  store i8 1, ptr %13, align 1, !tbaa !18
  br label %121

121:                                              ; preds = %115, %90
  %122 = load ptr, ptr @lex, align 8, !tbaa !5
  call void @TCOD_lex_restore(ptr noundef %122, ptr noundef %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr null, ptr %14, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %205, %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.TCOD_Parser, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !20
  %127 = call ptr @TCOD_list_begin(ptr noundef %126)
  store ptr %127, ptr %15, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %148, %123
  %129 = load ptr, ptr %15, align 8, !tbaa !5
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.TCOD_Parser, ptr %130, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !20
  %133 = call ptr @TCOD_list_end(ptr noundef %132)
  %134 = icmp ne ptr %129, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %128
  store i32 6, ptr %9, align 4
  br label %151

136:                                              ; preds = %128
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  %138 = load ptr, ptr %137, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.TCOD_ParserStruct, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !21
  %141 = getelementptr inbounds [258 x i8], ptr %11, i64 0, i64 0
  %142 = call i32 @strcmp(ptr noundef %140, ptr noundef %141) #6
  %143 = icmp eq i32 %142, 0
  br i1 %143, label %144, label %147

144:                                              ; preds = %136
  %145 = load ptr, ptr %15, align 8, !tbaa !5
  %146 = load ptr, ptr %145, align 8, !tbaa !5
  store ptr %146, ptr %14, align 8, !tbaa !5
  store i32 6, ptr %9, align 4
  br label %151

147:                                              ; preds = %136
  br label %148

148:                                              ; preds = %147
  %149 = load ptr, ptr %15, align 8, !tbaa !5
  %150 = getelementptr inbounds ptr, ptr %149, i32 1
  store ptr %150, ptr %15, align 8, !tbaa !5
  br label %128, !llvm.loop !23

151:                                              ; preds = %144, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %152

152:                                              ; preds = %151
  %153 = load ptr, ptr %14, align 8, !tbaa !5
  %154 = icmp eq ptr %153, null
  br i1 %154, label %155, label %188

155:                                              ; preds = %152
  %156 = load i8, ptr %13, align 1, !tbaa !18, !range !25, !noundef !26
  %157 = trunc i8 %156 to i1
  br i1 %157, label %158, label %188

158:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.TCOD_Parser, ptr %159, i32 0, i32 0
  %161 = load ptr, ptr %160, align 8, !tbaa !20
  %162 = call ptr @TCOD_list_begin(ptr noundef %161)
  store ptr %162, ptr %16, align 8, !tbaa !5
  br label %163

163:                                              ; preds = %183, %158
  %164 = load ptr, ptr %16, align 8, !tbaa !5
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.TCOD_Parser, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !20
  %168 = call ptr @TCOD_list_end(ptr noundef %167)
  %169 = icmp ne ptr %164, %168
  br i1 %169, label %171, label %170

170:                                              ; preds = %163
  store i32 9, ptr %9, align 4
  br label %186

171:                                              ; preds = %163
  %172 = load ptr, ptr %16, align 8, !tbaa !5
  %173 = load ptr, ptr %172, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.TCOD_ParserStruct, ptr %173, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !21
  %176 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %177 = call i32 @strcmp(ptr noundef %175, ptr noundef %176) #6
  %178 = icmp eq i32 %177, 0
  br i1 %178, label %179, label %182

179:                                              ; preds = %171
  %180 = load ptr, ptr %16, align 8, !tbaa !5
  %181 = load ptr, ptr %180, align 8, !tbaa !5
  store ptr %181, ptr %14, align 8, !tbaa !5
  store i32 9, ptr %9, align 4
  br label %186

182:                                              ; preds = %171
  br label %183

183:                                              ; preds = %182
  %184 = load ptr, ptr %16, align 8, !tbaa !5
  %185 = getelementptr inbounds ptr, ptr %184, i32 1
  store ptr %185, ptr %16, align 8, !tbaa !5
  br label %163, !llvm.loop !27

186:                                              ; preds = %179, %170
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187, %155, %152
  %189 = load ptr, ptr %14, align 8, !tbaa !5
  %190 = icmp eq ptr %189, null
  br i1 %190, label %191, label %198

191:                                              ; preds = %188
  %192 = load i8, ptr %8, align 1, !tbaa !18, !range !25, !noundef !26
  %193 = trunc i8 %192 to i1
  br i1 %193, label %194, label %198

194:                                              ; preds = %191
  %195 = load ptr, ptr %4, align 8, !tbaa !5
  %196 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %197 = call ptr @TCOD_parser_new_struct(ptr noundef %195, ptr noundef %196)
  br label %198

198:                                              ; preds = %194, %191, %188
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr %14, align 8, !tbaa !5
  %201 = icmp eq ptr %200, null
  br i1 %201, label %202, label %205

202:                                              ; preds = %199
  %203 = load i8, ptr %8, align 1, !tbaa !18, !range !25, !noundef !26
  %204 = trunc i8 %203 to i1
  br label %205

205:                                              ; preds = %202, %199
  %206 = phi i1 [ false, %199 ], [ %204, %202 ]
  br i1 %206, label %123, label %207, !llvm.loop !28

207:                                              ; preds = %205
  %208 = load ptr, ptr %14, align 8, !tbaa !5
  %209 = icmp eq ptr %208, null
  br i1 %209, label %210, label %212

210:                                              ; preds = %207
  %211 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  call void (ptr, ...) @TCOD_parser_error(ptr noundef @.str.33, ptr noundef %211)
  store i32 1, ptr %9, align 4
  br label %235

212:                                              ; preds = %207
  %213 = load ptr, ptr @listener, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.TCOD_parser_listener_t, ptr %213, i32 0, i32 0
  %215 = load ptr, ptr %214, align 8, !tbaa !29
  %216 = load ptr, ptr %14, align 8, !tbaa !5
  %217 = load i8, ptr %13, align 1, !tbaa !18, !range !25, !noundef !26
  %218 = trunc i8 %217 to i1
  br i1 %218, label %219, label %223

219:                                              ; preds = %212
  %220 = getelementptr inbounds [258 x i8], ptr %11, i64 0, i64 0
  %221 = call ptr @strchr(ptr noundef %220, i32 noundef 35) #6
  %222 = getelementptr inbounds i8, ptr %221, i64 1
  br label %224

223:                                              ; preds = %212
  br label %224

224:                                              ; preds = %223, %219
  %225 = phi ptr [ %222, %219 ], [ null, %223 ]
  %226 = call zeroext i1 %215(ptr noundef %216, ptr noundef %225)
  br i1 %226, label %228, label %227

227:                                              ; preds = %224
  store i32 1, ptr %9, align 4
  br label %235

228:                                              ; preds = %224
  %229 = load ptr, ptr %4, align 8, !tbaa !5
  %230 = load ptr, ptr %14, align 8, !tbaa !5
  %231 = call zeroext i1 @TCOD_parser_parse_entity(ptr noundef %229, ptr noundef %230)
  br i1 %231, label %233, label %232

232:                                              ; preds = %228
  store i32 1, ptr %9, align 4
  br label %235

233:                                              ; preds = %228
  br label %234

234:                                              ; preds = %233
  store i32 0, ptr %9, align 4
  br label %235

235:                                              ; preds = %234, %232, %227, %210
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %236

236:                                              ; preds = %235, %111
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 2632, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 258, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %10) #5
  br label %237

237:                                              ; preds = %236, %89, %79
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  %238 = load i32, ptr %9, align 4
  switch i32 %238, label %249 [
    i32 0, label %239
    i32 1, label %248
  ]

239:                                              ; preds = %237
  br label %52

240:                                              ; preds = %64
  %241 = load ptr, ptr @lex, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.TCOD_lex_t, ptr %241, i32 0, i32 1
  %243 = load i32, ptr %242, align 4, !tbaa !14
  %244 = icmp eq i32 %243, -1
  br i1 %244, label %245, label %246

245:                                              ; preds = %240
  call void (ptr, ...) @TCOD_parser_error(ptr noundef @.str.34)
  br label %248

246:                                              ; preds = %240
  %247 = load ptr, ptr @lex, align 8, !tbaa !5
  call void @TCOD_lex_delete(ptr noundef %247)
  br label %248

248:                                              ; preds = %246, %245, %237, %43
  ret void

249:                                              ; preds = %237
  unreachable
}

declare ptr @TCOD_lex_new(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare zeroext i1 @TCOD_lex_set_data_file(ptr noundef, ptr noundef) #2

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

declare ptr @TCOD_get_error() #2

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @string_copy(ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @TCOD_parser_parse_entity(ptr noundef, ptr noundef) #0

declare void @TCOD_lex_delete(ptr noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 willreturn memory(read) "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 }
attributes #6 = { nounwind willreturn memory(read) }

!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, !6, i64 144}
!10 = !{!"TCOD_Parser", !6, i64 0, !7, i64 8, !11, i64 136, !6, i64 144}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!13, !6, i64 32}
!13 = !{!"TCOD_parser_listener_t", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!14 = !{!15, !16, i64 4}
!15 = !{!"TCOD_lex_t", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !17, i64 16, !6, i64 24, !16, i64 32, !7, i64 36, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !16, i64 72, !16, i64 76, !16, i64 80, !7, i64 84, !7, i64 584, !6, i64 2584, !6, i64 2592, !6, i64 2600, !6, i64 2608, !6, i64 2616, !11, i64 2624, !11, i64 2625, !11, i64 2626}
!16 = !{!"int", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{!15, !6, i64 24}
!20 = !{!10, !6, i64 0}
!21 = !{!22, !6, i64 0}
!22 = !{!"TCOD_ParserStruct", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !24}
!28 = distinct !{!28, !24}
!29 = !{!13, !6, i64 0}


; 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.TCOD_parser_listener_t = type { ptr, ptr, ptr, ptr, ptr }
%struct.TCOD_lex_t = type { i32, i32, i32, i32, float, ptr, i32, i8, ptr, ptr, ptr, ptr, i32, i32, i32, [100 x [5 x i8]], [100 x [20 x i8]], ptr, ptr, ptr, ptr, ptr, i8, i8, i8 }

@lex = external hidden local_unnamed_addr global ptr, align 8
@listener = external hidden local_unnamed_addr global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@default_listener = external hidden global %struct.TCOD_parser_listener_t, align 8
@default_props = external hidden local_unnamed_addr global ptr, align 8
@symbols = external hidden global [11 x ptr], align 16
@keywords = external hidden global [9 x ptr], align 16
@.str.24 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @TCOD_parser_error(ptr noundef, ...) local_unnamed_addr #0

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

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

declare ptr @TCOD_list_begin(ptr noundef) local_unnamed_addr #2

declare ptr @TCOD_list_end(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

declare ptr @TCOD_list_new() local_unnamed_addr #2

declare void @TCOD_lex_savepoint(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @TCOD_lex_parse(ptr noundef) local_unnamed_addr #2

declare void @TCOD_lex_restore(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strchr(ptr noundef, i32 noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local void @TCOD_parser_run(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca [1024 x i8], align 16
  %5 = alloca [128 x i8], align 16
  %6 = alloca [258 x i8], align 16
  %7 = alloca %struct.TCOD_lex_t, align 8
  %.not = icmp eq ptr %2, null
  %8 = getelementptr inbounds i8, ptr %0, i64 144
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  br i1 %.not, label %10, label %._crit_edge

10:                                               ; preds = %3
  %.not39 = icmp eq ptr %9, null
  br i1 %.not39, label %11, label %._crit_edge

11:                                               ; preds = %10
  %12 = tail call ptr @TCOD_list_new() #6
  store ptr %12, ptr %8, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %3, %11, %10
  %13 = phi ptr [ %12, %11 ], [ %9, %10 ], [ %9, %3 ]
  %14 = phi ptr [ @default_listener, %11 ], [ @default_listener, %10 ], [ %2, %3 ]
  store ptr %14, ptr @listener, align 8, !tbaa !11
  store ptr %13, ptr @default_props, align 8, !tbaa !11
  %15 = tail call ptr @TCOD_lex_new(ptr noundef nonnull @symbols, ptr noundef nonnull @keywords, ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.26, ptr noundef null, ptr noundef nonnull @.str.27, i32 noundef 2) #6
  store ptr %15, ptr @lex, align 8, !tbaa !11
  %16 = tail call zeroext i1 @TCOD_lex_set_data_file(ptr noundef %15, ptr noundef %1) #6
  br i1 %16, label %.preheader, label %17

17:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %4) #6
  %18 = tail call ptr @TCOD_get_error() #6
  %19 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.28, ptr noundef %18) #6
  %20 = load ptr, ptr @listener, align 8, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %20, i64 32
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  call void %22(ptr noundef nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #6
  br label %.thread59

.preheader:                                       ; preds = %._crit_edge, %123
  %23 = load ptr, ptr @lex, align 8, !tbaa !11
  %24 = call i32 @TCOD_lex_parse(ptr noundef %23) #6
  %25 = load ptr, ptr @lex, align 8, !tbaa !11
  %26 = getelementptr inbounds i8, ptr %25, i64 4
  %27 = load i32, ptr %26, align 4, !tbaa !14
  switch i32 %27, label %28 [
    i32 -1, label %124
    i32 8, label %125
  ]

28:                                               ; preds = %.preheader
  %29 = icmp eq i32 %27, 2
  br i1 %29, label %30, label %38

30:                                               ; preds = %28
  %31 = getelementptr inbounds i8, ptr %25, i64 24
  %32 = load ptr, ptr %31, align 8, !tbaa !18
  %33 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %32, ptr noundef nonnull dereferenceable(1) @.str.29) #7
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %37

35:                                               ; preds = %30
  %36 = call i32 @TCOD_lex_parse(ptr noundef nonnull %25) #6
  %.pre120 = load ptr, ptr @lex, align 8, !tbaa !11
  %.phi.trans.insert121 = getelementptr inbounds i8, ptr %.pre120, i64 4
  %.pre122 = load i32, ptr %.phi.trans.insert121, align 4, !tbaa !14
  br label %38

37:                                               ; preds = %30
  call void (ptr, ...) @TCOD_parser_error(ptr noundef nonnull @.str.30, ptr noundef %32)
  br label %.thread59

38:                                               ; preds = %35, %28
  %39 = phi i32 [ %.pre122, %35 ], [ %27, %28 ]
  %40 = phi ptr [ %.pre120, %35 ], [ %25, %28 ]
  %.not40 = icmp eq i32 %39, 3
  br i1 %.not40, label %42, label %41

41:                                               ; preds = %38
  call void (ptr, ...) @TCOD_parser_error(ptr noundef nonnull @.str.31)
  br label %.thread59

42:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %5) #6
  %43 = getelementptr inbounds i8, ptr %40, i64 24
  %44 = load ptr, ptr %43, align 8, !tbaa !18
  %45 = call zeroext i1 @string_copy(ptr noundef nonnull %5, ptr noundef %44, i32 noundef 128)
  call void @llvm.lifetime.start.p0(i64 258, ptr nonnull %6) #6
  %46 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) %5) #6
  call void @llvm.lifetime.start.p0(i64 2632, ptr nonnull %7) #6
  %47 = load ptr, ptr @lex, align 8, !tbaa !11
  call void @TCOD_lex_savepoint(ptr noundef %47, ptr noundef nonnull %7) #6
  %48 = load ptr, ptr @lex, align 8, !tbaa !11
  %49 = call i32 @TCOD_lex_parse(ptr noundef %48) #6
  %.not66 = icmp eq i32 %49, 4
  br i1 %.not66, label %50, label %.split

50:                                               ; preds = %42
  %51 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.9) #6
  %52 = load ptr, ptr @lex, align 8, !tbaa !11
  %53 = getelementptr inbounds i8, ptr %52, i64 24
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  %55 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %54) #7
  %56 = icmp ugt i64 %55, 127
  br i1 %56, label %57, label %.split.us.preheader

57:                                               ; preds = %50
  call void (ptr, ...) @TCOD_parser_error(ptr noundef nonnull @.str.32, ptr noundef %54, i32 noundef 127)
  br label %.thread63

.split.us.preheader:                              ; preds = %50
  %58 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) %54) #6
  call void @TCOD_lex_restore(ptr noundef nonnull %52, ptr noundef nonnull %7) #6
  br label %.split.us

.split.us:                                        ; preds = %.split.us.preheader, %.thread53.us
  %59 = load ptr, ptr %0, align 8, !tbaa !19
  %60 = call ptr @TCOD_list_begin(ptr noundef %59) #6
  %61 = load ptr, ptr %0, align 8, !tbaa !19
  %62 = call ptr @TCOD_list_end(ptr noundef %61) #6
  %.not4179.us = icmp eq ptr %60, %62
  br i1 %.not4179.us, label %._crit_edge.us, label %.lr.ph.us

63:                                               ; preds = %.lr.ph.us
  %64 = getelementptr inbounds i8, ptr %.03180.us, i64 8
  %65 = load ptr, ptr %0, align 8, !tbaa !19
  %66 = call ptr @TCOD_list_end(ptr noundef %65) #6
  %.not41.us = icmp eq ptr %64, %66
  br i1 %.not41.us, label %._crit_edge.us, label %.lr.ph.us, !llvm.loop !20

.lr.ph.us:                                        ; preds = %.split.us, %63
  %.03180.us = phi ptr [ %64, %63 ], [ %60, %.split.us ]
  %67 = load ptr, ptr %.03180.us, align 8, !tbaa !11
  %68 = load ptr, ptr %67, align 8, !tbaa !22
  %69 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %68, ptr noundef nonnull dereferenceable(1) %6) #7
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %.thread53.us, label %63

._crit_edge.us:                                   ; preds = %63, %.split.us
  %71 = load ptr, ptr %0, align 8, !tbaa !19
  %72 = call ptr @TCOD_list_begin(ptr noundef %71) #6
  %73 = load ptr, ptr %0, align 8, !tbaa !19
  %74 = call ptr @TCOD_list_end(ptr noundef %73) #6
  %.not4281.us = icmp eq ptr %72, %74
  br i1 %.not4281.us, label %.thread.us, label %.lr.ph84.us

75:                                               ; preds = %.lr.ph84.us
  %76 = getelementptr inbounds i8, ptr %.082.us, i64 8
  %77 = load ptr, ptr %0, align 8, !tbaa !19
  %78 = call ptr @TCOD_list_end(ptr noundef %77) #6
  %.not42.us = icmp eq ptr %76, %78
  br i1 %.not42.us, label %.thread.us, label %.lr.ph84.us, !llvm.loop !24

.lr.ph84.us:                                      ; preds = %._crit_edge.us, %75
  %.082.us = phi ptr [ %76, %75 ], [ %72, %._crit_edge.us ]
  %79 = load ptr, ptr %.082.us, align 8, !tbaa !11
  %80 = load ptr, ptr %79, align 8, !tbaa !22
  %81 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %80, ptr noundef nonnull dereferenceable(1) %5) #7
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %.thread.us91, label %75

.thread.us:                                       ; preds = %75, %._crit_edge.us
  br i1 %29, label %83, label %.thread53.us

83:                                               ; preds = %.thread.us
  %84 = call ptr @TCOD_parser_new_struct(ptr noundef nonnull %0, ptr noundef nonnull %5)
  br label %.thread53.us

.thread53.us:                                     ; preds = %.lr.ph.us, %83, %.thread.us
  %85 = phi i1 [ true, %.thread.us ], [ true, %83 ], [ false, %.lr.ph.us ]
  %.358.us = phi ptr [ null, %.thread.us ], [ null, %83 ], [ %67, %.lr.ph.us ]
  %86 = and i1 %29, %85
  br i1 %86, label %.split.us, label %.split86.us, !llvm.loop !25

.split:                                           ; preds = %42
  %87 = load ptr, ptr @lex, align 8, !tbaa !11
  call void @TCOD_lex_restore(ptr noundef %87, ptr noundef nonnull %7) #6
  br i1 %29, label %.split.split, label %.split.split.us

.split.split.us:                                  ; preds = %.split
  %88 = load ptr, ptr %0, align 8, !tbaa !19
  %89 = call ptr @TCOD_list_begin(ptr noundef %88) #6
  %90 = load ptr, ptr %0, align 8, !tbaa !19
  %91 = call ptr @TCOD_list_end(ptr noundef %90) #6
  %.not4179.us88 = icmp eq ptr %89, %91
  br i1 %.not4179.us88, label %.thread.us91.thread, label %.lr.ph.us98

92:                                               ; preds = %.lr.ph.us98
  %93 = getelementptr inbounds i8, ptr %.03180.us90, i64 8
  %94 = load ptr, ptr %0, align 8, !tbaa !19
  %95 = call ptr @TCOD_list_end(ptr noundef %94) #6
  %.not41.us89 = icmp eq ptr %93, %95
  br i1 %.not41.us89, label %.thread.us91.thread, label %.lr.ph.us98, !llvm.loop !20

.lr.ph.us98:                                      ; preds = %.split.split.us, %92
  %.03180.us90 = phi ptr [ %93, %92 ], [ %89, %.split.split.us ]
  %96 = load ptr, ptr %.03180.us90, align 8, !tbaa !11
  %97 = load ptr, ptr %96, align 8, !tbaa !22
  %98 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %97, ptr noundef nonnull dereferenceable(1) %6) #7
  %99 = icmp eq i32 %98, 0
  br i1 %99, label %.thread.us91, label %92

.split.split:                                     ; preds = %.split, %.thread53
  %100 = load ptr, ptr %0, align 8, !tbaa !19
  %101 = call ptr @TCOD_list_begin(ptr noundef %100) #6
  %102 = load ptr, ptr %0, align 8, !tbaa !19
  %103 = call ptr @TCOD_list_end(ptr noundef %102) #6
  %.not4179 = icmp eq ptr %101, %103
  br i1 %.not4179, label %.thread53, label %.lr.ph

104:                                              ; preds = %.lr.ph
  %105 = getelementptr inbounds i8, ptr %.03180, i64 8
  %106 = load ptr, ptr %0, align 8, !tbaa !19
  %107 = call ptr @TCOD_list_end(ptr noundef %106) #6
  %.not41 = icmp eq ptr %105, %107
  br i1 %.not41, label %.thread53, label %.lr.ph, !llvm.loop !20

.lr.ph:                                           ; preds = %.split.split, %104
  %.03180 = phi ptr [ %105, %104 ], [ %101, %.split.split ]
  %108 = load ptr, ptr %.03180, align 8, !tbaa !11
  %109 = load ptr, ptr %108, align 8, !tbaa !22
  %110 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %109, ptr noundef nonnull dereferenceable(1) %6) #7
  %111 = icmp eq i32 %110, 0
  br i1 %111, label %.thread.us91, label %104

.thread53:                                        ; preds = %104, %.split.split
  %112 = call ptr @TCOD_parser_new_struct(ptr noundef nonnull %0, ptr noundef nonnull %5)
  br label %.split.split, !llvm.loop !25

.split86.us:                                      ; preds = %.thread53.us
  br i1 %85, label %.thread.us91.thread, label %.thread.us91

.thread.us91.thread:                              ; preds = %.split.split.us, %.split86.us, %92
  call void (ptr, ...) @TCOD_parser_error(ptr noundef nonnull @.str.33, ptr noundef nonnull %5)
  br label %.thread63

.thread.us91:                                     ; preds = %.lr.ph.us98, %.lr.ph, %.lr.ph84.us, %.split86.us
  %.us-phi87132 = phi ptr [ %.358.us, %.split86.us ], [ %79, %.lr.ph84.us ], [ %108, %.lr.ph ], [ %96, %.lr.ph.us98 ]
  %113 = load ptr, ptr @listener, align 8, !tbaa !11
  %114 = load ptr, ptr %113, align 8, !tbaa !26
  br i1 %.not66, label %115, label %118

115:                                              ; preds = %.thread.us91
  %116 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %6, i32 noundef 35) #7
  %117 = getelementptr inbounds i8, ptr %116, i64 1
  br label %118

118:                                              ; preds = %.thread.us91, %115
  %119 = phi ptr [ %117, %115 ], [ null, %.thread.us91 ]
  %120 = call zeroext i1 %114(ptr noundef nonnull %.us-phi87132, ptr noundef %119) #6
  br i1 %120, label %121, label %.thread63

121:                                              ; preds = %118
  %122 = call zeroext i1 @TCOD_parser_parse_entity(ptr noundef nonnull %0, ptr noundef nonnull %.us-phi87132)
  br i1 %122, label %123, label %.thread63

.thread63:                                        ; preds = %118, %121, %57, %.thread.us91.thread
  call void @llvm.lifetime.end.p0(i64 2632, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 258, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %5) #6
  br label %.thread59

123:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 2632, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 258, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %5) #6
  br label %.preheader

124:                                              ; preds = %.preheader
  call void (ptr, ...) @TCOD_parser_error(ptr noundef nonnull @.str.34)
  br label %.thread59

125:                                              ; preds = %.preheader
  call void @TCOD_lex_delete(ptr noundef nonnull %25) #6
  br label %.thread59

.thread59:                                        ; preds = %37, %41, %.thread63, %125, %124, %17
  ret void
}

declare ptr @TCOD_lex_new(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare zeroext i1 @TCOD_lex_set_data_file(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #5

declare ptr @TCOD_get_error() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @string_copy(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @TCOD_parser_parse_entity(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @TCOD_lex_delete(ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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 144}
!6 = !{!"TCOD_Parser", !7, i64 0, !8, i64 8, !10, i64 136, !7, i64 144}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_Bool", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !7, i64 32}
!13 = !{!"TCOD_parser_listener_t", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!14 = !{!15, !16, i64 4}
!15 = !{!"TCOD_lex_t", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !17, i64 16, !7, i64 24, !16, i64 32, !8, i64 36, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !16, i64 72, !16, i64 76, !16, i64 80, !8, i64 84, !8, i64 584, !7, i64 2584, !7, i64 2592, !7, i64 2600, !7, i64 2608, !7, i64 2616, !10, i64 2624, !10, i64 2625, !10, i64 2626}
!16 = !{!"int", !8, i64 0}
!17 = !{!"float", !8, i64 0}
!18 = !{!15, !7, i64 24}
!19 = !{!6, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !7, i64 0}
!23 = !{!"TCOD_ParserStruct", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}
!26 = !{!13, !7, i64 0}


; Effective O3 passes: BDCEPass,ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass