; 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_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_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_path_stroke = external hidden unnamed_addr constant [103 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 ptr @nk_buffer_memory(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @nk_draw_list_path_clear(ptr noundef) #2

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

13:                                               ; preds = %4
  br label %15

14:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str.2, i32 noundef 10140, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_path_stroke) #5
  unreachable

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

18:                                               ; preds = %15
  store i32 1, ptr %10, align 4
  br label %37

19:                                               ; preds = %15
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.nk_draw_list, ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = call ptr @nk_buffer_memory(ptr noundef %22)
  store ptr %23, ptr %9, align 8, !tbaa !5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.nk_draw_list, ptr %26, i32 0, i32 10
  %28 = load i32, ptr %27, align 8, !tbaa !20
  %29 = load i32, ptr %7, align 4, !tbaa !9
  %30 = load float, ptr %8, align 4, !tbaa !11
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.nk_draw_list, ptr %31, i32 0, i32 2
  %33 = getelementptr inbounds %struct.nk_convert_config, ptr %32, i32 0, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !21
  %35 = load i32, ptr %5, align 1
  call void @nk_draw_list_stroke_poly_line(ptr noundef %24, ptr noundef %25, i32 noundef %28, i32 %35, i32 noundef %29, float noundef %30, i32 noundef %34)
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  call void @nk_draw_list_path_clear(ptr noundef %36)
  store i32 0, ptr %10, align 4
  br label %37

37:                                               ; preds = %19, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %38 = load i32, ptr %10, align 4
  switch i32 %38, label %40 [
    i32 0, label %39
    i32 1, label %39
  ]

39:                                               ; preds = %37, %37
  ret void

40:                                               ; preds = %37
  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"="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 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !6, i64 176}
!14 = !{!"nk_draw_list", !15, i64 0, !7, i64 16, !16, i64 112, !6, i64 176, !6, i64 184, !6, i64 192, !10, i64 200, !10, i64 204, !10, i64 208, !19, i64 216, !10, i64 224, !10, i64 228, !10, i64 232, !10, i64 236}
!15 = !{!"nk_rect", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!16 = !{!"nk_convert_config", !12, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !17, i64 24, !6, i64 40, !19, i64 48, !19, i64 56}
!17 = !{!"nk_draw_null_texture", !7, i64 0, !18, i64 8}
!18 = !{!"nk_vec2", !12, i64 0, !12, i64 4}
!19 = !{!"long", !7, i64 0}
!20 = !{!14, !10, i64 224}
!21 = !{!14, !10, i64 116}


; 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_path_stroke = external hidden unnamed_addr constant [103 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 ptr @nk_buffer_memory(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @nk_draw_list_path_clear(ptr noundef) local_unnamed_addr #1

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

5:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.2, i32 noundef 10140, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_path_stroke) #3
  unreachable

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %0, i64 176
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = tail call ptr @nk_buffer_memory(ptr noundef %8)
  %10 = getelementptr inbounds i8, ptr %0, i64 224
  %11 = load i32, ptr %10, align 8, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %0, i64 116
  %13 = load i32, ptr %12, align 4, !tbaa !18
  tail call void @nk_draw_list_stroke_poly_line(ptr noundef nonnull %0, ptr noundef %9, i32 noundef %11, i32 %1, i32 noundef %2, float noundef %3, i32 noundef %13)
  tail call void @nk_draw_list_path_clear(ptr noundef nonnull %0)
  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"="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 = { 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, !15, i64 176}
!6 = !{!"nk_draw_list", !7, i64 0, !9, i64 16, !11, i64 112, !15, i64 176, !15, i64 184, !15, i64 192, !12, i64 200, !12, i64 204, !12, i64 208, !16, i64 216, !12, i64 224, !12, i64 228, !12, i64 232, !12, i64 236}
!7 = !{!"nk_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/C++ TBAA"}
!11 = !{!"nk_convert_config", !8, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !13, i64 24, !15, i64 40, !16, i64 48, !16, i64 56}
!12 = !{!"int", !9, i64 0}
!13 = !{!"nk_draw_null_texture", !9, i64 0, !14, i64 8}
!14 = !{!"nk_vec2", !8, i64 0, !8, i64 4}
!15 = !{!"any pointer", !9, i64 0}
!16 = !{!"long", !9, i64 0}
!17 = !{!6, !12, i64 224}
!18 = !{!6, !12, i64 116}


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