	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bttv_risc_init_main            ## -- Begin function bttv_risc_init_main
	.p2align	4, 0x90
_bttv_risc_init_main:                   ## @bttv_risc_init_main
	.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
	movq	%rdi, %rbx
	movl	20(%rdi), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	callq	_btcx_riscmem_alloc
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	16(%rbx), %esi
	movslq	(%rbx), %rdx
	leaq	L_.str(%rip), %rdi
	callq	_dprintk
	movq	_BT848_RISC_SYNC@GOTPCREL(%rip), %r12
	movq	_BT848_RISC_RESYNC@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	orl	(%r12), %edi
	movq	_BT848_FIFO_STATUS_VRE@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, (%rcx)
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 8(%rcx)
	movq	_BT848_RISC_JUMP@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 16(%rcx)
	movl	(%rbx), %edi
	addl	$16, %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 24(%rcx)
	movl	(%r15), %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 32(%rcx)
	movl	(%rbx), %edi
	addl	$24, %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 40(%rcx)
	movl	(%r15), %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 48(%rcx)
	movl	(%rbx), %edi
	addl	$32, %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 56(%rcx)
	movl	(%r13), %edi
	orl	(%r12), %edi
	movq	_BT848_FIFO_STATUS_VRO@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 64(%rcx)
	xorl	%edi, %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 72(%rcx)
	movl	(%r15), %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 80(%rcx)
	movl	(%rbx), %edi
	addl	$48, %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 88(%rcx)
	movl	(%r15), %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 96(%rcx)
	movl	(%rbx), %edi
	addl	$56, %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 104(%rcx)
	movl	(%r15), %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 112(%rcx)
	movl	(%rbx), %edi
	callq	_cpu_to_le32
	movq	8(%rbx), %rcx
	movq	%rax, 120(%rcx)
	jmp	LBB0_3
LBB0_1:
	movl	%eax, %r14d
LBB0_3:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d: risc main @ %08llx\n"

	.comm	_BT848_RISC_SYNC,4,2            ## @BT848_RISC_SYNC
	.comm	_BT848_RISC_RESYNC,4,2          ## @BT848_RISC_RESYNC
	.comm	_BT848_FIFO_STATUS_VRE,4,2      ## @BT848_FIFO_STATUS_VRE
	.comm	_BT848_RISC_JUMP,4,2            ## @BT848_RISC_JUMP
	.comm	_BT848_FIFO_STATUS_VRO,4,2      ## @BT848_FIFO_STATUS_VRO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bttv_risc_init_main            ; -- Begin function bttv_risc_init_main
	.p2align	2
_bttv_risc_init_main:                   ; @bttv_risc_init_main
	.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
	ldr	w0, [x0, #20]
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_btcx_riscmem_alloc
	tbnz	w0, #31, LBB0_2
; %bb.1:
	ldr	w1, [x19, #16]
	ldrsw	x2, [x19]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
Lloh5:
	adrp	x21, _BT848_RISC_SYNC@GOTPAGE
Lloh6:
	ldr	x21, [x21, _BT848_RISC_SYNC@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh7:
	adrp	x22, _BT848_RISC_RESYNC@GOTPAGE
Lloh8:
	ldr	x22, [x22, _BT848_RISC_RESYNC@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _BT848_FIFO_STATUS_VRE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _BT848_FIFO_STATUS_VRE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w0, w8, w9
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8]
	mov	w0, #0
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #8]
Lloh12:
	adrp	x20, _BT848_RISC_JUMP@GOTPAGE
Lloh13:
	ldr	x20, [x20, _BT848_RISC_JUMP@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #16]
	ldr	w8, [x19]
	add	w0, w8, #16
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #24]
	ldr	w0, [x20]
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #32]
	ldr	w8, [x19]
	add	w0, w8, #24
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #40]
	ldr	w0, [x20]
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #48]
	ldr	w8, [x19]
	add	w0, w8, #32
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #56]
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _BT848_FIFO_STATUS_VRO@GOTPAGE
Lloh15:
	ldr	x9, [x9, _BT848_FIFO_STATUS_VRO@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w0, w8, w9
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #64]
	mov	w0, #0
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #72]
	ldr	w0, [x20]
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #80]
	ldr	w8, [x19]
	add	w0, w8, #48
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #88]
	ldr	w0, [x20]
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #96]
	ldr	w8, [x19]
	add	w0, w8, #56
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #104]
	ldr	w0, [x20]
	bl	_cpu_to_le32
	ldr	x8, [x19, #8]
	str	x0, [x8, #112]
	ldr	w0, [x19]
	bl	_cpu_to_le32
	mov	x8, x0
	mov	w0, #0
	ldr	x9, [x19, #8]
	str	x8, [x9, #120]
LBB0_2:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d: risc main @ %08llx\n"

	.comm	_BT848_RISC_SYNC,4,2            ; @BT848_RISC_SYNC
	.comm	_BT848_RISC_RESYNC,4,2          ; @BT848_RISC_RESYNC
	.comm	_BT848_FIFO_STATUS_VRE,4,2      ; @BT848_FIFO_STATUS_VRE
	.comm	_BT848_RISC_JUMP,4,2            ; @BT848_RISC_JUMP
	.comm	_BT848_FIFO_STATUS_VRO,4,2      ; @BT848_FIFO_STATUS_VRO
.subsections_via_symbols
