; LLVM IR from VTIvanov20/eight-ball-pool :: src (main)

; 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.Rectangle = type { float, float, float, float }
%struct.Vector2 = type { float, float }
%struct.Color = type { i8, i8, i8, i8 }

@_ZL8guiState = external hidden global i32, align 4
@_ZL9guiLocked = external hidden global i8, align 1
@_ZL8guiAlpha = external hidden global float, align 4

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @GuiGetStyle(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float>, <2 x float>, i32 noundef, i32, i32) #4

declare i32 @Fade(i32, float noundef) #5

declare i32 @GetColor(i32 noundef) #5

declare <2 x float> @GetMousePosition() #5

declare zeroext i1 @CheckCollisionPointRec(<2 x float>, <2 x float>, <2 x float>) #5

declare zeroext i1 @IsMouseButtonDown(i32 noundef) #5

declare void @DrawRectangleGradientEx(<2 x float>, <2 x float>, i32, i32, i32, i32) #5

; Function Attrs: mustprogress uwtable
define dso_local float @GuiColorBarAlpha(<2 x float> %0, <2 x float> %1, float noundef %2) #4 {
  %4 = alloca %struct.Rectangle, align 4
  %5 = alloca float, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.Rectangle, align 4
  %8 = alloca %struct.Vector2, align 4
  %9 = alloca %struct.Vector2, align 4
  %10 = alloca %struct.Rectangle, align 4
  %11 = alloca %struct.Vector2, align 4
  %12 = alloca %struct.Rectangle, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.Rectangle, align 4
  %19 = alloca %struct.Rectangle, align 4
  %20 = alloca %struct.Color, align 1
  %21 = alloca %struct.Color, align 1
  %22 = alloca %struct.Color, align 1
  %23 = alloca %struct.Color, align 1
  %24 = alloca %struct.Color, align 1
  %25 = alloca %struct.Color, align 1
  %26 = alloca %struct.Rectangle, align 4
  %27 = alloca %struct.Color, align 1
  %28 = alloca %struct.Color, align 1
  %29 = alloca %struct.Color, align 1
  %30 = alloca %struct.Color, align 1
  %31 = alloca %struct.Color, align 1
  %32 = alloca %struct.Color, align 1
  %33 = alloca %struct.Rectangle, align 4
  %34 = alloca %struct.Color, align 1
  %35 = alloca %struct.Color, align 1
  %36 = alloca %struct.Color, align 1
  %37 = alloca %struct.Color, align 1
  %38 = alloca %struct.Color, align 1
  %39 = alloca %struct.Color, align 1
  %40 = alloca %struct.Color, align 1
  %41 = alloca %struct.Color, align 1
  %42 = alloca %struct.Rectangle, align 4
  %43 = alloca %struct.Color, align 1
  %44 = alloca %struct.Color, align 1
  %45 = alloca %struct.Color, align 1
  %46 = alloca %struct.Rectangle, align 4
  %47 = alloca %struct.Color, align 1
  %48 = alloca %struct.Color, align 1
  %49 = alloca %struct.Color, align 1
  %50 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %4, i32 0, i32 0
  store <2 x float> %0, ptr %50, align 4
  %51 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %4, i32 0, i32 1
  store <2 x float> %1, ptr %51, align 4
  store float %2, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %52 = load i32, ptr @_ZL8guiState, align 4, !tbaa !9
  store i32 %52, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  %53 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 0
  %54 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 0
  %55 = load float, ptr %54, align 4, !tbaa !11
  %56 = load float, ptr %5, align 4, !tbaa !5
  %57 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 2
  %58 = load float, ptr %57, align 4, !tbaa !13
  %59 = call float @llvm.fmuladd.f32(float %56, float %58, float %55)
  %60 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 19)
  %61 = sdiv i32 %60, 2
  %62 = sitofp i32 %61 to float
  %63 = fsub float %59, %62
  store float %63, ptr %53, align 4, !tbaa !11
  %64 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 1
  %65 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 1
  %66 = load float, ptr %65, align 4, !tbaa !14
  %67 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 20)
  %68 = sitofp i32 %67 to float
  %69 = fsub float %66, %68
  store float %69, ptr %64, align 4, !tbaa !14
  %70 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 2
  %71 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 19)
  %72 = sitofp i32 %71 to float
  store float %72, ptr %70, align 4, !tbaa !13
  %73 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 3
  %74 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 3
  %75 = load float, ptr %74, align 4, !tbaa !15
  %76 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 20)
  %77 = mul nsw i32 %76, 2
  %78 = sitofp i32 %77 to float
  %79 = fadd float %75, %78
  store float %79, ptr %73, align 4, !tbaa !15
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = icmp ne i32 %80, 3
  br i1 %81, label %82, label %122

82:                                               ; preds = %3
  %83 = load i8, ptr @_ZL9guiLocked, align 1, !tbaa !16, !range !18, !noundef !19
  %84 = trunc i8 %83 to i1
  br i1 %84, label %122, label %85

85:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %86 = call <2 x float> @GetMousePosition()
  store <2 x float> %86, ptr %8, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %4, i64 16, i1 false), !tbaa.struct !21
  %87 = load <2 x float>, ptr %9, align 4
  %88 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %10, i32 0, i32 0
  %89 = load <2 x float>, ptr %88, align 4
  %90 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %10, i32 0, i32 1
  %91 = load <2 x float>, ptr %90, align 4
  %92 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %87, <2 x float> %89, <2 x float> %91)
  br i1 %92, label %100, label %93

93:                                               ; preds = %85
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !21
  %94 = load <2 x float>, ptr %11, align 4
  %95 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 0
  %96 = load <2 x float>, ptr %95, align 4
  %97 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 1
  %98 = load <2 x float>, ptr %97, align 4
  %99 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %94, <2 x float> %96, <2 x float> %98)
  br i1 %99, label %100, label %121

100:                                              ; preds = %93, %85
  %101 = call zeroext i1 @IsMouseButtonDown(i32 noundef 0)
  br i1 %101, label %102, label %119

102:                                              ; preds = %100
  store i32 2, ptr %6, align 4, !tbaa !9
  %103 = getelementptr inbounds %struct.Vector2, ptr %8, i32 0, i32 0
  %104 = load float, ptr %103, align 4, !tbaa !22
  %105 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 0
  %106 = load float, ptr %105, align 4, !tbaa !11
  %107 = fsub float %104, %106
  %108 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 2
  %109 = load float, ptr %108, align 4, !tbaa !13
  %110 = fdiv float %107, %109
  store float %110, ptr %5, align 4, !tbaa !5
  %111 = load float, ptr %5, align 4, !tbaa !5
  %112 = fcmp ole float %111, 0.000000e+00
  br i1 %112, label %113, label %114

113:                                              ; preds = %102
  store float 0.000000e+00, ptr %5, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %113, %102
  %115 = load float, ptr %5, align 4, !tbaa !5
  %116 = fcmp oge float %115, 1.000000e+00
  br i1 %116, label %117, label %118

117:                                              ; preds = %114
  store float 1.000000e+00, ptr %5, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %117, %114
  br label %120

119:                                              ; preds = %100
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %119, %118
  br label %121

121:                                              ; preds = %120, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %122

122:                                              ; preds = %121, %82, %3
  %123 = load i32, ptr %6, align 4, !tbaa !9
  %124 = icmp ne i32 %123, 3
  br i1 %124, label %125, label %232

125:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %126 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 2
  %127 = load float, ptr %126, align 4, !tbaa !13
  %128 = fptosi float %127 to i32
  %129 = sdiv i32 %128, 10
  store i32 %129, ptr %13, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %130 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 3
  %131 = load float, ptr %130, align 4, !tbaa !15
  %132 = fptosi float %131 to i32
  %133 = sdiv i32 %132, 10
  store i32 %133, ptr %14, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !24
  br label %134

134:                                              ; preds = %198, %125
  %135 = load i32, ptr %15, align 4, !tbaa !24
  %136 = load i32, ptr %13, align 4, !tbaa !24
  %137 = icmp slt i32 %135, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %134
  store i32 2, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %201

139:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !24
  br label %140

140:                                              ; preds = %194, %139
  %141 = load i32, ptr %17, align 4, !tbaa !24
  %142 = load i32, ptr %14, align 4, !tbaa !24
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %197

145:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %146 = getelementptr inbounds %struct.Rectangle, ptr %18, i32 0, i32 0
  %147 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 0
  %148 = load float, ptr %147, align 4, !tbaa !11
  %149 = load i32, ptr %15, align 4, !tbaa !24
  %150 = mul nsw i32 %149, 10
  %151 = sitofp i32 %150 to float
  %152 = fadd float %148, %151
  store float %152, ptr %146, align 4, !tbaa !11
  %153 = getelementptr inbounds %struct.Rectangle, ptr %18, i32 0, i32 1
  %154 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 1
  %155 = load float, ptr %154, align 4, !tbaa !14
  %156 = load i32, ptr %17, align 4, !tbaa !24
  %157 = mul nsw i32 %156, 10
  %158 = sitofp i32 %157 to float
  %159 = fadd float %155, %158
  store float %159, ptr %153, align 4, !tbaa !14
  %160 = getelementptr inbounds %struct.Rectangle, ptr %18, i32 0, i32 2
  store float 1.000000e+01, ptr %160, align 4, !tbaa !13
  %161 = getelementptr inbounds %struct.Rectangle, ptr %18, i32 0, i32 3
  store float 1.000000e+01, ptr %161, align 4, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %18, i64 16, i1 false), !tbaa.struct !21
  %162 = getelementptr inbounds %struct.Color, ptr %20, i32 0, i32 0
  store i8 0, ptr %162, align 1, !tbaa !26
  %163 = getelementptr inbounds %struct.Color, ptr %20, i32 0, i32 1
  store i8 0, ptr %163, align 1, !tbaa !28
  %164 = getelementptr inbounds %struct.Color, ptr %20, i32 0, i32 2
  store i8 0, ptr %164, align 1, !tbaa !29
  %165 = getelementptr inbounds %struct.Color, ptr %20, i32 0, i32 3
  store i8 0, ptr %165, align 1, !tbaa !30
  %166 = load i32, ptr %15, align 4, !tbaa !24
  %167 = load i32, ptr %17, align 4, !tbaa !24
  %168 = add nsw i32 %166, %167
  %169 = srem i32 %168, 2
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %179

171:                                              ; preds = %145
  %172 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 9)
  %173 = call i32 @GetColor(i32 noundef %172)
  store i32 %173, ptr %23, align 1
  %174 = load i32, ptr %23, align 1
  %175 = call i32 @Fade(i32 %174, float noundef 0x3FD99999A0000000)
  store i32 %175, ptr %22, align 1
  %176 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !5
  %177 = load i32, ptr %22, align 1
  %178 = call i32 @Fade(i32 %177, float noundef %176)
  store i32 %178, ptr %21, align 1
  br label %187

179:                                              ; preds = %145
  %180 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 10)
  %181 = call i32 @GetColor(i32 noundef %180)
  store i32 %181, ptr %25, align 1
  %182 = load i32, ptr %25, align 1
  %183 = call i32 @Fade(i32 %182, float noundef 0x3FD99999A0000000)
  store i32 %183, ptr %24, align 1
  %184 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !5
  %185 = load i32, ptr %24, align 1
  %186 = call i32 @Fade(i32 %185, float noundef %184)
  store i32 %186, ptr %21, align 1
  br label %187

187:                                              ; preds = %179, %171
  %188 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %19, i32 0, i32 0
  %189 = load <2 x float>, ptr %188, align 4
  %190 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %19, i32 0, i32 1
  %191 = load <2 x float>, ptr %190, align 4
  %192 = load i32, ptr %20, align 1
  %193 = load i32, ptr %21, align 1
  call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %189, <2 x float> %191, i32 noundef 0, i32 %192, i32 %193)
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %194

194:                                              ; preds = %187
  %195 = load i32, ptr %17, align 4, !tbaa !24
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %17, align 4, !tbaa !24
  br label %140, !llvm.loop !31

197:                                              ; preds = %144
  br label %198

198:                                              ; preds = %197
  %199 = load i32, ptr %15, align 4, !tbaa !24
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %15, align 4, !tbaa !24
  br label %134, !llvm.loop !33

201:                                              ; preds = %138
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %4, i64 16, i1 false), !tbaa.struct !21
  %202 = getelementptr inbounds %struct.Color, ptr %27, i32 0, i32 0
  store i8 -1, ptr %202, align 1, !tbaa !26
  %203 = getelementptr inbounds %struct.Color, ptr %27, i32 0, i32 1
  store i8 -1, ptr %203, align 1, !tbaa !28
  %204 = getelementptr inbounds %struct.Color, ptr %27, i32 0, i32 2
  store i8 -1, ptr %204, align 1, !tbaa !29
  %205 = getelementptr inbounds %struct.Color, ptr %27, i32 0, i32 3
  store i8 0, ptr %205, align 1, !tbaa !30
  %206 = getelementptr inbounds %struct.Color, ptr %28, i32 0, i32 0
  store i8 -1, ptr %206, align 1, !tbaa !26
  %207 = getelementptr inbounds %struct.Color, ptr %28, i32 0, i32 1
  store i8 -1, ptr %207, align 1, !tbaa !28
  %208 = getelementptr inbounds %struct.Color, ptr %28, i32 0, i32 2
  store i8 -1, ptr %208, align 1, !tbaa !29
  %209 = getelementptr inbounds %struct.Color, ptr %28, i32 0, i32 3
  store i8 0, ptr %209, align 1, !tbaa !30
  %210 = getelementptr inbounds %struct.Color, ptr %30, i32 0, i32 0
  store i8 0, ptr %210, align 1, !tbaa !26
  %211 = getelementptr inbounds %struct.Color, ptr %30, i32 0, i32 1
  store i8 0, ptr %211, align 1, !tbaa !28
  %212 = getelementptr inbounds %struct.Color, ptr %30, i32 0, i32 2
  store i8 0, ptr %212, align 1, !tbaa !29
  %213 = getelementptr inbounds %struct.Color, ptr %30, i32 0, i32 3
  store i8 -1, ptr %213, align 1, !tbaa !30
  %214 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !5
  %215 = load i32, ptr %30, align 1
  %216 = call i32 @Fade(i32 %215, float noundef %214)
  store i32 %216, ptr %29, align 1
  %217 = getelementptr inbounds %struct.Color, ptr %32, i32 0, i32 0
  store i8 0, ptr %217, align 1, !tbaa !26
  %218 = getelementptr inbounds %struct.Color, ptr %32, i32 0, i32 1
  store i8 0, ptr %218, align 1, !tbaa !28
  %219 = getelementptr inbounds %struct.Color, ptr %32, i32 0, i32 2
  store i8 0, ptr %219, align 1, !tbaa !29
  %220 = getelementptr inbounds %struct.Color, ptr %32, i32 0, i32 3
  store i8 -1, ptr %220, align 1, !tbaa !30
  %221 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !5
  %222 = load i32, ptr %32, align 1
  %223 = call i32 @Fade(i32 %222, float noundef %221)
  store i32 %223, ptr %31, align 1
  %224 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %26, i32 0, i32 0
  %225 = load <2 x float>, ptr %224, align 4
  %226 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %26, i32 0, i32 1
  %227 = load <2 x float>, ptr %226, align 4
  %228 = load i32, ptr %27, align 1
  %229 = load i32, ptr %28, align 1
  %230 = load i32, ptr %29, align 1
  %231 = load i32, ptr %31, align 1
  call void @DrawRectangleGradientEx(<2 x float> %225, <2 x float> %227, i32 %228, i32 %229, i32 %230, i32 %231)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %259

232:                                              ; preds = %122
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %4, i64 16, i1 false), !tbaa.struct !21
  %233 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 10)
  %234 = call i32 @GetColor(i32 noundef %233)
  store i32 %234, ptr %35, align 1
  %235 = load i32, ptr %35, align 1
  %236 = call i32 @Fade(i32 %235, float noundef 0x3FB99999A0000000)
  store i32 %236, ptr %34, align 1
  %237 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 10)
  %238 = call i32 @GetColor(i32 noundef %237)
  store i32 %238, ptr %37, align 1
  %239 = load i32, ptr %37, align 1
  %240 = call i32 @Fade(i32 %239, float noundef 0x3FB99999A0000000)
  store i32 %240, ptr %36, align 1
  %241 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 9)
  %242 = call i32 @GetColor(i32 noundef %241)
  store i32 %242, ptr %39, align 1
  %243 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !5
  %244 = load i32, ptr %39, align 1
  %245 = call i32 @Fade(i32 %244, float noundef %243)
  store i32 %245, ptr %38, align 1
  %246 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 9)
  %247 = call i32 @GetColor(i32 noundef %246)
  store i32 %247, ptr %41, align 1
  %248 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !5
  %249 = load i32, ptr %41, align 1
  %250 = call i32 @Fade(i32 %249, float noundef %248)
  store i32 %250, ptr %40, align 1
  %251 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %33, i32 0, i32 0
  %252 = load <2 x float>, ptr %251, align 4
  %253 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %33, i32 0, i32 1
  %254 = load <2 x float>, ptr %253, align 4
  %255 = load i32, ptr %34, align 1
  %256 = load i32, ptr %36, align 1
  %257 = load i32, ptr %38, align 1
  %258 = load i32, ptr %40, align 1
  call void @DrawRectangleGradientEx(<2 x float> %252, <2 x float> %254, i32 %255, i32 %256, i32 %257, i32 %258)
  br label %259

259:                                              ; preds = %232, %201
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %42, ptr align 4 %4, i64 16, i1 false), !tbaa.struct !21
  %260 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 12)
  %261 = load i32, ptr %6, align 4, !tbaa !9
  %262 = mul nsw i32 %261, 3
  %263 = add nsw i32 0, %262
  %264 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef %263)
  %265 = call i32 @GetColor(i32 noundef %264)
  store i32 %265, ptr %44, align 1
  %266 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !5
  %267 = load i32, ptr %44, align 1
  %268 = call i32 @Fade(i32 %267, float noundef %266)
  store i32 %268, ptr %43, align 1
  %269 = getelementptr inbounds %struct.Color, ptr %45, i32 0, i32 0
  store i8 0, ptr %269, align 1, !tbaa !26
  %270 = getelementptr inbounds %struct.Color, ptr %45, i32 0, i32 1
  store i8 0, ptr %270, align 1, !tbaa !28
  %271 = getelementptr inbounds %struct.Color, ptr %45, i32 0, i32 2
  store i8 0, ptr %271, align 1, !tbaa !29
  %272 = getelementptr inbounds %struct.Color, ptr %45, i32 0, i32 3
  store i8 0, ptr %272, align 1, !tbaa !30
  %273 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %42, i32 0, i32 0
  %274 = load <2 x float>, ptr %273, align 4
  %275 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %42, i32 0, i32 1
  %276 = load <2 x float>, ptr %275, align 4
  %277 = load i32, ptr %43, align 1
  %278 = load i32, ptr %45, align 1
  call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %274, <2 x float> %276, i32 noundef %260, i32 %277, i32 %278)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %46, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !21
  %279 = getelementptr inbounds %struct.Color, ptr %47, i32 0, i32 0
  store i8 0, ptr %279, align 1, !tbaa !26
  %280 = getelementptr inbounds %struct.Color, ptr %47, i32 0, i32 1
  store i8 0, ptr %280, align 1, !tbaa !28
  %281 = getelementptr inbounds %struct.Color, ptr %47, i32 0, i32 2
  store i8 0, ptr %281, align 1, !tbaa !29
  %282 = getelementptr inbounds %struct.Color, ptr %47, i32 0, i32 3
  store i8 0, ptr %282, align 1, !tbaa !30
  %283 = load i32, ptr %6, align 4, !tbaa !9
  %284 = mul nsw i32 %283, 3
  %285 = add nsw i32 0, %284
  %286 = call i32 @GuiGetStyle(i32 noundef 13, i32 noundef %285)
  %287 = call i32 @GetColor(i32 noundef %286)
  store i32 %287, ptr %49, align 1
  %288 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !5
  %289 = load i32, ptr %49, align 1
  %290 = call i32 @Fade(i32 %289, float noundef %288)
  store i32 %290, ptr %48, align 1
  %291 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %46, i32 0, i32 0
  %292 = load <2 x float>, ptr %291, align 4
  %293 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %46, i32 0, i32 1
  %294 = load <2 x float>, ptr %293, align 4
  %295 = load i32, ptr %47, align 1
  %296 = load i32, ptr %48, align 1
  call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %292, <2 x float> %294, i32 noundef 0, i32 %295, i32 %296)
  %297 = load float, ptr %5, align 4, !tbaa !5
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  ret float %297
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress 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 = { mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTS15GuiControlState", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS9Rectangle", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !6, i64 4}
!15 = !{!12, !6, i64 12}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!21 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5}
!22 = !{!23, !6, i64 0}
!23 = !{!"_ZTS7Vector2", !6, i64 0, !6, i64 4}
!24 = !{!25, !25, i64 0}
!25 = !{!"int", !7, i64 0}
!26 = !{!27, !7, i64 0}
!27 = !{!"_ZTS5Color", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!28 = !{!27, !7, i64 1}
!29 = !{!27, !7, i64 2}
!30 = !{!27, !7, i64 3}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}


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

@_ZL8guiState = external hidden local_unnamed_addr global i32, align 4
@_ZL9guiLocked = external hidden local_unnamed_addr global i8, align 1
@_ZL8guiAlpha = external hidden local_unnamed_addr global float, align 4

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @GuiGetStyle(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float>, <2 x float>, i32 noundef, i32, i32) local_unnamed_addr #2

declare i32 @Fade(i32, float noundef) local_unnamed_addr #3

declare i32 @GetColor(i32 noundef) local_unnamed_addr #3

declare <2 x float> @GetMousePosition() local_unnamed_addr #3

declare zeroext i1 @CheckCollisionPointRec(<2 x float>, <2 x float>, <2 x float>) local_unnamed_addr #3

declare zeroext i1 @IsMouseButtonDown(i32 noundef) local_unnamed_addr #3

declare void @DrawRectangleGradientEx(<2 x float>, <2 x float>, i32, i32, i32, i32) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local float @GuiColorBarAlpha(<2 x float> %0, <2 x float> %1, float noundef %2) local_unnamed_addr #2 {
  %4 = load i32, ptr @_ZL8guiState, align 4, !tbaa !5
  %.sroa.087.0.vec.extract = extractelement <2 x float> %0, i64 0
  %.sroa.10.8.vec.extract = extractelement <2 x float> %1, i64 0
  %5 = tail call float @llvm.fmuladd.f32(float %2, float %.sroa.10.8.vec.extract, float %.sroa.087.0.vec.extract)
  %6 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 19)
  %7 = sdiv i32 %6, 2
  %.sroa.087.4.vec.extract = extractelement <2 x float> %0, i64 1
  %8 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 20)
  %9 = insertelement <2 x i32> poison, i32 %7, i64 0
  %10 = insertelement <2 x i32> %9, i32 %8, i64 1
  %11 = sitofp <2 x i32> %10 to <2 x float>
  %12 = insertelement <2 x float> %0, float %5, i64 0
  %13 = fsub <2 x float> %12, %11
  %14 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 19)
  %15 = sitofp i32 %14 to float
  %.sroa.6.8.vec.insert = insertelement <2 x float> poison, float %15, i64 0
  %.sroa.10.12.vec.extract = extractelement <2 x float> %1, i64 1
  %16 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 20)
  %17 = shl nsw i32 %16, 1
  %18 = sitofp i32 %17 to float
  %19 = fadd float %.sroa.10.12.vec.extract, %18
  %.sroa.6.12.vec.insert = insertelement <2 x float> %.sroa.6.8.vec.insert, float %19, i64 1
  %.not = icmp eq i32 %4, 3
  br i1 %.not, label %64, label %20

20:                                               ; preds = %3
  %21 = load i8, ptr @_ZL9guiLocked, align 1, !tbaa !9, !range !11, !noundef !12
  %22 = trunc nuw i8 %21 to i1
  br i1 %22, label %36, label %23

23:                                               ; preds = %20
  %24 = tail call <2 x float> @GetMousePosition()
  %25 = tail call zeroext i1 @CheckCollisionPointRec(<2 x float> %24, <2 x float> %0, <2 x float> %1)
  br i1 %25, label %28, label %26

26:                                               ; preds = %23
  %27 = tail call zeroext i1 @CheckCollisionPointRec(<2 x float> %24, <2 x float> %13, <2 x float> %.sroa.6.12.vec.insert)
  br i1 %27, label %28, label %36

28:                                               ; preds = %26, %23
  %29 = tail call zeroext i1 @IsMouseButtonDown(i32 noundef 0)
  br i1 %29, label %30, label %36

30:                                               ; preds = %28
  %31 = fsub <2 x float> %24, %0
  %32 = extractelement <2 x float> %31, i64 0
  %33 = fdiv float %32, %.sroa.10.8.vec.extract
  %.inv = fcmp ole float %33, 0.000000e+00
  %.0 = select i1 %.inv, float 0.000000e+00, float %33
  %34 = fcmp ult float %.0, 1.000000e+00
  br i1 %34, label %36, label %35

35:                                               ; preds = %30
  br label %36

36:                                               ; preds = %20, %35, %30, %26, %28
  %.1109.ph = phi i32 [ 1, %28 ], [ %4, %26 ], [ 2, %30 ], [ 2, %35 ], [ %4, %20 ]
  %.2.ph = phi float [ %2, %28 ], [ %2, %26 ], [ %.0, %30 ], [ 1.000000e+00, %35 ], [ %2, %20 ]
  %37 = fptosi float %.sroa.10.8.vec.extract to i32
  %38 = sdiv i32 %37, 10
  %39 = fptosi float %.sroa.10.12.vec.extract to i32
  %40 = sdiv i32 %39, 10
  %41 = icmp sgt i32 %37, 9
  %42 = icmp sgt i32 %39, 9
  %or.cond = select i1 %41, i1 %42, i1 false
  br i1 %or.cond, label %.preheader.us, label %._crit_edge126

.preheader.us:                                    ; preds = %36, %._crit_edge.us
  %.0110125.us = phi i32 [ %58, %._crit_edge.us ], [ 0, %36 ]
  %43 = mul nuw nsw i32 %.0110125.us, 10
  %44 = uitofp nneg i32 %43 to float
  %45 = fadd float %.sroa.087.0.vec.extract, %44
  %.sroa.054.0.vec.insert.us = insertelement <2 x float> poison, float %45, i64 0
  br label %46

46:                                               ; preds = %.preheader.us, %46
  %.0111124.us = phi i32 [ 0, %.preheader.us ], [ %57, %46 ]
  %47 = mul nuw nsw i32 %.0111124.us, 10
  %48 = uitofp nneg i32 %47 to float
  %49 = fadd float %.sroa.087.4.vec.extract, %48
  %.sroa.054.4.vec.insert.us = insertelement <2 x float> %.sroa.054.0.vec.insert.us, float %49, i64 1
  %50 = add nuw nsw i32 %.0111124.us, %.0110125.us
  %51 = and i32 %50, 1
  %.not116.us = icmp eq i32 %51, 0
  %. = select i1 %.not116.us, i32 10, i32 9
  %52 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef %.)
  %53 = tail call i32 @GetColor(i32 noundef %52)
  %54 = tail call i32 @Fade(i32 %53, float noundef 0x3FD99999A0000000)
  %55 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !13
  %56 = tail call i32 @Fade(i32 %54, float noundef %55)
  tail call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %.sroa.054.4.vec.insert.us, <2 x float> <float 1.000000e+01, float 1.000000e+01>, i32 noundef 0, i32 0, i32 %56)
  %57 = add nuw nsw i32 %.0111124.us, 1
  %exitcond.not = icmp eq i32 %57, %40
  br i1 %exitcond.not, label %._crit_edge.us, label %46, !llvm.loop !15

._crit_edge.us:                                   ; preds = %46
  %58 = add nuw nsw i32 %.0110125.us, 1
  %exitcond128.not = icmp eq i32 %58, %38
  br i1 %exitcond128.not, label %._crit_edge126, label %.preheader.us, !llvm.loop !17

._crit_edge126:                                   ; preds = %._crit_edge.us, %36
  %59 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !13
  %60 = tail call i32 @Fade(i32 -16777216, float noundef %59)
  %61 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !13
  %62 = tail call i32 @Fade(i32 -16777216, float noundef %61)
  tail call void @DrawRectangleGradientEx(<2 x float> %0, <2 x float> %1, i32 16777215, i32 16777215, i32 %60, i32 %62)
  %63 = mul nsw i32 %.1109.ph, 3
  br label %79

64:                                               ; preds = %3
  %65 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 10)
  %66 = tail call i32 @GetColor(i32 noundef %65)
  %67 = tail call i32 @Fade(i32 %66, float noundef 0x3FB99999A0000000)
  %68 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 10)
  %69 = tail call i32 @GetColor(i32 noundef %68)
  %70 = tail call i32 @Fade(i32 %69, float noundef 0x3FB99999A0000000)
  %71 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 9)
  %72 = tail call i32 @GetColor(i32 noundef %71)
  %73 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !13
  %74 = tail call i32 @Fade(i32 %72, float noundef %73)
  %75 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 9)
  %76 = tail call i32 @GetColor(i32 noundef %75)
  %77 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !13
  %78 = tail call i32 @Fade(i32 %76, float noundef %77)
  tail call void @DrawRectangleGradientEx(<2 x float> %0, <2 x float> %1, i32 %67, i32 %70, i32 %74, i32 %78)
  br label %79

79:                                               ; preds = %64, %._crit_edge126
  %.2122 = phi float [ %2, %64 ], [ %.2.ph, %._crit_edge126 ]
  %.1109120 = phi i32 [ 9, %64 ], [ %63, %._crit_edge126 ]
  %80 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef 12)
  %81 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef %.1109120)
  %82 = tail call i32 @GetColor(i32 noundef %81)
  %83 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !13
  %84 = tail call i32 @Fade(i32 %82, float noundef %83)
  tail call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %0, <2 x float> %1, i32 noundef %80, i32 %84, i32 0)
  %85 = tail call i32 @GuiGetStyle(i32 noundef 13, i32 noundef %.1109120)
  %86 = tail call i32 @GetColor(i32 noundef %85)
  %87 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !13
  %88 = tail call i32 @Fade(i32 %86, float noundef %87)
  tail call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %13, <2 x float> %.sroa.6.12.vec.insert, i32 noundef 0, i32 0, i32 %88)
  ret float %.2122
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress 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 #2 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { "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" }

!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 = !{!"_ZTS15GuiControlState", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass