	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bttv_set_dma                   ## -- Begin function bttv_set_dma
	.p2align	4, 0x90
_bttv_set_dma:                          ## @bttv_set_dma
	.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
	movq	%rdi, %r14
	movq	56(%rdi), %rax
	movq	64(%rdi), %rcx
	xorl	%edi, %edi
	testq	%rcx, %rcx
	setne	%dil
	addl	%edi, %edi
	movl	%edi, (%r14)
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	orl	$1, %edi
	movl	%edi, (%r14)
LBB0_2:
	movq	40(%r14), %rdx
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.3:
	orl	$12, %edi
	movl	%edi, (%r14)
LBB0_4:
	xorl	%ebx, %ebx
	testb	$3, %dil
	setne	%bl
	andl	$-4, %edi
	movl	$12, %r15d
	cmovel	%edi, %r15d
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.6:
	movq	8(%rdx), %r8
	testq	%rcx, %rcx
	je	LBB0_8
LBB0_9:
	movq	(%rcx), %r9
	jmp	LBB0_10
LBB0_5:
	xorl	%r8d, %r8d
	testq	%rcx, %rcx
	jne	LBB0_9
LBB0_8:
	xorl	%r9d, %r9d
LBB0_10:
	leal	(%rbx,%rbx,2), %ecx
	orl	%esi, %r15d
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.12:
	movq	(%rdx), %rbx
	jmp	LBB0_13
LBB0_11:
	xorl	%ebx, %ebx
LBB0_13:
	orl	%ecx, %r15d
	movl	4(%r14), %ecx
	movl	72(%r14), %esi
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movq	(%rax), %rax
	jmp	LBB0_16
LBB0_14:
	xorl	%eax, %eax
LBB0_16:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %edx
	pushq	%rax
	pushq	%rbx
	callq	_d2printk
	addq	$16, %rsp
	movq	_BT848_RISC_JUMP@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	4(%r14), %eax
	testq	%rax, %rax
	je	LBB0_17
## %bb.28:
	movq	_BT848_RISC_IRQ@GOTPCREL(%rip), %rcx
	movl	%eax, %edx
	andl	$15, %edx
	shlq	$16, %rdx
	shll	$20, %eax
	notl	%eax
	andl	$15728640, %eax                 ## imm = 0xF00000
	orq	%rdx, %rbx
	orq	%rax, %rbx
	orq	(%rcx), %rbx
	jmp	LBB0_19
LBB0_17:
	cmpq	$0, 48(%r14)
	jne	LBB0_19
## %bb.18:
	cmpq	$0, 40(%r14)
	je	LBB0_20
LBB0_19:
	leaq	32(%r14), %rdi
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	_BTTV_TIMEOUT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%rax), %rsi
	callq	_mod_timer
LBB0_21:
	movq	%rbx, %rdi
	callq	_cpu_to_le32
	movq	24(%r14), %rcx
	movq	_RISC_SLOT_LOOP@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	_BT848_CAP_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	movl	$-16, %esi
	callq	_btaor
	movl	8(%r14), %eax
	testl	%r15d, %r15d
	je	LBB0_24
## %bb.22:
	testl	%eax, %eax
	jne	LBB0_27
## %bb.23:
	movl	16(%r14), %edi
	movq	_BT848_RISC_STRT_ADD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_btwrite
	movq	_BT848_GPIO_DMA_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$3, %edi
	callq	_btor
	movl	$1, %eax
	jmp	LBB0_26
LBB0_24:
	testl	%eax, %eax
	je	LBB0_27
## %bb.25:
	movq	_BT848_GPIO_DMA_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$-4, %edi
	callq	_btand
	xorl	%eax, %eax
LBB0_26:
	movl	%eax, 8(%r14)
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	leaq	32(%r14), %rdi
	callq	_del_timer
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d: capctl=%x lirq=%d top=%08llx/%08llx even=%08llx/%08llx\n"

	.comm	_BT848_RISC_JUMP,8,3            ## @BT848_RISC_JUMP
	.comm	_BT848_RISC_IRQ,8,3             ## @BT848_RISC_IRQ
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_BTTV_TIMEOUT,8,3               ## @BTTV_TIMEOUT
	.comm	_RISC_SLOT_LOOP,8,3             ## @RISC_SLOT_LOOP
	.comm	_BT848_CAP_CTL,4,2              ## @BT848_CAP_CTL
	.comm	_BT848_RISC_STRT_ADD,4,2        ## @BT848_RISC_STRT_ADD
	.comm	_BT848_GPIO_DMA_CTL,4,2         ## @BT848_GPIO_DMA_CTL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bttv_set_dma                   ; -- Begin function bttv_set_dma
	.p2align	2
_bttv_set_dma:                          ; @bttv_set_dma
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldp	x8, x9, [x0, #56]
	cmp	x9, #0
	cset	w10, ne
	lsl	w12, w10, #1
	str	w12, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	orr	w12, w12, #0x1
	str	w12, [x19]
LBB0_2:
	ldr	x10, [x19, #40]
	cbz	x10, LBB0_4
; %bb.3:
	orr	w12, w12, #0xc
	str	w12, [x19]
LBB0_4:
	tst	w12, #0x3
	mov	w11, #3
	csel	w11, wzr, w11, eq
	tst	w12, #0xc
	mov	w12, #12
	csel	w12, wzr, w12, eq
	cbz	x10, LBB0_7
; %bb.5:
	ldr	x4, [x10, #8]
	cbz	x9, LBB0_8
LBB0_6:
	ldr	x5, [x9]
	b	LBB0_9
LBB0_7:
	mov	x4, #0
	cbnz	x9, LBB0_6
LBB0_8:
	mov	x5, #0
LBB0_9:
	orr	w9, w12, w1
	ldr	w1, [x19, #72]
	ldr	w3, [x19, #4]
	cbz	x10, LBB0_12
; %bb.10:
	ldr	x6, [x10]
	orr	w20, w9, w11
	cbz	x8, LBB0_13
LBB0_11:
	ldr	x7, [x8]
	b	LBB0_14
LBB0_12:
	mov	x6, #0
	orr	w20, w9, w11
	cbnz	x8, LBB0_11
LBB0_13:
	mov	x7, #0
LBB0_14:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x20
	bl	_d2printk
Lloh2:
	adrp	x8, _BT848_RISC_JUMP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BT848_RISC_JUMP@GOTPAGEOFF]
Lloh4:
	ldr	x21, [x8]
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_16
; %bb.15:
Lloh5:
	adrp	x9, _BT848_RISC_IRQ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BT848_RISC_IRQ@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	lsl	w10, w8, #16
	and	x10, x10, #0xf0000
	mov	w11, #15728640
	bic	w8, w11, w8, lsl #20
	orr	x10, x21, x10
	orr	x8, x10, x8
	orr	x21, x8, x9
	b	LBB0_18
LBB0_16:
	ldr	x8, [x19, #48]
	cbnz	x8, LBB0_18
; %bb.17:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_26
LBB0_18:
Lloh8:
	adrp	x8, _jiffies@GOTPAGE
Lloh9:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
	add	x0, x19, #32
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _BTTV_TIMEOUT@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BTTV_TIMEOUT@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_mod_timer
LBB0_19:
	mov	x0, x21
	bl	_cpu_to_le32
	ldr	x8, [x19, #24]
Lloh14:
	adrp	x9, _RISC_SLOT_LOOP@GOTPAGE
Lloh15:
	ldr	x9, [x9, _RISC_SLOT_LOOP@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	str	w0, [x8, x9, lsl #2]
Lloh17:
	adrp	x8, _BT848_CAP_CTL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BT848_CAP_CTL@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #-16
	bl	_btaor
	ldr	w8, [x19, #8]
	cbz	w20, LBB0_22
; %bb.20:
	cbnz	w8, LBB0_25
; %bb.21:
	ldr	w0, [x19, #16]
Lloh20:
	adrp	x8, _BT848_RISC_STRT_ADD@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BT848_RISC_STRT_ADD@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_btwrite
Lloh23:
	adrp	x8, _BT848_GPIO_DMA_CTL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BT848_GPIO_DMA_CTL@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	w0, #3
	bl	_btor
	mov	w8, #1
	b	LBB0_24
LBB0_22:
	cbz	w8, LBB0_25
; %bb.23:
Lloh26:
	adrp	x8, _BT848_GPIO_DMA_CTL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BT848_GPIO_DMA_CTL@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	w0, #-4
	bl	_btand
	mov	w8, #0
LBB0_24:
	str	w8, [x19, #8]
LBB0_25:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_26:
	add	x0, x19, #32
	bl	_del_timer
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d: capctl=%x lirq=%d top=%08llx/%08llx even=%08llx/%08llx\n"

	.comm	_BT848_RISC_JUMP,8,3            ; @BT848_RISC_JUMP
	.comm	_BT848_RISC_IRQ,8,3             ; @BT848_RISC_IRQ
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_BTTV_TIMEOUT,8,3               ; @BTTV_TIMEOUT
	.comm	_RISC_SLOT_LOOP,8,3             ; @RISC_SLOT_LOOP
	.comm	_BT848_CAP_CTL,4,2              ; @BT848_CAP_CTL
	.comm	_BT848_RISC_STRT_ADD,4,2        ; @BT848_RISC_STRT_ADD
	.comm	_BT848_GPIO_DMA_CTL,4,2         ; @BT848_GPIO_DMA_CTL
.subsections_via_symbols
