	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tw686x_sg_dma_alloc
_tw686x_sg_dma_alloc:                   ## @tw686x_sg_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	24(%rdi), %rcx
	movl	%esi, %edx
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	movq	_DMA_PAGE_TABLE1_ADDR@GOTPCREL(%rip), %rsi
	jmp	LBB0_3
LBB0_2:
	movq	_DMA_PAGE_TABLE0_ADDR@GOTPCREL(%rip), %rsi
LBB0_3:
	movq	(%r15), %rbx
	leaq	(,%rbx,4), %rax
	addq	(%rsi), %rax
	movq	16(%r15), %r12
	leaq	(%rdx,%rdx,2), %r13
	movq	16(%rcx,%r13,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.4:
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	12(%r12), %edi
	leaq	(%rcx,%r13,8), %rdx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	callq	_pci_alloc_consistent
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %rbx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, 8(%rax,%r13,8)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_reg_write
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_8
LBB0_7:
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	_TW686X_SG_TABLE_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	imulq	%rcx, %rbx
	addq	(%rax,%rdx,8), %rbx
LBB0_8:
	movq	8(%r15), %rax
	movq	%rbx, (%rax,%rdx,8)
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_5:
	addq	$8, %r12
	testl	%r14d, %r14d
	movq	(%r15), %rdx
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_v4l2_err
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_PAGE_TABLE1_ADDR,8,3       ## @DMA_PAGE_TABLE1_ADDR
	.comm	_DMA_PAGE_TABLE0_ADDR,8,3       ## @DMA_PAGE_TABLE0_ADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dma%d: unable to allocate %s-buffer\n"

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

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

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TW686X_SG_TABLE_SIZE,4,2       ## @TW686X_SG_TABLE_SIZE
	.no_dead_strip	_tw686x_sg_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_sg_dma_alloc
_tw686x_sg_dma_alloc:                   ; @tw686x_sg_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	x19, x0
	mov	w25, w1
	ldp	x20, x26, [x0, #16]
	cbz	w1, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _DMA_PAGE_TABLE1_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_PAGE_TABLE1_ADDR@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh2:
	adrp	x8, _DMA_PAGE_TABLE0_ADDR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DMA_PAGE_TABLE0_ADDR@GOTPAGEOFF]
LBB0_3:
	ldr	x9, [x8]
	ldr	x8, [x19]
	add	x9, x9, x8, lsl #2
	mov	w10, #24
	madd	x10, x25, x10, x26
	ldr	x1, [x10, #16]
	cbz	x1, LBB0_6
; %bb.4:
	ldr	w22, [x9]
	ldr	w0, [x20, #12]
	mov	w8, #24
	madd	x24, x25, x8, x26
	mov	x2, x24
	bl	_pci_alloc_consistent
	cbz	x0, LBB0_8
; %bb.5:
	mov	x23, x0
	mov	w8, #24
	madd	x8, x25, x8, x26
	str	x0, [x8, #8]
	ldr	w2, [x24]
	mov	x0, x20
	mov	x1, x22
	bl	_reg_write
	b	LBB0_7
LBB0_6:
	ldr	x9, [x20]
	ldr	x9, [x9]
	ldr	x9, [x9, x25, lsl #3]
Lloh4:
	adrp	x10, _TW686X_SG_TABLE_SIZE@GOTPAGE
Lloh5:
	ldr	x10, [x10, _TW686X_SG_TABLE_SIZE@GOTPAGEOFF]
Lloh6:
	ldrsw	x10, [x10]
	madd	x23, x8, x10, x9
LBB0_7:
	mov	w0, #0
	ldr	x8, [x19, #8]
	str	x23, [x8, x25, lsl #3]
	b	LBB0_9
LBB0_8:
	add	x0, x20, #8
	ldr	x2, [x19]
Lloh7:
	adrp	x8, l_.str.1@PAGE
Lloh8:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh9:
	adrp	x9, l_.str.2@PAGE
Lloh10:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	w21, #0
	csel	x3, x9, x8, eq
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_v4l2_err
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_PAGE_TABLE1_ADDR,8,3       ; @DMA_PAGE_TABLE1_ADDR
	.comm	_DMA_PAGE_TABLE0_ADDR,8,3       ; @DMA_PAGE_TABLE0_ADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dma%d: unable to allocate %s-buffer\n"

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

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

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TW686X_SG_TABLE_SIZE,4,2       ; @TW686X_SG_TABLE_SIZE
	.no_dead_strip	_tw686x_sg_dma_alloc
.subsections_via_symbols
