	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdlc_empty_fifo
_hdlc_empty_fifo:                       ## @hdlc_empty_fifo
	.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	%esi, %r15d
	movq	%rdi, %rbx
	cmpq	$0, 16(%rdi)
	jne	LBB0_1
## %bb.2:
	movq	_AVM_IDX_HDLC_1@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_AVM_IDX_HDLC_2@GOTPCREL(%rip), %rax
LBB0_3:
	movq	24(%rbx), %r12
	movb	(%rax), %r13b
	leaq	L_.str(%rip), %rsi
	movl	$16, %edi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_DBG
	movq	(%rbx), %r14
	movslq	%r15d, %rax
	addq	%r14, %rax
	movq	_HSCX_BUFMAX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_4
## %bb.15:
	leaq	L_.str.1(%rip), %rsi
	movl	$16, %edi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DBG                            ## TAILCALL
LBB0_4:
	addq	8(%rbx), %r14
	movq	%rax, (%rbx)
	movl	(%r12), %eax
	cmpl	$128, %eax
	je	LBB0_12
## %bb.5:
	cmpl	$129, %eax
	je	LBB0_8
## %bb.6:
	cmpl	$130, %eax
	jne	LBB0_14
## %bb.7:
	leaq	4(%r12), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	_AVM_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	movzbl	%r13b, %edi
	callq	_outl
	movq	_AVM_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r12), %rdi
	movq	_HDLC_FIFO@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	leal	3(%r15), %eax
	addl	$6, %r15d
	testl	%eax, %eax
	cmovnsl	%eax, %r15d
	sarl	$2, %r15d
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_insl
	jmp	LBB0_13
LBB0_12:
	leaq	4(%r12), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	_AVM_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	movzbl	%r13b, %edi
	callq	_outb
	movq	_AVM_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%r12), %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_insb
LBB0_13:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock                    ## TAILCALL
LBB0_8:
	cmpq	$0, 16(%rbx)
	jne	LBB0_9
## %bb.10:
	movq	_AVM_HDLC_FIFO_1@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_AVM_HDLC_FIFO_2@GOTPCREL(%rip), %rax
LBB0_11:
	movq	(%rax), %rdi
	addq	8(%r12), %rdi
	leal	3(%r15), %eax
	addl	$6, %r15d
	testl	%eax, %eax
	cmovnsl	%eax, %r15d
	sarl	$2, %r15d
	movq	%r14, %rsi
	movl	%r15d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_insl                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AVM_IDX_HDLC_2,1,0             ## @AVM_IDX_HDLC_2
	.comm	_AVM_IDX_HDLC_1,1,0             ## @AVM_IDX_HDLC_1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hdlc_empty_fifo %d"

	.comm	_HSCX_BUFMAX,8,3                ## @HSCX_BUFMAX
L_.str.1:                               ## @.str.1
	.asciz	"hdlc_empty_fifo: incoming packet too large"

	.comm	_AVM_INDEX,8,3                  ## @AVM_INDEX
	.comm	_AVM_DATA,8,3                   ## @AVM_DATA
	.comm	_HDLC_FIFO,8,3                  ## @HDLC_FIFO
	.comm	_AVM_HDLC_FIFO_2,8,3            ## @AVM_HDLC_FIFO_2
	.comm	_AVM_HDLC_FIFO_1,8,3            ## @AVM_HDLC_FIFO_1
	.no_dead_strip	_hdlc_empty_fifo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdlc_empty_fifo
_hdlc_empty_fifo:                       ; @hdlc_empty_fifo
	.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	x21, x0
Lloh0:
	adrp	x8, _AVM_IDX_HDLC_2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVM_IDX_HDLC_2@GOTPAGEOFF]
	ldp	x9, x22, [x0, #16]
Lloh2:
	adrp	x10, _AVM_IDX_HDLC_1@GOTPAGE
Lloh3:
	ldr	x10, [x10, _AVM_IDX_HDLC_1@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x10, x8, eq
	ldrb	w23, [x8]
	str	x19, [sp]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #16
	bl	_DBG
	ldr	x9, [x21]
	add	x8, x9, w19, sxtw
Lloh6:
	adrp	x10, _HSCX_BUFMAX@GOTPAGE
Lloh7:
	ldr	x10, [x10, _HSCX_BUFMAX@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x10
	b.le	LBB0_2
; %bb.1:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #16
	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
	b	_DBG
LBB0_2:
	ldr	x10, [x21, #8]
	add	x20, x10, x9
	str	x8, [x21]
	ldr	w8, [x22]
	cmp	w8, #128
	b.eq	LBB0_6
; %bb.3:
	cmp	w8, #129
	b.eq	LBB0_8
; %bb.4:
	cmp	w8, #130
	b.ne	LBB0_9
; %bb.5:
	add	x21, x22, #4
	mov	x0, x21
	bl	_spin_lock
	ldr	x8, [x22, #8]
Lloh11:
	adrp	x9, _AVM_INDEX@GOTPAGE
Lloh12:
	ldr	x9, [x9, _AVM_INDEX@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	add	x1, x9, x8
	and	w0, w23, #0xff
	bl	_outl
Lloh14:
	adrp	x8, _AVM_DATA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AVM_DATA@GOTPAGEOFF]
	ldr	x9, [x22, #8]
Lloh16:
	ldr	x8, [x8]
Lloh17:
	adrp	x10, _HDLC_FIFO@GOTPAGE
Lloh18:
	ldr	x10, [x10, _HDLC_FIFO@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
	add	x8, x8, x9
	add	x0, x8, x10
	add	w8, w19, #3
	add	w9, w19, #6
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w2, w8, #2
	mov	x1, x20
	bl	_insl
	b	LBB0_7
LBB0_6:
	add	x21, x22, #4
	mov	x0, x21
	bl	_spin_lock
	ldr	x8, [x22, #8]
Lloh20:
	adrp	x9, _AVM_INDEX@GOTPAGE
Lloh21:
	ldr	x9, [x9, _AVM_INDEX@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x1, x9, x8
	and	w0, w23, #0xff
	bl	_outb
	ldr	x8, [x22, #8]
Lloh23:
	adrp	x9, _AVM_DATA@GOTPAGE
Lloh24:
	ldr	x9, [x9, _AVM_DATA@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	add	x0, x9, x8
	mov	x1, x20
	mov	x2, x19
	bl	_insb
LBB0_7:
	mov	x0, x21
	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
	b	_spin_unlock
LBB0_8:
	ldr	x8, [x22, #8]
	ldr	x9, [x21, #16]
Lloh26:
	adrp	x10, _AVM_HDLC_FIFO_2@GOTPAGE
Lloh27:
	ldr	x10, [x10, _AVM_HDLC_FIFO_2@GOTPAGEOFF]
Lloh28:
	adrp	x11, _AVM_HDLC_FIFO_1@GOTPAGE
Lloh29:
	ldr	x11, [x11, _AVM_HDLC_FIFO_1@GOTPAGEOFF]
	cmp	x9, #0
	csel	x9, x11, x10, eq
	ldr	x9, [x9]
	add	x0, x9, x8
	add	w8, w19, #3
	add	w9, w19, #6
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w2, w8, #2
	mov	x1, x20
	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
	b	_insl
LBB0_9:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_AVM_IDX_HDLC_2,1,0             ; @AVM_IDX_HDLC_2
	.comm	_AVM_IDX_HDLC_1,1,0             ; @AVM_IDX_HDLC_1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hdlc_empty_fifo %d"

	.comm	_HSCX_BUFMAX,8,3                ; @HSCX_BUFMAX
l_.str.1:                               ; @.str.1
	.asciz	"hdlc_empty_fifo: incoming packet too large"

	.comm	_AVM_INDEX,8,3                  ; @AVM_INDEX
	.comm	_AVM_DATA,8,3                   ; @AVM_DATA
	.comm	_HDLC_FIFO,8,3                  ; @HDLC_FIFO
	.comm	_AVM_HDLC_FIFO_2,8,3            ; @AVM_HDLC_FIFO_2
	.comm	_AVM_HDLC_FIFO_1,8,3            ; @AVM_HDLC_FIFO_1
	.no_dead_strip	_hdlc_empty_fifo
.subsections_via_symbols
