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

; 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.2 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.26 = 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 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

; Function Attrs: nounwind 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) #2 {
  %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
  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) #4
  %15 = load ptr, ptr %9, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %6
  br label %19

18:                                               ; preds = %6
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str.2, i32 noundef 10263, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_stroke_circle) #5
  unreachable

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

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

26:                                               ; preds = %22, %19
  store i32 1, ptr %14, align 4
  br label %43

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

43:                                               ; preds = %27, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  %44 = load i32, ptr %14, 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 nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 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 = { nounwind }
attributes #5 = { 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/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 = !{!"nk_color", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}


; 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.2 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.26 = 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: nounwind 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: nounwind uwtable
declare dso_local void @nk_draw_list_path_stroke(ptr noundef, i32, i32 noundef, float noundef) local_unnamed_addr #2

; Function Attrs: nounwind 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.26, ptr noundef nonnull @.str.2, i32 noundef 10263, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_stroke_circle) #3
  unreachable

8:                                                ; preds = %6
  %.not11 = icmp ult i32 %3, 16777216
  br i1 %.not11, 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 = { 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 = { 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 #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