; LLVM IR from libtcod/libtcod :: src/libtcod (lex_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_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 }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [20 x i8], align 1

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

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

declare i32 @TCOD_set_errorf(ptr noundef, ...) #1

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @TCOD_lex_get_number(ptr noundef %0) #3 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !9
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.TCOD_lex_t, ptr %15, i32 0, i32 8
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = load i8, ptr %17, align 1, !tbaa !15
  %19 = sext i8 %18 to i32
  %20 = icmp eq i32 %19, 45
  br i1 %20, label %21, label %35

21:                                               ; preds = %1
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = load i32, ptr %4, align 4, !tbaa !9
  call void @allocate_tok(ptr noundef %22, i32 noundef %23)
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.TCOD_lex_t, ptr %24, i32 0, i32 5
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  %27 = load i32, ptr %4, align 4, !tbaa !9
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %4, align 4, !tbaa !9
  %29 = sext i32 %27 to i64
  %30 = getelementptr inbounds i8, ptr %26, i64 %29
  store i8 45, ptr %30, align 1, !tbaa !15
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.TCOD_lex_t, ptr %31, i32 0, i32 8
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds i8, ptr %33, i32 1
  store ptr %34, ptr %32, align 8, !tbaa !11
  br label %35

35:                                               ; preds = %21, %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %36 = call ptr @__ctype_toupper_loc() #7
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.TCOD_lex_t, ptr %38, i32 0, i32 8
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = load i8, ptr %40, align 1, !tbaa !15
  %42 = sext i8 %41 to i32
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i32, ptr %37, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !9
  store i32 %45, ptr %6, align 4, !tbaa !9
  %46 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %46, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %47 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %47, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  store i8 0, ptr %8, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  store i8 0, ptr %9, align 1, !tbaa !17
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %49 = icmp eq i32 %48, 48
  br i1 %49, label %50, label %92

50:                                               ; preds = %35
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.TCOD_lex_t, ptr %51, i32 0, i32 8
  %53 = load ptr, ptr %52, align 8, !tbaa !11
  %54 = getelementptr inbounds i8, ptr %53, i64 1
  %55 = load i8, ptr %54, align 1, !tbaa !15
  %56 = sext i8 %55 to i32
  %57 = icmp eq i32 %56, 120
  br i1 %57, label %66, label %58

58:                                               ; preds = %50
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.TCOD_lex_t, ptr %59, i32 0, i32 8
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  %62 = getelementptr inbounds i8, ptr %61, i64 1
  %63 = load i8, ptr %62, align 1, !tbaa !15
  %64 = sext i8 %63 to i32
  %65 = icmp eq i32 %64, 88
  br i1 %65, label %66, label %92

66:                                               ; preds = %58, %50
  store i8 1, ptr %8, align 1, !tbaa !17
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = load i32, ptr %4, align 4, !tbaa !9
  call void @allocate_tok(ptr noundef %67, i32 noundef %68)
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.TCOD_lex_t, ptr %69, i32 0, i32 5
  %71 = load ptr, ptr %70, align 8, !tbaa !16
  %72 = load i32, ptr %4, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %4, align 4, !tbaa !9
  %74 = sext i32 %72 to i64
  %75 = getelementptr inbounds i8, ptr %71, i64 %74
  store i8 48, ptr %75, align 1, !tbaa !15
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.TCOD_lex_t, ptr %76, i32 0, i32 8
  %78 = load ptr, ptr %77, align 8, !tbaa !11
  %79 = getelementptr inbounds i8, ptr %78, i32 1
  store ptr %79, ptr %77, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %80 = call ptr @__ctype_toupper_loc() #7
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.TCOD_lex_t, ptr %82, i32 0, i32 8
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = load i8, ptr %84, align 1, !tbaa !15
  %86 = sext i8 %85 to i32
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %81, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !9
  store i32 %89, ptr %10, align 4, !tbaa !9
  %90 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %90, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %91 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %91, ptr %5, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %66, %58, %35
  br label %93

93:                                               ; preds = %148, %92
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = load i32, ptr %4, align 4, !tbaa !9
  call void @allocate_tok(ptr noundef %94, i32 noundef %95)
  %96 = load i32, ptr %5, align 4, !tbaa !9
  %97 = trunc i32 %96 to i8
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.TCOD_lex_t, ptr %98, i32 0, i32 5
  %100 = load ptr, ptr %99, align 8, !tbaa !16
  %101 = load i32, ptr %4, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %4, align 4, !tbaa !9
  %103 = sext i32 %101 to i64
  %104 = getelementptr inbounds i8, ptr %100, i64 %103
  store i8 %97, ptr %104, align 1, !tbaa !15
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.TCOD_lex_t, ptr %105, i32 0, i32 8
  %107 = load ptr, ptr %106, align 8, !tbaa !11
  %108 = getelementptr inbounds i8, ptr %107, i32 1
  store ptr %108, ptr %106, align 8, !tbaa !11
  %109 = load i32, ptr %5, align 4, !tbaa !9
  %110 = icmp eq i32 %109, 46
  br i1 %110, label %111, label %117

111:                                              ; preds = %93
  %112 = load i8, ptr %8, align 1, !tbaa !17, !range !18, !noundef !19
  %113 = trunc i8 %112 to i1
  br i1 %113, label %114, label %116

114:                                              ; preds = %111
  %115 = call i32 (ptr, ...) @TCOD_set_errorf(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 409, ptr noundef @.str.12)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %12, align 4
  br label %191

116:                                              ; preds = %111
  store i8 1, ptr %9, align 1, !tbaa !17
  br label %117

117:                                              ; preds = %116, %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %118 = call ptr @__ctype_toupper_loc() #7
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.TCOD_lex_t, ptr %120, i32 0, i32 8
  %122 = load ptr, ptr %121, align 8, !tbaa !11
  %123 = load i8, ptr %122, align 1, !tbaa !15
  %124 = sext i8 %123 to i32
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i32, ptr %119, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !9
  store i32 %127, ptr %13, align 4, !tbaa !9
  %128 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %128, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %129 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %129, ptr %5, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %117
  %131 = load i32, ptr %5, align 4, !tbaa !9
  %132 = icmp sge i32 %131, 48
  br i1 %132, label %133, label %136

133:                                              ; preds = %130
  %134 = load i32, ptr %5, align 4, !tbaa !9
  %135 = icmp sle i32 %134, 57
  br i1 %135, label %148, label %136

136:                                              ; preds = %133, %130
  %137 = load i8, ptr %8, align 1, !tbaa !17, !range !18, !noundef !19
  %138 = trunc i8 %137 to i1
  br i1 %138, label %139, label %145

139:                                              ; preds = %136
  %140 = load i32, ptr %5, align 4, !tbaa !9
  %141 = icmp sge i32 %140, 65
  br i1 %141, label %142, label %145

142:                                              ; preds = %139
  %143 = load i32, ptr %5, align 4, !tbaa !9
  %144 = icmp sle i32 %143, 70
  br i1 %144, label %148, label %145

145:                                              ; preds = %142, %139, %136
  %146 = load i32, ptr %5, align 4, !tbaa !9
  %147 = icmp eq i32 %146, 46
  br label %148

148:                                              ; preds = %145, %142, %133
  %149 = phi i1 [ true, %142 ], [ true, %133 ], [ %147, %145 ]
  br i1 %149, label %93, label %150, !llvm.loop !20

150:                                              ; preds = %148
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = load i32, ptr %4, align 4, !tbaa !9
  call void @allocate_tok(ptr noundef %151, i32 noundef %152)
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.TCOD_lex_t, ptr %153, i32 0, i32 5
  %155 = load ptr, ptr %154, align 8, !tbaa !16
  %156 = load i32, ptr %4, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds i8, ptr %155, i64 %157
  store i8 0, ptr %158, align 1, !tbaa !15
  %159 = load i8, ptr %9, align 1, !tbaa !17, !range !18, !noundef !19
  %160 = trunc i8 %159 to i1
  br i1 %160, label %179, label %161

161:                                              ; preds = %150
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.TCOD_lex_t, ptr %162, i32 0, i32 5
  %164 = load ptr, ptr %163, align 8, !tbaa !16
  %165 = call i64 @strtol(ptr noundef %164, ptr noundef null, i32 noundef 0) #6
  %166 = trunc i64 %165 to i32
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.TCOD_lex_t, ptr %167, i32 0, i32 2
  store i32 %166, ptr %168, align 8, !tbaa !22
  %169 = load ptr, ptr %3, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.TCOD_lex_t, ptr %169, i32 0, i32 2
  %171 = load i32, ptr %170, align 8, !tbaa !22
  %172 = sitofp i32 %171 to float
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.TCOD_lex_t, ptr %173, i32 0, i32 4
  store float %172, ptr %174, align 8, !tbaa !23
  %175 = load ptr, ptr %3, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.TCOD_lex_t, ptr %175, i32 0, i32 1
  store i32 5, ptr %176, align 4, !tbaa !24
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.TCOD_lex_t, ptr %177, i32 0, i32 3
  store i32 -1, ptr %178, align 4, !tbaa !25
  store i32 5, ptr %2, align 4
  store i32 1, ptr %12, align 4
  br label %191

179:                                              ; preds = %150
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.TCOD_lex_t, ptr %180, i32 0, i32 5
  %182 = load ptr, ptr %181, align 8, !tbaa !16
  %183 = call double @atof(ptr noundef %182) #8
  %184 = fptrunc double %183 to float
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.TCOD_lex_t, ptr %185, i32 0, i32 4
  store float %184, ptr %186, align 8, !tbaa !23
  %187 = load ptr, ptr %3, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.TCOD_lex_t, ptr %187, i32 0, i32 1
  store i32 6, ptr %188, align 4, !tbaa !24
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.TCOD_lex_t, ptr %189, i32 0, i32 3
  store i32 -1, ptr %190, align 4, !tbaa !25
  store i32 6, ptr %2, align 4
  store i32 1, ptr %12, align 4
  br label %191

191:                                              ; preds = %179, %161, %114
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %192 = load i32, ptr %2, align 4
  ret i32 %192
}

; Function Attrs: nounwind
declare i64 @strtol(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare double @atof(ptr noundef nonnull) #5

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 willreturn memory(none) "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 = { inlinehint nounwind willreturn memory(read) 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(none) }
attributes #8 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 40}
!12 = !{!"TCOD_lex_t", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !13, i64 16, !6, i64 24, !10, i64 32, !7, i64 36, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !7, i64 84, !7, i64 584, !6, i64 2584, !6, i64 2592, !6, i64 2600, !6, i64 2608, !6, i64 2616, !14, i64 2624, !14, i64 2625, !14, i64 2626}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!12, !6, i64 24}
!17 = !{!14, !14, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!12, !10, i64 8}
!23 = !{!12, !13, i64 16}
!24 = !{!12, !10, i64 4}
!25 = !{!12, !10, i64 12}


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

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [20 x i8], align 1

declare i32 @TCOD_set_errorf(ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @allocate_tok(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 7) i32 @TCOD_lex_get_number(ptr noundef %0) local_unnamed_addr #2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 40
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = load i8, ptr %3, align 1, !tbaa !13
  %5 = icmp eq i8 %4, 45
  br i1 %5, label %6, label %11

6:                                                ; preds = %1
  tail call void @allocate_tok(ptr noundef nonnull %0, i32 noundef 0)
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = load ptr, ptr %7, align 8, !tbaa !14
  store i8 45, ptr %8, align 1, !tbaa !13
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 1
  store ptr %10, ptr %2, align 8, !tbaa !5
  %.pre = load i8, ptr %10, align 1, !tbaa !13
  br label %11

11:                                               ; preds = %6, %1
  %12 = phi i8 [ %.pre, %6 ], [ %4, %1 ]
  %13 = phi ptr [ %10, %6 ], [ %3, %1 ]
  %.057 = phi i32 [ 1, %6 ], [ 0, %1 ]
  %14 = tail call ptr @__ctype_toupper_loc() #5
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = sext i8 %12 to i64
  %17 = getelementptr inbounds i32, ptr %15, i64 %16
  %18 = load i32, ptr %17, align 4, !tbaa !16
  %19 = icmp eq i32 %18, 48
  br i1 %19, label %20, label %36

20:                                               ; preds = %11
  %21 = getelementptr inbounds i8, ptr %13, i64 1
  %22 = load i8, ptr %21, align 1, !tbaa !13
  switch i8 %22, label %36 [
    i8 120, label %23
    i8 88, label %23
  ]

23:                                               ; preds = %20, %20
  tail call void @allocate_tok(ptr noundef nonnull %0, i32 noundef %.057)
  %24 = getelementptr inbounds i8, ptr %0, i64 24
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = add nuw nsw i32 %.057, 1
  %27 = zext nneg i32 %.057 to i64
  %28 = getelementptr inbounds i8, ptr %25, i64 %27
  store i8 48, ptr %28, align 1, !tbaa !13
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i64 1
  store ptr %30, ptr %2, align 8, !tbaa !5
  %31 = load ptr, ptr %14, align 8, !tbaa !15
  %32 = load i8, ptr %30, align 1, !tbaa !13
  %33 = sext i8 %32 to i64
  %34 = getelementptr inbounds i32, ptr %31, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !16
  br label %36

36:                                               ; preds = %20, %23, %11
  %.060 = phi i1 [ true, %23 ], [ false, %11 ], [ false, %20 ]
  %.058 = phi i32 [ %35, %23 ], [ %18, %11 ], [ 48, %20 ]
  %.1 = phi i32 [ %26, %23 ], [ %.057, %11 ], [ %.057, %20 ]
  tail call void @allocate_tok(ptr noundef nonnull %0, i32 noundef %.1)
  %37 = trunc i32 %.058 to i8
  %38 = getelementptr inbounds i8, ptr %0, i64 24
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  %40 = zext nneg i32 %.1 to i64
  %41 = getelementptr inbounds i8, ptr %39, i64 %40
  store i8 %37, ptr %41, align 1, !tbaa !13
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 1
  store ptr %43, ptr %2, align 8, !tbaa !5
  %44 = icmp eq i32 %.058, 46
  %brmerge.not71 = and i1 %.060, %44
  br i1 %brmerge.not71, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %36
  %45 = zext nneg i32 %.1 to i64
  br i1 %.060, label %.lr.ph.split, label %.lr.ph.split.us.split.preheader

.lr.ph.split.us.split.preheader:                  ; preds = %.lr.ph
  %indvars.iv89 = add nuw nsw i64 %45, 1
  %46 = load ptr, ptr %14, align 8, !tbaa !15
  %47 = load i8, ptr %43, align 1, !tbaa !13
  %48 = sext i8 %47 to i64
  %49 = getelementptr inbounds i32, ptr %46, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !16
  %51 = add i32 %50, -48
  %or.cond.us90 = icmp ult i32 %51, 10
  %52 = icmp eq i32 %50, 46
  %or.cond8391 = or i1 %or.cond.us90, %52
  br i1 %or.cond8391, label %.backedge.us, label %.split.us

.backedge.us:                                     ; preds = %.lr.ph.split.us.split.preheader, %.backedge.us
  %53 = phi i32 [ %65, %.backedge.us ], [ %50, %.lr.ph.split.us.split.preheader ]
  %indvars.iv93 = phi i64 [ %indvars.iv, %.backedge.us ], [ %indvars.iv89, %.lr.ph.split.us.split.preheader ]
  %.061.mux72.us92 = phi i1 [ %.061.mux.us, %.backedge.us ], [ %44, %.lr.ph.split.us.split.preheader ]
  %54 = trunc nuw nsw i64 %indvars.iv93 to i32
  tail call void @allocate_tok(ptr noundef nonnull %0, i32 noundef %54)
  %55 = trunc nuw i32 %53 to i8
  %56 = load ptr, ptr %38, align 8, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %56, i64 %indvars.iv93
  store i8 %55, ptr %57, align 1, !tbaa !13
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 1
  store ptr %59, ptr %2, align 8, !tbaa !5
  %60 = icmp eq i32 %53, 46
  %.061.mux.us = select i1 %60, i1 true, i1 %.061.mux72.us92
  %indvars.iv = add nuw nsw i64 %indvars.iv93, 1
  %61 = load ptr, ptr %14, align 8, !tbaa !15
  %62 = load i8, ptr %59, align 1, !tbaa !13
  %63 = sext i8 %62 to i64
  %64 = getelementptr inbounds i32, ptr %61, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !16
  %66 = add i32 %65, -48
  %or.cond.us = icmp ult i32 %66, 10
  %67 = icmp eq i32 %65, 46
  %or.cond83 = or i1 %or.cond.us, %67
  br i1 %or.cond83, label %.backedge.us, label %.split.us

._crit_edge:                                      ; preds = %.backedge, %36
  %68 = tail call i32 (ptr, ...) @TCOD_set_errorf(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 409, ptr noundef nonnull @.str.12) #6
  br label %101

.lr.ph.split:                                     ; preds = %.lr.ph, %.backedge
  %indvars.iv80.in = phi i64 [ %indvars.iv80, %.backedge ], [ %45, %.lr.ph ]
  %69 = phi ptr [ %81, %.backedge ], [ %43, %.lr.ph ]
  %indvars.iv80 = add nuw nsw i64 %indvars.iv80.in, 1
  %70 = load ptr, ptr %14, align 8, !tbaa !15
  %71 = load i8, ptr %69, align 1, !tbaa !13
  %72 = sext i8 %71 to i64
  %73 = getelementptr inbounds i32, ptr %70, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !16
  %.fr86 = freeze i32 %74
  %75 = add i32 %.fr86, -48
  %or.cond = icmp ult i32 %75, 10
  br i1 %or.cond, label %.backedge, label %switch.early.test

switch.early.test:                                ; preds = %.lr.ph.split
  switch i32 %.fr86, label %.split.us [
    i32 70, label %.backedge
    i32 69, label %.backedge
    i32 68, label %.backedge
    i32 67, label %.backedge
    i32 66, label %.backedge
    i32 65, label %.backedge
    i32 46, label %.backedge
  ]

.backedge:                                        ; preds = %switch.early.test, %switch.early.test, %switch.early.test, %switch.early.test, %switch.early.test, %switch.early.test, %switch.early.test, %.lr.ph.split
  %76 = trunc nuw nsw i64 %indvars.iv80 to i32
  tail call void @allocate_tok(ptr noundef nonnull %0, i32 noundef %76)
  %77 = trunc i32 %.fr86 to i8
  %78 = load ptr, ptr %38, align 8, !tbaa !14
  %79 = getelementptr inbounds i8, ptr %78, i64 %indvars.iv80
  store i8 %77, ptr %79, align 1, !tbaa !13
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %80, i64 1
  store ptr %81, ptr %2, align 8, !tbaa !5
  %82 = icmp eq i32 %.fr86, 46
  br i1 %82, label %._crit_edge, label %.lr.ph.split, !llvm.loop !17

.split.us:                                        ; preds = %.backedge.us, %switch.early.test, %.lr.ph.split.us.split.preheader
  %.us-phi.in = phi i64 [ %indvars.iv89, %.lr.ph.split.us.split.preheader ], [ %indvars.iv80, %switch.early.test ], [ %indvars.iv, %.backedge.us ]
  %.us-phi73 = phi i1 [ %44, %.lr.ph.split.us.split.preheader ], [ %44, %switch.early.test ], [ %.061.mux.us, %.backedge.us ]
  %.us-phi = trunc i64 %.us-phi.in to i32
  tail call void @allocate_tok(ptr noundef nonnull %0, i32 noundef %.us-phi)
  %83 = load ptr, ptr %38, align 8, !tbaa !14
  %sext = shl i64 %.us-phi.in, 32
  %84 = ashr exact i64 %sext, 32
  %85 = getelementptr inbounds i8, ptr %83, i64 %84
  store i8 0, ptr %85, align 1, !tbaa !13
  %86 = load ptr, ptr %38, align 8, !tbaa !14
  br i1 %.us-phi73, label %95, label %87

87:                                               ; preds = %.split.us
  %88 = tail call i64 @strtol(ptr nocapture noundef %86, ptr noundef null, i32 noundef 0) #6
  %89 = trunc i64 %88 to i32
  %90 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %89, ptr %90, align 8, !tbaa !19
  %91 = sitofp i32 %89 to float
  %92 = getelementptr inbounds i8, ptr %0, i64 16
  store float %91, ptr %92, align 8, !tbaa !20
  %93 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 5, ptr %93, align 4, !tbaa !21
  %94 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 -1, ptr %94, align 4, !tbaa !22
  br label %101

95:                                               ; preds = %.split.us
  %96 = tail call double @atof(ptr noundef %86) #7
  %97 = fptrunc double %96 to float
  %98 = getelementptr inbounds i8, ptr %0, i64 16
  store float %97, ptr %98, align 8, !tbaa !20
  %99 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 6, ptr %99, align 4, !tbaa !21
  %100 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 -1, ptr %100, align 4, !tbaa !22
  br label %101

101:                                              ; preds = %95, %87, %._crit_edge
  %.0 = phi i32 [ -1, %._crit_edge ], [ 6, %95 ], [ 5, %87 ]
  ret i32 %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare double @atof(ptr nocapture noundef nonnull) local_unnamed_addr #4

attributes #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 nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn "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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #5 = { nounwind willreturn memory(none) }
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, !11, i64 40}
!6 = !{!"TCOD_lex_t", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !11, i64 24, !7, i64 32, !8, i64 36, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !7, i64 72, !7, i64 76, !7, i64 80, !8, i64 84, !8, i64 584, !11, i64 2584, !11, i64 2592, !11, i64 2600, !11, i64 2608, !11, i64 2616, !12, i64 2624, !12, i64 2625, !12, i64 2626}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!6, !11, i64 24}
!15 = !{!11, !11, i64 0}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!6, !7, i64 8}
!20 = !{!6, !10, i64 16}
!21 = !{!6, !7, i64 4}
!22 = !{!6, !7, i64 12}


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