; 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"

@.str.2 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [4 x i8], align 1
@__PRETTY_FUNCTION__.nk_checkbox_flags_text = external hidden unnamed_addr constant [97 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [6 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 i32 @nk_checkbox_text(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

16:                                               ; preds = %5
  br label %18

17:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str.33, ptr noundef @.str.2, i32 noundef 20584, ptr noundef @__PRETTY_FUNCTION__.nk_checkbox_flags_text) #4
  unreachable

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

21:                                               ; preds = %18
  br label %23

22:                                               ; preds = %18
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.2, i32 noundef 20585, ptr noundef @__PRETTY_FUNCTION__.nk_checkbox_flags_text) #4
  unreachable

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

26:                                               ; preds = %23
  br label %28

27:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.123, ptr noundef @.str.2, i32 noundef 20586, ptr noundef @__PRETTY_FUNCTION__.nk_checkbox_flags_text) #4
  unreachable

28:                                               ; preds = %26
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %37

31:                                               ; preds = %28
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %37

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

37:                                               ; preds = %34, %31, %28
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %66

38:                                               ; preds = %34
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = and i32 %40, %41
  %43 = load i32, ptr %11, align 4, !tbaa !9
  %44 = and i32 %42, %43
  store i32 %44, ptr %12, align 4, !tbaa !9
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = call i32 @nk_checkbox_text(ptr noundef %45, ptr noundef %46, i32 noundef %47, ptr noundef %12)
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %65

50:                                               ; preds = %38
  %51 = load i32, ptr %12, align 4, !tbaa !9
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %58

53:                                               ; preds = %50
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = load i32, ptr %55, align 4, !tbaa !9
  %57 = or i32 %56, %54
  store i32 %57, ptr %55, align 4, !tbaa !9
  br label %64

58:                                               ; preds = %50
  %59 = load i32, ptr %11, align 4, !tbaa !9
  %60 = xor i32 %59, -1
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = and i32 %62, %60
  store i32 %63, ptr %61, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %58, %53
  store i32 1, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %66

65:                                               ; preds = %38
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %66

66:                                               ; preds = %65, %64, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %67 = load i32, ptr %6, align 4
  ret i32 %67
}

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 = !{!"int", !7, i64 0}


; 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.22 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [4 x i8], align 1
@__PRETTY_FUNCTION__.nk_checkbox_flags_text = external hidden unnamed_addr constant [97 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress 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) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @nk_checkbox_flags_text(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #2 {
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %7, label %8

7:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.33, ptr noundef nonnull @.str.2, i32 noundef 20584, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_checkbox_flags_text) #4
  unreachable

8:                                                ; preds = %5
  %.not22 = icmp eq ptr %1, null
  br i1 %.not22, label %9, label %10

9:                                                ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.2, i32 noundef 20585, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_checkbox_flags_text) #4
  unreachable

10:                                               ; preds = %8
  %.not23 = icmp eq ptr %3, null
  br i1 %.not23, label %11, label %12

11:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.123, ptr noundef nonnull @.str.2, i32 noundef 20586, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_checkbox_flags_text) #4
  unreachable

12:                                               ; preds = %10
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = and i32 %13, %4
  store i32 %14, ptr %6, align 4, !tbaa !5
  %15 = call i32 @nk_checkbox_text(ptr noundef nonnull %0, ptr noundef nonnull %1, i32 noundef %2, ptr noundef nonnull %6)
  %.not24 = icmp eq i32 %15, 0
  br i1 %.not24, label %26, label %16

16:                                               ; preds = %12
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %.not25 = icmp eq i32 %17, 0
  br i1 %.not25, label %21, label %18

18:                                               ; preds = %16
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = or i32 %19, %4
  br label %25

21:                                               ; preds = %16
  %22 = xor i32 %4, -1
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = and i32 %23, %22
  br label %25

25:                                               ; preds = %21, %18
  %storemerge = phi i32 [ %24, %21 ], [ %20, %18 ]
  store i32 %storemerge, ptr %3, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %12, %25
  %.0 = phi i32 [ 1, %25 ], [ 0, %12 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  ret i32 %.0
}

attributes #0 = { mustprogress 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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