; LLVM IR from Xingyu-Lin/softgym :: PyFlex/bindings/demo/imgui.ll (Z18imguiEndScrollAreav)

; 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.GuiState = type { i8, i8, i8, i32, i32, i32, i32, i32, i32, i8, i8, i8, i32, i32, float, i32, i32, i32, i8, i32, i32 }

@_ZL7g_state = external hidden global %struct.GuiState, align 4
@_ZL10g_scrollId = external hidden global i32, align 4
@_ZL11g_scrollTop = external hidden global i32, align 4
@_ZL14g_scrollBottom = external hidden global i32, align 4
@_ZL13g_scrollRight = external hidden global i32, align 4
@_ZL11g_scrollVal = external hidden global ptr, align 8
@_ZL15g_scrollAreaTop = external hidden global i32, align 4
@_ZL18g_insideScrollArea = external hidden global i8, align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z6inRectiiiib(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL20addGfxCmdRoundedRectfffffj(float noundef, float noundef, float noundef, float noundef, float noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z9imguiRGBAhhhh(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL16addGfxCmdScissoriiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18imguiEndScrollAreav() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca float, align 4
  call void @_ZL16addGfxCmdScissoriiii(i32 noundef -1, i32 noundef -1, i32 noundef -1, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  %18 = load i32, ptr @_ZL13g_scrollRight, align 4, !tbaa !5
  %19 = add nsw i32 %18, 3
  store i32 %19, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %20 = load i32, ptr @_ZL14g_scrollBottom, align 4, !tbaa !5
  store i32 %20, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 12, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %21 = load i32, ptr @_ZL11g_scrollTop, align 4, !tbaa !5
  %22 = load i32, ptr @_ZL14g_scrollBottom, align 4, !tbaa !5
  %23 = sub nsw i32 %21, %22
  store i32 %23, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %24 = load i32, ptr @_ZL15g_scrollAreaTop, align 4, !tbaa !5
  store i32 %24, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %25 = load i32, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 16), align 4, !tbaa !9
  store i32 %25, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = sub nsw i32 %26, %27
  store i32 %28, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = sitofp i32 %29 to float
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = sitofp i32 %31 to float
  %33 = fdiv float %30, %32
  store float %33, ptr %8, align 4, !tbaa !13
  %34 = load float, ptr %8, align 4, !tbaa !13
  %35 = fcmp olt float %34, 1.000000e+00
  br i1 %35, label %36, label %211

36:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = sub nsw i32 %37, %38
  %40 = sitofp i32 %39 to float
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = sitofp i32 %41 to float
  %43 = fdiv float %40, %42
  store float %43, ptr %9, align 4, !tbaa !13
  %44 = load float, ptr %9, align 4, !tbaa !13
  %45 = fcmp olt float %44, 0.000000e+00
  br i1 %45, label %46, label %47

46:                                               ; preds = %36
  store float 0.000000e+00, ptr %9, align 4, !tbaa !13
  br label %47

47:                                               ; preds = %46, %36
  %48 = load float, ptr %9, align 4, !tbaa !13
  %49 = fcmp ogt float %48, 1.000000e+00
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  store float 1.000000e+00, ptr %9, align 4, !tbaa !13
  br label %51

51:                                               ; preds = %50, %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %52 = load i32, ptr @_ZL10g_scrollId, align 4, !tbaa !5
  store i32 %52, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %53 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %53, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = load float, ptr %9, align 4, !tbaa !13
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sitofp i32 %56 to float
  %58 = fmul float %55, %57
  %59 = fptosi float %58 to i32
  %60 = add nsw i32 %54, %59
  store i32 %60, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %61 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %61, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %62 = load float, ptr %8, align 4, !tbaa !13
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = sitofp i32 %63 to float
  %65 = fmul float %62, %64
  %66 = fptosi float %65 to i32
  store i32 %66, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = load i32, ptr %14, align 4, !tbaa !5
  %69 = sub nsw i32 %68, 1
  %70 = sub nsw i32 %67, %69
  store i32 %70, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #4
  %71 = load i32, ptr %11, align 4, !tbaa !5
  %72 = load i32, ptr %12, align 4, !tbaa !5
  %73 = load i32, ptr %13, align 4, !tbaa !5
  %74 = load i32, ptr %14, align 4, !tbaa !5
  %75 = call noundef zeroext i1 @_Z6inRectiiiib(i32 noundef %71, i32 noundef %72, i32 noundef %73, i32 noundef %74, i1 noundef zeroext true)
  %76 = zext i1 %75 to i8
  store i8 %76, ptr %16, align 1, !tbaa !14
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = load i8, ptr %16, align 1, !tbaa !14, !range !15, !noundef !16
  %79 = trunc i8 %78 to i1
  %80 = call noundef zeroext i1 @_ZL11buttonLogicjb(i32 noundef %77, i1 noundef zeroext %79)
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = call noundef zeroext i1 @_Z8isActivej(i32 noundef %81)
  br i1 %82, label %83, label %128

83:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %84 = load i32, ptr %12, align 4, !tbaa !5
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = sub nsw i32 %84, %85
  %87 = sitofp i32 %86 to float
  %88 = load i32, ptr %15, align 4, !tbaa !5
  %89 = sitofp i32 %88 to float
  %90 = fdiv float %87, %89
  store float %90, ptr %17, align 4, !tbaa !13
  %91 = load i8, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 11), align 2, !tbaa !17, !range !15, !noundef !16
  %92 = trunc i8 %91 to i1
  br i1 %92, label %93, label %96

93:                                               ; preds = %83
  %94 = load i32, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 4), align 4, !tbaa !18
  store i32 %94, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 13), align 4, !tbaa !19
  %95 = load float, ptr %17, align 4, !tbaa !13
  store float %95, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 14), align 4, !tbaa !20
  br label %96

96:                                               ; preds = %93, %83
  %97 = load i32, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 13), align 4, !tbaa !19
  %98 = load i32, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 4), align 4, !tbaa !18
  %99 = icmp ne i32 %97, %98
  br i1 %99, label %100, label %127

100:                                              ; preds = %96
  %101 = load float, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 14), align 4, !tbaa !20
  %102 = load i32, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 4), align 4, !tbaa !18
  %103 = load i32, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 13), align 4, !tbaa !19
  %104 = sub nsw i32 %102, %103
  %105 = sitofp i32 %104 to float
  %106 = load i32, ptr %15, align 4, !tbaa !5
  %107 = sitofp i32 %106 to float
  %108 = fdiv float %105, %107
  %109 = fadd float %101, %108
  store float %109, ptr %17, align 4, !tbaa !13
  %110 = load float, ptr %17, align 4, !tbaa !13
  %111 = fcmp olt float %110, 0.000000e+00
  br i1 %111, label %112, label %113

112:                                              ; preds = %100
  store float 0.000000e+00, ptr %17, align 4, !tbaa !13
  br label %113

113:                                              ; preds = %112, %100
  %114 = load float, ptr %17, align 4, !tbaa !13
  %115 = fcmp ogt float %114, 1.000000e+00
  br i1 %115, label %116, label %117

116:                                              ; preds = %113
  store float 1.000000e+00, ptr %17, align 4, !tbaa !13
  br label %117

117:                                              ; preds = %116, %113
  %118 = load float, ptr %17, align 4, !tbaa !13
  %119 = fsub float 1.000000e+00, %118
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = load i32, ptr %4, align 4, !tbaa !5
  %122 = sub nsw i32 %120, %121
  %123 = sitofp i32 %122 to float
  %124 = fmul float %119, %123
  %125 = fptosi float %124 to i32
  %126 = load ptr, ptr @_ZL11g_scrollVal, align 8, !tbaa !21
  store i32 %125, ptr %126, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %117, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %128

128:                                              ; preds = %127, %51
  %129 = load i32, ptr %1, align 4, !tbaa !5
  %130 = sitofp i32 %129 to float
  %131 = load i32, ptr %2, align 4, !tbaa !5
  %132 = sitofp i32 %131 to float
  %133 = load i32, ptr %3, align 4, !tbaa !5
  %134 = sitofp i32 %133 to float
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = sitofp i32 %135 to float
  %137 = load i32, ptr %3, align 4, !tbaa !5
  %138 = sitofp i32 %137 to float
  %139 = fdiv float %138, 2.000000e+00
  %140 = fsub float %139, 1.000000e+00
  %141 = call noundef i32 @_Z9imguiRGBAhhhh(i8 noundef zeroext 0, i8 noundef zeroext 0, i8 noundef zeroext 0, i8 noundef zeroext -60)
  call void @_ZL20addGfxCmdRoundedRectfffffj(float noundef %130, float noundef %132, float noundef %134, float noundef %136, float noundef %140, i32 noundef %141)
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = call noundef zeroext i1 @_Z8isActivej(i32 noundef %142)
  br i1 %143, label %144, label %158

144:                                              ; preds = %128
  %145 = load i32, ptr %11, align 4, !tbaa !5
  %146 = sitofp i32 %145 to float
  %147 = load i32, ptr %12, align 4, !tbaa !5
  %148 = sitofp i32 %147 to float
  %149 = load i32, ptr %13, align 4, !tbaa !5
  %150 = sitofp i32 %149 to float
  %151 = load i32, ptr %14, align 4, !tbaa !5
  %152 = sitofp i32 %151 to float
  %153 = load i32, ptr %3, align 4, !tbaa !5
  %154 = sitofp i32 %153 to float
  %155 = fdiv float %154, 2.000000e+00
  %156 = fsub float %155, 1.000000e+00
  %157 = call noundef i32 @_Z9imguiRGBAhhhh(i8 noundef zeroext -1, i8 noundef zeroext -60, i8 noundef zeroext 0, i8 noundef zeroext -60)
  call void @_ZL20addGfxCmdRoundedRectfffffj(float noundef %146, float noundef %148, float noundef %150, float noundef %152, float noundef %156, i32 noundef %157)
  br label %179

158:                                              ; preds = %128
  %159 = load i32, ptr %11, align 4, !tbaa !5
  %160 = sitofp i32 %159 to float
  %161 = load i32, ptr %12, align 4, !tbaa !5
  %162 = sitofp i32 %161 to float
  %163 = load i32, ptr %13, align 4, !tbaa !5
  %164 = sitofp i32 %163 to float
  %165 = load i32, ptr %14, align 4, !tbaa !5
  %166 = sitofp i32 %165 to float
  %167 = load i32, ptr %3, align 4, !tbaa !5
  %168 = sitofp i32 %167 to float
  %169 = fdiv float %168, 2.000000e+00
  %170 = fsub float %169, 1.000000e+00
  %171 = load i32, ptr %10, align 4, !tbaa !5
  %172 = call noundef zeroext i1 @_Z5isHotj(i32 noundef %171)
  br i1 %172, label %173, label %175

173:                                              ; preds = %158
  %174 = call noundef i32 @_Z9imguiRGBAhhhh(i8 noundef zeroext -1, i8 noundef zeroext -60, i8 noundef zeroext 0, i8 noundef zeroext 96)
  br label %177

175:                                              ; preds = %158
  %176 = call noundef i32 @_Z9imguiRGBAhhhh(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext 64)
  br label %177

177:                                              ; preds = %175, %173
  %178 = phi i32 [ %174, %173 ], [ %176, %175 ]
  call void @_ZL20addGfxCmdRoundedRectfffffj(float noundef %160, float noundef %162, float noundef %164, float noundef %166, float noundef %170, i32 noundef %178)
  br label %179

179:                                              ; preds = %177, %144
  %180 = load i8, ptr @_ZL18g_insideScrollArea, align 1, !tbaa !14, !range !15, !noundef !16
  %181 = trunc i8 %180 to i1
  br i1 %181, label %182, label %210

182:                                              ; preds = %179
  %183 = load i32, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 5), align 4, !tbaa !23
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %209

185:                                              ; preds = %182
  %186 = load i32, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 5), align 4, !tbaa !23
  %187 = mul nsw i32 20, %186
  %188 = load ptr, ptr @_ZL11g_scrollVal, align 8, !tbaa !21
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = add nsw i32 %189, %187
  store i32 %190, ptr %188, align 4, !tbaa !5
  %191 = load ptr, ptr @_ZL11g_scrollVal, align 8, !tbaa !21
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = icmp slt i32 %192, 0
  br i1 %193, label %194, label %196

194:                                              ; preds = %185
  %195 = load ptr, ptr @_ZL11g_scrollVal, align 8, !tbaa !21
  store i32 0, ptr %195, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %194, %185
  %197 = load ptr, ptr @_ZL11g_scrollVal, align 8, !tbaa !21
  %198 = load i32, ptr %197, align 4, !tbaa !5
  %199 = load i32, ptr %7, align 4, !tbaa !5
  %200 = load i32, ptr %4, align 4, !tbaa !5
  %201 = sub nsw i32 %199, %200
  %202 = icmp sgt i32 %198, %201
  br i1 %202, label %203, label %208

203:                                              ; preds = %196
  %204 = load i32, ptr %7, align 4, !tbaa !5
  %205 = load i32, ptr %4, align 4, !tbaa !5
  %206 = sub nsw i32 %204, %205
  %207 = load ptr, ptr @_ZL11g_scrollVal, align 8, !tbaa !21
  store i32 %206, ptr %207, align 4, !tbaa !5
  br label %208

208:                                              ; preds = %203, %196
  br label %209

209:                                              ; preds = %208, %182
  br label %210

210:                                              ; preds = %209, %179
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %211

211:                                              ; preds = %210, %0
  store i8 0, ptr getelementptr inbounds (%struct.GuiState, ptr @_ZL7g_state, i32 0, i32 18), align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZL11buttonLogicjb(i32 noundef, i1 noundef zeroext) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8isActivej(i32 noundef) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5isHotj(i32 noundef) #0

attributes #0 = { inlinehint 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 #1 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{!10, !6, i64 48}
!10 = !{!"_ZTS8GuiState", !11, i64 0, !11, i64 1, !11, i64 2, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !11, i64 28, !11, i64 29, !11, i64 30, !6, i64 32, !6, i64 36, !12, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !11, i64 56, !6, i64 60, !6, i64 64}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!10, !11, i64 30}
!18 = !{!10, !6, i64 8}
!19 = !{!10, !6, i64 36}
!20 = !{!10, !12, i64 40}
!21 = !{!22, !22, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = !{!10, !6, i64 12}
!24 = !{!10, !11, i64 56}


; 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.GuiState = type { i8, i8, i8, i32, i32, i32, i32, i32, i32, i8, i8, i8, i32, i32, float, i32, i32, i32, i8, i32, i32 }

@_ZL7g_state = external hidden local_unnamed_addr global %struct.GuiState, align 4
@_ZL10g_scrollId = external hidden local_unnamed_addr global i32, align 4
@_ZL11g_scrollTop = external hidden local_unnamed_addr global i32, align 4
@_ZL14g_scrollBottom = external hidden local_unnamed_addr global i32, align 4
@_ZL13g_scrollRight = external hidden local_unnamed_addr global i32, align 4
@_ZL11g_scrollVal = external hidden local_unnamed_addr global ptr, align 8
@_ZL15g_scrollAreaTop = external hidden local_unnamed_addr global i32, align 4
@_ZL18g_insideScrollArea = external hidden local_unnamed_addr global i8, align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z6inRectiiiib(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL20addGfxCmdRoundedRectfffffj(float noundef, float noundef, float noundef, float noundef, float noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z9imguiRGBAhhhh(i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL16addGfxCmdScissoriiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18imguiEndScrollAreav() local_unnamed_addr #2 {
  tail call void @_ZL16addGfxCmdScissoriiii(i32 noundef -1, i32 noundef -1, i32 noundef -1, i32 noundef -1)
  %1 = load i32, ptr @_ZL13g_scrollRight, align 4, !tbaa !5
  %2 = add nsw i32 %1, 3
  %3 = load i32, ptr @_ZL14g_scrollBottom, align 4, !tbaa !5
  %4 = load i32, ptr @_ZL11g_scrollTop, align 4, !tbaa !5
  %5 = sub nsw i32 %4, %3
  %6 = load i32, ptr @_ZL15g_scrollAreaTop, align 4, !tbaa !5
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL7g_state, i64 48), align 4, !tbaa !9
  %8 = sub nsw i32 %6, %7
  %9 = sitofp i32 %5 to float
  %10 = sitofp i32 %8 to float
  %11 = fdiv float %9, %10
  %12 = fcmp olt float %11, 1.000000e+00
  br i1 %12, label %13, label %77

13:                                               ; preds = %0
  %14 = sub nsw i32 %3, %7
  %15 = sitofp i32 %14 to float
  %16 = fdiv float %15, %10
  %17 = fcmp olt float %16, 0.000000e+00
  %.057 = select i1 %17, float 0.000000e+00, float %16
  %18 = fcmp ogt float %.057, 1.000000e+00
  %.158 = select i1 %18, float 1.000000e+00, float %.057
  %19 = load i32, ptr @_ZL10g_scrollId, align 4, !tbaa !5
  %20 = fmul float %.158, %9
  %21 = fptosi float %20 to i32
  %22 = add nsw i32 %3, %21
  %23 = fmul float %11, %9
  %24 = fptosi float %23 to i32
  %25 = tail call noundef zeroext i1 @_Z6inRectiiiib(i32 noundef %2, i32 noundef %22, i32 noundef 12, i32 noundef %24, i1 noundef zeroext true)
  %26 = tail call noundef zeroext i1 @_ZL11buttonLogicjb(i32 noundef %19, i1 noundef zeroext %25)
  %27 = tail call noundef zeroext i1 @_Z8isActivej(i32 noundef %19)
  br i1 %27, label %28, label %51

28:                                               ; preds = %13
  %.neg66 = add i32 %5, 1
  %29 = sub i32 %.neg66, %24
  %30 = sitofp i32 %29 to float
  %31 = load i8, ptr getelementptr inbounds (i8, ptr @_ZL7g_state, i64 30), align 2, !tbaa !13, !range !14, !noundef !15
  %32 = trunc nuw i8 %31 to i1
  br i1 %32, label %.thread, label %36

.thread:                                          ; preds = %28
  %33 = sitofp i32 %21 to float
  %34 = fdiv float %33, %30
  %35 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL7g_state, i64 8), align 4, !tbaa !16
  store i32 %35, ptr getelementptr inbounds (i8, ptr @_ZL7g_state, i64 36), align 4, !tbaa !17
  store float %34, ptr getelementptr inbounds (i8, ptr @_ZL7g_state, i64 40), align 4, !tbaa !18
  br label %51

36:                                               ; preds = %28
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @_ZL7g_state, i64 36), align 4, !tbaa !17
  %.pre67 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL7g_state, i64 8), align 4, !tbaa !16
  %.not = icmp eq i32 %.pre, %.pre67
  br i1 %.not, label %51, label %37

37:                                               ; preds = %36
  %38 = load float, ptr getelementptr inbounds (i8, ptr @_ZL7g_state, i64 40), align 4, !tbaa !18
  %39 = sub nsw i32 %.pre67, %.pre
  %40 = sitofp i32 %39 to float
  %41 = fdiv float %40, %30
  %42 = fadd float %41, %38
  %43 = fcmp olt float %42, 0.000000e+00
  %.0 = select i1 %43, float 0.000000e+00, float %42
  %44 = fcmp ogt float %.0, 1.000000e+00
  %.1 = select i1 %44, float 1.000000e+00, float %.0
  %45 = fsub float 1.000000e+00, %.1
  %46 = sub nsw i32 %8, %5
  %47 = sitofp i32 %46 to float
  %48 = fmul float %45, %47
  %49 = fptosi float %48 to i32
  %50 = load ptr, ptr @_ZL11g_scrollVal, align 8, !tbaa !19
  store i32 %49, ptr %50, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %.thread, %36, %37, %13
  %52 = sitofp i32 %2 to float
  %53 = sitofp i32 %3 to float
  %54 = tail call noundef i32 @_Z9imguiRGBAhhhh(i8 noundef zeroext 0, i8 noundef zeroext 0, i8 noundef zeroext 0, i8 noundef zeroext -60)
  tail call void @_ZL20addGfxCmdRoundedRectfffffj(float noundef %52, float noundef %53, float noundef 1.200000e+01, float noundef %9, float noundef 5.000000e+00, i32 noundef %54)
  %55 = tail call noundef zeroext i1 @_Z8isActivej(i32 noundef %19)
  %56 = sitofp i32 %22 to float
  %57 = sitofp i32 %24 to float
  br i1 %55, label %58, label %60

58:                                               ; preds = %51
  %59 = tail call noundef i32 @_Z9imguiRGBAhhhh(i8 noundef zeroext -1, i8 noundef zeroext -60, i8 noundef zeroext 0, i8 noundef zeroext -60)
  br label %66

60:                                               ; preds = %51
  %61 = tail call noundef zeroext i1 @_Z5isHotj(i32 noundef %19)
  br i1 %61, label %62, label %64

62:                                               ; preds = %60
  %63 = tail call noundef i32 @_Z9imguiRGBAhhhh(i8 noundef zeroext -1, i8 noundef zeroext -60, i8 noundef zeroext 0, i8 noundef zeroext 96)
  br label %66

64:                                               ; preds = %60
  %65 = tail call noundef i32 @_Z9imguiRGBAhhhh(i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext -1, i8 noundef zeroext 64)
  br label %66

66:                                               ; preds = %62, %64, %58
  %.sink = phi i32 [ %59, %58 ], [ %63, %62 ], [ %65, %64 ]
  tail call void @_ZL20addGfxCmdRoundedRectfffffj(float noundef %52, float noundef %56, float noundef 1.200000e+01, float noundef %57, float noundef 5.000000e+00, i32 noundef %.sink)
  %67 = load i8, ptr @_ZL18g_insideScrollArea, align 1, !tbaa !21, !range !14, !noundef !15
  %68 = trunc nuw i8 %67 to i1
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL7g_state, i64 12), align 4
  %70 = icmp ne i32 %69, 0
  %or.cond = select i1 %68, i1 %70, i1 false
  br i1 %or.cond, label %71, label %77

71:                                               ; preds = %66
  %72 = mul nsw i32 %69, 20
  %73 = load ptr, ptr @_ZL11g_scrollVal, align 8, !tbaa !19
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %74, %72
  %spec.select = tail call i32 @llvm.smax.i32(i32 %75, i32 0)
  %76 = sub nsw i32 %8, %5
  %spec.store.select = tail call i32 @llvm.smin.i32(i32 %spec.select, i32 %76)
  store i32 %spec.store.select, ptr %73, align 4
  br label %77

77:                                               ; preds = %71, %66, %0
  store i8 0, ptr getelementptr inbounds (i8, ptr @_ZL7g_state, i64 56), align 4, !tbaa !22
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZL11buttonLogicjb(i32 noundef, i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z8isActivej(i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5isHotj(i32 noundef) local_unnamed_addr #0

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

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

attributes #0 = { inlinehint 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 #1 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!10, !6, i64 48}
!10 = !{!"_ZTS8GuiState", !11, i64 0, !11, i64 1, !11, i64 2, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !11, i64 28, !11, i64 29, !11, i64 30, !6, i64 32, !6, i64 36, !12, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !11, i64 56, !6, i64 60, !6, i64 64}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!10, !11, i64 30}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!10, !6, i64 8}
!17 = !{!10, !6, i64 36}
!18 = !{!10, !12, i64 40}
!19 = !{!20, !20, i64 0}
!20 = !{!"any pointer", !7, i64 0}
!21 = !{!11, !11, i64 0}
!22 = !{!10, !11, i64 56}


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