; 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_color = type { i8, i8, i8, i8 }
%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_rect = type { float, float, float, float }
%struct.nk_vec2 = type { float, float }
%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 }
%union.nk_handle = type { ptr }

@.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_stroke = external hidden unnamed_addr constant [103 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 nounwind uwtable
declare dso_local ptr @nk_buffer_memory(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @nk_draw_list_stroke_poly_line(ptr noundef, ptr noundef, i32 noundef, i32, i32 noundef, float noundef, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @nk_draw_list_path_clear(ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @nk_draw_list_path_stroke(ptr noundef %0, i32 %1, i32 noundef %2, float noundef %3) #5 {
  %5 = alloca %struct.nk_color, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.nk_color, align 1
  store i32 %1, ptr %5, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store float %3, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %4
  br label %17

15:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.1, i32 noundef 10329, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_path_stroke) #7
  unreachable

16:                                               ; No predecessors!
  br label %17

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

20:                                               ; preds = %17
  store i32 1, ptr %10, align 4
  br label %39

21:                                               ; preds = %17
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.nk_draw_list, ptr %22, i32 0, i32 3
  %24 = load ptr, ptr %23, align 8, !tbaa !13
  %25 = call ptr @nk_buffer_memory(ptr noundef %24)
  store ptr %25, ptr %9, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.nk_draw_list, ptr %28, i32 0, i32 10
  %30 = load i32, ptr %29, align 8, !tbaa !22
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %11, ptr align 1 %5, i64 4, i1 false), !tbaa.struct !23
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = load float, ptr %8, align 4, !tbaa !11
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.nk_draw_list, ptr %33, i32 0, i32 2
  %35 = getelementptr inbounds %struct.nk_convert_config, ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 4, !tbaa !25
  %37 = load i32, ptr %11, align 1
  call void @nk_draw_list_stroke_poly_line(ptr noundef %26, ptr noundef %27, i32 noundef %30, i32 %37, i32 noundef %31, float noundef %32, i32 noundef %36)
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  call void @nk_draw_list_path_clear(ptr noundef %38)
  store i32 0, ptr %10, align 4
  br label %39

39:                                               ; preds = %21, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %40 = load i32, ptr %10, align 4
  switch i32 %40, label %42 [
    i32 0, label %41
    i32 1, label %41
  ]

41:                                               ; preds = %39, %39
  ret void

42:                                               ; preds = %39
  unreachable
}

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 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 #4 = { 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 #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, !10, i64 0}
!10 = !{!"_ZTS19nk_draw_list_stroke", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !6, i64 176}
!14 = !{!"_ZTS12nk_draw_list", !15, i64 0, !7, i64 16, !16, i64 112, !6, i64 176, !6, i64 184, !6, i64 192, !18, i64 200, !18, i64 204, !18, i64 208, !21, i64 216, !18, i64 224, !18, i64 228, !17, i64 232, !17, i64 236}
!15 = !{!"_ZTS7nk_rect", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!16 = !{!"_ZTS17nk_convert_config", !12, i64 0, !17, i64 4, !17, i64 8, !18, i64 12, !18, i64 16, !18, i64 20, !19, i64 24, !6, i64 40, !21, i64 48, !21, i64 56}
!17 = !{!"_ZTS16nk_anti_aliasing", !7, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTS20nk_draw_null_texture", !7, i64 0, !20, i64 8}
!20 = !{!"_ZTS7nk_vec2", !12, i64 0, !12, i64 4}
!21 = !{!"long", !7, i64 0}
!22 = !{!14, !18, i64 224}
!23 = !{i64 0, i64 1, !24, i64 1, i64 1, !24, i64 2, i64 1, !24, i64 3, i64 1, !24}
!24 = !{!7, !7, i64 0}
!25 = !{!14, !17, i64 116}


; 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.25 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.nk_draw_list_path_stroke = external hidden unnamed_addr constant [103 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 nounwind uwtable
declare dso_local ptr @nk_buffer_memory(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @nk_draw_list_stroke_poly_line(ptr noundef, ptr noundef, i32 noundef, i32, i32 noundef, float noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @nk_draw_list_path_clear(ptr noundef) local_unnamed_addr #1

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

5:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.1, i32 noundef 10329, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_path_stroke) #4
  unreachable

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %0, i64 176
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = tail call ptr @nk_buffer_memory(ptr noundef %8)
  %10 = getelementptr inbounds i8, ptr %0, i64 224
  %11 = load i32, ptr %10, align 8, !tbaa !18
  %12 = getelementptr inbounds i8, ptr %0, i64 116
  %13 = load i32, ptr %12, align 4, !tbaa !19
  tail call void @nk_draw_list_stroke_poly_line(ptr noundef nonnull %0, ptr noundef %9, i32 noundef %11, i32 %1, i32 noundef %2, float noundef %3, i32 noundef %13)
  tail call void @nk_draw_list_path_clear(ptr noundef nonnull %0)
  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 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 #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 = { 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, !16, i64 176}
!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 = !{!6, !13, i64 224}
!19 = !{!6, !12, i64 116}


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