; 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
@.str.17 = external hidden unnamed_addr constant [6 x i8], align 1

; 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: mustprogress uwtable
declare dso_local void @GuiSetStyle(i32 noundef, i32 noundef, i32 noundef) #2

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

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

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

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

declare i32 @GetColor(i32 noundef) #4

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

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

declare zeroext i1 @IsMouseButtonDown(i32 noundef) #4

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

; Function Attrs: mustprogress uwtable
declare hidden { <2 x float>, <2 x float> } @_ZL13GetTextBoundsi9Rectangle(i32 noundef, <2 x float>, <2 x float>) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL12GuiTextSplitPKcPiS1_(ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local i32 @GuiComboBox(<2 x float> %0, <2 x float> %1, ptr noundef %2, i32 noundef %3) #3 {
  %5 = alloca %struct.Rectangle, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.Rectangle, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %struct.Vector2, align 4
  %13 = alloca %struct.Vector2, align 4
  %14 = alloca %struct.Rectangle, align 4
  %15 = alloca %struct.Vector2, align 4
  %16 = alloca %struct.Rectangle, align 4
  %17 = alloca %struct.Rectangle, align 4
  %18 = alloca %struct.Color, align 1
  %19 = alloca %struct.Color, align 1
  %20 = alloca %struct.Color, align 1
  %21 = alloca %struct.Color, align 1
  %22 = alloca %struct.Rectangle, align 4
  %23 = alloca %struct.Rectangle, align 4
  %24 = alloca %struct.Color, align 1
  %25 = alloca %struct.Color, align 1
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %struct.Rectangle, align 4
  %29 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  store <2 x float> %0, ptr %29, align 4
  %30 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  store <2 x float> %1, ptr %30, align 4
  store ptr %2, ptr %6, align 8, !tbaa !5
  store i32 %3, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %31 = load i32, ptr @_ZL8guiState, align 4, !tbaa !11
  store i32 %31, ptr %8, align 4, !tbaa !11
  %32 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 16)
  %33 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 17)
  %34 = add nsw i32 %32, %33
  %35 = sitofp i32 %34 to float
  %36 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 2
  %37 = load float, ptr %36, align 4, !tbaa !13
  %38 = fsub float %37, %35
  store float %38, ptr %36, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %39 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 0
  %40 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 0
  %41 = load float, ptr %40, align 4, !tbaa !16
  %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 7, i32 noundef 17)
  %46 = sitofp i32 %45 to float
  %47 = fadd float %44, %46
  store float %47, ptr %39, align 4, !tbaa !16
  %48 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 1
  %49 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 1
  %50 = load float, ptr %49, align 4, !tbaa !17
  store float %50, ptr %48, align 4, !tbaa !17
  %51 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 2
  %52 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 16)
  %53 = sitofp i32 %52 to float
  store float %53, ptr %51, align 4, !tbaa !13
  %54 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 3
  %55 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 3
  %56 = load float, ptr %55, align 4, !tbaa !18
  store float %56, ptr %54, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = call noundef ptr @_ZL12GuiTextSplitPKcPiS1_(ptr noundef %57, ptr noundef %10, ptr noundef null)
  store ptr %58, ptr %11, align 8, !tbaa !5
  %59 = load i32, ptr %7, align 4, !tbaa !9
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %4
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %71

62:                                               ; preds = %4
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = sub nsw i32 %64, 1
  %66 = icmp sgt i32 %63, %65
  br i1 %66, label %67, label %70

67:                                               ; preds = %62
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = sub nsw i32 %68, 1
  store i32 %69, ptr %7, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %67, %62
  br label %71

71:                                               ; preds = %70, %61
  %72 = load i32, ptr %8, align 4, !tbaa !11
  %73 = icmp ne i32 %72, 3
  br i1 %73, label %74, label %111

74:                                               ; preds = %71
  %75 = load i8, ptr @_ZL9guiLocked, align 1, !tbaa !19, !range !21, !noundef !22
  %76 = trunc i8 %75 to i1
  br i1 %76, label %111, label %77

77:                                               ; preds = %74
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = icmp sgt i32 %78, 1
  br i1 %79, label %80, label %111

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %81 = call <2 x float> @GetMousePosition()
  store <2 x float> %81, ptr %12, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !23
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %5, i64 16, i1 false), !tbaa.struct !25
  %82 = load <2 x float>, ptr %13, align 4
  %83 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %14, i32 0, i32 0
  %84 = load <2 x float>, ptr %83, align 4
  %85 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %14, i32 0, i32 1
  %86 = load <2 x float>, ptr %85, align 4
  %87 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %82, <2 x float> %84, <2 x float> %86)
  br i1 %87, label %95, label %88

88:                                               ; preds = %80
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %12, i64 8, i1 false), !tbaa.struct !23
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %9, i64 16, i1 false), !tbaa.struct !25
  %89 = load <2 x float>, ptr %15, align 4
  %90 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %16, i32 0, i32 0
  %91 = load <2 x float>, ptr %90, align 4
  %92 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %16, i32 0, i32 1
  %93 = load <2 x float>, ptr %92, align 4
  %94 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %89, <2 x float> %91, <2 x float> %93)
  br i1 %94, label %95, label %110

95:                                               ; preds = %88, %80
  %96 = call zeroext i1 @IsMouseButtonPressed(i32 noundef 0)
  br i1 %96, label %97, label %105

97:                                               ; preds = %95
  %98 = load i32, ptr %7, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %7, align 4, !tbaa !9
  %100 = load i32, ptr %7, align 4, !tbaa !9
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = icmp sge i32 %100, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %97
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %104

104:                                              ; preds = %103, %97
  br label %105

105:                                              ; preds = %104, %95
  %106 = call zeroext i1 @IsMouseButtonDown(i32 noundef 0)
  br i1 %106, label %107, label %108

107:                                              ; preds = %105
  store i32 2, ptr %8, align 4, !tbaa !11
  br label %109

108:                                              ; preds = %105
  store i32 1, ptr %8, align 4, !tbaa !11
  br label %109

109:                                              ; preds = %108, %107
  br label %110

110:                                              ; preds = %109, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %111

111:                                              ; preds = %110, %77, %74, %71
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %5, i64 16, i1 false), !tbaa.struct !25
  %112 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 12)
  %113 = load i32, ptr %8, align 4, !tbaa !11
  %114 = mul nsw i32 %113, 3
  %115 = add nsw i32 0, %114
  %116 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef %115)
  %117 = call i32 @GetColor(i32 noundef %116)
  store i32 %117, ptr %19, align 1
  %118 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !24
  %119 = load i32, ptr %19, align 1
  %120 = call i32 @Fade(i32 %119, float noundef %118)
  store i32 %120, ptr %18, align 1
  %121 = load i32, ptr %8, align 4, !tbaa !11
  %122 = mul nsw i32 %121, 3
  %123 = add nsw i32 1, %122
  %124 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef %123)
  %125 = call i32 @GetColor(i32 noundef %124)
  store i32 %125, ptr %21, align 1
  %126 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !24
  %127 = load i32, ptr %21, align 1
  %128 = call i32 @Fade(i32 %127, float noundef %126)
  store i32 %128, ptr %20, align 1
  %129 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %17, i32 0, i32 0
  %130 = load <2 x float>, ptr %129, align 4
  %131 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %17, i32 0, i32 1
  %132 = load <2 x float>, ptr %131, align 4
  %133 = load i32, ptr %18, align 1
  %134 = load i32, ptr %20, align 1
  call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %130, <2 x float> %132, i32 noundef %112, i32 %133, i32 %134)
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = load i32, ptr %7, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds ptr, ptr %135, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %5, i64 16, i1 false), !tbaa.struct !25
  %140 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %23, i32 0, i32 0
  %141 = load <2 x float>, ptr %140, align 4
  %142 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %23, i32 0, i32 1
  %143 = load <2 x float>, ptr %142, align 4
  %144 = call { <2 x float>, <2 x float> } @_ZL13GetTextBoundsi9Rectangle(i32 noundef 7, <2 x float> %141, <2 x float> %143)
  %145 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %22, i32 0, i32 0
  %146 = extractvalue { <2 x float>, <2 x float> } %144, 0
  store <2 x float> %146, ptr %145, align 4
  %147 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %22, i32 0, i32 1
  %148 = extractvalue { <2 x float>, <2 x float> } %144, 1
  store <2 x float> %148, ptr %147, align 4
  %149 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 14)
  %150 = load i32, ptr %8, align 4, !tbaa !11
  %151 = mul nsw i32 %150, 3
  %152 = add nsw i32 2, %151
  %153 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef %152)
  %154 = call i32 @GetColor(i32 noundef %153)
  store i32 %154, ptr %25, align 1
  %155 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !24
  %156 = load i32, ptr %25, align 1
  %157 = call i32 @Fade(i32 %156, float noundef %155)
  store i32 %157, ptr %24, align 1
  %158 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %22, i32 0, i32 0
  %159 = load <2 x float>, ptr %158, align 4
  %160 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %22, i32 0, i32 1
  %161 = load <2 x float>, ptr %160, align 4
  %162 = load i32, ptr %24, align 1
  call void @_ZL11GuiDrawTextPKc9Rectanglei5Color(ptr noundef %139, <2 x float> %159, <2 x float> %161, i32 noundef %149, i32 %162)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %163 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 12)
  store i32 %163, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %164 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 14)
  store i32 %164, ptr %27, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef 1)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %9, i64 16, i1 false), !tbaa.struct !25
  %165 = load i32, ptr %7, align 4, !tbaa !9
  %166 = add nsw i32 %165, 1
  %167 = load i32, ptr %10, align 4, !tbaa !9
  %168 = call ptr (ptr, ...) @TextFormat(ptr noundef @.str.17, i32 noundef %166, i32 noundef %167)
  %169 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %28, i32 0, i32 0
  %170 = load <2 x float>, ptr %169, align 4
  %171 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %28, i32 0, i32 1
  %172 = load <2 x float>, ptr %171, align 4
  %173 = call zeroext i1 @GuiButton(<2 x float> %170, <2 x float> %172, ptr noundef %168)
  %174 = load i32, ptr %27, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef %174)
  %175 = load i32, ptr %26, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef %175)
  %176 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  ret i32 %176
}

declare zeroext i1 @IsMouseButtonPressed(i32 noundef) #4

declare ptr @TextFormat(ptr noundef, ...) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 = { 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 = { 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 = !{!"_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 0}
!17 = !{!14, !15, i64 4}
!18 = !{!14, !15, i64 12}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24}
!24 = !{!15, !15, 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
@.str.17 = external hidden unnamed_addr constant [6 x i8], align 1

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

; 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
declare hidden { <2 x float>, <2 x float> } @_ZL13GetTextBoundsi9Rectangle(i32 noundef, <2 x float>, <2 x float>) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL12GuiTextSplitPKcPiS1_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local i32 @GuiComboBox(<2 x float> %0, <2 x float> %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = alloca i32, align 4
  %6 = load i32, ptr @_ZL8guiState, align 4, !tbaa !5
  %7 = tail call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 16)
  %8 = tail call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 17)
  %9 = add nsw i32 %8, %7
  %10 = sitofp i32 %9 to float
  %.sroa.644.8.vec.extract = extractelement <2 x float> %1, i64 0
  %11 = fsub float %.sroa.644.8.vec.extract, %10
  %.sroa.644.8.vec.insert = insertelement <2 x float> %1, float %11, i64 0
  %.sroa.040.0.vec.extract = extractelement <2 x float> %0, i64 0
  %12 = fadd float %.sroa.040.0.vec.extract, %11
  %13 = tail call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 17)
  %14 = sitofp i32 %13 to float
  %15 = fadd float %12, %14
  %.sroa.023.4.vec.insert = insertelement <2 x float> %0, float %15, i64 0
  %16 = tail call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 16)
  %17 = sitofp i32 %16 to float
  %.sroa.6.12.vec.insert = insertelement <2 x float> %1, float %17, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  %18 = call noundef ptr @_ZL12GuiTextSplitPKcPiS1_(ptr noundef %2, ptr noundef nonnull %5, ptr noundef null)
  %19 = icmp slt i32 %3, 0
  %20 = load i32, ptr %5, align 4
  %.not57 = icmp sgt i32 %20, %3
  %21 = add nsw i32 %20, -1
  %spec.select = select i1 %.not57, i32 %3, i32 %21
  %.0 = select i1 %19, i32 0, i32 %spec.select
  %.not58 = icmp eq i32 %6, 3
  br i1 %.not58, label %36, label %22

22:                                               ; preds = %4
  %23 = load i8, ptr @_ZL9guiLocked, align 1, !tbaa !11, !range !13, !noundef !14
  %24 = trunc nuw i8 %23 to i1
  %25 = icmp slt i32 %20, 2
  %or.cond.not = select i1 %24, i1 true, i1 %25
  br i1 %or.cond.not, label %36, label %26

26:                                               ; preds = %22
  %27 = call <2 x float> @GetMousePosition()
  %28 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %27, <2 x float> %0, <2 x float> %.sroa.644.8.vec.insert)
  br i1 %28, label %31, label %29

29:                                               ; preds = %26
  %30 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %27, <2 x float> %.sroa.023.4.vec.insert, <2 x float> %.sroa.6.12.vec.insert)
  br i1 %30, label %31, label %36

31:                                               ; preds = %29, %26
  %32 = call zeroext i1 @IsMouseButtonPressed(i32 noundef 0)
  %33 = add nsw i32 %.0, 1
  %34 = load i32, ptr %5, align 4
  %.not = icmp slt i32 %33, %34
  %spec.store.select = select i1 %.not, i32 %33, i32 0
  %.1 = select i1 %32, i32 %spec.store.select, i32 %.0
  %35 = call zeroext i1 @IsMouseButtonDown(i32 noundef 0)
  %spec.select60 = select i1 %35, i32 2, i32 1
  br label %36

36:                                               ; preds = %31, %29, %22, %4
  %.152 = phi i32 [ %6, %22 ], [ 3, %4 ], [ %6, %29 ], [ %spec.select60, %31 ]
  %.3 = phi i32 [ %.0, %22 ], [ %.0, %4 ], [ %.0, %29 ], [ %.1, %31 ]
  %37 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 12)
  %38 = mul nsw i32 %.152, 3
  %39 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef %38)
  %40 = call i32 @GetColor(i32 noundef %39)
  %41 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !15
  %42 = call i32 @Fade(i32 %40, float noundef %41)
  %43 = add nsw i32 %38, 1
  %44 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef %43)
  %45 = call i32 @GetColor(i32 noundef %44)
  %46 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !15
  %47 = call i32 @Fade(i32 %45, float noundef %46)
  call void @_ZL16GuiDrawRectangle9Rectanglei5ColorS0_(<2 x float> %0, <2 x float> %.sroa.644.8.vec.insert, i32 noundef %37, i32 %42, i32 %47)
  %48 = sext i32 %.3 to i64
  %49 = getelementptr inbounds ptr, ptr %18, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !17
  %51 = call { <2 x float>, <2 x float> } @_ZL13GetTextBoundsi9Rectangle(i32 noundef 7, <2 x float> %0, <2 x float> %.sroa.644.8.vec.insert)
  %52 = extractvalue { <2 x float>, <2 x float> } %51, 0
  %53 = extractvalue { <2 x float>, <2 x float> } %51, 1
  %54 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef 14)
  %55 = add nsw i32 %38, 2
  %56 = call i32 @GuiGetStyle(i32 noundef 7, i32 noundef %55)
  %57 = call i32 @GetColor(i32 noundef %56)
  %58 = load float, ptr @_ZL8guiAlpha, align 4, !tbaa !15
  %59 = call i32 @Fade(i32 %57, float noundef %58)
  call void @_ZL11GuiDrawTextPKc9Rectanglei5Color(ptr noundef %50, <2 x float> %52, <2 x float> %53, i32 noundef %54, i32 %59)
  %60 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 12)
  %61 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 14)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef 1)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef 1)
  %62 = add nsw i32 %.3, 1
  %63 = load i32, ptr %5, align 4, !tbaa !9
  %64 = call ptr (ptr, ...) @TextFormat(ptr noundef nonnull @.str.17, i32 noundef %62, i32 noundef %63)
  %65 = call zeroext i1 @GuiButton(<2 x float> %.sroa.023.4.vec.insert, <2 x float> %.sroa.6.12.vec.insert, ptr noundef %64)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef %61)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef %60)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  ret i32 %.3
}

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

declare ptr @TextFormat(ptr noundef, ...) local_unnamed_addr #3

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 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!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}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}


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