; LLVM IR from ClementineAccount/Albuquerque :: src/HelloSDL (main)

; 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.nk_nine_slice = type { %struct.nk_image, i16, i16, i16, i16 }
%struct.nk_image = type { %union.nk_handle, i16, i16, [4 x i16] }
%union.nk_handle = type { ptr }
%struct.nk_rect = type { float, float, float, float }

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL7nk_zeroPvm(ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @nk_sub9slice_handle(ptr dead_on_unwind noalias writable sret(%struct.nk_nine_slice) align 8 %0, ptr %1, i16 noundef zeroext %2, i16 noundef zeroext %3, <2 x float> %4, <2 x float> %5, i16 noundef zeroext %6, i16 noundef zeroext %7, i16 noundef zeroext %8, i16 noundef zeroext %9) #3 {
  %11 = alloca %union.nk_handle, align 8
  %12 = alloca %struct.nk_rect, align 4
  %13 = alloca i16, align 2
  %14 = alloca i16, align 2
  %15 = alloca i16, align 2
  %16 = alloca i16, align 2
  %17 = alloca i16, align 2
  %18 = alloca i16, align 2
  %19 = alloca ptr, align 8
  %20 = getelementptr inbounds %union.nk_handle, ptr %11, i32 0, i32 0
  store ptr %1, ptr %20, align 8
  %21 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 0
  store <2 x float> %4, ptr %21, align 4
  %22 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 1
  store <2 x float> %5, ptr %22, align 4
  store i16 %2, ptr %13, align 2, !tbaa !5
  store i16 %3, ptr %14, align 2, !tbaa !5
  store i16 %6, ptr %15, align 2, !tbaa !5
  store i16 %7, ptr %16, align 2, !tbaa !5
  store i16 %8, ptr %17, align 2, !tbaa !5
  store i16 %9, ptr %18, align 2, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %23 = getelementptr inbounds %struct.nk_nine_slice, ptr %0, i32 0, i32 0
  store ptr %23, ptr %19, align 8, !tbaa !9
  call void @_ZL7nk_zeroPvm(ptr noundef %0, i64 noundef 32)
  %24 = load ptr, ptr %19, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.nk_image, ptr %24, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !11
  %26 = load i16, ptr %13, align 2, !tbaa !5
  %27 = load ptr, ptr %19, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.nk_image, ptr %27, i32 0, i32 1
  store i16 %26, ptr %28, align 8, !tbaa !13
  %29 = load i16, ptr %14, align 2, !tbaa !5
  %30 = load ptr, ptr %19, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.nk_image, ptr %30, i32 0, i32 2
  store i16 %29, ptr %31, align 2, !tbaa !15
  %32 = getelementptr inbounds %struct.nk_rect, ptr %12, i32 0, i32 0
  %33 = load float, ptr %32, align 4, !tbaa !16
  %34 = fptoui float %33 to i16
  %35 = load ptr, ptr %19, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.nk_image, ptr %35, i32 0, i32 3
  %37 = getelementptr inbounds [4 x i16], ptr %36, i64 0, i64 0
  store i16 %34, ptr %37, align 4, !tbaa !5
  %38 = getelementptr inbounds %struct.nk_rect, ptr %12, i32 0, i32 1
  %39 = load float, ptr %38, align 4, !tbaa !19
  %40 = fptoui float %39 to i16
  %41 = load ptr, ptr %19, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.nk_image, ptr %41, i32 0, i32 3
  %43 = getelementptr inbounds [4 x i16], ptr %42, i64 0, i64 1
  store i16 %40, ptr %43, align 2, !tbaa !5
  %44 = getelementptr inbounds %struct.nk_rect, ptr %12, i32 0, i32 2
  %45 = load float, ptr %44, align 4, !tbaa !20
  %46 = fptoui float %45 to i16
  %47 = load ptr, ptr %19, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.nk_image, ptr %47, i32 0, i32 3
  %49 = getelementptr inbounds [4 x i16], ptr %48, i64 0, i64 2
  store i16 %46, ptr %49, align 4, !tbaa !5
  %50 = getelementptr inbounds %struct.nk_rect, ptr %12, i32 0, i32 3
  %51 = load float, ptr %50, align 4, !tbaa !21
  %52 = fptoui float %51 to i16
  %53 = load ptr, ptr %19, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.nk_image, ptr %53, i32 0, i32 3
  %55 = getelementptr inbounds [4 x i16], ptr %54, i64 0, i64 3
  store i16 %52, ptr %55, align 2, !tbaa !5
  %56 = load i16, ptr %15, align 2, !tbaa !5
  %57 = getelementptr inbounds %struct.nk_nine_slice, ptr %0, i32 0, i32 1
  store i16 %56, ptr %57, align 8, !tbaa !22
  %58 = load i16, ptr %16, align 2, !tbaa !5
  %59 = getelementptr inbounds %struct.nk_nine_slice, ptr %0, i32 0, i32 2
  store i16 %58, ptr %59, align 2, !tbaa !24
  %60 = load i16, ptr %17, align 2, !tbaa !5
  %61 = getelementptr inbounds %struct.nk_nine_slice, ptr %0, i32 0, i32 3
  store i16 %60, ptr %61, align 4, !tbaa !25
  %62 = load i16, ptr %18, align 2, !tbaa !5
  %63 = getelementptr inbounds %struct.nk_nine_slice, ptr %0, i32 0, i32 4
  store i16 %62, ptr %63, align 2, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  ret void
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { 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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{i64 0, i64 8, !12}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTS8nk_image", !7, i64 0, !6, i64 8, !6, i64 10, !7, i64 12}
!15 = !{!14, !6, i64 10}
!16 = !{!17, !18, i64 0}
!17 = !{!"_ZTS7nk_rect", !18, i64 0, !18, i64 4, !18, i64 8, !18, i64 12}
!18 = !{!"float", !7, i64 0}
!19 = !{!17, !18, i64 4}
!20 = !{!17, !18, i64 8}
!21 = !{!17, !18, i64 12}
!22 = !{!23, !6, i64 24}
!23 = !{!"_ZTS13nk_nine_slice", !14, i64 0, !6, i64 24, !6, i64 26, !6, i64 28, !6, i64 30}
!24 = !{!23, !6, i64 26}
!25 = !{!23, !6, i64 28}
!26 = !{!23, !6, i64 30}


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

%struct.nk_nine_slice = type { %struct.nk_image, i16, i16, i16, i16 }
%struct.nk_image = type { %union.nk_handle, i16, i16, [4 x i16] }
%union.nk_handle = type { ptr }

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL7nk_zeroPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @nk_sub9slice_handle(ptr dead_on_unwind noalias writable sret(%struct.nk_nine_slice) align 8 %0, ptr %1, i16 noundef zeroext %2, i16 noundef zeroext %3, <2 x float> %4, <2 x float> %5, i16 noundef zeroext %6, i16 noundef zeroext %7, i16 noundef zeroext %8, i16 noundef zeroext %9) local_unnamed_addr #1 {
  tail call void @_ZL7nk_zeroPvm(ptr noundef %0, i64 noundef 32)
  store ptr %1, ptr %0, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  store i16 %2, ptr %11, align 8, !tbaa !8
  %12 = getelementptr inbounds i8, ptr %0, i64 10
  store i16 %3, ptr %12, align 2, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %0, i64 12
  %14 = shufflevector <2 x float> %4, <2 x float> %5, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  %15 = fptoui <4 x float> %14 to <4 x i16>
  store <4 x i16> %15, ptr %13, align 4, !tbaa !12
  %16 = getelementptr inbounds i8, ptr %0, i64 24
  store i16 %6, ptr %16, align 8, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %0, i64 26
  store i16 %7, ptr %17, align 2, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %0, i64 28
  store i16 %8, ptr %18, align 4, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %0, i64 30
  store i16 %9, ptr %19, align 2, !tbaa !17
  ret void
}

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 = { mustprogress uwtable "min-legal-vector-width"="64" "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, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 8}
!9 = !{!"_ZTS8nk_image", !6, i64 0, !10, i64 8, !10, i64 10, !6, i64 12}
!10 = !{!"short", !6, i64 0}
!11 = !{!9, !10, i64 10}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !10, i64 24}
!14 = !{!"_ZTS13nk_nine_slice", !9, i64 0, !10, i64 24, !10, i64 26, !10, i64 28, !10, i64 30}
!15 = !{!14, !10, i64 26}
!16 = !{!14, !10, i64 28}
!17 = !{!14, !10, i64 30}


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