	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_bchannel
_setup_bchannel:                        ## @setup_bchannel
	.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
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r13
	movq	_HFCUSB_DBG_STATES@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	callq	_DBG
	movq	(%r13), %rax
	movslq	%ebx, %rbx
	movl	%r14d, (%rax,%rbx,4)
	movq	_L1_MODE_NULL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	%r14d, (%rcx)
	setne	%al
	movq	_L1_MODE_TRANS@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	leal	(,%rax,8), %ecx
	leal	2(,%rax,8), %r15d
	cmovnel	%ecx, %r15d
	movq	_HFCUSB_FIFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L___const.setup_bchannel.idx_table(%rip), %rax
	movl	(%rax,%rbx,4), %r12d
	movq	%r13, %rdi
	movl	%r12d, %edx
	movl	$1, %ecx
	callq	_queue_control_request
	movq	_HFCUSB_CON_HDLC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	movl	$1, %ecx
	callq	_queue_control_request
	movq	_HFCUSB_INC_RES_F@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$2, %edx
	movl	$1, %ecx
	callq	_queue_control_request
	movq	_HFCUSB_FIFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	incl	%r12d
	movq	%r13, %rdi
	movl	%r12d, %edx
	movl	$1, %ecx
	callq	_queue_control_request
	movq	_HFCUSB_CON_HDLC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	movl	$1, %ecx
	callq	_queue_control_request
	movq	_HFCUSB_INC_RES_F@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$2, %edx
	movl	$1, %ecx
	callq	_queue_control_request
	movq	(%r13), %rax
	xorl	%edx, %edx
	cmpl	$0, 4(%rax)
	setne	%dl
	addl	%edx, %edx
	cmpl	$1, (%rax)
	sbbl	$0, %edx
	addl	$65, %edx
	movq	_HFCUSB_SCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$1, %ecx
	callq	_queue_control_request
	movq	(%r13), %rax
	xorl	%ecx, %ecx
	cmpl	$0, (%rax)
	setne	%cl
	leal	2(%rcx), %edx
	cmpl	$0, 4(%rax)
	cmovel	%ecx, %edx
	movq	_HFCUSB_SCTRL_R@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	$1, %ecx
	callq	_queue_control_request
	testl	%ebx, %ebx
	movq	_LED_B2_OFF@GOTPCREL(%rip), %rax
	cmoveq	_LED_B1_OFF@GOTPCREL(%rip), %rax
	movq	_LED_B2_ON@GOTPCREL(%rip), %rcx
	cmoveq	_LED_B1_ON@GOTPCREL(%rip), %rcx
	movq	_L1_MODE_NULL@GOTPCREL(%rip), %rdx
	cmpl	%r14d, (%rdx)
	cmoveq	%rax, %rcx
	movl	(%rcx), %esi
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_handle_led                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__literal8,8byte_literals
	.p2align	2                               ## @__const.setup_bchannel.idx_table
L___const.setup_bchannel.idx_table:
	.long	0                               ## 0x0
	.long	2                               ## 0x2

	.comm	_HFCUSB_DBG_STATES,4,2          ## @HFCUSB_DBG_STATES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HFC-S USB: setting channel %d to mode %d"

	.comm	_L1_MODE_NULL,4,2               ## @L1_MODE_NULL
	.comm	_L1_MODE_TRANS,4,2              ## @L1_MODE_TRANS
	.comm	_HFCUSB_FIFO,4,2                ## @HFCUSB_FIFO
	.comm	_HFCUSB_CON_HDLC,4,2            ## @HFCUSB_CON_HDLC
	.comm	_HFCUSB_INC_RES_F,4,2           ## @HFCUSB_INC_RES_F
	.comm	_HFCUSB_SCTRL,4,2               ## @HFCUSB_SCTRL
	.comm	_HFCUSB_SCTRL_R,4,2             ## @HFCUSB_SCTRL_R
	.comm	_LED_B2_OFF,4,2                 ## @LED_B2_OFF
	.comm	_LED_B1_OFF,4,2                 ## @LED_B1_OFF
	.comm	_LED_B2_ON,4,2                  ## @LED_B2_ON
	.comm	_LED_B1_ON,4,2                  ## @LED_B1_ON
	.no_dead_strip	_setup_bchannel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_bchannel
_setup_bchannel:                        ; @setup_bchannel
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _HFCUSB_DBG_STATES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HFCUSB_DBG_STATES@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x20
	bl	_DBG
	ldr	x8, [x19]
	sbfiz	x9, x21, #2, #32
	str	w20, [x8, x9]
Lloh5:
	adrp	x24, _L1_MODE_NULL@GOTPAGE
Lloh6:
	ldr	x24, [x24, _L1_MODE_NULL@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, w20
	cset	w8, ne
	lsl	w10, w8, #3
Lloh7:
	adrp	x11, _L1_MODE_TRANS@GOTPAGE
Lloh8:
	ldr	x11, [x11, _L1_MODE_TRANS@GOTPAGEOFF]
Lloh9:
	ldr	w11, [x11]
	mov	w12, #2
	bfi	w12, w8, #3, #1
Lloh10:
	adrp	x25, _HFCUSB_FIFO@GOTPAGE
Lloh11:
	ldr	x25, [x25, _HFCUSB_FIFO@GOTPAGEOFF]
	cmp	w11, w20
	csel	w22, w12, w10, eq
	ldr	w1, [x25]
Lloh12:
	adrp	x8, l___const.setup_bchannel.idx_table@PAGE
Lloh13:
	add	x8, x8, l___const.setup_bchannel.idx_table@PAGEOFF
	ldr	w23, [x8, x9]
	mov	x0, x19
	mov	x2, x23
	mov	w3, #1
	bl	_queue_control_request
Lloh14:
	adrp	x26, _HFCUSB_CON_HDLC@GOTPAGE
Lloh15:
	ldr	x26, [x26, _HFCUSB_CON_HDLC@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x19
	mov	x2, x22
	mov	w3, #1
	bl	_queue_control_request
Lloh16:
	adrp	x27, _HFCUSB_INC_RES_F@GOTPAGE
Lloh17:
	ldr	x27, [x27, _HFCUSB_INC_RES_F@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	x0, x19
	mov	w2, #2
	mov	w3, #1
	bl	_queue_control_request
	ldr	w1, [x25]
	add	w2, w23, #1
	mov	x0, x19
	mov	w3, #1
	bl	_queue_control_request
	ldr	w1, [x26]
	mov	x0, x19
	mov	x2, x22
	mov	w3, #1
	bl	_queue_control_request
	ldr	w1, [x27]
	mov	x0, x19
	mov	w2, #2
	mov	w3, #1
	bl	_queue_control_request
	ldr	x8, [x19]
	ldp	w9, w8, [x8]
	cmp	w9, #0
	mov	w9, #64
	cinc	w9, w9, ne
	orr	w10, w9, #0x2
	cmp	w8, #0
	csel	w2, w9, w10, eq
Lloh18:
	adrp	x8, _HFCUSB_SCTRL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HFCUSB_SCTRL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_queue_control_request
	ldr	x8, [x19]
	ldp	w9, w8, [x8]
	cmp	w9, #0
	cset	w9, ne
	orr	w10, w9, #0x2
	cmp	w8, #0
	csel	w2, w9, w10, eq
Lloh21:
	adrp	x8, _HFCUSB_SCTRL_R@GOTPAGE
Lloh22:
	ldr	x8, [x8, _HFCUSB_SCTRL_R@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_queue_control_request
	ldr	w8, [x24]
Lloh24:
	adrp	x9, _LED_B1_OFF@GOTPAGE
Lloh25:
	ldr	x9, [x9, _LED_B1_OFF@GOTPAGEOFF]
Lloh26:
	adrp	x10, _LED_B2_OFF@GOTPAGE
Lloh27:
	ldr	x10, [x10, _LED_B2_OFF@GOTPAGEOFF]
	cmp	w21, #0
	csel	x9, x9, x10, eq
Lloh28:
	adrp	x10, _LED_B1_ON@GOTPAGE
Lloh29:
	ldr	x10, [x10, _LED_B1_ON@GOTPAGEOFF]
Lloh30:
	adrp	x11, _LED_B2_ON@GOTPAGE
Lloh31:
	ldr	x11, [x11, _LED_B2_ON@GOTPAGEOFF]
	csel	x10, x10, x11, eq
	cmp	w8, w20
	csel	x8, x9, x10, eq
	ldr	w1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_handle_led
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__literal8,8byte_literals
	.p2align	2                               ; @__const.setup_bchannel.idx_table
l___const.setup_bchannel.idx_table:
	.long	0                               ; 0x0
	.long	2                               ; 0x2

	.comm	_HFCUSB_DBG_STATES,4,2          ; @HFCUSB_DBG_STATES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HFC-S USB: setting channel %d to mode %d"

	.comm	_L1_MODE_NULL,4,2               ; @L1_MODE_NULL
	.comm	_L1_MODE_TRANS,4,2              ; @L1_MODE_TRANS
	.comm	_HFCUSB_FIFO,4,2                ; @HFCUSB_FIFO
	.comm	_HFCUSB_CON_HDLC,4,2            ; @HFCUSB_CON_HDLC
	.comm	_HFCUSB_INC_RES_F,4,2           ; @HFCUSB_INC_RES_F
	.comm	_HFCUSB_SCTRL,4,2               ; @HFCUSB_SCTRL
	.comm	_HFCUSB_SCTRL_R,4,2             ; @HFCUSB_SCTRL_R
	.comm	_LED_B2_OFF,4,2                 ; @LED_B2_OFF
	.comm	_LED_B1_OFF,4,2                 ; @LED_B1_OFF
	.comm	_LED_B2_ON,4,2                  ; @LED_B2_ON
	.comm	_LED_B1_ON,4,2                  ; @LED_B1_ON
	.no_dead_strip	_setup_bchannel
.subsections_via_symbols
