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

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

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

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

declare zeroext i1 @IsMouseButtonReleased(i32 noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local zeroext i1 @GuiCheckBox(<2 x float> %0, <2 x float> %1, ptr noundef %2, i1 noundef zeroext %3) #4 {
  %5 = alloca %struct.Rectangle, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca %struct.Rectangle, align 4
  %10 = alloca %struct.Vector2, align 4
  %11 = alloca %struct.Rectangle, align 4
  %12 = alloca %struct.Vector2, align 4
  %13 = alloca %struct.Rectangle, align 4
  %14 = alloca %struct.Rectangle, align 4
  %15 = alloca %struct.Color, align 1
  %16 = alloca %struct.Color, align 1
  %17 = alloca %struct.Color, align 1
  %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.Rectangle, align 4
  %24 = alloca %struct.Color, align 1
  %25 = alloca %struct.Color, align 1
  %26 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  store <2 x float> %0, ptr %26, align 4
  %27 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  store <2 x float> %1, ptr %27, align 4
  store ptr %2, ptr %6, align 8, !tbaa !5
  %28 = zext i1 %3 to i8
  store i8 %28, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %29 = load i32, ptr @_ZL8guiState, align 4, !tbaa !11
  store i32 %29, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  call void @llvm.memset.p0.i64(ptr align 4 %9, i8 0, i64 16, i1 false)
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %73

32:                                               ; preds = %4
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = call noundef i32 @_ZL12GetTextWidthPKc(ptr noundef %33)
  %35 = sitofp i32 %34 to float
  %36 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 2
  store float %35, ptr %36, align 4, !tbaa !13
  %37 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %38 = sitofp i32 %37 to float
  %39 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 3
  store float %38, ptr %39, align 4, !tbaa !16
  %40 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 0
  %41 = load float, ptr %40, align 4, !tbaa !17
  %42 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 2
  %43 = load float, ptr %42, align 4, !tbaa !13
  %44 = fadd float %41, %43
  %45 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 13)
  %46 = sitofp i32 %45 to float
  %47 = fadd float %44, %46
  %48 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 0
  store float %47, ptr %48, align 4, !tbaa !17
  %49 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 1
  %50 = load float, ptr %49, align 4, !tbaa !18
  %51 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 3
  %52 = load float, ptr %51, align 4, !tbaa !16
  %53 = fdiv float %52, 2.000000e+00
  %54 = fadd float %50, %53
  %55 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %56 = sdiv i32 %55, 2
  %57 = sitofp i32 %56 to float
  %58 = fsub float %54, %57
  %59 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 1
  store float %58, ptr %59, align 4, !tbaa !18
  %60 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 14)
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %72

62:                                               ; preds = %32
  %63 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 0
  %64 = load float, ptr %63, align 4, !tbaa !17
  %65 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 2
  %66 = load float, ptr %65, align 4, !tbaa !13
  %67 = fsub float %64, %66
  %68 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 13)
  %69 = sitofp i32 %68 to float
  %70 = fsub float %67, %69
  %71 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 0
  store float %70, ptr %71, align 4, !tbaa !17
  br label %72

72:                                               ; preds = %62, %32
  br label %73

73:                                               ; preds = %72, %4
  %74 = load i32, ptr %8, align 4, !tbaa !11
  %75 = icmp ne i32 %74, 3
  br i1 %75, label %76, label %126

76:                                               ; preds = %73
  %77 = load i8, ptr @_ZL9guiLocked, align 1, !tbaa !9, !range !19, !noundef !20
  %78 = trunc i8 %77 to i1
  br i1 %78, label %126, label %79

79:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %80 = call <2 x float> @GetMousePosition()
  store <2 x float> %80, ptr %10, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  %81 = getelementptr inbounds %struct.Rectangle, ptr %11, i32 0, i32 0
  %82 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 14)
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %87

84:                                               ; preds = %79
  %85 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 0
  %86 = load float, ptr %85, align 4, !tbaa !17
  br label %90

87:                                               ; preds = %79
  %88 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 0
  %89 = load float, ptr %88, align 4, !tbaa !17
  br label %90

90:                                               ; preds = %87, %84
  %91 = phi float [ %86, %84 ], [ %89, %87 ]
  store float %91, ptr %81, align 4, !tbaa !17
  %92 = getelementptr inbounds %struct.Rectangle, ptr %11, i32 0, i32 1
  %93 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 1
  %94 = load float, ptr %93, align 4, !tbaa !18
  store float %94, ptr %92, align 4, !tbaa !18
  %95 = getelementptr inbounds %struct.Rectangle, ptr %11, i32 0, i32 2
  %96 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 2
  %97 = load float, ptr %96, align 4, !tbaa !13
  %98 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 2
  %99 = load float, ptr %98, align 4, !tbaa !13
  %100 = fadd float %97, %99
  %101 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 13)
  %102 = sitofp i32 %101 to float
  %103 = fadd float %100, %102
  store float %103, ptr %95, align 4, !tbaa !13
  %104 = getelementptr inbounds %struct.Rectangle, ptr %11, i32 0, i32 3
  %105 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 3
  %106 = load float, ptr %105, align 4, !tbaa !16
  store float %106, ptr %104, align 4, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %10, i64 8, i1 false), !tbaa.struct !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %11, i64 16, i1 false), !tbaa.struct !23
  %107 = load <2 x float>, ptr %12, align 4
  %108 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 0
  %109 = load <2 x float>, ptr %108, align 4
  %110 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 1
  %111 = load <2 x float>, ptr %110, align 4
  %112 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %107, <2 x float> %109, <2 x float> %111)
  br i1 %112, label %113, label %125

113:                                              ; preds = %90
  %114 = call zeroext i1 @IsMouseButtonDown(i32 noundef 0)
  br i1 %114, label %115, label %116

115:                                              ; preds = %113
  store i32 2, ptr %8, align 4, !tbaa !11
  br label %117

116:                                              ; preds = %113
  store i32 1, ptr %8, align 4, !tbaa !11
  br label %117

117:                                              ; preds = %116, %115
  %118 = call zeroext i1 @IsMouseButtonReleased(i32 noundef 0)
  br i1 %118, label %119, label %124

119:                                              ; preds = %117
  %120 = load i8, ptr %7, align 1, !tbaa !9, !range !19, !noundef !20
  %121 = trunc i8 %120 to i1
  %122 = xor i1 %121, true
  %123 = zext i1 %122 to i8
  store i8 %123, ptr %7, align 1, !tbaa !9
  br label %124

124:                                              ; preds = %119, %117
  br label %125

125:                                              ; preds = %124, %90
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %126

126:                                              ; preds = %125, %76, %73
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %5, i64 16, i1 false), !tbaa.struct !23
  %127 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %128 = load i32, ptr %8, align 4, !tbaa !11
  %129 = mul nsw i32 %128, 3
  %130 = add nsw i32 0, %129
  %131 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef %130)
  %132 = call i32 @GetColor(i32 noundef %131)
  store i32 %132, ptr %16, align 1
  %133 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !22
  %134 = load i32, ptr %16, align 1
  %135 = call i32 @Fade(i32 %134, float noundef %133)
  store i32 %135, ptr %15, align 1
  %136 = getelementptr inbounds %struct.Color, ptr %17, i32 0, i32 0
  store i8 0, ptr %136, align 1, !tbaa !24
  %137 = getelementptr inbounds %struct.Color, ptr %17, i32 0, i32 1
  store i8 0, ptr %137, align 1, !tbaa !26
  %138 = getelementptr inbounds %struct.Color, ptr %17, i32 0, i32 2
  store i8 0, ptr %138, align 1, !tbaa !27
  %139 = getelementptr inbounds %struct.Color, ptr %17, i32 0, i32 3
  store i8 0, ptr %139, align 1, !tbaa !28
  %140 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %14, i32 0, i32 0
  %141 = load <2 x float>, ptr %140, align 4
  %142 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %14, i32 0, i32 1
  %143 = load <2 x float>, ptr %142, align 4
  %144 = load i32, ptr %15, align 1
  %145 = load i32, ptr %17, align 1
  call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %141, <2 x float> %143, i32 noundef %127, i32 %144, i32 %145)
  %146 = load i8, ptr %7, align 1, !tbaa !9, !range !19, !noundef !20
  %147 = trunc i8 %146 to i1
  br i1 %147, label %148, label %203

148:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %149 = getelementptr inbounds %struct.Rectangle, ptr %18, i32 0, i32 0
  %150 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 0
  %151 = load float, ptr %150, align 4, !tbaa !17
  %152 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %153 = sitofp i32 %152 to float
  %154 = fadd float %151, %153
  %155 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 16)
  %156 = sitofp i32 %155 to float
  %157 = fadd float %154, %156
  store float %157, ptr %149, align 4, !tbaa !17
  %158 = getelementptr inbounds %struct.Rectangle, ptr %18, i32 0, i32 1
  %159 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 1
  %160 = load float, ptr %159, align 4, !tbaa !18
  %161 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %162 = sitofp i32 %161 to float
  %163 = fadd float %160, %162
  %164 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 16)
  %165 = sitofp i32 %164 to float
  %166 = fadd float %163, %165
  store float %166, ptr %158, align 4, !tbaa !18
  %167 = getelementptr inbounds %struct.Rectangle, ptr %18, i32 0, i32 2
  %168 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 2
  %169 = load float, ptr %168, align 4, !tbaa !13
  %170 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %171 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 16)
  %172 = add nsw i32 %170, %171
  %173 = mul nsw i32 2, %172
  %174 = sitofp i32 %173 to float
  %175 = fsub float %169, %174
  store float %175, ptr %167, align 4, !tbaa !13
  %176 = getelementptr inbounds %struct.Rectangle, ptr %18, i32 0, i32 3
  %177 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 3
  %178 = load float, ptr %177, align 4, !tbaa !16
  %179 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %180 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 16)
  %181 = add nsw i32 %179, %180
  %182 = mul nsw i32 2, %181
  %183 = sitofp i32 %182 to float
  %184 = fsub float %178, %183
  store float %184, ptr %176, align 4, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %18, i64 16, i1 false), !tbaa.struct !23
  %185 = getelementptr inbounds %struct.Color, ptr %20, i32 0, i32 0
  store i8 0, ptr %185, align 1, !tbaa !24
  %186 = getelementptr inbounds %struct.Color, ptr %20, i32 0, i32 1
  store i8 0, ptr %186, align 1, !tbaa !26
  %187 = getelementptr inbounds %struct.Color, ptr %20, i32 0, i32 2
  store i8 0, ptr %187, align 1, !tbaa !27
  %188 = getelementptr inbounds %struct.Color, ptr %20, i32 0, i32 3
  store i8 0, ptr %188, align 1, !tbaa !28
  %189 = load i32, ptr %8, align 4, !tbaa !11
  %190 = mul nsw i32 %189, 3
  %191 = add nsw i32 2, %190
  %192 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef %191)
  %193 = call i32 @GetColor(i32 noundef %192)
  store i32 %193, ptr %22, align 1
  %194 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !22
  %195 = load i32, ptr %22, align 1
  %196 = call i32 @Fade(i32 %195, float noundef %194)
  store i32 %196, ptr %21, align 1
  %197 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %19, i32 0, i32 0
  %198 = load <2 x float>, ptr %197, align 4
  %199 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %19, i32 0, i32 1
  %200 = load <2 x float>, ptr %199, align 4
  %201 = load i32, ptr %20, align 1
  %202 = load i32, ptr %21, align 1
  call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %198, <2 x float> %200, i32 noundef 0, i32 %201, i32 %202)
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %203

203:                                              ; preds = %148, %126
  %204 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %9, i64 16, i1 false), !tbaa.struct !23
  %205 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 14)
  %206 = icmp eq i32 %205, 2
  %207 = zext i1 %206 to i64
  %208 = select i1 %206, i32 0, i32 2
  %209 = load i32, ptr %8, align 4, !tbaa !11
  %210 = mul nsw i32 %209, 3
  %211 = add nsw i32 2, %210
  %212 = call i32 @GuiGetStyle(i32 noundef 1, i32 noundef %211)
  %213 = call i32 @GetColor(i32 noundef %212)
  store i32 %213, ptr %25, align 1
  %214 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !22
  %215 = load i32, ptr %25, align 1
  %216 = call i32 @Fade(i32 %215, float noundef %214)
  store i32 %216, ptr %24, align 1
  %217 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %23, i32 0, i32 0
  %218 = load <2 x float>, ptr %217, align 4
  %219 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %23, i32 0, i32 1
  %220 = load <2 x float>, ptr %219, align 4
  %221 = load i32, ptr %24, align 1
  call void @_ZL11GuiDrawTextPKc9Rectanglei5Color(ptr noundef %204, <2 x float> %218, <2 x float> %220, i32 noundef %208, i32 %221)
  %222 = load i8, ptr %7, align 1, !tbaa !9, !range !19, !noundef !20
  %223 = trunc i8 %222 to i1
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  ret i1 %223
}

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 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS15GuiControlState", !7, i64 0}
!13 = !{!14, !15, i64 8}
!14 = !{!"_ZTS9Rectangle", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12}
!15 = !{!"float", !7, i64 0}
!16 = !{!14, !15, i64 12}
!17 = !{!14, !15, i64 0}
!18 = !{!14, !15, i64 4}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{i64 0, i64 4, !22, i64 4, i64 4, !22}
!22 = !{!15, !15, i64 0}
!23 = !{i64 0, i64 4, !22, i64 4, i64 4, !22, i64 8, i64 4, !22, i64 12, i64 4, !22}
!24 = !{!25, !7, i64 0}
!25 = !{!"_ZTS5Color", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!26 = !{!25, !7, i64 1}
!27 = !{!25, !7, i64 2}
!28 = !{!25, !7, i64 3}


; 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 uwtable
declare dso_local i32 @GuiGetStyle(i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

declare i32 @GetColor(i32 noundef) local_unnamed_addr #2

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

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

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

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

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

declare zeroext i1 @IsMouseButtonReleased(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local zeroext i1 @GuiCheckBox(<2 x float> %0, <2 x float> %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #1 {
  %5 = load i32, ptr @_ZL8guiState, align 4, !tbaa !5
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %31, label %6

6:                                                ; preds = %4
  %7 = tail call noundef i32 @_ZL12GetTextWidthPKc(ptr noundef nonnull %2)
  %8 = tail call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %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 = fadd <2 x float> %0, %1
  %13 = extractelement <2 x float> %12, i64 0
  %14 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 13)
  %15 = sitofp i32 %14 to float
  %16 = fadd float %13, %15
  %.sroa.028.0.vec.insert = insertelement <2 x float> poison, float %16, i64 0
  %.sroa.045.4.vec.extract = extractelement <2 x float> %0, i64 1
  %.sroa.9.12.vec.extract = extractelement <2 x float> %1, i64 1
  %17 = fmul float %.sroa.9.12.vec.extract, 5.000000e-01
  %18 = fadd float %.sroa.045.4.vec.extract, %17
  %19 = tail call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %20 = sdiv i32 %19, 2
  %21 = sitofp i32 %20 to float
  %22 = fsub float %18, %21
  %.sroa.028.4.vec.insert = insertelement <2 x float> %.sroa.028.0.vec.insert, float %22, i64 1
  %23 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 14)
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %31

25:                                               ; preds = %6
  %26 = fsub <2 x float> %0, %11
  %27 = extractelement <2 x float> %26, i64 0
  %28 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 13)
  %29 = sitofp i32 %28 to float
  %30 = fsub float %27, %29
  %.sroa.028.0.vec.insert31 = insertelement <2 x float> %.sroa.028.4.vec.insert, float %30, i64 0
  br label %31

31:                                               ; preds = %6, %25, %4
  %.sroa.028.0 = phi <2 x float> [ %.sroa.028.0.vec.insert31, %25 ], [ %.sroa.028.4.vec.insert, %6 ], [ zeroinitializer, %4 ]
  %.sroa.8.0 = phi <2 x float> [ %11, %25 ], [ %11, %6 ], [ zeroinitializer, %4 ]
  %.not71 = icmp eq i32 %5, 3
  br i1 %.not71, label %49, label %32

32:                                               ; preds = %31
  %33 = load i8, ptr @_ZL9guiLocked, align 1, !tbaa !9, !range !11, !noundef !12
  %34 = trunc nuw i8 %33 to i1
  br i1 %34, label %49, label %35

35:                                               ; preds = %32
  %36 = tail call <2 x float> @GetMousePosition()
  %37 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 14)
  %38 = icmp eq i32 %37, 0
  %.sroa.028.0.vec.extract = extractelement <2 x float> %.sroa.028.0, i64 0
  %.sroa.045.0.vec.extract50 = extractelement <2 x float> %0, i64 0
  %39 = select i1 %38, float %.sroa.028.0.vec.extract, float %.sroa.045.0.vec.extract50
  %.sroa.023.4.vec.insert = insertelement <2 x float> %0, float %39, i64 0
  %40 = fadd <2 x float> %.sroa.8.0, %1
  %41 = extractelement <2 x float> %40, i64 0
  %42 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 13)
  %43 = sitofp i32 %42 to float
  %44 = fadd float %41, %43
  %.sroa.525.12.vec.insert = insertelement <2 x float> %1, float %44, i64 0
  %45 = tail call zeroext i1 @CheckCollisionPointRec(<2 x float> %36, <2 x float> %.sroa.023.4.vec.insert, <2 x float> %.sroa.525.12.vec.insert)
  br i1 %45, label %46, label %49

46:                                               ; preds = %35
  %47 = tail call zeroext i1 @IsMouseButtonDown(i32 noundef 0)
  %. = select i1 %47, i32 2, i32 1
  %48 = tail call zeroext i1 @IsMouseButtonReleased(i32 noundef 0)
  %spec.select = xor i1 %48, %3
  br label %49

49:                                               ; preds = %46, %35, %32, %31
  %.2 = phi i32 [ %5, %32 ], [ 3, %31 ], [ %5, %35 ], [ %., %46 ]
  %.1 = phi i1 [ %3, %32 ], [ %3, %31 ], [ %3, %35 ], [ %spec.select, %46 ]
  %50 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %51 = mul nsw i32 %.2, 3
  %52 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef %51)
  %53 = tail call i32 @GetColor(i32 noundef %52)
  %54 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !13
  %55 = tail call i32 @Fade(i32 %53, float noundef %54)
  tail call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %0, <2 x float> %1, i32 noundef %50, i32 %55, i32 0)
  br i1 %.1, label %56, label %._crit_edge

._crit_edge:                                      ; preds = %49
  %.pre = add nsw i32 %51, 2
  br label %86

56:                                               ; preds = %49
  %57 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %58 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 16)
  %59 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %60 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 16)
  %61 = insertelement <2 x i32> poison, i32 %57, i64 0
  %62 = insertelement <2 x i32> %61, i32 %59, i64 1
  %63 = sitofp <2 x i32> %62 to <2 x float>
  %64 = fadd <2 x float> %63, %0
  %65 = insertelement <2 x i32> poison, i32 %58, i64 0
  %66 = insertelement <2 x i32> %65, i32 %60, i64 1
  %67 = sitofp <2 x i32> %66 to <2 x float>
  %68 = fadd <2 x float> %64, %67
  %69 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %70 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 16)
  %71 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %72 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 16)
  %73 = insertelement <2 x i32> poison, i32 %70, i64 0
  %74 = insertelement <2 x i32> %73, i32 %72, i64 1
  %75 = insertelement <2 x i32> poison, i32 %69, i64 0
  %76 = insertelement <2 x i32> %75, i32 %71, i64 1
  %77 = add nsw <2 x i32> %74, %76
  %78 = shl nsw <2 x i32> %77, <i32 1, i32 1>
  %79 = sitofp <2 x i32> %78 to <2 x float>
  %80 = fsub <2 x float> %1, %79
  %81 = add nsw i32 %51, 2
  %82 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef %81)
  %83 = tail call i32 @GetColor(i32 noundef %82)
  %84 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !13
  %85 = tail call i32 @Fade(i32 %83, float noundef %84)
  tail call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %68, <2 x float> %80, i32 noundef 0, i32 0, i32 %85)
  br label %86

86:                                               ; preds = %._crit_edge, %56
  %.pre-phi = phi i32 [ %.pre, %._crit_edge ], [ %81, %56 ]
  %87 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 14)
  %88 = icmp eq i32 %87, 2
  %89 = select i1 %88, i32 0, i32 2
  %90 = tail call i32 @GuiGetStyle(i32 noundef 1, i32 noundef %.pre-phi)
  %91 = tail call i32 @GetColor(i32 noundef %90)
  %92 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !13
  %93 = tail call i32 @Fade(i32 %91, float noundef %92)
  tail call void @_ZL11GuiDrawTextPKc9Rectanglei5Color(ptr noundef %2, <2 x float> %.sroa.028.0, <2 x float> %.sroa.8.0, i32 noundef %89, i32 %93)
  ret i1 %.1
}

attributes #0 = { 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 #1 = { 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 #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" }

!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}


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