; 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_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_vec2 = type { 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.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_init = external hidden unnamed_addr constant [46 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 hidden void @nk_zero(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @nk_draw_list_init(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca float, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  store i64 0, ptr %3, align 8, !tbaa !9
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = icmp ne ptr %6, null
  br i1 %7, label %8, label %9

8:                                                ; preds = %1
  br label %10

9:                                                ; preds = %1
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str.2, i32 noundef 9224, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_init) #4
  unreachable

10:                                               ; preds = %8
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = icmp ne ptr %11, null
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  store i32 1, ptr %4, align 4
  br label %43

14:                                               ; preds = %10
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  call void @nk_zero(ptr noundef %15, i64 noundef 240)
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %16

16:                                               ; preds = %39, %14
  %17 = load i64, ptr %3, align 8, !tbaa !9
  %18 = icmp ult i64 %17, 12
  br i1 %18, label %19, label %42

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %20 = load i64, ptr %3, align 8, !tbaa !9
  %21 = uitofp i64 %20 to float
  %22 = fdiv float %21, 1.200000e+01
  %23 = fmul float %22, 2.000000e+00
  %24 = fmul float %23, 0x400921FB60000000
  store float %24, ptr %5, align 4, !tbaa !11
  %25 = load float, ptr %5, align 4, !tbaa !11
  %26 = call float @nk_cos(float noundef %25)
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.nk_draw_list, ptr %27, i32 0, i32 1
  %29 = load i64, ptr %3, align 8, !tbaa !9
  %30 = getelementptr inbounds [12 x %struct.nk_vec2], ptr %28, i64 0, i64 %29
  %31 = getelementptr inbounds %struct.nk_vec2, ptr %30, i32 0, i32 0
  store float %26, ptr %31, align 8, !tbaa !13
  %32 = load float, ptr %5, align 4, !tbaa !11
  %33 = call float @nk_sin(float noundef %32)
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.nk_draw_list, ptr %34, i32 0, i32 1
  %36 = load i64, ptr %3, align 8, !tbaa !9
  %37 = getelementptr inbounds [12 x %struct.nk_vec2], ptr %35, i64 0, i64 %36
  %38 = getelementptr inbounds %struct.nk_vec2, ptr %37, i32 0, i32 1
  store float %33, ptr %38, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %39

39:                                               ; preds = %19
  %40 = load i64, ptr %3, align 8, !tbaa !9
  %41 = add i64 %40, 1
  store i64 %41, ptr %3, align 8, !tbaa !9
  br label %16, !llvm.loop !16

42:                                               ; preds = %16
  store i32 0, ptr %4, align 4
  br label %43

43:                                               ; preds = %42, %13
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %44 = load i32, ptr %4, 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
}

; Function Attrs: nounwind uwtable
declare hidden float @nk_cos(float noundef) #2

; Function Attrs: nounwind uwtable
declare hidden float @nk_sin(float noundef) #2

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"="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 = { nounwind }
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, !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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"nk_vec2", !12, i64 0, !12, i64 4}
!15 = !{!14, !12, i64 4}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; 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_init = external hidden unnamed_addr constant [46 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 hidden void @nk_zero(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @nk_draw_list_init(ptr noundef %0) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %2, label %3

2:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.2, i32 noundef 9224, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_init) #2
  unreachable

3:                                                ; preds = %1
  tail call void @nk_zero(ptr noundef nonnull %0, i64 noundef 240)
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = tail call float @nk_cos(float noundef 0.000000e+00)
  store float %5, ptr %4, align 8, !tbaa !5
  %6 = tail call float @nk_sin(float noundef 0.000000e+00)
  %7 = getelementptr inbounds i8, ptr %0, i64 20
  store float %6, ptr %7, align 4, !tbaa !10
  %8 = tail call float @nk_cos(float noundef 0x3FE0C15240000000)
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  store float %8, ptr %9, align 8, !tbaa !5
  %10 = tail call float @nk_sin(float noundef 0x3FE0C15240000000)
  %11 = getelementptr inbounds i8, ptr %0, i64 28
  store float %10, ptr %11, align 4, !tbaa !10
  %12 = tail call float @nk_cos(float noundef 0x3FF0C15240000000)
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  store float %12, ptr %13, align 8, !tbaa !5
  %14 = tail call float @nk_sin(float noundef 0x3FF0C15240000000)
  %15 = getelementptr inbounds i8, ptr %0, i64 36
  store float %14, ptr %15, align 4, !tbaa !10
  %16 = tail call float @nk_cos(float noundef 0x3FF921FB60000000)
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  store float %16, ptr %17, align 8, !tbaa !5
  %18 = tail call float @nk_sin(float noundef 0x3FF921FB60000000)
  %19 = getelementptr inbounds i8, ptr %0, i64 44
  store float %18, ptr %19, align 4, !tbaa !10
  %20 = tail call float @nk_cos(float noundef 0x4000C15240000000)
  %21 = getelementptr inbounds i8, ptr %0, i64 48
  store float %20, ptr %21, align 8, !tbaa !5
  %22 = tail call float @nk_sin(float noundef 0x4000C15240000000)
  %23 = getelementptr inbounds i8, ptr %0, i64 52
  store float %22, ptr %23, align 4, !tbaa !10
  %24 = tail call float @nk_cos(float noundef 0x4004F1A6C0000000)
  %25 = getelementptr inbounds i8, ptr %0, i64 56
  store float %24, ptr %25, align 8, !tbaa !5
  %26 = tail call float @nk_sin(float noundef 0x4004F1A6C0000000)
  %27 = getelementptr inbounds i8, ptr %0, i64 60
  store float %26, ptr %27, align 4, !tbaa !10
  %28 = tail call float @nk_cos(float noundef 0x400921FB60000000)
  %29 = getelementptr inbounds i8, ptr %0, i64 64
  store float %28, ptr %29, align 8, !tbaa !5
  %30 = tail call float @nk_sin(float noundef 0x400921FB60000000)
  %31 = getelementptr inbounds i8, ptr %0, i64 68
  store float %30, ptr %31, align 4, !tbaa !10
  %32 = tail call float @nk_cos(float noundef 0x400D524FE0000000)
  %33 = getelementptr inbounds i8, ptr %0, i64 72
  store float %32, ptr %33, align 8, !tbaa !5
  %34 = tail call float @nk_sin(float noundef 0x400D524FE0000000)
  %35 = getelementptr inbounds i8, ptr %0, i64 76
  store float %34, ptr %35, align 4, !tbaa !10
  %36 = tail call float @nk_cos(float noundef 0x4010C15240000000)
  %37 = getelementptr inbounds i8, ptr %0, i64 80
  store float %36, ptr %37, align 8, !tbaa !5
  %38 = tail call float @nk_sin(float noundef 0x4010C15240000000)
  %39 = getelementptr inbounds i8, ptr %0, i64 84
  store float %38, ptr %39, align 4, !tbaa !10
  %40 = tail call float @nk_cos(float noundef 0x4012D97C80000000)
  %41 = getelementptr inbounds i8, ptr %0, i64 88
  store float %40, ptr %41, align 8, !tbaa !5
  %42 = tail call float @nk_sin(float noundef 0x4012D97C80000000)
  %43 = getelementptr inbounds i8, ptr %0, i64 92
  store float %42, ptr %43, align 4, !tbaa !10
  %44 = tail call float @nk_cos(float noundef 0x4014F1A6C0000000)
  %45 = getelementptr inbounds i8, ptr %0, i64 96
  store float %44, ptr %45, align 8, !tbaa !5
  %46 = tail call float @nk_sin(float noundef 0x4014F1A6C0000000)
  %47 = getelementptr inbounds i8, ptr %0, i64 100
  store float %46, ptr %47, align 4, !tbaa !10
  %48 = tail call float @nk_cos(float noundef 0x401709D120000000)
  %49 = getelementptr inbounds i8, ptr %0, i64 104
  store float %48, ptr %49, align 8, !tbaa !5
  %50 = tail call float @nk_sin(float noundef 0x401709D120000000)
  %51 = getelementptr inbounds i8, ptr %0, i64 108
  store float %50, ptr %51, align 4, !tbaa !10
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden float @nk_cos(float noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden float @nk_sin(float noundef) local_unnamed_addr #1

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"="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 = { 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, !7, i64 0}
!6 = !{!"nk_vec2", !7, i64 0, !7, i64 4}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass