	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_flexcop_dma_allocate           ## -- Begin function flexcop_dma_allocate
	.p2align	4, 0x90
_flexcop_dma_allocate:                  ## @flexcop_dma_allocate
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	$0, -32(%rbp)
	testb	$1, %bl
	jne	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	-32(%rbp), %rdx
	movl	%ebx, %esi
	callq	_pci_alloc_consistent
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r15, 40(%r14)
	movq	%rax, 32(%r14)
	movq	-32(%rbp), %rcx
	movq	%rcx, 24(%r14)
	movl	%ebx, %edx
	shrl	$31, %edx
	addl	%ebx, %edx
	sarl	%edx
	movslq	%edx, %rdx
	leaq	(%rax,%rdx,4), %rax
	movq	%rax, 16(%r14)
	addq	%rdx, %rcx
	movq	%rcx, 8(%r14)
	movl	%edx, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dma buffersize has to be even."

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_flexcop_dma_allocate           ; -- Begin function flexcop_dma_allocate
	.p2align	2
_flexcop_dma_allocate:                  ; @flexcop_dma_allocate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	str	xzr, [sp, #8]
	tbnz	w2, #0, LBB0_3
; %bb.1:
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	add	x2, sp, #8
	mov	x1, x20
	bl	_pci_alloc_consistent
	cbz	x0, LBB0_4
; %bb.2:
	mov	x8, x0
	mov	w0, #0
	stp	x8, x21, [x19, #32]
	ldr	x9, [sp, #8]
	str	x9, [x19, #24]
	cmp	w20, #0
	cinc	w10, w20, lt
	asr	w10, w10, #1
	add	x8, x8, w10, sxtw #2
	add	x9, x9, w10, sxtw
	stp	x9, x8, [x19, #8]
	str	w10, [x19]
	b	LBB0_6
LBB0_3:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dma buffersize has to be even."

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
