	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_cs_packet_next_reloc    ## -- Begin function radeon_cs_packet_next_reloc
	.p2align	4, 0x90
_radeon_cs_packet_next_reloc:           ## @radeon_cs_packet_next_reloc
	.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
	cmpq	$0, 16(%rdi)
	je	LBB0_1
## %bb.2:
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	$0, (%rsi)
	movq	16(%rdi), %r13
	movl	8(%rdi), %edx
	leaq	-72(%rbp), %rsi
	callq	_radeon_cs_packet_parse
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.3:
	movl	-48(%rbp), %eax
	movl	8(%r15), %ecx
	addl	%ecx, %eax
	addl	$2, %eax
	movl	%eax, 8(%r15)
	movq	-72(%rbp), %rax
	movq	_RADEON_PACKET_TYPE3@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	movq	-64(%rbp), %rax
	movq	_RADEON_PACKET3_NOP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.6:
	movl	-56(%rbp), %esi
	incl	%esi
	movq	%r15, %rdi
	callq	_radeon_get_ib_value
                                        ## kill: def $eax killed $eax def $rax
	movl	(%r13), %edx
	cmpl	%edx, %eax
	jae	LBB0_7
## %bb.10:
	movq	(%r15), %rcx
	testl	%r12d, %r12d
	je	LBB0_12
## %bb.11:
	movq	%rcx, (%r14)
	movq	8(%r13), %rdx
	movl	%eax, %eax
	movl	(%rdx,%rax,4), %eax
	orl	%eax, (%rcx)
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_9
LBB0_5:
	movl	-56(%rbp), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_8:
	leaq	-72(%rbp), %rsi
	movq	%r15, %rdi
	callq	_radeon_cs_dump_packet
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_8
LBB0_12:
	andl	$-4, %eax
	addq	%rax, %rcx
	movq	%rcx, (%r14)
LBB0_13:
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No relocation chunk !\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RADEON_PACKET_TYPE3,8,3        ## @RADEON_PACKET_TYPE3
	.comm	_RADEON_PACKET3_NOP,8,3         ## @RADEON_PACKET3_NOP
L_.str.1:                               ## @.str.1
	.asciz	"No packet3 for relocation for packet at %d.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Relocs at %d after relocations chunk end %d !\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_cs_packet_next_reloc    ; -- Begin function radeon_cs_packet_next_reloc
	.p2align	2
_radeon_cs_packet_next_reloc:           ; @radeon_cs_packet_next_reloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_7
; %bb.1:
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	str	xzr, [x1]
	ldr	x22, [x0, #16]
	ldr	w2, [x0, #8]
	add	x1, sp, #16
	bl	_radeon_cs_packet_parse
	cbnz	w0, LBB0_11
; %bb.2:
	ldr	w8, [sp, #40]
	ldr	w9, [x19, #8]
	add	w8, w8, w9
	add	w8, w8, #2
	str	w8, [x19, #8]
	ldr	x8, [sp, #16]
Lloh0:
	adrp	x9, _RADEON_PACKET_TYPE3@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_PACKET_TYPE3@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.3:
	ldr	x8, [sp, #24]
Lloh3:
	adrp	x9, _RADEON_PACKET3_NOP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RADEON_PACKET3_NOP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.4:
	ldr	w8, [sp, #32]
	add	w1, w8, #1
	mov	x0, x19
	bl	_radeon_get_ib_value
	mov	x8, x0
	ldr	w9, [x22]
	cmp	w0, w9
	b.hs	LBB0_12
; %bb.5:
	ldr	x9, [x19]
	mov	w0, #0
	cbz	w21, LBB0_13
; %bb.6:
	str	x9, [x20]
	ldr	x10, [x22, #8]
	ldr	w8, [x10, w8, uxtw #2]
	ldr	w10, [x9]
	orr	w8, w10, w8
	str	w8, [x9]
	b	LBB0_11
LBB0_7:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_10
LBB0_8:
	ldr	w8, [sp, #32]
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_9:
	bl	_DRM_ERROR
	add	x1, sp, #16
	mov	x0, x19
	bl	_radeon_cs_dump_packet
LBB0_10:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
	add	sp, sp, #96
	ret
LBB0_12:
	stp	x8, x9, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_13:
	and	w8, w8, #0xfffffffc
	add	x8, x9, x8
	str	x8, [x20]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No relocation chunk !\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RADEON_PACKET_TYPE3,8,3        ; @RADEON_PACKET_TYPE3
	.comm	_RADEON_PACKET3_NOP,8,3         ; @RADEON_PACKET3_NOP
l_.str.1:                               ; @.str.1
	.asciz	"No packet3 for relocation for packet at %d.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Relocs at %d after relocations chunk end %d !\n"

.subsections_via_symbols
