; 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.544" = 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 @_ZNK4juce6Colour7getARGBEv(ptr noundef nonnull align 1 dereferenceable(4)) #1

; 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

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 @_ZN4juce13PixmapHelpers27createColourPixmapFromImageEP9_XDisplayRKNS_5ImageE(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %1) #3 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 %"class.juce::HeapBlock.544", align 8
  %9 = alloca ptr, align 8
  %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 %"class.juce::Colour", align 1
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  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 8, ptr %8) #6
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = mul i32 %23, %24
  %26 = zext i32 %25 to i64
  invoke void @_ZN4juce9HeapBlockIjLb0EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %26)
          to label %27 unwind label %33

27:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %60, %27
  %29 = load i32, ptr %12, align 4, !tbaa !9
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %37, label %32

32:                                               ; preds = %28
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %63

33:                                               ; preds = %2
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %9, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %10, align 4
  br label %117

37:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %52, %37
  %39 = load i32, ptr %14, align 4, !tbaa !9
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %59

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = load i32, ptr %14, align 4, !tbaa !9
  %46 = load i32, ptr %12, align 4, !tbaa !9
  invoke void @_ZNK4juce5Image10getPixelAtEii(ptr dead_on_unwind writable sret(%"class.juce::Colour") align 1 %15, ptr noundef nonnull align 8 dereferenceable(8) %44, i32 noundef %45, i32 noundef %46)
          to label %47 unwind label %55

47:                                               ; preds = %43
  %48 = call noundef i32 @_ZNK4juce6Colour7getARGBEv(ptr noundef nonnull align 1 dereferenceable(4) %15) #6
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %11, align 4, !tbaa !9
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4juce9HeapBlockIjLb0EEixIiEERjT_(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef %49) #6
  store i32 %48, ptr %51, align 4, !tbaa !9
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %52

52:                                               ; preds = %47
  %53 = load i32, ptr %14, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %14, align 4, !tbaa !9
  br label %38, !llvm.loop !11

55:                                               ; preds = %43
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %116

59:                                               ; preds = %42
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %12, align 4, !tbaa !9
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %12, align 4, !tbaa !9
  br label %28, !llvm.loop !13

63:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = call noundef ptr @_ZNK4juce9HeapBlockIjLb0EE7getDataEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = load i32, ptr %7, align 4, !tbaa !9
  %68 = invoke ptr @XCreateImage(ptr noundef %64, ptr noundef null, i32 noundef 24, i32 noundef 2, i32 noundef 0, ptr noundef %65, i32 noundef %66, i32 noundef %67, i32 noundef 32, i32 noundef 0)
          to label %69 unwind label %102

69:                                               ; preds = %63
  store ptr %68, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.anon.545, ptr %71, i32 0, i32 35
  %73 = load ptr, ptr %72, align 8, !tbaa !14
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.anon.545, ptr %74, i32 0, i32 33
  %76 = load i32, ptr %75, align 8, !tbaa !17
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %struct.Screen, ptr %73, i64 %77
  %79 = getelementptr inbounds %struct.Screen, ptr %78, i32 0, i32 2
  %80 = load i64, ptr %79, align 8, !tbaa !18
  %81 = load i32, ptr %6, align 4, !tbaa !9
  %82 = load i32, ptr %7, align 4, !tbaa !9
  %83 = invoke i64 @XCreatePixmap(ptr noundef %70, i64 noundef %80, i32 noundef %81, i32 noundef %82, i32 noundef 24)
          to label %84 unwind label %106

84:                                               ; preds = %69
  store i64 %83, ptr %17, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = load i64, ptr %17, align 8, !tbaa !20
  %87 = invoke ptr @XCreateGC(ptr noundef %85, i64 noundef %86, i64 noundef 0, ptr noundef null)
          to label %88 unwind label %110

88:                                               ; preds = %84
  store ptr %87, ptr %18, align 8, !tbaa !5
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = load i64, ptr %17, align 8, !tbaa !20
  %91 = load ptr, ptr %18, align 8, !tbaa !5
  %92 = load ptr, ptr %16, align 8, !tbaa !5
  %93 = load i32, ptr %6, align 4, !tbaa !9
  %94 = load i32, ptr %7, align 4, !tbaa !9
  %95 = invoke i32 @XPutImage(ptr noundef %89, i64 noundef %90, ptr noundef %91, ptr noundef %92, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %93, i32 noundef %94)
          to label %96 unwind label %110

96:                                               ; preds = %88
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = load ptr, ptr %18, align 8, !tbaa !5
  %99 = invoke i32 @XFreeGC(ptr noundef %97, ptr noundef %98)
          to label %100 unwind label %110

100:                                              ; preds = %96
  %101 = load i64, ptr %17, align 8, !tbaa !20
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZN4juce9HeapBlockIjLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, 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 %101

102:                                              ; preds = %63
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %9, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %10, align 4
  br label %115

106:                                              ; preds = %69
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %9, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %10, align 4
  br label %114

110:                                              ; preds = %96, %88, %84
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %9, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %114

114:                                              ; preds = %110, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %115

115:                                              ; preds = %114, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %116

116:                                              ; preds = %115, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZN4juce9HeapBlockIjLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br label %117

117:                                              ; preds = %116, %33
  call void @llvm.lifetime.end.p0(i64 8, 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 %118

118:                                              ; preds = %117
  %119 = load ptr, ptr %9, align 8
  %120 = load i32, ptr %10, align 4
  %121 = insertvalue { ptr, i32 } poison, ptr %119, 0
  %122 = insertvalue { ptr, i32 } %121, i32 %120, 1
  resume { ptr, i32 } %122
}

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

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

declare ptr @XCreateImage(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

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

declare ptr @XCreateGC(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

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

declare i32 @XFreeGC(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockIjLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 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 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 = { 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 #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !6, i64 232}
!15 = !{!"_ZTS3$_0", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !6, i64 32, !16, i64 40, !16, i64 48, !16, 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, !16, i64 144, !16, 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, !16, i64 240, !16, i64 248, !10, i64 256, !10, i64 260, !6, i64 264, !6, i64 272, !10, i64 280, !6, i64 288}
!16 = !{!"long", !7, i64 0}
!17 = !{!15, !10, i64 224}
!18 = !{!19, !16, i64 16}
!19 = !{!"_ZTS6Screen", !6, i64 0, !6, i64 8, !16, 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, !16, i64 80, !16, i64 88, !16, i64 96, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !16, i64 120}
!20 = !{!16, !16, 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"

%"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.544" = 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 @_ZNK4juce6Colour7getARGBEv(ptr noundef nonnull align 1 dereferenceable(4)) local_unnamed_addr #1

; 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

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 @_ZN4juce13PixmapHelpers27createColourPixmapFromImageEP9_XDisplayRKNS_5ImageE(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %1) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::ScopedXLock", align 1
  %4 = alloca %"class.juce::HeapBlock.544", 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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %8 = mul i32 %7, %6
  %9 = zext i32 %8 to i64
  invoke void @_ZN4juce9HeapBlockIjLb0EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %9)
          to label %.preheader48 unwind label %22

.preheader48:                                     ; preds = %2
  %10 = icmp sgt i32 %7, 0
  %11 = icmp sgt i32 %6, 0
  %or.cond = and i1 %10, %11
  br i1 %or.cond, label %.preheader.us, label %._crit_edge54

.preheader.us:                                    ; preds = %.preheader48, %._crit_edge.us
  %.03853.us = phi i32 [ %15, %._crit_edge.us ], [ 0, %.preheader48 ]
  %.04152.us = phi i32 [ %18, %._crit_edge.us ], [ 0, %.preheader48 ]
  br label %12

12:                                               ; preds = %.preheader.us, %13
  %.13951.us = phi i32 [ %.03853.us, %.preheader.us ], [ %15, %13 ]
  %.04050.us = phi i32 [ 0, %.preheader.us ], [ %17, %13 ]
  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 %.04050.us, i32 noundef %.04152.us)
          to label %13 unwind label %.split.us

13:                                               ; preds = %12
  %14 = call noundef i32 @_ZNK4juce6Colour7getARGBEv(ptr noundef nonnull align 1 dereferenceable(4) %5) #6
  %15 = add nsw i32 %.13951.us, 1
  %16 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK4juce9HeapBlockIjLb0EEixIiEERjT_(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef %.13951.us) #6
  store i32 %14, ptr %16, align 4, !tbaa !5
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %17 = add nuw nsw i32 %.04050.us, 1
  %exitcond.not = icmp eq i32 %17, %6
  br i1 %exitcond.not, label %._crit_edge.us, label %12, !llvm.loop !9

._crit_edge.us:                                   ; preds = %13
  %18 = add nuw nsw i32 %.04152.us, 1
  %exitcond56.not = icmp eq i32 %18, %7
  br i1 %exitcond56.not, label %._crit_edge54, label %.preheader.us, !llvm.loop !11

.split.us:                                        ; preds = %12
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %46

._crit_edge54:                                    ; preds = %._crit_edge.us, %.preheader48
  %20 = call noundef ptr @_ZNK4juce9HeapBlockIjLb0EE7getDataEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %21 = invoke ptr @XCreateImage(ptr noundef %0, ptr noundef null, i32 noundef 24, i32 noundef 2, i32 noundef 0, ptr noundef %20, i32 noundef %6, i32 noundef %7, i32 noundef 32, i32 noundef 0)
          to label %24 unwind label %40

22:                                               ; preds = %2
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %47

24:                                               ; preds = %._crit_edge54
  %25 = getelementptr inbounds i8, ptr %0, i64 232
  %26 = load ptr, ptr %25, align 8, !tbaa !12
  %27 = getelementptr inbounds i8, ptr %0, i64 224
  %28 = load i32, ptr %27, align 8, !tbaa !16
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds %struct.Screen, ptr %26, i64 %29, i32 2
  %31 = load i64, ptr %30, align 8, !tbaa !17
  %32 = invoke i64 @XCreatePixmap(ptr noundef nonnull %0, i64 noundef %31, i32 noundef %6, i32 noundef %7, i32 noundef 24)
          to label %33 unwind label %42

33:                                               ; preds = %24
  %34 = invoke ptr @XCreateGC(ptr noundef nonnull %0, i64 noundef %32, i64 noundef 0, ptr noundef null)
          to label %35 unwind label %44

35:                                               ; preds = %33
  %36 = invoke i32 @XPutImage(ptr noundef nonnull %0, i64 noundef %32, ptr noundef %34, ptr noundef %21, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %6, i32 noundef %7)
          to label %37 unwind label %44

37:                                               ; preds = %35
  %38 = invoke i32 @XFreeGC(ptr noundef nonnull %0, ptr noundef %34)
          to label %39 unwind label %44

39:                                               ; preds = %37
  call void @_ZN4juce9HeapBlockIjLb0EED2Ev(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 %32

40:                                               ; preds = %._crit_edge54
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %46

42:                                               ; preds = %24
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %46

44:                                               ; preds = %37, %35, %33
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %46

46:                                               ; preds = %40, %44, %42, %.split.us
  %.pn45 = phi { ptr, i32 } [ %19, %.split.us ], [ %41, %40 ], [ %45, %44 ], [ %43, %42 ]
  call void @_ZN4juce9HeapBlockIjLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br label %47

47:                                               ; preds = %46, %22
  %.pn45.pn = phi { ptr, i32 } [ %.pn45, %46 ], [ %23, %22 ]
  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 } %.pn45.pn
}

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

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

declare ptr @XCreateImage(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

declare ptr @XCreateGC(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @XFreeGC(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockIjLb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 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 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 = { 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 #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !14, i64 232}
!13 = !{!"_ZTS3$_0", !14, i64 0, !14, i64 8, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !14, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !6, i64 64, !14, i64 72, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !14, i64 104, !6, i64 112, !6, i64 116, !14, i64 120, !14, i64 128, !6, i64 136, !15, i64 144, !15, i64 152, !14, i64 160, !14, i64 168, !14, i64 176, !14, i64 184, !6, i64 192, !14, i64 200, !14, i64 208, !14, i64 216, !6, i64 224, !6, i64 228, !14, i64 232, !15, i64 240, !15, i64 248, !6, i64 256, !6, i64 260, !14, i64 264, !14, i64 272, !6, i64 280, !14, i64 288}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!13, !6, i64 224}
!17 = !{!18, !15, i64 16}
!18 = !{!"_ZTS6Screen", !14, i64 0, !14, i64 8, !15, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !14, i64 48, !6, i64 56, !14, i64 64, !14, i64 72, !15, i64 80, !15, i64 88, !15, i64 96, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !15, i64 120}


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