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

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

; 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 uwtable
declare dso_local void @_ZN4juce9Component9setBoundsEiiii(ptr noundef nonnull align 8 dereferenceable(197), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce14LookAndFeel_V229positionDocumentWindowButtonsERNS_14DocumentWindowEiiiiPNS_6ButtonES4_S4_b(ptr noundef nonnull align 8 dereferenceable(304) %0, ptr noundef nonnull align 8 dereferenceable(400) %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, i1 noundef zeroext %9) unnamed_addr #1 align 2 {
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i8, align 1
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store i32 %2, ptr %13, align 4, !tbaa !9
  store i32 %3, ptr %14, align 4, !tbaa !9
  store i32 %4, ptr %15, align 4, !tbaa !9
  store i32 %5, ptr %16, align 4, !tbaa !9
  store ptr %6, ptr %17, align 8, !tbaa !5
  store ptr %7, ptr %18, align 8, !tbaa !5
  store ptr %8, ptr %19, align 8, !tbaa !5
  %23 = zext i1 %9 to i8
  store i8 %23, ptr %20, align 1, !tbaa !11
  %24 = load ptr, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %25 = load i32, ptr %16, align 4, !tbaa !9
  %26 = load i32, ptr %16, align 4, !tbaa !9
  %27 = sdiv i32 %26, 8
  %28 = sub nsw i32 %25, %27
  store i32 %28, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %29 = load i8, ptr %20, align 1, !tbaa !11, !range !13, !noundef !14
  %30 = trunc i8 %29 to i1
  br i1 %30, label %31, label %34

31:                                               ; preds = %10
  %32 = load i32, ptr %13, align 4, !tbaa !9
  %33 = add nsw i32 %32, 4
  br label %43

34:                                               ; preds = %10
  %35 = load i32, ptr %13, align 4, !tbaa !9
  %36 = load i32, ptr %15, align 4, !tbaa !9
  %37 = add nsw i32 %35, %36
  %38 = load i32, ptr %21, align 4, !tbaa !9
  %39 = sub nsw i32 %37, %38
  %40 = load i32, ptr %21, align 4, !tbaa !9
  %41 = sdiv i32 %40, 4
  %42 = sub nsw i32 %39, %41
  br label %43

43:                                               ; preds = %34, %31
  %44 = phi i32 [ %33, %31 ], [ %42, %34 ]
  store i32 %44, ptr %22, align 4, !tbaa !9
  %45 = load ptr, ptr %19, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %67

47:                                               ; preds = %43
  %48 = load ptr, ptr %19, align 8, !tbaa !5
  %49 = load i32, ptr %22, align 4, !tbaa !9
  %50 = load i32, ptr %14, align 4, !tbaa !9
  %51 = load i32, ptr %21, align 4, !tbaa !9
  %52 = load i32, ptr %16, align 4, !tbaa !9
  call void @_ZN4juce9Component9setBoundsEiiii(ptr noundef nonnull align 8 dereferenceable(197) %48, i32 noundef %49, i32 noundef %50, i32 noundef %51, i32 noundef %52)
  %53 = load i8, ptr %20, align 1, !tbaa !11, !range !13, !noundef !14
  %54 = trunc i8 %53 to i1
  br i1 %54, label %55, label %57

55:                                               ; preds = %47
  %56 = load i32, ptr %21, align 4, !tbaa !9
  br label %63

57:                                               ; preds = %47
  %58 = load i32, ptr %21, align 4, !tbaa !9
  %59 = load i32, ptr %21, align 4, !tbaa !9
  %60 = sdiv i32 %59, 4
  %61 = add nsw i32 %58, %60
  %62 = sub nsw i32 0, %61
  br label %63

63:                                               ; preds = %57, %55
  %64 = phi i32 [ %56, %55 ], [ %62, %57 ]
  %65 = load i32, ptr %22, align 4, !tbaa !9
  %66 = add nsw i32 %65, %64
  store i32 %66, ptr %22, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %63, %43
  %68 = load i8, ptr %20, align 1, !tbaa !11, !range !13, !noundef !14
  %69 = trunc i8 %68 to i1
  br i1 %69, label %70, label %71

70:                                               ; preds = %67
  call void @_ZSt4swapIPN4juce6ButtonEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #3
  br label %71

71:                                               ; preds = %70, %67
  %72 = load ptr, ptr %18, align 8, !tbaa !5
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %91

74:                                               ; preds = %71
  %75 = load ptr, ptr %18, align 8, !tbaa !5
  %76 = load i32, ptr %22, align 4, !tbaa !9
  %77 = load i32, ptr %14, align 4, !tbaa !9
  %78 = load i32, ptr %21, align 4, !tbaa !9
  %79 = load i32, ptr %16, align 4, !tbaa !9
  call void @_ZN4juce9Component9setBoundsEiiii(ptr noundef nonnull align 8 dereferenceable(197) %75, i32 noundef %76, i32 noundef %77, i32 noundef %78, i32 noundef %79)
  %80 = load i8, ptr %20, align 1, !tbaa !11, !range !13, !noundef !14
  %81 = trunc i8 %80 to i1
  br i1 %81, label %82, label %84

82:                                               ; preds = %74
  %83 = load i32, ptr %21, align 4, !tbaa !9
  br label %87

84:                                               ; preds = %74
  %85 = load i32, ptr %21, align 4, !tbaa !9
  %86 = sub nsw i32 0, %85
  br label %87

87:                                               ; preds = %84, %82
  %88 = phi i32 [ %83, %82 ], [ %86, %84 ]
  %89 = load i32, ptr %22, align 4, !tbaa !9
  %90 = add nsw i32 %89, %88
  store i32 %90, ptr %22, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %87, %71
  %92 = load ptr, ptr %17, align 8, !tbaa !5
  %93 = icmp ne ptr %92, null
  br i1 %93, label %94, label %100

94:                                               ; preds = %91
  %95 = load ptr, ptr %17, align 8, !tbaa !5
  %96 = load i32, ptr %22, align 4, !tbaa !9
  %97 = load i32, ptr %14, align 4, !tbaa !9
  %98 = load i32, ptr %21, align 4, !tbaa !9
  %99 = load i32, ptr %16, align 4, !tbaa !9
  call void @_ZN4juce9Component9setBoundsEiiii(ptr noundef nonnull align 8 dereferenceable(197) %95, i32 noundef %96, i32 noundef %97, i32 noundef %98, i32 noundef %99)
  br label %100

100:                                              ; preds = %94, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIPN4juce6ButtonEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


; 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 uwtable
declare dso_local void @_ZN4juce9Component9setBoundsEiiii(ptr noundef nonnull align 8 dereferenceable(197), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce14LookAndFeel_V229positionDocumentWindowButtonsERNS_14DocumentWindowEiiiiPNS_6ButtonES4_S4_b(ptr nocapture noundef nonnull readnone align 8 dereferenceable(304) %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(400) %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, i1 noundef zeroext %9) unnamed_addr #0 align 2 {
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %6, ptr %11, align 8, !tbaa !5
  store ptr %7, ptr %12, align 8, !tbaa !5
  %.neg = sdiv i32 %5, -8
  %13 = add i32 %.neg, %5
  %14 = sub i32 0, %13
  br i1 %9, label %15, label %.thread

15:                                               ; preds = %10
  %16 = add nsw i32 %2, 4
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %.thread46, label %.thread49

.thread:                                          ; preds = %10
  %17 = add nsw i32 %4, %2
  %18 = sub i32 %17, %13
  %.neg35 = sdiv i32 %13, -4
  %19 = add i32 %18, %.neg35
  %.not40 = icmp eq ptr %8, null
  br i1 %.not40, label %.thread42, label %21

.thread49:                                        ; preds = %15
  tail call void @_ZN4juce9Component9setBoundsEiiii(ptr noundef nonnull align 8 dereferenceable(197) %8, i32 noundef %16, i32 noundef %3, i32 noundef %13, i32 noundef %5)
  %20 = add nsw i32 %13, %16
  br label %.thread46

21:                                               ; preds = %.thread
  tail call void @_ZN4juce9Component9setBoundsEiiii(ptr noundef nonnull align 8 dereferenceable(197) %8, i32 noundef %19, i32 noundef %3, i32 noundef %13, i32 noundef %5)
  %.neg37 = sub i32 %.neg35, %13
  %22 = add nsw i32 %.neg37, %19
  br label %.thread42

.thread46:                                        ; preds = %15, %.thread49
  %.048 = phi i32 [ %20, %.thread49 ], [ %16, %15 ]
  call void @_ZSt4swapIPN4juce6ButtonEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #2
  %.pre = load ptr, ptr %12, align 8, !tbaa !5
  br label %.thread42

.thread42:                                        ; preds = %21, %.thread, %.thread46
  %23 = phi ptr [ %.pre, %.thread46 ], [ %7, %21 ], [ %7, %.thread ]
  %.044 = phi i32 [ %.048, %.thread46 ], [ %22, %21 ], [ %19, %.thread ]
  %.not38 = icmp eq ptr %23, null
  br i1 %.not38, label %27, label %24

24:                                               ; preds = %.thread42
  call void @_ZN4juce9Component9setBoundsEiiii(ptr noundef nonnull align 8 dereferenceable(197) %23, i32 noundef %.044, i32 noundef %3, i32 noundef %13, i32 noundef %5)
  %25 = select i1 %9, i32 %13, i32 %14
  %26 = add nsw i32 %.044, %25
  br label %27

27:                                               ; preds = %24, %.thread42
  %.1 = phi i32 [ %26, %24 ], [ %.044, %.thread42 ]
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %.not39 = icmp eq ptr %28, null
  br i1 %.not39, label %30, label %29

29:                                               ; preds = %27
  call void @_ZN4juce9Component9setBoundsEiiii(ptr noundef nonnull align 8 dereferenceable(197) %28, i32 noundef %.1, i32 noundef %3, i32 noundef %13, i32 noundef %5)
  br label %30

30:                                               ; preds = %29, %27
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIPN4juce6ButtonEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

attributes #0 = { 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 #1 = { 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 #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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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