; 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_fill_circle = external hidden unnamed_addr constant [107 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_fill(ptr noundef, i32) #3

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

15:                                               ; preds = %5
  br label %17

16:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str.2, i32 noundef 10252, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_fill_circle) #5
  unreachable

17:                                               ; preds = %15
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %24

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

24:                                               ; preds = %20, %17
  store i32 1, ptr %12, align 4
  br label %40

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

40:                                               ; preds = %25, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  %41 = load i32, ptr %12, align 4
  switch i32 %41, label %43 [
    i32 0, label %42
    i32 1, label %42
  ]

42:                                               ; preds = %40, %40
  ret void

43:                                               ; preds = %40
  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_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: 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_fill(ptr noundef, i32) local_unnamed_addr #2

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

7:                                                ; preds = %5
  %.not10 = icmp ult i32 %3, 16777216
  br i1 %.not10, 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 = { 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