; LLVM IR from unitreerobotics/kinect_teleoperate :: src/extern/glfw/src/tests (inputlag)

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @nk_rgb(i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @nk_fill_circle(ptr noundef, <2 x float>, <2 x float>, i32) #2

; Function Attrs: nounwind uwtable
define dso_local void @draw_marker(ptr noundef %0, i32 noundef %1, <2 x float> %2) #2 {
  %4 = alloca %struct.nk_vec2, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [4 x %struct.nk_color], align 16
  %8 = alloca %struct.nk_rect, align 4
  store <2 x float> %2, ptr %4, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #3
  %9 = call i32 @nk_rgb(i32 noundef 255, i32 noundef 0, i32 noundef 0)
  store i32 %9, ptr %7, align 4
  %10 = getelementptr inbounds %struct.nk_color, ptr %7, i64 1
  %11 = call i32 @nk_rgb(i32 noundef 255, i32 noundef 255, i32 noundef 0)
  store i32 %11, ptr %10, align 4
  %12 = getelementptr inbounds %struct.nk_color, ptr %7, i64 2
  %13 = call i32 @nk_rgb(i32 noundef 0, i32 noundef 255, i32 noundef 0)
  store i32 %13, ptr %12, align 4
  %14 = getelementptr inbounds %struct.nk_color, ptr %7, i64 3
  %15 = call i32 @nk_rgb(i32 noundef 0, i32 noundef 96, i32 noundef 255)
  store i32 %15, ptr %14, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #3
  %16 = getelementptr inbounds %struct.nk_rect, ptr %8, i32 0, i32 0
  %17 = getelementptr inbounds %struct.nk_vec2, ptr %4, i32 0, i32 0
  %18 = load float, ptr %17, align 4, !tbaa !11
  %19 = fadd float -5.000000e+00, %18
  store float %19, ptr %16, align 4, !tbaa !14
  %20 = getelementptr inbounds %struct.nk_rect, ptr %8, i32 0, i32 1
  %21 = getelementptr inbounds %struct.nk_vec2, ptr %4, i32 0, i32 1
  %22 = load float, ptr %21, align 4, !tbaa !16
  %23 = fadd float -5.000000e+00, %22
  store float %23, ptr %20, align 4, !tbaa !17
  %24 = getelementptr inbounds %struct.nk_rect, ptr %8, i32 0, i32 2
  store float 1.000000e+01, ptr %24, align 4, !tbaa !18
  %25 = getelementptr inbounds %struct.nk_rect, ptr %8, i32 0, i32 3
  store float 1.000000e+01, ptr %25, align 4, !tbaa !19
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [4 x %struct.nk_color], ptr %7, i64 0, i64 %28
  %30 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  %31 = load <2 x float>, ptr %30, align 4
  %32 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  %33 = load <2 x float>, ptr %32, align 4
  %34 = load i32, ptr %29, align 4
  call void @nk_fill_circle(ptr noundef %26, <2 x float> %31, <2 x float> %33, i32 %34)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"nk_vec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"nk_rect", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!16 = !{!12, !13, i64 4}
!17 = !{!15, !13, i64 4}
!18 = !{!15, !13, i64 8}
!19 = !{!15, !13, i64 12}


; 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_color = type { i8, i8, i8, i8 }

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @nk_rgb(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @draw_marker(ptr noundef %0, i32 noundef %1, <2 x float> %2) local_unnamed_addr #2 {
  %4 = alloca [4 x %struct.nk_color], align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  %5 = tail call i32 @nk_rgb(i32 noundef 255, i32 noundef 0, i32 noundef 0)
  store i32 %5, ptr %4, align 16
  %6 = getelementptr inbounds i8, ptr %4, i64 4
  %7 = tail call i32 @nk_rgb(i32 noundef 255, i32 noundef 255, i32 noundef 0)
  store i32 %7, ptr %6, align 4
  %8 = getelementptr inbounds i8, ptr %4, i64 8
  %9 = tail call i32 @nk_rgb(i32 noundef 0, i32 noundef 255, i32 noundef 0)
  store i32 %9, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr %4, i64 12
  %11 = tail call i32 @nk_rgb(i32 noundef 0, i32 noundef 96, i32 noundef 255)
  store i32 %11, ptr %10, align 4
  %12 = fadd <2 x float> %2, <float -5.000000e+00, float -5.000000e+00>
  %13 = sext i32 %1 to i64
  %14 = getelementptr inbounds [4 x %struct.nk_color], ptr %4, i64 0, i64 %13
  %15 = load i32, ptr %14, align 4
  tail call void @nk_fill_circle(ptr noundef %0, <2 x float> %12, <2 x float> <float 1.000000e+01, float 1.000000e+01>, i32 %15)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { 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,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass