	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_cs_legacy_ioctl           ## -- Begin function r600_cs_legacy_ioctl
	.p2align	4, 0x90
_r600_cs_legacy_ioctl:                  ## @r600_cs_legacy_ioctl
	.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
	movq	8(%rdi), %r13
	movl	$0, -44(%rbp)
	testq	%r13, %r13
	je	LBB0_1
## %bb.3:
	movq	_RADEON_FAMILY_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	(%r13), %r12d
	movq	_CHIP_R600@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jae	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leaq	4(%r13), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	leaq	-56(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_r600_ib_get
	testl	%eax, %eax
	jne	LBB0_6
## %bb.7:
	movq	(%r14), %rax
	movq	-56(%rbp), %rcx
	movslq	(%rcx), %r8
	shlq	$2, %r8
	addq	(%rax), %r8
	leaq	-48(%rbp), %r9
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	movl	%r12d, %ecx
	callq	_r600_cs_legacy
	movq	%rbx, %r12
	movl	%eax, %ebx
	movl	-48(%rbp), %ecx
	movq	-56(%rbp), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	movl	%eax, %r8d
	callq	_r600_ib_free
	leaq	-44(%rbp), %rsi
	movq	%r13, %rdi
	callq	_r600_cs_id_emit
	movl	-44(%rbp), %eax
	movl	%eax, (%r12)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
LBB0_8:
	movl	%ebx, %eax
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	_r600_cs_legacy_ioctl.cold.1
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function r600_cs_legacy_ioctl.cold.1
_r600_cs_legacy_ioctl.cold.1:           ## @r600_cs_legacy_ioctl.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_ERROR
	ud2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"called with no initialization\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RADEON_FAMILY_MASK,4,2         ## @RADEON_FAMILY_MASK
	.comm	_CHIP_R600,4,2                  ## @CHIP_R600
L_.str.1:                               ## @.str.1
	.asciz	"cs ioctl valid only for R6XX & R7XX in legacy mode\n"

L_.str.2:                               ## @.str.2
	.asciz	"ib_get failed\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_r600_cs_legacy_ioctl           ; -- Begin function r600_cs_legacy_ioctl
	.p2align	2
_r600_cs_legacy_ioctl:                  ; @r600_cs_legacy_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	ldr	x20, [x0, #8]
	str	wzr, [sp]
	cbz	x20, LBB0_3
; %bb.1:
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _RADEON_FAMILY_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RADEON_FAMILY_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w24, w9, w8
Lloh3:
	adrp	x8, _CHIP_R600@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CHIP_R600@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w24, w8
	b.hs	LBB0_5
; %bb.2:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_3:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
LBB0_4:
	bl	_DRM_ERROR
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_7
LBB0_5:
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
	add	x23, x20, #4
	mov	x0, x23
	bl	_mutex_lock
	add	x2, sp, #8
	mov	x0, x22
	mov	x1, x21
	bl	_r600_ib_get
	cbnz	w0, LBB0_8
; %bb.6:
	ldr	x8, [x22]
	ldr	x8, [x8]
	ldr	x9, [sp, #8]
	ldrsw	x9, [x9]
	add	x4, x8, x9, lsl #2
	add	x5, sp, #4
	mov	x0, x22
	mov	x1, x19
	mov	x2, x21
	mov	x3, x24
	bl	_r600_cs_legacy
	mov	x24, x0
	ldr	w3, [sp, #4]
	ldr	x1, [sp, #8]
	mov	x0, x22
	mov	x2, x21
	mov	x4, x24
	bl	_r600_ib_free
	mov	x1, sp
	mov	x0, x20
	bl	_r600_cs_id_emit
	ldr	w8, [sp]
	str	w8, [x19]
	mov	x0, x23
	bl	_mutex_unlock
LBB0_7:
	mov	x0, x24
	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
	add	sp, sp, #80
	ret
LBB0_8:
	bl	_r600_cs_legacy_ioctl.cold.1
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function r600_cs_legacy_ioctl.cold.1
_r600_cs_legacy_ioctl.cold.1:           ; @r600_cs_legacy_ioctl.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	brk	#0x1
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"called with no initialization\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RADEON_FAMILY_MASK,4,2         ; @RADEON_FAMILY_MASK
	.comm	_CHIP_R600,4,2                  ; @CHIP_R600
l_.str.1:                               ; @.str.1
	.asciz	"cs ioctl valid only for R6XX & R7XX in legacy mode\n"

l_.str.2:                               ; @.str.2
	.asciz	"ib_get failed\n"

.subsections_via_symbols
