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

@nk_null_rect = external hidden constant %struct.nk_rect, align 4
@.str.2 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__.nk_draw_list_setup = external hidden unnamed_addr constant [187 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @nk_draw_list_setup(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5, i32 noundef %6) #2 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store i32 %5, ptr %13, align 4, !tbaa !9
  store i32 %6, ptr %14, align 4, !tbaa !9
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %7
  br label %19

18:                                               ; preds = %7
  call void @__assert_fail(ptr noundef @.str.27, ptr noundef @.str.2, i32 noundef 9238, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_setup) #3
  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 %23

22:                                               ; preds = %19
  br label %24

23:                                               ; preds = %19
  call void @__assert_fail(ptr noundef @.str.28, ptr noundef @.str.2, i32 noundef 9239, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_setup) #3
  unreachable

24:                                               ; preds = %22
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %24
  br label %29

28:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.29, ptr noundef @.str.2, i32 noundef 9240, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_setup) #3
  unreachable

29:                                               ; preds = %27
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  br label %34

33:                                               ; preds = %29
  call void @__assert_fail(ptr noundef @.str.30, ptr noundef @.str.2, i32 noundef 9241, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_setup) #3
  unreachable

34:                                               ; preds = %32
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  br label %39

38:                                               ; preds = %34
  call void @__assert_fail(ptr noundef @.str.31, ptr noundef @.str.2, i32 noundef 9242, ptr noundef @__PRETTY_FUNCTION__.nk_draw_list_setup) #3
  unreachable

39:                                               ; preds = %37
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %54

42:                                               ; preds = %39
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %54

45:                                               ; preds = %42
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %54

48:                                               ; preds = %45
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %54

51:                                               ; preds = %48
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %55, label %54

54:                                               ; preds = %51, %48, %45, %42, %39
  br label %88

55:                                               ; preds = %51
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.nk_draw_list, ptr %57, i32 0, i32 3
  store ptr %56, ptr %58, align 8, !tbaa !11
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.nk_draw_list, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %60, ptr align 8 %61, i64 64, i1 false), !tbaa.struct !19
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.nk_draw_list, ptr %63, i32 0, i32 5
  store ptr %62, ptr %64, align 8, !tbaa !23
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.nk_draw_list, ptr %66, i32 0, i32 4
  store ptr %65, ptr %67, align 8, !tbaa !24
  %68 = load i32, ptr %13, align 4, !tbaa !9
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.nk_draw_list, ptr %69, i32 0, i32 12
  store i32 %68, ptr %70, align 8, !tbaa !25
  %71 = load i32, ptr %14, align 4, !tbaa !9
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.nk_draw_list, ptr %72, i32 0, i32 13
  store i32 %71, ptr %73, align 4, !tbaa !26
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.nk_draw_list, ptr %74, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %75, ptr align 4 @nk_null_rect, i64 16, i1 false), !tbaa.struct !27
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.nk_draw_list, ptr %76, i32 0, i32 9
  store i64 0, ptr %77, align 8, !tbaa !28
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.nk_draw_list, ptr %78, i32 0, i32 6
  store i32 0, ptr %79, align 8, !tbaa !29
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.nk_draw_list, ptr %80, i32 0, i32 7
  store i32 0, ptr %81, align 4, !tbaa !30
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.nk_draw_list, ptr %82, i32 0, i32 9
  store i64 0, ptr %83, align 8, !tbaa !28
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.nk_draw_list, ptr %84, i32 0, i32 8
  store i32 0, ptr %85, align 8, !tbaa !31
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.nk_draw_list, ptr %86, i32 0, i32 10
  store i32 0, ptr %87, align 8, !tbaa !32
  br label %88

88:                                               ; preds = %55, %54
  ret void
}

attributes #0 = { nocallback nofree 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 = { 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, !6, i64 176}
!12 = !{!"nk_draw_list", !13, i64 0, !7, i64 16, !15, i64 112, !6, i64 176, !6, i64 184, !6, i64 192, !10, i64 200, !10, i64 204, !10, i64 208, !18, i64 216, !10, i64 224, !10, i64 228, !10, i64 232, !10, i64 236}
!13 = !{!"nk_rect", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!14 = !{!"float", !7, i64 0}
!15 = !{!"nk_convert_config", !14, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !16, i64 24, !6, i64 40, !18, i64 48, !18, i64 56}
!16 = !{!"nk_draw_null_texture", !7, i64 0, !17, i64 8}
!17 = !{!"nk_vec2", !14, i64 0, !14, i64 4}
!18 = !{!"long", !7, i64 0}
!19 = !{i64 0, i64 4, !20, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 4, !9, i64 20, i64 4, !9, i64 24, i64 8, !21, i64 32, i64 4, !20, i64 36, i64 4, !20, i64 40, i64 8, !5, i64 48, i64 8, !22, i64 56, i64 8, !22}
!20 = !{!14, !14, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!18, !18, i64 0}
!23 = !{!12, !6, i64 192}
!24 = !{!12, !6, i64 184}
!25 = !{!12, !10, i64 232}
!26 = !{!12, !10, i64 236}
!27 = !{i64 0, i64 4, !20, i64 4, i64 4, !20, i64 8, i64 4, !20, i64 12, i64 4, !20}
!28 = !{!12, !18, i64 216}
!29 = !{!12, !10, i64 200}
!30 = !{!12, !10, i64 204}
!31 = !{!12, !10, i64 208}
!32 = !{!12, !10, i64 224}


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

@nk_null_rect = external hidden local_unnamed_addr constant %struct.nk_rect, align 4
@.str.2 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__.nk_draw_list_setup = external hidden unnamed_addr constant [187 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

8:                                                ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.2, i32 noundef 9238, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_setup) #3
  unreachable

9:                                                ; preds = %7
  %.not39 = icmp eq ptr %1, null
  br i1 %.not39, label %10, label %11

10:                                               ; preds = %9
  tail call void @__assert_fail(ptr noundef nonnull @.str.28, ptr noundef nonnull @.str.2, i32 noundef 9239, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_setup) #3
  unreachable

11:                                               ; preds = %9
  %.not40 = icmp eq ptr %2, null
  br i1 %.not40, label %12, label %13

12:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.29, ptr noundef nonnull @.str.2, i32 noundef 9240, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_setup) #3
  unreachable

13:                                               ; preds = %11
  %.not41 = icmp eq ptr %3, null
  br i1 %.not41, label %14, label %15

14:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.30, ptr noundef nonnull @.str.2, i32 noundef 9241, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_setup) #3
  unreachable

15:                                               ; preds = %13
  %.not42 = icmp eq ptr %4, null
  br i1 %.not42, label %16, label %17

16:                                               ; preds = %15
  tail call void @__assert_fail(ptr noundef nonnull @.str.31, ptr noundef nonnull @.str.2, i32 noundef 9242, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_draw_list_setup) #3
  unreachable

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %0, i64 176
  store ptr %2, ptr %18, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 112
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %19, ptr noundef nonnull align 8 dereferenceable(64) %1, i64 64, i1 false), !tbaa.struct !17
  %20 = getelementptr inbounds i8, ptr %0, i64 192
  store ptr %4, ptr %20, align 8, !tbaa !23
  %21 = getelementptr inbounds i8, ptr %0, i64 184
  store ptr %3, ptr %21, align 8, !tbaa !24
  %22 = getelementptr inbounds i8, ptr %0, i64 232
  store i32 %5, ptr %22, align 8, !tbaa !25
  %23 = getelementptr inbounds i8, ptr %0, i64 236
  store i32 %6, ptr %23, align 4, !tbaa !26
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(16) @nk_null_rect, i64 16, i1 false), !tbaa.struct !27
  %24 = getelementptr inbounds i8, ptr %0, i64 216
  %25 = getelementptr inbounds i8, ptr %0, i64 200
  store i32 0, ptr %25, align 8, !tbaa !28
  %26 = getelementptr inbounds i8, ptr %0, i64 204
  store i32 0, ptr %26, align 4, !tbaa !29
  store i64 0, ptr %24, align 8, !tbaa !30
  %27 = getelementptr inbounds i8, ptr %0, i64 208
  store i32 0, ptr %27, align 8, !tbaa !31
  %28 = getelementptr inbounds i8, ptr %0, i64 224
  store i32 0, ptr %28, align 8, !tbaa !32
  ret void
}

attributes #0 = { mustprogress nocallback nofree 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 = { 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 = !{i64 0, i64 4, !18, i64 4, i64 4, !19, i64 8, i64 4, !19, i64 12, i64 4, !19, i64 16, i64 4, !19, i64 20, i64 4, !19, i64 24, i64 8, !20, i64 32, i64 4, !18, i64 36, i64 4, !18, i64 40, i64 8, !21, i64 48, i64 8, !22, i64 56, i64 8, !22}
!18 = !{!8, !8, i64 0}
!19 = !{!12, !12, i64 0}
!20 = !{!9, !9, i64 0}
!21 = !{!15, !15, i64 0}
!22 = !{!16, !16, i64 0}
!23 = !{!6, !15, i64 192}
!24 = !{!6, !15, i64 184}
!25 = !{!6, !12, i64 232}
!26 = !{!6, !12, i64 236}
!27 = !{i64 0, i64 4, !18, i64 4, i64 4, !18, i64 8, i64 4, !18, i64 12, i64 4, !18}
!28 = !{!6, !12, i64 200}
!29 = !{!6, !12, i64 204}
!30 = !{!6, !16, i64 216}
!31 = !{!6, !12, i64 208}
!32 = !{!6, !12, i64 224}


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