	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tw686x_memcpy_dma_alloc
_tw686x_memcpy_dma_alloc:               ## @tw686x_memcpy_dma_alloc
	.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
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	32(%rdi), %r14
	testl	%esi, %esi
	jne	LBB0_1
## %bb.2:
	movq	_VDMA_P_ADDR@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_VDMA_B_ADDR@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rax), %rax
	movq	(%r13), %rcx
	movq	16(%r13), %rdx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r15d, %r12d
	shlq	$4, %r12
	movq	8(%rdx,%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_WARN
	movl	12(%r13), %ebx
	imull	8(%r13), %ebx
	movq	24(%r13), %rax
	imull	(%rax), %ebx
	sarl	$3, %ebx
	movl	4(%r14), %edi
	movq	16(%r13), %rax
	leaq	(%rax,%r12), %rdx
	addq	$4, %rdx
	movl	%ebx, %esi
	callq	_pci_alloc_consistent
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	16(%r13), %rcx
	movl	%ebx, (%rcx,%r12)
	movq	%rax, 8(%rcx,%r12)
	movl	4(%rcx,%r12), %edx
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_reg_write
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_4:
	testl	%r15d, %r15d
	movq	(%r13), %rdx
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_v4l2_err
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VDMA_B_ADDR,8,3                ## @VDMA_B_ADDR
	.comm	_VDMA_P_ADDR,8,3                ## @VDMA_P_ADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Allocating buffer but previous still here\n"

L_.str.1:                               ## @.str.1
	.asciz	"dma%d: unable to allocate %s-buffer\n"

L_.str.2:                               ## @.str.2
	.asciz	"B"

L_.str.3:                               ## @.str.3
	.asciz	"P"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_tw686x_memcpy_dma_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tw686x_memcpy_dma_alloc
_tw686x_memcpy_dma_alloc:               ; @tw686x_memcpy_dma_alloc
	.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
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _VDMA_P_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VDMA_P_ADDR@GOTPAGEOFF]
Lloh2:
	adrp	x9, _VDMA_B_ADDR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _VDMA_B_ADDR@GOTPAGEOFF]
	cmp	w1, #0
	csel	x8, x8, x9, eq
	ldr	x8, [x8]
	ldr	x9, [x0]
	ldr	w22, [x8, x9, lsl #2]
	ldr	x19, [x0, #32]
	ldr	x8, [x0, #16]
	mov	w24, w1
	lsl	x25, x24, #4
	add	x8, x8, x25
	ldr	x0, [x8, #8]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN
	ldp	w8, w9, [x20, #8]
	mul	w8, w9, w8
	ldp	x10, x9, [x20, #16]
	ldr	w9, [x9]
	mul	w8, w8, w9
	asr	w23, w8, #3
	ldr	w0, [x19, #4]
	add	x8, x10, x25
	add	x2, x8, #4
	mov	x1, x23
	bl	_pci_alloc_consistent
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x20, #16]
	add	x8, x8, x24, lsl #4
	str	w23, [x8]
	str	x0, [x8, #8]
	ldr	w2, [x8, #4]
	mov	x0, x19
	mov	x1, x22
	bl	_reg_write
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	ldr	x2, [x20]
Lloh6:
	adrp	x8, l_.str.2@PAGE
Lloh7:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh8:
	adrp	x9, l_.str.3@PAGE
Lloh9:
	add	x9, x9, l_.str.3@PAGEOFF
	cmp	w21, #0
	csel	x3, x9, x8, eq
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_v4l2_err
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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 AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_VDMA_B_ADDR,8,3                ; @VDMA_B_ADDR
	.comm	_VDMA_P_ADDR,8,3                ; @VDMA_P_ADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Allocating buffer but previous still here\n"

l_.str.1:                               ; @.str.1
	.asciz	"dma%d: unable to allocate %s-buffer\n"

l_.str.2:                               ; @.str.2
	.asciz	"B"

l_.str.3:                               ; @.str.3
	.asciz	"P"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_tw686x_memcpy_dma_alloc
.subsections_via_symbols
