; LLVM IR from kala13x/libxutils :: src/sys (cli)

; 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.xcli_bar_ = type { %struct.xcli_size_, i64, i64, i32, i32, i8, i8, i8, i8, double, i32, i8, i8, i8, i8, i8, i8, [256 x i8], [256 x i8], [256 x i8] }
%struct.xcli_size_ = type { i64, i64 }

; Function Attrs: nounwind uwtable
declare dso_local i32 @XProgBar_UpdateWindowSize(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @XProgBar_GetDefaults(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.xcli_bar_, ptr %3, i32 0, i32 3
  store i32 100000, ptr %4, align 8, !tbaa !9
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.xcli_bar_, ptr %5, i32 0, i32 1
  store i64 0, ptr %6, align 8, !tbaa !15
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.xcli_bar_, ptr %7, i32 0, i32 4
  store i32 0, ptr %8, align 4, !tbaa !16
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.xcli_bar_, ptr %9, i32 0, i32 10
  store i32 0, ptr %10, align 8, !tbaa !17
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.xcli_bar_, ptr %11, i32 0, i32 9
  store double 0.000000e+00, ptr %12, align 8, !tbaa !18
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.xcli_bar_, ptr %13, i32 0, i32 2
  store i64 0, ptr %14, align 8, !tbaa !19
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.xcli_bar_, ptr %15, i32 0, i32 5
  store i8 0, ptr %16, align 8, !tbaa !20
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.xcli_bar_, ptr %17, i32 0, i32 6
  store i8 0, ptr %18, align 1, !tbaa !21
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.xcli_bar_, ptr %19, i32 0, i32 8
  store i8 0, ptr %20, align 1, !tbaa !22
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.xcli_bar_, ptr %21, i32 0, i32 7
  store i8 0, ptr %22, align 2, !tbaa !23
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.xcli_bar_, ptr %23, i32 0, i32 11
  store i8 60, ptr %24, align 4, !tbaa !24
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.xcli_bar_, ptr %25, i32 0, i32 12
  store i8 62, ptr %26, align 1, !tbaa !25
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.xcli_bar_, ptr %27, i32 0, i32 13
  store i8 61, ptr %28, align 2, !tbaa !26
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.xcli_bar_, ptr %29, i32 0, i32 14
  store i8 32, ptr %30, align 1, !tbaa !27
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.xcli_bar_, ptr %31, i32 0, i32 15
  store i8 91, ptr %32, align 8, !tbaa !28
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.xcli_bar_, ptr %33, i32 0, i32 16
  store i8 93, ptr %34, align 1, !tbaa !29
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.xcli_bar_, ptr %35, i32 0, i32 17
  %37 = getelementptr inbounds [256 x i8], ptr %36, i64 0, i64 0
  call void @xstrnul(ptr noundef %37)
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.xcli_bar_, ptr %38, i32 0, i32 18
  %40 = getelementptr inbounds [256 x i8], ptr %39, i64 0, i64 0
  call void @xstrnul(ptr noundef %40)
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.xcli_bar_, ptr %41, i32 0, i32 19
  %43 = getelementptr inbounds [256 x i8], ptr %42, i64 0, i64 0
  call void @xstrnul(ptr noundef %43)
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = call i32 @XProgBar_UpdateWindowSize(ptr noundef %44)
  ret void
}

declare void @xstrnul(ptr noundef) #1

attributes #0 = { 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 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !13, i64 32}
!10 = !{!"xcli_bar_", !11, i64 0, !12, i64 16, !12, i64 24, !13, i64 32, !13, i64 36, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !14, i64 48, !13, i64 56, !7, i64 60, !7, i64 61, !7, i64 62, !7, i64 63, !7, i64 64, !7, i64 65, !7, i64 66, !7, i64 322, !7, i64 578}
!11 = !{!"xcli_size_", !12, i64 0, !12, i64 8}
!12 = !{!"long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!10, !12, i64 16}
!16 = !{!10, !13, i64 36}
!17 = !{!10, !13, i64 56}
!18 = !{!10, !14, i64 48}
!19 = !{!10, !12, i64 24}
!20 = !{!10, !7, i64 40}
!21 = !{!10, !7, i64 41}
!22 = !{!10, !7, i64 43}
!23 = !{!10, !7, i64 42}
!24 = !{!10, !7, i64 60}
!25 = !{!10, !7, i64 61}
!26 = !{!10, !7, i64 62}
!27 = !{!10, !7, i64 63}
!28 = !{!10, !7, i64 64}
!29 = !{!10, !7, i64 65}


; 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: nounwind uwtable
declare dso_local i32 @XProgBar_UpdateWindowSize(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @XProgBar_GetDefaults(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 100000, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = getelementptr inbounds i8, ptr %0, i64 36
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 0, ptr %5, align 8, !tbaa !13
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  store double 0.000000e+00, ptr %6, align 8, !tbaa !14
  %7 = getelementptr inbounds i8, ptr %0, i64 60
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  store i64 0, ptr %4, align 4
  store <4 x i8> <i8 60, i8 62, i8 61, i8 32>, ptr %7, align 4, !tbaa !15
  %8 = getelementptr inbounds i8, ptr %0, i64 64
  store i8 91, ptr %8, align 8, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %0, i64 65
  store i8 93, ptr %9, align 1, !tbaa !17
  %10 = getelementptr inbounds i8, ptr %0, i64 66
  tail call void @xstrnul(ptr noundef nonnull %10) #3
  %11 = getelementptr inbounds i8, ptr %0, i64 322
  tail call void @xstrnul(ptr noundef nonnull %11) #3
  %12 = getelementptr inbounds i8, ptr %0, i64 578
  tail call void @xstrnul(ptr noundef nonnull %12) #3
  %13 = tail call i32 @XProgBar_UpdateWindowSize(ptr noundef %0)
  ret void
}

declare void @xstrnul(ptr noundef) local_unnamed_addr #1

; 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 = { 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 = { "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 32}
!6 = !{!"xcli_bar_", !7, i64 0, !8, i64 16, !8, i64 24, !11, i64 32, !11, i64 36, !9, i64 40, !9, i64 41, !9, i64 42, !9, i64 43, !12, i64 48, !11, i64 56, !9, i64 60, !9, i64 61, !9, i64 62, !9, i64 63, !9, i64 64, !9, i64 65, !9, i64 66, !9, i64 322, !9, i64 578}
!7 = !{!"xcli_size_", !8, i64 0, !8, i64 8}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"double", !9, i64 0}
!13 = !{!6, !11, i64 56}
!14 = !{!6, !12, i64 48}
!15 = !{!9, !9, i64 0}
!16 = !{!6, !9, i64 64}
!17 = !{!6, !9, i64 65}


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