	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DMAbuf_get_buffer_pointer      ## -- Begin function DMAbuf_get_buffer_pointer
	.p2align	4, 0x90
_DMAbuf_get_buffer_pointer:             ## @DMAbuf_get_buffer_pointer
	.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	_DMA_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_1
## %bb.2:
	movl	%edx, %r12d
	movq	%rsi, %r15
	movl	4(%rsi), %ebx
	xorl	%eax, %eax
	callq	_claim_dma_lock
	movq	%rax, %r14
	movl	%ebx, %edi
	callq	_clear_dma_ff
	movq	_isa_dma_bridge_buggy@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jne	LBB0_4
## %bb.3:
	movl	4(%r15), %edi
	callq	_disable_dma
LBB0_4:
	movl	%ebx, %edi
	callq	_get_dma_residue
	movl	8(%r15), %ecx
	movl	%ecx, %ebx
	subl	%eax, %ebx
	movq	_DMA_MAP_MAPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%r15)
	je	LBB0_5
LBB0_9:
	xorl	%eax, %eax
	testl	%ebx, %ebx
	cmovlel	%eax, %ebx
	cmpl	%ecx, %ebx
	cmovgel	%eax, %ebx
	cmpl	$0, (%r13)
	jne	LBB0_11
## %bb.10:
	movl	4(%r15), %edi
	callq	_enable_dma
LBB0_11:
	movq	%r14, %rdi
	callq	_release_dma_lock
	jmp	LBB0_12
LBB0_1:
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_DMODE_OUTPUT@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_7
## %bb.6:
	cmpq	$0, 16(%r15)
	jne	LBB0_9
	jmp	LBB0_8
LBB0_7:
	cmpq	$0, 32(%r15)
	jne	LBB0_9
LBB0_8:
	xorl	%eax, %eax
	cmpl	24(%r15), %ebx
	cmovgl	%eax, %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_ACTIVE,4,2                 ## @DMA_ACTIVE
	.comm	_isa_dma_bridge_buggy,4,2       ## @isa_dma_bridge_buggy
	.comm	_DMA_MAP_MAPPED,4,2             ## @DMA_MAP_MAPPED
	.comm	_DMODE_OUTPUT,4,2               ## @DMODE_OUTPUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DMAbuf_get_buffer_pointer      ; -- Begin function DMAbuf_get_buffer_pointer
	.p2align	2
_DMAbuf_get_buffer_pointer:             ; @DMAbuf_get_buffer_pointer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	w8, [x1]
Lloh0:
	adrp	x9, _DMA_ACTIVE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_ACTIVE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.1:
	mov	x21, x2
	mov	x19, x1
	ldr	w22, [x1, #4]
	bl	_claim_dma_lock
	mov	x20, x0
	mov	x0, x22
	bl	_clear_dma_ff
Lloh3:
	adrp	x23, _isa_dma_bridge_buggy@GOTPAGE
Lloh4:
	ldr	x23, [x23, _isa_dma_bridge_buggy@GOTPAGEOFF]
	ldr	w8, [x23]
	cbnz	w8, LBB0_3
; %bb.2:
	ldr	w0, [x19, #4]
	bl	_disable_dma
LBB0_3:
	mov	x0, x22
	bl	_get_dma_residue
	ldp	w8, w10, [x19, #8]
	sub	w9, w8, w0
Lloh5:
	adrp	x11, _DMA_MAP_MAPPED@GOTPAGE
Lloh6:
	ldr	x11, [x11, _DMA_MAP_MAPPED@GOTPAGEOFF]
Lloh7:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_9
LBB0_4:
	cmp	w9, #0
	csel	w9, w9, wzr, gt
	cmp	w9, w8
	csel	w21, w9, wzr, lt
	ldr	w8, [x23]
	cbnz	w8, LBB0_6
; %bb.5:
	ldr	w0, [x19, #4]
	bl	_enable_dma
LBB0_6:
	mov	x0, x20
	bl	_release_dma_lock
	b	LBB0_8
LBB0_7:
	mov	w21, #0
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh8:
	adrp	x10, _DMODE_OUTPUT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _DMODE_OUTPUT@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	cmp	w10, w21
	b.ne	LBB0_11
; %bb.10:
	ldr	x10, [x19, #16]
	cbnz	x10, LBB0_4
	b	LBB0_12
LBB0_11:
	ldr	x10, [x19, #32]
	cbnz	x10, LBB0_4
LBB0_12:
	ldr	w10, [x19, #24]
	cmp	w9, w10
	csel	w9, wzr, w9, gt
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_ACTIVE,4,2                 ; @DMA_ACTIVE
	.comm	_isa_dma_bridge_buggy,4,2       ; @isa_dma_bridge_buggy
	.comm	_DMA_MAP_MAPPED,4,2             ; @DMA_MAP_MAPPED
	.comm	_DMODE_OUTPUT,4,2               ; @DMODE_OUTPUT
.subsections_via_symbols
