; 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_stroke_circle = external hidden unnamed_addr constant [116 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_stroke(ptr noundef, i32, i32 noundef, float noundef) #4

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

19:                                               ; preds = %6
  br label %22

20:                                               ; preds = %6
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.1, i32 noundef 10452, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_stroke_circle) #6
  unreachable

21:                                               ; No predecessors!
  br label %22

22:                                               ; preds = %21, %19
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %29

25:                                               ; preds = %22
  %26 = getelementptr inbounds %struct.nk_color, ptr %8, i32 0, i32 3
  %27 = load i8, ptr %26, align 1, !tbaa !13
  %28 = icmp ne i8 %27, 0
  br i1 %28, label %30, label %29

29:                                               ; preds = %25, %22
  store i32 1, ptr %14, align 4
  br label %46

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

46:                                               ; preds = %30, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %47 = load i32, ptr %14, align 4
  switch i32 %47, label %49 [
    i32 0, label %48
    i32 1, label %48
  ]

48:                                               ; preds = %46, %46
  ret void

49:                                               ; preds = %46
  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_stroke_circle = external hidden unnamed_addr constant [116 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_stroke(ptr noundef, i32, i32 noundef, float noundef) local_unnamed_addr #2

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

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

8:                                                ; preds = %6
  %.not14 = icmp ult i32 %3, 16777216
  br i1 %.not14, label %14, label %9

9:                                                ; preds = %8
  %10 = uitofp i32 %4 to float
  %11 = fadd float %10, -1.000000e+00
  %12 = fmul float %11, 0x401921FB60000000
  %13 = fdiv float %12, %10
  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 %13, i32 noundef %4)
  tail call void @nk_draw_list_path_stroke(ptr noundef nonnull %0, i32 %3, i32 noundef 1, float noundef %5)
  br label %14

14:                                               ; preds = %8, %9
  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