	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hrz_close_rx
_hrz_close_rx:                          ## @hrz_close_rx
	.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
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_memmap@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rbx
	leaq	8(%rdi), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%r12,8), %r12
	addq	$4, %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_rd_mem
	movl	%eax, %ebx
	movq	_BUFFER_PTR_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	_RX_CHANNEL_DISABLED@GOTPCREL(%rip), %r13
	cmpl	(%r13), %ebx
	jne	LBB0_1
## %bb.8:
	movq	_DBG_VCC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PRINTD                         ## TAILCALL
LBB0_1:
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	movq	_RX_CHANNEL_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	(%r13), %edx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_wr_mem
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_rd_mem
	movq	_BUFFER_PTR_MASK@GOTPCREL(%rip), %rbx
	andl	(%rbx), %eax
	movl	(%r13), %edx
	cmpl	%edx, %eax
	jne	LBB0_2
## %bb.3:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, -56(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_4
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_wr_mem
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_rd_mem
	andl	(%rbx), %eax
	movl	(%r13), %edx
	cmpl	%edx, %eax
	jne	LBB0_2
LBB0_4:
	movq	%r14, %rdi
	callq	_WAIT_FLUSH_RX_COMPLETE
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rbx,8), %r12
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_RX_CHANS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movslq	%ecx, %r13
	xorq	%rbx, %r13
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_SELECT_RX_CHANNEL
	movq	%r14, %rdi
	callq	_WAIT_UPDATE_COMPLETE
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_rd_mem
	movl	%eax, %r15d
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_SELECT_RX_CHANNEL
	movq	%r14, %rdi
	callq	_WAIT_UPDATE_COMPLETE
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_FLUSH_RX_CHANNEL
	movq	%r14, %rdi
	callq	_WAIT_FLUSH_RX_COMPLETE
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_SELECT_RX_CHANNEL
	movq	%r14, %rdi
	callq	_WAIT_UPDATE_COMPLETE
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_rd_mem
	movl	%eax, %ebx
	movq	_DBG_RX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DBG_VCC@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r15d, %edx
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_PRINTD
	cmpl	%ebx, %r15d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_5
## %bb.6:
	movslq	%r15d, %rax
	movq	(%r14), %rcx
	movslq	40(%r14), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 40(%r14)
	movq	%rax, (%rcx,%rdx,8)
LBB0_7:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_memmap,8,3                     ## @memmap
	.comm	_BUFFER_PTR_MASK,4,2            ## @BUFFER_PTR_MASK
	.comm	_RX_CHANNEL_DISABLED,4,2        ## @RX_CHANNEL_DISABLED
	.comm	_DBG_VCC,4,2                    ## @DBG_VCC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"closing VC: RX channel %u already disabled"

	.comm	_RX_CHANNEL_IDLE,4,2            ## @RX_CHANNEL_IDLE
	.comm	_RX_CHANS,4,2                   ## @RX_CHANS
	.comm	_DBG_RX,4,2                     ## @DBG_RX
L_.str.1:                               ## @.str.1
	.asciz	"r1 = %u, r2 = %u"

	.comm	_DBG_WARN,4,2                   ## @DBG_WARN
	.comm	_RX_QUEUE_WR_PTR_OFF,4,2        ## @RX_QUEUE_WR_PTR_OFF
	.comm	_SIMONS_DODGEY_MARKER,4,2       ## @SIMONS_DODGEY_MARKER
	.no_dead_strip	_hrz_close_rx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hrz_close_rx
_hrz_close_rx:                          ; @hrz_close_rx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _memmap@GOTPAGE
Lloh1:
	ldr	x8, [x8, _memmap@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x23, [x8, #8]
	add	x20, x0, #8
	mov	x0, x20
	bl	_spin_lock_irqsave
	add	x8, x23, x21, lsl #3
	add	x22, x8, #4
	mov	x0, x19
	mov	x1, x22
	bl	_rd_mem
Lloh3:
	adrp	x24, _BUFFER_PTR_MASK@GOTPAGE
Lloh4:
	ldr	x24, [x24, _BUFFER_PTR_MASK@GOTPAGEOFF]
	ldr	w8, [x24]
	and	w26, w8, w0
	mov	x0, x20
	bl	_spin_unlock_irqrestore
Lloh5:
	adrp	x25, _RX_CHANNEL_DISABLED@GOTPAGE
Lloh6:
	ldr	x25, [x25, _RX_CHANNEL_DISABLED@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w26, w8
	b.ne	LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _DBG_VCC@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DBG_VCC@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	str	x21, [sp]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PRINTD
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_2:
Lloh12:
	adrp	x8, _RX_CHANNEL_IDLE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RX_CHANNEL_IDLE@GOTPAGEOFF]
Lloh14:
	ldr	w27, [x8]
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w2, [x25]
	mov	x0, x19
	mov	x1, x22
	bl	_wr_mem
	mov	x0, x19
	mov	x1, x22
	bl	_rd_mem
	ldr	w8, [x24]
	and	w8, w8, w0
	ldr	w2, [x25]
	cmp	w8, w2
	b.ne	LBB0_4
; %bb.3:
	cmp	w26, w27
	b.ne	LBB0_5
	b	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_wr_mem
	mov	x0, x19
	mov	x1, x22
	bl	_rd_mem
	ldr	w8, [x24]
	and	w8, w8, w0
	ldr	w2, [x25]
	cmp	w8, w2
	b.ne	LBB0_4
LBB0_5:
	mov	x0, x19
	bl	_WAIT_FLUSH_RX_COMPLETE
	add	x22, x23, x21, lsl #3
Lloh15:
	adrp	x26, _RX_CHANS@GOTPAGE
Lloh16:
	ldr	x26, [x26, _RX_CHANS@GOTPAGEOFF]
Lloh17:
	adrp	x27, _DBG_VCC@GOTPAGE
Lloh18:
	ldr	x27, [x27, _DBG_VCC@GOTPAGEOFF]
Lloh19:
	adrp	x28, _DBG_RX@GOTPAGE
Lloh20:
	ldr	x28, [x28, _DBG_RX@GOTPAGEOFF]
Lloh21:
	adrp	x23, l_.str.1@PAGE
Lloh22:
	add	x23, x23, l_.str.1@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x26]
	cmp	w8, #0
	cinc	w8, w8, lt
	sbfx	x8, x8, #1, #31
	eor	x25, x8, x21
	mov	x0, x19
	mov	x1, x25
	bl	_SELECT_RX_CHANNEL
	mov	x0, x19
	bl	_WAIT_UPDATE_COMPLETE
	mov	x0, x19
	mov	x1, x22
	bl	_rd_mem
	mov	x24, x0
	mov	x0, x19
	mov	x1, x21
	bl	_SELECT_RX_CHANNEL
	mov	x0, x19
	bl	_WAIT_UPDATE_COMPLETE
	mov	x0, x19
	mov	x1, x21
	bl	_FLUSH_RX_CHANNEL
	mov	x0, x19
	bl	_WAIT_FLUSH_RX_COMPLETE
	mov	x0, x19
	mov	x1, x25
	bl	_SELECT_RX_CHANNEL
	mov	x0, x19
	bl	_WAIT_UPDATE_COMPLETE
	mov	x0, x19
	mov	x1, x22
	bl	_rd_mem
	mov	x25, x0
	ldr	w8, [x27]
	ldr	w9, [x28]
	orr	w0, w9, w8
	stp	x24, x25, [sp]
	mov	x1, x23
	bl	_PRINTD
	cmp	w24, w25
	b.ne	LBB0_6
; %bb.7:
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	sxtw	x8, w24
	ldr	x9, [x19]
	ldrsw	x10, [x19, #40]
	add	w11, w10, #1
	str	w11, [x19, #40]
	str	x8, [x9, x10, lsl #3]
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_spin_unlock_irqrestore
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_memmap,8,3                     ; @memmap
	.comm	_BUFFER_PTR_MASK,4,2            ; @BUFFER_PTR_MASK
	.comm	_RX_CHANNEL_DISABLED,4,2        ; @RX_CHANNEL_DISABLED
	.comm	_DBG_VCC,4,2                    ; @DBG_VCC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"closing VC: RX channel %u already disabled"

	.comm	_RX_CHANNEL_IDLE,4,2            ; @RX_CHANNEL_IDLE
	.comm	_RX_CHANS,4,2                   ; @RX_CHANS
	.comm	_DBG_RX,4,2                     ; @DBG_RX
l_.str.1:                               ; @.str.1
	.asciz	"r1 = %u, r2 = %u"

	.comm	_DBG_WARN,4,2                   ; @DBG_WARN
	.comm	_RX_QUEUE_WR_PTR_OFF,4,2        ; @RX_QUEUE_WR_PTR_OFF
	.comm	_SIMONS_DODGEY_MARKER,4,2       ; @SIMONS_DODGEY_MARKER
	.no_dead_strip	_hrz_close_rx
.subsections_via_symbols
