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

; 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.Data = type { %struct.ImageDetailsV1, %struct.SettingsDataV1, %struct.LayerData }
%struct.ImageDetailsV1 = type { i32, i32, i32, i32 }
%struct.SettingsDataV1 = type { i32, i32, i32 }
%struct.LayerData = type { %struct.LayerV1, %struct.LayerV2, ptr }
%struct.LayerV1 = type { i32, i32, i32, i32 }
%struct.LayerV2 = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.TCOD_ColorRGB = type { i8, i8, i8 }
%struct.TCOD_Console = type { i32, i32, ptr, i32, i32, %struct.TCOD_ColorRGB, %struct.TCOD_ColorRGB, i8, %struct.TCOD_ColorRGB, i32, ptr, ptr }

@.str.5 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.TCOD_console_load_apf = external hidden unnamed_addr constant [58 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [126 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @TCOD_console_validate_(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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

declare i32 @fclose(ptr noundef) #4

declare void @TCOD_console_resize_(ptr noundef, i32 noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @detectBigEndianness() #5

; Function Attrs: nounwind uwtable
declare dso_local void @fix32(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local i32 @fourCC(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @fourCCequals(i32 noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @get32(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @getData(ptr noundef, i64 noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local void @fixSettings(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local void @fixImage(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local void @fixLayer_v1(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local void @fixLayer_v2(ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @TCOD_console_load_apf(ptr noundef %0, ptr noundef %1) #5 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %struct.Data, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i8, align 1
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %struct.SettingsDataV1, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca %struct.ImageDetailsV1, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca %struct.TCOD_ColorRGB, align 1
  %32 = alloca %struct.TCOD_ColorRGB, align 1
  %33 = alloca i32, align 4
  %34 = alloca i24, align 4
  %35 = alloca i24, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %36 = call i32 @fourCC(ptr noundef @.str.24)
  store i32 %36, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %37 = call i32 @fourCC(ptr noundef @.str.25)
  store i32 %37, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %38 = call i32 @fourCC(ptr noundef @.str.26)
  store i32 %38, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 88, ptr %10) #8
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = call ptr @TCOD_console_validate_(ptr noundef %39)
  store ptr %40, ptr %4, align 8, !tbaa !5
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %2
  br label %45

44:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.5, i32 noundef 1013, ptr noundef @__PRETTY_FUNCTION__.TCOD_console_load_apf) #9
  unreachable

45:                                               ; preds = %43
  call void @detectBigEndianness()
  %46 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 0
  %47 = getelementptr inbounds %struct.ImageDetailsV1, ptr %46, i32 0, i32 0
  store i32 1, ptr %47, align 8, !tbaa !11
  %48 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 0
  %49 = getelementptr inbounds %struct.ImageDetailsV1, ptr %48, i32 0, i32 1
  store i32 1, ptr %49, align 4, !tbaa !17
  %50 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 0
  %51 = getelementptr inbounds %struct.ImageDetailsV1, ptr %50, i32 0, i32 2
  store i32 0, ptr %51, align 8, !tbaa !18
  %52 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 0
  %53 = getelementptr inbounds %struct.ImageDetailsV1, ptr %52, i32 0, i32 3
  store i32 0, ptr %53, align 4, !tbaa !19
  %54 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 1
  %55 = getelementptr inbounds %struct.SettingsDataV1, ptr %54, i32 0, i32 0
  store i32 1, ptr %55, align 8, !tbaa !20
  %56 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 1
  %57 = getelementptr inbounds %struct.SettingsDataV1, ptr %56, i32 0, i32 1
  store i32 10, ptr %57, align 4, !tbaa !21
  %58 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 1
  %59 = getelementptr inbounds %struct.SettingsDataV1, ptr %58, i32 0, i32 2
  store i32 10, ptr %59, align 8, !tbaa !22
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = call noalias ptr @fopen(ptr noundef %60, ptr noundef @.str.11)
  store ptr %61, ptr %9, align 8, !tbaa !5
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = icmp eq ptr %62, null
  br i1 %63, label %64, label %67

64:                                               ; preds = %45
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, ptr noundef %65)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %377

67:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #8
  store i8 1, ptr %18, align 1, !tbaa !23
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = call zeroext i1 @get32(ptr noundef %12, ptr noundef %68)
  br i1 %69, label %70, label %73

70:                                               ; preds = %67
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = call zeroext i1 @fourCCequals(i32 noundef %71, ptr noundef @.str.22)
  br i1 %72, label %75, label %73

73:                                               ; preds = %70, %67
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, ptr noundef @.str.30)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %371

75:                                               ; preds = %70
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = call zeroext i1 @get32(ptr noundef %13, ptr noundef %76)
  br i1 %77, label %80, label %78

78:                                               ; preds = %75
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, ptr noundef @.str.31)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %371

80:                                               ; preds = %75
  call void @fix32(ptr noundef %13)
  br label %81

81:                                               ; preds = %286, %80
  %82 = load i8, ptr %18, align 1, !tbaa !23, !range !25, !noundef !26
  %83 = trunc i8 %82 to i1
  br i1 %83, label %84, label %87

84:                                               ; preds = %81
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br label %87

87:                                               ; preds = %84, %81
  %88 = phi i1 [ false, %81 ], [ %86, %84 ]
  br i1 %88, label %89, label %287

89:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = call zeroext i1 @get32(ptr noundef %19, ptr noundef %90)
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  store i32 3, ptr %11, align 4
  br label %284

93:                                               ; preds = %89
  %94 = load i32, ptr %19, align 4, !tbaa !9
  %95 = call zeroext i1 @fourCCequals(i32 noundef %94, ptr noundef @.str.23)
  br i1 %95, label %99, label %96

96:                                               ; preds = %93
  %97 = load i32, ptr %19, align 4, !tbaa !9
  %98 = call zeroext i1 @fourCCequals(i32 noundef %97, ptr noundef @.str.32)
  br i1 %98, label %99, label %276

99:                                               ; preds = %96, %93
  br label %100

100:                                              ; preds = %274, %99
  %101 = load i8, ptr %18, align 1, !tbaa !23, !range !25, !noundef !26
  %102 = trunc i8 %101 to i1
  br i1 %102, label %103, label %106

103:                                              ; preds = %100
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = icmp ne ptr %104, null
  br label %106

106:                                              ; preds = %103, %100
  %107 = phi i1 [ false, %100 ], [ %105, %103 ]
  br i1 %107, label %108, label %275

108:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = call zeroext i1 @get32(ptr noundef %20, ptr noundef %109)
  br i1 %110, label %112, label %111

111:                                              ; preds = %108
  store i8 0, ptr %18, align 1, !tbaa !23
  store i32 5, ptr %11, align 4
  br label %272

112:                                              ; preds = %108
  %113 = load i32, ptr %20, align 4, !tbaa !9
  %114 = load i32, ptr %6, align 4, !tbaa !9
  %115 = icmp eq i32 %113, %114
  br i1 %115, label %116, label %136

116:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #8
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = call zeroext i1 @get32(ptr noundef %21, ptr noundef %117)
  call void @fix32(ptr noundef %21)
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = call zeroext i1 @get32(ptr noundef %22, ptr noundef %119)
  call void @fix32(ptr noundef %22)
  %121 = load i32, ptr %22, align 4, !tbaa !9
  %122 = icmp ne i32 %121, 1
  br i1 %122, label %123, label %125

123:                                              ; preds = %116
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.33, ptr noundef @.str.34)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %133

125:                                              ; preds = %116
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = call zeroext i1 @getData(ptr noundef %23, i64 noundef 12, ptr noundef %126)
  br i1 %127, label %130, label %128

128:                                              ; preds = %125
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, ptr noundef @.str.35)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %133

130:                                              ; preds = %125
  %131 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %131, ptr align 4 %23, i64 12, i1 false), !tbaa.struct !27
  %132 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 1
  call void @fixSettings(ptr noundef %132)
  store i32 0, ptr %11, align 4
  br label %133

133:                                              ; preds = %130, %128, %123
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  %134 = load i32, ptr %11, align 4
  switch i32 %134, label %272 [
    i32 0, label %135
  ]

135:                                              ; preds = %133
  br label %270

136:                                              ; preds = %112
  %137 = load i32, ptr %20, align 4, !tbaa !9
  %138 = load i32, ptr %7, align 4, !tbaa !9
  %139 = icmp eq i32 %137, %138
  br i1 %139, label %140, label %179

140:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #8
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = call zeroext i1 @get32(ptr noundef %24, ptr noundef %141)
  call void @fix32(ptr noundef %24)
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = call zeroext i1 @get32(ptr noundef %25, ptr noundef %143)
  call void @fix32(ptr noundef %25)
  %145 = load i32, ptr %25, align 4, !tbaa !9
  %146 = icmp ne i32 %145, 1
  br i1 %146, label %147, label %149

147:                                              ; preds = %140
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.33, ptr noundef @.str.36)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %176

149:                                              ; preds = %140
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = call zeroext i1 @getData(ptr noundef %26, i64 noundef 16, ptr noundef %150)
  br i1 %151, label %154, label %152

152:                                              ; preds = %149
  %153 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, ptr noundef @.str.37)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %176

154:                                              ; preds = %149
  %155 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %155, ptr align 4 %26, i64 16, i1 false), !tbaa.struct !28
  %156 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 0
  call void @fixImage(ptr noundef %156)
  %157 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 0
  %158 = getelementptr inbounds %struct.ImageDetailsV1, ptr %157, i32 0, i32 0
  %159 = load i32, ptr %158, align 8, !tbaa !11
  %160 = icmp ugt i32 %159, 0
  br i1 %160, label %161, label %167

161:                                              ; preds = %154
  %162 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 0
  %163 = getelementptr inbounds %struct.ImageDetailsV1, ptr %162, i32 0, i32 1
  %164 = load i32, ptr %163, align 4, !tbaa !17
  %165 = icmp ugt i32 %164, 0
  br i1 %165, label %166, label %167

166:                                              ; preds = %161
  br label %168

167:                                              ; preds = %161, %154
  call void @__assert_fail(ptr noundef @.str.38, ptr noundef @.str.5, i32 noundef 1103, ptr noundef @__PRETTY_FUNCTION__.TCOD_console_load_apf) #9
  unreachable

168:                                              ; preds = %166
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 0
  %171 = getelementptr inbounds %struct.ImageDetailsV1, ptr %170, i32 0, i32 0
  %172 = load i32, ptr %171, align 8, !tbaa !11
  %173 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 0
  %174 = getelementptr inbounds %struct.ImageDetailsV1, ptr %173, i32 0, i32 1
  %175 = load i32, ptr %174, align 4, !tbaa !17
  call void @TCOD_console_resize_(ptr noundef %169, i32 noundef %172, i32 noundef %175)
  store i32 0, ptr %11, align 4
  br label %176

176:                                              ; preds = %168, %152, %147
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  %177 = load i32, ptr %11, align 4
  switch i32 %177, label %272 [
    i32 0, label %178
  ]

178:                                              ; preds = %176
  br label %269

179:                                              ; preds = %136
  %180 = load i32, ptr %20, align 4, !tbaa !9
  %181 = load i32, ptr %8, align 4, !tbaa !9
  %182 = icmp eq i32 %180, %181
  br i1 %182, label %183, label %261

183:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = call zeroext i1 @get32(ptr noundef %27, ptr noundef %184)
  call void @fix32(ptr noundef %27)
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  %187 = call zeroext i1 @get32(ptr noundef %28, ptr noundef %186)
  call void @fix32(ptr noundef %28)
  %188 = load i32, ptr %28, align 4, !tbaa !9
  %189 = icmp ugt i32 %188, 2
  br i1 %189, label %190, label %192

190:                                              ; preds = %183
  %191 = call i32 (ptr, ...) @printf(ptr noundef @.str.33, ptr noundef @.str.39)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %258

192:                                              ; preds = %183
  %193 = load i32, ptr %28, align 4, !tbaa !9
  %194 = icmp eq i32 %193, 1
  br i1 %194, label %195, label %224

195:                                              ; preds = %192
  %196 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %197 = getelementptr inbounds %struct.LayerData, ptr %196, i32 0, i32 0
  %198 = load ptr, ptr %9, align 8, !tbaa !5
  %199 = call zeroext i1 @getData(ptr noundef %197, i64 noundef 16, ptr noundef %198)
  br i1 %199, label %202, label %200

200:                                              ; preds = %195
  %201 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, ptr noundef @.str.40)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %258

202:                                              ; preds = %195
  %203 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %204 = getelementptr inbounds %struct.LayerData, ptr %203, i32 0, i32 0
  call void @fixLayer_v1(ptr noundef %204)
  %205 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %206 = getelementptr inbounds %struct.LayerData, ptr %205, i32 0, i32 0
  %207 = getelementptr inbounds %struct.LayerV1, ptr %206, i32 0, i32 3
  %208 = load i32, ptr %207, align 4, !tbaa !29
  %209 = zext i32 %208 to i64
  %210 = mul i64 1, %209
  %211 = call noalias ptr @malloc(i64 noundef %210) #10
  %212 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %213 = getelementptr inbounds %struct.LayerData, ptr %212, i32 0, i32 2
  store ptr %211, ptr %213, align 8, !tbaa !30
  %214 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %215 = getelementptr inbounds %struct.LayerData, ptr %214, i32 0, i32 2
  %216 = load ptr, ptr %215, align 8, !tbaa !30
  %217 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %218 = getelementptr inbounds %struct.LayerData, ptr %217, i32 0, i32 0
  %219 = getelementptr inbounds %struct.LayerV1, ptr %218, i32 0, i32 3
  %220 = load i32, ptr %219, align 4, !tbaa !29
  %221 = zext i32 %220 to i64
  %222 = load ptr, ptr %9, align 8, !tbaa !5
  %223 = call zeroext i1 @getData(ptr noundef %216, i64 noundef %221, ptr noundef %222)
  br label %257

224:                                              ; preds = %192
  %225 = load i32, ptr %28, align 4, !tbaa !9
  %226 = icmp eq i32 %225, 2
  br i1 %226, label %227, label %256

227:                                              ; preds = %224
  %228 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %229 = getelementptr inbounds %struct.LayerData, ptr %228, i32 0, i32 1
  %230 = load ptr, ptr %9, align 8, !tbaa !5
  %231 = call zeroext i1 @getData(ptr noundef %229, i64 noundef 28, ptr noundef %230)
  br i1 %231, label %234, label %232

232:                                              ; preds = %227
  %233 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, ptr noundef @.str.40)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %258

234:                                              ; preds = %227
  %235 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %236 = getelementptr inbounds %struct.LayerData, ptr %235, i32 0, i32 1
  call void @fixLayer_v2(ptr noundef %236)
  %237 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %238 = getelementptr inbounds %struct.LayerData, ptr %237, i32 0, i32 1
  %239 = getelementptr inbounds %struct.LayerV2, ptr %238, i32 0, i32 6
  %240 = load i32, ptr %239, align 8, !tbaa !31
  %241 = zext i32 %240 to i64
  %242 = mul i64 1, %241
  %243 = call noalias ptr @malloc(i64 noundef %242) #10
  %244 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %245 = getelementptr inbounds %struct.LayerData, ptr %244, i32 0, i32 2
  store ptr %243, ptr %245, align 8, !tbaa !30
  %246 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %247 = getelementptr inbounds %struct.LayerData, ptr %246, i32 0, i32 2
  %248 = load ptr, ptr %247, align 8, !tbaa !30
  %249 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %250 = getelementptr inbounds %struct.LayerData, ptr %249, i32 0, i32 1
  %251 = getelementptr inbounds %struct.LayerV2, ptr %250, i32 0, i32 6
  %252 = load i32, ptr %251, align 8, !tbaa !31
  %253 = zext i32 %252 to i64
  %254 = load ptr, ptr %9, align 8, !tbaa !5
  %255 = call zeroext i1 @getData(ptr noundef %248, i64 noundef %253, ptr noundef %254)
  br label %256

256:                                              ; preds = %234, %224
  br label %257

257:                                              ; preds = %256, %202
  store i32 0, ptr %11, align 4
  br label %258

258:                                              ; preds = %257, %232, %200, %190
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  %259 = load i32, ptr %11, align 4
  switch i32 %259, label %272 [
    i32 0, label %260
  ]

260:                                              ; preds = %258
  br label %268

261:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  %262 = load ptr, ptr %9, align 8, !tbaa !5
  %263 = call zeroext i1 @get32(ptr noundef %29, ptr noundef %262)
  call void @fix32(ptr noundef %29)
  %264 = load ptr, ptr %9, align 8, !tbaa !5
  %265 = load i32, ptr %29, align 4, !tbaa !9
  %266 = zext i32 %265 to i64
  %267 = call i32 @fseek(ptr noundef %264, i64 noundef %266, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %268

268:                                              ; preds = %261, %260
  br label %269

269:                                              ; preds = %268, %178
  br label %270

270:                                              ; preds = %269, %135
  br label %271

271:                                              ; preds = %270
  store i32 0, ptr %11, align 4
  br label %272

272:                                              ; preds = %271, %258, %176, %133, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  %273 = load i32, ptr %11, align 4
  switch i32 %273, label %284 [
    i32 0, label %274
    i32 5, label %275
  ]

274:                                              ; preds = %272
  br label %100, !llvm.loop !32

275:                                              ; preds = %272, %106
  store i8 0, ptr %18, align 1, !tbaa !23
  br label %283

276:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  %277 = load ptr, ptr %9, align 8, !tbaa !5
  %278 = call zeroext i1 @get32(ptr noundef %30, ptr noundef %277)
  %279 = load ptr, ptr %9, align 8, !tbaa !5
  %280 = load i32, ptr %30, align 4, !tbaa !9
  %281 = zext i32 %280 to i64
  %282 = call i32 @fseek(ptr noundef %279, i64 noundef %281, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  br label %283

283:                                              ; preds = %276, %275
  store i32 0, ptr %11, align 4
  br label %284

284:                                              ; preds = %283, %272, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  %285 = load i32, ptr %11, align 4
  switch i32 %285, label %371 [
    i32 0, label %286
    i32 3, label %287
  ]

286:                                              ; preds = %284
  br label %81, !llvm.loop !34

287:                                              ; preds = %284, %87
  %288 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %289 = getelementptr inbounds %struct.LayerData, ptr %288, i32 0, i32 2
  %290 = load ptr, ptr %289, align 8, !tbaa !30
  store ptr %290, ptr %17, align 8, !tbaa !5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %291

291:                                              ; preds = %364, %287
  %292 = load i32, ptr %15, align 4, !tbaa !9
  %293 = load ptr, ptr %4, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.TCOD_Console, ptr %293, i32 0, i32 0
  %295 = load i32, ptr %294, align 8, !tbaa !35
  %296 = icmp slt i32 %292, %295
  br i1 %296, label %297, label %367

297:                                              ; preds = %291
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %298

298:                                              ; preds = %360, %297
  %299 = load i32, ptr %16, align 4, !tbaa !9
  %300 = load ptr, ptr %4, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.TCOD_Console, ptr %300, i32 0, i32 1
  %302 = load i32, ptr %301, align 4, !tbaa !38
  %303 = icmp slt i32 %299, %302
  br i1 %303, label %304, label %363

304:                                              ; preds = %298
  call void @llvm.lifetime.start.p0(i64 3, ptr %31) #8
  call void @llvm.lifetime.start.p0(i64 3, ptr %32) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  %305 = load ptr, ptr %17, align 8, !tbaa !5
  %306 = load i32, ptr %14, align 4, !tbaa !9
  %307 = add nsw i32 %306, 1
  store i32 %307, ptr %14, align 4, !tbaa !9
  %308 = sext i32 %306 to i64
  %309 = getelementptr inbounds i8, ptr %305, i64 %308
  %310 = load i8, ptr %309, align 1, !tbaa !39
  %311 = zext i8 %310 to i32
  store i32 %311, ptr %33, align 4, !tbaa !9
  %312 = load ptr, ptr %17, align 8, !tbaa !5
  %313 = load i32, ptr %14, align 4, !tbaa !9
  %314 = add nsw i32 %313, 1
  store i32 %314, ptr %14, align 4, !tbaa !9
  %315 = sext i32 %313 to i64
  %316 = getelementptr inbounds i8, ptr %312, i64 %315
  %317 = load i8, ptr %316, align 1, !tbaa !39
  %318 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %31, i32 0, i32 0
  store i8 %317, ptr %318, align 1, !tbaa !40
  %319 = load ptr, ptr %17, align 8, !tbaa !5
  %320 = load i32, ptr %14, align 4, !tbaa !9
  %321 = add nsw i32 %320, 1
  store i32 %321, ptr %14, align 4, !tbaa !9
  %322 = sext i32 %320 to i64
  %323 = getelementptr inbounds i8, ptr %319, i64 %322
  %324 = load i8, ptr %323, align 1, !tbaa !39
  %325 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %31, i32 0, i32 1
  store i8 %324, ptr %325, align 1, !tbaa !41
  %326 = load ptr, ptr %17, align 8, !tbaa !5
  %327 = load i32, ptr %14, align 4, !tbaa !9
  %328 = add nsw i32 %327, 1
  store i32 %328, ptr %14, align 4, !tbaa !9
  %329 = sext i32 %327 to i64
  %330 = getelementptr inbounds i8, ptr %326, i64 %329
  %331 = load i8, ptr %330, align 1, !tbaa !39
  %332 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %31, i32 0, i32 2
  store i8 %331, ptr %332, align 1, !tbaa !42
  %333 = load ptr, ptr %17, align 8, !tbaa !5
  %334 = load i32, ptr %14, align 4, !tbaa !9
  %335 = add nsw i32 %334, 1
  store i32 %335, ptr %14, align 4, !tbaa !9
  %336 = sext i32 %334 to i64
  %337 = getelementptr inbounds i8, ptr %333, i64 %336
  %338 = load i8, ptr %337, align 1, !tbaa !39
  %339 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 0
  store i8 %338, ptr %339, align 1, !tbaa !40
  %340 = load ptr, ptr %17, align 8, !tbaa !5
  %341 = load i32, ptr %14, align 4, !tbaa !9
  %342 = add nsw i32 %341, 1
  store i32 %342, ptr %14, align 4, !tbaa !9
  %343 = sext i32 %341 to i64
  %344 = getelementptr inbounds i8, ptr %340, i64 %343
  %345 = load i8, ptr %344, align 1, !tbaa !39
  %346 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 1
  store i8 %345, ptr %346, align 1, !tbaa !41
  %347 = load ptr, ptr %17, align 8, !tbaa !5
  %348 = load i32, ptr %14, align 4, !tbaa !9
  %349 = add nsw i32 %348, 1
  store i32 %349, ptr %14, align 4, !tbaa !9
  %350 = sext i32 %348 to i64
  %351 = getelementptr inbounds i8, ptr %347, i64 %350
  %352 = load i8, ptr %351, align 1, !tbaa !39
  %353 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 2
  store i8 %352, ptr %353, align 1, !tbaa !42
  %354 = load ptr, ptr %4, align 8, !tbaa !5
  %355 = load i32, ptr %15, align 4, !tbaa !9
  %356 = load i32, ptr %16, align 4, !tbaa !9
  %357 = load i32, ptr %33, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 1 %31, i64 3, i1 false)
  %358 = load i24, ptr %34, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 1 %32, i64 3, i1 false)
  %359 = load i24, ptr %35, align 4
  call void @TCOD_console_put_char_ex(ptr noundef %354, i32 noundef %355, i32 noundef %356, i32 noundef %357, i24 %358, i24 %359)
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 3, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 3, ptr %31) #8
  br label %360

360:                                              ; preds = %304
  %361 = load i32, ptr %16, align 4, !tbaa !9
  %362 = add nsw i32 %361, 1
  store i32 %362, ptr %16, align 4, !tbaa !9
  br label %298, !llvm.loop !43

363:                                              ; preds = %298
  br label %364

364:                                              ; preds = %363
  %365 = load i32, ptr %15, align 4, !tbaa !9
  %366 = add nsw i32 %365, 1
  store i32 %366, ptr %15, align 4, !tbaa !9
  br label %291, !llvm.loop !44

367:                                              ; preds = %291
  %368 = getelementptr inbounds %struct.Data, ptr %10, i32 0, i32 2
  %369 = getelementptr inbounds %struct.LayerData, ptr %368, i32 0, i32 2
  %370 = load ptr, ptr %369, align 8, !tbaa !30
  call void @free(ptr noundef %370) #8
  store i32 0, ptr %11, align 4
  br label %371

371:                                              ; preds = %367, %284, %78, %73
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %372 = load i32, ptr %11, align 4
  switch i32 %372, label %377 [
    i32 0, label %373
  ]

373:                                              ; preds = %371
  br label %374

374:                                              ; preds = %373
  %375 = load ptr, ptr %9, align 8, !tbaa !5
  %376 = call i32 @fclose(ptr noundef %375)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %377

377:                                              ; preds = %374, %371, %64
  call void @llvm.lifetime.end.p0(i64 88, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  %378 = load i1, ptr %3, align 1
  ret i1 %378
}

declare i32 @printf(ptr noundef, ...) #4

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #6

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #4

declare void @TCOD_console_put_char_ex(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i24, i24) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #7

attributes #0 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { noreturn 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 #4 = { "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 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 allocsize(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 #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn nounwind }
attributes #10 = { nounwind allocsize(0) }

!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, !10, i64 0}
!12 = !{!"Data", !13, i64 0, !14, i64 16, !15, i64 32}
!13 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!14 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8}
!15 = !{!"LayerData", !13, i64 0, !16, i64 16, !6, i64 48}
!16 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!17 = !{!12, !10, i64 4}
!18 = !{!12, !10, i64 8}
!19 = !{!12, !10, i64 12}
!20 = !{!12, !10, i64 16}
!21 = !{!12, !10, i64 20}
!22 = !{!12, !10, i64 24}
!23 = !{!24, !24, i64 0}
!24 = !{!"_Bool", !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!28 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9}
!29 = !{!12, !10, i64 44}
!30 = !{!12, !6, i64 80}
!31 = !{!12, !10, i64 72}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}
!35 = !{!36, !10, i64 0}
!36 = !{!"TCOD_Console", !10, i64 0, !10, i64 4, !6, i64 8, !10, i64 16, !10, i64 20, !37, i64 24, !37, i64 27, !24, i64 30, !37, i64 31, !10, i64 36, !6, i64 40, !6, i64 48}
!37 = !{!"TCOD_ColorRGB", !7, i64 0, !7, i64 1, !7, i64 2}
!38 = !{!36, !10, i64 4}
!39 = !{!7, !7, i64 0}
!40 = !{!37, !7, i64 0}
!41 = !{!37, !7, i64 1}
!42 = !{!37, !7, i64 2}
!43 = distinct !{!43, !33}
!44 = distinct !{!44, !33}


; 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.Data = type { %struct.ImageDetailsV1, %struct.SettingsDataV1, %struct.LayerData }
%struct.ImageDetailsV1 = type { i32, i32, i32, i32 }
%struct.SettingsDataV1 = type { i32, i32, i32 }
%struct.LayerData = type { %struct.LayerV1, %struct.LayerV2, ptr }
%struct.LayerV1 = type { i32, i32, i32, i32 }
%struct.LayerV2 = type { i32, i32, i32, i32, i32, i32, i32 }

@.str.5 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.TCOD_console_load_apf = external hidden unnamed_addr constant [58 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [126 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @TCOD_console_validate_(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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #4

declare void @TCOD_console_resize_(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare dso_local void @detectBigEndianness() local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local void @fix32(ptr noundef) local_unnamed_addr #6

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @fourCCequals(i32 noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @get32(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @getData(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local void @fixSettings(ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local void @fixImage(ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local void @fixLayer_v1(ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local void @fixLayer_v2(ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @TCOD_console_load_apf(ptr noundef %0, ptr noundef %1) local_unnamed_addr #6 {
  %3 = alloca %struct.Data, align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.SettingsDataV1, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.ImageDetailsV1, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = tail call i32 @fourCC(ptr noundef nonnull @.str.24)
  %19 = tail call i32 @fourCC(ptr noundef nonnull @.str.25)
  %20 = tail call i32 @fourCC(ptr noundef nonnull @.str.26)
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %3) #9
  %21 = tail call ptr @TCOD_console_validate_(ptr noundef %0)
  %.not = icmp eq ptr %21, null
  br i1 %.not, label %22, label %23

22:                                               ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.5, i32 noundef 1013, ptr noundef nonnull @__PRETTY_FUNCTION__.TCOD_console_load_apf) #10
  unreachable

23:                                               ; preds = %2
  tail call void @detectBigEndianness()
  %24 = getelementptr inbounds i8, ptr %3, i64 4
  store <4 x i32> <i32 1, i32 1, i32 0, i32 0>, ptr %3, align 16, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %3, i64 16
  store i32 1, ptr %25, align 16, !tbaa !9
  %26 = getelementptr inbounds i8, ptr %3, i64 20
  store i32 10, ptr %26, align 4, !tbaa !16
  %27 = getelementptr inbounds i8, ptr %3, i64 24
  store i32 10, ptr %27, align 8, !tbaa !17
  %28 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.11)
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %32

30:                                               ; preds = %23
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28, ptr noundef %1)
  br label %161

32:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %33 = call zeroext i1 @get32(ptr noundef nonnull %4, ptr noundef nonnull %28)
  br i1 %33, label %34, label %37

34:                                               ; preds = %32
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = call zeroext i1 @fourCCequals(i32 noundef %35, ptr noundef nonnull @.str.22)
  br i1 %36, label %39, label %37

37:                                               ; preds = %34, %32
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull @.str.30)
  br label %.thread115

39:                                               ; preds = %34
  %40 = call zeroext i1 @get32(ptr noundef nonnull %5, ptr noundef nonnull %28)
  br i1 %40, label %43, label %41

41:                                               ; preds = %39
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull @.str.31)
  br label %.thread115

43:                                               ; preds = %39
  call void @fix32(ptr noundef nonnull %5)
  %44 = getelementptr inbounds i8, ptr %3, i64 48
  %45 = getelementptr inbounds i8, ptr %3, i64 72
  %46 = getelementptr inbounds i8, ptr %3, i64 80
  %47 = getelementptr inbounds i8, ptr %3, i64 32
  %48 = getelementptr inbounds i8, ptr %3, i64 44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  %49 = call zeroext i1 @get32(ptr noundef nonnull %6, ptr noundef %28)
  br i1 %49, label %.lr.ph134, label %.thread111

.thread111:                                       ; preds = %.loopexit, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  br label %.loopexit118

.lr.ph134:                                        ; preds = %43, %.loopexit
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = call zeroext i1 @fourCCequals(i32 noundef %50, ptr noundef nonnull @.str.23)
  br i1 %51, label %55, label %52

52:                                               ; preds = %.lr.ph134
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = call zeroext i1 @fourCCequals(i32 noundef %53, ptr noundef nonnull @.str.32)
  br i1 %54, label %55, label %.loopexit

55:                                               ; preds = %52, %.lr.ph134
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  %56 = call zeroext i1 @get32(ptr noundef nonnull %7, ptr noundef %28)
  br i1 %56, label %.lr.ph136, label %.lr.ph._crit_edge

.lr.ph136:                                        ; preds = %55, %.lr.ph
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = icmp eq i32 %57, %18
  br i1 %58, label %59, label %70

59:                                               ; preds = %.lr.ph136
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #9
  %60 = call zeroext i1 @get32(ptr noundef nonnull %8, ptr noundef %28)
  call void @fix32(ptr noundef nonnull %8)
  %61 = call zeroext i1 @get32(ptr noundef nonnull %9, ptr noundef %28)
  call void @fix32(ptr noundef nonnull %9)
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %.not98 = icmp eq i32 %62, 1
  br i1 %.not98, label %65, label %63

63:                                               ; preds = %59
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33, ptr noundef nonnull @.str.34)
  br label %.critedge

65:                                               ; preds = %59
  %66 = call zeroext i1 @getData(ptr noundef nonnull %10, i64 noundef 12, ptr noundef %28)
  br i1 %66, label %69, label %67

67:                                               ; preds = %65
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull @.str.35)
  br label %.critedge

69:                                               ; preds = %65
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(12) %25, ptr noundef nonnull align 4 dereferenceable(12) %10, i64 12, i1 false), !tbaa.struct !18
  call void @fixSettings(ptr noundef nonnull %25)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  br label %.lr.ph

70:                                               ; preds = %.lr.ph136
  %71 = icmp eq i32 %57, %19
  br i1 %71, label %72, label %89

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #9
  %73 = call zeroext i1 @get32(ptr noundef nonnull %11, ptr noundef %28)
  call void @fix32(ptr noundef nonnull %11)
  %74 = call zeroext i1 @get32(ptr noundef nonnull %12, ptr noundef %28)
  call void @fix32(ptr noundef nonnull %12)
  %75 = load i32, ptr %12, align 4, !tbaa !5
  %.not97 = icmp eq i32 %75, 1
  br i1 %.not97, label %78, label %76

76:                                               ; preds = %72
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33, ptr noundef nonnull @.str.36)
  br label %.critedge100

78:                                               ; preds = %72
  %79 = call zeroext i1 @getData(ptr noundef nonnull %13, i64 noundef 16, ptr noundef %28)
  br i1 %79, label %82, label %80

80:                                               ; preds = %78
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull @.str.37)
  br label %.critedge100

82:                                               ; preds = %78
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(16) %13, i64 16, i1 false), !tbaa.struct !19
  call void @fixImage(ptr noundef nonnull %3)
  %83 = load i32, ptr %3, align 16, !tbaa !20
  %84 = icmp ne i32 %83, 0
  %85 = load i32, ptr %24, align 4
  %86 = icmp ne i32 %85, 0
  %or.cond = select i1 %84, i1 %86, i1 false
  br i1 %or.cond, label %88, label %87

87:                                               ; preds = %82
  call void @__assert_fail(ptr noundef nonnull @.str.38, ptr noundef nonnull @.str.5, i32 noundef 1103, ptr noundef nonnull @__PRETTY_FUNCTION__.TCOD_console_load_apf) #10
  unreachable

88:                                               ; preds = %82
  call void @TCOD_console_resize_(ptr noundef nonnull %21, i32 noundef %83, i32 noundef %85) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  br label %.lr.ph

89:                                               ; preds = %70
  %90 = icmp eq i32 %57, %20
  br i1 %90, label %91, label %115

91:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #9
  %92 = call zeroext i1 @get32(ptr noundef nonnull %14, ptr noundef %28)
  call void @fix32(ptr noundef nonnull %14)
  %93 = call zeroext i1 @get32(ptr noundef nonnull %15, ptr noundef %28)
  call void @fix32(ptr noundef nonnull %15)
  %94 = load i32, ptr %15, align 4, !tbaa !5
  %95 = icmp ugt i32 %94, 2
  br i1 %95, label %96, label %98

96:                                               ; preds = %91
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33, ptr noundef nonnull @.str.39)
  br label %.critedge102

98:                                               ; preds = %91
  switch i32 %94, label %114 [
    i32 1, label %99
    i32 2, label %105
  ]

99:                                               ; preds = %98
  %100 = call zeroext i1 @getData(ptr noundef nonnull %47, i64 noundef 16, ptr noundef %28)
  br i1 %100, label %103, label %101

101:                                              ; preds = %99
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull @.str.40)
  br label %.critedge102

103:                                              ; preds = %99
  call void @fixLayer_v1(ptr noundef nonnull %47)
  %104 = load i32, ptr %48, align 4, !tbaa !21
  br label %.sink.split

105:                                              ; preds = %98
  %106 = call zeroext i1 @getData(ptr noundef nonnull %44, i64 noundef 28, ptr noundef %28)
  br i1 %106, label %109, label %107

107:                                              ; preds = %105
  %108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull @.str.40)
  br label %.critedge102

109:                                              ; preds = %105
  call void @fixLayer_v2(ptr noundef nonnull %44)
  %110 = load i32, ptr %45, align 8, !tbaa !22
  br label %.sink.split

.sink.split:                                      ; preds = %109, %103
  %.sink = phi i32 [ %104, %103 ], [ %110, %109 ]
  %111 = zext i32 %.sink to i64
  %112 = call noalias ptr @malloc(i64 noundef %111) #11
  store ptr %112, ptr %46, align 16, !tbaa !23
  %113 = call zeroext i1 @getData(ptr noundef %112, i64 noundef %111, ptr noundef %28)
  br label %114

114:                                              ; preds = %.sink.split, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #9
  br label %.lr.ph

115:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #9
  %116 = call zeroext i1 @get32(ptr noundef nonnull %16, ptr noundef %28)
  call void @fix32(ptr noundef nonnull %16)
  %117 = load i32, ptr %16, align 4, !tbaa !5
  %118 = zext i32 %117 to i64
  %119 = call i32 @fseek(ptr noundef %28, i64 noundef %118, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #9
  br label %.lr.ph

.critedge:                                        ; preds = %67, %63
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  br label %.thread108

.critedge100:                                     ; preds = %80, %76
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  br label %.thread108

.critedge102:                                     ; preds = %107, %101, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #9
  br label %.thread108

.thread108:                                       ; preds = %.critedge102, %.critedge100, %.critedge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  br label %.thread115

.lr.ph:                                           ; preds = %115, %69, %88, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  %120 = call zeroext i1 @get32(ptr noundef nonnull %7, ptr noundef %28)
  br i1 %120, label %.lr.ph136, label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  br label %.loopexit118

.loopexit:                                        ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #9
  %121 = call zeroext i1 @get32(ptr noundef nonnull %17, ptr noundef %28)
  %122 = load i32, ptr %17, align 4, !tbaa !5
  %123 = zext i32 %122 to i64
  %124 = call i32 @fseek(ptr noundef %28, i64 noundef %123, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  %125 = call zeroext i1 @get32(ptr noundef nonnull %6, ptr noundef %28)
  br i1 %125, label %.lr.ph134, label %.thread111

.loopexit118:                                     ; preds = %.lr.ph._crit_edge, %.thread111
  %126 = load ptr, ptr %46, align 16, !tbaa !23
  %127 = load i32, ptr %21, align 8, !tbaa !24
  %128 = icmp sgt i32 %127, 0
  br i1 %128, label %.preheader.lr.ph, label %._crit_edge125

.preheader.lr.ph:                                 ; preds = %.loopexit118
  %129 = getelementptr inbounds i8, ptr %21, i64 4
  %130 = load i32, ptr %129, align 4, !tbaa !28
  %131 = icmp sgt i32 %130, 0
  br i1 %131, label %.preheader, label %._crit_edge125

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %132 = phi i32 [ %155, %._crit_edge ], [ %127, %.preheader.lr.ph ]
  %133 = phi i32 [ %156, %._crit_edge ], [ %130, %.preheader.lr.ph ]
  %.082124 = phi i32 [ %.183.lcssa, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %.084123 = phi i32 [ %157, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %134 = icmp sgt i32 %133, 0
  br i1 %134, label %.lr.ph122.preheader, label %._crit_edge

.lr.ph122.preheader:                              ; preds = %.preheader
  %135 = sext i32 %.082124 to i64
  br label %.lr.ph122

.lr.ph122:                                        ; preds = %.lr.ph122.preheader, %.lr.ph122
  %indvars.iv = phi i64 [ %135, %.lr.ph122.preheader ], [ %indvars.iv.next, %.lr.ph122 ]
  %.085120 = phi i32 [ 0, %.lr.ph122.preheader ], [ %151, %.lr.ph122 ]
  %136 = getelementptr inbounds i8, ptr %126, i64 %indvars.iv
  %137 = load i8, ptr %136, align 1, !tbaa !29
  %138 = zext i8 %137 to i32
  %139 = getelementptr i8, ptr %136, i64 1
  %140 = load i8, ptr %139, align 1, !tbaa !29
  %141 = getelementptr i8, ptr %136, i64 2
  %142 = load i16, ptr %141, align 1
  %143 = zext i16 %142 to i24
  %144 = shl nuw i24 %143, 8
  %145 = getelementptr i8, ptr %136, i64 4
  %146 = load i8, ptr %145, align 1, !tbaa !29
  %147 = getelementptr i8, ptr %136, i64 5
  %148 = load i16, ptr %147, align 1
  %149 = zext i16 %148 to i24
  %150 = shl nuw i24 %149, 8
  %indvars.iv.next = add nsw i64 %indvars.iv, 7
  %.sroa.010.0.insert.ext = zext i8 %140 to i24
  %.sroa.010.0.insert.insert = or disjoint i24 %144, %.sroa.010.0.insert.ext
  %.sroa.0.0.insert.ext = zext i8 %146 to i24
  %.sroa.0.0.insert.insert = or disjoint i24 %150, %.sroa.0.0.insert.ext
  call void @TCOD_console_put_char_ex(ptr noundef nonnull %21, i32 noundef %.084123, i32 noundef %.085120, i32 noundef %138, i24 %.sroa.010.0.insert.insert, i24 %.sroa.0.0.insert.insert) #9
  %151 = add nuw nsw i32 %.085120, 1
  %152 = load i32, ptr %129, align 4, !tbaa !28
  %153 = icmp slt i32 %151, %152
  br i1 %153, label %.lr.ph122, label %._crit_edge.loopexit, !llvm.loop !30

._crit_edge.loopexit:                             ; preds = %.lr.ph122
  %154 = trunc nsw i64 %indvars.iv.next to i32
  %.pre = load i32, ptr %21, align 8, !tbaa !24
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %155 = phi i32 [ %132, %.preheader ], [ %.pre, %._crit_edge.loopexit ]
  %156 = phi i32 [ %133, %.preheader ], [ %152, %._crit_edge.loopexit ]
  %.183.lcssa = phi i32 [ %.082124, %.preheader ], [ %154, %._crit_edge.loopexit ]
  %157 = add nuw nsw i32 %.084123, 1
  %158 = icmp slt i32 %157, %155
  br i1 %158, label %.preheader, label %._crit_edge125.loopexit, !llvm.loop !32

.thread115:                                       ; preds = %41, %37, %.thread108
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  br label %161

._crit_edge125.loopexit:                          ; preds = %._crit_edge
  %.pre128 = load ptr, ptr %46, align 16, !tbaa !23
  br label %._crit_edge125

._crit_edge125:                                   ; preds = %.preheader.lr.ph, %._crit_edge125.loopexit, %.loopexit118
  %159 = phi ptr [ %.pre128, %._crit_edge125.loopexit ], [ %126, %.loopexit118 ], [ %126, %.preheader.lr.ph ]
  call void @free(ptr noundef %159) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  %160 = call i32 @fclose(ptr noundef %28)
  br label %161

161:                                              ; preds = %.thread115, %._crit_edge125, %30
  %.12 = phi i1 [ false, %30 ], [ true, %._crit_edge125 ], [ false, %.thread115 ]
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %3) #9
  ret i1 %.12
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #4

declare void @TCOD_console_put_char_ex(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i24, i24) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8

attributes #0 = { inlinehint 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { noreturn 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 #4 = { 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind 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 #7 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #8 = { 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 #9 = { nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind allocsize(0) }

!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, !6, i64 16}
!10 = !{!"Data", !11, i64 0, !12, i64 16, !13, i64 32}
!11 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!12 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!"LayerData", !11, i64 0, !14, i64 16, !15, i64 48}
!14 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!10, !6, i64 20}
!17 = !{!10, !6, i64 24}
!18 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!19 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5}
!20 = !{!10, !6, i64 0}
!21 = !{!10, !6, i64 44}
!22 = !{!10, !6, i64 72}
!23 = !{!10, !15, i64 80}
!24 = !{!25, !6, i64 0}
!25 = !{!"TCOD_Console", !6, i64 0, !6, i64 4, !15, i64 8, !6, i64 16, !6, i64 20, !26, i64 24, !26, i64 27, !27, i64 30, !26, i64 31, !6, i64 36, !15, i64 40, !15, i64 48}
!26 = !{!"TCOD_ColorRGB", !7, i64 0, !7, i64 1, !7, i64 2}
!27 = !{!"_Bool", !7, i64 0}
!28 = !{!25, !6, i64 4}
!29 = !{!7, !7, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31, !33}
!33 = !{!"llvm.loop.unswitch.partial.disable"}


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