; LLVM IR from NotManyIdeasDev/double-pendulum-sim :: double-pendulum-sim/Libraries/raygui-2.8/examples/controls_test_suite (GuiCheckBox)

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

@guiState = external hidden global i32, align 4
@guiLocked = external hidden global i8, align 1
@guiAlpha = 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

declare i32 @GetColor(i32 noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @GetTextWidth(ptr noundef) #2

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

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

declare zeroext i1 @IsMouseButtonDown(i32 noundef) #3

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

declare zeroext i1 @IsMouseButtonReleased(i32 noundef) #3

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

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

57:                                               ; preds = %27
  %58 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 0
  %59 = load float, ptr %58, align 4, !tbaa !17
  %60 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 2
  %61 = load float, ptr %60, align 4, !tbaa !13
  %62 = fsub float %59, %61
  %63 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 13)
  %64 = sitofp i32 %63 to float
  %65 = fsub float %62, %64
  %66 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 0
  store float %65, ptr %66, align 4, !tbaa !17
  br label %67

67:                                               ; preds = %57, %27
  br label %68

68:                                               ; preds = %67, %4
  %69 = load i32, ptr %8, align 4, !tbaa !11
  %70 = icmp ne i32 %69, 3
  br i1 %70, label %71, label %121

71:                                               ; preds = %68
  %72 = load i8, ptr @guiLocked, align 1, !tbaa !9, !range !19, !noundef !20
  %73 = trunc i8 %72 to i1
  br i1 %73, label %121, label %74

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

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

82:                                               ; preds = %74
  %83 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 0
  %84 = load float, ptr %83, align 4, !tbaa !17
  br label %85

85:                                               ; preds = %82, %79
  %86 = phi float [ %81, %79 ], [ %84, %82 ]
  store float %86, ptr %76, align 4, !tbaa !17
  %87 = getelementptr inbounds %struct.Rectangle, ptr %11, i32 0, i32 1
  %88 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 1
  %89 = load float, ptr %88, align 4, !tbaa !18
  store float %89, ptr %87, align 4, !tbaa !18
  %90 = getelementptr inbounds %struct.Rectangle, ptr %11, i32 0, i32 2
  %91 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 2
  %92 = load float, ptr %91, align 4, !tbaa !13
  %93 = getelementptr inbounds %struct.Rectangle, ptr %9, i32 0, i32 2
  %94 = load float, ptr %93, align 4, !tbaa !13
  %95 = fadd float %92, %94
  %96 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 13)
  %97 = sitofp i32 %96 to float
  %98 = fadd float %95, %97
  store float %98, ptr %90, align 4, !tbaa !13
  %99 = getelementptr inbounds %struct.Rectangle, ptr %11, i32 0, i32 3
  %100 = getelementptr inbounds %struct.Rectangle, ptr %5, i32 0, i32 3
  %101 = load float, ptr %100, align 4, !tbaa !16
  store float %101, ptr %99, align 4, !tbaa !16
  %102 = load <2 x float>, ptr %10, align 4
  %103 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %11, i32 0, i32 0
  %104 = load <2 x float>, ptr %103, align 4
  %105 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %11, i32 0, i32 1
  %106 = load <2 x float>, ptr %105, align 4
  %107 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %102, <2 x float> %104, <2 x float> %106)
  br i1 %107, label %108, label %120

108:                                              ; preds = %85
  %109 = call zeroext i1 @IsMouseButtonDown(i32 noundef 0)
  br i1 %109, label %110, label %111

110:                                              ; preds = %108
  store i32 2, ptr %8, align 4, !tbaa !11
  br label %112

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

112:                                              ; preds = %111, %110
  %113 = call zeroext i1 @IsMouseButtonReleased(i32 noundef 0)
  br i1 %113, label %114, label %119

114:                                              ; preds = %112
  %115 = load i8, ptr %7, align 1, !tbaa !9, !range !19, !noundef !20
  %116 = trunc i8 %115 to i1
  %117 = xor i1 %116, true
  %118 = zext i1 %117 to i8
  store i8 %118, ptr %7, align 1, !tbaa !9
  br label %119

119:                                              ; preds = %114, %112
  br label %120

120:                                              ; preds = %119, %85
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %121

121:                                              ; preds = %120, %71, %68
  %122 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 12)
  %123 = load i32, ptr %8, align 4, !tbaa !11
  %124 = mul i32 %123, 3
  %125 = add i32 0, %124
  %126 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef %125)
  %127 = call i32 @GetColor(i32 noundef %126)
  store i32 %127, ptr %13, align 1
  %128 = load float, ptr @guiAlpha, align 4, !tbaa !21
  %129 = load i32, ptr %13, align 1
  %130 = call i32 @Fade(i32 %129, float noundef %128)
  store i32 %130, ptr %12, align 1
  %131 = getelementptr inbounds %struct.Color, ptr %14, i32 0, i32 0
  store i8 0, ptr %131, align 1, !tbaa !22
  %132 = getelementptr inbounds %struct.Color, ptr %14, i32 0, i32 1
  store i8 0, ptr %132, align 1, !tbaa !24
  %133 = getelementptr inbounds %struct.Color, ptr %14, i32 0, i32 2
  store i8 0, ptr %133, align 1, !tbaa !25
  %134 = getelementptr inbounds %struct.Color, ptr %14, i32 0, i32 3
  store i8 0, ptr %134, align 1, !tbaa !26
  %135 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  %136 = load <2 x float>, ptr %135, align 4
  %137 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  %138 = load <2 x float>, ptr %137, align 4
  %139 = load i32, ptr %12, align 1
  %140 = load i32, ptr %14, align 1
  call void @GuiDrawRectangle(<2 x float> %136, <2 x float> %138, i32 noundef %122, i32 %139, i32 %140)
  %141 = load i8, ptr %7, align 1, !tbaa !9, !range !19, !noundef !20
  %142 = trunc i8 %141 to i1
  br i1 %142, label %143, label %198

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

198:                                              ; preds = %143, %121
  %199 = load ptr, ptr %6, align 8, !tbaa !5
  %200 = icmp ne ptr %199, null
  br i1 %200, label %201, label %220

201:                                              ; preds = %198
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 14)
  %204 = icmp eq i32 %203, 2
  %205 = zext i1 %204 to i64
  %206 = select i1 %204, i32 0, i32 2
  %207 = load i32, ptr %8, align 4, !tbaa !11
  %208 = mul i32 %207, 3
  %209 = add i32 2, %208
  %210 = call i32 @GuiGetStyle(i32 noundef 1, i32 noundef %209)
  %211 = call i32 @GetColor(i32 noundef %210)
  store i32 %211, ptr %20, align 1
  %212 = load float, ptr @guiAlpha, align 4, !tbaa !21
  %213 = load i32, ptr %20, align 1
  %214 = call i32 @Fade(i32 %213, float noundef %212)
  store i32 %214, ptr %19, align 1
  %215 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %216 = load <2 x float>, ptr %215, align 4
  %217 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %218 = load <2 x float>, ptr %217, align 4
  %219 = load i32, ptr %19, align 1
  call void @GuiDrawText(ptr noundef %202, <2 x float> %216, <2 x float> %218, i32 noundef %206, i32 %219)
  br label %220

220:                                              ; preds = %201, %198
  %221 = load i8, ptr %7, align 1, !tbaa !9, !range !19, !noundef !20
  %222 = trunc i8 %221 to i1
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  ret i1 %222
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !15, i64 8}
!14 = !{!"Rectangle", !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 = !{!15, !15, i64 0}
!22 = !{!23, !7, i64 0}
!23 = !{!"Color", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!24 = !{!23, !7, i64 1}
!25 = !{!23, !7, i64 2}
!26 = !{!23, !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"

@guiState = external hidden local_unnamed_addr global i32, align 4
@guiLocked = external hidden local_unnamed_addr global i8, align 1
@guiAlpha = external hidden local_unnamed_addr global float, align 4

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

; Function Attrs: nounwind uwtable
declare hidden void @GuiDrawRectangle(<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: nounwind uwtable
declare hidden i32 @GetTextWidth(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: nounwind uwtable
declare hidden void @GuiDrawText(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: nounwind 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 @guiState, align 4, !tbaa !5
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %31, label %6

6:                                                ; preds = %4
  %7 = tail call i32 @GetTextWidth(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.019.0.vec.insert = insertelement <2 x float> poison, float %16, i64 0
  %.sroa.037.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.037.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.019.4.vec.insert = insertelement <2 x float> %.sroa.019.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.019.0.vec.insert22 = insertelement <2 x float> %.sroa.019.4.vec.insert, float %30, i64 0
  br label %31

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

32:                                               ; preds = %31
  %33 = load i8, ptr @guiLocked, 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() #3
  %37 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 14)
  %38 = icmp eq i32 %37, 0
  %.sroa.019.0.vec.extract = extractelement <2 x float> %.sroa.019.0, i64 0
  %.sroa.037.0.vec.extract42 = extractelement <2 x float> %0, i64 0
  %39 = select i1 %38, float %.sroa.019.0.vec.extract, float %.sroa.037.0.vec.extract42
  %.sroa.014.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.516.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.014.4.vec.insert, <2 x float> %.sroa.516.12.vec.insert) #3
  br i1 %45, label %46, label %49

46:                                               ; preds = %35
  %47 = tail call zeroext i1 @IsMouseButtonDown(i32 noundef 0) #3
  %. = select i1 %47, i32 2, i32 1
  %48 = tail call zeroext i1 @IsMouseButtonReleased(i32 noundef 0) #3
  %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 i32 %.2, 3
  %52 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef %51)
  %53 = tail call i32 @GetColor(i32 noundef %52) #3
  %54 = load float, ptr @guiAlpha, align 4, !tbaa !13
  %55 = tail call i32 @Fade(i32 %53, float noundef %54) #3
  tail call void @GuiDrawRectangle(<2 x float> %0, <2 x float> %1, i32 noundef %50, i32 %55, i32 0)
  br i1 %.1, label %56, 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 i32 %51, 2
  %82 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef %81)
  %83 = tail call i32 @GetColor(i32 noundef %82) #3
  %84 = load float, ptr @guiAlpha, align 4, !tbaa !13
  %85 = tail call i32 @Fade(i32 %83, float noundef %84) #3
  tail call void @GuiDrawRectangle(<2 x float> %68, <2 x float> %80, i32 noundef 0, i32 0, i32 %85)
  br label %86

86:                                               ; preds = %56, %49
  br i1 %.not, label %96, label %87

87:                                               ; preds = %86
  %88 = tail call i32 @GuiGetStyle(i32 noundef 6, i32 noundef 14)
  %89 = icmp eq i32 %88, 2
  %90 = select i1 %89, i32 0, i32 2
  %91 = add i32 %51, 2
  %92 = tail call i32 @GuiGetStyle(i32 noundef 1, i32 noundef %91)
  %93 = tail call i32 @GetColor(i32 noundef %92) #3
  %94 = load float, ptr @guiAlpha, align 4, !tbaa !13
  %95 = tail call i32 @Fade(i32 %93, float noundef %94) #3
  tail call void @GuiDrawText(ptr noundef nonnull %2, <2 x float> %.sroa.019.0, <2 x float> %.sroa.8.0, i32 noundef %90, i32 %95)
  br label %96

96:                                               ; preds = %87, %86
  ret i1 %.1
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind 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" }
attributes #3 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/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,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass