	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bttv_risc_hook                 ## -- Begin function bttv_risc_hook
	.p2align	4, 0x90
_bttv_risc_hook:                        ## @bttv_risc_hook
	.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	%ecx, %ebx
	movl	%esi, %r14d
	movq	%rdi, %r15
	movslq	(%rdi), %rax
	leal	8(,%r14,4), %ecx
	movslq	%ecx, %r12
	addq	%rax, %r12
	movl	16(%rdi), %esi
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r13
	movq	(%rdx), %r8
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %ecx
	movl	%ebx, %r9d
	xorl	%eax, %eax
	callq	_d2printk
	movq	_BT848_RISC_JUMP@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:
	movq	_BT848_RISC_IRQ@GOTPCREL(%rip), %rax
	andl	$15, %ebx
	movl	%ebx, %ecx
	shll	$16, %ecx
	shll	$20, %ebx
	orl	%ecx, %ebx
	xorl	$15728640, %ebx                 ## imm = 0xF00000
	orq	%rbx, %rdi
	orq	(%rax), %rdi
LBB0_4:
	callq	_cpu_to_le32
	movq	8(%r13), %rcx
	movq	%rax, (%rcx)
	movq	%r12, %rdi
	callq	_cpu_to_le32
	movq	8(%r13), %rcx
	movq	%rax, 8(%rcx)
	movq	(%r13), %r12
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%edx, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_d2printk
LBB0_5:
	movq	%r12, %rdi
	callq	_cpu_to_le32
	movq	8(%r15), %rcx
	movslq	%r14d, %rdx
	movq	%rax, 8(%rcx,%rdx,8)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d: risc=%p slot[%d]=NULL\n"

L_.str.1:                               ## @.str.1
	.asciz	"%d: risc=%p slot[%d]=%08llx irq=%d\n"

	.comm	_BT848_RISC_JUMP,8,3            ## @BT848_RISC_JUMP
	.comm	_BT848_RISC_IRQ,8,3             ## @BT848_RISC_IRQ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bttv_risc_hook                 ; -- Begin function bttv_risc_hook
	.p2align	2
_bttv_risc_hook:                        ; @bttv_risc_hook
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
	ldrsw	x8, [x0]
	lsl	w9, w1, #2
	add	w9, w9, #8
	add	x21, x8, w9, sxtw
	ldr	w1, [x0, #16]
	cbz	x2, LBB0_4
; %bb.1:
	mov	x23, x3
	mov	x22, x2
	ldr	x8, [x2]
	stp	x8, x23, [sp]
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x3, x19
	bl	_d2printk
Lloh2:
	adrp	x8, _BT848_RISC_JUMP@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BT848_RISC_JUMP@GOTPAGEOFF]
Lloh4:
	ldr	x0, [x8]
	cbz	w23, LBB0_3
; %bb.2:
Lloh5:
	adrp	x8, _BT848_RISC_IRQ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BT848_RISC_IRQ@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ubfiz	w9, w23, #16, #4
	bfi	w9, w23, #20, #4
	eor	w9, w9, #0xf00000
	orr	x9, x0, x9
	orr	x0, x9, x8
LBB0_3:
	bl	_cpu_to_le32
	ldr	x8, [x22, #8]
	str	x0, [x8]
	mov	x0, x21
	bl	_cpu_to_le32
	ldp	x21, x8, [x22]
	str	x0, [x8, #8]
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x19
	bl	_d2printk
LBB0_5:
	mov	x0, x21
	bl	_cpu_to_le32
	ldr	x8, [x20, #8]
	add	w9, w19, #1
	str	x0, [x8, w9, sxtw #3]
	mov	w0, #0
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d: risc=%p slot[%d]=NULL\n"

l_.str.1:                               ; @.str.1
	.asciz	"%d: risc=%p slot[%d]=%08llx irq=%d\n"

	.comm	_BT848_RISC_JUMP,8,3            ; @BT848_RISC_JUMP
	.comm	_BT848_RISC_IRQ,8,3             ; @BT848_RISC_IRQ
.subsections_via_symbols
