	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_backlight_init         ## -- Begin function nouveau_backlight_init
	.p2align	4, 0x90
_nouveau_backlight_init:                ## @nouveau_backlight_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	12(%rdi), %edi
	callq	_nouveau_drm
	movq	%rax, %r14
	movq	_BL_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	$0, -56(%rbp)
	xorl	%eax, %eax
	callq	_apple_gmux_present
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_NV_INFO_ONCE
LBB0_2:
	xorl	%r12d, %r12d
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_30
## %bb.4:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	(%rbx), %rax
	movq	_DRM_MODE_CONNECTOR_LVDS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	_DCB_OUTPUT_LVDS@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_DRM_MODE_CONNECTOR_eDP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.8:
	movq	_DCB_OUTPUT_DP@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_find_encoder
	testq	%rax, %rax
	je	LBB0_2
## %bb.10:
	movq	%rax, %r13
	movl	(%r14), %eax
	leal	-128(%rax), %ecx
	cmpl	$7, %ecx
	jae	LBB0_23
## %bb.11:
	leaq	-56(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	movq	%r13, %rdi
	callq	_nv50_backlight_init
LBB0_12:
	movl	%eax, %r12d
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	je	LBB0_2
## %bb.16:
	testl	%r12d, %r12d
	jne	LBB0_3
## %bb.17:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_26
## %bb.18:
	movq	%rax, %r12
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_nouveau_get_backlight_name
	testl	%eax, %eax
	je	LBB0_27
## %bb.19:
	movl	8(%rbx), %esi
	movq	-64(%rbp), %rcx
	leaq	-56(%rbp), %r8
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_backlight_device_register
	movq	%rax, 8(%r12)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_29
## %bb.20:
	movq	(%r12), %rsi
	testq	%rsi, %rsi
	js	LBB0_22
## %bb.21:
	movq	_bl_ida@GOTPCREL(%rip), %rdi
	callq	_ida_simple_remove
LBB0_22:
	movq	8(%r12), %rdi
	callq	_PTR_ERR
	movq	%r12, %rdi
	movl	%eax, %r12d
	jmp	LBB0_28
LBB0_23:
	cmpl	$135, %eax
	jne	LBB0_2
## %bb.24:
	leaq	-56(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	movq	%r13, %rdi
	callq	_nv40_backlight_init
	jmp	LBB0_12
LBB0_26:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_3
LBB0_27:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_NV_ERROR
	movq	%r12, %rdi
	xorl	%r12d, %r12d
LBB0_28:
	callq	_kfree
	jmp	LBB0_3
LBB0_29:
	movq	%rbx, %rdi
	callq	_nouveau_connector
	movq	%r12, (%rax)
	movq	8(%r12), %rdi
	movq	(%rdi), %rax
	callq	*(%rax)
	movq	8(%r12), %rdi
	movl	%eax, 8(%rdi)
	callq	_backlight_update_status
	jmp	LBB0_2
LBB0_30:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BL_NAME_SIZE,4,2               ## @BL_NAME_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Apple GMUX detected: not registering Nouveau backlight interface\n"

	.comm	_DRM_MODE_CONNECTOR_LVDS,8,3    ## @DRM_MODE_CONNECTOR_LVDS
	.comm	_DCB_OUTPUT_LVDS,4,2            ## @DCB_OUTPUT_LVDS
	.comm	_DRM_MODE_CONNECTOR_eDP,8,3     ## @DRM_MODE_CONNECTOR_eDP
	.comm	_DCB_OUTPUT_DP,4,2              ## @DCB_OUTPUT_DP
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Failed to retrieve a unique name for the backlight interface\n"

	.comm	_bl_ida,4,2                     ## @bl_ida
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_backlight_init         ; -- Begin function nouveau_backlight_init
	.p2align	2
_nouveau_backlight_init:                ; @nouveau_backlight_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	w0, [x0, #12]
	bl	_nouveau_drm
	mov	x20, x0
Lloh3:
	adrp	x8, _BL_NAME_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BL_NAME_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	stur	wzr, [x29, #-64]
	bl	_apple_gmux_present
	cbz	x0, LBB0_5
; %bb.1:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_NV_INFO_ONCE
LBB0_2:
	mov	w24, #0
LBB0_3:
	ldur	x8, [x29, #-56]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_26
; %bb.4:
	mov	x0, x24
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x8, [x19]
Lloh13:
	adrp	x9, _DRM_MODE_CONNECTOR_LVDS@GOTPAGE
Lloh14:
	ldr	x9, [x9, _DRM_MODE_CONNECTOR_LVDS@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
Lloh16:
	adrp	x8, _DCB_OUTPUT_LVDS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DCB_OUTPUT_LVDS@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh18:
	adrp	x9, _DRM_MODE_CONNECTOR_eDP@GOTPAGE
Lloh19:
	ldr	x9, [x9, _DRM_MODE_CONNECTOR_eDP@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.8:
Lloh21:
	adrp	x8, _DCB_OUTPUT_DP@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DCB_OUTPUT_DP@GOTPAGEOFF]
LBB0_9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_find_encoder
	cbz	x0, LBB0_2
; %bb.10:
	mov	x23, x0
	ldr	w8, [x20]
	sub	w9, w8, #128
	cmp	w9, #7
	b.hs	LBB0_20
; %bb.11:
	sub	x1, x29, #64
	sub	x2, x29, #72
	mov	x0, x23
	bl	_nv50_backlight_init
LBB0_12:
	mov	x24, x0
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_2
; %bb.13:
	cbnz	w24, LBB0_3
; %bb.14:
Lloh26:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_22
; %bb.15:
	mov	x22, x0
	mov	x0, x21
	mov	x1, x22
	bl	_nouveau_get_backlight_name
	cbz	w0, LBB0_23
; %bb.16:
	ldr	w1, [x19, #8]
	ldur	x3, [x29, #-72]
	sub	x4, x29, #64
	mov	x0, x21
	mov	x2, x23
	bl	_backlight_device_register
	str	x0, [x22, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_25
; %bb.17:
	ldr	x1, [x22]
	tbnz	x1, #63, LBB0_19
; %bb.18:
Lloh29:
	adrp	x0, _bl_ida@GOTPAGE
Lloh30:
	ldr	x0, [x0, _bl_ida@GOTPAGEOFF]
	bl	_ida_simple_remove
LBB0_19:
	ldr	x0, [x22, #8]
	bl	_PTR_ERR
	mov	x24, x0
	b	LBB0_24
LBB0_20:
	cmp	w8, #135
	b.ne	LBB0_2
; %bb.21:
	sub	x1, x29, #64
	sub	x2, x29, #72
	mov	x0, x23
	bl	_nv40_backlight_init
	b	LBB0_12
LBB0_22:
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_3
LBB0_23:
Lloh34:
	adrp	x1, l_.str.1@PAGE
Lloh35:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_NV_ERROR
	mov	w24, #0
LBB0_24:
	mov	x0, x22
	bl	_kfree
	b	LBB0_3
LBB0_25:
	mov	x0, x19
	bl	_nouveau_connector
	str	x22, [x0]
	ldr	x0, [x22, #8]
	ldr	x8, [x0]
	ldr	x8, [x8]
	blr	x8
	ldr	x8, [x22, #8]
	str	w0, [x8, #8]
	mov	x0, x8
	bl	_backlight_update_status
	b	LBB0_2
LBB0_26:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_BL_NAME_SIZE,4,2               ; @BL_NAME_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Apple GMUX detected: not registering Nouveau backlight interface\n"

	.comm	_DRM_MODE_CONNECTOR_LVDS,8,3    ; @DRM_MODE_CONNECTOR_LVDS
	.comm	_DCB_OUTPUT_LVDS,4,2            ; @DCB_OUTPUT_LVDS
	.comm	_DRM_MODE_CONNECTOR_eDP,8,3     ; @DRM_MODE_CONNECTOR_eDP
	.comm	_DCB_OUTPUT_DP,4,2              ; @DCB_OUTPUT_DP
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Failed to retrieve a unique name for the backlight interface\n"

	.comm	_bl_ida,4,2                     ; @bl_ida
.subsections_via_symbols
