; LLVM IR from rcliftonharvey/dspfilters4juce :: DSPFilters4JUCEDemo/JuceLibraryCode/juce_opengl.ll (ZN4juce13OpenGLContextC2Ev)

; 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::OpenGLContext" = type <{ %"struct.juce::OpenGLExtensionFunctions", ptr, ptr, double, %"class.juce::ScopedPointer.1", %"class.juce::OpenGLPixelFormat", [4 x i8], ptr, i32, [4 x i8], i64, i8, i8, i8, [5 x i8] }>
%"struct.juce::OpenGLExtensionFunctions" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.juce::ScopedPointer.1" = type { ptr }
%"class.juce::OpenGLPixelFormat" = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8] }>

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce13OpenGLContextC2Ev(ptr noundef nonnull align 8 dereferenceable(491) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 0
  %5 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 1
  store ptr null, ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 2
  store ptr null, ptr %6, align 8, !tbaa !19
  %7 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 3
  store double 1.000000e+00, ptr %7, align 8, !tbaa !20
  %8 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 4
  call void @_ZN4juce13ScopedPointerINS_13OpenGLContext10AttachmentEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #2
  %9 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 5
  call void @_ZN4juce17OpenGLPixelFormatC1Eiiii(ptr noundef nonnull align 4 dereferenceable(41) %9, i32 noundef 8, i32 noundef 8, i32 noundef 16, i32 noundef 0) #2
  %10 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 7
  store ptr null, ptr %10, align 8, !tbaa !21
  %11 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 8
  store i32 0, ptr %11, align 8, !tbaa !22
  %12 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 10
  store i64 8388608, ptr %12, align 8, !tbaa !23
  %13 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 11
  store i8 1, ptr %13, align 8, !tbaa !24
  %14 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 12
  store i8 0, ptr %14, align 1, !tbaa !25
  %15 = getelementptr inbounds %"class.juce::OpenGLContext", ptr %3, i32 0, i32 13
  store i8 0, ptr %15, align 2, !tbaa !26
  ret void
}

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

declare void @_ZN4juce17OpenGLPixelFormatC1Eiiii(ptr, i32, i32, i32, i32)

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 = { 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"}
!9 = !{!10, !6, i64 384}
!10 = !{!"_ZTSN4juce13OpenGLContextE", !11, i64 0, !6, i64 384, !6, i64 392, !12, i64 400, !13, i64 408, !14, i64 416, !6, i64 464, !16, i64 472, !17, i64 480, !18, i64 488, !18, i64 489, !18, i64 490}
!11 = !{!"_ZTSN4juce24OpenGLExtensionFunctionsE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376}
!12 = !{!"double", !7, i64 0}
!13 = !{!"_ZTSN4juce13ScopedPointerINS_13OpenGLContext10AttachmentEEE", !6, i64 0}
!14 = !{!"_ZTSN4juce17OpenGLPixelFormatE", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !7, i64 40}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN4juce13OpenGLContext13OpenGLVersionE", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!10, !6, i64 392}
!20 = !{!10, !12, i64 400}
!21 = !{!10, !6, i64 464}
!22 = !{!10, !16, i64 472}
!23 = !{!10, !17, i64 480}
!24 = !{!10, !18, i64 488}
!25 = !{!10, !18, i64 489}
!26 = !{!10, !18, i64 490}


; 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
define dso_local void @_ZN4juce13OpenGLContextC2Ev(ptr noundef nonnull align 8 dereferenceable(491) %0) unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 384
  %3 = getelementptr inbounds i8, ptr %0, i64 400
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false)
  store double 1.000000e+00, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 408
  tail call void @_ZN4juce13ScopedPointerINS_13OpenGLContext10AttachmentEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %5 = getelementptr inbounds i8, ptr %0, i64 416
  tail call void @_ZN4juce17OpenGLPixelFormatC1Eiiii(ptr noundef nonnull align 4 dereferenceable(41) %5, i32 noundef 8, i32 noundef 8, i32 noundef 16, i32 noundef 0) #3
  %6 = getelementptr inbounds i8, ptr %0, i64 464
  store ptr null, ptr %6, align 8, !tbaa !18
  %7 = getelementptr inbounds i8, ptr %0, i64 472
  store i32 0, ptr %7, align 8, !tbaa !19
  %8 = getelementptr inbounds i8, ptr %0, i64 480
  store i64 8388608, ptr %8, align 8, !tbaa !20
  %9 = getelementptr inbounds i8, ptr %0, i64 488
  store i8 1, ptr %9, align 8, !tbaa !21
  %10 = getelementptr inbounds i8, ptr %0, i64 489
  store i8 0, ptr %10, align 1, !tbaa !22
  %11 = getelementptr inbounds i8, ptr %0, i64 490
  store i8 0, ptr %11, align 2, !tbaa !23
  ret void
}

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

declare void @_ZN4juce17OpenGLPixelFormatC1Eiiii(ptr, i32, i32, i32, i32) local_unnamed_addr

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11, i64 400}
!6 = !{!"_ZTSN4juce13OpenGLContextE", !7, i64 0, !8, i64 384, !8, i64 392, !11, i64 400, !12, i64 408, !13, i64 416, !8, i64 464, !15, i64 472, !16, i64 480, !17, i64 488, !17, i64 489, !17, i64 490}
!7 = !{!"_ZTSN4juce24OpenGLExtensionFunctionsE", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !8, i64 72, !8, i64 80, !8, i64 88, !8, i64 96, !8, i64 104, !8, i64 112, !8, i64 120, !8, i64 128, !8, i64 136, !8, i64 144, !8, i64 152, !8, i64 160, !8, i64 168, !8, i64 176, !8, i64 184, !8, i64 192, !8, i64 200, !8, i64 208, !8, i64 216, !8, i64 224, !8, i64 232, !8, i64 240, !8, i64 248, !8, i64 256, !8, i64 264, !8, i64 272, !8, i64 280, !8, i64 288, !8, i64 296, !8, i64 304, !8, i64 312, !8, i64 320, !8, i64 328, !8, i64 336, !8, i64 344, !8, i64 352, !8, i64 360, !8, i64 368, !8, i64 376}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"double", !9, i64 0}
!12 = !{!"_ZTSN4juce13ScopedPointerINS_13OpenGLContext10AttachmentEEE", !8, i64 0}
!13 = !{!"_ZTSN4juce17OpenGLPixelFormatE", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !9, i64 40}
!14 = !{!"int", !9, i64 0}
!15 = !{!"_ZTSN4juce13OpenGLContext13OpenGLVersionE", !9, i64 0}
!16 = !{!"long", !9, i64 0}
!17 = !{!"bool", !9, i64 0}
!18 = !{!6, !8, i64 464}
!19 = !{!6, !15, i64 472}
!20 = !{!6, !16, i64 480}
!21 = !{!6, !17, i64 488}
!22 = !{!6, !17, i64 489}
!23 = !{!6, !17, i64 490}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,SROAPass,TailCallElimPass