	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mgslpc_program_hw
_mgslpc_program_hw:                     ## @mgslpc_program_hw
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_spin_lock_irqsave
	movq	%rbx, %rdi
	callq	_rx_stop
	movq	%rbx, %rdi
	callq	_tx_stop
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%rbx)
	movq	$0, 72(%rbx)
	movq	48(%rbx), %rax
	movq	_MGSL_MODE_HDLC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	cmpq	$0, 8(%rbx)
	je	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	callq	_hdlc_mode
	jmp	LBB0_4
LBB0_3:
	movq	%rbx, %rdi
	callq	_async_mode
LBB0_4:
	movq	%rbx, %rdi
	callq	_set_signals
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rbx)
	movups	%xmm0, 32(%rbx)
	movq	_CHB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IRQ_DCD@GOTPCREL(%rip), %rax
	movq	_IRQ_CTS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_irq_enable
	movq	_PVR_DSR@GOTPCREL(%rip), %rax
	movq	_PVR_RI@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	orb	(%rax), %cl
	movzbl	%cl, %esi
	movq	%rbx, %rdi
	callq	_port_irq_enable
	movq	%rbx, %rdi
	callq	_get_signals
	cmpq	$0, 8(%rbx)
	je	LBB0_5
LBB0_7:
	movq	%rbx, %rdi
	callq	_rx_start
LBB0_8:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_5:
	testq	%r14, %r14
	je	LBB0_8
## %bb.6:
	movq	(%r14), %rax
	movq	_CREAD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_7
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_MGSL_MODE_HDLC,8,3             ## @MGSL_MODE_HDLC
	.comm	_CHB,4,2                        ## @CHB
	.comm	_IRQ_DCD,4,2                    ## @IRQ_DCD
	.comm	_IRQ_CTS,4,2                    ## @IRQ_CTS
	.comm	_PVR_DSR,8,3                    ## @PVR_DSR
	.comm	_PVR_RI,1,0                     ## @PVR_RI
	.comm	_CREAD,4,2                      ## @CREAD
	.no_dead_strip	_mgslpc_program_hw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mgslpc_program_hw
_mgslpc_program_hw:                     ; @mgslpc_program_hw
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_rx_stop
	mov	x0, x19
	bl	_tx_stop
	stp	xzr, xzr, [x19, #64]
	str	xzr, [x19, #56]
	ldr	x8, [x19, #48]
Lloh0:
	adrp	x9, _MGSL_MODE_HDLC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MGSL_MODE_HDLC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_hdlc_mode
	b	LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_async_mode
LBB0_4:
	mov	x0, x19
	bl	_set_signals
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x19, #16]
Lloh3:
	adrp	x8, _CHB@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CHB@GOTPAGEOFF]
Lloh5:
	adrp	x9, _IRQ_DCD@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IRQ_DCD@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	ldr	w8, [x9]
Lloh9:
	adrp	x9, _IRQ_CTS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IRQ_CTS@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_irq_enable
Lloh12:
	adrp	x8, _PVR_DSR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PVR_DSR@GOTPAGEOFF]
	ldrb	w8, [x8]
Lloh14:
	adrp	x9, _PVR_RI@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PVR_RI@GOTPAGEOFF]
	ldrb	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_port_irq_enable
	mov	x0, x19
	bl	_get_signals
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_7
LBB0_5:
	mov	x0, x19
	bl	_rx_start
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_spin_unlock_irqrestore
LBB0_7:
	cbz	x20, LBB0_6
; %bb.8:
	ldr	x8, [x20]
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _CREAD@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CREAD@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_5
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_MGSL_MODE_HDLC,8,3             ; @MGSL_MODE_HDLC
	.comm	_CHB,4,2                        ; @CHB
	.comm	_IRQ_DCD,4,2                    ; @IRQ_DCD
	.comm	_IRQ_CTS,4,2                    ; @IRQ_CTS
	.comm	_PVR_DSR,8,3                    ; @PVR_DSR
	.comm	_PVR_RI,1,0                     ; @PVR_RI
	.comm	_CREAD,4,2                      ; @CREAD
	.no_dead_strip	_mgslpc_program_hw
.subsections_via_symbols
