; 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 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
declare hidden void @_ZL7nk_zeroPvm(ptr noundef, i64 noundef) #1

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

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 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !10, i64 8}
!15 = !{!"_ZTS8nk_image", !7, i64 0, !10, i64 8, !10, i64 10, !7, i64 12}
!16 = !{!15, !10, i64 10}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTS7nk_rect", !19, i64 0, !19, i64 4, !19, i64 8, !19, i64 12}
!19 = !{!"float", !7, i64 0}
!20 = !{!18, !19, i64 4}
!21 = !{!18, !19, i64 8}
!22 = !{!18, !19, i64 12}
!23 = !{!24, !10, i64 24}
!24 = !{!"_ZTS13nk_nine_slice", !15, i64 0, !10, i64 24, !10, i64 26, !10, i64 28, !10, i64 30}
!25 = !{!24, !10, i64 26}
!26 = !{!24, !10, i64 28}
!27 = !{!24, !10, 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_id(ptr dead_on_unwind noalias writable sret(%struct.nk_nine_slice) align 8 %0, i32 noundef %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 i32 %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