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

%"class.juce::Colour" = type { %"class.juce::PixelARGB" }
%"class.juce::PixelARGB" = type { %union.anon.77 }
%union.anon.77 = type { i32 }
%"class.juce::ScopedXLock" = type { i8 }
%"class.juce::HeapBlock.149" = type { ptr }
%struct.anon.545 = type { ptr, ptr, i32, i32, i32, i32, ptr, i64, i64, i64, i32, ptr, i32, i32, i32, i32, i32, ptr, i32, i32, ptr, ptr, i32, i64, i64, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, i32, i32, ptr, i64, i64, i32, i32, ptr, ptr, i32, ptr }
%struct.Screen = type { ptr, ptr, i64, i32, i32, i32, i32, i32, ptr, i32, ptr, ptr, i64, i64, i64, i32, i32, i32, i32, i64 }

declare i32 @__gxx_personality_v0(...)

; 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: nounwind
declare noundef i32 @_ZNK4juce5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: nounwind
declare noundef i32 @_ZNK4juce5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: nounwind
declare void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4)) unnamed_addr #1

declare void @_ZNK4juce5Image10getPixelAtEii(ptr dead_on_unwind writable sret(%"class.juce::Colour") align 1, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK4juce6Colour8getAlphaEv(ptr noundef nonnull align 1 dereferenceable(4)) #3 align 2

declare void @_ZN4juce11ScopedXLockC1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN4juce11ScopedXLockD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN4juce13PixmapHelpers25createMaskPixmapFromImageEP9_XDisplayRKNS_5ImageE(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %1) #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.juce::ScopedXLock", align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.juce::HeapBlock.149", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca %"class.juce::Colour", align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  call void @_ZN4juce11ScopedXLockC1Ev(ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = call noundef i32 @_ZNK4juce5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  store i32 %20, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call noundef i32 @_ZNK4juce5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  store i32 %22, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = add i32 %23, 7
  %25 = lshr i32 %24, 3
  store i32 %25, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @_ZN4juce9HeapBlockIcLb0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = mul i32 %26, %27
  %29 = zext i32 %28 to i64
  invoke void @_ZN4juce9HeapBlockIcLb0EE6callocEmm(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef %29, i64 noundef 1)
          to label %30 unwind label %41

30:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.anon.545, ptr %31, i32 0, i32 15
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = icmp eq i32 %33, 1
  %35 = zext i1 %34 to i8
  store i8 %35, ptr %12, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %96, %30
  %37 = load i32, ptr %13, align 4, !tbaa !9
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = icmp ult i32 %37, %38
  br i1 %39, label %45, label %40

40:                                               ; preds = %36
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %99

41:                                               ; preds = %2
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %10, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %11, align 4
  br label %121

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %92, %45
  %47 = load i32, ptr %15, align 4, !tbaa !9
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = icmp ult i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %95

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  %52 = load i8, ptr %12, align 1, !tbaa !14, !range !16, !noundef !17
  %53 = trunc i8 %52 to i1
  br i1 %53, label %54, label %58

54:                                               ; preds = %51
  %55 = load i32, ptr %15, align 4, !tbaa !9
  %56 = and i32 %55, 7
  %57 = sub i32 7, %56
  br label %61

58:                                               ; preds = %51
  %59 = load i32, ptr %15, align 4, !tbaa !9
  %60 = and i32 %59, 7
  br label %61

61:                                               ; preds = %58, %54
  %62 = phi i32 [ %57, %54 ], [ %60, %58 ]
  %63 = shl i32 1, %62
  %64 = trunc i32 %63 to i8
  store i8 %64, ptr %16, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %65 = load i32, ptr %13, align 4, !tbaa !9
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = mul i32 %65, %66
  %68 = load i32, ptr %15, align 4, !tbaa !9
  %69 = lshr i32 %68, 3
  %70 = add i32 %67, %69
  store i32 %70, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = load i32, ptr %15, align 4, !tbaa !9
  %73 = load i32, ptr %13, align 4, !tbaa !9
  invoke void @_ZNK4juce5Image10getPixelAtEii(ptr dead_on_unwind writable sret(%"class.juce::Colour") align 1 %18, ptr noundef nonnull align 8 dereferenceable(8) %71, i32 noundef %72, i32 noundef %73)
          to label %74 unwind label %87

74:                                               ; preds = %61
  %75 = call noundef zeroext i8 @_ZNK4juce6Colour8getAlphaEv(ptr noundef nonnull align 1 dereferenceable(4) %18) #6
  %76 = zext i8 %75 to i32
  %77 = icmp sge i32 %76, 128
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br i1 %77, label %78, label %91

78:                                               ; preds = %74
  %79 = load i8, ptr %16, align 1, !tbaa !18
  %80 = sext i8 %79 to i32
  %81 = load i32, ptr %17, align 4, !tbaa !9
  %82 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK4juce9HeapBlockIcLb0EEixIjEERcT_(ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef %81) #6
  %83 = load i8, ptr %82, align 1, !tbaa !18
  %84 = sext i8 %83 to i32
  %85 = or i32 %84, %80
  %86 = trunc i32 %85 to i8
  store i8 %86, ptr %82, align 1, !tbaa !18
  br label %91

87:                                               ; preds = %61
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %10, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %120

91:                                               ; preds = %78, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %15, align 4, !tbaa !9
  %94 = add i32 %93, 1
  store i32 %94, ptr %15, align 4, !tbaa !9
  br label %46, !llvm.loop !19

95:                                               ; preds = %50
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = add i32 %97, 1
  store i32 %98, ptr %13, align 4, !tbaa !9
  br label %36, !llvm.loop !21

99:                                               ; preds = %40
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.anon.545, ptr %101, i32 0, i32 35
  %103 = load ptr, ptr %102, align 8, !tbaa !22
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.anon.545, ptr %104, i32 0, i32 33
  %106 = load i32, ptr %105, align 8, !tbaa !23
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %struct.Screen, ptr %103, i64 %107
  %109 = getelementptr inbounds %struct.Screen, ptr %108, i32 0, i32 2
  %110 = load i64, ptr %109, align 8, !tbaa !24
  %111 = call noundef ptr @_ZNK4juce9HeapBlockIcLb0EE7getDataEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %112 = load i32, ptr %6, align 4, !tbaa !9
  %113 = load i32, ptr %7, align 4, !tbaa !9
  %114 = invoke i64 @XCreatePixmapFromBitmapData(ptr noundef %100, i64 noundef %110, ptr noundef %111, i32 noundef %112, i32 noundef %113, i64 noundef 1, i64 noundef 0, i32 noundef 1)
          to label %115 unwind label %116

115:                                              ; preds = %99
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @_ZN4juce9HeapBlockIcLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @_ZN4juce11ScopedXLockD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  ret i64 %114

116:                                              ; preds = %99
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %10, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %11, align 4
  br label %120

120:                                              ; preds = %116, %87
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  br label %121

121:                                              ; preds = %120, %41
  call void @_ZN4juce9HeapBlockIcLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @_ZN4juce11ScopedXLockD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  br label %122

122:                                              ; preds = %121
  %123 = load ptr, ptr %10, align 8
  %124 = load i32, ptr %11, align 4
  %125 = insertvalue { ptr, i32 } poison, ptr %123, 0
  %126 = insertvalue { ptr, i32 } %125, i32 %124, 1
  resume { ptr, i32 } %126
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockIcLb0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK4juce9HeapBlockIcLb0EEixIjEERcT_(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5 align 2

declare i64 @XCreatePixmapFromBitmapData(ptr noundef, i64 noundef, ptr noundef, i32 noundef, i32 noundef, i64 noundef, i64 noundef, i32 noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockIcLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "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 = { "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 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 #4 = { 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 #5 = { 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 #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 = !{!"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, !10, i64 92}
!12 = !{!"_ZTS3$_0", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !6, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !10, i64 64, !6, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !6, i64 104, !10, i64 112, !10, i64 116, !6, i64 120, !6, i64 128, !10, i64 136, !13, i64 144, !13, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !10, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !10, i64 224, !10, i64 228, !6, i64 232, !13, i64 240, !13, i64 248, !10, i64 256, !10, i64 260, !6, i64 264, !6, i64 272, !10, i64 280, !6, i64 288}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = !{!12, !6, i64 232}
!23 = !{!12, !10, i64 224}
!24 = !{!25, !13, i64 16}
!25 = !{!"_ZTS6Screen", !6, i64 0, !6, i64 8, !13, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !6, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !13, i64 120}


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

%"class.juce::Colour" = type { %"class.juce::PixelARGB" }
%"class.juce::PixelARGB" = type { %union.anon.77 }
%union.anon.77 = type { i32 }
%"class.juce::ScopedXLock" = type { i8 }
%"class.juce::HeapBlock.149" = type { ptr }
%struct.Screen = type { ptr, ptr, i64, i32, i32, i32, i32, i32, ptr, i32, ptr, ptr, i64, i64, i64, i32, i32, i32, i32, i64 }

declare i32 @__gxx_personality_v0(...)

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
declare noundef i32 @_ZNK4juce5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: nounwind
declare noundef i32 @_ZNK4juce5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4)) unnamed_addr #1

declare void @_ZNK4juce5Image10getPixelAtEii(ptr dead_on_unwind writable sret(%"class.juce::Colour") align 1, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK4juce6Colour8getAlphaEv(ptr noundef nonnull align 1 dereferenceable(4)) local_unnamed_addr #3 align 2

declare void @_ZN4juce11ScopedXLockC1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN4juce11ScopedXLockD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN4juce13PixmapHelpers25createMaskPixmapFromImageEP9_XDisplayRKNS_5ImageE(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %1) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::ScopedXLock", align 1
  %4 = alloca %"class.juce::HeapBlock.149", align 8
  %5 = alloca %"class.juce::Colour", align 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  call void @_ZN4juce11ScopedXLockC1Ev(ptr noundef nonnull align 1 dereferenceable(1) %3)
  %6 = call noundef i32 @_ZNK4juce5Image8getWidthEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  %7 = call noundef i32 @_ZNK4juce5Image9getHeightEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  %8 = add i32 %6, 7
  %9 = lshr i32 %8, 3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @_ZN4juce9HeapBlockIcLb0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %10 = mul i32 %9, %7
  %11 = zext i32 %10 to i64
  call void @_ZN4juce9HeapBlockIcLb0EE6callocEmm(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %11, i64 noundef 1)
  %.not = icmp eq i32 %7, 0
  %.not44 = icmp eq i32 %6, 0
  %or.cond = or i1 %.not, %.not44
  br i1 %or.cond, label %._crit_edge37, label %.preheader.lr.ph.split.us

.preheader.lr.ph.split.us:                        ; preds = %2
  %12 = getelementptr inbounds i8, ptr %0, i64 92
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %.fr45 = freeze i32 %13
  %14 = icmp eq i32 %.fr45, 1
  br i1 %14, label %.preheader.us.us, label %.preheader.us

.preheader.us.us:                                 ; preds = %.preheader.lr.ph.split.us, %._crit_edge.split.us.us.us
  %.03135.us.us = phi i32 [ %32, %._crit_edge.split.us.us.us ], [ 0, %.preheader.lr.ph.split.us ]
  %15 = mul i32 %.03135.us.us, %9
  br label %16

16:                                               ; preds = %30, %.preheader.us.us
  %.03034.us.us.us = phi i32 [ 0, %.preheader.us.us ], [ %31, %30 ]
  %17 = and i32 %.03034.us.us.us, 7
  %18 = xor i32 %17, 7
  %19 = lshr i32 %.03034.us.us.us, 3
  %20 = add i32 %19, %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  invoke void @_ZNK4juce5Image10getPixelAtEii(ptr dead_on_unwind nonnull writable sret(%"class.juce::Colour") align 1 %5, ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %.03034.us.us.us, i32 noundef %.03135.us.us)
          to label %21 unwind label %.split.us.split.us.split.us

21:                                               ; preds = %16
  %22 = call noundef zeroext i8 @_ZNK4juce6Colour8getAlphaEv(ptr noundef nonnull align 1 dereferenceable(4) %5) #6
  %23 = icmp slt i8 %22, 0
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br i1 %23, label %24, label %30

24:                                               ; preds = %21
  %25 = shl nuw nsw i32 1, %18
  %26 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK4juce9HeapBlockIcLb0EEixIjEERcT_(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef %20) #6
  %27 = load i8, ptr %26, align 1, !tbaa !12
  %28 = trunc nuw i32 %25 to i8
  %29 = or i8 %27, %28
  store i8 %29, ptr %26, align 1, !tbaa !12
  br label %30

30:                                               ; preds = %24, %21
  %31 = add nuw i32 %.03034.us.us.us, 1
  %exitcond49.not = icmp eq i32 %31, %6
  br i1 %exitcond49.not, label %._crit_edge.split.us.us.us, label %16, !llvm.loop !13

._crit_edge.split.us.us.us:                       ; preds = %30
  %32 = add nuw i32 %.03135.us.us, 1
  %exitcond50.not = icmp eq i32 %32, %7
  br i1 %exitcond50.not, label %._crit_edge37, label %.preheader.us.us, !llvm.loop !15

.split.us.split.us.split.us:                      ; preds = %16
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %61

.preheader.us:                                    ; preds = %.preheader.lr.ph.split.us, %._crit_edge.split.us39
  %.03135.us = phi i32 [ %50, %._crit_edge.split.us39 ], [ 0, %.preheader.lr.ph.split.us ]
  %34 = mul i32 %.03135.us, %9
  br label %35

35:                                               ; preds = %.preheader.us, %48
  %.03034.us38 = phi i32 [ 0, %.preheader.us ], [ %49, %48 ]
  %36 = and i32 %.03034.us38, 7
  %37 = lshr i32 %.03034.us38, 3
  %38 = add i32 %37, %34
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  invoke void @_ZNK4juce5Image10getPixelAtEii(ptr dead_on_unwind nonnull writable sret(%"class.juce::Colour") align 1 %5, ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %.03034.us38, i32 noundef %.03135.us)
          to label %39 unwind label %.split.split.us

39:                                               ; preds = %35
  %40 = call noundef zeroext i8 @_ZNK4juce6Colour8getAlphaEv(ptr noundef nonnull align 1 dereferenceable(4) %5) #6
  %41 = icmp slt i8 %40, 0
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br i1 %41, label %42, label %48

42:                                               ; preds = %39
  %43 = shl nuw nsw i32 1, %36
  %44 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK4juce9HeapBlockIcLb0EEixIjEERcT_(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef %38) #6
  %45 = load i8, ptr %44, align 1, !tbaa !12
  %46 = trunc nuw i32 %43 to i8
  %47 = or i8 %45, %46
  store i8 %47, ptr %44, align 1, !tbaa !12
  br label %48

48:                                               ; preds = %42, %39
  %49 = add nuw i32 %.03034.us38, 1
  %exitcond.not = icmp eq i32 %49, %6
  br i1 %exitcond.not, label %._crit_edge.split.us39, label %35, !llvm.loop !13

._crit_edge.split.us39:                           ; preds = %48
  %50 = add nuw i32 %.03135.us, 1
  %exitcond48.not = icmp eq i32 %50, %7
  br i1 %exitcond48.not, label %._crit_edge37, label %.preheader.us, !llvm.loop !15

.split.split.us:                                  ; preds = %35
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %61

._crit_edge37:                                    ; preds = %._crit_edge.split.us39, %._crit_edge.split.us.us.us, %2
  %52 = getelementptr inbounds i8, ptr %0, i64 232
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = getelementptr inbounds i8, ptr %0, i64 224
  %55 = load i32, ptr %54, align 8, !tbaa !17
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds %struct.Screen, ptr %53, i64 %56, i32 2
  %58 = load i64, ptr %57, align 8, !tbaa !18
  %59 = call noundef ptr @_ZNK4juce9HeapBlockIcLb0EE7getDataEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %60 = invoke i64 @XCreatePixmapFromBitmapData(ptr noundef nonnull %0, i64 noundef %58, ptr noundef %59, i32 noundef %6, i32 noundef %7, i64 noundef 1, i64 noundef 0, i32 noundef 1)
          to label %62 unwind label %63

61:                                               ; preds = %.split.us.split.us.split.us, %.split.split.us
  %.us-phi = phi { ptr, i32 } [ %51, %.split.split.us ], [ %33, %.split.us.split.us.split.us ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %65

62:                                               ; preds = %._crit_edge37
  call void @_ZN4juce9HeapBlockIcLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @_ZN4juce11ScopedXLockD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  ret i64 %60

63:                                               ; preds = %._crit_edge37
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %65

65:                                               ; preds = %63, %61
  %.pn = phi { ptr, i32 } [ %.us-phi, %61 ], [ %64, %63 ]
  call void @_ZN4juce9HeapBlockIcLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @_ZN4juce11ScopedXLockD1Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockIcLb0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockIcLb0EE6callocEmm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK4juce9HeapBlockIcLb0EEixIjEERcT_(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #5 align 2

declare i64 @XCreatePixmapFromBitmapData(ptr noundef, i64 noundef, ptr noundef, i32 noundef, i32 noundef, i64 noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockIcLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "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 = { "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 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 #4 = { 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 #5 = { 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 #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, !10, i64 92}
!6 = !{!"_ZTS3$_0", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !7, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !10, i64 64, !7, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !7, i64 104, !10, i64 112, !10, i64 116, !7, i64 120, !7, i64 128, !10, i64 136, !11, i64 144, !11, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !10, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !10, i64 224, !10, i64 228, !7, i64 232, !11, i64 240, !11, i64 248, !10, i64 256, !10, i64 260, !7, i64 264, !7, i64 272, !10, i64 280, !7, i64 288}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!8, !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!6, !7, i64 232}
!17 = !{!6, !10, i64 224}
!18 = !{!19, !11, i64 16}
!19 = !{!"_ZTS6Screen", !7, i64 0, !7, i64 8, !11, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !7, i64 48, !10, i64 56, !7, i64 64, !7, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !11, i64 120}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass