; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local zeroext i1 @GuiButton(<2 x float>, <2 x float>, ptr noundef) #4

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

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

declare i32 @GetColor(i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL12GetTextWidthPKc(ptr noundef) #4

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

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

declare zeroext i1 @IsMouseButtonDown(i32 noundef) #6

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

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

94:                                               ; preds = %7
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = call noundef i32 @_ZL12GetTextWidthPKc(ptr noundef %95)
  %97 = sitofp i32 %96 to float
  %98 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 2
  store float %97, ptr %98, align 4, !tbaa !19
  %99 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %100 = sitofp i32 %99 to float
  %101 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 3
  store float %100, ptr %101, align 4, !tbaa !20
  %102 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 0
  %103 = load float, ptr %102, align 4, !tbaa !15
  %104 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 2
  %105 = load float, ptr %104, align 4, !tbaa !19
  %106 = fadd float %103, %105
  %107 = call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 13)
  %108 = sitofp i32 %107 to float
  %109 = fadd float %106, %108
  %110 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 0
  store float %109, ptr %110, align 4, !tbaa !15
  %111 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 1
  %112 = load float, ptr %111, align 4, !tbaa !18
  %113 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 3
  %114 = load float, ptr %113, align 4, !tbaa !20
  %115 = fdiv float %114, 2.000000e+00
  %116 = fadd float %112, %115
  %117 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %118 = sdiv i32 %117, 2
  %119 = sitofp i32 %118 to float
  %120 = fsub float %116, %119
  %121 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 1
  store float %120, ptr %121, align 4, !tbaa !18
  %122 = call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 14)
  %123 = icmp eq i32 %122, 0
  br i1 %123, label %124, label %134

124:                                              ; preds = %94
  %125 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 0
  %126 = load float, ptr %125, align 4, !tbaa !15
  %127 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 2
  %128 = load float, ptr %127, align 4, !tbaa !19
  %129 = fsub float %126, %128
  %130 = call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 13)
  %131 = sitofp i32 %130 to float
  %132 = fsub float %129, %131
  %133 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 0
  store float %132, ptr %133, align 4, !tbaa !15
  br label %134

134:                                              ; preds = %124, %94
  br label %135

135:                                              ; preds = %134, %7
  %136 = load i32, ptr %14, align 4, !tbaa !13
  %137 = icmp ne i32 %136, 3
  br i1 %137, label %138, label %155

138:                                              ; preds = %135
  %139 = load i8, ptr @_ZL9guiLocked, align 1, !tbaa !11, !range !21, !noundef !22
  %140 = trunc i8 %139 to i1
  br i1 %140, label %155, label %141

141:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %142 = call <2 x float> @GetMousePosition()
  store <2 x float> %142, ptr %21, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %21, i64 8, i1 false), !tbaa.struct !23
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !25
  %143 = load <2 x float>, ptr %22, align 4
  %144 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %23, i32 0, i32 0
  %145 = load <2 x float>, ptr %144, align 4
  %146 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %23, i32 0, i32 1
  %147 = load <2 x float>, ptr %146, align 4
  %148 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %143, <2 x float> %145, <2 x float> %147)
  br i1 %148, label %149, label %154

149:                                              ; preds = %141
  %150 = call zeroext i1 @IsMouseButtonDown(i32 noundef 0)
  br i1 %150, label %151, label %152

151:                                              ; preds = %149
  store i32 2, ptr %14, align 4, !tbaa !13
  br label %153

152:                                              ; preds = %149
  store i32 1, ptr %14, align 4, !tbaa !13
  br label %153

153:                                              ; preds = %152, %151
  br label %154

154:                                              ; preds = %153, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %155

155:                                              ; preds = %154, %138, %135
  %156 = load i8, ptr %13, align 1, !tbaa !11, !range !21, !noundef !22
  %157 = trunc i8 %156 to i1
  br i1 %157, label %171, label %158

158:                                              ; preds = %155
  %159 = load i32, ptr %16, align 4, !tbaa !9
  %160 = load i32, ptr %11, align 4, !tbaa !9
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %162, label %164

162:                                              ; preds = %158
  %163 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %163, ptr %16, align 4, !tbaa !9
  br label %164

164:                                              ; preds = %162, %158
  %165 = load i32, ptr %16, align 4, !tbaa !9
  %166 = load i32, ptr %12, align 4, !tbaa !9
  %167 = icmp sgt i32 %165, %166
  br i1 %167, label %168, label %170

168:                                              ; preds = %164
  %169 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %169, ptr %16, align 4, !tbaa !9
  br label %170

170:                                              ; preds = %168, %164
  br label %171

171:                                              ; preds = %170, %155
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %17, i64 16, i1 false), !tbaa.struct !25
  %172 = load i32, ptr %11, align 4, !tbaa !9
  %173 = load i32, ptr %12, align 4, !tbaa !9
  %174 = load i8, ptr %13, align 1, !tbaa !11, !range !21, !noundef !22
  %175 = trunc i8 %174 to i1
  %176 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %24, i32 0, i32 0
  %177 = load <2 x float>, ptr %176, align 4
  %178 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %24, i32 0, i32 1
  %179 = load <2 x float>, ptr %178, align 4
  %180 = call zeroext i1 @GuiValueBox(<2 x float> %177, <2 x float> %179, ptr noundef null, ptr noundef %16, i32 noundef %172, i32 noundef %173, i1 noundef zeroext %175)
  %181 = zext i1 %180 to i8
  store i8 %181, ptr %15, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %182 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 12)
  store i32 %182, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %183 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 14)
  store i32 %183, ptr %26, align 4, !tbaa !9
  %184 = call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 12)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef %184)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %18, i64 16, i1 false), !tbaa.struct !25
  %185 = call ptr @GuiIconText(i32 noundef 118, ptr noundef null)
  %186 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 0
  %187 = load <2 x float>, ptr %186, align 4
  %188 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 1
  %189 = load <2 x float>, ptr %188, align 4
  %190 = call zeroext i1 @GuiButton(<2 x float> %187, <2 x float> %189, ptr noundef %185)
  br i1 %190, label %191, label %194

191:                                              ; preds = %171
  %192 = load i32, ptr %16, align 4, !tbaa !9
  %193 = add nsw i32 %192, -1
  store i32 %193, ptr %16, align 4, !tbaa !9
  br label %194

194:                                              ; preds = %191, %171
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %19, i64 16, i1 false), !tbaa.struct !25
  %195 = call ptr @GuiIconText(i32 noundef 119, ptr noundef null)
  %196 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %28, i32 0, i32 0
  %197 = load <2 x float>, ptr %196, align 4
  %198 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %28, i32 0, i32 1
  %199 = load <2 x float>, ptr %198, align 4
  %200 = call zeroext i1 @GuiButton(<2 x float> %197, <2 x float> %199, ptr noundef %195)
  br i1 %200, label %201, label %204

201:                                              ; preds = %194
  %202 = load i32, ptr %16, align 4, !tbaa !9
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %16, align 4, !tbaa !9
  br label %204

204:                                              ; preds = %201, %194
  %205 = load i32, ptr %26, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef %205)
  %206 = load i32, ptr %25, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef %206)
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %20, i64 16, i1 false), !tbaa.struct !25
  %208 = call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 14)
  %209 = icmp eq i32 %208, 2
  %210 = zext i1 %209 to i64
  %211 = select i1 %209, i32 0, i32 2
  %212 = load i32, ptr %14, align 4, !tbaa !13
  %213 = mul nsw i32 %212, 3
  %214 = add nsw i32 2, %213
  %215 = call i32 @GuiGetStyle(i32 noundef 1, i32 noundef %214)
  %216 = call i32 @GetColor(i32 noundef %215)
  store i32 %216, ptr %31, align 1
  %217 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !24
  %218 = load i32, ptr %31, align 1
  %219 = call i32 @Fade(i32 %218, float noundef %217)
  store i32 %219, ptr %30, align 1
  %220 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %29, i32 0, i32 0
  %221 = load <2 x float>, ptr %220, align 4
  %222 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %29, i32 0, i32 1
  %223 = load <2 x float>, ptr %222, align 4
  %224 = load i32, ptr %30, align 1
  call void @_ZL11GuiDrawTextPKc9Rectanglei5Color(ptr noundef %207, <2 x float> %221, <2 x float> %223, i32 noundef %211, i32 %224)
  %225 = load i32, ptr %16, align 4, !tbaa !9
  %226 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %225, ptr %226, align 4, !tbaa !9
  %227 = load i8, ptr %15, align 1, !tbaa !11, !range !21, !noundef !22
  %228 = trunc i8 %227 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  ret i1 %228
}

; Function Attrs: mustprogress uwtable
declare dso_local zeroext i1 @GuiValueBox(<2 x float>, <2 x float>, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i1 noundef zeroext) #4

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

!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++ 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 = !{!"_ZTS15GuiControlState", !7, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTS9Rectangle", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12}
!17 = !{!"float", !7, i64 0}
!18 = !{!16, !17, i64 4}
!19 = !{!16, !17, i64 8}
!20 = !{!16, !17, i64 12}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24}
!24 = !{!17, !17, i64 0}
!25 = !{i64 0, i64 4, !24, i64 4, i64 4, !24, i64 8, i64 4, !24, i64 12, i64 4, !24}


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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local zeroext i1 @GuiButton(<2 x float>, <2 x float>, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @GuiIconText(i32 noundef, ptr noundef) local_unnamed_addr #3

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

declare i32 @GetColor(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL12GetTextWidthPKc(ptr noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local zeroext i1 @GuiSpinner(<2 x float> %0, <2 x float> %1, ptr noundef %2, ptr nocapture noundef %3, i32 noundef %4, i32 noundef %5, i1 noundef zeroext %6) local_unnamed_addr #2 {
  %8 = alloca i32, align 4
  %9 = load i32, ptr @_ZL8guiState, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %10 = load i32, ptr %3, align 4, !tbaa !9
  store i32 %10, ptr %8, align 4, !tbaa !9
  %.sroa.046.0.vec.extract = extractelement <2 x float> %0, i64 0
  %11 = tail call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 16)
  %12 = sitofp i32 %11 to float
  %13 = fadd float %.sroa.046.0.vec.extract, %12
  %14 = tail call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 17)
  %15 = sitofp i32 %14 to float
  %16 = fadd float %13, %15
  %.sroa.027.4.vec.insert = insertelement <2 x float> %0, float %16, i64 0
  %.sroa.11.8.vec.extract = extractelement <2 x float> %1, i64 0
  %17 = tail call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 16)
  %18 = tail call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 17)
  %19 = add nsw i32 %18, %17
  %20 = shl nsw i32 %19, 1
  %21 = sitofp i32 %20 to float
  %22 = fsub float %.sroa.11.8.vec.extract, %21
  %.sroa.529.12.vec.insert = insertelement <2 x float> %1, float %22, i64 0
  %23 = tail call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 16)
  %24 = sitofp i32 %23 to float
  %.sroa.525.12.vec.insert = insertelement <2 x float> %1, float %24, i64 0
  %25 = fadd <2 x float> %0, %1
  %26 = extractelement <2 x float> %25, i64 0
  %27 = tail call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 16)
  %28 = sitofp i32 %27 to float
  %29 = fsub float %26, %28
  %.sroa.020.4.vec.insert = insertelement <2 x float> %0, float %29, i64 0
  %30 = tail call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 16)
  %31 = sitofp i32 %30 to float
  %.sroa.5.12.vec.insert = insertelement <2 x float> %1, float %31, i64 0
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %55, label %32

32:                                               ; preds = %7
  %.sroa.11.12.vec.extract = extractelement <2 x float> %1, i64 1
  %.sroa.046.4.vec.extract = extractelement <2 x float> %0, i64 1
  %33 = tail call noundef i32 @_ZL12GetTextWidthPKc(ptr noundef nonnull %2)
  %34 = tail call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %35 = insertelement <2 x i32> poison, i32 %33, i64 0
  %36 = insertelement <2 x i32> %35, i32 %34, i64 1
  %37 = sitofp <2 x i32> %36 to <2 x float>
  %38 = tail call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 13)
  %39 = sitofp i32 %38 to float
  %40 = fadd float %26, %39
  %.sroa.014.0.vec.insert = insertelement <2 x float> poison, float %40, i64 0
  %41 = fmul float %.sroa.11.12.vec.extract, 5.000000e-01
  %42 = fadd float %.sroa.046.4.vec.extract, %41
  %43 = tail call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %44 = sdiv i32 %43, 2
  %45 = sitofp i32 %44 to float
  %46 = fsub float %42, %45
  %.sroa.014.4.vec.insert = insertelement <2 x float> %.sroa.014.0.vec.insert, float %46, i64 1
  %47 = tail call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 14)
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %55

49:                                               ; preds = %32
  %50 = fsub <2 x float> %0, %37
  %51 = extractelement <2 x float> %50, i64 0
  %52 = tail call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 13)
  %53 = sitofp i32 %52 to float
  %54 = fsub float %51, %53
  %.sroa.014.0.vec.insert17 = insertelement <2 x float> %.sroa.014.4.vec.insert, float %54, i64 0
  br label %55

55:                                               ; preds = %32, %49, %7
  %.sroa.014.0 = phi <2 x float> [ %.sroa.014.0.vec.insert17, %49 ], [ %.sroa.014.4.vec.insert, %32 ], [ zeroinitializer, %7 ]
  %.sroa.7.0 = phi <2 x float> [ %37, %49 ], [ %37, %32 ], [ zeroinitializer, %7 ]
  %.not78 = icmp eq i32 %9, 3
  br i1 %.not78, label %64, label %56

56:                                               ; preds = %55
  %57 = load i8, ptr @_ZL9guiLocked, align 1, !tbaa !11, !range !13, !noundef !14
  %58 = trunc nuw i8 %57 to i1
  br i1 %58, label %64, label %59

59:                                               ; preds = %56
  %60 = tail call <2 x float> @GetMousePosition()
  %61 = tail call zeroext i1 @CheckCollisionPointRec(<2 x float> %60, <2 x float> %0, <2 x float> %1)
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  %63 = tail call zeroext i1 @IsMouseButtonDown(i32 noundef 0)
  %. = select i1 %63, i32 2, i32 1
  br label %64

64:                                               ; preds = %59, %62, %56, %55
  %.1 = phi i32 [ %9, %56 ], [ 3, %55 ], [ %9, %59 ], [ %., %62 ]
  br i1 %6, label %68, label %condstore.split

condstore.split:                                  ; preds = %64
  %.not79 = icmp slt i32 %10, %4
  %65 = tail call i32 @llvm.smax.i32(i32 %10, i32 %4)
  %.not80 = icmp sgt i32 %65, %5
  %66 = or i1 %.not79, %.not80
  br i1 %66, label %67, label %68

67:                                               ; preds = %condstore.split
  %simplifycfg.merge = tail call i32 @llvm.smin.i32(i32 %65, i32 %5)
  store i32 %simplifycfg.merge, ptr %8, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %67, %condstore.split, %64
  %69 = call zeroext i1 @GuiValueBox(<2 x float> %.sroa.027.4.vec.insert, <2 x float> %.sroa.529.12.vec.insert, ptr noundef null, ptr noundef nonnull %8, i32 noundef %4, i32 noundef %5, i1 noundef zeroext %6)
  %70 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 12)
  %71 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 14)
  %72 = call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 12)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef %72)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef 1)
  %73 = call ptr @GuiIconText(i32 noundef 118, ptr noundef null)
  %74 = call zeroext i1 @GuiButton(<2 x float> %0, <2 x float> %.sroa.525.12.vec.insert, ptr noundef %73)
  br i1 %74, label %75, label %78

75:                                               ; preds = %68
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr %8, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %75, %68
  %79 = call ptr @GuiIconText(i32 noundef 119, ptr noundef null)
  %80 = call zeroext i1 @GuiButton(<2 x float> %.sroa.020.4.vec.insert, <2 x float> %.sroa.5.12.vec.insert, ptr noundef %79)
  br i1 %80, label %81, label %84

81:                                               ; preds = %78
  %82 = load i32, ptr %8, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %8, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %81, %78
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef %71)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef %70)
  %85 = call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 14)
  %86 = icmp eq i32 %85, 2
  %87 = select i1 %86, i32 0, i32 2
  %88 = mul nsw i32 %.1, 3
  %89 = add nsw i32 %88, 2
  %90 = call i32 @GuiGetStyle(i32 noundef 1, i32 noundef %89)
  %91 = call i32 @GetColor(i32 noundef %90)
  %92 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !15
  %93 = call i32 @Fade(i32 %91, float noundef %92)
  call void @_ZL11GuiDrawTextPKc9Rectanglei5Color(ptr noundef %2, <2 x float> %.sroa.014.0, <2 x float> %.sroa.7.0, i32 noundef %87, i32 %93)
  %94 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %94, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  ret i1 %69
}

; Function Attrs: mustprogress uwtable
declare dso_local zeroext i1 @GuiValueBox(<2 x float>, <2 x float>, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress 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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"_ZTS15GuiControlState", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass