	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ucc_hdlc_attach
_ucc_hdlc_attach:                       ## @ucc_hdlc_attach
	.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
	movl	%edx, %r14d
	movl	%esi, %ebx
	callq	_dev_to_hdlc
	movq	(%rax), %rax
	movq	_ENCODING_NRZ@GOTPCREL(%rip), %rcx
	cmpw	%bx, (%rcx)
	je	LBB0_3
## %bb.1:
	movq	_ENCODING_NRZI@GOTPCREL(%rip), %rcx
	cmpw	%bx, (%rcx)
	jne	LBB0_2
LBB0_3:
	movq	_PARITY_NONE@GOTPCREL(%rip), %rcx
	cmpw	%r14w, (%rcx)
	je	LBB0_7
## %bb.4:
	movq	_PARITY_CRC32_PR1_CCITT@GOTPCREL(%rip), %rcx
	cmpw	%r14w, (%rcx)
	je	LBB0_7
## %bb.5:
	movq	_PARITY_CRC16_PR0_CCITT@GOTPCREL(%rip), %rcx
	cmpw	%r14w, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	_PARITY_CRC16_PR1_CCITT@GOTPCREL(%rip), %rcx
	cmpw	%r14w, (%rcx)
	je	LBB0_7
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_7:
	movw	%bx, (%rax)
	movw	%r14w, 2(%rax)
	xorl	%eax, %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENCODING_NRZ,2,1               ## @ENCODING_NRZ
	.comm	_ENCODING_NRZI,2,1              ## @ENCODING_NRZI
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PARITY_NONE,2,1                ## @PARITY_NONE
	.comm	_PARITY_CRC32_PR1_CCITT,2,1     ## @PARITY_CRC32_PR1_CCITT
	.comm	_PARITY_CRC16_PR0_CCITT,2,1     ## @PARITY_CRC16_PR0_CCITT
	.comm	_PARITY_CRC16_PR1_CCITT,2,1     ## @PARITY_CRC16_PR1_CCITT
	.no_dead_strip	_ucc_hdlc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ucc_hdlc_attach
_ucc_hdlc_attach:                       ; @ucc_hdlc_attach
	.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	x19, x2
	mov	x20, x1
	bl	_dev_to_hdlc
Lloh0:
	adrp	x8, _ENCODING_NRZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENCODING_NRZ@GOTPAGEOFF]
	ldrh	w8, [x8]
Lloh2:
	adrp	x9, _ENCODING_NRZI@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ENCODING_NRZI@GOTPAGEOFF]
	ldrh	w9, [x9]
	cmp	w8, w20
	ccmp	w9, w20, #4, ne
	b.ne	LBB0_3
; %bb.1:
Lloh4:
	adrp	x8, _PARITY_NONE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PARITY_NONE@GOTPAGEOFF]
Lloh6:
	adrp	x9, _PARITY_CRC32_PR1_CCITT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PARITY_CRC32_PR1_CCITT@GOTPAGEOFF]
	ldrh	w8, [x8]
	ldrh	w9, [x9]
Lloh8:
	adrp	x10, _PARITY_CRC16_PR0_CCITT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PARITY_CRC16_PR0_CCITT@GOTPAGEOFF]
Lloh10:
	adrp	x11, _PARITY_CRC16_PR1_CCITT@GOTPAGE
Lloh11:
	ldr	x11, [x11, _PARITY_CRC16_PR1_CCITT@GOTPAGEOFF]
	ldrh	w10, [x10]
	ldrh	w11, [x11]
	cmp	w8, w19
	ccmp	w9, w19, #4, ne
	ccmp	w10, w19, #4, ne
	ccmp	w11, w19, #4, ne
	b.ne	LBB0_3
; %bb.2:
	mov	w8, #0
	ldr	x9, [x0]
	strh	w20, [x9]
	strh	w19, [x9, #2]
	b	LBB0_4
LBB0_3:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w8, w8
LBB0_4:
	mov	x0, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENCODING_NRZ,2,1               ; @ENCODING_NRZ
	.comm	_ENCODING_NRZI,2,1              ; @ENCODING_NRZI
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PARITY_NONE,2,1                ; @PARITY_NONE
	.comm	_PARITY_CRC32_PR1_CCITT,2,1     ; @PARITY_CRC32_PR1_CCITT
	.comm	_PARITY_CRC16_PR0_CCITT,2,1     ; @PARITY_CRC16_PR0_CCITT
	.comm	_PARITY_CRC16_PR1_CCITT,2,1     ; @PARITY_CRC16_PR1_CCITT
	.no_dead_strip	_ucc_hdlc_attach
.subsections_via_symbols
