	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_check_arguments
_radeon_check_arguments:                ## @radeon_check_arguments
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	_radeon_vram_limit@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_radeon_check_pot_argument
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	(%r12), %edi
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movl	$0, (%rbx)
LBB0_2:
	movq	_radeon_gart_size@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	cmpl	$-1, %edx
	je	LBB0_3
## %bb.4:
	cmpl	$31, %edx
	jg	LBB0_6
LBB0_5:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_9
LBB0_3:
	movl	8(%r12), %edi
	callq	_radeon_gart_size_auto
	movl	%eax, %edx
	movl	%eax, (%r14)
	cmpl	$31, %edx
	jle	LBB0_5
LBB0_6:
	movl	%edx, %edi
	callq	_radeon_check_pot_argument
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	(%r14), %eax
	jmp	LBB0_10
LBB0_8:
	movl	(%r12), %edi
	movl	(%r14), %edx
	leaq	L_.str.2(%rip), %rsi
LBB0_9:
	callq	_dev_warn
	movl	8(%r12), %edi
	callq	_radeon_gart_size_auto
	movl	%eax, (%r14)
LBB0_10:
	shll	$20, %eax
	movl	%eax, 4(%r12)
	movq	_radeon_agpmode@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	leal	1(%rdx), %eax
	cmpl	$9, %eax
	ja	LBB0_12
## %bb.11:
	movl	$559, %ecx                      ## imm = 0x22F
	btl	%eax, %ecx
	jae	LBB0_12
LBB0_13:
	movq	_radeon_vm_size@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_radeon_check_pot_argument
	testl	%eax, %eax
	je	LBB0_14
## %bb.15:
	movl	(%r14), %edx
	testl	%edx, %edx
	jle	LBB0_16
## %bb.17:
	cmpl	$1025, %edx                     ## imm = 0x401
	jb	LBB0_20
## %bb.18:
	movl	(%r12), %edi
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_19
LBB0_14:
	movl	(%r12), %edi
	movl	(%r14), %edx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_19
LBB0_16:
	movl	(%r12), %edi
	leaq	L_.str.5(%rip), %rsi
LBB0_19:
	callq	_dev_warn
	movl	$4, (%r14)
	movl	$4, %edx
LBB0_20:
	movq	_radeon_vm_block_size@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	cmpl	$-1, %ecx
	je	LBB0_21
## %bb.23:
	cmpl	$8, %ecx
	jg	LBB0_22
## %bb.24:
	movl	(%r12), %edi
	leaq	L_.str.7(%rip), %rsi
	movl	%ecx, %edx
	callq	_dev_warn
	movl	$9, (%r15)
	movl	(%r14), %edx
	movl	$9, %ecx
	jmp	LBB0_25
LBB0_21:
	movl	%edx, %edi
	callq	_ilog2
	movl	%eax, %ecx
	movl	(%r14), %edx
	leal	21(%rcx), %eax
	shrl	%eax
	addl	$9, %ecx
	cmpl	$9, %edx
	cmovgel	%eax, %ecx
	movl	%ecx, (%r15)
LBB0_22:
	cmpl	$24, %ecx
	jg	LBB0_26
LBB0_25:
	shll	$10, %edx
	movslq	%edx, %rax
	shrq	%cl, %rax
	testq	%rax, %rax
	jne	LBB0_27
LBB0_26:
	movl	(%r12), %edi
	leaq	L_.str.8(%rip), %rsi
	movl	%ecx, %edx
	callq	_dev_warn
	movl	$9, (%r15)
LBB0_27:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dev_warn
	movl	$0, (%rbx)
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_radeon_vram_limit,4,2          ## @radeon_vram_limit
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vram limit (%d) must be a power of 2\n"

	.comm	_radeon_gart_size,4,2           ## @radeon_gart_size
L_.str.1:                               ## @.str.1
	.asciz	"gart size (%d) too small\n"

L_.str.2:                               ## @.str.2
	.asciz	"gart size (%d) must be a power of 2\n"

	.comm	_radeon_agpmode,4,2             ## @radeon_agpmode
L_.str.3:                               ## @.str.3
	.asciz	"invalid AGP mode %d (valid mode: -1, 0, 1, 2, 4, 8)\n"

	.comm	_radeon_vm_size,4,2             ## @radeon_vm_size
L_.str.4:                               ## @.str.4
	.asciz	"VM size (%d) must be a power of 2\n"

L_.str.5:                               ## @.str.5
	.asciz	"VM size (%d) too small, min is 1GB\n"

L_.str.6:                               ## @.str.6
	.asciz	"VM size (%d) too large, max is 1TB\n"

	.comm	_radeon_vm_block_size,4,2       ## @radeon_vm_block_size
L_.str.7:                               ## @.str.7
	.asciz	"VM page table size (%d) too small\n"

L_.str.8:                               ## @.str.8
	.asciz	"VM page table size (%d) too large\n"

	.no_dead_strip	_radeon_check_arguments
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_check_arguments
_radeon_check_arguments:                ; @radeon_check_arguments
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
Lloh0:
	adrp	x20, _radeon_vram_limit@GOTPAGE
Lloh1:
	ldr	x20, [x20, _radeon_vram_limit@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_radeon_check_pot_argument
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
	ldr	w2, [x20]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	str	wzr, [x20]
LBB0_2:
Lloh4:
	adrp	x20, _radeon_gart_size@GOTPAGE
Lloh5:
	ldr	x20, [x20, _radeon_gart_size@GOTPAGEOFF]
	ldr	w2, [x20]
	cmn	w2, #1
	b.eq	LBB0_5
; %bb.3:
	cmp	w2, #31
	b.gt	LBB0_6
LBB0_4:
	ldr	w0, [x19]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_5:
	ldr	w0, [x19, #8]
	bl	_radeon_gart_size_auto
	mov	x2, x0
	str	w0, [x20]
	cmp	w2, #31
	b.le	LBB0_4
LBB0_6:
	mov	x0, x2
	bl	_radeon_check_pot_argument
	cbz	w0, LBB0_8
; %bb.7:
	ldr	w0, [x20]
	b	LBB0_10
LBB0_8:
	ldr	w0, [x19]
	ldr	w2, [x20]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	bl	_dev_warn
	ldr	w0, [x19, #8]
	bl	_radeon_gart_size_auto
	str	w0, [x20]
LBB0_10:
	lsl	w8, w0, #20
	str	w8, [x19, #4]
Lloh10:
	adrp	x20, _radeon_agpmode@GOTPAGE
Lloh11:
	ldr	x20, [x20, _radeon_agpmode@GOTPAGEOFF]
	ldr	w2, [x20]
	add	w8, w2, #1
	cmp	w8, #9
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #559
	and	w8, w8, w9
	ccmp	w8, #0, #4, ls
	b.eq	LBB0_26
LBB0_11:
Lloh12:
	adrp	x20, _radeon_vm_size@GOTPAGE
Lloh13:
	ldr	x20, [x20, _radeon_vm_size@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_radeon_check_pot_argument
	cbz	w0, LBB0_15
; %bb.12:
	ldr	w2, [x20]
	cmp	w2, #0
	b.le	LBB0_16
; %bb.13:
	cmp	w2, #1025
	b.lo	LBB0_18
; %bb.14:
	ldr	w0, [x19]
Lloh14:
	adrp	x1, l_.str.6@PAGE
Lloh15:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_17
LBB0_15:
	ldr	w0, [x19]
	ldr	w2, [x20]
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_16:
	ldr	w0, [x19]
Lloh18:
	adrp	x1, l_.str.5@PAGE
Lloh19:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_17:
	bl	_dev_warn
	mov	w2, #4
	str	w2, [x20]
LBB0_18:
Lloh20:
	adrp	x21, _radeon_vm_block_size@GOTPAGE
Lloh21:
	ldr	x21, [x21, _radeon_vm_block_size@GOTPAGEOFF]
	ldr	w8, [x21]
	cmn	w8, #1
	b.eq	LBB0_21
; %bb.19:
	cmp	w8, #8
	b.gt	LBB0_22
; %bb.20:
	ldr	w0, [x19]
Lloh22:
	adrp	x1, l_.str.7@PAGE
Lloh23:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x2, x8
	bl	_dev_warn
	mov	w8, #9
	str	w8, [x21]
	ldr	w2, [x20]
	b	LBB0_23
LBB0_21:
	mov	x0, x2
	bl	_ilog2
	ldr	w2, [x20]
	add	w8, w0, #21
	lsr	w8, w8, #1
	add	w9, w0, #9
	cmp	w2, #9
	csel	w8, w9, w8, lt
	str	w8, [x21]
LBB0_22:
	cmp	w8, #24
	b.gt	LBB0_24
LBB0_23:
	lsl	w9, w2, #10
	sxtw	x9, w9
	lsr	x9, x9, x8
	cbnz	x9, LBB0_25
LBB0_24:
	ldr	w0, [x19]
Lloh24:
	adrp	x1, l_.str.8@PAGE
Lloh25:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x2, x8
	bl	_dev_warn
	mov	w8, #9
	str	w8, [x21]
LBB0_25:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_26:
	ldr	w0, [x19]
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_warn
	str	wzr, [x20]
	b	LBB0_11
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_radeon_vram_limit,4,2          ; @radeon_vram_limit
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vram limit (%d) must be a power of 2\n"

	.comm	_radeon_gart_size,4,2           ; @radeon_gart_size
l_.str.1:                               ; @.str.1
	.asciz	"gart size (%d) too small\n"

l_.str.2:                               ; @.str.2
	.asciz	"gart size (%d) must be a power of 2\n"

	.comm	_radeon_agpmode,4,2             ; @radeon_agpmode
l_.str.3:                               ; @.str.3
	.asciz	"invalid AGP mode %d (valid mode: -1, 0, 1, 2, 4, 8)\n"

	.comm	_radeon_vm_size,4,2             ; @radeon_vm_size
l_.str.4:                               ; @.str.4
	.asciz	"VM size (%d) must be a power of 2\n"

l_.str.5:                               ; @.str.5
	.asciz	"VM size (%d) too small, min is 1GB\n"

l_.str.6:                               ; @.str.6
	.asciz	"VM size (%d) too large, max is 1TB\n"

	.comm	_radeon_vm_block_size,4,2       ; @radeon_vm_block_size
l_.str.7:                               ; @.str.7
	.asciz	"VM page table size (%d) too small\n"

l_.str.8:                               ; @.str.8
	.asciz	"VM page table size (%d) too large\n"

	.no_dead_strip	_radeon_check_arguments
.subsections_via_symbols
