; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/juce_gui_basics.ll (ZN4juce8Viewport10autoScrollEiiii)

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

%"class.juce::Viewport" = type { %"class.juce::Component.base", %"class.juce::ComponentListener", %"class.juce::ScrollBar::Listener", %"class.juce::WeakReference", %"class.juce::Rectangle", i32, i32, i32, i8, i8, i8, i8, i8, i8, [6 x i8], %"class.juce::Component", %"class.juce::ScrollBar", %"class.juce::ScrollBar", %"class.juce::ScopedPointer.345" }
%"class.juce::Component.base" = type <{ %"class.juce::MouseListener", %"class.juce::String", %"class.juce::String", ptr, %"class.juce::Rectangle", %"class.juce::ScopedPointer", %"class.juce::ScopedPointer.0", %"class.juce::Array", ptr, %"class.juce::MouseCursor", ptr, %"class.juce::ScopedPointer.1", %"class.juce::ScopedPointer.2", %"class.juce::ScopedPointer.3", %"class.juce::ListenerList", %"class.juce::NamedValueSet", %"class.juce::WeakReference<juce::Component>::Master", %union.anon, i8 }>
%"class.juce::MouseListener" = type { ptr }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::ScopedPointer" = type { ptr }
%"class.juce::ScopedPointer.0" = type { ptr }
%"class.juce::Array" = type { %"class.juce::ArrayAllocationBase", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase" = type <{ %"class.juce::HeapBlock", i32, [4 x i8] }>
%"class.juce::HeapBlock" = type { ptr }
%"class.juce::MouseCursor" = type { ptr }
%"class.juce::ScopedPointer.1" = type { ptr }
%"class.juce::ScopedPointer.2" = type { ptr }
%"class.juce::ScopedPointer.3" = type { ptr }
%"class.juce::ListenerList" = type { %"class.juce::Array.4" }
%"class.juce::Array.4" = type { %"class.juce::ArrayAllocationBase.5", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.5" = type <{ %"class.juce::HeapBlock.6", i32, [4 x i8] }>
%"class.juce::HeapBlock.6" = type { ptr }
%"class.juce::NamedValueSet" = type { %"class.juce::Array.9" }
%"class.juce::Array.9" = type { %"class.juce::ArrayAllocationBase.10", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.10" = type <{ %"class.juce::HeapBlock.11", i32, [4 x i8] }>
%"class.juce::HeapBlock.11" = type { ptr }
%"class.juce::WeakReference<juce::Component>::Master" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%union.anon = type { i32 }
%"class.juce::ComponentListener" = type { ptr }
%"class.juce::ScrollBar::Listener" = type { ptr }
%"class.juce::WeakReference" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }
%"class.juce::Component" = type <{ %"class.juce::MouseListener", %"class.juce::String", %"class.juce::String", ptr, %"class.juce::Rectangle", %"class.juce::ScopedPointer", %"class.juce::ScopedPointer.0", %"class.juce::Array", ptr, %"class.juce::MouseCursor", ptr, %"class.juce::ScopedPointer.1", %"class.juce::ScopedPointer.2", %"class.juce::ScopedPointer.3", %"class.juce::ListenerList", %"class.juce::NamedValueSet", %"class.juce::WeakReference<juce::Component>::Master", %union.anon, i8, [3 x i8] }>
%"class.juce::ScrollBar" = type { %"class.juce::Component.base", %"class.juce::AsyncUpdater", %"class.juce::Timer", %"class.juce::Range.324", %"class.juce::Range.324", double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, %"class.juce::ScopedPointer.325", %"class.juce::ScopedPointer.325", %"class.juce::ListenerList.326" }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr.15" }
%"class.juce::ReferenceCountedObjectPtr.15" = type { ptr }
%"class.juce::Timer" = type { ptr, i32, i32, ptr, ptr }
%"class.juce::Range.324" = type { double, double }
%"class.juce::ScopedPointer.325" = type { ptr }
%"class.juce::ListenerList.326" = type { %"class.juce::Array.327" }
%"class.juce::Array.327" = type { %"class.juce::ArrayAllocationBase.328", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.328" = type <{ %"class.juce::HeapBlock.329", i32, [4 x i8] }>
%"class.juce::HeapBlock.329" = type { ptr }
%"class.juce::ScopedPointer.345" = type { ptr }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEneEPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component8getWidthEv(ptr noundef nonnull align 8 dereferenceable(197)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component9getHeightEv(ptr noundef nonnull align 8 dereferenceable(197)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9Component9isVisibleEv(ptr noundef nonnull align 8 dereferenceable(197)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component4getXEv(ptr noundef nonnull align 8 dereferenceable(197)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component4getYEv(ptr noundef nonnull align 8 dereferenceable(197)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component18setTopLeftPositionEii(ptr noundef nonnull align 8 dereferenceable(197), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component8getRightEv(ptr noundef nonnull align 8 dereferenceable(197)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce8Viewport10autoScrollEiiii(ptr noundef nonnull align 8 dereferenceable(1224) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #2 align 2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, 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
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  %15 = load ptr, ptr %7, align 8
  %16 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %17 = call noundef zeroext i1 @_ZNK4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEneEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef null) #3
  br i1 %17, label %18, label %161

18:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  %19 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 17
  %20 = call noundef zeroext i1 @_ZNK4juce9Component9isVisibleEv(ptr noundef nonnull align 8 dereferenceable(197) %19) #3
  br i1 %20, label %32, label %21

21:                                               ; preds = %18
  %22 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %23 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #3
  %24 = call noundef i32 @_ZNK4juce9Component4getXEv(ptr noundef nonnull align 8 dereferenceable(197) %23) #3
  %25 = icmp slt i32 %24, 0
  br i1 %25, label %32, label %26

26:                                               ; preds = %21
  %27 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %28 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #3
  %29 = call noundef i32 @_ZNK4juce9Component8getRightEv(ptr noundef nonnull align 8 dereferenceable(197) %28) #3
  %30 = call noundef i32 @_ZNK4juce9Component8getWidthEv(ptr noundef nonnull align 8 dereferenceable(197) %15) #3
  %31 = icmp sgt i32 %29, %30
  br i1 %31, label %32, label %78

32:                                               ; preds = %26, %21, %18
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %36, label %40

36:                                               ; preds = %32
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = sub nsw i32 %37, %38
  store i32 %39, ptr %12, align 4, !tbaa !9
  br label %55

40:                                               ; preds = %32
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 15
  %43 = call noundef i32 @_ZNK4juce9Component8getWidthEv(ptr noundef nonnull align 8 dereferenceable(197) %42) #3
  %44 = load i32, ptr %10, align 4, !tbaa !9
  %45 = sub nsw i32 %43, %44
  %46 = icmp sge i32 %41, %45
  br i1 %46, label %47, label %54

47:                                               ; preds = %40
  %48 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 15
  %49 = call noundef i32 @_ZNK4juce9Component8getWidthEv(ptr noundef nonnull align 8 dereferenceable(197) %48) #3
  %50 = load i32, ptr %10, align 4, !tbaa !9
  %51 = sub nsw i32 %49, %50
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = sub nsw i32 %51, %52
  store i32 %53, ptr %12, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %47, %40
  br label %55

55:                                               ; preds = %54, %36
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = icmp slt i32 %56, 0
  br i1 %57, label %58, label %69

58:                                               ; preds = %55
  %59 = load i32, ptr %12, align 4, !tbaa !9
  %60 = load i32, ptr %11, align 4, !tbaa !9
  %61 = sub nsw i32 0, %60
  %62 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 15
  %63 = call noundef i32 @_ZNK4juce9Component8getWidthEv(ptr noundef nonnull align 8 dereferenceable(197) %62) #3
  %64 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %65 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %64) #3
  %66 = call noundef i32 @_ZNK4juce9Component8getRightEv(ptr noundef nonnull align 8 dereferenceable(197) %65) #3
  %67 = sub nsw i32 %63, %66
  %68 = call noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_S1_(i32 noundef %59, i32 noundef %61, i32 noundef %67)
  store i32 %68, ptr %12, align 4, !tbaa !9
  br label %77

69:                                               ; preds = %55
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %73 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %72) #3
  %74 = call noundef i32 @_ZNK4juce9Component4getXEv(ptr noundef nonnull align 8 dereferenceable(197) %73) #3
  %75 = sub nsw i32 0, %74
  %76 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_S1_(i32 noundef %70, i32 noundef %71, i32 noundef %75)
  store i32 %76, ptr %12, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %69, %58
  br label %78

78:                                               ; preds = %77, %26
  %79 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 16
  %80 = call noundef zeroext i1 @_ZNK4juce9Component9isVisibleEv(ptr noundef nonnull align 8 dereferenceable(197) %79) #3
  br i1 %80, label %92, label %81

81:                                               ; preds = %78
  %82 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %83 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %82) #3
  %84 = call noundef i32 @_ZNK4juce9Component4getYEv(ptr noundef nonnull align 8 dereferenceable(197) %83) #3
  %85 = icmp slt i32 %84, 0
  br i1 %85, label %92, label %86

86:                                               ; preds = %81
  %87 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %88 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %87) #3
  %89 = call noundef i32 @_ZNK4juce9Component9getBottomEv(ptr noundef nonnull align 8 dereferenceable(197) %88) #3
  %90 = call noundef i32 @_ZNK4juce9Component9getHeightEv(ptr noundef nonnull align 8 dereferenceable(197) %15) #3
  %91 = icmp sgt i32 %89, %90
  br i1 %91, label %92, label %138

92:                                               ; preds = %86, %81, %78
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %96, label %100

96:                                               ; preds = %92
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = load i32, ptr %9, align 4, !tbaa !9
  %99 = sub nsw i32 %97, %98
  store i32 %99, ptr %13, align 4, !tbaa !9
  br label %115

100:                                              ; preds = %92
  %101 = load i32, ptr %9, align 4, !tbaa !9
  %102 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 15
  %103 = call noundef i32 @_ZNK4juce9Component9getHeightEv(ptr noundef nonnull align 8 dereferenceable(197) %102) #3
  %104 = load i32, ptr %10, align 4, !tbaa !9
  %105 = sub nsw i32 %103, %104
  %106 = icmp sge i32 %101, %105
  br i1 %106, label %107, label %114

107:                                              ; preds = %100
  %108 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 15
  %109 = call noundef i32 @_ZNK4juce9Component9getHeightEv(ptr noundef nonnull align 8 dereferenceable(197) %108) #3
  %110 = load i32, ptr %10, align 4, !tbaa !9
  %111 = sub nsw i32 %109, %110
  %112 = load i32, ptr %9, align 4, !tbaa !9
  %113 = sub nsw i32 %111, %112
  store i32 %113, ptr %13, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %107, %100
  br label %115

115:                                              ; preds = %114, %96
  %116 = load i32, ptr %13, align 4, !tbaa !9
  %117 = icmp slt i32 %116, 0
  br i1 %117, label %118, label %129

118:                                              ; preds = %115
  %119 = load i32, ptr %13, align 4, !tbaa !9
  %120 = load i32, ptr %11, align 4, !tbaa !9
  %121 = sub nsw i32 0, %120
  %122 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 15
  %123 = call noundef i32 @_ZNK4juce9Component9getHeightEv(ptr noundef nonnull align 8 dereferenceable(197) %122) #3
  %124 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %125 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %124) #3
  %126 = call noundef i32 @_ZNK4juce9Component9getBottomEv(ptr noundef nonnull align 8 dereferenceable(197) %125) #3
  %127 = sub nsw i32 %123, %126
  %128 = call noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_S1_(i32 noundef %119, i32 noundef %121, i32 noundef %127)
  store i32 %128, ptr %13, align 4, !tbaa !9
  br label %137

129:                                              ; preds = %115
  %130 = load i32, ptr %13, align 4, !tbaa !9
  %131 = load i32, ptr %11, align 4, !tbaa !9
  %132 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %133 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %132) #3
  %134 = call noundef i32 @_ZNK4juce9Component4getYEv(ptr noundef nonnull align 8 dereferenceable(197) %133) #3
  %135 = sub nsw i32 0, %134
  %136 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_S1_(i32 noundef %130, i32 noundef %131, i32 noundef %135)
  store i32 %136, ptr %13, align 4, !tbaa !9
  br label %137

137:                                              ; preds = %129, %118
  br label %138

138:                                              ; preds = %137, %86
  %139 = load i32, ptr %12, align 4, !tbaa !9
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %144, label %141

141:                                              ; preds = %138
  %142 = load i32, ptr %13, align 4, !tbaa !9
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %157

144:                                              ; preds = %141, %138
  %145 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %146 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %145) #3
  %147 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %148 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %147) #3
  %149 = call noundef i32 @_ZNK4juce9Component4getXEv(ptr noundef nonnull align 8 dereferenceable(197) %148) #3
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = add nsw i32 %149, %150
  %152 = getelementptr inbounds %"class.juce::Viewport", ptr %15, i32 0, i32 3
  %153 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %152) #3
  %154 = call noundef i32 @_ZNK4juce9Component4getYEv(ptr noundef nonnull align 8 dereferenceable(197) %153) #3
  %155 = load i32, ptr %13, align 4, !tbaa !9
  %156 = add nsw i32 %154, %155
  call void @_ZN4juce9Component18setTopLeftPositionEii(ptr noundef nonnull align 8 dereferenceable(197) %146, i32 noundef %151, i32 noundef %156)
  store i1 true, ptr %6, align 1
  store i32 1, ptr %14, align 4
  br label %158

157:                                              ; preds = %141
  store i32 0, ptr %14, align 4
  br label %158

158:                                              ; preds = %157, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %159 = load i32, ptr %14, align 4
  switch i32 %159, label %164 [
    i32 0, label %160
    i32 1, label %162
  ]

160:                                              ; preds = %158
  br label %161

161:                                              ; preds = %160, %5
  store i1 false, ptr %6, align 1
  br label %162

162:                                              ; preds = %161, %158
  %163 = load i1, ptr %6, align 1
  ret i1 %163

164:                                              ; preds = %158
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component9getBottomEv(ptr noundef nonnull align 8 dereferenceable(197)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEneEPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component8getWidthEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component9getHeightEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9Component9isVisibleEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component4getXEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component4getYEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component18setTopLeftPositionEii(ptr noundef nonnull align 8 dereferenceable(197), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component8getRightEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce8Viewport10autoScrollEiiii(ptr noundef nonnull align 8 dereferenceable(1224) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #1 align 2 {
  %6 = getelementptr inbounds i8, ptr %0, i64 216
  %7 = tail call noundef zeroext i1 @_ZNK4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEneEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef null) #2
  br i1 %7, label %8, label %.thread50

8:                                                ; preds = %5
  %9 = getelementptr inbounds i8, ptr %0, i64 840
  %10 = tail call noundef zeroext i1 @_ZNK4juce9Component9isVisibleEv(ptr noundef nonnull align 8 dereferenceable(197) %9) #2
  br i1 %10, label %20, label %11

11:                                               ; preds = %8
  %12 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %13 = tail call noundef i32 @_ZNK4juce9Component4getXEv(ptr noundef nonnull align 8 dereferenceable(197) %12) #2
  %14 = icmp slt i32 %13, 0
  br i1 %14, label %20, label %15

15:                                               ; preds = %11
  %16 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %17 = tail call noundef i32 @_ZNK4juce9Component8getRightEv(ptr noundef nonnull align 8 dereferenceable(197) %16) #2
  %18 = tail call noundef i32 @_ZNK4juce9Component8getWidthEv(ptr noundef nonnull align 8 dereferenceable(197) %0) #2
  %19 = icmp sgt i32 %17, %18
  br i1 %19, label %20, label %46

20:                                               ; preds = %15, %11, %8
  %21 = icmp slt i32 %1, %3
  br i1 %21, label %22, label %24

22:                                               ; preds = %20
  %23 = sub nsw i32 %3, %1
  br label %32

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %0, i64 264
  %26 = tail call noundef i32 @_ZNK4juce9Component8getWidthEv(ptr noundef nonnull align 8 dereferenceable(197) %25) #2
  %27 = sub nsw i32 %26, %3
  %.not = icmp sgt i32 %27, %1
  br i1 %.not, label %.thread, label %28

28:                                               ; preds = %24
  %29 = tail call noundef i32 @_ZNK4juce9Component8getWidthEv(ptr noundef nonnull align 8 dereferenceable(197) %25) #2
  %30 = add i32 %3, %1
  %31 = sub i32 %29, %30
  br label %32

32:                                               ; preds = %28, %22
  %.034 = phi i32 [ %23, %22 ], [ %31, %28 ]
  %33 = icmp slt i32 %.034, 0
  br i1 %33, label %34, label %.thread

34:                                               ; preds = %32
  %35 = sub nsw i32 0, %4
  %36 = getelementptr inbounds i8, ptr %0, i64 264
  %37 = tail call noundef i32 @_ZNK4juce9Component8getWidthEv(ptr noundef nonnull align 8 dereferenceable(197) %36) #2
  %38 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %39 = tail call noundef i32 @_ZNK4juce9Component8getRightEv(ptr noundef nonnull align 8 dereferenceable(197) %38) #2
  %40 = sub nsw i32 %37, %39
  %41 = tail call noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_S1_(i32 noundef %.034, i32 noundef %35, i32 noundef %40)
  br label %46

.thread:                                          ; preds = %24, %32
  %.03446 = phi i32 [ %.034, %32 ], [ 0, %24 ]
  %42 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %43 = tail call noundef i32 @_ZNK4juce9Component4getXEv(ptr noundef nonnull align 8 dereferenceable(197) %42) #2
  %44 = sub nsw i32 0, %43
  %45 = tail call noundef i32 @_ZN4juce4jminIiEET_S1_S1_S1_(i32 noundef %.03446, i32 noundef %4, i32 noundef %44)
  br label %46

46:                                               ; preds = %34, %.thread, %15
  %.135 = phi i32 [ %41, %34 ], [ %45, %.thread ], [ 0, %15 ]
  %47 = getelementptr inbounds i8, ptr %0, i64 464
  %48 = tail call noundef zeroext i1 @_ZNK4juce9Component9isVisibleEv(ptr noundef nonnull align 8 dereferenceable(197) %47) #2
  br i1 %48, label %58, label %49

49:                                               ; preds = %46
  %50 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %51 = tail call noundef i32 @_ZNK4juce9Component4getYEv(ptr noundef nonnull align 8 dereferenceable(197) %50) #2
  %52 = icmp slt i32 %51, 0
  br i1 %52, label %58, label %53

53:                                               ; preds = %49
  %54 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %55 = tail call noundef i32 @_ZNK4juce9Component9getBottomEv(ptr noundef nonnull align 8 dereferenceable(197) %54) #2
  %56 = tail call noundef i32 @_ZNK4juce9Component9getHeightEv(ptr noundef nonnull align 8 dereferenceable(197) %0) #2
  %57 = icmp sgt i32 %55, %56
  br i1 %57, label %58, label %84

58:                                               ; preds = %53, %49, %46
  %59 = icmp slt i32 %2, %3
  br i1 %59, label %60, label %62

60:                                               ; preds = %58
  %61 = sub nsw i32 %3, %2
  br label %70

62:                                               ; preds = %58
  %63 = getelementptr inbounds i8, ptr %0, i64 264
  %64 = tail call noundef i32 @_ZNK4juce9Component9getHeightEv(ptr noundef nonnull align 8 dereferenceable(197) %63) #2
  %65 = sub nsw i32 %64, %3
  %.not44 = icmp sgt i32 %65, %2
  br i1 %.not44, label %.thread47, label %66

66:                                               ; preds = %62
  %67 = tail call noundef i32 @_ZNK4juce9Component9getHeightEv(ptr noundef nonnull align 8 dereferenceable(197) %63) #2
  %68 = add i32 %3, %2
  %69 = sub i32 %67, %68
  br label %70

70:                                               ; preds = %66, %60
  %.033 = phi i32 [ %61, %60 ], [ %69, %66 ]
  %71 = icmp slt i32 %.033, 0
  br i1 %71, label %72, label %.thread47

72:                                               ; preds = %70
  %73 = sub nsw i32 0, %4
  %74 = getelementptr inbounds i8, ptr %0, i64 264
  %75 = tail call noundef i32 @_ZNK4juce9Component9getHeightEv(ptr noundef nonnull align 8 dereferenceable(197) %74) #2
  %76 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %77 = tail call noundef i32 @_ZNK4juce9Component9getBottomEv(ptr noundef nonnull align 8 dereferenceable(197) %76) #2
  %78 = sub nsw i32 %75, %77
  %79 = tail call noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_S1_(i32 noundef %.033, i32 noundef %73, i32 noundef %78)
  br label %84

.thread47:                                        ; preds = %62, %70
  %.03349 = phi i32 [ %.033, %70 ], [ 0, %62 ]
  %80 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %81 = tail call noundef i32 @_ZNK4juce9Component4getYEv(ptr noundef nonnull align 8 dereferenceable(197) %80) #2
  %82 = sub nsw i32 0, %81
  %83 = tail call noundef i32 @_ZN4juce4jminIiEET_S1_S1_S1_(i32 noundef %.03349, i32 noundef %4, i32 noundef %82)
  br label %84

84:                                               ; preds = %72, %.thread47, %53
  %.1 = phi i32 [ %79, %72 ], [ %83, %.thread47 ], [ 0, %53 ]
  %85 = or i32 %.1, %.135
  %or.cond.not.not = icmp eq i32 %85, 0
  br i1 %or.cond.not.not, label %.thread50, label %86

86:                                               ; preds = %84
  %87 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %88 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %89 = tail call noundef i32 @_ZNK4juce9Component4getXEv(ptr noundef nonnull align 8 dereferenceable(197) %88) #2
  %90 = add nsw i32 %89, %.135
  %91 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #2
  %92 = tail call noundef i32 @_ZNK4juce9Component4getYEv(ptr noundef nonnull align 8 dereferenceable(197) %91) #2
  %93 = add nsw i32 %92, %.1
  tail call void @_ZN4juce9Component18setTopLeftPositionEii(ptr noundef nonnull align 8 dereferenceable(197) %87, i32 noundef %90, i32 noundef %93)
  br label %.thread50

.thread50:                                        ; preds = %84, %5, %86
  %.137 = phi i1 [ true, %86 ], [ false, %5 ], [ false, %84 ]
  ret i1 %.137
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component9getBottomEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #0 align 2

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

!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)"}


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