; 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_rect = type { float, float, float, float }
%struct.nk_vec2 = type { float, float }
%union.nk_handle = type { ptr }
%struct.nk_draw_list = type { %struct.nk_rect, [12 x %struct.nk_vec2], %struct.nk_convert_config, ptr, ptr, ptr, i32, i32, i32, i64, i32, i32, i32, i32 }
%struct.nk_convert_config = type { float, i32, i32, i32, i32, i32, %struct.nk_draw_null_texture, ptr, i64, i64 }
%struct.nk_draw_null_texture = type { %union.nk_handle, %struct.nk_vec2 }
%struct.nk_draw_command = type { i32, %struct.nk_rect, %union.nk_handle }

@_ZL12nk_null_rect = external hidden constant %struct.nk_rect, align 4
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.nk_draw_list_path_line_to = external hidden unnamed_addr constant [70 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; 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
define dso_local void @nk_draw_list_path_line_to(ptr noundef %0, <2 x float> %1) #3 {
  %3 = alloca %struct.nk_vec2, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.nk_rect, align 4
  %9 = alloca %union.nk_handle, align 8
  store <2 x float> %1, ptr %3, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = icmp ne ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  br label %15

13:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.1, i32 noundef 10190, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_path_line_to) #7
  unreachable

14:                                               ; No predecessors!
  br label %15

15:                                               ; preds = %14, %12
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  store i32 1, ptr %7, align 4
  br label %62

19:                                               ; preds = %15
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.nk_draw_list, ptr %20, i32 0, i32 8
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %30, label %24

24:                                               ; preds = %19
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 @_ZL12nk_null_rect, i64 16, i1 false), !tbaa.struct !19
  %26 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  %27 = load <2 x float>, ptr %26, align 4
  %28 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  %29 = load <2 x float>, ptr %28, align 4
  call void @_ZL21nk_draw_list_add_clipP12nk_draw_list7nk_rect(ptr noundef %25, <2 x float> %27, <2 x float> %29)
  br label %30

30:                                               ; preds = %24, %19
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = call noundef ptr @_ZL25nk_draw_list_command_lastP12nk_draw_list(ptr noundef %31)
  store ptr %32, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %53

35:                                               ; preds = %30
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.nk_draw_command, ptr %36, i32 0, i32 2
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.nk_draw_list, ptr %39, i32 0, i32 2
  %41 = getelementptr inbounds %struct.nk_convert_config, ptr %40, i32 0, i32 6
  %42 = getelementptr inbounds %struct.nk_draw_null_texture, ptr %41, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8, !tbaa !21
  %44 = icmp ne ptr %38, %43
  br i1 %44, label %45, label %53

45:                                               ; preds = %35
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.nk_draw_list, ptr %47, i32 0, i32 2
  %49 = getelementptr inbounds %struct.nk_convert_config, ptr %48, i32 0, i32 6
  %50 = getelementptr inbounds %struct.nk_draw_null_texture, ptr %49, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %50, i64 8, i1 false), !tbaa.struct !22
  %51 = getelementptr inbounds %union.nk_handle, ptr %9, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8
  call void @_ZL23nk_draw_list_push_imageP12nk_draw_list9nk_handle(ptr noundef %46, ptr %52)
  br label %53

53:                                               ; preds = %45, %35, %30
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = call noundef ptr @_ZL23nk_draw_list_alloc_pathP12nk_draw_listi(ptr noundef %54, i32 noundef 1)
  store ptr %55, ptr %5, align 8, !tbaa !5
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %59, label %58

58:                                               ; preds = %53
  store i32 1, ptr %7, align 4
  br label %62

59:                                               ; preds = %53
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.nk_vec2, ptr %60, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %61, ptr align 4 %3, i64 8, i1 false), !tbaa.struct !23
  store i32 0, ptr %7, align 4
  br label %62

62:                                               ; preds = %59, %58, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %63 = load i32, ptr %7, align 4
  switch i32 %63, label %65 [
    i32 0, label %64
    i32 1, label %64
  ]

64:                                               ; preds = %62, %62
  ret void

65:                                               ; preds = %62
  unreachable
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL21nk_draw_list_add_clipP12nk_draw_list7nk_rect(ptr noundef, <2 x float>, <2 x float>) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL25nk_draw_list_command_lastP12nk_draw_list(ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL23nk_draw_list_push_imageP12nk_draw_list9nk_handle(ptr noundef, ptr) #3

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL23nk_draw_list_alloc_pathP12nk_draw_listi(ptr noundef, i32 noundef) #5

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { mustprogress 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { 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, !15, i64 208}
!10 = !{!"_ZTS12nk_draw_list", !11, i64 0, !7, i64 16, !13, i64 112, !6, i64 176, !6, i64 184, !6, i64 192, !15, i64 200, !15, i64 204, !15, i64 208, !18, i64 216, !15, i64 224, !15, i64 228, !14, i64 232, !14, i64 236}
!11 = !{!"_ZTS7nk_rect", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!12 = !{!"float", !7, i64 0}
!13 = !{!"_ZTS17nk_convert_config", !12, i64 0, !14, i64 4, !14, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !16, i64 24, !6, i64 40, !18, i64 48, !18, i64 56}
!14 = !{!"_ZTS16nk_anti_aliasing", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTS20nk_draw_null_texture", !7, i64 0, !17, i64 8}
!17 = !{!"_ZTS7nk_vec2", !12, i64 0, !12, i64 4}
!18 = !{!"long", !7, i64 0}
!19 = !{i64 0, i64 4, !20, i64 4, i64 4, !20, i64 8, i64 4, !20, i64 12, i64 4, !20}
!20 = !{!12, !12, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{i64 0, i64 8, !21}
!23 = !{i64 0, i64 4, !20, i64 4, i64 4, !20}


; 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_rect = type { float, float, float, float }

@_ZL12nk_null_rect = external hidden local_unnamed_addr constant %struct.nk_rect, align 4
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.nk_draw_list_path_line_to = external hidden unnamed_addr constant [70 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_draw_list_path_line_to(ptr noundef %0, <2 x float> %1) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.1, i32 noundef 10190, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_path_line_to) #4
  unreachable

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 208
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %.not18 = icmp eq i32 %6, 0
  br i1 %.not18, label %7, label %8

7:                                                ; preds = %4
  %.sroa.01.0.copyload = load <2 x float>, ptr @_ZL12nk_null_rect, align 4
  %.sroa.2.0.copyload = load <2 x float>, ptr getelementptr inbounds (i8, ptr @_ZL12nk_null_rect, i64 8), align 4
  tail call void @_ZL21nk_draw_list_add_clipP12nk_draw_list7nk_rect(ptr noundef nonnull %0, <2 x float> %.sroa.01.0.copyload, <2 x float> %.sroa.2.0.copyload)
  br label %8

8:                                                ; preds = %7, %4
  %9 = tail call noundef ptr @_ZL25nk_draw_list_command_lastP12nk_draw_list(ptr noundef nonnull %0)
  %.not19 = icmp eq ptr %9, null
  br i1 %.not19, label %16, label %10

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %9, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !18
  %13 = getelementptr inbounds i8, ptr %0, i64 136
  %14 = load ptr, ptr %13, align 8, !tbaa !18
  %.not20 = icmp eq ptr %12, %14
  br i1 %.not20, label %16, label %15

15:                                               ; preds = %10
  tail call void @_ZL23nk_draw_list_push_imageP12nk_draw_list9nk_handle(ptr noundef nonnull %0, ptr %14)
  br label %16

16:                                               ; preds = %15, %10, %8
  %17 = tail call noundef ptr @_ZL23nk_draw_list_alloc_pathP12nk_draw_listi(ptr noundef nonnull %0, i32 noundef 1)
  %.not21 = icmp eq ptr %17, null
  br i1 %.not21, label %19, label %18

18:                                               ; preds = %16
  store <2 x float> %1, ptr %17, align 4
  br label %19

19:                                               ; preds = %16, %18
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL21nk_draw_list_add_clipP12nk_draw_list7nk_rect(ptr noundef, <2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL25nk_draw_list_command_lastP12nk_draw_list(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL23nk_draw_list_push_imageP12nk_draw_list9nk_handle(ptr noundef, ptr) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZL23nk_draw_list_alloc_pathP12nk_draw_listi(ptr noundef, i32 noundef) local_unnamed_addr #3

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"="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 #2 = { mustprogress 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 #3 = { 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 #4 = { 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, !13, i64 208}
!6 = !{!"_ZTS12nk_draw_list", !7, i64 0, !9, i64 16, !11, i64 112, !16, i64 176, !16, i64 184, !16, i64 192, !13, i64 200, !13, i64 204, !13, i64 208, !17, i64 216, !13, i64 224, !13, i64 228, !12, i64 232, !12, i64 236}
!7 = !{!"_ZTS7nk_rect", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTS17nk_convert_config", !8, i64 0, !12, i64 4, !12, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !14, i64 24, !16, i64 40, !17, i64 48, !17, i64 56}
!12 = !{!"_ZTS16nk_anti_aliasing", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!"_ZTS20nk_draw_null_texture", !9, i64 0, !15, i64 8}
!15 = !{!"_ZTS7nk_vec2", !8, i64 0, !8, i64 4}
!16 = !{!"any pointer", !9, i64 0}
!17 = !{!"long", !9, i64 0}
!18 = !{!9, !9, i64 0}


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