; LLVM IR from unitreerobotics/kinect_teleoperate :: src/extern/glfw/src/src (monitor)

; 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._GLFWlibrary = type { i32, %struct.GLFWallocator, %struct._GLFWplatform, %struct.anon, ptr, ptr, ptr, ptr, i32, i32, [16 x %struct._GLFWjoystick], ptr, i32, %struct._GLFWtls, %struct._GLFWtls, %struct._GLFWmutex, %struct.anon.8, %struct.anon.9, %struct.anon.10, %struct.anon.11, %struct.anon.12, %struct._GLFWlibraryNull }
%struct.GLFWallocator = type { ptr, ptr, ptr, ptr }
%struct._GLFWplatform = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon = type { %struct._GLFWinitconfig, %struct._GLFWfbconfig, %struct._GLFWwndconfig, %struct._GLFWctxconfig, i32 }
%struct._GLFWinitconfig = type { i32, i32, i32, ptr, %struct.anon.0, %struct.anon.1, %struct.anon.2 }
%struct.anon.0 = type { i32, i32 }
%struct.anon.1 = type { i32 }
%struct.anon.2 = type { i32 }
%struct._GLFWfbconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
%struct._GLFWwndconfig = type { i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.anon.3, %struct.anon.4, %struct.anon.5, %struct.anon.6 }
%struct.anon.3 = type { [256 x i8] }
%struct.anon.4 = type { [256 x i8], [256 x i8] }
%struct.anon.5 = type { i32, i32 }
%struct.anon.6 = type { [256 x i8] }
%struct._GLFWctxconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, %struct.anon.7 }
%struct.anon.7 = type { i32 }
%struct._GLFWjoystick = type { i32, i32, ptr, i32, ptr, i32, ptr, i32, [128 x i8], ptr, [33 x i8], ptr }
%struct._GLFWtls = type { %struct._GLFWtlsPOSIX }
%struct._GLFWtlsPOSIX = type { i32, i32 }
%struct._GLFWmutex = type { %struct._GLFWmutexPOSIX }
%struct._GLFWmutexPOSIX = type { i32, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.anon.8 = type { i64, %struct._GLFWtimerPOSIX }
%struct._GLFWtimerPOSIX = type { i32, i64 }
%struct.anon.9 = type { i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.10 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.11 = type { i32, ptr, [2 x ptr], ptr, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.12 = type { ptr, ptr }
%struct._GLFWlibraryNull = type { i32, i32, ptr, ptr, [121 x i16], [349 x i8] }
%struct.GLFWgammaramp = type { ptr, ptr, ptr, i32 }

@.str.1 = external hidden unnamed_addr constant [102 x i8], align 1
@_glfw = external global %struct._GLFWlibrary, align 8
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__.glfwSetGamma = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

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

declare ptr @_glfw_calloc(i64 noundef, i64 noundef) #2

declare void @_glfw_free(ptr noundef) #2

declare void @_glfwInputError(i32 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
define dso_local void @glfwSetGamma(ptr noundef %0, float noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %struct.GLFWgammaramp, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %11 = load float, ptr %4, align 4, !tbaa !9
  %12 = fcmp ogt float %11, 0.000000e+00
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  br label %15

14:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 470, ptr noundef @__PRETTY_FUNCTION__.glfwSetGamma) #7
  unreachable

15:                                               ; preds = %13
  %16 = load float, ptr %4, align 4, !tbaa !9
  %17 = fcmp ole float %16, 0x47EFFFFFE0000000
  br i1 %17, label %18, label %19

18:                                               ; preds = %15
  br label %20

19:                                               ; preds = %15
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 471, ptr noundef @__PRETTY_FUNCTION__.glfwSetGamma) #7
  unreachable

20:                                               ; preds = %18
  %21 = load i32, ptr @_glfw, align 8, !tbaa !11
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  call void (i32, ptr, ...) @_glfwInputError(i32 noundef 65537, ptr noundef null)
  store i32 1, ptr %9, align 4
  br label %98

24:                                               ; preds = %20
  %25 = load ptr, ptr %3, 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.7, ptr noundef @.str.1, i32 noundef 475, ptr noundef @__PRETTY_FUNCTION__.glfwSetGamma) #7
  unreachable

29:                                               ; preds = %27
  %30 = load float, ptr %4, align 4, !tbaa !9
  %31 = load float, ptr %4, align 4, !tbaa !9
  %32 = fcmp une float %30, %31
  br i1 %32, label %39, label %33

33:                                               ; preds = %29
  %34 = load float, ptr %4, align 4, !tbaa !9
  %35 = fcmp ole float %34, 0.000000e+00
  br i1 %35, label %39, label %36

36:                                               ; preds = %33
  %37 = load float, ptr %4, align 4, !tbaa !9
  %38 = fcmp ogt float %37, 0x47EFFFFFE0000000
  br i1 %38, label %39, label %42

39:                                               ; preds = %36, %33, %29
  %40 = load float, ptr %4, align 4, !tbaa !9
  %41 = fpext float %40 to double
  call void (i32, ptr, ...) @_glfwInputError(i32 noundef 65540, ptr noundef @.str.8, double noundef %41)
  store i32 1, ptr %9, align 4
  br label %98

42:                                               ; preds = %36
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = call ptr @glfwGetGammaRamp(ptr noundef %43)
  store ptr %44, ptr %8, align 8, !tbaa !5
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %48, label %47

47:                                               ; preds = %42
  store i32 1, ptr %9, align 4
  br label %98

48:                                               ; preds = %42
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.GLFWgammaramp, ptr %49, i32 0, i32 3
  %51 = load i32, ptr %50, align 8, !tbaa !37
  %52 = zext i32 %51 to i64
  %53 = call ptr @_glfw_calloc(i64 noundef %52, i64 noundef 2)
  store ptr %53, ptr %6, align 8, !tbaa !5
  store i32 0, ptr %5, align 4, !tbaa !39
  br label %54

54:                                               ; preds = %82, %48
  %55 = load i32, ptr %5, align 4, !tbaa !39
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.GLFWgammaramp, ptr %56, i32 0, i32 3
  %58 = load i32, ptr %57, align 8, !tbaa !37
  %59 = icmp ult i32 %55, %58
  br i1 %59, label %60, label %85

60:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %61 = load i32, ptr %5, align 4, !tbaa !39
  %62 = uitofp i32 %61 to float
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.GLFWgammaramp, ptr %63, i32 0, i32 3
  %65 = load i32, ptr %64, align 8, !tbaa !37
  %66 = sub i32 %65, 1
  %67 = uitofp i32 %66 to float
  %68 = fdiv float %62, %67
  store float %68, ptr %10, align 4, !tbaa !9
  %69 = load float, ptr %10, align 4, !tbaa !9
  %70 = load float, ptr %4, align 4, !tbaa !9
  %71 = fdiv float 1.000000e+00, %70
  %72 = call float @powf(float noundef %69, float noundef %71) #6
  %73 = call float @llvm.fmuladd.f32(float %72, float 6.553500e+04, float 5.000000e-01)
  store float %73, ptr %10, align 4, !tbaa !9
  %74 = load float, ptr %10, align 4, !tbaa !9
  %75 = call float @llvm.minnum.f32(float %74, float 6.553500e+04)
  store float %75, ptr %10, align 4, !tbaa !9
  %76 = load float, ptr %10, align 4, !tbaa !9
  %77 = fptoui float %76 to i16
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = load i32, ptr %5, align 4, !tbaa !39
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds i16, ptr %78, i64 %80
  store i16 %77, ptr %81, align 2, !tbaa !40
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %82

82:                                               ; preds = %60
  %83 = load i32, ptr %5, align 4, !tbaa !39
  %84 = add i32 %83, 1
  store i32 %84, ptr %5, align 4, !tbaa !39
  br label %54, !llvm.loop !42

85:                                               ; preds = %54
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.GLFWgammaramp, ptr %7, i32 0, i32 0
  store ptr %86, ptr %87, align 8, !tbaa !44
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.GLFWgammaramp, ptr %7, i32 0, i32 1
  store ptr %88, ptr %89, align 8, !tbaa !45
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.GLFWgammaramp, ptr %7, i32 0, i32 2
  store ptr %90, ptr %91, align 8, !tbaa !46
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.GLFWgammaramp, ptr %92, i32 0, i32 3
  %94 = load i32, ptr %93, align 8, !tbaa !37
  %95 = getelementptr inbounds %struct.GLFWgammaramp, ptr %7, i32 0, i32 3
  store i32 %94, ptr %95, align 8, !tbaa !37
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  call void @glfwSetGammaRamp(ptr noundef %96, ptr noundef %7)
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_glfw_free(ptr noundef %97)
  store i32 0, ptr %9, align 4
  br label %98

98:                                               ; preds = %85, %47, %39, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %99 = load i32, ptr %9, align 4
  switch i32 %99, label %101 [
    i32 0, label %100
    i32 1, label %100
  ]

100:                                              ; preds = %98, %98
  ret void

101:                                              ; preds = %98
  unreachable
}

; Function Attrs: nounwind uwtable
declare dso_local ptr @glfwGetGammaRamp(ptr noundef) #3

; Function Attrs: nounwind
declare float @powf(float noundef, float noundef) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.minnum.f32(float, float) #5

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 "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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { 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, !13, i64 0}
!12 = !{!"_GLFWlibrary", !13, i64 0, !14, i64 8, !15, i64 40, !16, i64 616, !6, i64 1896, !6, i64 1904, !6, i64 1912, !6, i64 1920, !13, i64 1928, !13, i64 1932, !7, i64 1936, !6, i64 5776, !13, i64 5784, !26, i64 5788, !26, i64 5796, !28, i64 5808, !30, i64 5856, !32, i64 5880, !33, i64 6136, !34, i64 6200, !35, i64 6272, !36, i64 6288}
!13 = !{!"int", !7, i64 0}
!14 = !{!"GLFWallocator", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"_GLFWplatform", !13, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568}
!16 = !{!"", !17, i64 0, !20, i64 40, !22, i64 112, !25, i64 1216, !13, i64 1272}
!17 = !{!"_GLFWinitconfig", !13, i64 0, !13, i64 4, !13, i64 8, !6, i64 16, !18, i64 24, !19, i64 32, !19, i64 36}
!18 = !{!"", !13, i64 0, !13, i64 4}
!19 = !{!"", !13, i64 0}
!20 = !{!"_GLFWfbconfig", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !21, i64 64}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_GLFWwndconfig", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !6, i64 16, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !23, i64 72, !24, i64 328, !18, i64 840, !23, i64 848}
!23 = !{!"", !7, i64 0}
!24 = !{!"", !7, i64 0, !7, i64 256}
!25 = !{!"_GLFWctxconfig", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !6, i64 40, !19, i64 48}
!26 = !{!"_GLFWtls", !27, i64 0}
!27 = !{!"_GLFWtlsPOSIX", !13, i64 0, !13, i64 4}
!28 = !{!"_GLFWmutex", !29, i64 0}
!29 = !{!"_GLFWmutexPOSIX", !13, i64 0, !7, i64 8}
!30 = !{!"", !21, i64 0, !31, i64 8}
!31 = !{!"_GLFWtimerPOSIX", !13, i64 0, !21, i64 8}
!32 = !{!"", !13, i64 0, !6, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248}
!33 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!34 = !{!"", !13, i64 0, !6, i64 8, !7, i64 16, !6, i64 32, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68}
!35 = !{!"", !6, i64 0, !6, i64 8}
!36 = !{!"_GLFWlibraryNull", !13, i64 0, !13, i64 4, !6, i64 8, !6, i64 16, !7, i64 24, !7, i64 266}
!37 = !{!38, !13, i64 24}
!38 = !{!"GLFWgammaramp", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24}
!39 = !{!13, !13, i64 0}
!40 = !{!41, !41, i64 0}
!41 = !{!"short", !7, i64 0}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = !{!38, !6, i64 0}
!45 = !{!38, !6, i64 8}
!46 = !{!38, !6, i64 16}


; 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._GLFWlibrary = type { i32, %struct.GLFWallocator, %struct._GLFWplatform, %struct.anon, ptr, ptr, ptr, ptr, i32, i32, [16 x %struct._GLFWjoystick], ptr, i32, %struct._GLFWtls, %struct._GLFWtls, %struct._GLFWmutex, %struct.anon.8, %struct.anon.9, %struct.anon.10, %struct.anon.11, %struct.anon.12, %struct._GLFWlibraryNull }
%struct.GLFWallocator = type { ptr, ptr, ptr, ptr }
%struct._GLFWplatform = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon = type { %struct._GLFWinitconfig, %struct._GLFWfbconfig, %struct._GLFWwndconfig, %struct._GLFWctxconfig, i32 }
%struct._GLFWinitconfig = type { i32, i32, i32, ptr, %struct.anon.0, %struct.anon.1, %struct.anon.2 }
%struct.anon.0 = type { i32, i32 }
%struct.anon.1 = type { i32 }
%struct.anon.2 = type { i32 }
%struct._GLFWfbconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 }
%struct._GLFWwndconfig = type { i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.anon.3, %struct.anon.4, %struct.anon.5, %struct.anon.6 }
%struct.anon.3 = type { [256 x i8] }
%struct.anon.4 = type { [256 x i8], [256 x i8] }
%struct.anon.5 = type { i32, i32 }
%struct.anon.6 = type { [256 x i8] }
%struct._GLFWctxconfig = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, %struct.anon.7 }
%struct.anon.7 = type { i32 }
%struct._GLFWjoystick = type { i32, i32, ptr, i32, ptr, i32, ptr, i32, [128 x i8], ptr, [33 x i8], ptr }
%struct._GLFWtls = type { %struct._GLFWtlsPOSIX }
%struct._GLFWtlsPOSIX = type { i32, i32 }
%struct._GLFWmutex = type { %struct._GLFWmutexPOSIX }
%struct._GLFWmutexPOSIX = type { i32, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.anon.8 = type { i64, %struct._GLFWtimerPOSIX }
%struct._GLFWtimerPOSIX = type { i32, i64 }
%struct.anon.9 = type { i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.10 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.anon.11 = type { i32, ptr, [2 x ptr], ptr, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.12 = type { ptr, ptr }
%struct._GLFWlibraryNull = type { i32, i32, ptr, ptr, [121 x i16], [349 x i8] }
%struct.GLFWgammaramp = type { ptr, ptr, ptr, i32 }

@.str.1 = external hidden unnamed_addr constant [102 x i8], align 1
@_glfw = external local_unnamed_addr global %struct._GLFWlibrary, align 8
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__.glfwSetGamma = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

declare ptr @_glfw_calloc(i64 noundef, i64 noundef) local_unnamed_addr #2

declare void @_glfw_free(ptr noundef) local_unnamed_addr #2

declare void @_glfwInputError(i32 noundef, ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @glfwSetGamma(ptr noundef %0, float noundef %1) local_unnamed_addr #3 {
  %3 = alloca %struct.GLFWgammaramp, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  %4 = fcmp ogt float %1, 0.000000e+00
  br i1 %4, label %6, label %5

5:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 470, ptr noundef nonnull @__PRETTY_FUNCTION__.glfwSetGamma) #7
  unreachable

6:                                                ; preds = %2
  %7 = fcmp ugt float %1, 0x47EFFFFFE0000000
  br i1 %7, label %8, label %9

8:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 471, ptr noundef nonnull @__PRETTY_FUNCTION__.glfwSetGamma) #7
  unreachable

9:                                                ; preds = %6
  %10 = load i32, ptr @_glfw, align 8, !tbaa !5
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %12

11:                                               ; preds = %9
  tail call void (i32, ptr, ...) @_glfwInputError(i32 noundef 65537, ptr noundef null) #6
  br label %45

12:                                               ; preds = %9
  %.not34 = icmp eq ptr %0, null
  br i1 %.not34, label %13, label %14

13:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 475, ptr noundef nonnull @__PRETTY_FUNCTION__.glfwSetGamma) #7
  unreachable

14:                                               ; preds = %12
  %15 = fcmp ogt float %1, 0x47EFFFFFE0000000
  br i1 %15, label %16, label %18

16:                                               ; preds = %14
  %17 = fpext float %1 to double
  tail call void (i32, ptr, ...) @_glfwInputError(i32 noundef 65540, ptr noundef nonnull @.str.8, double noundef %17) #6
  br label %45

18:                                               ; preds = %14
  %19 = tail call ptr @glfwGetGammaRamp(ptr noundef nonnull %0)
  %.not35 = icmp eq ptr %19, null
  br i1 %.not35, label %45, label %20

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %19, i64 24
  %22 = load i32, ptr %21, align 8, !tbaa !34
  %23 = zext i32 %22 to i64
  %24 = tail call ptr @_glfw_calloc(i64 noundef %23, i64 noundef 2) #6
  %25 = load i32, ptr %21, align 8, !tbaa !34
  %.not37 = icmp eq i32 %25, 0
  br i1 %.not37, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %20
  %26 = fdiv float 1.000000e+00, %1
  br label %27

27:                                               ; preds = %.lr.ph, %27
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %27 ]
  %28 = phi i32 [ %25, %.lr.ph ], [ %39, %27 ]
  %29 = trunc nuw i64 %indvars.iv to i32
  %30 = uitofp i32 %29 to float
  %31 = add i32 %28, -1
  %32 = uitofp i32 %31 to float
  %33 = fdiv float %30, %32
  %34 = tail call float @powf(float noundef %33, float noundef %26) #6
  %35 = tail call float @llvm.fmuladd.f32(float %34, float 6.553500e+04, float 5.000000e-01)
  %36 = tail call float @llvm.minnum.f32(float %35, float 6.553500e+04)
  %37 = fptoui float %36 to i16
  %38 = getelementptr inbounds i16, ptr %24, i64 %indvars.iv
  store i16 %37, ptr %38, align 2, !tbaa !36
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = load i32, ptr %21, align 8, !tbaa !34
  %40 = zext i32 %39 to i64
  %41 = icmp ult i64 %indvars.iv.next, %40
  br i1 %41, label %27, label %._crit_edge, !llvm.loop !38

._crit_edge:                                      ; preds = %27, %20
  %.lcssa = phi i32 [ 0, %20 ], [ %39, %27 ]
  store ptr %24, ptr %3, align 8, !tbaa !40
  %42 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %24, ptr %42, align 8, !tbaa !41
  %43 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %24, ptr %43, align 8, !tbaa !42
  %44 = getelementptr inbounds i8, ptr %3, i64 24
  store i32 %.lcssa, ptr %44, align 8, !tbaa !34
  call void @glfwSetGammaRamp(ptr noundef nonnull %0, ptr noundef nonnull %3)
  call void @_glfw_free(ptr noundef %24) #6
  br label %45

45:                                               ; preds = %18, %._crit_edge, %16, %11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local ptr @glfwGetGammaRamp(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @powf(float noundef, float noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.minnum.f32(float, float) #5

; Function Attrs: nounwind uwtable
declare dso_local void @glfwSetGammaRamp(ptr noundef, ptr noundef) local_unnamed_addr #3

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { mustprogress nofree nounwind willreturn memory(write) "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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { 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 = !{!"_GLFWlibrary", !7, i64 0, !10, i64 8, !12, i64 40, !13, i64 616, !11, i64 1896, !11, i64 1904, !11, i64 1912, !11, i64 1920, !7, i64 1928, !7, i64 1932, !8, i64 1936, !11, i64 5776, !7, i64 5784, !23, i64 5788, !23, i64 5796, !25, i64 5808, !27, i64 5856, !29, i64 5880, !30, i64 6136, !31, i64 6200, !32, i64 6272, !33, i64 6288}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"GLFWallocator", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_GLFWplatform", !7, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !11, i64 288, !11, i64 296, !11, i64 304, !11, i64 312, !11, i64 320, !11, i64 328, !11, i64 336, !11, i64 344, !11, i64 352, !11, i64 360, !11, i64 368, !11, i64 376, !11, i64 384, !11, i64 392, !11, i64 400, !11, i64 408, !11, i64 416, !11, i64 424, !11, i64 432, !11, i64 440, !11, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !11, i64 520, !11, i64 528, !11, i64 536, !11, i64 544, !11, i64 552, !11, i64 560, !11, i64 568}
!13 = !{!"", !14, i64 0, !17, i64 40, !19, i64 112, !22, i64 1216, !7, i64 1272}
!14 = !{!"_GLFWinitconfig", !7, i64 0, !7, i64 4, !7, i64 8, !11, i64 16, !15, i64 24, !16, i64 32, !16, i64 36}
!15 = !{!"", !7, i64 0, !7, i64 4}
!16 = !{!"", !7, i64 0}
!17 = !{!"_GLFWfbconfig", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !18, i64 64}
!18 = !{!"long", !8, i64 0}
!19 = !{!"_GLFWwndconfig", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !11, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !20, i64 72, !21, i64 328, !15, i64 840, !20, i64 848}
!20 = !{!"", !8, i64 0}
!21 = !{!"", !8, i64 0, !8, i64 256}
!22 = !{!"_GLFWctxconfig", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !11, i64 40, !16, i64 48}
!23 = !{!"_GLFWtls", !24, i64 0}
!24 = !{!"_GLFWtlsPOSIX", !7, i64 0, !7, i64 4}
!25 = !{!"_GLFWmutex", !26, i64 0}
!26 = !{!"_GLFWmutexPOSIX", !7, i64 0, !8, i64 8}
!27 = !{!"", !18, i64 0, !28, i64 8}
!28 = !{!"_GLFWtimerPOSIX", !7, i64 0, !18, i64 8}
!29 = !{!"", !7, i64 0, !11, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248}
!30 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56}
!31 = !{!"", !7, i64 0, !11, i64 8, !8, i64 16, !11, i64 32, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68}
!32 = !{!"", !11, i64 0, !11, i64 8}
!33 = !{!"_GLFWlibraryNull", !7, i64 0, !7, i64 4, !11, i64 8, !11, i64 16, !8, i64 24, !8, i64 266}
!34 = !{!35, !7, i64 24}
!35 = !{!"GLFWgammaramp", !11, i64 0, !11, i64 8, !11, i64 16, !7, i64 24}
!36 = !{!37, !37, i64 0}
!37 = !{!"short", !8, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = !{!35, !11, i64 0}
!41 = !{!35, !11, i64 8}
!42 = !{!35, !11, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass