	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cmm_open
_cmm_open:                              ## @cmm_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_iminor
	movl	%eax, %r13d
	movq	_CM4000_MAX_DEV@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jge	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_lock_kernel
	movq	_dev_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r13d, %rcx
	movq	(%rax,%rcx,8), %r12
	testq	%r12, %r12
	je	LBB0_6
## %bb.2:
	movq	%r12, %rdi
	callq	_pcmcia_dev_present
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	cmpl	$0, (%r12)
	je	LBB0_10
## %bb.4:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_7:
	subl	(%rax), %ebx
LBB0_8:
	xorl	%eax, %eax
	callq	_unlock_kernel
LBB0_9:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	8(%r12), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, 8(%r14)
	movq	%r15, %rdi
	callq	_imajor
	movq	_current@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx), %edx
	movl	4(%rcx), %r9d
	movl	%edx, (%rsp)
	leaq	L_.str(%rip), %rdx
	xorl	%ebx, %ebx
	movl	$2, %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%eax, %ecx
	movl	%r13d, %r8d
	movq	%rsi, %r13
	xorl	%eax, %eax
	callq	_DEBUGP
	movq	%r13, %rdi
	callq	_ZERO_DEV
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_12
## %bb.11:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_12:
	movq	_T_50MSEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	movq	%r13, %rdi
	callq	_start_monitor
	movl	$1, (%r12)
	leaq	L_.str.1(%rip), %rdx
	movl	$2, %edi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_DEBUGP
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_nonseekable_open
	movl	%eax, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_CM4000_MAX_DEV,4,2             ## @CM4000_MAX_DEV
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_dev_table,8,3                  ## @dev_table
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-> cmm_open(device=%d.%d process=%s,%d)\n"

	.comm	_current,8,3                    ## @current
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_T_50MSEC,4,2                   ## @T_50MSEC
L_.str.1:                               ## @.str.1
	.asciz	"<- cmm_open\n"

	.no_dead_strip	_cmm_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cmm_open
_cmm_open:                              ; @cmm_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x0
	bl	_iminor
Lloh0:
	adrp	x8, _CM4000_MAX_DEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CM4000_MAX_DEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ge	LBB0_5
; %bb.1:
	mov	x23, x0
	bl	_lock_kernel
Lloh3:
	adrp	x8, _dev_table@GOTPAGE
Lloh4:
	ldr	x8, [x8, _dev_table@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x21, [x8, w23, sxtw #3]
	cbz	x21, LBB0_6
; %bb.2:
	mov	x0, x21
	bl	_pcmcia_dev_present
	cbz	w0, LBB0_6
; %bb.3:
	ldr	w8, [x21]
	cbz	w8, LBB0_10
; %bb.4:
Lloh6:
	adrp	x8, _EBUSY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_9
LBB0_6:
Lloh11:
	adrp	x8, _ENODEV@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_8:
	bl	_unlock_kernel
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	ldr	x22, [x21, #8]
	str	x22, [x19, #8]
	mov	x0, x20
	bl	_imajor
                                        ; kill: def $w0 killed $w0 def $x0
Lloh13:
	adrp	x8, _current@GOTPAGE
Lloh14:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	ldp	w8, w9, [x8]
	stp	x9, x8, [sp, #16]
	stp	x0, x23, [sp]
Lloh16:
	adrp	x2, l_.str@PAGE
Lloh17:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #2
	mov	x1, x22
	bl	_DEBUGP
	mov	x0, x22
	bl	_ZERO_DEV
	ldr	w8, [x19]
Lloh18:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
Lloh21:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_7
LBB0_12:
Lloh23:
	adrp	x8, _T_50MSEC@GOTPAGE
Lloh24:
	ldr	x8, [x8, _T_50MSEC@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	str	w8, [x22]
	mov	x0, x22
	bl	_start_monitor
	mov	w8, #1
	str	w8, [x21]
Lloh26:
	adrp	x2, l_.str.1@PAGE
Lloh27:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w0, #2
	mov	x1, x22
	bl	_DEBUGP
	mov	x0, x20
	mov	x1, x19
	bl	_nonseekable_open
	mov	x19, x0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_CM4000_MAX_DEV,4,2             ; @CM4000_MAX_DEV
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_dev_table,8,3                  ; @dev_table
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-> cmm_open(device=%d.%d process=%s,%d)\n"

	.comm	_current,8,3                    ; @current
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_T_50MSEC,4,2                   ; @T_50MSEC
l_.str.1:                               ; @.str.1
	.asciz	"<- cmm_open\n"

	.no_dead_strip	_cmm_open
.subsections_via_symbols
