	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DMAbuf_open                    ## -- Begin function DMAbuf_open
	.p2align	4, 0x90
_DMAbuf_open:                           ## @DMAbuf_open
	.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	_audio_devs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %rcx
	movq	(%rax,%rcx,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	movl	%esi, %r15d
	movl	%edi, %r14d
	movq	_DMA_DUPLEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	jne	LBB0_4
## %bb.3:
	movq	16(%rbx), %rax
	movq	%rax, 32(%rbx)
LBB0_4:
	movq	24(%rbx), %rdi
	callq	_check_driver
	movq	24(%rbx), %rax
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	*(%rax)
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	16(%rbx), %rax
	movq	32(%rbx), %r13
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpq	%rax, %r13
	jne	LBB0_8
## %bb.7:
	movq	_DMA_DUPLEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%rbx)
LBB0_8:
	movq	_OPEN_WRITE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_11
## %bb.9:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_open_dmap
	testl	%eax, %eax
	js	LBB0_10
LBB0_11:
	movl	%r15d, 4(%rbx)
	movq	_OPEN_READ@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	je	LBB0_14
## %bb.12:
	movq	_OPEN_WRITE@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	je	LBB0_17
## %bb.13:
	movq	_DMA_DUPLEX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_17
LBB0_14:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r13, %rdx
	callq	_open_dmap
	testl	%eax, %eax
	js	LBB0_15
LBB0_17:
	movl	%r15d, 8(%rbx)
	movl	$1, 12(%rbx)
	movq	24(%rbx), %rax
	movl	%r14d, %edi
	movl	$8, %esi
	callq	*24(%rax)
	movq	24(%rbx), %rax
	movl	%r14d, %edi
	movl	$1, %esi
	callq	*16(%rax)
	movq	24(%rbx), %rax
	movq	_DSP_DEFAULT_SPEED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%r14d, %edi
	callq	*8(%rax)
	movq	16(%rbx), %rax
	movq	(%rax), %rcx
	movq	_DMODE_OUTPUT@GOTPCREL(%rip), %rdx
	xorl	%r12d, %r12d
	cmpq	(%rdx), %rcx
	jne	LBB0_19
## %bb.18:
	movl	16(%rax), %edi
	movl	8(%rax), %edx
	movl	12(%rax), %esi
	callq	_memset
	jmp	LBB0_19
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_19
LBB0_5:
	movl	%eax, %r12d
	jmp	LBB0_19
LBB0_10:
	movl	%eax, %r12d
	movq	24(%rbx), %rax
	movl	%r14d, %edi
	callq	*32(%rax)
	jmp	LBB0_19
LBB0_15:
	movl	%eax, %r12d
	movq	24(%rbx), %rax
	movl	%r14d, %edi
	callq	*32(%rax)
	movq	_OPEN_WRITE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_19
## %bb.16:
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_close_dmap
LBB0_19:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_audio_devs,8,3                 ## @audio_devs
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_DMA_DUPLEX,4,2                 ## @DMA_DUPLEX
	.comm	_OPEN_WRITE,4,2                 ## @OPEN_WRITE
	.comm	_OPEN_READ,4,2                  ## @OPEN_READ
	.comm	_DSP_DEFAULT_SPEED,4,2          ## @DSP_DEFAULT_SPEED
	.comm	_DMODE_OUTPUT,8,3               ## @DMODE_OUTPUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DMAbuf_open                    ; -- Begin function DMAbuf_open
	.p2align	2
_DMAbuf_open:                           ; @DMAbuf_open
	.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
Lloh0:
	adrp	x8, _audio_devs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _audio_devs@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x19, [x8, w0, sxtw #3]
	cbz	x19, LBB0_15
; %bb.1:
	mov	x21, x1
	mov	x20, x0
	ldr	w8, [x19]
Lloh3:
	adrp	x25, _DMA_DUPLEX@GOTPAGE
Lloh4:
	ldr	x25, [x25, _DMA_DUPLEX@GOTPAGEOFF]
	ldr	w9, [x25]
	tst	w9, w8
	b.ne	LBB0_3
; %bb.2:
	ldr	x8, [x19, #16]
	str	x8, [x19, #32]
LBB0_3:
	ldr	x0, [x19, #24]
	bl	_check_driver
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	mov	x0, x20
	mov	x1, x21
	blr	x8
	tbnz	w0, #31, LBB0_16
; %bb.4:
	ldr	x22, [x19, #16]
	ldr	x24, [x19, #32]
	cmp	x24, x22
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x25]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
LBB0_6:
Lloh5:
	adrp	x26, _OPEN_WRITE@GOTPAGE
Lloh6:
	ldr	x26, [x26, _OPEN_WRITE@GOTPAGEOFF]
	ldr	w8, [x26]
	tst	w8, w21
	b.eq	LBB0_8
; %bb.7:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_open_dmap
	tbnz	w0, #31, LBB0_17
LBB0_8:
	str	w21, [x19, #4]
Lloh7:
	adrp	x8, _OPEN_READ@GOTPAGE
Lloh8:
	ldr	x8, [x8, _OPEN_READ@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w8, w21
	b.eq	LBB0_11
; %bb.9:
	ldr	w8, [x26]
	cmp	w8, w21
	b.eq	LBB0_12
; %bb.10:
	ldr	w8, [x19]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_12
LBB0_11:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x24
	bl	_open_dmap
	tbnz	w0, #31, LBB0_18
LBB0_12:
	mov	w8, #1
	stp	w21, w8, [x19, #8]
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #24]
	mov	x0, x20
	mov	w1, #8
	blr	x8
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #16]
	mov	x0, x20
	mov	w1, #1
	blr	x8
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #8]
Lloh10:
	adrp	x9, _DSP_DEFAULT_SPEED@GOTPAGE
Lloh11:
	ldr	x9, [x9, _DSP_DEFAULT_SPEED@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x9]
	mov	x0, x20
	blr	x8
	ldr	x8, [x19, #16]
	ldr	x9, [x8]
Lloh13:
	adrp	x10, _DMODE_OUTPUT@GOTPAGE
Lloh14:
	ldr	x10, [x10, _DMODE_OUTPUT@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_14
; %bb.13:
	ldp	w1, w0, [x8, #12]
	ldr	w2, [x8, #8]
	bl	_memset
LBB0_14:
	mov	w23, #0
	b	LBB0_20
LBB0_15:
Lloh16:
	adrp	x8, _ENXIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_20
LBB0_16:
	mov	x23, x0
	b	LBB0_20
LBB0_17:
	mov	x23, x0
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #32]
	mov	x0, x20
	blr	x8
	b	LBB0_20
LBB0_18:
	mov	x23, x0
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #32]
	mov	x0, x20
	blr	x8
	ldr	w8, [x26]
	tst	w8, w21
	b.eq	LBB0_20
; %bb.19:
	mov	x0, x19
	mov	x1, x22
	bl	_close_dmap
LBB0_20:
	mov	x0, x23
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_DMA_DUPLEX,4,2                 ; @DMA_DUPLEX
	.comm	_OPEN_WRITE,4,2                 ; @OPEN_WRITE
	.comm	_OPEN_READ,4,2                  ; @OPEN_READ
	.comm	_DSP_DEFAULT_SPEED,4,2          ; @DSP_DEFAULT_SPEED
	.comm	_DMODE_OUTPUT,8,3               ; @DMODE_OUTPUT
.subsections_via_symbols
