; 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_vec2 = type { float, float }
%struct.nk_color = type { i8, i8, i8, i8 }

@.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_fill_circle = external hidden unnamed_addr constant [107 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
declare dso_local void @nk_draw_list_path_arc_to(ptr noundef, <2 x float>, float noundef, float noundef, float noundef, i32 noundef) #3

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

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

17:                                               ; preds = %5
  br label %20

18:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.1, i32 noundef 10441, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_fill_circle) #6
  unreachable

19:                                               ; No predecessors!
  br label %20

20:                                               ; preds = %19, %17
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %27

23:                                               ; preds = %20
  %24 = getelementptr inbounds %struct.nk_color, ptr %7, i32 0, i32 3
  %25 = load i8, ptr %24, align 1, !tbaa !13
  %26 = icmp ne i8 %25, 0
  br i1 %26, label %28, label %27

27:                                               ; preds = %23, %20
  store i32 1, ptr %12, align 4
  br label %43

28:                                               ; preds = %23
  %29 = load i32, ptr %10, align 4, !tbaa !11
  %30 = uitofp i32 %29 to float
  %31 = fsub float %30, 1.000000e+00
  %32 = fmul float 0x401921FB60000000, %31
  %33 = load i32, ptr %10, align 4, !tbaa !11
  %34 = uitofp i32 %33 to float
  %35 = fdiv float %32, %34
  store float %35, ptr %11, align 4, !tbaa !9
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !15
  %37 = load float, ptr %9, align 4, !tbaa !9
  %38 = load float, ptr %11, align 4, !tbaa !9
  %39 = load i32, ptr %10, align 4, !tbaa !11
  %40 = load <2 x float>, ptr %13, align 4
  call void @nk_draw_list_path_arc_to(ptr noundef %36, <2 x float> %40, float noundef %37, float noundef 0.000000e+00, float noundef %38, i32 noundef %39)
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %14, ptr align 1 %7, i64 4, i1 false), !tbaa.struct !16
  %42 = load i32, ptr %14, align 1
  call void @nk_draw_list_path_fill(ptr noundef %41, i32 %42)
  store i32 0, ptr %12, align 4
  br label %43

43:                                               ; preds = %28, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %44 = load i32, ptr %12, align 4
  switch i32 %44, label %46 [
    i32 0, label %45
    i32 1, label %45
  ]

45:                                               ; preds = %43, %43
  ret void

46:                                               ; preds = %43
  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 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 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 = { nounwind }
attributes #6 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !7, i64 3}
!14 = !{!"_ZTS8nk_color", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!15 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!16 = !{i64 0, i64 1, !17, i64 1, i64 1, !17, i64 2, i64 1, !17, i64 3, i64 1, !17}
!17 = !{!7, !7, 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.25 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.nk_draw_list_fill_circle = external hidden unnamed_addr constant [107 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
declare dso_local void @nk_draw_list_path_arc_to(ptr noundef, <2 x float>, float noundef, float noundef, float noundef, i32 noundef) local_unnamed_addr #1

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

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

6:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.1, i32 noundef 10441, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_fill_circle) #3
  unreachable

7:                                                ; preds = %5
  %.not13 = icmp ult i32 %3, 16777216
  br i1 %.not13, label %13, label %8

8:                                                ; preds = %7
  %9 = uitofp i32 %4 to float
  %10 = fadd float %9, -1.000000e+00
  %11 = fmul float %10, 0x401921FB60000000
  %12 = fdiv float %11, %9
  tail call void @nk_draw_list_path_arc_to(ptr noundef nonnull %0, <2 x float> %1, float noundef %2, float noundef 0.000000e+00, float noundef %12, i32 noundef %4)
  tail call void @nk_draw_list_path_fill(ptr noundef nonnull %0, i32 %3)
  br label %13

13:                                               ; preds = %7, %8
  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"="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 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)"}


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