	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_attach_hdlc_protocol           ## -- Begin function attach_hdlc_protocol
	.p2align	4, 0x90
_attach_hdlc_protocol:                  ## @attach_hdlc_protocol
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_detach_hdlc_protocol
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movl	(%r14), %edi
	callq	_try_module_get
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	testq	%r15, %r15
	je	LBB0_7
## %bb.5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_kmalloc
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_dev_to_hdlc
	movq	%r15, 8(%rax)
	movq	%rbx, %rdi
	callq	_dev_to_hdlc
	cmpq	$0, 8(%rax)
	je	LBB0_6
LBB0_7:
	movq	%rbx, %rdi
	callq	_dev_to_hdlc
	movq	%r14, (%rax)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_2:
	movq	_ENOSYS@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_6:
	movl	(%r14), %edi
	callq	_module_put
	movq	_ENOBUFS@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOBUFS,4,2                    ## @ENOBUFS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_attach_hdlc_protocol           ; -- Begin function attach_hdlc_protocol
	.p2align	2
_attach_hdlc_protocol:                  ; @attach_hdlc_protocol
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	bl	_detach_hdlc_protocol
	cbnz	w0, LBB0_8
; %bb.1:
	ldr	w0, [x19]
	bl	_try_module_get
	cbz	w0, LBB0_5
; %bb.2:
	cbz	x21, LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_kmalloc
	mov	x21, x0
	mov	x0, x20
	bl	_dev_to_hdlc
	str	x21, [x0, #8]
	mov	x0, x20
	bl	_dev_to_hdlc
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_6
LBB0_4:
	mov	x0, x20
	bl	_dev_to_hdlc
	mov	x8, x0
	mov	w0, #0
	str	x19, [x8]
	b	LBB0_8
LBB0_5:
Lloh3:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
	ldr	w0, [x19]
	bl	_module_put
Lloh5:
	adrp	x8, _ENOBUFS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOBUFS@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOBUFS,4,2                    ; @ENOBUFS
.subsections_via_symbols
