	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_atif_query_backlight_caps
_amdgpu_atif_query_backlight_caps:      ## @amdgpu_atif_query_backlight_caps
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	$8, -48(%rbp)
	movq	_ATIF_QBTC_REQUEST_LCD1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	$8, -72(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, -64(%rbp)
	movq	_ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-72(%rbp), %rdx
	callq	_amdgpu_atif_call
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	(%r15), %rax
	movq	(%rax), %r12
	cmpq	$9, %r12
	ja	LBB0_5
## %bb.4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_5:
	leaq	-56(%rbp), %r13
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	$8, %edi
	movq	%r12, %rsi
	callq	_min
	movq	(%r15), %rsi
	movq	%r13, %rdi
	movq	%rax, %rdx
	callq	_memcpy
	movl	$1, (%r14)
	movl	-52(%rbp), %eax
	movl	%eax, 8(%r14)
	movl	-56(%rbp), %eax
	movl	%eax, 4(%r14)
LBB0_6:
	movq	%r15, %rdi
	callq	_kfree
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATIF_QBTC_REQUEST_LCD1,4,2     ## @ATIF_QBTC_REQUEST_LCD1
	.comm	_ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS,4,2 ## @ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS
	.comm	_EIO,4,2                        ## @EIO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_amdgpu_atif_query_backlight_caps
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_atif_query_backlight_caps
_amdgpu_atif_query_backlight_caps:      ; @amdgpu_atif_query_backlight_caps
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	mov	w8, #8
Lloh0:
	adrp	x9, _ATIF_QBTC_REQUEST_LCD1@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATIF_QBTC_REQUEST_LCD1@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #16]
	str	w8, [sp]
	add	x8, sp, #16
	str	x8, [sp, #8]
Lloh3:
	adrp	x8, _ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_amdgpu_atif_call
	mov	x19, x0
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x19]
	ldr	x21, [x8]
	cmp	x21, #9
	b.hi	LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_5:
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	mov	w0, #8
	mov	x1, x21
	bl	_min
	mov	x2, x0
	ldr	x1, [x19]
	add	x0, sp, #24
	bl	_memcpy
	mov	w21, #0
	mov	w8, #1
	str	w8, [x20]
	ldr	d0, [sp, #24]
	stur	d0, [x20, #4]
LBB0_6:
	mov	x0, x19
	bl	_kfree
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ATIF_QBTC_REQUEST_LCD1,4,2     ; @ATIF_QBTC_REQUEST_LCD1
	.comm	_ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS,4,2 ; @ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS
	.comm	_EIO,4,2                        ; @EIO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_amdgpu_atif_query_backlight_caps
.subsections_via_symbols
