	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_atpx_validate
_radeon_atpx_validate:                  ## @radeon_atpx_validate
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$1, (%rdi)
	cmpq	$0, 16(%rdi)
	je	LBB0_11
## %bb.1:
	movq	%rdi, %rbx
	movl	24(%rdi), %edi
	movq	_ATPX_FUNCTION_GET_PX_PARAMETERS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	callq	_radeon_atpx_call
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r14
	leaq	-32(%rbp), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	(%r14), %rax
	movq	(%rax), %rsi
	cmpq	$9, %rsi
	ja	LBB0_6
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_printk
	movq	%r14, %rdi
	callq	_kfree
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_12
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_12
LBB0_6:
	movl	$8, %edi
	callq	_min
	movq	(%r14), %rsi
	leaq	-32(%rbp), %rdi
	movq	%rax, %rdx
	callq	_memcpy
	movl	-28(%rbp), %eax
	andl	-32(%rbp), %eax
	movq	_ATPX_SEPARATE_MUX_FOR_I2C@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movabsq	$4294967297, %rcx               ## imm = 0x100000001
	movq	%rcx, 4(%rbx)
LBB0_8:
	movq	_ATPX_CRT1_RGB_SIGNAL_MUXED@GOTPCREL(%rip), %rcx
	movq	_ATPX_TV_SIGNAL_MUXED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_ATPX_DFP_SIGNAL_MUXED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_10
## %bb.9:
	movl	$1, 8(%rbx)
LBB0_10:
	movq	%r14, %rdi
	callq	_kfree
LBB0_11:
	xorl	%r15d, %r15d
LBB0_12:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATPX_FUNCTION_GET_PX_PARAMETERS,4,2 ## @ATPX_FUNCTION_GET_PX_PARAMETERS
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ATPX buffer is too small: %zu\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ATPX_SEPARATE_MUX_FOR_I2C,4,2  ## @ATPX_SEPARATE_MUX_FOR_I2C
	.comm	_ATPX_CRT1_RGB_SIGNAL_MUXED,4,2 ## @ATPX_CRT1_RGB_SIGNAL_MUXED
	.comm	_ATPX_TV_SIGNAL_MUXED,4,2       ## @ATPX_TV_SIGNAL_MUXED
	.comm	_ATPX_DFP_SIGNAL_MUXED,4,2      ## @ATPX_DFP_SIGNAL_MUXED
	.no_dead_strip	_radeon_atpx_validate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_atpx_validate
_radeon_atpx_validate:                  ; @radeon_atpx_validate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	w8, #1
	str	w8, [x0]
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_11
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0, #24]
Lloh0:
	adrp	x8, _ATPX_FUNCTION_GET_PX_PARAMETERS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATPX_FUNCTION_GET_PX_PARAMETERS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_radeon_atpx_call
	cbz	x0, LBB0_4
; %bb.2:
	mov	x20, x0
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x8, [x20]
	ldr	x1, [x8]
	cmp	x1, #9
	b.hi	LBB0_6
; %bb.3:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
	mov	x0, x20
	bl	_kfree
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh7:
	adrp	x8, _EIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_6:
	mov	w0, #8
	bl	_min
	mov	x2, x0
	ldr	x1, [x20]
	add	x0, sp, #8
	bl	_memcpy
	ldp	w8, w9, [sp, #8]
	and	w8, w9, w8
Lloh9:
	adrp	x9, _ATPX_SEPARATE_MUX_FOR_I2C@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ATPX_SEPARATE_MUX_FOR_I2C@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w8, w9
	b.eq	LBB0_8
; %bb.7:
	movi.2s	v0, #1
	stur	d0, [x19, #4]
LBB0_8:
Lloh12:
	adrp	x9, _ATPX_CRT1_RGB_SIGNAL_MUXED@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ATPX_CRT1_RGB_SIGNAL_MUXED@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _ATPX_TV_SIGNAL_MUXED@GOTPAGE
Lloh16:
	ldr	x10, [x10, _ATPX_TV_SIGNAL_MUXED@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh18:
	adrp	x10, _ATPX_DFP_SIGNAL_MUXED@GOTPAGE
Lloh19:
	ldr	x10, [x10, _ATPX_DFP_SIGNAL_MUXED@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	orr	w9, w9, w10
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
	mov	w8, #1
	str	w8, [x19, #8]
LBB0_10:
	mov	x0, x20
	bl	_kfree
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ATPX_FUNCTION_GET_PX_PARAMETERS,4,2 ; @ATPX_FUNCTION_GET_PX_PARAMETERS
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ATPX buffer is too small: %zu\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ATPX_SEPARATE_MUX_FOR_I2C,4,2  ; @ATPX_SEPARATE_MUX_FOR_I2C
	.comm	_ATPX_CRT1_RGB_SIGNAL_MUXED,4,2 ; @ATPX_CRT1_RGB_SIGNAL_MUXED
	.comm	_ATPX_TV_SIGNAL_MUXED,4,2       ; @ATPX_TV_SIGNAL_MUXED
	.comm	_ATPX_DFP_SIGNAL_MUXED,4,2      ; @ATPX_DFP_SIGNAL_MUXED
	.no_dead_strip	_radeon_atpx_validate
.subsections_via_symbols
