; 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 }
%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_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_stroke_line = external hidden unnamed_addr constant [109 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: mustprogress nounwind uwtable
declare dso_local <2 x float> @nk_vec2(float noundef, float noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @nk_draw_list_path_line_to(ptr noundef, <2 x float>) #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @nk_draw_list_stroke_line(ptr noundef %0, <2 x float> %1, <2 x float> %2, i32 %3, float noundef %4) #4 {
  %6 = alloca %struct.nk_vec2, align 4
  %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 %struct.nk_vec2, align 4
  %12 = alloca %struct.nk_vec2, align 4
  %13 = alloca %struct.nk_vec2, align 4
  %14 = alloca %struct.nk_vec2, align 4
  %15 = alloca %struct.nk_vec2, align 4
  %16 = alloca %struct.nk_vec2, align 4
  %17 = alloca %struct.nk_vec2, align 4
  %18 = alloca %struct.nk_vec2, align 4
  %19 = alloca %struct.nk_color, align 1
  store <2 x float> %1, ptr %6, align 4
  store <2 x float> %2, ptr %7, align 4
  store i32 %3, ptr %8, align 1
  store ptr %0, ptr %9, align 8, !tbaa !5
  store float %4, ptr %10, align 4, !tbaa !9
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %5
  br label %25

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

24:                                               ; No predecessors!
  br label %25

25:                                               ; preds = %24, %22
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %32

28:                                               ; preds = %25
  %29 = getelementptr inbounds %struct.nk_color, ptr %8, i32 0, i32 3
  %30 = load i8, ptr %29, align 1, !tbaa !11
  %31 = icmp ne i8 %30, 0
  br i1 %31, label %33, label %32

32:                                               ; preds = %28, %25
  br label %78

33:                                               ; preds = %28
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.nk_draw_list, ptr %34, i32 0, i32 12
  %36 = load i32, ptr %35, align 8, !tbaa !13
  %37 = icmp eq i32 %36, 1
  br i1 %37, label %38, label %43

38:                                               ; preds = %33
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !22
  %40 = load <2 x float>, ptr %11, align 4
  call void @nk_draw_list_path_line_to(ptr noundef %39, <2 x float> %40)
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !22
  %42 = load <2 x float>, ptr %12, align 4
  call void @nk_draw_list_path_line_to(ptr noundef %41, <2 x float> %42)
  br label %74

43:                                               ; preds = %33
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.nk_vec2, ptr %6, i32 0, i32 0
  %46 = load float, ptr %45, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %47 = call <2 x float> @nk_vec2(float noundef 5.000000e-01, float noundef 5.000000e-01)
  store <2 x float> %47, ptr %14, align 4
  %48 = getelementptr inbounds %struct.nk_vec2, ptr %14, i32 0, i32 0
  %49 = load float, ptr %48, align 4, !tbaa !23
  %50 = fsub float %46, %49
  %51 = getelementptr inbounds %struct.nk_vec2, ptr %6, i32 0, i32 1
  %52 = load float, ptr %51, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %53 = call <2 x float> @nk_vec2(float noundef 5.000000e-01, float noundef 5.000000e-01)
  store <2 x float> %53, ptr %15, align 4
  %54 = getelementptr inbounds %struct.nk_vec2, ptr %15, i32 0, i32 1
  %55 = load float, ptr %54, align 4, !tbaa !24
  %56 = fsub float %52, %55
  %57 = call <2 x float> @nk_vec2(float noundef %50, float noundef %56)
  store <2 x float> %57, ptr %13, align 4
  %58 = load <2 x float>, ptr %13, align 4
  call void @nk_draw_list_path_line_to(ptr noundef %44, <2 x float> %58)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.nk_vec2, ptr %7, i32 0, i32 0
  %61 = load float, ptr %60, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %62 = call <2 x float> @nk_vec2(float noundef 5.000000e-01, float noundef 5.000000e-01)
  store <2 x float> %62, ptr %17, align 4
  %63 = getelementptr inbounds %struct.nk_vec2, ptr %17, i32 0, i32 0
  %64 = load float, ptr %63, align 4, !tbaa !23
  %65 = fsub float %61, %64
  %66 = getelementptr inbounds %struct.nk_vec2, ptr %7, i32 0, i32 1
  %67 = load float, ptr %66, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %68 = call <2 x float> @nk_vec2(float noundef 5.000000e-01, float noundef 5.000000e-01)
  store <2 x float> %68, ptr %18, align 4
  %69 = getelementptr inbounds %struct.nk_vec2, ptr %18, i32 0, i32 1
  %70 = load float, ptr %69, align 4, !tbaa !24
  %71 = fsub float %67, %70
  %72 = call <2 x float> @nk_vec2(float noundef %65, float noundef %71)
  store <2 x float> %72, ptr %16, align 4
  %73 = load <2 x float>, ptr %16, align 4
  call void @nk_draw_list_path_line_to(ptr noundef %59, <2 x float> %73)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %74

74:                                               ; preds = %43, %38
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %19, ptr align 1 %8, i64 4, i1 false), !tbaa.struct !25
  %76 = load float, ptr %10, align 4, !tbaa !9
  %77 = load i32, ptr %19, align 1
  call void @nk_draw_list_path_stroke(ptr noundef %75, i32 %77, i32 noundef 0, float noundef %76)
  br label %78

78:                                               ; preds = %74, %32
  ret void
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { noreturn nounwind }
attributes #7 = { 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, !7, i64 3}
!12 = !{!"_ZTS8nk_color", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!13 = !{!14, !17, i64 232}
!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", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!16 = !{!"_ZTS17nk_convert_config", !10, 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", !10, i64 0, !10, i64 4}
!21 = !{!"long", !7, i64 0}
!22 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!23 = !{!20, !10, i64 0}
!24 = !{!20, !10, i64 4}
!25 = !{i64 0, i64 1, !26, i64 1, i64 1, !26, i64 2, i64 1, !26, i64 3, i64 1, !26}
!26 = !{!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_line = external hidden unnamed_addr constant [109 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @nk_vec2(float noundef, float noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @nk_draw_list_stroke_line(ptr noundef %0, <2 x float> %1, <2 x float> %2, i32 %3, float noundef %4) local_unnamed_addr #2 {
  %.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 10340, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_stroke_line) #4
  unreachable

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

8:                                                ; preds = %7
  %9 = getelementptr inbounds i8, ptr %0, i64 232
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = icmp eq i32 %10, 1
  br i1 %11, label %12, label %13

12:                                               ; preds = %8
  tail call void @nk_draw_list_path_line_to(ptr noundef nonnull %0, <2 x float> %1)
  br label %28

13:                                               ; preds = %8
  %14 = tail call <2 x float> @nk_vec2(float noundef 5.000000e-01, float noundef 5.000000e-01)
  %15 = fsub <2 x float> %1, %14
  %16 = extractelement <2 x float> %15, i64 0
  %17 = tail call <2 x float> @nk_vec2(float noundef 5.000000e-01, float noundef 5.000000e-01)
  %18 = fsub <2 x float> %1, %17
  %19 = extractelement <2 x float> %18, i64 1
  %20 = tail call <2 x float> @nk_vec2(float noundef %16, float noundef %19)
  tail call void @nk_draw_list_path_line_to(ptr noundef nonnull %0, <2 x float> %20)
  %21 = tail call <2 x float> @nk_vec2(float noundef 5.000000e-01, float noundef 5.000000e-01)
  %22 = fsub <2 x float> %2, %21
  %23 = extractelement <2 x float> %22, i64 0
  %24 = tail call <2 x float> @nk_vec2(float noundef 5.000000e-01, float noundef 5.000000e-01)
  %25 = fsub <2 x float> %2, %24
  %26 = extractelement <2 x float> %25, i64 1
  %27 = tail call <2 x float> @nk_vec2(float noundef %23, float noundef %26)
  br label %28

28:                                               ; preds = %13, %12
  %.sink = phi <2 x float> [ %27, %13 ], [ %2, %12 ]
  tail call void @nk_draw_list_path_line_to(ptr noundef nonnull %0, <2 x float> %.sink)
  tail call void @nk_draw_list_path_stroke(ptr noundef nonnull %0, i32 %3, i32 noundef 0, float noundef %4)
  br label %29

29:                                               ; preds = %7, %28
  ret void
}

attributes #0 = { mustprogress nounwind 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 #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"="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, !12, i64 232}
!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}


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