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

%union.nk_handle = type { ptr }
%struct.nk_font_atlas = type { ptr, i32, i32, %struct.nk_allocator, %struct.nk_allocator, %struct.nk_recti, [7 x %struct.nk_cursor], i32, ptr, ptr, ptr, ptr, i32 }
%struct.nk_allocator = type { %union.nk_handle, ptr, ptr }
%struct.nk_recti = type { i16, i16, i16, i16 }
%struct.nk_cursor = type { %struct.nk_image, %struct.nk_vec2, %struct.nk_vec2 }
%struct.nk_image = type { %union.nk_handle, i16, i16, [4 x i16] }
%struct.nk_vec2 = type { float, float }

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [6 x i8], align 1
@__PRETTY_FUNCTION__.nk_font_atlas_begin = external hidden unnamed_addr constant [49 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [48 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @nk_font_atlas_begin(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca %union.nk_handle, align 8
  %4 = alloca %union.nk_handle, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = icmp ne ptr %5, null
  br i1 %6, label %7, label %8

7:                                                ; preds = %1
  br label %10

8:                                                ; preds = %1
  call void @__assert_fail(ptr noundef @.str.44, ptr noundef @.str.1, i32 noundef 17360, ptr noundef @__PRETTY_FUNCTION__.nk_font_atlas_begin) #3
  unreachable

9:                                                ; No predecessors!
  br label %10

10:                                               ; preds = %9, %7
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.nk_font_atlas, ptr %11, i32 0, i32 4
  %13 = getelementptr inbounds %struct.nk_allocator, ptr %12, i32 0, i32 1
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %22

16:                                               ; preds = %10
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.nk_font_atlas, ptr %17, i32 0, i32 4
  %19 = getelementptr inbounds %struct.nk_allocator, ptr %18, i32 0, i32 2
  %20 = load ptr, ptr %19, align 8, !tbaa !15
  %21 = icmp ne ptr %20, null
  br label %22

22:                                               ; preds = %16, %10
  %23 = phi i1 [ false, %10 ], [ %21, %16 ]
  br i1 %23, label %24, label %25

24:                                               ; preds = %22
  br label %27

25:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.48, ptr noundef @.str.1, i32 noundef 17361, ptr noundef @__PRETTY_FUNCTION__.nk_font_atlas_begin) #3
  unreachable

26:                                               ; No predecessors!
  br label %27

27:                                               ; preds = %26, %24
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.nk_font_atlas, ptr %28, i32 0, i32 3
  %30 = getelementptr inbounds %struct.nk_allocator, ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !16
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %39

33:                                               ; preds = %27
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.nk_font_atlas, ptr %34, i32 0, i32 3
  %36 = getelementptr inbounds %struct.nk_allocator, ptr %35, i32 0, i32 2
  %37 = load ptr, ptr %36, align 8, !tbaa !17
  %38 = icmp ne ptr %37, null
  br label %39

39:                                               ; preds = %33, %27
  %40 = phi i1 [ false, %27 ], [ %38, %33 ]
  br i1 %40, label %41, label %42

41:                                               ; preds = %39
  br label %44

42:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.49, ptr noundef @.str.1, i32 noundef 17362, ptr noundef @__PRETTY_FUNCTION__.nk_font_atlas_begin) #3
  unreachable

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %41
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %71

47:                                               ; preds = %44
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.nk_font_atlas, ptr %48, i32 0, i32 3
  %50 = getelementptr inbounds %struct.nk_allocator, ptr %49, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !16
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %71

53:                                               ; preds = %47
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.nk_font_atlas, ptr %54, i32 0, i32 3
  %56 = getelementptr inbounds %struct.nk_allocator, ptr %55, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %71

59:                                               ; preds = %53
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.nk_font_atlas, ptr %60, i32 0, i32 4
  %62 = getelementptr inbounds %struct.nk_allocator, ptr %61, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %71

65:                                               ; preds = %59
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.nk_font_atlas, ptr %66, i32 0, i32 4
  %68 = getelementptr inbounds %struct.nk_allocator, ptr %67, i32 0, i32 2
  %69 = load ptr, ptr %68, align 8, !tbaa !15
  %70 = icmp ne ptr %69, null
  br i1 %70, label %72, label %71

71:                                               ; preds = %65, %59, %53, %47, %44
  br label %112

72:                                               ; preds = %65
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.nk_font_atlas, ptr %73, i32 0, i32 8
  %75 = load ptr, ptr %74, align 8, !tbaa !18
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %92

77:                                               ; preds = %72
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.nk_font_atlas, ptr %78, i32 0, i32 3
  %80 = getelementptr inbounds %struct.nk_allocator, ptr %79, i32 0, i32 2
  %81 = load ptr, ptr %80, align 8, !tbaa !17
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.nk_font_atlas, ptr %82, i32 0, i32 3
  %84 = getelementptr inbounds %struct.nk_allocator, ptr %83, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %84, i64 8, i1 false), !tbaa.struct !19
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.nk_font_atlas, ptr %85, i32 0, i32 8
  %87 = load ptr, ptr %86, align 8, !tbaa !18
  %88 = getelementptr inbounds %union.nk_handle, ptr %3, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8
  call void %81(ptr %89, ptr noundef %87)
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.nk_font_atlas, ptr %90, i32 0, i32 8
  store ptr null, ptr %91, align 8, !tbaa !18
  br label %92

92:                                               ; preds = %77, %72
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.nk_font_atlas, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !21
  %96 = icmp ne ptr %95, null
  br i1 %96, label %97, label %112

97:                                               ; preds = %92
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.nk_font_atlas, ptr %98, i32 0, i32 3
  %100 = getelementptr inbounds %struct.nk_allocator, ptr %99, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !17
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.nk_font_atlas, ptr %102, i32 0, i32 3
  %104 = getelementptr inbounds %struct.nk_allocator, ptr %103, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %104, i64 8, i1 false), !tbaa.struct !19
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.nk_font_atlas, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !21
  %108 = getelementptr inbounds %union.nk_handle, ptr %4, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8
  call void %101(ptr %109, ptr noundef %107)
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.nk_font_atlas, ptr %110, i32 0, i32 0
  store ptr null, ptr %111, align 8, !tbaa !21
  br label %112

112:                                              ; preds = %97, %92, %71
  ret void
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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"="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 = { noreturn 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 48}
!10 = !{!"_ZTS13nk_font_atlas", !6, i64 0, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 40, !13, i64 64, !7, i64 72, !11, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !11, i64 392}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS12nk_allocator", !7, i64 0, !6, i64 8, !6, i64 16}
!13 = !{!"_ZTS8nk_recti", !14, i64 0, !14, i64 2, !14, i64 4, !14, i64 6}
!14 = !{!"short", !7, i64 0}
!15 = !{!10, !6, i64 56}
!16 = !{!10, !6, i64 24}
!17 = !{!10, !6, i64 32}
!18 = !{!10, !6, i64 360}
!19 = !{i64 0, i64 8, !20}
!20 = !{!7, !7, i64 0}
!21 = !{!10, !6, i64 0}


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

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [6 x i8], align 1
@__PRETTY_FUNCTION__.nk_font_atlas_begin = external hidden unnamed_addr constant [49 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [48 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @nk_font_atlas_begin(ptr noundef %0) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %2, label %3

2:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.44, ptr noundef nonnull @.str.1, i32 noundef 17360, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_font_atlas_begin) #2
  unreachable

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not26 = icmp eq ptr %5, null
  br i1 %.not26, label %.critedge, label %6

6:                                                ; preds = %3
  %7 = getelementptr inbounds i8, ptr %0, i64 56
  %8 = load ptr, ptr %7, align 8, !tbaa !14
  %.not27 = icmp eq ptr %8, null
  br i1 %.not27, label %.critedge, label %9

.critedge:                                        ; preds = %3, %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.48, ptr noundef nonnull @.str.1, i32 noundef 17361, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_font_atlas_begin) #2
  unreachable

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !15
  %.not28 = icmp eq ptr %12, null
  br i1 %.not28, label %.critedge2, label %13

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = load ptr, ptr %14, align 8, !tbaa !16
  %.not29 = icmp eq ptr %15, null
  br i1 %.not29, label %.critedge2, label %16

.critedge2:                                       ; preds = %9, %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.49, ptr noundef nonnull @.str.1, i32 noundef 17362, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_font_atlas_begin) #2
  unreachable

16:                                               ; preds = %13
  %17 = getelementptr inbounds i8, ptr %0, i64 360
  %18 = load ptr, ptr %17, align 8, !tbaa !17
  %.not30 = icmp eq ptr %18, null
  br i1 %.not30, label %20, label %19

19:                                               ; preds = %16
  %.sroa.03.0.copyload = load ptr, ptr %10, align 8, !tbaa !18
  tail call void %15(ptr %.sroa.03.0.copyload, ptr noundef nonnull %18)
  store ptr null, ptr %17, align 8, !tbaa !17
  br label %20

20:                                               ; preds = %19, %16
  %21 = load ptr, ptr %0, align 8, !tbaa !19
  %.not31 = icmp eq ptr %21, null
  br i1 %.not31, label %24, label %22

22:                                               ; preds = %20
  %23 = load ptr, ptr %14, align 8, !tbaa !16
  %.sroa.0.0.copyload = load ptr, ptr %10, align 8, !tbaa !18
  tail call void %23(ptr %.sroa.0.0.copyload, ptr noundef nonnull %21)
  store ptr null, ptr %0, align 8, !tbaa !19
  br label %24

24:                                               ; preds = %22, %20
  ret void
}

attributes #0 = { noreturn nounwind "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"="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 = { noreturn 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, !7, i64 48}
!6 = !{!"_ZTS13nk_font_atlas", !7, i64 0, !10, i64 8, !10, i64 12, !11, i64 16, !11, i64 40, !12, i64 64, !8, i64 72, !10, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !10, i64 392}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTS12nk_allocator", !8, i64 0, !7, i64 8, !7, i64 16}
!12 = !{!"_ZTS8nk_recti", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6}
!13 = !{!"short", !8, i64 0}
!14 = !{!6, !7, i64 56}
!15 = !{!6, !7, i64 24}
!16 = !{!6, !7, i64 32}
!17 = !{!6, !7, i64 360}
!18 = !{!8, !8, i64 0}
!19 = !{!6, !7, i64 0}


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