; 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.Font = type { i32, i32, i32, %struct.Texture, ptr, ptr }
%struct.Texture = type { i32, i32, i32, i32, i32 }
%struct.Rectangle = type { float, float, float, float }
%struct.Vector2 = type { float, float }

@_ZL7guiFont = external hidden global %struct.Font, align 8
@_ZZ15GuiTextInputBoxE12textEditMode = external hidden global 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

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

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

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

declare <2 x float> @MeasureTextEx(ptr noundef byval(%struct.Font) align 8, ptr noundef, float noundef, float noundef) #5

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @GuiTextInputBox(<2 x float> %0, <2 x float> %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #4 {
  %7 = alloca %struct.Rectangle, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %struct.Rectangle, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.Rectangle, align 4
  %18 = alloca %struct.Vector2, align 4
  %19 = alloca %struct.Font, align 8
  %20 = alloca %struct.Rectangle, align 4
  %21 = alloca %struct.Rectangle, align 4
  %22 = alloca i32, align 4
  %23 = alloca %struct.Rectangle, align 4
  %24 = alloca %struct.Rectangle, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %struct.Rectangle, align 4
  %28 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 0
  store <2 x float> %0, ptr %28, align 4
  %29 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 1
  store <2 x float> %1, ptr %29, align 4
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  store ptr %5, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 -1, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = call noundef ptr @_ZL12GuiTextSplitPKcPiS1_(ptr noundef %30, ptr noundef %13, ptr noundef null)
  store ptr %31, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  call void @llvm.memset.p0.i64(ptr align 4 %15, i8 0, i64 16, i1 false)
  %32 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 0
  %33 = load float, ptr %32, align 4, !tbaa !11
  %34 = fadd float %33, 1.000000e+01
  %35 = getelementptr inbounds %struct.Rectangle, ptr %15, i32 0, i32 0
  store float %34, ptr %35, align 4, !tbaa !11
  %36 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 1
  %37 = load float, ptr %36, align 4, !tbaa !14
  %38 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 3
  %39 = load float, ptr %38, align 4, !tbaa !15
  %40 = fadd float %37, %39
  %41 = fsub float %40, 2.400000e+01
  %42 = fsub float %41, 1.000000e+01
  %43 = getelementptr inbounds %struct.Rectangle, ptr %15, i32 0, i32 1
  store float %42, ptr %43, align 4, !tbaa !14
  %44 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 2
  %45 = load float, ptr %44, align 4, !tbaa !16
  %46 = load i32, ptr %13, align 4, !tbaa !9
  %47 = add nsw i32 %46, 1
  %48 = mul nsw i32 10, %47
  %49 = sitofp i32 %48 to float
  %50 = fsub float %45, %49
  %51 = load i32, ptr %13, align 4, !tbaa !9
  %52 = sitofp i32 %51 to float
  %53 = fdiv float %50, %52
  %54 = getelementptr inbounds %struct.Rectangle, ptr %15, i32 0, i32 2
  store float %53, ptr %54, align 4, !tbaa !16
  %55 = getelementptr inbounds %struct.Rectangle, ptr %15, i32 0, i32 3
  store float 2.400000e+01, ptr %55, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %56 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 3
  %57 = load float, ptr %56, align 4, !tbaa !15
  %58 = fptosi float %57 to i32
  %59 = sub nsw i32 %58, 22
  %60 = call i32 @GuiGetStyle(i32 noundef 15, i32 noundef 12)
  %61 = sub nsw i32 %59, %60
  %62 = sub nsw i32 %61, 24
  %63 = sub nsw i32 %62, 20
  store i32 %63, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  call void @llvm.memset.p0.i64(ptr align 4 %17, i8 0, i64 16, i1 false)
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %100

66:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 @_ZL7guiFont, i64 48, i1 false), !tbaa.struct !17
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %69 = sitofp i32 %68 to float
  %70 = call <2 x float> @MeasureTextEx(ptr noundef byval(%struct.Font) align 8 %19, ptr noundef %67, float noundef %69, float noundef 1.000000e+00)
  store <2 x float> %70, ptr %18, align 4
  %71 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 0
  %72 = load float, ptr %71, align 4, !tbaa !11
  %73 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 2
  %74 = load float, ptr %73, align 4, !tbaa !16
  %75 = fdiv float %74, 2.000000e+00
  %76 = fadd float %72, %75
  %77 = getelementptr inbounds %struct.Vector2, ptr %18, i32 0, i32 0
  %78 = load float, ptr %77, align 4, !tbaa !18
  %79 = fdiv float %78, 2.000000e+00
  %80 = fsub float %76, %79
  %81 = getelementptr inbounds %struct.Rectangle, ptr %17, i32 0, i32 0
  store float %80, ptr %81, align 4, !tbaa !11
  %82 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 1
  %83 = load float, ptr %82, align 4, !tbaa !14
  %84 = fadd float %83, 2.200000e+01
  %85 = load i32, ptr %16, align 4, !tbaa !9
  %86 = sdiv i32 %85, 4
  %87 = sitofp i32 %86 to float
  %88 = fadd float %84, %87
  %89 = getelementptr inbounds %struct.Vector2, ptr %18, i32 0, i32 1
  %90 = load float, ptr %89, align 4, !tbaa !20
  %91 = fdiv float %90, 2.000000e+00
  %92 = fsub float %88, %91
  %93 = getelementptr inbounds %struct.Rectangle, ptr %17, i32 0, i32 1
  store float %92, ptr %93, align 4, !tbaa !14
  %94 = getelementptr inbounds %struct.Vector2, ptr %18, i32 0, i32 0
  %95 = load float, ptr %94, align 4, !tbaa !18
  %96 = getelementptr inbounds %struct.Rectangle, ptr %17, i32 0, i32 2
  store float %95, ptr %96, align 4, !tbaa !16
  %97 = getelementptr inbounds %struct.Vector2, ptr %18, i32 0, i32 1
  %98 = load float, ptr %97, align 4, !tbaa !20
  %99 = getelementptr inbounds %struct.Rectangle, ptr %17, i32 0, i32 3
  store float %98, ptr %99, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %100

100:                                              ; preds = %66, %6
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  call void @llvm.memset.p0.i64(ptr align 4 %20, i8 0, i64 16, i1 false)
  %101 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 0
  %102 = load float, ptr %101, align 4, !tbaa !11
  %103 = fadd float %102, 1.000000e+01
  %104 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 0
  store float %103, ptr %104, align 4, !tbaa !11
  %105 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 1
  %106 = load float, ptr %105, align 4, !tbaa !14
  %107 = fadd float %106, 2.200000e+01
  %108 = fsub float %107, 1.500000e+01
  %109 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 1
  store float %108, ptr %109, align 4, !tbaa !14
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = icmp eq ptr %110, null
  br i1 %111, label %112, label %119

112:                                              ; preds = %100
  %113 = load i32, ptr %16, align 4, !tbaa !9
  %114 = sdiv i32 %113, 2
  %115 = sitofp i32 %114 to float
  %116 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 1
  %117 = load float, ptr %116, align 4, !tbaa !14
  %118 = fadd float %117, %115
  store float %118, ptr %116, align 4, !tbaa !14
  br label %129

119:                                              ; preds = %100
  %120 = load i32, ptr %16, align 4, !tbaa !9
  %121 = sdiv i32 %120, 2
  %122 = load i32, ptr %16, align 4, !tbaa !9
  %123 = sdiv i32 %122, 4
  %124 = add nsw i32 %121, %123
  %125 = sitofp i32 %124 to float
  %126 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 1
  %127 = load float, ptr %126, align 4, !tbaa !14
  %128 = fadd float %127, %125
  store float %128, ptr %126, align 4, !tbaa !14
  br label %129

129:                                              ; preds = %119, %112
  %130 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 2
  %131 = load float, ptr %130, align 4, !tbaa !16
  %132 = fsub float %131, 2.000000e+01
  %133 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 2
  store float %132, ptr %133, align 4, !tbaa !16
  %134 = getelementptr inbounds %struct.Rectangle, ptr %20, i32 0, i32 3
  store float 3.000000e+01, ptr %134, align 4, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !21
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %21, i32 0, i32 0
  %137 = load <2 x float>, ptr %136, align 4
  %138 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %21, i32 0, i32 1
  %139 = load <2 x float>, ptr %138, align 4
  %140 = call zeroext i1 @GuiWindowBox(<2 x float> %137, <2 x float> %139, ptr noundef %135)
  br i1 %140, label %141, label %142

141:                                              ; preds = %129
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %142

142:                                              ; preds = %141, %129
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %153

145:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %146 = call i32 @GuiGetStyle(i32 noundef 1, i32 noundef 14)
  store i32 %146, ptr %22, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 1, i32 noundef 14, i32 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %17, i64 16, i1 false), !tbaa.struct !21
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %23, i32 0, i32 0
  %149 = load <2 x float>, ptr %148, align 4
  %150 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %23, i32 0, i32 1
  %151 = load <2 x float>, ptr %150, align 4
  call void @GuiLabel(<2 x float> %149, <2 x float> %151, ptr noundef %147)
  %152 = load i32, ptr %22, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 1, i32 noundef 14, i32 noundef %152)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %153

153:                                              ; preds = %145, %142
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %20, i64 16, i1 false), !tbaa.struct !21
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  %155 = load i8, ptr @_ZZ15GuiTextInputBoxE12textEditMode, align 1, !tbaa !23, !range !25, !noundef !26
  %156 = trunc i8 %155 to i1
  %157 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %24, i32 0, i32 0
  %158 = load <2 x float>, ptr %157, align 4
  %159 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %24, i32 0, i32 1
  %160 = load <2 x float>, ptr %159, align 4
  %161 = call zeroext i1 @GuiTextBox(<2 x float> %158, <2 x float> %160, ptr noundef %154, i32 noundef 256, i1 noundef zeroext %156)
  br i1 %161, label %162, label %167

162:                                              ; preds = %153
  %163 = load i8, ptr @_ZZ15GuiTextInputBoxE12textEditMode, align 1, !tbaa !23, !range !25, !noundef !26
  %164 = trunc i8 %163 to i1
  %165 = xor i1 %164, true
  %166 = zext i1 %165 to i8
  store i8 %166, ptr @_ZZ15GuiTextInputBoxE12textEditMode, align 1, !tbaa !23
  br label %167

167:                                              ; preds = %162, %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %168 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 14)
  store i32 %168, ptr %25, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %169

169:                                              ; preds = %195, %167
  %170 = load i32, ptr %26, align 4, !tbaa !9
  %171 = load i32, ptr %13, align 4, !tbaa !9
  %172 = icmp slt i32 %170, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %198

174:                                              ; preds = %169
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %15, i64 16, i1 false), !tbaa.struct !21
  %175 = load ptr, ptr %14, align 8, !tbaa !5
  %176 = load i32, ptr %26, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds ptr, ptr %175, i64 %177
  %179 = load ptr, ptr %178, align 8, !tbaa !5
  %180 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 0
  %181 = load <2 x float>, ptr %180, align 4
  %182 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %27, i32 0, i32 1
  %183 = load <2 x float>, ptr %182, align 4
  %184 = call zeroext i1 @GuiButton(<2 x float> %181, <2 x float> %183, ptr noundef %179)
  br i1 %184, label %185, label %188

185:                                              ; preds = %174
  %186 = load i32, ptr %26, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %12, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %185, %174
  %189 = getelementptr inbounds %struct.Rectangle, ptr %15, i32 0, i32 2
  %190 = load float, ptr %189, align 4, !tbaa !16
  %191 = fadd float %190, 1.000000e+01
  %192 = getelementptr inbounds %struct.Rectangle, ptr %15, i32 0, i32 0
  %193 = load float, ptr %192, align 4, !tbaa !11
  %194 = fadd float %193, %191
  store float %194, ptr %192, align 4, !tbaa !11
  br label %195

195:                                              ; preds = %188
  %196 = load i32, ptr %26, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %26, align 4, !tbaa !9
  br label %169, !llvm.loop !27

198:                                              ; preds = %173
  %199 = load i32, ptr %25, align 4, !tbaa !9
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef %199)
  %200 = load i32, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  ret i32 %200
}

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 = { 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 #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS9Rectangle", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = !{!12, !13, i64 12}
!16 = !{!12, !13, i64 8}
!17 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 4, !9, i64 20, i64 4, !9, i64 24, i64 4, !9, i64 28, i64 4, !9, i64 32, i64 8, !5, i64 40, i64 8, !5}
!18 = !{!19, !13, i64 0}
!19 = !{!"_ZTS7Vector2", !13, i64 0, !13, i64 4}
!20 = !{!19, !13, i64 4}
!21 = !{i64 0, i64 4, !22, i64 4, i64 4, !22, i64 8, i64 4, !22, i64 12, i64 4, !22}
!22 = !{!13, !13, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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

%struct.Font = type { i32, i32, i32, %struct.Texture, ptr, ptr }
%struct.Texture = type { i32, i32, i32, i32, i32 }

@_ZL7guiFont = external hidden local_unnamed_addr global %struct.Font, align 8
@_ZZ15GuiTextInputBoxE12textEditMode = external hidden local_unnamed_addr global 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 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: 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 #2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @GuiLabel(<2 x float>, <2 x float>, ptr noundef) local_unnamed_addr #3

declare <2 x float> @MeasureTextEx(ptr noundef byval(%struct.Font) align 8, ptr noundef, float noundef, float noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @GuiTextInputBox(<2 x float> %0, <2 x float> %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #3 {
  %7 = alloca i32, align 4
  %8 = alloca %struct.Font, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  %9 = call noundef ptr @_ZL12GuiTextSplitPKcPiS1_(ptr noundef %4, ptr noundef nonnull %7, ptr noundef null)
  %.sroa.050.0.vec.extract = extractelement <2 x float> %0, i64 0
  %10 = fadd float %.sroa.050.0.vec.extract, 1.000000e+01
  %.sroa.034.0.vec.insert = insertelement <2 x float> <float poison, float 0.000000e+00>, float %10, i64 0
  %.sroa.050.4.vec.extract = extractelement <2 x float> %0, i64 1
  %.sroa.860.12.vec.extract = extractelement <2 x float> %1, i64 1
  %11 = fadd float %.sroa.050.4.vec.extract, %.sroa.860.12.vec.extract
  %12 = fadd float %11, -2.400000e+01
  %13 = fadd float %12, -1.000000e+01
  %.sroa.034.4.vec.insert = insertelement <2 x float> %.sroa.034.0.vec.insert, float %13, i64 1
  %.sroa.860.8.vec.extract = extractelement <2 x float> %1, i64 0
  %14 = load i32, ptr %7, align 4, !tbaa !5
  %15 = mul i32 %14, 10
  %16 = add i32 %15, 10
  %17 = sitofp i32 %16 to float
  %18 = fsub float %.sroa.860.8.vec.extract, %17
  %19 = sitofp i32 %14 to float
  %20 = fdiv float %18, %19
  %.sroa.8.12.vec.insert = insertelement <2 x float> <float poison, float 2.400000e+01>, float %20, i64 0
  %21 = fptosi float %.sroa.860.12.vec.extract to i32
  %22 = call i32 @GuiGetStyle(i32 noundef 15, i32 noundef 12)
  %23 = add i32 %21, -66
  %24 = sub i32 %23, %22
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %25, label %28

25:                                               ; preds = %6
  %26 = fadd float %.sroa.050.4.vec.extract, 2.200000e+01
  %27 = sdiv i32 %24, 2
  br label %45

28:                                               ; preds = %6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(48) @_ZL7guiFont, i64 48, i1 false), !tbaa.struct !9
  %29 = call i32 @GuiGetStyle(i32 noundef 0, i32 noundef 16)
  %30 = sitofp i32 %29 to float
  %31 = call <2 x float> @MeasureTextEx(ptr noundef nonnull byval(%struct.Font) align 8 %8, ptr noundef nonnull %3, float noundef %30, float noundef 1.000000e+00)
  %32 = shufflevector <2 x float> %1, <2 x float> %0, <2 x i32> <i32 0, i32 3>
  %33 = fmul <2 x float> %32, <float 5.000000e-01, float poison>
  %34 = fadd <2 x float> %32, <float poison, float 2.200000e+01>
  %35 = shufflevector <2 x float> %33, <2 x float> %34, <2 x i32> <i32 0, i32 3>
  %36 = sdiv i32 %24, 4
  %37 = sitofp i32 %36 to float
  %38 = insertelement <2 x float> %0, float %37, i64 1
  %39 = fadd <2 x float> %38, %35
  %40 = fmul <2 x float> %31, <float 5.000000e-01, float 5.000000e-01>
  %41 = fsub <2 x float> %39, %40
  %42 = sdiv i32 %24, 2
  %43 = add nsw i32 %42, %36
  %44 = extractelement <2 x float> %34, i64 1
  br label %45

45:                                               ; preds = %28, %25
  %.sink = phi i32 [ %43, %28 ], [ %27, %25 ]
  %.sink84.in = phi float [ %44, %28 ], [ %26, %25 ]
  %.sroa.6.077 = phi <2 x float> [ %31, %28 ], [ zeroinitializer, %25 ]
  %.sroa.027.075 = phi <2 x float> [ %41, %28 ], [ zeroinitializer, %25 ]
  %.sink84 = fadd float %.sink84.in, -1.500000e+01
  %46 = sitofp i32 %.sink to float
  %47 = fadd float %.sink84, %46
  %.sroa.012.4.vec.insert20 = insertelement <2 x float> %.sroa.034.0.vec.insert, float %47, i64 1
  %48 = fadd float %.sroa.860.8.vec.extract, -2.000000e+01
  %.sroa.10.12.vec.insert = insertelement <2 x float> <float poison, float 3.000000e+01>, float %48, i64 0
  %49 = call zeroext i1 @GuiWindowBox(<2 x float> %0, <2 x float> %1, ptr noundef %2)
  %not. = xor i1 %49, true
  %spec.select = sext i1 %not. to i32
  br i1 %.not, label %52, label %50

50:                                               ; preds = %45
  %51 = call i32 @GuiGetStyle(i32 noundef 1, i32 noundef 14)
  call void @GuiSetStyle(i32 noundef 1, i32 noundef 14, i32 noundef 1)
  call void @GuiLabel(<2 x float> %.sroa.027.075, <2 x float> %.sroa.6.077, ptr noundef nonnull %3)
  call void @GuiSetStyle(i32 noundef 1, i32 noundef 14, i32 noundef %51)
  br label %52

52:                                               ; preds = %50, %45
  %53 = load i8, ptr @_ZZ15GuiTextInputBoxE12textEditMode, align 1, !tbaa !12, !range !14, !noundef !15
  %54 = trunc nuw i8 %53 to i1
  %55 = call zeroext i1 @GuiTextBox(<2 x float> %.sroa.012.4.vec.insert20, <2 x float> %.sroa.10.12.vec.insert, ptr noundef %5, i32 noundef 256, i1 noundef zeroext %54)
  br i1 %55, label %56, label %59

56:                                               ; preds = %52
  %57 = load i8, ptr @_ZZ15GuiTextInputBoxE12textEditMode, align 1, !tbaa !12, !range !14, !noundef !15
  %58 = xor i8 %57, 1
  store i8 %58, ptr @_ZZ15GuiTextInputBoxE12textEditMode, align 1, !tbaa !12
  br label %59

59:                                               ; preds = %56, %52
  %60 = call i32 @GuiGetStyle(i32 noundef 2, i32 noundef 14)
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef 1)
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %59
  %63 = fadd float %20, 1.000000e+01
  br label %64

._crit_edge:                                      ; preds = %64, %59
  %.1.lcssa = phi i32 [ %spec.select, %59 ], [ %spec.select71, %64 ]
  call void @GuiSetStyle(i32 noundef 2, i32 noundef 14, i32 noundef %60)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  ret i32 %.1.lcssa

64:                                               ; preds = %.lr.ph, %64
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %64 ]
  %.182 = phi i32 [ %spec.select, %.lr.ph ], [ %spec.select71, %64 ]
  %.sroa.034.080 = phi <2 x float> [ %.sroa.034.4.vec.insert, %.lr.ph ], [ %.sroa.034.0.vec.insert38, %64 ]
  %65 = getelementptr inbounds ptr, ptr %9, i64 %indvars.iv
  %66 = load ptr, ptr %65, align 8, !tbaa !10
  %67 = call zeroext i1 @GuiButton(<2 x float> %.sroa.034.080, <2 x float> %.sroa.8.12.vec.insert, ptr noundef %66)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %68 = trunc nuw nsw i64 %indvars.iv.next to i32
  %spec.select71 = select i1 %67, i32 %68, i32 %.182
  %.sroa.034.0.vec.extract = extractelement <2 x float> %.sroa.034.080, i64 0
  %69 = fadd float %63, %.sroa.034.0.vec.extract
  %.sroa.034.0.vec.insert38 = insertelement <2 x float> %.sroa.034.080, float %69, i64 0
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = icmp slt i64 %indvars.iv.next, %71
  br i1 %72, label %64, label %._crit_edge, !llvm.loop !16
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5, i64 16, i64 4, !5, i64 20, i64 4, !5, i64 24, i64 4, !5, i64 28, i64 4, !5, i64 32, i64 8, !10, i64 40, i64 8, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass