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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @GuiButton(<2 x float>, <2 x float>, ptr noundef) #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

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

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

118:                                              ; preds = %88
  %119 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 0
  %120 = load float, ptr %119, align 4, !tbaa !13
  %121 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 2
  %122 = load float, ptr %121, align 4, !tbaa !17
  %123 = fsub float %120, %122
  %124 = call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 13)
  %125 = sitofp i32 %124 to float
  %126 = fsub float %123, %125
  %127 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 0
  store float %126, ptr %127, align 4, !tbaa !13
  br label %128

128:                                              ; preds = %118, %88
  br label %129

129:                                              ; preds = %128, %7
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = icmp ne i32 %130, 3
  br i1 %131, label %132, label %149

132:                                              ; preds = %129
  %133 = load i8, ptr @guiLocked, align 1, !tbaa !11, !range !19, !noundef !20
  %134 = trunc i8 %133 to i1
  br i1 %134, label %149, label %135

135:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %136 = call <2 x float> @GetMousePosition()
  store <2 x float> %136, ptr %21, align 4
  %137 = load <2 x float>, ptr %21, align 4
  %138 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  %139 = load <2 x float>, ptr %138, align 4
  %140 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  %141 = load <2 x float>, ptr %140, align 4
  %142 = call zeroext i1 @CheckCollisionPointRec(<2 x float> %137, <2 x float> %139, <2 x float> %141)
  br i1 %142, label %143, label %148

143:                                              ; preds = %135
  %144 = call zeroext i1 @IsMouseButtonDown(i32 noundef 0)
  br i1 %144, label %145, label %146

145:                                              ; preds = %143
  store i32 2, ptr %14, align 4, !tbaa !9
  br label %147

146:                                              ; preds = %143
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %147

147:                                              ; preds = %146, %145
  br label %148

148:                                              ; preds = %147, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %149

149:                                              ; preds = %148, %132, %129
  %150 = load i8, ptr %13, align 1, !tbaa !11, !range !19, !noundef !20
  %151 = trunc i8 %150 to i1
  br i1 %151, label %165, label %152

152:                                              ; preds = %149
  %153 = load i32, ptr %16, align 4, !tbaa !9
  %154 = load i32, ptr %11, align 4, !tbaa !9
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %156, label %158

156:                                              ; preds = %152
  %157 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %157, ptr %16, align 4, !tbaa !9
  br label %158

158:                                              ; preds = %156, %152
  %159 = load i32, ptr %16, align 4, !tbaa !9
  %160 = load i32, ptr %12, align 4, !tbaa !9
  %161 = icmp sgt i32 %159, %160
  br i1 %161, label %162, label %164

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

164:                                              ; preds = %162, %158
  br label %165

165:                                              ; preds = %164, %149
  %166 = load i32, ptr %11, align 4, !tbaa !9
  %167 = load i32, ptr %12, align 4, !tbaa !9
  %168 = load i8, ptr %13, align 1, !tbaa !11, !range !19, !noundef !20
  %169 = trunc i8 %168 to i1
  %170 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %17, i32 0, i32 0
  %171 = load <2 x float>, ptr %170, align 4
  %172 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %17, i32 0, i32 1
  %173 = load <2 x float>, ptr %172, align 4
  %174 = call zeroext i1 @GuiValueBox(<2 x float> %171, <2 x float> %173, ptr noundef null, ptr noundef %16, i32 noundef %166, i32 noundef %167, i1 noundef zeroext %169)
  %175 = zext i1 %174 to i8
  store i8 %175, ptr %15, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %176 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 12)
  store i32 %176, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %177 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 14)
  store i32 %177, ptr %23, align 4, !tbaa !9
  %178 = call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 12)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef %178)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef 1)
  %179 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %18, i32 0, i32 0
  %180 = load <2 x float>, ptr %179, align 4
  %181 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %18, i32 0, i32 1
  %182 = load <2 x float>, ptr %181, align 4
  %183 = call zeroext i1 @GuiButton(<2 x float> %180, <2 x float> %182, ptr noundef @.str.2)
  br i1 %183, label %184, label %187

184:                                              ; preds = %165
  %185 = load i32, ptr %16, align 4, !tbaa !9
  %186 = add nsw i32 %185, -1
  store i32 %186, ptr %16, align 4, !tbaa !9
  br label %187

187:                                              ; preds = %184, %165
  %188 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %19, i32 0, i32 0
  %189 = load <2 x float>, ptr %188, align 4
  %190 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %19, i32 0, i32 1
  %191 = load <2 x float>, ptr %190, align 4
  %192 = call zeroext i1 @GuiButton(<2 x float> %189, <2 x float> %191, ptr noundef @.str.3)
  br i1 %192, label %193, label %196

193:                                              ; preds = %187
  %194 = load i32, ptr %16, align 4, !tbaa !9
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %16, align 4, !tbaa !9
  br label %196

196:                                              ; preds = %193, %187
  %197 = load i32, ptr %23, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef %197)
  %198 = load i32, ptr %22, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef %198)
  %199 = load ptr, ptr %9, align 8, !tbaa !5
  %200 = icmp ne ptr %199, null
  br i1 %200, label %201, label %220

201:                                              ; preds = %196
  %202 = load ptr, ptr %9, align 8, !tbaa !5
  %203 = call i32 @GuiGetStyle(i32 noundef 11, 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 %14, align 4, !tbaa !9
  %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 %25, align 1
  %212 = load float, ptr @guiAlpha, align 4, !tbaa !21
  %213 = load i32, ptr %25, align 1
  %214 = call i32 @Fade(i32 %213, float noundef %212)
  store i32 %214, ptr %24, align 1
  %215 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %20, i32 0, i32 0
  %216 = load <2 x float>, ptr %215, align 4
  %217 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %20, i32 0, i32 1
  %218 = load <2 x float>, ptr %217, align 4
  %219 = load i32, ptr %24, 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, %196
  %221 = load i32, ptr %16, align 4, !tbaa !9
  %222 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %221, ptr %222, align 4, !tbaa !9
  %223 = load i8, ptr %15, align 1, !tbaa !11, !range !19, !noundef !20
  %224 = trunc i8 %223 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  ret i1 %224
}

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"Rectangle", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12}
!15 = !{!"float", !7, i64 0}
!16 = !{!14, !15, i64 4}
!17 = !{!14, !15, i64 8}
!18 = !{!14, !15, i64 12}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!15, !15, i64 0}


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

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

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

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

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

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

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

declare i32 @GetColor(i32 noundef) local_unnamed_addr #3

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

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: nounwind uwtable
declare hidden void @GuiDrawText(ptr noundef, <2 x float>, <2 x float>, i32 noundef, i32) local_unnamed_addr #2

; Function Attrs: nounwind 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 @guiState, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %10 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %10, ptr %8, align 4, !tbaa !5
  %.sroa.037.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.037.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.017.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.519.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.515.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.010.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.037.4.vec.extract = extractelement <2 x float> %0, i64 1
  %33 = tail call i32 @GetTextWidth(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.04.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.037.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.04.4.vec.insert = insertelement <2 x float> %.sroa.04.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.04.0.vec.insert7 = insertelement <2 x float> %.sroa.04.4.vec.insert, float %54, i64 0
  br label %55

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

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

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

62:                                               ; preds = %59
  %63 = tail call zeroext i1 @IsMouseButtonDown(i32 noundef 0) #5
  %. = 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
  %.not71 = icmp slt i32 %10, %4
  %65 = tail call i32 @llvm.smax.i32(i32 %10, i32 %4)
  %.not72 = icmp sgt i32 %65, %5
  %66 = or i1 %.not71, %.not72
  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 !5
  br label %68

68:                                               ; preds = %67, %condstore.split, %64
  %69 = call zeroext i1 @GuiValueBox(<2 x float> %.sroa.017.4.vec.insert, <2 x float> %.sroa.519.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 zeroext i1 @GuiButton(<2 x float> %0, <2 x float> %.sroa.515.12.vec.insert, ptr noundef nonnull @.str.2)
  br i1 %73, label %74, label %77

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

77:                                               ; preds = %74, %68
  %78 = call zeroext i1 @GuiButton(<2 x float> %.sroa.010.4.vec.insert, <2 x float> %.sroa.5.12.vec.insert, ptr noundef nonnull @.str.3)
  br i1 %78, label %79, label %82

79:                                               ; preds = %77
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %8, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %79, %77
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef %71)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 12, i32 noundef %70)
  br i1 %.not, label %93, label %83

83:                                               ; preds = %82
  %84 = call i32 @GuiGetStyle(i32 noundef 11, i32 noundef 14)
  %85 = icmp eq i32 %84, 2
  %86 = select i1 %85, i32 0, i32 2
  %87 = mul i32 %.1, 3
  %88 = add i32 %87, 2
  %89 = call i32 @GuiGetStyle(i32 noundef 1, i32 noundef %88)
  %90 = call i32 @GetColor(i32 noundef %89) #5
  %91 = load float, ptr @guiAlpha, align 4, !tbaa !13
  %92 = call i32 @Fade(i32 %90, float noundef %91) #5
  call void @GuiDrawText(ptr noundef nonnull %2, <2 x float> %.sroa.04.0, <2 x float> %.sroa.7.0, i32 noundef %86, i32 %92)
  br label %93

93:                                               ; preds = %83, %82
  %94 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %94, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  ret i1 %69
}

; Function Attrs: nounwind 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) #4

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nosync nounwind speculatable willreturn memory(none) }
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 = !{!"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,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass