	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_cs_ib_fill
_radeon_cs_ib_fill:                     ## @radeon_cs_ib_fill
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	24(%rsi), %r13
	xorl	%r14d, %r14d
	testq	%r13, %r13
	je	LBB0_21
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_RADEON_CS_USE_VM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_2
## %bb.5:
	movq	56(%rbx), %rax
	movq	(%rax), %rcx
	movq	(%r15), %rax
	movq	_CHIP_TAHITI@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jl	LBB0_14
## %bb.6:
	movq	48(%rbx), %r12
	testq	%r12, %r12
	je	LBB0_14
## %bb.7:
	movl	(%r12), %r8d
	movq	_RADEON_IB_VM_MAX_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r8d
	jle	LBB0_10
## %bb.8:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_9
LBB0_2:
	movl	(%r13), %r8d
	xorl	%ecx, %ecx
	jmp	LBB0_3
LBB0_10:
	movl	16(%rbx), %esi
	leaq	32(%rbx), %rdx
	shll	$2, %r8d
	movq	%r15, %rdi
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	callq	_radeon_ib_get
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	%r13d, %r14d
	jmp	LBB0_21
LBB0_12:
	movl	$1, 32(%rbx)
	movl	(%r12), %edx
	movl	%edx, 36(%rbx)
	movl	40(%rbx), %edi
	movl	4(%r12), %esi
	shll	$2, %edx
	callq	_copy_from_user
	testq	%rax, %rax
	jne	LBB0_19
## %bb.13:
	movq	24(%rbx), %r13
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
LBB0_14:
	movl	(%r13), %r8d
	movq	_RADEON_IB_VM_MAX_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r8d
	jle	LBB0_3
## %bb.15:
	leaq	L_.str.2(%rip), %rdi
LBB0_9:
	xorl	%r14d, %r14d
	movl	%r8d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_20:
	subl	(%rax), %r14d
	jmp	LBB0_21
LBB0_3:
	movl	16(%rbx), %esi
	leaq	4(%rbx), %rdx
	shll	$2, %r8d
	movq	%r15, %rdi
	callq	_radeon_ib_get
	testl	%eax, %eax
	je	LBB0_16
## %bb.4:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	%r15d, %r14d
	jmp	LBB0_21
LBB0_16:
	movl	(%r13), %edx
	movl	%edx, 8(%rbx)
	movq	8(%r13), %rsi
	movl	12(%rbx), %edi
	testq	%rsi, %rsi
	je	LBB0_18
## %bb.17:
	shll	$2, %edx
	callq	_memcpy
LBB0_21:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movl	4(%r13), %esi
	shll	$2, %edx
	callq	_copy_from_user
	testq	%rax, %rax
	je	LBB0_21
LBB0_19:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_RADEON_CS_USE_VM,4,2           ## @RADEON_CS_USE_VM
	.comm	_CHIP_TAHITI,8,3                ## @CHIP_TAHITI
	.comm	_RADEON_IB_VM_MAX_SIZE,4,2      ## @RADEON_IB_VM_MAX_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cs IB CONST too big: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Failed to get const ib !\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.2:                               ## @.str.2
	.asciz	"cs IB too big: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to get ib !\n"

	.no_dead_strip	_radeon_cs_ib_fill
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_cs_ib_fill
_radeon_cs_ib_fill:                     ; @radeon_cs_ib_fill
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x23, [x1, #24]
	cbz	x23, LBB0_19
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _RADEON_CS_USE_VM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_CS_USE_VM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.2:
	ldr	x8, [x19, #56]
	ldr	x21, [x8]
	ldr	x8, [x20]
Lloh3:
	adrp	x9, _CHIP_TAHITI@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CHIP_TAHITI@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x24, _RADEON_IB_VM_MAX_SIZE@GOTPAGE
Lloh7:
	ldr	x24, [x24, _RADEON_IB_VM_MAX_SIZE@GOTPAGEOFF]
	cmp	x8, x9
	b.lt	LBB0_11
; %bb.3:
	ldr	x25, [x19, #48]
	cbz	x25, LBB0_11
; %bb.4:
	ldr	w8, [x25]
	ldr	w9, [x24]
	cmp	w8, w9
	b.le	LBB0_7
; %bb.5:
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_13
LBB0_6:
	mov	x21, #0
	ldr	w8, [x23]
	b	LBB0_15
LBB0_7:
	ldr	w1, [x19, #16]
	add	x2, x19, #32
	lsl	w4, w8, #2
	mov	x0, x20
	mov	x3, x21
	bl	_radeon_ib_get
	cbz	w0, LBB0_9
; %bb.8:
	mov	x22, x0
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_20
LBB0_9:
	mov	w8, #1
	ldp	w9, w1, [x25]
	stp	w8, w9, [x19, #32]
	ldr	w0, [x19, #40]
	lsl	w2, w9, #2
	bl	_copy_from_user
	cbnz	x0, LBB0_22
; %bb.10:
	ldr	x23, [x19, #24]
LBB0_11:
	ldr	w8, [x23]
	ldr	w9, [x24]
	cmp	w8, w9
	b.le	LBB0_15
; %bb.12:
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_13:
	bl	_DRM_ERROR
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_20
LBB0_15:
	ldr	w1, [x19, #16]
	add	x2, x19, #4
	lsl	w4, w8, #2
	mov	x0, x20
	mov	x3, x21
	bl	_radeon_ib_get
	cbz	w0, LBB0_17
; %bb.16:
	mov	x22, x0
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_20
LBB0_17:
	ldr	w8, [x23]
	str	w8, [x19, #8]
	ldr	x1, [x23, #8]
	ldr	w0, [x19, #12]
	cbz	x1, LBB0_21
; %bb.18:
	lsl	w2, w8, #2
	bl	_memcpy
LBB0_19:
	mov	w22, #0
LBB0_20:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_21:
	ldr	w1, [x23, #4]
	lsl	w2, w8, #2
	bl	_copy_from_user
	cbz	x0, LBB0_19
LBB0_22:
Lloh18:
	adrp	x8, _EFAULT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_RADEON_CS_USE_VM,4,2           ; @RADEON_CS_USE_VM
	.comm	_CHIP_TAHITI,8,3                ; @CHIP_TAHITI
	.comm	_RADEON_IB_VM_MAX_SIZE,4,2      ; @RADEON_IB_VM_MAX_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cs IB CONST too big: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Failed to get const ib !\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.2:                               ; @.str.2
	.asciz	"cs IB too big: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to get ib !\n"

	.no_dead_strip	_radeon_cs_ib_fill
.subsections_via_symbols
