	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_fifo_channel_create_   ## -- Begin function nouveau_fifo_channel_create_
	.p2align	4, 0x90
_nouveau_fifo_channel_create_:          ## @nouveau_fifo_channel_create_
	.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
	movl	%r9d, -52(%rbp)                 ## 4-byte Spill
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	24(%rbp), %r13d
	movq	40(%rbp), %r12
	movq	%rsi, %rdi
	callq	_nv_device
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movl	%r13d, %r9d
	pushq	%r12
	movl	32(%rbp), %eax
	pushq	%rax
	callq	_nouveau_namedb_create_
	addq	$16, %rsp
	testl	%eax, %eax
	jne	LBB0_17
## %bb.1:
	movl	16(%rbp), %esi
	movq	(%r12), %r13
	movq	%r15, %rdi
	callq	_nouveau_handle_ref
	movq	%rax, 24(%r13)
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	(%rax), %rcx
	movl	(%rcx), %ecx
	andl	$-2, %ecx
	cmpl	$128, %ecx
	jne	LBB0_5
## %bb.6:
	movq	8(%rax), %rdi
	leaq	16(%r13), %rcx
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	*(%rdi)
	testl	%eax, %eax
	jne	LBB0_17
## %bb.7:
	leaq	16(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	(%r14), %rax
	movq	8(%r14), %rcx
	movq	%rax, (%r13)
	cmpq	%rcx, %rax
	jae	LBB0_12
## %bb.8:
	movq	24(%r14), %rdx
	incq	%rax
	negq	%rcx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, -8(%rdx,%rax,8)
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_10 Depth=1
	movq	%rax, (%r13)
	leaq	(%rcx,%rax), %rsi
	incq	%rsi
	incq	%rax
	cmpq	$1, %rsi
	jne	LBB0_10
	jmp	LBB0_12
LBB0_2:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r13, %rdi
	callq	_nv_object
	movq	24(%r14), %rcx
	movq	(%r13), %rdx
	movq	%rax, (%rcx,%rdx,8)
LBB0_12:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	(%r13), %rax
	cmpq	8(%r14), %rax
	jne	LBB0_14
## %bb.13:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_nv_error
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_14:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_pci_resource_start
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	addl	%eax, %ecx
	movl	(%r13), %edi
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	imull	%ebx, %edi
	addl	%ecx, %edi
	movl	%ebx, %esi
	callq	_ioremap
	movl	%eax, 12(%r13)
	testl	%eax, %eax
	je	LBB0_15
## %bb.16:
	movl	%ebx, 8(%r13)
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_15:
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no free channels\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_EFAULT,4,2                     ## @EFAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_fifo_channel_create_   ; -- Begin function nouveau_fifo_channel_create_
	.p2align	2
_nouveau_fifo_channel_create_:          ; @nouveau_fifo_channel_create_
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x27, x7
	mov	x26, x6
	str	w5, [sp, #12]                   ; 4-byte Folded Spill
	mov	x20, x4
	mov	x21, x3
	mov	x28, x2
	mov	x22, x1
	mov	x25, x0
	ldr	w19, [x29, #16]
	ldr	x23, [x29, #24]
	mov	x0, x1
	bl	_nv_device
	mov	x24, x0
	mov	x0, x25
	mov	x1, x22
	mov	x2, x28
	mov	w3, #0
	mov	x4, #0
	mov	x5, x27
	mov	x6, x19
	mov	x7, x23
	bl	_nouveau_namedb_create_
	cbnz	w0, LBB0_11
; %bb.1:
	ldr	x23, [x23]
	mov	x0, x25
	mov	x1, x26
	bl	_nouveau_handle_ref
	str	x0, [x23, #24]
	cbz	x0, LBB0_8
; %bb.2:
	mov	x2, x0
	ldr	x8, [x0]
	ldr	w8, [x8]
	and	w8, w8, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_9
; %bb.3:
	ldr	x0, [x2, #8]
	ldr	x8, [x0]
	add	x3, x23, #16
	mov	x1, x25
	blr	x8
	cbnz	w0, LBB0_11
; %bb.4:
	add	x25, x22, #16
	mov	x0, x25
	bl	_spin_lock_irqsave
	ldp	x8, x9, [x22]
	str	x8, [x23]
	cmp	x8, x9
	b.hs	LBB0_13
; %bb.5:
	ldr	x10, [x22, #24]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10, x8, lsl #3]
	cbz	x11, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x8, x8, #1
	str	x8, [x23]
	cmp	x9, x8
	b.ne	LBB0_6
	b	LBB0_13
LBB0_8:
Lloh0:
	adrp	x8, _ENOENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_12:
	mov	x0, x23
	bl	_nv_object
	ldr	x8, [x22, #24]
	ldr	x9, [x23]
	str	x0, [x8, x9, lsl #3]
LBB0_13:
	mov	x0, x25
	bl	_spin_unlock_irqrestore
	ldr	x8, [x23]
	ldr	x9, [x22, #8]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.14:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_nv_error
Lloh6:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_10
LBB0_15:
	ldr	w0, [x24]
	mov	x1, x21
	bl	_pci_resource_start
	add	w8, w0, w20
	ldr	w9, [x23]
	ldr	w19, [sp, #12]                  ; 4-byte Folded Reload
	madd	w0, w9, w19, w8
	mov	x1, x19
	bl	_ioremap
	str	w0, [x23, #12]
	cbz	w0, LBB0_17
; %bb.16:
	mov	w0, #0
	str	w19, [x23, #8]
	b	LBB0_11
LBB0_17:
Lloh8:
	adrp	x8, _EFAULT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no free channels\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_EFAULT,4,2                     ; @EFAULT
.subsections_via_symbols
