	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_cs_parser_relocs
_radeon_cs_parser_relocs:               ## @radeon_cs_parser_relocs
	.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
	movslq	(%rdi), %rbx
	cmpq	$-1, %rbx
	je	LBB0_1
## %bb.3:
	movq	%rdi, %r13
	movq	56(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	48(%rdi), %r14
	movq	$0, 40(%rdi)
	shlq	$4, %rbx
	movl	(%r14,%rbx), %eax
	leal	3(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$2, %edi
	movl	%edi, 4(%r13)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 24(%r13)
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movl	4(%r13), %edi
	movl	(%r15), %edx
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 16(%r13)
	testq	%rax, %rax
	je	LBB0_4
## %bb.7:
	movl	4(%r13), %eax
	testl	%eax, %eax
	je	LBB0_17
## %bb.8:
	leaq	(%r14,%rbx), %rcx
	addq	$8, %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	leaq	8(%r13), %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	24(%r13), %rdx
	movq	%rcx, (%rdx,%rbx,8)
	movq	16(%r13), %rcx
	imulq	$56, %rbx, %rdx
	movq	$0, (%rcx,%rdx)
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	incq	%rbx
	movl	%eax, %ecx
	cmpq	%rcx, %rbx
	jae	LBB0_17
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %r14
	leal	(,%rbx,4), %r15d
	movq	(%r14,%r15,4), %rdx
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	16(%r13), %rcx
	movq	%rbx, %rsi
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	(%rcx), %rdx
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_12 Depth=2
	addq	$56, %rcx
	decq	%rsi
	jne	LBB0_12
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	32(%r13), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_gem_object_lookup
	movq	16(%r13), %rcx
	imulq	$56, %rbx, %r12
	movq	%rax, 48(%rcx,%r12)
	testq	%rax, %rax
	je	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	addq	%r12, %rcx
	movq	24(%r13), %rax
	movq	%rcx, (%rax,%rbx,8)
	movq	16(%r13), %rax
	movq	48(%rax,%r12), %rdi
	callq	_gem_to_radeon_bo
	movq	16(%r13), %rcx
	movq	%rax, 40(%rcx,%r12)
	leaq	(%rcx,%r12), %rdi
	addq	$8, %rdi
	movq	%rax, 24(%rcx,%r12)
	movl	16(%r14,%r15,4), %edx
	movl	%edx, 20(%rcx,%r12)
	movl	12(%r14,%r15,4), %edx
	movl	%edx, 16(%rcx,%r12)
	movq	%rax, 8(%rcx,%r12)
	movq	(%r14,%r15,4), %rax
	movq	%rax, (%rcx,%r12)
	movl	8(%r14,%r15,4), %eax
	movl	%eax, 32(%rcx,%r12)
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_radeon_bo_list_add_object
	movl	4(%r13), %eax
	jmp	LBB0_16
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_2
LBB0_1:
	xorl	%eax, %eax
LBB0_2:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	addq	$8, %r13
	movq	%r13, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_radeon_bo_list_validate        ## TAILCALL
LBB0_18:
	movq	(%r14,%r15,4), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gem object lookup failed 0x%x\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.no_dead_strip	_radeon_cs_parser_relocs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_cs_parser_relocs
_radeon_cs_parser_relocs:               ; @radeon_cs_parser_relocs
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldrsw	x21, [x0]
	cmn	w21, #1
	b.eq	LBB0_15
; %bb.1:
	mov	x19, x0
	ldp	x23, x8, [x0, #48]
	ldr	x20, [x8]
	str	xzr, [x0, #40]
	lsl	x8, x21, #4
	ldr	w8, [x23, x8]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w0, w8, #2
	str	w0, [x19, #4]
Lloh0:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_13
; %bb.2:
	ldr	w0, [x19, #4]
	ldr	w2, [x22]
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_13
; %bb.3:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_17
; %bb.4:
	mov	x22, #0
	add	x9, x23, x21, lsl #4
	add	x23, x9, #8
	add	x21, x19, #8
	mov	w24, #56
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x10, [x19, #24]
	str	x9, [x10, x22, lsl #3]
	ldr	x9, [x19, #16]
	mul	x10, x22, x24
	str	xzr, [x9, x10]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x22, x22, #1
	cmp	x22, w8, uxtw
	b.hs	LBB0_17
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	x9, [x23]
	lsl	w10, w22, #2
	add	x25, x9, w10, uxtw #2
	ldr	x2, [x25]
	cbz	x22, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x9, [x19, #16]
	mov	x10, x22
LBB0_9:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x11, [x9]
	cmp	x2, x11
	b.eq	LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	add	x9, x9, #56
	subs	x10, x10, #1
	b.ne	LBB0_9
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w1, [x19, #32]
	mov	x0, x20
	bl	_drm_gem_object_lookup
	ldr	x8, [x19, #16]
	madd	x9, x22, x24, x8
	str	x0, [x9, #48]
	cbz	x0, LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	mul	x26, x22, x24
	add	x8, x8, x26
	ldr	x9, [x19, #24]
	str	x8, [x9, x22, lsl #3]
	ldr	x8, [x19, #16]
	add	x8, x8, x26
	ldr	x0, [x8, #48]
	bl	_gem_to_radeon_bo
	ldr	x8, [x19, #16]
	add	x8, x8, x26
	str	x0, [x8, #40]
	str	x0, [x8, #24]
	ldur	d0, [x25, #12]
	str	d0, [x8, #16]
	ldr	x9, [x25]
	str	x9, [x8]
	ldr	w9, [x25, #8]
	str	w9, [x8, #32]
	str	x0, [x8, #8]!
	mov	x0, x8
	mov	x1, x21
	bl	_radeon_bo_list_add_object
	ldr	w8, [x19, #4]
	b	LBB0_6
LBB0_13:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_16
LBB0_15:
	mov	w0, #0
LBB0_16:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_17:
	add	x0, x19, #8
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_radeon_bo_list_validate
LBB0_18:
	ldr	x1, [x25]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh6:
	adrp	x8, _ENOENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gem object lookup failed 0x%x\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.no_dead_strip	_radeon_cs_parser_relocs
.subsections_via_symbols
