	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdlcdrv_receiver               ## -- Begin function hdlcdrv_receiver
	.p2align	4, 0x90
_hdlcdrv_receiver:                      ## @hdlcdrv_receiver
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	testq	%rsi, %rsi
	je	LBB0_18
## %bb.1:
	movq	%rsi, %r13
	movq	(%rsi), %rax
	movq	_HDLCDRV_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.2:
	leaq	24(%r13), %rbx
	xorl	%edi, %edi
	movq	%rbx, %rsi
	callq	_test_and_set_bit
	testq	%rax, %rax
	je	LBB0_3
LBB0_18:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	leaq	48(%r13), %rbx
	movq	%rbx, %rdi
	callq	_hdlcdrv_hbuf_empty
	testl	%eax, %eax
	je	LBB0_4
LBB0_17:
	xorl	%edi, %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_clear_bit                      ## TAILCALL
LBB0_4:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	12(%r13), %esi
	movq	%r13, %rdi
	callq	_hdlc_rx_add_bytes
	subl	%eax, 16(%r13)
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_hdlcdrv_hbuf_empty
	testl	%eax, %eax
	jne	LBB0_17
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	%rbx, %rdi
	callq	_hdlcdrv_hbuf_get
	movswl	10(%r13), %ecx
	shll	$16, %eax
	orl	%eax, %ecx
	movl	%ecx, 8(%r13)
	movswl	14(%r13), %edx
	orl	%eax, %edx
	movl	%edx, 12(%r13)
	movl	16(%r13), %edx
	addl	$16, %edx
	movl	%edx, 16(%r13)
	movl	$130048, %ebx                   ## imm = 0x1FC00
	movl	$130560, %r15d                  ## imm = 0x1FE00
	movl	$64512, %r12d                   ## imm = 0xFC00
	movl	$129024, %esi                   ## imm = 0x1F800
	movl	$63488, %edi                    ## imm = 0xF800
	movl	$65535, %r8d                    ## imm = 0xFFFF
	movl	$15, %r14d
	movl	$-23, %r9d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ecx, %eax
	notl	%eax
	testl	%eax, %ebx
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movl	$0, 20(%r13)
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=2
	movl	%ecx, %eax
	andl	%r15d, %eax
	cmpl	%r12d, %eax
	jne	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=2
	cmpl	$0, 20(%r13)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=2
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movl	12(%r13), %esi
	leal	8(%r14), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	addl	%r9d, %edx
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	callq	_hdlc_rx_add_bytes
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_hdlc_rx_flag
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	movq	-88(%rbp), %r8                  ## 8-byte Reload
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	$0, 40(%r13)
	movl	28(%r13), %eax
	movl	%eax, 32(%r13)
	movl	$1, 20(%r13)
	movl	%r14d, 16(%r13)
	movl	%r14d, %edx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=2
	andl	%esi, %ecx
	cmpl	%edi, %ecx
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=2
	decl	%edx
	movl	%edx, 16(%r13)
	movl	12(%r13), %eax
	movl	%r8d, %ecx
	notl	%ecx
	andl	%eax, %ecx
	andl	%r8d, %eax
	addl	%eax, %eax
	orl	%ecx, %eax
	movl	%eax, 12(%r13)
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=2
	subl	$1, %r14d
	jb	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_6 Depth=2
	addl	%r8d, %r8d
	incl	%r8d
	addl	%edi, %edi
	addl	%esi, %esi
	addl	%r12d, %r12d
	addl	%r15d, %r15d
	addl	%ebx, %ebx
	movl	8(%r13), %ecx
	incl	%r9d
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_HDLCDRV_MAGIC,8,3              ## @HDLCDRV_MAGIC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdlcdrv_receiver               ; -- Begin function hdlcdrv_receiver
	.p2align	2
_hdlcdrv_receiver:                      ; @hdlcdrv_receiver
	.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
	cbz	x1, LBB0_3
; %bb.1:
	mov	x19, x1
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _HDLCDRV_MAGIC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HDLCDRV_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	mov	x20, x0
	add	x21, x19, #24
	mov	w0, #0
	mov	x1, x21
	bl	_test_and_set_bit
	cbz	x0, LBB0_4
LBB0_3:
	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_4:
	str	x21, [sp]                       ; 8-byte Folded Spill
	add	x21, x19, #48
	mov	x0, x21
	bl	_hdlcdrv_hbuf_empty
	cbz	w0, LBB0_6
LBB0_5:
	mov	w0, #0
	ldr	x1, [sp]                        ; 8-byte Folded Reload
	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	_clear_bit
LBB0_6:
	str	x21, [sp, #8]                   ; 8-byte Folded Spill
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	w1, [x19, #12]
	mov	x0, x19
	bl	_hdlc_rx_add_bytes
	ldr	w8, [x19, #16]
	sub	w8, w8, w0
	str	w8, [x19, #16]
	ldr	x21, [sp, #8]                   ; 8-byte Folded Reload
	mov	x0, x21
	bl	_hdlcdrv_hbuf_empty
	cbnz	w0, LBB0_5
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_hdlcdrv_hbuf_get
	lsl	w8, w0, #16
	ldr	d0, [x19, #8]
	sshr.2s	v0, v0, #16
	dup.2s	v1, w8
	ldr	w8, [x19, #16]
	add	w2, w8, #16
	orr.8b	v0, v0, v1
	str	d0, [x19, #8]
	fmov	w8, s0
	mov	w24, #130048
	mov	w25, #130560
	mov	w26, #64512
	mov	w27, #129024
	str	w2, [x19, #16]
	mov	w28, #63488
	mov	w23, #65535
	mov	w21, #15
	mov	w22, #-23
	bics	wzr, w24, w8
	b.ne	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_8 Depth=1
	str	wzr, [x19, #20]
	b	LBB0_16
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	and	w9, w8, w25
	cmp	w9, w26
	b.ne	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x19, #12]
	add	w9, w21, #8
	lsl	w1, w8, w9
	add	w2, w22, w2
	mov	x0, x19
	bl	_hdlc_rx_add_bytes
	mov	x0, x20
	mov	x1, x19
	bl	_hdlc_rx_flag
LBB0_13:                                ;   in Loop: Header=BB0_8 Depth=1
	str	xzr, [x19, #40]
	ldr	w8, [x19, #28]
	str	w8, [x19, #32]
	mov	w8, #1
	stp	w21, w8, [x19, #16]
	mov	x2, x21
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	and	w8, w8, w27
	cmp	w8, w28
	b.ne	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_8 Depth=1
	sub	w2, w2, #1
	ldr	w8, [x19, #12]
	bic	w9, w8, w23
	and	w8, w8, w23
	orr	w8, w9, w8, lsl #1
	stp	w8, w2, [x19, #12]
LBB0_16:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	w21, LBB0_7
; %bb.17:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	w9, #1
	bfi	w9, w23, #1, #31
	lsl	w28, w28, #1
	lsl	w27, w27, #1
	lsl	w26, w26, #1
	lsl	w25, w25, #1
	lsl	w24, w24, #1
	sub	w21, w21, #1
	ldr	w8, [x19, #8]
	add	w22, w22, #1
	mov	x23, x9
	bics	wzr, w24, w8
	b.ne	LBB0_10
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_HDLCDRV_MAGIC,8,3              ; @HDLCDRV_MAGIC
.subsections_via_symbols
