; LLVM IR from drohmer/cgp :: library/cgp/14_window/window (window)

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

%"struct.cgp::window_structure" = type <{ ptr, ptr, i32, i32, i32, i32, i32, i32, i8, [7 x i8] }>
%struct.GLFWvidmode = type { i32, i32, i32, i32, i32, i32 }

; 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
define dso_local void @_ZN3cgp16window_structure13create_windowEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(41) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %4, i32 noundef %5) #1 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  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 ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  %14 = load ptr, ptr %7, align 8
  %15 = load i32, ptr %8, align 4, !tbaa !9
  %16 = load i32, ptr %9, align 4, !tbaa !9
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  %18 = load i32, ptr %11, align 4, !tbaa !9
  %19 = load i32, ptr %12, align 4, !tbaa !9
  %20 = call noundef ptr @_ZN3cgpL18glfw_create_windowEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiiP11GLFWmonitorP10GLFWwindow(i32 noundef %15, i32 noundef %16, ptr noundef nonnull align 8 dereferenceable(32) %17, i32 noundef %18, i32 noundef %19, ptr noundef null, ptr noundef null)
  %21 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 0
  store ptr %20, ptr %21, align 8, !tbaa !11
  %22 = call ptr @glfwGetPrimaryMonitor()
  %23 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 1
  store ptr %22, ptr %23, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %24 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = call ptr @glfwGetVideoMode(ptr noundef %25)
  store ptr %26, ptr %13, align 8, !tbaa !5
  %27 = load ptr, ptr %13, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.GLFWvidmode, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 4, !tbaa !15
  %30 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 6
  store i32 %29, ptr %30, align 8, !tbaa !17
  %31 = load ptr, ptr %13, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.GLFWvidmode, ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !18
  %34 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 7
  store i32 %33, ptr %34, align 4, !tbaa !19
  %35 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 2
  %38 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 3
  call void @glfwGetWindowPos(ptr noundef %36, ptr noundef %37, ptr noundef %38)
  %39 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 4
  %42 = getelementptr inbounds %"struct.cgp::window_structure", ptr %14, i32 0, i32 5
  call void @glfwGetWindowSize(ptr noundef %40, ptr noundef %41, ptr noundef %42)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN3cgpL18glfw_create_windowEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiiP11GLFWmonitorP10GLFWwindow(i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, ptr noundef, ptr noundef) #1

declare ptr @glfwGetPrimaryMonitor() #2

declare ptr @glfwGetVideoMode(ptr noundef) #2

declare void @glfwGetWindowPos(ptr noundef, ptr noundef, ptr noundef) #2

declare void @glfwGetWindowSize(ptr noundef, ptr noundef, ptr noundef) #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 = { "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, !6, i64 0}
!12 = !{!"_ZTSN3cgp16window_structureE", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !13, i64 40}
!13 = !{!"bool", !7, i64 0}
!14 = !{!12, !6, i64 8}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTS11GLFWvidmode", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!17 = !{!12, !10, i64 32}
!18 = !{!16, !10, i64 4}
!19 = !{!12, !10, i64 36}


; 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
define dso_local void @_ZN3cgp16window_structure13create_windowEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEii(ptr noundef nonnull align 8 dereferenceable(41) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #0 align 2 {
  %7 = tail call noundef ptr @_ZN3cgpL18glfw_create_windowEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiiP11GLFWmonitorP10GLFWwindow(i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef %4, i32 noundef %5, ptr noundef null, ptr noundef null)
  store ptr %7, ptr %0, align 8, !tbaa !5
  %8 = tail call ptr @glfwGetPrimaryMonitor()
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %8, ptr %9, align 8, !tbaa !12
  %10 = tail call ptr @glfwGetVideoMode(ptr noundef %8)
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = load <2 x i32>, ptr %10, align 4, !tbaa !13
  store <2 x i32> %12, ptr %11, align 8, !tbaa !13
  %13 = load ptr, ptr %0, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = getelementptr inbounds i8, ptr %0, i64 20
  tail call void @glfwGetWindowPos(ptr noundef %13, ptr noundef nonnull %14, ptr noundef nonnull %15)
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = getelementptr inbounds i8, ptr %0, i64 28
  tail call void @glfwGetWindowSize(ptr noundef %16, ptr noundef nonnull %17, ptr noundef nonnull %18)
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN3cgpL18glfw_create_windowEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiiP11GLFWmonitorP10GLFWwindow(i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @glfwGetPrimaryMonitor() local_unnamed_addr #1

declare ptr @glfwGetVideoMode(ptr noundef) local_unnamed_addr #1

declare void @glfwGetWindowPos(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @glfwGetWindowSize(ptr noundef, ptr noundef, ptr noundef) 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 = { "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" }

!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, !7, i64 0}
!6 = !{!"_ZTSN3cgp16window_structureE", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !11, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!6, !7, i64 8}
!13 = !{!10, !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass