; 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.TCOD_ColorRGB = type { i8, i8, i8 }

@TCOD_black = external constant %struct.TCOD_ColorRGB, align 1
@credits_initialized = external hidden global i8, align 1
@TCOD_console_credits_render_ex.powered_by = external hidden global [128 x i8], align 16
@TCOD_console_credits_render_ex.char_heat = external hidden global [128 x float], align 16
@TCOD_console_credits_render_ex.char_x = external hidden global [128 x i32], align 16
@TCOD_console_credits_render_ex.char_y = external hidden global [128 x i32], align 16
@TCOD_console_credits_render_ex.static_vars_initialized = external hidden global i8, align 1
@TCOD_console_credits_render_ex.text_length = external hidden global i32, align 4
@TCOD_console_credits_render_ex.text_length_upper = external hidden global i32, align 4
@TCOD_console_credits_render_ex.console_w = external hidden global i32, align 4
@TCOD_console_credits_render_ex.console_h = external hidden global i32, align 4
@TCOD_console_credits_render_ex.text_progress = external hidden global float, align 4
@TCOD_console_credits_render_ex.colormap_heat = external hidden global [64 x %struct.TCOD_ColorRGB], align 16
@TCOD_console_credits_render_ex.colormap_light = external hidden global [64 x %struct.TCOD_ColorRGB], align 16
@TCOD_console_credits_render_ex.noise = external hidden global ptr, align 8
@TCOD_console_credits_render_ex.color_keys_heat = external hidden constant [4 x %struct.TCOD_ColorRGB], align 1
@TCOD_console_credits_render_ex.color_keys_light = external hidden constant [4 x %struct.TCOD_ColorRGB], align 1
@TCOD_console_credits_render_ex.color_key_positions = external hidden constant [4 x i32], align 16
@TCOD_console_credits_render_ex.img = external hidden global ptr, align 8
@TCOD_console_credits_render_ex.left = external hidden global i32, align 4
@TCOD_console_credits_render_ex.right = external hidden global i32, align 4
@TCOD_console_credits_render_ex.top = external hidden global i32, align 4
@TCOD_console_credits_render_ex.bottom = external hidden global i32, align 4
@TCOD_console_credits_render_ex.particle_heat = external hidden global [64 x float], align 16
@TCOD_console_credits_render_ex.particle_x = external hidden global [64 x float], align 16
@TCOD_console_credits_render_ex.particle_y = external hidden global [64 x float], align 16
@TCOD_console_credits_render_ex.particle_x_velocity = external hidden global [64 x float], align 16
@TCOD_console_credits_render_ex.particle_y_velocity = external hidden global [64 x float], align 16
@TCOD_console_credits_render_ex.particle_count = external hidden global i32, align 4
@TCOD_console_credits_render_ex.first_particle = external hidden global i32, align 4
@TCOD_console_credits_render_ex.particle_delay = external hidden global float, align 4
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1
@version_string = external hidden global ptr, align 8

; 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

declare i32 @TCOD_console_get_width(ptr noundef) #3

declare i32 @TCOD_console_get_height(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @TCOD_console_credits_render_ex(ptr noundef %0, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %3, float noundef %4) #4 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca float, align 4
  %12 = alloca %struct.TCOD_ColorRGB, align 1
  %13 = alloca i24, align 4
  %14 = alloca i24, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %struct.TCOD_ColorRGB, align 1
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca float, align 4
  %32 = alloca %struct.TCOD_ColorRGB, align 1
  %33 = alloca i32, align 4
  %34 = alloca %struct.TCOD_ColorRGB, align 1
  %35 = alloca i8, align 1
  %36 = alloca i8, align 1
  %37 = alloca i8, align 1
  %38 = alloca i8, align 1
  %39 = alloca %struct.TCOD_ColorRGB, align 1
  %40 = alloca i24, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca %struct.TCOD_ColorRGB, align 1
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca float, align 4
  %48 = alloca float, align 4
  %49 = alloca %struct.TCOD_ColorRGB, align 1
  %50 = alloca %struct.TCOD_ColorRGB, align 1
  %51 = alloca i24, align 4
  %52 = alloca i24, align 4
  %53 = alloca i24, align 4
  %54 = alloca %struct.TCOD_ColorRGB, align 1
  %55 = alloca %struct.TCOD_ColorRGB, align 1
  %56 = alloca i24, align 4
  %57 = alloca i24, align 4
  %58 = alloca i24, align 4
  %59 = alloca %struct.TCOD_ColorRGB, align 1
  %60 = alloca %struct.TCOD_ColorRGB, align 1
  %61 = alloca i24, align 4
  %62 = alloca i24, align 4
  %63 = alloca i24, align 4
  %64 = alloca i32, align 4
  %65 = alloca i32, align 4
  %66 = alloca i32, align 4
  %67 = alloca %struct.TCOD_ColorRGB, align 1
  %68 = alloca float, align 4
  %69 = alloca %struct.TCOD_ColorRGB, align 1
  %70 = alloca i32, align 4
  %71 = alloca i32, align 4
  %72 = alloca i32, align 4
  %73 = alloca i24, align 4
  %74 = alloca %struct.TCOD_ColorRGB, align 1
  %75 = alloca i24, align 4
  %76 = alloca i24, align 4
  %77 = alloca i24, align 4
  %78 = alloca i32, align 4
  %79 = alloca i24, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  %80 = zext i1 %3 to i8
  store i8 %80, ptr %10, align 1, !tbaa !11
  store float %4, ptr %11, align 4, !tbaa !13
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = call ptr @TCOD_console_validate_(ptr noundef %81)
  store ptr %82, ptr %7, align 8, !tbaa !5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = icmp ne ptr %83, null
  br i1 %84, label %86, label %85

85:                                               ; preds = %5
  store i1 false, ptr %6, align 1
  br label %983

86:                                               ; preds = %5
  %87 = load i8, ptr @TCOD_console_credits_render_ex.static_vars_initialized, align 1, !tbaa !11, !range !15, !noundef !16
  %88 = trunc i8 %87 to i1
  br i1 %88, label %117, label %89

89:                                               ; preds = %86
  call void @TCOD_color_gen_map(ptr noundef @TCOD_console_credits_render_ex.colormap_heat, i32 noundef 4, ptr noundef @TCOD_console_credits_render_ex.color_keys_heat, ptr noundef @TCOD_console_credits_render_ex.color_key_positions)
  call void @TCOD_color_gen_map(ptr noundef @TCOD_console_credits_render_ex.colormap_light, i32 noundef 4, ptr noundef @TCOD_console_credits_render_ex.color_keys_light, ptr noundef @TCOD_console_credits_render_ex.color_key_positions)
  %90 = load ptr, ptr @version_string, align 8, !tbaa !5
  %91 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef @TCOD_console_credits_render_ex.powered_by, i64 noundef 128, ptr noundef @.str.8, ptr noundef %90) #7
  store i32 %91, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %92 = call ptr @TCOD_noise_new(i32 noundef 1, float noundef 5.000000e-01, float noundef 2.000000e+00, ptr noundef null)
  store ptr %92, ptr @TCOD_console_credits_render_ex.noise, align 8, !tbaa !5
  store i32 11, ptr @TCOD_console_credits_render_ex.text_length_upper, align 4, !tbaa !9
  %93 = load i32, ptr %8, align 4, !tbaa !9
  %94 = sub nsw i32 %93, 4
  %95 = icmp sgt i32 %94, 0
  br i1 %95, label %96, label %99

96:                                               ; preds = %89
  %97 = load i32, ptr %8, align 4, !tbaa !9
  %98 = sub nsw i32 %97, 4
  br label %100

99:                                               ; preds = %89
  br label %100

100:                                              ; preds = %99, %96
  %101 = phi i32 [ %98, %96 ], [ 0, %99 ]
  store i32 %101, ptr @TCOD_console_credits_render_ex.left, align 4, !tbaa !9
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = sub nsw i32 %102, 4
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %105, label %108

105:                                              ; preds = %100
  %106 = load i32, ptr %9, align 4, !tbaa !9
  %107 = sub nsw i32 %106, 4
  br label %109

108:                                              ; preds = %100
  br label %109

109:                                              ; preds = %108, %105
  %110 = phi i32 [ %107, %105 ], [ 0, %108 ]
  store i32 %110, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 3, ptr %12) #7
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = call i24 @TCOD_console_get_default_background(ptr noundef %111)
  store i24 %112, ptr %12, align 1
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 1 @TCOD_black, i64 3, i1 false)
  %114 = load i24, ptr %13, align 4
  call void @TCOD_console_set_default_background(ptr noundef %113, i24 %114)
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 1 %12, i64 3, i1 false)
  %116 = load i24, ptr %14, align 4
  call void @TCOD_console_set_default_background(ptr noundef %115, i24 %116)
  store i8 1, ptr @TCOD_console_credits_render_ex.static_vars_initialized, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 3, ptr %12) #7
  br label %117

117:                                              ; preds = %109, %86
  %118 = load i8, ptr @credits_initialized, align 1, !tbaa !11, !range !15, !noundef !16
  %119 = trunc i8 %118 to i1
  br i1 %119, label %157, label %120

120:                                              ; preds = %117
  store float -4.000000e+00, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %121 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %121, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %122 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %122, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %153, %120
  %124 = load i32, ptr %17, align 4, !tbaa !9
  %125 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %156

128:                                              ; preds = %123
  %129 = load i32, ptr %17, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [128 x float], ptr @TCOD_console_credits_render_ex.char_heat, i64 0, i64 %130
  store float -1.000000e+00, ptr %131, align 4, !tbaa !13
  %132 = load i32, ptr %15, align 4, !tbaa !9
  %133 = load i32, ptr %17, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_x, i64 0, i64 %134
  store i32 %132, ptr %135, align 4, !tbaa !9
  %136 = load i32, ptr %16, align 4, !tbaa !9
  %137 = load i32, ptr %17, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_y, i64 0, i64 %138
  store i32 %136, ptr %139, align 4, !tbaa !9
  %140 = load i32, ptr %15, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %15, align 4, !tbaa !9
  %142 = load i32, ptr %17, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [128 x i8], ptr @TCOD_console_credits_render_ex.powered_by, i64 0, i64 %143
  %145 = load i8, ptr %144, align 1, !tbaa !17
  %146 = sext i8 %145 to i32
  %147 = icmp eq i32 %146, 10
  br i1 %147, label %148, label %152

148:                                              ; preds = %128
  %149 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %149, ptr %15, align 4, !tbaa !9
  %150 = load i32, ptr %16, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %16, align 4, !tbaa !9
  br label %152

152:                                              ; preds = %148, %128
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %17, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %17, align 4, !tbaa !9
  br label %123, !llvm.loop !18

156:                                              ; preds = %127
  store i32 0, ptr @TCOD_console_credits_render_ex.first_particle, align 4, !tbaa !9
  store i32 0, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !9
  store i8 1, ptr @credits_initialized, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %157

157:                                              ; preds = %156, %117
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = call i32 @TCOD_console_get_width(ptr noundef %158)
  %160 = load i32, ptr @TCOD_console_credits_render_ex.console_w, align 4, !tbaa !9
  %161 = icmp ne i32 %159, %160
  br i1 %161, label %167, label %162

162:                                              ; preds = %157
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = call i32 @TCOD_console_get_height(ptr noundef %163)
  %165 = load i32, ptr @TCOD_console_credits_render_ex.console_h, align 4, !tbaa !9
  %166 = icmp ne i32 %164, %165
  br i1 %166, label %167, label %218

167:                                              ; preds = %162, %157
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = call i32 @TCOD_console_get_width(ptr noundef %168)
  store i32 %169, ptr @TCOD_console_credits_render_ex.console_w, align 4, !tbaa !9
  %170 = load ptr, ptr %7, align 8, !tbaa !5
  %171 = call i32 @TCOD_console_get_height(ptr noundef %170)
  store i32 %171, ptr @TCOD_console_credits_render_ex.console_h, align 4, !tbaa !9
  %172 = load i32, ptr %8, align 4, !tbaa !9
  %173 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %174 = add nsw i32 %172, %173
  %175 = load i32, ptr @TCOD_console_credits_render_ex.console_w, align 4, !tbaa !9
  %176 = sub nsw i32 %175, 1
  %177 = icmp slt i32 %174, %176
  br i1 %177, label %178, label %182

178:                                              ; preds = %167
  %179 = load i32, ptr %8, align 4, !tbaa !9
  %180 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %181 = add nsw i32 %179, %180
  br label %185

182:                                              ; preds = %167
  %183 = load i32, ptr @TCOD_console_credits_render_ex.console_w, align 4, !tbaa !9
  %184 = sub nsw i32 %183, 1
  br label %185

185:                                              ; preds = %182, %178
  %186 = phi i32 [ %181, %178 ], [ %184, %182 ]
  store i32 %186, ptr @TCOD_console_credits_render_ex.right, align 4, !tbaa !9
  %187 = load i32, ptr %9, align 4, !tbaa !9
  %188 = add nsw i32 %187, 6
  %189 = load i32, ptr @TCOD_console_credits_render_ex.console_h, align 4, !tbaa !9
  %190 = sub nsw i32 %189, 1
  %191 = icmp slt i32 %188, %190
  br i1 %191, label %192, label %195

192:                                              ; preds = %185
  %193 = load i32, ptr %9, align 4, !tbaa !9
  %194 = add nsw i32 %193, 6
  br label %198

195:                                              ; preds = %185
  %196 = load i32, ptr @TCOD_console_credits_render_ex.console_h, align 4, !tbaa !9
  %197 = sub nsw i32 %196, 1
  br label %198

198:                                              ; preds = %195, %192
  %199 = phi i32 [ %194, %192 ], [ %197, %195 ]
  store i32 %199, ptr @TCOD_console_credits_render_ex.bottom, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %200 = load i32, ptr @TCOD_console_credits_render_ex.right, align 4, !tbaa !9
  %201 = load i32, ptr @TCOD_console_credits_render_ex.left, align 4, !tbaa !9
  %202 = sub nsw i32 %200, %201
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %204 = load i32, ptr @TCOD_console_credits_render_ex.bottom, align 4, !tbaa !9
  %205 = load i32, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !9
  %206 = sub nsw i32 %204, %205
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %19, align 4, !tbaa !9
  %208 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  %209 = icmp ne ptr %208, null
  br i1 %209, label %210, label %212

210:                                              ; preds = %198
  %211 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  call void @TCOD_image_delete(ptr noundef %211)
  br label %212

212:                                              ; preds = %210, %198
  %213 = load i32, ptr %18, align 4, !tbaa !9
  %214 = mul nsw i32 %213, 2
  %215 = load i32, ptr %19, align 4, !tbaa !9
  %216 = mul nsw i32 %215, 2
  %217 = call ptr @TCOD_image_new(i32 noundef %214, i32 noundef %216)
  store ptr %217, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %218

218:                                              ; preds = %212, %162
  call void @llvm.lifetime.start.p0(i64 3, ptr %20) #7
  %219 = load ptr, ptr %7, align 8, !tbaa !5
  %220 = call i24 @TCOD_console_get_default_foreground(ptr noundef %219)
  store i24 %220, ptr %20, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %221 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %222 = load i32, ptr @TCOD_console_credits_render_ex.text_length_upper, align 4, !tbaa !9
  %223 = sitofp i32 %222 to float
  %224 = fcmp olt float %221, %223
  br i1 %224, label %225, label %232

225:                                              ; preds = %218
  %226 = load i32, ptr %8, align 4, !tbaa !9
  %227 = sitofp i32 %226 to float
  %228 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %229 = fadd float %227, %228
  store float %229, ptr %21, align 4, !tbaa !13
  %230 = load i32, ptr %9, align 4, !tbaa !9
  %231 = sitofp i32 %230 to float
  store float %231, ptr %22, align 4, !tbaa !13
  br label %242

232:                                              ; preds = %218
  %233 = load i32, ptr %8, align 4, !tbaa !9
  %234 = load i32, ptr @TCOD_console_credits_render_ex.text_length_upper, align 4, !tbaa !9
  %235 = sub nsw i32 %233, %234
  %236 = sitofp i32 %235 to float
  %237 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %238 = fadd float %236, %237
  store float %238, ptr %21, align 4, !tbaa !13
  %239 = load i32, ptr %9, align 4, !tbaa !9
  %240 = add nsw i32 %239, 1
  %241 = sitofp i32 %240 to float
  store float %241, ptr %22, align 4, !tbaa !13
  br label %242

242:                                              ; preds = %232, %225
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %243 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %244 = fmul float %243, 6.000000e+00
  store float %244, ptr %23, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %245 = load ptr, ptr @TCOD_console_credits_render_ex.noise, align 8, !tbaa !5
  %246 = call float @TCOD_noise_get(ptr noundef %245, ptr noundef %23)
  %247 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %246, float 3.000000e+00)
  store float %247, ptr %24, align 4, !tbaa !13
  %248 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %249 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %250 = sub nsw i32 %249, 1
  %251 = sitofp i32 %250 to float
  %252 = fcmp oge float %248, %251
  br i1 %252, label %253, label %262

253:                                              ; preds = %242
  %254 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %255 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %256 = sitofp i32 %255 to float
  %257 = fsub float %254, %256
  %258 = fadd float %257, 1.000000e+00
  %259 = load float, ptr %24, align 4, !tbaa !13
  %260 = fneg float %258
  %261 = call float @llvm.fmuladd.f32(float %260, float 4.000000e+00, float %259)
  store float %261, ptr %24, align 4, !tbaa !13
  br label %292

262:                                              ; preds = %242
  %263 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %264 = fcmp olt float %263, 0.000000e+00
  br i1 %264, label %265, label %269

265:                                              ; preds = %262
  %266 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %267 = load float, ptr %24, align 4, !tbaa !13
  %268 = call float @llvm.fmuladd.f32(float %266, float 4.000000e+00, float %267)
  store float %268, ptr %24, align 4, !tbaa !13
  br label %291

269:                                              ; preds = %262
  %270 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %271 = fadd float %270, 5.000000e-01
  %272 = fptosi float %271 to i32
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [128 x i8], ptr @TCOD_console_credits_render_ex.powered_by, i64 0, i64 %273
  %275 = load i8, ptr %274, align 1, !tbaa !17
  %276 = sext i8 %275 to i32
  %277 = icmp eq i32 %276, 32
  br i1 %277, label %287, label %278

278:                                              ; preds = %269
  %279 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %280 = fadd float %279, 5.000000e-01
  %281 = fptosi float %280 to i32
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [128 x i8], ptr @TCOD_console_credits_render_ex.powered_by, i64 0, i64 %282
  %284 = load i8, ptr %283, align 1, !tbaa !17
  %285 = sext i8 %284 to i32
  %286 = icmp eq i32 %285, 10
  br i1 %286, label %287, label %290

287:                                              ; preds = %278, %269
  %288 = load float, ptr %24, align 4, !tbaa !13
  %289 = fdiv float %288, 2.000000e+00
  store float %289, ptr %24, align 4, !tbaa !13
  br label %290

290:                                              ; preds = %287, %278
  br label %291

291:                                              ; preds = %290, %265
  br label %292

292:                                              ; preds = %291, %253
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %293 = load float, ptr %24, align 4, !tbaa !13
  %294 = load float, ptr %24, align 4, !tbaa !13
  %295 = fmul float %293, %294
  %296 = fmul float %295, 4.000000e+00
  store float %296, ptr %25, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %297 = load i32, ptr @TCOD_console_credits_render_ex.left, align 4, !tbaa !9
  %298 = mul nsw i32 %297, 2
  store i32 %298, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %299

299:                                              ; preds = %497, %292
  %300 = load i32, ptr %26, align 4, !tbaa !9
  %301 = load i32, ptr @TCOD_console_credits_render_ex.right, align 4, !tbaa !9
  %302 = add nsw i32 %301, 1
  %303 = mul nsw i32 %302, 2
  %304 = icmp slt i32 %300, %303
  br i1 %304, label %306, label %305

305:                                              ; preds = %299
  store i32 5, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %502

306:                                              ; preds = %299
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %307 = load i32, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !9
  %308 = mul nsw i32 %307, 2
  store i32 %308, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %309

309:                                              ; preds = %491, %306
  %310 = load i32, ptr %29, align 4, !tbaa !9
  %311 = load i32, ptr @TCOD_console_credits_render_ex.bottom, align 4, !tbaa !9
  %312 = add nsw i32 %311, 1
  %313 = mul nsw i32 %312, 2
  %314 = icmp slt i32 %310, %313
  br i1 %314, label %316, label %315

315:                                              ; preds = %309
  store i32 8, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %496

316:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %317 = load i32, ptr %26, align 4, !tbaa !9
  %318 = sitofp i32 %317 to float
  %319 = load float, ptr %21, align 4, !tbaa !13
  %320 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %319, float %318)
  %321 = load i32, ptr %26, align 4, !tbaa !9
  %322 = sitofp i32 %321 to float
  %323 = load float, ptr %21, align 4, !tbaa !13
  %324 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %323, float %322)
  %325 = load i32, ptr %29, align 4, !tbaa !9
  %326 = sitofp i32 %325 to float
  %327 = load float, ptr %22, align 4, !tbaa !13
  %328 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %327, float %326)
  %329 = load i32, ptr %29, align 4, !tbaa !9
  %330 = sitofp i32 %329 to float
  %331 = load float, ptr %22, align 4, !tbaa !13
  %332 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %331, float %330)
  %333 = fmul float %328, %332
  %334 = call float @llvm.fmuladd.f32(float %320, float %324, float %333)
  store float %334, ptr %31, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 3, ptr %32) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %32, ptr align 1 @TCOD_black, i64 3, i1 false), !tbaa.struct !20
  %335 = load float, ptr %24, align 4, !tbaa !13
  %336 = fcmp oge float %335, 0.000000e+00
  br i1 %336, label %337, label %368

337:                                              ; preds = %316
  %338 = load float, ptr %31, align 4, !tbaa !13
  %339 = load float, ptr %25, align 4, !tbaa !13
  %340 = fcmp olt float %338, %339
  br i1 %340, label %341, label %368

341:                                              ; preds = %337
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  %342 = load float, ptr %25, align 4, !tbaa !13
  %343 = load float, ptr %31, align 4, !tbaa !13
  %344 = fsub float %342, %343
  %345 = fmul float 6.300000e+01, %344
  %346 = load float, ptr %25, align 4, !tbaa !13
  %347 = fdiv float %345, %346
  %348 = fptosi float %347 to i32
  %349 = sub nsw i32 63, %348
  %350 = call i32 @TCOD_random_get_int(ptr noundef null, i32 noundef -10, i32 noundef 10)
  %351 = add nsw i32 %349, %350
  store i32 %351, ptr %33, align 4, !tbaa !9
  %352 = load i32, ptr %33, align 4, !tbaa !9
  %353 = icmp slt i32 %352, 0
  br i1 %353, label %354, label %355

354:                                              ; preds = %341
  br label %363

355:                                              ; preds = %341
  %356 = load i32, ptr %33, align 4, !tbaa !9
  %357 = icmp sgt i32 %356, 63
  br i1 %357, label %358, label %359

358:                                              ; preds = %355
  br label %361

359:                                              ; preds = %355
  %360 = load i32, ptr %33, align 4, !tbaa !9
  br label %361

361:                                              ; preds = %359, %358
  %362 = phi i32 [ 63, %358 ], [ %360, %359 ]
  br label %363

363:                                              ; preds = %361, %354
  %364 = phi i32 [ 0, %354 ], [ %362, %361 ]
  store i32 %364, ptr %33, align 4, !tbaa !9
  %365 = load i32, ptr %33, align 4, !tbaa !9
  %366 = sext i32 %365 to i64
  %367 = getelementptr inbounds [64 x %struct.TCOD_ColorRGB], ptr @TCOD_console_credits_render_ex.colormap_light, i64 0, i64 %366
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %32, ptr align 1 %367, i64 3, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %368

368:                                              ; preds = %363, %337, %316
  %369 = load i8, ptr %10, align 1, !tbaa !11, !range !15, !noundef !16
  %370 = trunc i8 %369 to i1
  br i1 %370, label %371, label %486

371:                                              ; preds = %368
  call void @llvm.lifetime.start.p0(i64 3, ptr %34) #7
  %372 = load ptr, ptr %7, align 8, !tbaa !5
  %373 = load i32, ptr %26, align 4, !tbaa !9
  %374 = sdiv i32 %373, 2
  %375 = load i32, ptr %29, align 4, !tbaa !9
  %376 = sdiv i32 %375, 2
  %377 = call i24 @TCOD_console_get_char_background(ptr noundef %372, i32 noundef %374, i32 noundef %376)
  store i24 %377, ptr %34, align 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %35) #7
  %378 = load ptr, ptr %7, align 8, !tbaa !5
  %379 = load i32, ptr %26, align 4, !tbaa !9
  %380 = sdiv i32 %379, 2
  %381 = load i32, ptr %29, align 4, !tbaa !9
  %382 = sdiv i32 %381, 2
  %383 = call i32 @TCOD_console_get_char(ptr noundef %378, i32 noundef %380, i32 noundef %382)
  %384 = call signext i8 @quadrants_from_codepoint(i32 noundef %383)
  store i8 %384, ptr %35, align 1, !tbaa !17
  %385 = load i8, ptr %35, align 1, !tbaa !17
  %386 = sext i8 %385 to i32
  %387 = icmp sgt i32 %386, 0
  br i1 %387, label %388, label %422

388:                                              ; preds = %371
  call void @llvm.lifetime.start.p0(i64 1, ptr %36) #7
  %389 = load i32, ptr %26, align 4, !tbaa !9
  %390 = and i32 %389, 1
  %391 = icmp ne i32 %390, 0
  %392 = zext i1 %391 to i8
  store i8 %392, ptr %36, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %37) #7
  %393 = load i32, ptr %29, align 4, !tbaa !9
  %394 = and i32 %393, 1
  %395 = icmp ne i32 %394, 0
  %396 = zext i1 %395 to i8
  store i8 %396, ptr %37, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %38) #7
  %397 = load i8, ptr %37, align 1, !tbaa !11, !range !15, !noundef !16
  %398 = trunc i8 %397 to i1
  %399 = zext i1 %398 to i32
  %400 = mul nsw i32 3, %399
  %401 = add nsw i32 1, %400
  %402 = load i8, ptr %36, align 1, !tbaa !11, !range !15, !noundef !16
  %403 = trunc i8 %402 to i1
  %404 = zext i1 %403 to i32
  %405 = add nsw i32 %404, 1
  %406 = mul nsw i32 %401, %405
  %407 = trunc i32 %406 to i8
  store i8 %407, ptr %38, align 1, !tbaa !17
  %408 = load i8, ptr %38, align 1, !tbaa !17
  %409 = sext i8 %408 to i32
  %410 = load i8, ptr %35, align 1, !tbaa !17
  %411 = sext i8 %410 to i32
  %412 = and i32 %409, %411
  %413 = icmp ne i32 %412, 0
  br i1 %413, label %414, label %421

414:                                              ; preds = %388
  call void @llvm.lifetime.start.p0(i64 3, ptr %39) #7
  %415 = load ptr, ptr %7, align 8, !tbaa !5
  %416 = load i32, ptr %26, align 4, !tbaa !9
  %417 = sdiv i32 %416, 2
  %418 = load i32, ptr %29, align 4, !tbaa !9
  %419 = sdiv i32 %418, 2
  %420 = call i24 @TCOD_console_get_char_foreground(ptr noundef %415, i32 noundef %417, i32 noundef %419)
  store i24 %420, ptr %39, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %34, ptr align 1 %39, i64 3, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 3, ptr %39) #7
  br label %421

421:                                              ; preds = %414, %388
  call void @llvm.lifetime.end.p0(i64 1, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %36) #7
  br label %422

422:                                              ; preds = %421, %371
  %423 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %34, i32 0, i32 0
  %424 = load i8, ptr %423, align 1, !tbaa !21
  %425 = zext i8 %424 to i32
  %426 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 0
  %427 = load i8, ptr %426, align 1, !tbaa !21
  %428 = zext i8 %427 to i32
  %429 = add nsw i32 %425, %428
  %430 = icmp slt i32 255, %429
  br i1 %430, label %431, label %432

431:                                              ; preds = %422
  br label %440

432:                                              ; preds = %422
  %433 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %34, i32 0, i32 0
  %434 = load i8, ptr %433, align 1, !tbaa !21
  %435 = zext i8 %434 to i32
  %436 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 0
  %437 = load i8, ptr %436, align 1, !tbaa !21
  %438 = zext i8 %437 to i32
  %439 = add nsw i32 %435, %438
  br label %440

440:                                              ; preds = %432, %431
  %441 = phi i32 [ 255, %431 ], [ %439, %432 ]
  %442 = trunc i32 %441 to i8
  %443 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 0
  store i8 %442, ptr %443, align 1, !tbaa !21
  %444 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %34, i32 0, i32 1
  %445 = load i8, ptr %444, align 1, !tbaa !23
  %446 = zext i8 %445 to i32
  %447 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 1
  %448 = load i8, ptr %447, align 1, !tbaa !23
  %449 = zext i8 %448 to i32
  %450 = add nsw i32 %446, %449
  %451 = icmp slt i32 255, %450
  br i1 %451, label %452, label %453

452:                                              ; preds = %440
  br label %461

453:                                              ; preds = %440
  %454 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %34, i32 0, i32 1
  %455 = load i8, ptr %454, align 1, !tbaa !23
  %456 = zext i8 %455 to i32
  %457 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 1
  %458 = load i8, ptr %457, align 1, !tbaa !23
  %459 = zext i8 %458 to i32
  %460 = add nsw i32 %456, %459
  br label %461

461:                                              ; preds = %453, %452
  %462 = phi i32 [ 255, %452 ], [ %460, %453 ]
  %463 = trunc i32 %462 to i8
  %464 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 1
  store i8 %463, ptr %464, align 1, !tbaa !23
  %465 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %34, i32 0, i32 2
  %466 = load i8, ptr %465, align 1, !tbaa !24
  %467 = zext i8 %466 to i32
  %468 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 2
  %469 = load i8, ptr %468, align 1, !tbaa !24
  %470 = zext i8 %469 to i32
  %471 = add nsw i32 %467, %470
  %472 = icmp slt i32 255, %471
  br i1 %472, label %473, label %474

473:                                              ; preds = %461
  br label %482

474:                                              ; preds = %461
  %475 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %34, i32 0, i32 2
  %476 = load i8, ptr %475, align 1, !tbaa !24
  %477 = zext i8 %476 to i32
  %478 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 2
  %479 = load i8, ptr %478, align 1, !tbaa !24
  %480 = zext i8 %479 to i32
  %481 = add nsw i32 %477, %480
  br label %482

482:                                              ; preds = %474, %473
  %483 = phi i32 [ 255, %473 ], [ %481, %474 ]
  %484 = trunc i32 %483 to i8
  %485 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %32, i32 0, i32 2
  store i8 %484, ptr %485, align 1, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 1, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 3, ptr %34) #7
  br label %486

486:                                              ; preds = %482, %368
  %487 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  %488 = load i32, ptr %27, align 4, !tbaa !9
  %489 = load i32, ptr %30, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %40, ptr align 1 %32, i64 3, i1 false)
  %490 = load i24, ptr %40, align 4
  call void @TCOD_image_put_pixel(ptr noundef %487, i32 noundef %488, i32 noundef %489, i24 %490)
  call void @llvm.lifetime.end.p0(i64 3, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %491

491:                                              ; preds = %486
  %492 = load i32, ptr %29, align 4, !tbaa !9
  %493 = add nsw i32 %492, 1
  store i32 %493, ptr %29, align 4, !tbaa !9
  %494 = load i32, ptr %30, align 4, !tbaa !9
  %495 = add nsw i32 %494, 1
  store i32 %495, ptr %30, align 4, !tbaa !9
  br label %309, !llvm.loop !25

496:                                              ; preds = %315
  br label %497

497:                                              ; preds = %496
  %498 = load i32, ptr %26, align 4, !tbaa !9
  %499 = add nsw i32 %498, 1
  store i32 %499, ptr %26, align 4, !tbaa !9
  %500 = load i32, ptr %27, align 4, !tbaa !9
  %501 = add nsw i32 %500, 1
  store i32 %501, ptr %27, align 4, !tbaa !9
  br label %299, !llvm.loop !26

502:                                              ; preds = %305
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #7
  %503 = load i32, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !9
  store i32 %503, ptr %41, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #7
  %504 = load i32, ptr @TCOD_console_credits_render_ex.first_particle, align 4, !tbaa !9
  store i32 %504, ptr %42, align 4, !tbaa !9
  br label %505

505:                                              ; preds = %678, %502
  %506 = load i32, ptr %41, align 4, !tbaa !9
  %507 = icmp sgt i32 %506, 0
  br i1 %507, label %508, label %684

508:                                              ; preds = %505
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #7
  %509 = load i32, ptr %42, align 4, !tbaa !9
  %510 = sext i32 %509 to i64
  %511 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_heat, i64 0, i64 %510
  %512 = load float, ptr %511, align 4, !tbaa !13
  %513 = fsub float 1.000000e+00, %512
  %514 = fmul float 6.400000e+01, %513
  %515 = fptosi float %514 to i32
  %516 = icmp slt i32 63, %515
  br i1 %516, label %517, label %518

517:                                              ; preds = %508
  br label %526

518:                                              ; preds = %508
  %519 = load i32, ptr %42, align 4, !tbaa !9
  %520 = sext i32 %519 to i64
  %521 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_heat, i64 0, i64 %520
  %522 = load float, ptr %521, align 4, !tbaa !13
  %523 = fsub float 1.000000e+00, %522
  %524 = fmul float 6.400000e+01, %523
  %525 = fptosi float %524 to i32
  br label %526

526:                                              ; preds = %518, %517
  %527 = phi i32 [ 63, %517 ], [ %525, %518 ]
  store i32 %527, ptr %43, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 3, ptr %44) #7
  %528 = load i32, ptr %43, align 4, !tbaa !9
  %529 = sext i32 %528 to i64
  %530 = getelementptr inbounds [64 x %struct.TCOD_ColorRGB], ptr @TCOD_console_credits_render_ex.colormap_heat, i64 0, i64 %529
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %44, ptr align 1 %530, i64 3, i1 false), !tbaa.struct !20
  %531 = load i32, ptr %42, align 4, !tbaa !9
  %532 = sext i32 %531 to i64
  %533 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y, i64 0, i64 %532
  %534 = load float, ptr %533, align 4, !tbaa !13
  %535 = load i32, ptr @TCOD_console_credits_render_ex.bottom, align 4, !tbaa !9
  %536 = load i32, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !9
  %537 = sub nsw i32 %535, %536
  %538 = add nsw i32 %537, 1
  %539 = mul nsw i32 %538, 2
  %540 = sitofp i32 %539 to float
  %541 = fcmp olt float %534, %540
  br i1 %541, label %542, label %610

542:                                              ; preds = %526
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #7
  %543 = load i32, ptr %42, align 4, !tbaa !9
  %544 = sext i32 %543 to i64
  %545 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x, i64 0, i64 %544
  %546 = load float, ptr %545, align 4, !tbaa !13
  %547 = fptosi float %546 to i32
  store i32 %547, ptr %45, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #7
  %548 = load i32, ptr %42, align 4, !tbaa !9
  %549 = sext i32 %548 to i64
  %550 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y, i64 0, i64 %549
  %551 = load float, ptr %550, align 4, !tbaa !13
  %552 = fptosi float %551 to i32
  store i32 %552, ptr %46, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #7
  %553 = load i32, ptr %42, align 4, !tbaa !9
  %554 = sext i32 %553 to i64
  %555 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x, i64 0, i64 %554
  %556 = load float, ptr %555, align 4, !tbaa !13
  %557 = load i32, ptr %45, align 4, !tbaa !9
  %558 = sitofp i32 %557 to float
  %559 = fsub float %556, %558
  store float %559, ptr %47, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #7
  %560 = load i32, ptr %42, align 4, !tbaa !9
  %561 = sext i32 %560 to i64
  %562 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y, i64 0, i64 %561
  %563 = load float, ptr %562, align 4, !tbaa !13
  %564 = load i32, ptr %46, align 4, !tbaa !9
  %565 = sitofp i32 %564 to float
  %566 = fsub float %563, %565
  store float %566, ptr %48, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 3, ptr %49) #7
  %567 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  %568 = load i32, ptr %45, align 4, !tbaa !9
  %569 = load i32, ptr %46, align 4, !tbaa !9
  %570 = call i24 @TCOD_image_get_pixel(ptr noundef %567, i32 noundef %568, i32 noundef %569)
  store i24 %570, ptr %49, align 1
  call void @llvm.lifetime.start.p0(i64 3, ptr %50) #7
  %571 = load float, ptr %47, align 4, !tbaa !13
  %572 = load float, ptr %48, align 4, !tbaa !13
  %573 = fadd float %571, %572
  %574 = fmul float 5.000000e-01, %573
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %51, ptr align 1 %44, i64 3, i1 false)
  %575 = load i24, ptr %51, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %52, ptr align 1 %49, i64 3, i1 false)
  %576 = load i24, ptr %52, align 4
  %577 = call i24 @TCOD_color_lerp(i24 %575, i24 %576, float noundef %574)
  store i24 %577, ptr %50, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %49, ptr align 1 %50, i64 3, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 3, ptr %50) #7
  %578 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  %579 = load i32, ptr %45, align 4, !tbaa !9
  %580 = load i32, ptr %46, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %53, ptr align 1 %49, i64 3, i1 false)
  %581 = load i24, ptr %53, align 4
  call void @TCOD_image_put_pixel(ptr noundef %578, i32 noundef %579, i32 noundef %580, i24 %581)
  call void @llvm.lifetime.start.p0(i64 3, ptr %54) #7
  %582 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  %583 = load i32, ptr %45, align 4, !tbaa !9
  %584 = add nsw i32 %583, 1
  %585 = load i32, ptr %46, align 4, !tbaa !9
  %586 = call i24 @TCOD_image_get_pixel(ptr noundef %582, i32 noundef %584, i32 noundef %585)
  store i24 %586, ptr %54, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %49, ptr align 1 %54, i64 3, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 3, ptr %54) #7
  call void @llvm.lifetime.start.p0(i64 3, ptr %55) #7
  %587 = load float, ptr %47, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %56, ptr align 1 %49, i64 3, i1 false)
  %588 = load i24, ptr %56, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %57, ptr align 1 %44, i64 3, i1 false)
  %589 = load i24, ptr %57, align 4
  %590 = call i24 @TCOD_color_lerp(i24 %588, i24 %589, float noundef %587)
  store i24 %590, ptr %55, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %49, ptr align 1 %55, i64 3, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 3, ptr %55) #7
  %591 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  %592 = load i32, ptr %45, align 4, !tbaa !9
  %593 = add nsw i32 %592, 1
  %594 = load i32, ptr %46, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %58, ptr align 1 %49, i64 3, i1 false)
  %595 = load i24, ptr %58, align 4
  call void @TCOD_image_put_pixel(ptr noundef %591, i32 noundef %593, i32 noundef %594, i24 %595)
  call void @llvm.lifetime.start.p0(i64 3, ptr %59) #7
  %596 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  %597 = load i32, ptr %45, align 4, !tbaa !9
  %598 = load i32, ptr %46, align 4, !tbaa !9
  %599 = add nsw i32 %598, 1
  %600 = call i24 @TCOD_image_get_pixel(ptr noundef %596, i32 noundef %597, i32 noundef %599)
  store i24 %600, ptr %59, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %49, ptr align 1 %59, i64 3, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 3, ptr %59) #7
  call void @llvm.lifetime.start.p0(i64 3, ptr %60) #7
  %601 = load float, ptr %48, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %61, ptr align 1 %49, i64 3, i1 false)
  %602 = load i24, ptr %61, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %62, ptr align 1 %44, i64 3, i1 false)
  %603 = load i24, ptr %62, align 4
  %604 = call i24 @TCOD_color_lerp(i24 %602, i24 %603, float noundef %601)
  store i24 %604, ptr %60, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %49, ptr align 1 %60, i64 3, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 3, ptr %60) #7
  %605 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  %606 = load i32, ptr %45, align 4, !tbaa !9
  %607 = load i32, ptr %46, align 4, !tbaa !9
  %608 = add nsw i32 %607, 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %63, ptr align 1 %49, i64 3, i1 false)
  %609 = load i24, ptr %63, align 4
  call void @TCOD_image_put_pixel(ptr noundef %605, i32 noundef %606, i32 noundef %608, i24 %609)
  call void @llvm.lifetime.end.p0(i64 3, ptr %49) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #7
  br label %620

610:                                              ; preds = %526
  %611 = load i32, ptr %42, align 4, !tbaa !9
  %612 = sext i32 %611 to i64
  %613 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y_velocity, i64 0, i64 %612
  %614 = load float, ptr %613, align 4, !tbaa !13
  %615 = fneg float %614
  %616 = fmul float %615, 5.000000e-01
  %617 = load i32, ptr %42, align 4, !tbaa !9
  %618 = sext i32 %617 to i64
  %619 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y_velocity, i64 0, i64 %618
  store float %616, ptr %619, align 4, !tbaa !13
  br label %620

620:                                              ; preds = %610, %542
  %621 = load float, ptr %11, align 4, !tbaa !13
  %622 = fsub float 1.000000e+00, %621
  %623 = load i32, ptr %42, align 4, !tbaa !9
  %624 = sext i32 %623 to i64
  %625 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x_velocity, i64 0, i64 %624
  %626 = load float, ptr %625, align 4, !tbaa !13
  %627 = fmul float %626, %622
  store float %627, ptr %625, align 4, !tbaa !13
  %628 = load i32, ptr %42, align 4, !tbaa !9
  %629 = sext i32 %628 to i64
  %630 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_heat, i64 0, i64 %629
  %631 = load float, ptr %630, align 4, !tbaa !13
  %632 = fsub float 1.000000e+00, %631
  %633 = load float, ptr %11, align 4, !tbaa !13
  %634 = fmul float %632, %633
  %635 = load i32, ptr %42, align 4, !tbaa !9
  %636 = sext i32 %635 to i64
  %637 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y_velocity, i64 0, i64 %636
  %638 = load float, ptr %637, align 4, !tbaa !13
  %639 = call float @llvm.fmuladd.f32(float %634, float 3.000000e+02, float %638)
  store float %639, ptr %637, align 4, !tbaa !13
  %640 = load i32, ptr %42, align 4, !tbaa !9
  %641 = sext i32 %640 to i64
  %642 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x_velocity, i64 0, i64 %641
  %643 = load float, ptr %642, align 4, !tbaa !13
  %644 = load float, ptr %11, align 4, !tbaa !13
  %645 = load i32, ptr %42, align 4, !tbaa !9
  %646 = sext i32 %645 to i64
  %647 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x, i64 0, i64 %646
  %648 = load float, ptr %647, align 4, !tbaa !13
  %649 = call float @llvm.fmuladd.f32(float %643, float %644, float %648)
  store float %649, ptr %647, align 4, !tbaa !13
  %650 = load i32, ptr %42, align 4, !tbaa !9
  %651 = sext i32 %650 to i64
  %652 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y_velocity, i64 0, i64 %651
  %653 = load float, ptr %652, align 4, !tbaa !13
  %654 = load float, ptr %11, align 4, !tbaa !13
  %655 = load i32, ptr %42, align 4, !tbaa !9
  %656 = sext i32 %655 to i64
  %657 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y, i64 0, i64 %656
  %658 = load float, ptr %657, align 4, !tbaa !13
  %659 = call float @llvm.fmuladd.f32(float %653, float %654, float %658)
  store float %659, ptr %657, align 4, !tbaa !13
  %660 = load float, ptr %11, align 4, !tbaa !13
  %661 = load i32, ptr %42, align 4, !tbaa !9
  %662 = sext i32 %661 to i64
  %663 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_heat, i64 0, i64 %662
  %664 = load float, ptr %663, align 4, !tbaa !13
  %665 = fneg float %660
  %666 = call float @llvm.fmuladd.f32(float %665, float 0x3FD3333340000000, float %664)
  store float %666, ptr %663, align 4, !tbaa !13
  %667 = load i32, ptr %42, align 4, !tbaa !9
  %668 = sext i32 %667 to i64
  %669 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_heat, i64 0, i64 %668
  %670 = load float, ptr %669, align 4, !tbaa !13
  %671 = fcmp olt float %670, 0.000000e+00
  br i1 %671, label %672, label %678

672:                                              ; preds = %620
  %673 = load i32, ptr @TCOD_console_credits_render_ex.first_particle, align 4, !tbaa !9
  %674 = add nsw i32 %673, 1
  %675 = srem i32 %674, 64
  store i32 %675, ptr @TCOD_console_credits_render_ex.first_particle, align 4, !tbaa !9
  %676 = load i32, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !9
  %677 = add nsw i32 %676, -1
  store i32 %677, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !9
  br label %678

678:                                              ; preds = %672, %620
  %679 = load i32, ptr %42, align 4, !tbaa !9
  %680 = add nsw i32 %679, 1
  %681 = srem i32 %680, 64
  store i32 %681, ptr %42, align 4, !tbaa !9
  %682 = load i32, ptr %41, align 4, !tbaa !9
  %683 = add nsw i32 %682, -1
  store i32 %683, ptr %41, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 3, ptr %44) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #7
  br label %505, !llvm.loop !27

684:                                              ; preds = %505
  %685 = load float, ptr %11, align 4, !tbaa !13
  %686 = load float, ptr @TCOD_console_credits_render_ex.particle_delay, align 4, !tbaa !13
  %687 = fsub float %686, %685
  store float %687, ptr @TCOD_console_credits_render_ex.particle_delay, align 4, !tbaa !13
  %688 = load float, ptr @TCOD_console_credits_render_ex.particle_delay, align 4, !tbaa !13
  %689 = fcmp olt float %688, 0.000000e+00
  br i1 %689, label %690, label %731

690:                                              ; preds = %684
  %691 = load i32, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !9
  %692 = icmp slt i32 %691, 64
  br i1 %692, label %693, label %731

693:                                              ; preds = %690
  %694 = load float, ptr %24, align 4, !tbaa !13
  %695 = fcmp ogt float %694, 2.000000e+00
  br i1 %695, label %696, label %731

696:                                              ; preds = %693
  call void @llvm.lifetime.start.p0(i64 4, ptr %64) #7
  %697 = load i32, ptr @TCOD_console_credits_render_ex.first_particle, align 4, !tbaa !9
  %698 = load i32, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !9
  %699 = add nsw i32 %698, 1
  store i32 %699, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !9
  %700 = add nsw i32 %697, %698
  %701 = srem i32 %700, 64
  store i32 %701, ptr %64, align 4, !tbaa !9
  %702 = load float, ptr %21, align 4, !tbaa !13
  %703 = load i32, ptr @TCOD_console_credits_render_ex.left, align 4, !tbaa !9
  %704 = sitofp i32 %703 to float
  %705 = fsub float %702, %704
  %706 = fmul float 2.000000e+00, %705
  %707 = load i32, ptr %64, align 4, !tbaa !9
  %708 = sext i32 %707 to i64
  %709 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x, i64 0, i64 %708
  store float %706, ptr %709, align 4, !tbaa !13
  %710 = load float, ptr %22, align 4, !tbaa !13
  %711 = load i32, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !9
  %712 = sitofp i32 %711 to float
  %713 = fsub float %710, %712
  %714 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %713, float 2.000000e+00)
  %715 = load i32, ptr %64, align 4, !tbaa !9
  %716 = sext i32 %715 to i64
  %717 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y, i64 0, i64 %716
  store float %714, ptr %717, align 4, !tbaa !13
  %718 = call float @TCOD_random_get_float(ptr noundef null, float noundef -5.000000e+00, float noundef 5.000000e+00)
  %719 = load i32, ptr %64, align 4, !tbaa !9
  %720 = sext i32 %719 to i64
  %721 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x_velocity, i64 0, i64 %720
  store float %718, ptr %721, align 4, !tbaa !13
  %722 = call float @TCOD_random_get_float(ptr noundef null, float noundef -5.000000e-01, float noundef -1.500000e+01)
  %723 = load i32, ptr %64, align 4, !tbaa !9
  %724 = sext i32 %723 to i64
  %725 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y_velocity, i64 0, i64 %724
  store float %722, ptr %725, align 4, !tbaa !13
  %726 = load i32, ptr %64, align 4, !tbaa !9
  %727 = sext i32 %726 to i64
  %728 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_heat, i64 0, i64 %727
  store float 1.000000e+00, ptr %728, align 4, !tbaa !13
  %729 = load float, ptr @TCOD_console_credits_render_ex.particle_delay, align 4, !tbaa !13
  %730 = fadd float %729, 0x3FB99999A0000000
  store float %730, ptr @TCOD_console_credits_render_ex.particle_delay, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %64) #7
  br label %731

731:                                              ; preds = %696, %693, %690, %684
  %732 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !5
  %733 = load ptr, ptr %7, align 8, !tbaa !5
  %734 = load i32, ptr @TCOD_console_credits_render_ex.left, align 4, !tbaa !9
  %735 = load i32, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !9
  call void @TCOD_image_blit_2x(ptr noundef %732, ptr noundef %733, i32 noundef %734, i32 noundef %735, i32 noundef 0, i32 noundef 0, i32 noundef -1, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %65) #7
  store i32 0, ptr %65, align 4, !tbaa !9
  br label %736

736:                                              ; preds = %943, %731
  %737 = load i32, ptr %65, align 4, !tbaa !9
  %738 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %739 = icmp slt i32 %737, %738
  br i1 %739, label %741, label %740

740:                                              ; preds = %736
  store i32 13, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %65) #7
  br label %946

741:                                              ; preds = %736
  %742 = load i32, ptr %65, align 4, !tbaa !9
  %743 = sext i32 %742 to i64
  %744 = getelementptr inbounds [128 x float], ptr @TCOD_console_credits_render_ex.char_heat, i64 0, i64 %743
  %745 = load float, ptr %744, align 4, !tbaa !13
  %746 = fcmp oge float %745, 0.000000e+00
  br i1 %746, label %747, label %942

747:                                              ; preds = %741
  %748 = load i32, ptr %65, align 4, !tbaa !9
  %749 = sext i32 %748 to i64
  %750 = getelementptr inbounds [128 x i8], ptr @TCOD_console_credits_render_ex.powered_by, i64 0, i64 %749
  %751 = load i8, ptr %750, align 1, !tbaa !17
  %752 = sext i8 %751 to i32
  %753 = icmp ne i32 %752, 10
  br i1 %753, label %754, label %942

754:                                              ; preds = %747
  call void @llvm.lifetime.start.p0(i64 4, ptr %66) #7
  %755 = load i32, ptr %65, align 4, !tbaa !9
  %756 = sext i32 %755 to i64
  %757 = getelementptr inbounds [128 x float], ptr @TCOD_console_credits_render_ex.char_heat, i64 0, i64 %756
  %758 = load float, ptr %757, align 4, !tbaa !13
  %759 = fmul float 6.400000e+01, %758
  %760 = fptosi float %759 to i32
  store i32 %760, ptr %66, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 3, ptr %67) #7
  %761 = load i32, ptr %66, align 4, !tbaa !9
  %762 = icmp slt i32 63, %761
  br i1 %762, label %763, label %764

763:                                              ; preds = %754
  br label %766

764:                                              ; preds = %754
  %765 = load i32, ptr %66, align 4, !tbaa !9
  br label %766

766:                                              ; preds = %764, %763
  %767 = phi i32 [ 63, %763 ], [ %765, %764 ]
  store i32 %767, ptr %66, align 4, !tbaa !9
  %768 = load i32, ptr %66, align 4, !tbaa !9
  %769 = sext i32 %768 to i64
  %770 = getelementptr inbounds [64 x %struct.TCOD_ColorRGB], ptr @TCOD_console_credits_render_ex.colormap_heat, i64 0, i64 %769
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %67, ptr align 1 %770, i64 3, i1 false), !tbaa.struct !20
  %771 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %772 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %773 = sitofp i32 %772 to float
  %774 = fcmp oge float %771, %773
  br i1 %774, label %775, label %917

775:                                              ; preds = %766
  call void @llvm.lifetime.start.p0(i64 4, ptr %68) #7
  %776 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %777 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %778 = sitofp i32 %777 to float
  %779 = fsub float %776, %778
  %780 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %781 = sitofp i32 %780 to float
  %782 = fdiv float %779, %781
  store float %782, ptr %68, align 4, !tbaa !13
  %783 = load i8, ptr %10, align 1, !tbaa !11, !range !15, !noundef !16
  %784 = trunc i8 %783 to i1
  br i1 %784, label %785, label %911

785:                                              ; preds = %775
  call void @llvm.lifetime.start.p0(i64 3, ptr %69) #7
  %786 = load ptr, ptr %7, align 8, !tbaa !5
  %787 = load i32, ptr %65, align 4, !tbaa !9
  %788 = sext i32 %787 to i64
  %789 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_x, i64 0, i64 %788
  %790 = load i32, ptr %789, align 4, !tbaa !9
  %791 = load i32, ptr %65, align 4, !tbaa !9
  %792 = sext i32 %791 to i64
  %793 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_y, i64 0, i64 %792
  %794 = load i32, ptr %793, align 4, !tbaa !9
  %795 = call i24 @TCOD_console_get_char_background(ptr noundef %786, i32 noundef %790, i32 noundef %794)
  store i24 %795, ptr %69, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %70) #7
  %796 = load float, ptr %68, align 4, !tbaa !13
  %797 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %69, i32 0, i32 0
  %798 = load i8, ptr %797, align 1, !tbaa !21
  %799 = zext i8 %798 to i32
  %800 = sitofp i32 %799 to float
  %801 = load float, ptr %68, align 4, !tbaa !13
  %802 = fsub float 1.000000e+00, %801
  %803 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %67, i32 0, i32 0
  %804 = load i8, ptr %803, align 1, !tbaa !21
  %805 = zext i8 %804 to i32
  %806 = sitofp i32 %805 to float
  %807 = fmul float %802, %806
  %808 = call float @llvm.fmuladd.f32(float %796, float %800, float %807)
  %809 = fptosi float %808 to i32
  store i32 %809, ptr %70, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %71) #7
  %810 = load float, ptr %68, align 4, !tbaa !13
  %811 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %69, i32 0, i32 1
  %812 = load i8, ptr %811, align 1, !tbaa !23
  %813 = zext i8 %812 to i32
  %814 = sitofp i32 %813 to float
  %815 = load float, ptr %68, align 4, !tbaa !13
  %816 = fsub float 1.000000e+00, %815
  %817 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %67, i32 0, i32 1
  %818 = load i8, ptr %817, align 1, !tbaa !23
  %819 = zext i8 %818 to i32
  %820 = sitofp i32 %819 to float
  %821 = fmul float %816, %820
  %822 = call float @llvm.fmuladd.f32(float %810, float %814, float %821)
  %823 = fptosi float %822 to i32
  store i32 %823, ptr %71, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %72) #7
  %824 = load float, ptr %68, align 4, !tbaa !13
  %825 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %69, i32 0, i32 2
  %826 = load i8, ptr %825, align 1, !tbaa !24
  %827 = zext i8 %826 to i32
  %828 = sitofp i32 %827 to float
  %829 = load float, ptr %68, align 4, !tbaa !13
  %830 = fsub float 1.000000e+00, %829
  %831 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %67, i32 0, i32 2
  %832 = load i8, ptr %831, align 1, !tbaa !24
  %833 = zext i8 %832 to i32
  %834 = sitofp i32 %833 to float
  %835 = fmul float %830, %834
  %836 = call float @llvm.fmuladd.f32(float %824, float %828, float %835)
  %837 = fptosi float %836 to i32
  store i32 %837, ptr %72, align 4, !tbaa !9
  %838 = load i32, ptr %70, align 4, !tbaa !9
  %839 = icmp slt i32 %838, 255
  br i1 %839, label %840, label %842

840:                                              ; preds = %785
  %841 = load i32, ptr %70, align 4, !tbaa !9
  br label %843

842:                                              ; preds = %785
  br label %843

843:                                              ; preds = %842, %840
  %844 = phi i32 [ %841, %840 ], [ 255, %842 ]
  %845 = icmp sgt i32 0, %844
  br i1 %845, label %846, label %847

846:                                              ; preds = %843
  br label %855

847:                                              ; preds = %843
  %848 = load i32, ptr %70, align 4, !tbaa !9
  %849 = icmp slt i32 %848, 255
  br i1 %849, label %850, label %852

850:                                              ; preds = %847
  %851 = load i32, ptr %70, align 4, !tbaa !9
  br label %853

852:                                              ; preds = %847
  br label %853

853:                                              ; preds = %852, %850
  %854 = phi i32 [ %851, %850 ], [ 255, %852 ]
  br label %855

855:                                              ; preds = %853, %846
  %856 = phi i32 [ 0, %846 ], [ %854, %853 ]
  %857 = trunc i32 %856 to i8
  %858 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %67, i32 0, i32 0
  store i8 %857, ptr %858, align 1, !tbaa !21
  %859 = load i32, ptr %71, align 4, !tbaa !9
  %860 = icmp slt i32 %859, 255
  br i1 %860, label %861, label %863

861:                                              ; preds = %855
  %862 = load i32, ptr %71, align 4, !tbaa !9
  br label %864

863:                                              ; preds = %855
  br label %864

864:                                              ; preds = %863, %861
  %865 = phi i32 [ %862, %861 ], [ 255, %863 ]
  %866 = icmp sgt i32 0, %865
  br i1 %866, label %867, label %868

867:                                              ; preds = %864
  br label %876

868:                                              ; preds = %864
  %869 = load i32, ptr %71, align 4, !tbaa !9
  %870 = icmp slt i32 %869, 255
  br i1 %870, label %871, label %873

871:                                              ; preds = %868
  %872 = load i32, ptr %71, align 4, !tbaa !9
  br label %874

873:                                              ; preds = %868
  br label %874

874:                                              ; preds = %873, %871
  %875 = phi i32 [ %872, %871 ], [ 255, %873 ]
  br label %876

876:                                              ; preds = %874, %867
  %877 = phi i32 [ 0, %867 ], [ %875, %874 ]
  %878 = trunc i32 %877 to i8
  %879 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %67, i32 0, i32 1
  store i8 %878, ptr %879, align 1, !tbaa !23
  %880 = load i32, ptr %72, align 4, !tbaa !9
  %881 = icmp slt i32 %880, 255
  br i1 %881, label %882, label %884

882:                                              ; preds = %876
  %883 = load i32, ptr %72, align 4, !tbaa !9
  br label %885

884:                                              ; preds = %876
  br label %885

885:                                              ; preds = %884, %882
  %886 = phi i32 [ %883, %882 ], [ 255, %884 ]
  %887 = icmp sgt i32 0, %886
  br i1 %887, label %888, label %889

888:                                              ; preds = %885
  br label %897

889:                                              ; preds = %885
  %890 = load i32, ptr %72, align 4, !tbaa !9
  %891 = icmp slt i32 %890, 255
  br i1 %891, label %892, label %894

892:                                              ; preds = %889
  %893 = load i32, ptr %72, align 4, !tbaa !9
  br label %895

894:                                              ; preds = %889
  br label %895

895:                                              ; preds = %894, %892
  %896 = phi i32 [ %893, %892 ], [ 255, %894 ]
  br label %897

897:                                              ; preds = %895, %888
  %898 = phi i32 [ 0, %888 ], [ %896, %895 ]
  %899 = trunc i32 %898 to i8
  %900 = getelementptr inbounds %struct.TCOD_ColorRGB, ptr %67, i32 0, i32 2
  store i8 %899, ptr %900, align 1, !tbaa !24
  %901 = load ptr, ptr %7, align 8, !tbaa !5
  %902 = load i32, ptr %65, align 4, !tbaa !9
  %903 = sext i32 %902 to i64
  %904 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_x, i64 0, i64 %903
  %905 = load i32, ptr %904, align 4, !tbaa !9
  %906 = load i32, ptr %65, align 4, !tbaa !9
  %907 = sext i32 %906 to i64
  %908 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_y, i64 0, i64 %907
  %909 = load i32, ptr %908, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %73, ptr align 1 %67, i64 3, i1 false)
  %910 = load i24, ptr %73, align 4
  call void @TCOD_console_set_char_foreground(ptr noundef %901, i32 noundef %905, i32 noundef %909, i24 %910)
  call void @llvm.lifetime.end.p0(i64 4, ptr %72) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %71) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %70) #7
  call void @llvm.lifetime.end.p0(i64 3, ptr %69) #7
  br label %916

911:                                              ; preds = %775
  call void @llvm.lifetime.start.p0(i64 3, ptr %74) #7
  %912 = load float, ptr %68, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %75, ptr align 1 %67, i64 3, i1 false)
  %913 = load i24, ptr %75, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %76, ptr align 1 @TCOD_black, i64 3, i1 false)
  %914 = load i24, ptr %76, align 4
  %915 = call i24 @TCOD_color_lerp(i24 %913, i24 %914, float noundef %912)
  store i24 %915, ptr %74, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %67, ptr align 1 %74, i64 3, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 3, ptr %74) #7
  br label %916

916:                                              ; preds = %911, %897
  call void @llvm.lifetime.end.p0(i64 4, ptr %68) #7
  br label %917

917:                                              ; preds = %916, %766
  %918 = load ptr, ptr %7, align 8, !tbaa !5
  %919 = load i32, ptr %65, align 4, !tbaa !9
  %920 = sext i32 %919 to i64
  %921 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_x, i64 0, i64 %920
  %922 = load i32, ptr %921, align 4, !tbaa !9
  %923 = load i32, ptr %65, align 4, !tbaa !9
  %924 = sext i32 %923 to i64
  %925 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_y, i64 0, i64 %924
  %926 = load i32, ptr %925, align 4, !tbaa !9
  %927 = load i32, ptr %65, align 4, !tbaa !9
  %928 = sext i32 %927 to i64
  %929 = getelementptr inbounds [128 x i8], ptr @TCOD_console_credits_render_ex.powered_by, i64 0, i64 %928
  %930 = load i8, ptr %929, align 1, !tbaa !17
  %931 = sext i8 %930 to i32
  call void @TCOD_console_set_char(ptr noundef %918, i32 noundef %922, i32 noundef %926, i32 noundef %931)
  %932 = load ptr, ptr %7, align 8, !tbaa !5
  %933 = load i32, ptr %65, align 4, !tbaa !9
  %934 = sext i32 %933 to i64
  %935 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_x, i64 0, i64 %934
  %936 = load i32, ptr %935, align 4, !tbaa !9
  %937 = load i32, ptr %65, align 4, !tbaa !9
  %938 = sext i32 %937 to i64
  %939 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_y, i64 0, i64 %938
  %940 = load i32, ptr %939, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %77, ptr align 1 %67, i64 3, i1 false)
  %941 = load i24, ptr %77, align 4
  call void @TCOD_console_set_char_foreground(ptr noundef %932, i32 noundef %936, i32 noundef %940, i24 %941)
  call void @llvm.lifetime.end.p0(i64 3, ptr %67) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %66) #7
  br label %942

942:                                              ; preds = %917, %747, %741
  br label %943

943:                                              ; preds = %942
  %944 = load i32, ptr %65, align 4, !tbaa !9
  %945 = add nsw i32 %944, 1
  store i32 %945, ptr %65, align 4, !tbaa !9
  br label %736, !llvm.loop !28

946:                                              ; preds = %740
  %947 = load float, ptr %11, align 4, !tbaa !13
  %948 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %949 = call float @llvm.fmuladd.f32(float %947, float 4.000000e+00, float %948)
  store float %949, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %78) #7
  store i32 0, ptr %78, align 4, !tbaa !9
  br label %950

950:                                              ; preds = %969, %946
  %951 = load i32, ptr %78, align 4, !tbaa !9
  %952 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %953 = fadd float %952, 5.000000e-01
  %954 = fptosi float %953 to i32
  %955 = icmp slt i32 %951, %954
  br i1 %955, label %957, label %956

956:                                              ; preds = %950
  store i32 16, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %78) #7
  br label %972

957:                                              ; preds = %950
  %958 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %959 = load i32, ptr %78, align 4, !tbaa !9
  %960 = sitofp i32 %959 to float
  %961 = fsub float %958, %960
  %962 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %963 = sdiv i32 %962, 2
  %964 = sitofp i32 %963 to float
  %965 = fdiv float %961, %964
  %966 = load i32, ptr %78, align 4, !tbaa !9
  %967 = sext i32 %966 to i64
  %968 = getelementptr inbounds [128 x float], ptr @TCOD_console_credits_render_ex.char_heat, i64 0, i64 %967
  store float %965, ptr %968, align 4, !tbaa !13
  br label %969

969:                                              ; preds = %957
  %970 = load i32, ptr %78, align 4, !tbaa !9
  %971 = add nsw i32 %970, 1
  store i32 %971, ptr %78, align 4, !tbaa !9
  br label %950, !llvm.loop !29

972:                                              ; preds = %956
  %973 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %79, ptr align 1 %20, i64 3, i1 false)
  %974 = load i24, ptr %79, align 4
  call void @TCOD_console_set_default_foreground(ptr noundef %973, i24 %974)
  %975 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !13
  %976 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !9
  %977 = mul nsw i32 2, %976
  %978 = sitofp i32 %977 to float
  %979 = fcmp ole float %975, %978
  br i1 %979, label %980, label %981

980:                                              ; preds = %972
  store i1 false, ptr %6, align 1
  store i32 1, ptr %28, align 4
  br label %982

981:                                              ; preds = %972
  store i8 0, ptr @credits_initialized, align 1, !tbaa !11
  store i1 true, ptr %6, align 1
  store i32 1, ptr %28, align 4
  br label %982

982:                                              ; preds = %981, %980
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 3, ptr %20) #7
  br label %983

983:                                              ; preds = %982, %85
  %984 = load i1, ptr %6, align 1
  ret i1 %984
}

declare void @TCOD_color_gen_map(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #5

declare ptr @TCOD_noise_new(i32 noundef, float noundef, float noundef, ptr noundef) #3

declare i24 @TCOD_console_get_default_background(ptr noundef) #3

declare void @TCOD_console_set_default_background(ptr noundef, i24) #3

declare void @TCOD_image_delete(ptr noundef) #3

declare ptr @TCOD_image_new(i32 noundef, i32 noundef) #3

declare i24 @TCOD_console_get_default_foreground(ptr noundef) #3

declare float @TCOD_noise_get(ptr noundef, ptr noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #6

declare i32 @TCOD_random_get_int(ptr noundef, i32 noundef, i32 noundef) #3

declare i24 @TCOD_console_get_char_background(ptr noundef, i32 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden signext i8 @quadrants_from_codepoint(i32 noundef) #4

declare i32 @TCOD_console_get_char(ptr noundef, i32 noundef, i32 noundef) #3

declare i24 @TCOD_console_get_char_foreground(ptr noundef, i32 noundef, i32 noundef) #3

declare void @TCOD_image_put_pixel(ptr noundef, i32 noundef, i32 noundef, i24) #3

declare i24 @TCOD_image_get_pixel(ptr noundef, i32 noundef, i32 noundef) #3

declare i24 @TCOD_color_lerp(i24, i24, float noundef) #3

declare float @TCOD_random_get_float(ptr noundef, float noundef, float noundef) #3

declare void @TCOD_image_blit_2x(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare void @TCOD_console_set_char_foreground(ptr noundef, i32 noundef, i32 noundef, i24) #3

declare void @TCOD_console_set_char(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare void @TCOD_console_set_default_foreground(ptr noundef, i24) #3

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 = { "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 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 "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{i64 0, i64 1, !17, i64 1, i64 1, !17, i64 2, i64 1, !17}
!21 = !{!22, !7, i64 0}
!22 = !{!"TCOD_ColorRGB", !7, i64 0, !7, i64 1, !7, i64 2}
!23 = !{!22, !7, i64 1}
!24 = !{!22, !7, i64 2}
!25 = distinct !{!25, !19}
!26 = distinct !{!26, !19}
!27 = distinct !{!27, !19}
!28 = distinct !{!28, !19}
!29 = distinct !{!29, !19}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.TCOD_ColorRGB = type { i8, i8, i8 }

@TCOD_black = external local_unnamed_addr constant %struct.TCOD_ColorRGB, align 1
@credits_initialized = external hidden local_unnamed_addr global i8, align 1
@TCOD_console_credits_render_ex.powered_by = external hidden global [128 x i8], align 16
@TCOD_console_credits_render_ex.char_heat = external hidden local_unnamed_addr global [128 x float], align 16
@TCOD_console_credits_render_ex.char_x = external hidden local_unnamed_addr global [128 x i32], align 16
@TCOD_console_credits_render_ex.char_y = external hidden local_unnamed_addr global [128 x i32], align 16
@TCOD_console_credits_render_ex.static_vars_initialized = external hidden local_unnamed_addr global i8, align 1
@TCOD_console_credits_render_ex.text_length = external hidden local_unnamed_addr global i32, align 4
@TCOD_console_credits_render_ex.text_length_upper = external hidden local_unnamed_addr global i32, align 4
@TCOD_console_credits_render_ex.console_w = external hidden local_unnamed_addr global i32, align 4
@TCOD_console_credits_render_ex.console_h = external hidden local_unnamed_addr global i32, align 4
@TCOD_console_credits_render_ex.text_progress = external hidden local_unnamed_addr global float, align 4
@TCOD_console_credits_render_ex.colormap_heat = external hidden global [64 x %struct.TCOD_ColorRGB], align 16
@TCOD_console_credits_render_ex.colormap_light = external hidden global [64 x %struct.TCOD_ColorRGB], align 16
@TCOD_console_credits_render_ex.noise = external hidden local_unnamed_addr global ptr, align 8
@TCOD_console_credits_render_ex.color_keys_heat = external hidden constant [4 x %struct.TCOD_ColorRGB], align 1
@TCOD_console_credits_render_ex.color_keys_light = external hidden constant [4 x %struct.TCOD_ColorRGB], align 1
@TCOD_console_credits_render_ex.color_key_positions = external hidden constant [4 x i32], align 16
@TCOD_console_credits_render_ex.img = external hidden local_unnamed_addr global ptr, align 8
@TCOD_console_credits_render_ex.left = external hidden local_unnamed_addr global i32, align 4
@TCOD_console_credits_render_ex.right = external hidden local_unnamed_addr global i32, align 4
@TCOD_console_credits_render_ex.top = external hidden local_unnamed_addr global i32, align 4
@TCOD_console_credits_render_ex.bottom = external hidden local_unnamed_addr global i32, align 4
@TCOD_console_credits_render_ex.particle_heat = external hidden local_unnamed_addr global [64 x float], align 16
@TCOD_console_credits_render_ex.particle_x = external hidden local_unnamed_addr global [64 x float], align 16
@TCOD_console_credits_render_ex.particle_y = external hidden local_unnamed_addr global [64 x float], align 16
@TCOD_console_credits_render_ex.particle_x_velocity = external hidden local_unnamed_addr global [64 x float], align 16
@TCOD_console_credits_render_ex.particle_y_velocity = external hidden local_unnamed_addr global [64 x float], align 16
@TCOD_console_credits_render_ex.particle_count = external hidden local_unnamed_addr global i32, align 4
@TCOD_console_credits_render_ex.first_particle = external hidden local_unnamed_addr global i32, align 4
@TCOD_console_credits_render_ex.particle_delay = external hidden local_unnamed_addr global float, align 4
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1
@version_string = external hidden local_unnamed_addr global ptr, align 8

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare i32 @TCOD_console_get_width(ptr noundef) local_unnamed_addr #2

declare i32 @TCOD_console_get_height(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @TCOD_console_credits_render_ex(ptr noundef %0, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %3, float noundef %4) local_unnamed_addr #3 {
  %6 = alloca float, align 4
  %7 = tail call ptr @TCOD_console_validate_(ptr noundef %0)
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %410, label %8

8:                                                ; preds = %5
  %9 = load i8, ptr @TCOD_console_credits_render_ex.static_vars_initialized, align 1, !tbaa !5, !range !9, !noundef !10
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %20, label %11

11:                                               ; preds = %8
  tail call void @TCOD_color_gen_map(ptr noundef nonnull @TCOD_console_credits_render_ex.colormap_heat, i32 noundef 4, ptr noundef nonnull @TCOD_console_credits_render_ex.color_keys_heat, ptr noundef nonnull @TCOD_console_credits_render_ex.color_key_positions) #7
  tail call void @TCOD_color_gen_map(ptr noundef nonnull @TCOD_console_credits_render_ex.colormap_light, i32 noundef 4, ptr noundef nonnull @TCOD_console_credits_render_ex.color_keys_light, ptr noundef nonnull @TCOD_console_credits_render_ex.color_key_positions) #7
  %12 = load ptr, ptr @version_string, align 8, !tbaa !11
  %13 = tail call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) @TCOD_console_credits_render_ex.powered_by, i64 noundef 128, ptr noundef nonnull @.str.8, ptr noundef %12) #7
  store i32 %13, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !13
  %14 = tail call ptr @TCOD_noise_new(i32 noundef 1, float noundef 5.000000e-01, float noundef 2.000000e+00, ptr noundef null) #7
  store ptr %14, ptr @TCOD_console_credits_render_ex.noise, align 8, !tbaa !11
  store i32 11, ptr @TCOD_console_credits_render_ex.text_length_upper, align 4, !tbaa !13
  %15 = tail call i32 @llvm.smax.i32(i32 %1, i32 4)
  %16 = add nsw i32 %15, -4
  store i32 %16, ptr @TCOD_console_credits_render_ex.left, align 4, !tbaa !13
  %17 = tail call i32 @llvm.smax.i32(i32 %2, i32 4)
  %18 = add nsw i32 %17, -4
  store i32 %18, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !13
  %19 = tail call i24 @TCOD_console_get_default_background(ptr noundef nonnull %7) #7
  %.0.copyload234 = load i24, ptr @TCOD_black, align 1
  tail call void @TCOD_console_set_default_background(ptr noundef nonnull %7, i24 %.0.copyload234) #7
  tail call void @TCOD_console_set_default_background(ptr noundef nonnull %7, i24 %19) #7
  store i8 1, ptr @TCOD_console_credits_render_ex.static_vars_initialized, align 1, !tbaa !5
  br label %20

20:                                               ; preds = %11, %8
  %21 = load i8, ptr @credits_initialized, align 1, !tbaa !5, !range !9, !noundef !10
  %22 = trunc nuw i8 %21 to i1
  br i1 %22, label %46, label %23

23:                                               ; preds = %20
  store float -4.000000e+00, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !15
  %24 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !13
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %23
  %wide.trip.count = zext nneg i32 %24 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %26 = icmp eq i32 %24, 1
  br i1 %26, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %.0282326.unr = phi i32 [ %1, %.lr.ph.preheader ], [ %spec.select321.1, %.lr.ph ]
  %.0284325.unr = phi i32 [ %2, %.lr.ph.preheader ], [ %spec.select.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %27 = getelementptr inbounds [128 x float], ptr @TCOD_console_credits_render_ex.char_heat, i64 0, i64 %indvars.iv.unr
  store float -1.000000e+00, ptr %27, align 4, !tbaa !15
  %28 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_x, i64 0, i64 %indvars.iv.unr
  store i32 %.0282326.unr, ptr %28, align 4, !tbaa !13
  %29 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_y, i64 0, i64 %indvars.iv.unr
  store i32 %.0284325.unr, ptr %29, align 4, !tbaa !13
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa, %23
  store i32 0, ptr @TCOD_console_credits_render_ex.first_particle, align 4, !tbaa !13
  store i32 0, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !13
  store i8 1, ptr @credits_initialized, align 1, !tbaa !5
  br label %46

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %.0282326 = phi i32 [ %1, %.lr.ph.preheader.new ], [ %spec.select321.1, %.lr.ph ]
  %.0284325 = phi i32 [ %2, %.lr.ph.preheader.new ], [ %spec.select.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %30 = getelementptr inbounds [128 x float], ptr @TCOD_console_credits_render_ex.char_heat, i64 0, i64 %indvars.iv
  store float -1.000000e+00, ptr %30, align 8, !tbaa !15
  %31 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_x, i64 0, i64 %indvars.iv
  store i32 %.0282326, ptr %31, align 8, !tbaa !13
  %32 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_y, i64 0, i64 %indvars.iv
  store i32 %.0284325, ptr %32, align 8, !tbaa !13
  %33 = add nsw i32 %.0282326, 1
  %34 = getelementptr inbounds [128 x i8], ptr @TCOD_console_credits_render_ex.powered_by, i64 0, i64 %indvars.iv
  %35 = load i8, ptr %34, align 2, !tbaa !17
  %36 = icmp eq i8 %35, 10
  %37 = zext i1 %36 to i32
  %spec.select = add nsw i32 %.0284325, %37
  %spec.select321 = select i1 %36, i32 %1, i32 %33
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %38 = getelementptr inbounds [128 x float], ptr @TCOD_console_credits_render_ex.char_heat, i64 0, i64 %indvars.iv.next
  store float -1.000000e+00, ptr %38, align 4, !tbaa !15
  %39 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_x, i64 0, i64 %indvars.iv.next
  store i32 %spec.select321, ptr %39, align 4, !tbaa !13
  %40 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_y, i64 0, i64 %indvars.iv.next
  store i32 %spec.select, ptr %40, align 4, !tbaa !13
  %41 = add nsw i32 %spec.select321, 1
  %42 = getelementptr inbounds [128 x i8], ptr @TCOD_console_credits_render_ex.powered_by, i64 0, i64 %indvars.iv.next
  %43 = load i8, ptr %42, align 1, !tbaa !17
  %44 = icmp eq i8 %43, 10
  %45 = zext i1 %44 to i32
  %spec.select.1 = add nsw i32 %spec.select, %45
  %spec.select321.1 = select i1 %44, i32 %1, i32 %41
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !18

46:                                               ; preds = %._crit_edge, %20
  %47 = tail call i32 @TCOD_console_get_width(ptr noundef nonnull %7) #7
  %48 = load i32, ptr @TCOD_console_credits_render_ex.console_w, align 4, !tbaa !13
  %.not316 = icmp eq i32 %47, %48
  br i1 %.not316, label %49, label %52

49:                                               ; preds = %46
  %50 = tail call i32 @TCOD_console_get_height(ptr noundef nonnull %7) #7
  %51 = load i32, ptr @TCOD_console_credits_render_ex.console_h, align 4, !tbaa !13
  %.not317 = icmp eq i32 %50, %51
  br i1 %.not317, label %74, label %52

52:                                               ; preds = %49, %46
  %53 = tail call i32 @TCOD_console_get_width(ptr noundef nonnull %7) #7
  store i32 %53, ptr @TCOD_console_credits_render_ex.console_w, align 4, !tbaa !13
  %54 = tail call i32 @TCOD_console_get_height(ptr noundef nonnull %7) #7
  store i32 %54, ptr @TCOD_console_credits_render_ex.console_h, align 4, !tbaa !13
  %55 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !13
  %56 = add nsw i32 %55, %1
  %57 = load i32, ptr @TCOD_console_credits_render_ex.console_w, align 4, !tbaa !13
  %58 = add nsw i32 %57, -1
  %. = tail call i32 @llvm.smin.i32(i32 %56, i32 %58)
  store i32 %., ptr @TCOD_console_credits_render_ex.right, align 4, !tbaa !13
  %59 = add nsw i32 %2, 6
  %60 = add nsw i32 %54, -1
  %61 = tail call i32 @llvm.smin.i32(i32 %59, i32 %60)
  store i32 %61, ptr @TCOD_console_credits_render_ex.bottom, align 4, !tbaa !13
  %62 = load i32, ptr @TCOD_console_credits_render_ex.left, align 4, !tbaa !13
  %63 = sub nsw i32 %., %62
  %64 = load i32, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !13
  %65 = sub nsw i32 %61, %64
  %66 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !11
  %.not318 = icmp eq ptr %66, null
  br i1 %.not318, label %68, label %67

67:                                               ; preds = %52
  tail call void @TCOD_image_delete(ptr noundef nonnull %66) #7
  br label %68

68:                                               ; preds = %67, %52
  %69 = shl i32 %63, 1
  %70 = add i32 %69, 2
  %71 = shl i32 %65, 1
  %72 = add i32 %71, 2
  %73 = tail call ptr @TCOD_image_new(i32 noundef %70, i32 noundef %72) #7
  store ptr %73, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !11
  br label %74

74:                                               ; preds = %68, %49
  %75 = tail call i24 @TCOD_console_get_default_foreground(ptr noundef nonnull %7) #7
  %76 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !15
  %77 = load i32, ptr @TCOD_console_credits_render_ex.text_length_upper, align 4, !tbaa !13
  %78 = sitofp i32 %77 to float
  %79 = fcmp uge float %76, %78
  %80 = zext i1 %79 to i32
  %.0288.in = add nsw i32 %80, %2
  %81 = select i1 %79, i32 %77, i32 0
  %.pn.in = sub nsw i32 %1, %81
  %.pn = sitofp i32 %.pn.in to float
  %.0287 = fadd float %76, %.pn
  %.0288 = sitofp i32 %.0288.in to float
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %82 = fmul float %76, 6.000000e+00
  store float %82, ptr %6, align 4, !tbaa !15
  %83 = load ptr, ptr @TCOD_console_credits_render_ex.noise, align 8, !tbaa !11
  %84 = call float @TCOD_noise_get(ptr noundef %83, ptr noundef nonnull %6) #7
  %85 = call float @llvm.fmuladd.f32(float %84, float 2.000000e+00, float 3.000000e+00)
  %86 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !15
  %87 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !13
  %88 = add nsw i32 %87, -1
  %89 = sitofp i32 %88 to float
  %90 = fcmp ult float %86, %89
  br i1 %90, label %97, label %91

91:                                               ; preds = %74
  %92 = sitofp i32 %87 to float
  %93 = fsub float %86, %92
  %94 = fadd float %93, 1.000000e+00
  %95 = fneg float %94
  %96 = call float @llvm.fmuladd.f32(float %95, float 4.000000e+00, float %85)
  br label %109

97:                                               ; preds = %74
  %98 = fcmp olt float %86, 0.000000e+00
  br i1 %98, label %99, label %101

99:                                               ; preds = %97
  %100 = call float @llvm.fmuladd.f32(float %86, float 4.000000e+00, float %85)
  br label %109

101:                                              ; preds = %97
  %102 = fadd float %86, 5.000000e-01
  %103 = fptosi float %102 to i32
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [128 x i8], ptr @TCOD_console_credits_render_ex.powered_by, i64 0, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !17
  switch i8 %106, label %109 [
    i8 32, label %107
    i8 10, label %107
  ]

107:                                              ; preds = %101, %101
  %108 = fmul float %85, 5.000000e-01
  br label %109

109:                                              ; preds = %101, %99, %107, %91
  %.0289 = phi float [ %96, %91 ], [ %100, %99 ], [ %108, %107 ], [ %85, %101 ]
  %110 = fmul float %.0289, %.0289
  %111 = fmul float %110, 4.000000e+00
  %112 = load i32, ptr @TCOD_console_credits_render_ex.left, align 4, !tbaa !13
  %113 = shl nsw i32 %112, 1
  %114 = load i32, ptr @TCOD_console_credits_render_ex.right, align 4, !tbaa !13
  %115 = shl i32 %114, 1
  %116 = add i32 %115, 2
  %117 = icmp slt i32 %113, %116
  br i1 %117, label %.lr.ph336, label %._crit_edge337

.lr.ph336:                                        ; preds = %109
  %118 = fcmp oge float %.0289, 0.000000e+00
  %.pre = load i32, ptr @TCOD_console_credits_render_ex.bottom, align 4, !tbaa !13
  br label %124

._crit_edge337:                                   ; preds = %._crit_edge332, %109
  %119 = load i32, ptr @TCOD_console_credits_render_ex.particle_count, align 4
  %120 = icmp sgt i32 %119, 0
  %.pre373.pre = load i32, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !13
  br i1 %120, label %.lr.ph341, label %._crit_edge342

.lr.ph341:                                        ; preds = %._crit_edge337
  %121 = load i32, ptr @TCOD_console_credits_render_ex.first_particle, align 4, !tbaa !13
  %122 = fsub float 1.000000e+00, %4
  %123 = fneg float %4
  %.pre364 = load i32, ptr @TCOD_console_credits_render_ex.bottom, align 4, !tbaa !13
  br label %200

124:                                              ; preds = %.lr.ph336, %._crit_edge332
  %125 = phi i32 [ %114, %.lr.ph336 ], [ %137, %._crit_edge332 ]
  %126 = phi i32 [ %.pre, %.lr.ph336 ], [ %138, %._crit_edge332 ]
  %.0290334 = phi i32 [ %113, %.lr.ph336 ], [ %139, %._crit_edge332 ]
  %.0291333 = phi i32 [ 0, %.lr.ph336 ], [ %140, %._crit_edge332 ]
  %127 = load i32, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !13
  %128 = shl nsw i32 %127, 1
  %129 = shl i32 %126, 1
  %130 = add i32 %129, 2
  %131 = icmp slt i32 %128, %130
  br i1 %131, label %.lr.ph331, label %._crit_edge332

.lr.ph331:                                        ; preds = %124
  %132 = sitofp i32 %.0290334 to float
  %133 = call float @llvm.fmuladd.f32(float %.0287, float -2.000000e+00, float %132)
  %134 = sdiv i32 %.0290334, 2
  %135 = and i32 %.0290334, 1
  %136 = add nuw nsw i32 %135, 1
  br label %144

._crit_edge332.loopexit:                          ; preds = %192
  %.pre362 = load i32, ptr @TCOD_console_credits_render_ex.right, align 4, !tbaa !13
  br label %._crit_edge332

._crit_edge332:                                   ; preds = %._crit_edge332.loopexit, %124
  %137 = phi i32 [ %.pre362, %._crit_edge332.loopexit ], [ %125, %124 ]
  %138 = phi i32 [ %196, %._crit_edge332.loopexit ], [ %126, %124 ]
  %139 = add nsw i32 %.0290334, 1
  %140 = add nuw nsw i32 %.0291333, 1
  %141 = shl i32 %137, 1
  %142 = add i32 %141, 2
  %143 = icmp slt i32 %139, %142
  br i1 %143, label %124, label %._crit_edge337, !llvm.loop !20

144:                                              ; preds = %.lr.ph331, %192
  %.0292328 = phi i32 [ %128, %.lr.ph331 ], [ %194, %192 ]
  %.0293327 = phi i32 [ 0, %.lr.ph331 ], [ %195, %192 ]
  %145 = sitofp i32 %.0292328 to float
  %146 = call float @llvm.fmuladd.f32(float %.0288, float -2.000000e+00, float %145)
  %147 = fmul float %146, %146
  %148 = call float @llvm.fmuladd.f32(float %133, float %133, float %147)
  %149 = fcmp olt float %148, %111
  %or.cond322 = select i1 %118, i1 %149, i1 false
  br i1 %or.cond322, label %150, label %161

150:                                              ; preds = %144
  %151 = fsub float %111, %148
  %152 = fmul float %151, 6.300000e+01
  %153 = fdiv float %152, %111
  %154 = fptosi float %153 to i32
  %155 = call i32 @TCOD_random_get_int(ptr noundef null, i32 noundef -10, i32 noundef 10) #7
  %reass.sub351 = sub i32 %155, %154
  %156 = add i32 %reass.sub351, 63
  %157 = call i32 @llvm.smin.i32(i32 %156, i32 63)
  %158 = call i32 @llvm.smax.i32(i32 %157, i32 0)
  %159 = zext nneg i32 %158 to i64
  %160 = getelementptr inbounds [64 x %struct.TCOD_ColorRGB], ptr @TCOD_console_credits_render_ex.colormap_light, i64 0, i64 %159
  %.sroa.8176.0..sroa_idx = getelementptr inbounds i8, ptr %160, i64 1
  %.sroa.11179.0..sroa_idx = getelementptr inbounds i8, ptr %160, i64 2
  br label %161

161:                                              ; preds = %150, %144
  %.sroa.0173.0.in = phi ptr [ %160, %150 ], [ @TCOD_black, %144 ]
  %.sroa.8176.0.in = phi ptr [ %.sroa.8176.0..sroa_idx, %150 ], [ getelementptr inbounds (i8, ptr @TCOD_black, i64 1), %144 ]
  %.sroa.11179.0.in = phi ptr [ %.sroa.11179.0..sroa_idx, %150 ], [ getelementptr inbounds (i8, ptr @TCOD_black, i64 2), %144 ]
  %.sroa.11179.0 = load i8, ptr %.sroa.11179.0.in, align 1, !tbaa !17
  %.sroa.8176.0 = load i8, ptr %.sroa.8176.0.in, align 1, !tbaa !17
  %.sroa.0173.0 = load i8, ptr %.sroa.0173.0.in, align 1, !tbaa !17
  br i1 %3, label %162, label %192

162:                                              ; preds = %161
  %163 = sdiv i32 %.0292328, 2
  %164 = call i24 @TCOD_console_get_char_background(ptr noundef nonnull %7, i32 noundef %134, i32 noundef %163) #7
  %.sroa.0160.0.extract.trunc = trunc i24 %164 to i8
  %.sroa.6.0.extract.shift = lshr i24 %164, 8
  %.sroa.6.0.extract.trunc = trunc i24 %.sroa.6.0.extract.shift to i8
  %.sroa.8.0.extract.shift = lshr i24 %164, 16
  %.sroa.8.0.extract.trunc = trunc nuw i24 %.sroa.8.0.extract.shift to i8
  %165 = call i32 @TCOD_console_get_char(ptr noundef nonnull %7, i32 noundef %134, i32 noundef %163) #7
  %166 = call signext i8 @quadrants_from_codepoint(i32 noundef %165)
  %167 = icmp sgt i8 %166, 0
  br i1 %167, label %168, label %176

168:                                              ; preds = %162
  %169 = zext nneg i8 %166 to i32
  %170 = trunc i32 %.0292328 to i1
  %171 = select i1 %170, i32 2, i32 0
  %172 = shl nuw nsw i32 %136, %171
  %173 = and i32 %172, %169
  %.not320 = icmp eq i32 %173, 0
  br i1 %.not320, label %176, label %174

174:                                              ; preds = %168
  %175 = call i24 @TCOD_console_get_char_foreground(ptr noundef nonnull %7, i32 noundef %134, i32 noundef %163) #7
  %.sroa.0160.0.extract.trunc162 = trunc i24 %175 to i8
  %.sroa.6.0.extract.shift163 = lshr i24 %175, 8
  %.sroa.6.0.extract.trunc164 = trunc i24 %.sroa.6.0.extract.shift163 to i8
  %.sroa.8.0.extract.shift166 = lshr i24 %175, 16
  %.sroa.8.0.extract.trunc167 = trunc nuw i24 %.sroa.8.0.extract.shift166 to i8
  br label %176

176:                                              ; preds = %168, %174, %162
  %.sroa.0160.1 = phi i8 [ %.sroa.0160.0.extract.trunc, %162 ], [ %.sroa.0160.0.extract.trunc162, %174 ], [ %.sroa.0160.0.extract.trunc, %168 ]
  %.sroa.6.1 = phi i8 [ %.sroa.6.0.extract.trunc, %162 ], [ %.sroa.6.0.extract.trunc164, %174 ], [ %.sroa.6.0.extract.trunc, %168 ]
  %.sroa.8.1 = phi i8 [ %.sroa.8.0.extract.trunc, %162 ], [ %.sroa.8.0.extract.trunc167, %174 ], [ %.sroa.8.0.extract.trunc, %168 ]
  %177 = zext i8 %.sroa.0160.1 to i32
  %178 = zext i8 %.sroa.0173.0 to i32
  %179 = add nuw nsw i32 %177, %178
  %180 = call i32 @llvm.umin.i32(i32 %179, i32 255)
  %181 = trunc nuw i32 %180 to i8
  %182 = zext i8 %.sroa.6.1 to i32
  %183 = zext i8 %.sroa.8176.0 to i32
  %184 = add nuw nsw i32 %182, %183
  %185 = call i32 @llvm.umin.i32(i32 %184, i32 255)
  %186 = trunc nuw i32 %185 to i8
  %187 = zext i8 %.sroa.8.1 to i32
  %188 = zext i8 %.sroa.11179.0 to i32
  %189 = add nuw nsw i32 %187, %188
  %190 = call i32 @llvm.umin.i32(i32 %189, i32 255)
  %191 = trunc nuw i32 %190 to i8
  br label %192

192:                                              ; preds = %176, %161
  %.sroa.0173.1 = phi i8 [ %181, %176 ], [ %.sroa.0173.0, %161 ]
  %.sroa.8176.1 = phi i8 [ %186, %176 ], [ %.sroa.8176.0, %161 ]
  %.sroa.11179.1 = phi i8 [ %191, %176 ], [ %.sroa.11179.0, %161 ]
  %193 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !11
  %.sroa.11179.0.insert.ext = zext i8 %.sroa.11179.1 to i24
  %.sroa.11179.0.insert.shift = shl nuw i24 %.sroa.11179.0.insert.ext, 16
  %.sroa.8176.0.insert.ext = zext i8 %.sroa.8176.1 to i24
  %.sroa.8176.0.insert.shift = shl nuw nsw i24 %.sroa.8176.0.insert.ext, 8
  %.sroa.8176.0.insert.insert = or disjoint i24 %.sroa.11179.0.insert.shift, %.sroa.8176.0.insert.shift
  %.sroa.0173.0.insert.ext = zext i8 %.sroa.0173.1 to i24
  %.sroa.0173.0.insert.insert = or disjoint i24 %.sroa.8176.0.insert.insert, %.sroa.0173.0.insert.ext
  call void @TCOD_image_put_pixel(ptr noundef %193, i32 noundef %.0291333, i32 noundef %.0293327, i24 %.sroa.0173.0.insert.insert) #7
  %194 = add nsw i32 %.0292328, 1
  %195 = add nuw nsw i32 %.0293327, 1
  %196 = load i32, ptr @TCOD_console_credits_render_ex.bottom, align 4, !tbaa !13
  %197 = shl i32 %196, 1
  %198 = add i32 %197, 2
  %199 = icmp slt i32 %194, %198
  br i1 %199, label %144, label %._crit_edge332.loopexit, !llvm.loop !21

200:                                              ; preds = %.lr.ph341, %275
  %201 = phi i32 [ %.pre373.pre, %.lr.ph341 ], [ %253, %275 ]
  %202 = phi i32 [ %.pre364, %.lr.ph341 ], [ %254, %275 ]
  %.0295339 = phi i32 [ %119, %.lr.ph341 ], [ %278, %275 ]
  %.0296338 = phi i32 [ %121, %.lr.ph341 ], [ %277, %275 ]
  %203 = sext i32 %.0296338 to i64
  %204 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_heat, i64 0, i64 %203
  %205 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y, i64 0, i64 %203
  %206 = load float, ptr %205, align 4, !tbaa !15
  %207 = sub nsw i32 %202, %201
  %208 = shl i32 %207, 1
  %209 = add i32 %208, 2
  %210 = sitofp i32 %209 to float
  %211 = fcmp olt float %206, %210
  br i1 %211, label %212, label %246

212:                                              ; preds = %200
  %213 = load float, ptr %204, align 4, !tbaa !15
  %214 = fsub float 1.000000e+00, %213
  %215 = fmul float %214, 6.400000e+01
  %216 = fptosi float %215 to i32
  %spec.select323 = call i32 @llvm.smin.i32(i32 %216, i32 63)
  %217 = sext i32 %spec.select323 to i64
  %218 = getelementptr inbounds [64 x %struct.TCOD_ColorRGB], ptr @TCOD_console_credits_render_ex.colormap_heat, i64 0, i64 %217
  %.sroa.0127.0.copyload = load i24, ptr %218, align 1
  %219 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x, i64 0, i64 %203
  %220 = load float, ptr %219, align 4, !tbaa !15
  %221 = insertelement <2 x float> poison, float %206, i64 0
  %222 = insertelement <2 x float> %221, float %220, i64 1
  %223 = fptosi <2 x float> %222 to <2 x i32>
  %224 = sitofp <2 x i32> %223 to <2 x float>
  %225 = fsub <2 x float> %222, %224
  %226 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !11
  %227 = extractelement <2 x i32> %223, i64 0
  %228 = extractelement <2 x i32> %223, i64 1
  %229 = call i24 @TCOD_image_get_pixel(ptr noundef %226, i32 noundef %228, i32 noundef %227) #7
  %230 = extractelement <2 x float> %225, i64 0
  %231 = extractelement <2 x float> %225, i64 1
  %232 = fadd float %230, %231
  %233 = fmul float %232, 5.000000e-01
  %234 = call i24 @TCOD_color_lerp(i24 %.sroa.0127.0.copyload, i24 %229, float noundef %233) #7
  %235 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !11
  call void @TCOD_image_put_pixel(ptr noundef %235, i32 noundef %228, i32 noundef %227, i24 %234) #7
  %236 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !11
  %237 = add nsw i32 %228, 1
  %238 = call i24 @TCOD_image_get_pixel(ptr noundef %236, i32 noundef %237, i32 noundef %227) #7
  %239 = call i24 @TCOD_color_lerp(i24 %238, i24 %.sroa.0127.0.copyload, float noundef %231) #7
  %240 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !11
  call void @TCOD_image_put_pixel(ptr noundef %240, i32 noundef %237, i32 noundef %227, i24 %239) #7
  %241 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !11
  %242 = add nsw i32 %227, 1
  %243 = call i24 @TCOD_image_get_pixel(ptr noundef %241, i32 noundef %228, i32 noundef %242) #7
  %244 = call i24 @TCOD_color_lerp(i24 %243, i24 %.sroa.0127.0.copyload, float noundef %230) #7
  %245 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !11
  call void @TCOD_image_put_pixel(ptr noundef %245, i32 noundef %228, i32 noundef %242, i24 %244) #7
  %.pre363 = load i32, ptr @TCOD_console_credits_render_ex.bottom, align 4, !tbaa !13
  %.pre365 = load i32, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !13
  %.phi.trans.insert = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y_velocity, i64 0, i64 %203
  %.pre367 = load float, ptr %.phi.trans.insert, align 4, !tbaa !15
  %.pre368 = load float, ptr %205, align 4, !tbaa !15
  br label %250

246:                                              ; preds = %200
  %247 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y_velocity, i64 0, i64 %203
  %248 = load float, ptr %247, align 4, !tbaa !15
  %249 = fmul float %248, -5.000000e-01
  br label %250

250:                                              ; preds = %246, %212
  %251 = phi float [ %206, %246 ], [ %.pre368, %212 ]
  %252 = phi float [ %249, %246 ], [ %.pre367, %212 ]
  %253 = phi i32 [ %201, %246 ], [ %.pre365, %212 ]
  %254 = phi i32 [ %202, %246 ], [ %.pre363, %212 ]
  %255 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x_velocity, i64 0, i64 %203
  %256 = load float, ptr %255, align 4, !tbaa !15
  %257 = fmul float %122, %256
  store float %257, ptr %255, align 4, !tbaa !15
  %258 = load float, ptr %204, align 4, !tbaa !15
  %259 = fsub float 1.000000e+00, %258
  %260 = fmul float %259, %4
  %261 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y_velocity, i64 0, i64 %203
  %262 = call float @llvm.fmuladd.f32(float %260, float 3.000000e+02, float %252)
  store float %262, ptr %261, align 4, !tbaa !15
  %263 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x, i64 0, i64 %203
  %264 = load float, ptr %263, align 4, !tbaa !15
  %265 = call float @llvm.fmuladd.f32(float %257, float %4, float %264)
  store float %265, ptr %263, align 4, !tbaa !15
  %266 = call float @llvm.fmuladd.f32(float %262, float %4, float %251)
  store float %266, ptr %205, align 4, !tbaa !15
  %267 = call float @llvm.fmuladd.f32(float %123, float 0x3FD3333340000000, float %258)
  store float %267, ptr %204, align 4, !tbaa !15
  %268 = fcmp olt float %267, 0.000000e+00
  br i1 %268, label %269, label %275

269:                                              ; preds = %250
  %270 = load i32, ptr @TCOD_console_credits_render_ex.first_particle, align 4, !tbaa !13
  %271 = add nsw i32 %270, 1
  %272 = srem i32 %271, 64
  store i32 %272, ptr @TCOD_console_credits_render_ex.first_particle, align 4, !tbaa !13
  %273 = load i32, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !13
  %274 = add nsw i32 %273, -1
  store i32 %274, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !13
  br label %275

275:                                              ; preds = %269, %250
  %276 = add nsw i32 %.0296338, 1
  %277 = srem i32 %276, 64
  %278 = add nsw i32 %.0295339, -1
  %279 = icmp sgt i32 %.0295339, 1
  br i1 %279, label %200, label %._crit_edge342.loopexit, !llvm.loop !22

._crit_edge342.loopexit:                          ; preds = %275
  %.pre369 = load i32, ptr @TCOD_console_credits_render_ex.particle_count, align 4
  br label %._crit_edge342

._crit_edge342:                                   ; preds = %._crit_edge342.loopexit, %._crit_edge337
  %.pre373 = phi i32 [ %253, %._crit_edge342.loopexit ], [ %.pre373.pre, %._crit_edge337 ]
  %280 = phi i32 [ %.pre369, %._crit_edge342.loopexit ], [ %119, %._crit_edge337 ]
  %281 = load float, ptr @TCOD_console_credits_render_ex.particle_delay, align 4, !tbaa !15
  %282 = fsub float %281, %4
  store float %282, ptr @TCOD_console_credits_render_ex.particle_delay, align 4, !tbaa !15
  %283 = fcmp olt float %282, 0.000000e+00
  %284 = icmp slt i32 %280, 64
  %or.cond = select i1 %283, i1 %284, i1 false
  %285 = fcmp ogt float %.0289, 2.000000e+00
  %or.cond3 = select i1 %or.cond, i1 %285, i1 false
  %.pre371 = load i32, ptr @TCOD_console_credits_render_ex.left, align 4, !tbaa !13
  br i1 %or.cond3, label %286, label %307

286:                                              ; preds = %._crit_edge342
  %287 = load i32, ptr @TCOD_console_credits_render_ex.first_particle, align 4, !tbaa !13
  %288 = add nsw i32 %280, 1
  store i32 %288, ptr @TCOD_console_credits_render_ex.particle_count, align 4, !tbaa !13
  %289 = add nsw i32 %287, %280
  %290 = srem i32 %289, 64
  %291 = sitofp i32 %.pre371 to float
  %292 = fsub float %.0287, %291
  %293 = fmul float %292, 2.000000e+00
  %294 = sext i32 %290 to i64
  %295 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x, i64 0, i64 %294
  store float %293, ptr %295, align 4, !tbaa !15
  %296 = sitofp i32 %.pre373 to float
  %297 = fsub float %.0288, %296
  %298 = call float @llvm.fmuladd.f32(float %297, float 2.000000e+00, float 2.000000e+00)
  %299 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y, i64 0, i64 %294
  store float %298, ptr %299, align 4, !tbaa !15
  %300 = call float @TCOD_random_get_float(ptr noundef null, float noundef -5.000000e+00, float noundef 5.000000e+00) #7
  %301 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_x_velocity, i64 0, i64 %294
  store float %300, ptr %301, align 4, !tbaa !15
  %302 = call float @TCOD_random_get_float(ptr noundef null, float noundef -5.000000e-01, float noundef -1.500000e+01) #7
  %303 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_y_velocity, i64 0, i64 %294
  store float %302, ptr %303, align 4, !tbaa !15
  %304 = getelementptr inbounds [64 x float], ptr @TCOD_console_credits_render_ex.particle_heat, i64 0, i64 %294
  store float 1.000000e+00, ptr %304, align 4, !tbaa !15
  %305 = load float, ptr @TCOD_console_credits_render_ex.particle_delay, align 4, !tbaa !15
  %306 = fadd float %305, 0x3FB99999A0000000
  store float %306, ptr @TCOD_console_credits_render_ex.particle_delay, align 4, !tbaa !15
  %.pre370 = load i32, ptr @TCOD_console_credits_render_ex.left, align 4, !tbaa !13
  %.pre372 = load i32, ptr @TCOD_console_credits_render_ex.top, align 4, !tbaa !13
  br label %307

307:                                              ; preds = %286, %._crit_edge342
  %308 = phi i32 [ %.pre372, %286 ], [ %.pre373, %._crit_edge342 ]
  %309 = phi i32 [ %.pre370, %286 ], [ %.pre371, %._crit_edge342 ]
  %310 = load ptr, ptr @TCOD_console_credits_render_ex.img, align 8, !tbaa !11
  call void @TCOD_image_blit_2x(ptr noundef %310, ptr noundef nonnull %7, i32 noundef %309, i32 noundef %308, i32 noundef 0, i32 noundef 0, i32 noundef -1, i32 noundef -1) #7
  %311 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !13
  %312 = icmp sgt i32 %311, 0
  br i1 %312, label %.lr.ph345, label %._crit_edge346

.lr.ph345:                                        ; preds = %307
  %.0.copyload10 = load i24, ptr @TCOD_black, align 1
  br label %325

._crit_edge346:                                   ; preds = %394, %307
  %.lcssa = phi i32 [ %311, %307 ], [ %395, %394 ]
  %313 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !15
  %314 = call float @llvm.fmuladd.f32(float %4, float 4.000000e+00, float %313)
  store float %314, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !15
  %315 = fadd float %314, 5.000000e-01
  %316 = fptosi float %315 to i32
  %317 = icmp sgt i32 %316, 0
  br i1 %317, label %.lr.ph349, label %._crit_edge350

.lr.ph349:                                        ; preds = %._crit_edge346
  %318 = sdiv i32 %.lcssa, 2
  %319 = sitofp i32 %318 to float
  %wide.trip.count360 = zext nneg i32 %316 to i64
  %min.iters.check = icmp ult i32 %316, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph349
  %indvars.iv357.ph = phi i64 [ 0, %.lr.ph349 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph349
  %n.vec = and i64 %wide.trip.count360, 2147483644
  %broadcast.splatinsert = insertelement <4 x float> poison, float %314, i64 0
  %broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert382 = insertelement <4 x float> poison, float %319, i64 0
  %broadcast.splat383 = shufflevector <4 x float> %broadcast.splatinsert382, <4 x float> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %320 = uitofp <4 x i32> %vec.ind to <4 x float>
  %321 = fsub <4 x float> %broadcast.splat, %320
  %322 = fdiv <4 x float> %321, %broadcast.splat383
  %323 = getelementptr inbounds [128 x float], ptr @TCOD_console_credits_render_ex.char_heat, i64 0, i64 %index
  store <4 x float> %322, ptr %323, align 16, !tbaa !15
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %324 = icmp eq i64 %index.next, %n.vec
  br i1 %324, label %middle.block, label %vector.body, !llvm.loop !23

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count360
  br i1 %cmp.n, label %._crit_edge350, label %scalar.ph.preheader

325:                                              ; preds = %.lr.ph345, %394
  %326 = phi i32 [ %311, %.lr.ph345 ], [ %395, %394 ]
  %indvars.iv354 = phi i64 [ 0, %.lr.ph345 ], [ %indvars.iv.next355, %394 ]
  %327 = getelementptr inbounds [128 x float], ptr @TCOD_console_credits_render_ex.char_heat, i64 0, i64 %indvars.iv354
  %328 = load float, ptr %327, align 4, !tbaa !15
  %329 = fcmp ult float %328, 0.000000e+00
  br i1 %329, label %394, label %330

330:                                              ; preds = %325
  %331 = getelementptr inbounds [128 x i8], ptr @TCOD_console_credits_render_ex.powered_by, i64 0, i64 %indvars.iv354
  %332 = load i8, ptr %331, align 1, !tbaa !17
  %.not319 = icmp eq i8 %332, 10
  br i1 %.not319, label %394, label %333

333:                                              ; preds = %330
  %334 = fmul float %328, 6.400000e+01
  %335 = fptosi float %334 to i32
  %336 = call i32 @llvm.smin.i32(i32 %335, i32 63)
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds [64 x %struct.TCOD_ColorRGB], ptr @TCOD_console_credits_render_ex.colormap_heat, i64 0, i64 %337
  %.sroa.035.0.copyload = load i8, ptr %338, align 1, !tbaa !17
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %338, i64 1
  %.sroa.9.0.copyload = load i8, ptr %.sroa.9.0..sroa_idx, align 1, !tbaa !17
  %.sroa.11.0..sroa_idx = getelementptr inbounds i8, ptr %338, i64 2
  %.sroa.11.0.copyload = load i8, ptr %.sroa.11.0..sroa_idx, align 1, !tbaa !17
  %339 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !15
  %340 = sitofp i32 %326 to float
  %341 = fcmp ult float %339, %340
  br i1 %341, label %385, label %342

342:                                              ; preds = %333
  %343 = fsub float %339, %340
  %344 = fdiv float %343, %340
  br i1 %3, label %345, label %383

345:                                              ; preds = %342
  %346 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_x, i64 0, i64 %indvars.iv354
  %347 = load i32, ptr %346, align 4, !tbaa !13
  %348 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_y, i64 0, i64 %indvars.iv354
  %349 = load i32, ptr %348, align 4, !tbaa !13
  %350 = call i24 @TCOD_console_get_char_background(ptr noundef nonnull %7, i32 noundef %347, i32 noundef %349) #7
  %.sroa.4.0.extract.shift = lshr i24 %350, 8
  %.sroa.5.0.extract.shift = lshr i24 %350, 16
  %351 = and i24 %350, 255
  %352 = uitofp nneg i24 %351 to float
  %353 = fsub float 1.000000e+00, %344
  %354 = uitofp i8 %.sroa.035.0.copyload to float
  %355 = fmul float %353, %354
  %356 = call float @llvm.fmuladd.f32(float %344, float %352, float %355)
  %357 = fptosi float %356 to i32
  %358 = and i24 %.sroa.4.0.extract.shift, 255
  %359 = uitofp nneg i24 %358 to float
  %360 = uitofp i8 %.sroa.9.0.copyload to float
  %361 = fmul float %353, %360
  %362 = call float @llvm.fmuladd.f32(float %344, float %359, float %361)
  %363 = fptosi float %362 to i32
  %364 = uitofp nneg i24 %.sroa.5.0.extract.shift to float
  %365 = uitofp i8 %.sroa.11.0.copyload to float
  %366 = fmul float %353, %365
  %367 = call float @llvm.fmuladd.f32(float %344, float %364, float %366)
  %368 = fptosi float %367 to i32
  %369 = call i32 @llvm.smin.i32(i32 %357, i32 255)
  %370 = call i32 @llvm.smax.i32(i32 %369, i32 0)
  %371 = trunc nuw i32 %370 to i8
  %372 = call i32 @llvm.smin.i32(i32 %363, i32 255)
  %373 = call i32 @llvm.smax.i32(i32 %372, i32 0)
  %374 = trunc nuw i32 %373 to i8
  %375 = call i32 @llvm.smin.i32(i32 %368, i32 255)
  %376 = call i32 @llvm.smax.i32(i32 %375, i32 0)
  %377 = trunc nuw i32 %376 to i8
  %378 = load i32, ptr %346, align 4, !tbaa !13
  %379 = load i32, ptr %348, align 4, !tbaa !13
  %380 = trunc nuw nsw i32 %376 to i24
  %.sroa.11.0.insert.ext54 = shl nuw i24 %380, 16
  %381 = trunc nuw nsw i32 %373 to i24
  %.sroa.9.0.insert.ext46 = shl nuw nsw i24 %381, 8
  %.sroa.9.0.insert.shift47 = and i24 %.sroa.9.0.insert.ext46, 65280
  %.sroa.9.0.insert.insert49 = or disjoint i24 %.sroa.9.0.insert.shift47, %.sroa.11.0.insert.ext54
  %382 = trunc nuw nsw i32 %370 to i24
  %.sroa.035.0.insert.insert41 = add nuw nsw i24 %.sroa.9.0.insert.insert49, %382
  call void @TCOD_console_set_char_foreground(ptr noundef nonnull %7, i32 noundef %378, i32 noundef %379, i24 %.sroa.035.0.insert.insert41) #7
  br label %385

383:                                              ; preds = %342
  %.sroa.11.0.insert.ext50 = zext i8 %.sroa.11.0.copyload to i24
  %.sroa.11.0.insert.shift51 = shl nuw i24 %.sroa.11.0.insert.ext50, 16
  %.sroa.9.0.insert.ext42 = zext i8 %.sroa.9.0.copyload to i24
  %.sroa.9.0.insert.shift43 = shl nuw nsw i24 %.sroa.9.0.insert.ext42, 8
  %.sroa.035.0.insert.ext36 = zext i8 %.sroa.035.0.copyload to i24
  %.sroa.9.0.insert.insert45 = or disjoint i24 %.sroa.9.0.insert.shift43, %.sroa.035.0.insert.ext36
  %.sroa.035.0.insert.insert38 = or disjoint i24 %.sroa.9.0.insert.insert45, %.sroa.11.0.insert.shift51
  %384 = call i24 @TCOD_color_lerp(i24 %.sroa.035.0.insert.insert38, i24 %.0.copyload10, float noundef %344) #7
  %.sroa.035.0.extract.trunc = trunc i24 %384 to i8
  %.sroa.9.0.extract.shift = lshr i24 %384, 8
  %.sroa.9.0.extract.trunc = trunc i24 %.sroa.9.0.extract.shift to i8
  %.sroa.11.0.extract.shift = lshr i24 %384, 16
  %.sroa.11.0.extract.trunc = trunc nuw i24 %.sroa.11.0.extract.shift to i8
  br label %385

385:                                              ; preds = %345, %383, %333
  %.sroa.11.1 = phi i8 [ %.sroa.11.0.copyload, %333 ], [ %377, %345 ], [ %.sroa.11.0.extract.trunc, %383 ]
  %.sroa.9.1 = phi i8 [ %.sroa.9.0.copyload, %333 ], [ %374, %345 ], [ %.sroa.9.0.extract.trunc, %383 ]
  %.sroa.035.1 = phi i8 [ %.sroa.035.0.copyload, %333 ], [ %371, %345 ], [ %.sroa.035.0.extract.trunc, %383 ]
  %386 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_x, i64 0, i64 %indvars.iv354
  %387 = load i32, ptr %386, align 4, !tbaa !13
  %388 = getelementptr inbounds [128 x i32], ptr @TCOD_console_credits_render_ex.char_y, i64 0, i64 %indvars.iv354
  %389 = load i32, ptr %388, align 4, !tbaa !13
  %390 = load i8, ptr %331, align 1, !tbaa !17
  %391 = sext i8 %390 to i32
  call void @TCOD_console_set_char(ptr noundef nonnull %7, i32 noundef %387, i32 noundef %389, i32 noundef %391) #7
  %392 = load i32, ptr %386, align 4, !tbaa !13
  %393 = load i32, ptr %388, align 4, !tbaa !13
  %.sroa.11.0.insert.ext = zext i8 %.sroa.11.1 to i24
  %.sroa.11.0.insert.shift = shl nuw i24 %.sroa.11.0.insert.ext, 16
  %.sroa.9.0.insert.ext = zext i8 %.sroa.9.1 to i24
  %.sroa.9.0.insert.shift = shl nuw nsw i24 %.sroa.9.0.insert.ext, 8
  %.sroa.9.0.insert.insert = or disjoint i24 %.sroa.9.0.insert.shift, %.sroa.11.0.insert.shift
  %.sroa.035.0.insert.ext = zext i8 %.sroa.035.1 to i24
  %.sroa.035.0.insert.insert = or disjoint i24 %.sroa.9.0.insert.insert, %.sroa.035.0.insert.ext
  call void @TCOD_console_set_char_foreground(ptr noundef nonnull %7, i32 noundef %392, i32 noundef %393, i24 %.sroa.035.0.insert.insert) #7
  %.pre374 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !13
  br label %394

394:                                              ; preds = %325, %330, %385
  %395 = phi i32 [ %326, %325 ], [ %326, %330 ], [ %.pre374, %385 ]
  %indvars.iv.next355 = add nuw nsw i64 %indvars.iv354, 1
  %396 = sext i32 %395 to i64
  %397 = icmp slt i64 %indvars.iv.next355, %396
  br i1 %397, label %325, label %._crit_edge346, !llvm.loop !26

._crit_edge350:                                   ; preds = %scalar.ph, %middle.block, %._crit_edge346
  call void @TCOD_console_set_default_foreground(ptr noundef nonnull %7, i24 %75) #7
  %398 = load float, ptr @TCOD_console_credits_render_ex.text_progress, align 4, !tbaa !15
  %399 = load i32, ptr @TCOD_console_credits_render_ex.text_length, align 4, !tbaa !13
  %400 = shl nsw i32 %399, 1
  %401 = sitofp i32 %400 to float
  %402 = fcmp ugt float %398, %401
  br i1 %402, label %408, label %409

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv357 = phi i64 [ %indvars.iv.next358, %scalar.ph ], [ %indvars.iv357.ph, %scalar.ph.preheader ]
  %403 = trunc nuw nsw i64 %indvars.iv357 to i32
  %404 = uitofp nneg i32 %403 to float
  %405 = fsub float %314, %404
  %406 = fdiv float %405, %319
  %407 = getelementptr inbounds [128 x float], ptr @TCOD_console_credits_render_ex.char_heat, i64 0, i64 %indvars.iv357
  store float %406, ptr %407, align 4, !tbaa !15
  %indvars.iv.next358 = add nuw nsw i64 %indvars.iv357, 1
  %exitcond361.not = icmp eq i64 %indvars.iv.next358, %wide.trip.count360
  br i1 %exitcond361.not, label %._crit_edge350, label %scalar.ph, !llvm.loop !27

408:                                              ; preds = %._crit_edge350
  store i8 0, ptr @credits_initialized, align 1, !tbaa !5
  br label %409

409:                                              ; preds = %._crit_edge350, %408
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %410

410:                                              ; preds = %5, %409
  %.1 = phi i1 [ %402, %409 ], [ false, %5 ]
  ret i1 %.1
}

declare void @TCOD_color_gen_map(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @TCOD_noise_new(i32 noundef, float noundef, float noundef, ptr noundef) local_unnamed_addr #2

declare i24 @TCOD_console_get_default_background(ptr noundef) local_unnamed_addr #2

declare void @TCOD_console_set_default_background(ptr noundef, i24) local_unnamed_addr #2

declare void @TCOD_image_delete(ptr noundef) local_unnamed_addr #2

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

declare i24 @TCOD_console_get_default_foreground(ptr noundef) local_unnamed_addr #2

declare float @TCOD_noise_get(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

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

declare i24 @TCOD_console_get_char_background(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden signext i8 @quadrants_from_codepoint(i32 noundef) local_unnamed_addr #3

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

declare i24 @TCOD_console_get_char_foreground(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @TCOD_image_put_pixel(ptr noundef, i32 noundef, i32 noundef, i24) local_unnamed_addr #2

declare i24 @TCOD_image_get_pixel(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i24 @TCOD_color_lerp(i24, i24, float noundef) local_unnamed_addr #2

declare float @TCOD_random_get_float(ptr noundef, float noundef, float noundef) local_unnamed_addr #2

declare void @TCOD_image_blit_2x(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @TCOD_console_set_char_foreground(ptr noundef, i32 noundef, i32 noundef, i24) local_unnamed_addr #2

declare void @TCOD_console_set_char(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @TCOD_console_set_default_foreground(ptr noundef, i24) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #6

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 = { "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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"_Bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19, !24, !25}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !19}
!27 = distinct !{!27, !19, !25, !24}


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