	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipw_open
_ipw_open:                              ## @ipw_open
	.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	%rdi, %r15
	movl	(%rdi), %edi
	callq	_get_tty
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, %r14
	addq	$16, %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpq	$0, 40(%rbx)
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_4:
	movq	(%rbx), %rax
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	$0, 32(%rbx)
LBB0_6:
	incq	%rax
	movq	%rax, (%rbx)
	movq	%r15, 24(%rbx)
	movq	%rbx, 8(%r15)
	movl	$1, 4(%r15)
	movq	8(%rbx), %rax
	movq	_TTYTYPE_MODEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	movl	20(%rbx), %edi
	callq	_ipwireless_ppp_open
LBB0_8:
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_TTYTYPE_MODEM,8,3              ## @TTYTYPE_MODEM
	.no_dead_strip	_ipw_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipw_open
_ipw_open:                              ; @ipw_open
	.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, x0
	ldr	w0, [x0]
	bl	_get_tty
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	add	x19, x0, #16
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20, #40]
	cbz	x8, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_3:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_4:
	ldr	x8, [x20]
	cbnz	x8, LBB0_6
; %bb.5:
	str	xzr, [x20, #32]
LBB0_6:
	add	x8, x8, #1
	str	x8, [x20]
	str	x21, [x20, #24]
	str	x20, [x21, #8]
	mov	w8, #1
	str	w8, [x21, #4]
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _TTYTYPE_MODEM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TTYTYPE_MODEM@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	ldr	w0, [x20, #20]
	bl	_ipwireless_ppp_open
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
LBB0_9:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_TTYTYPE_MODEM,8,3              ; @TTYTYPE_MODEM
	.no_dead_strip	_ipw_open
.subsections_via_symbols
