	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function port_fops_open
_port_fops_open:                        ## @port_fops_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rax
	movl	(%rax), %edi
	callq	_find_port_by_devt
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rax, (%r14)
	movq	%rax, %rdi
	callq	_is_console_port
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_4:
	leaq	12(%r12), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	cmpl	$0, (%r12)
	je	LBB0_8
## %bb.5:
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	addq	$4, %r12
	movq	_remove_port@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_kref_put
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	$1, (%r12)
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	movq	%r12, %rbx
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irq
	movq	%r12, %rdi
	callq	_reclaim_consumed_buffers
	movq	%rbx, %rdi
	callq	_spin_unlock_irq
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_nonseekable_open
	movq	(%r14), %rdi
	movq	_VIRTIO_CONSOLE_PORT_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_send_control_msg
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_VIRTIO_CONSOLE_PORT_OPEN,4,2   ## @VIRTIO_CONSOLE_PORT_OPEN
	.comm	_remove_port,4,2                ## @remove_port
	.no_dead_strip	_port_fops_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function port_fops_open
_port_fops_open:                        ; @port_fops_open
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x21, x0
	ldr	x8, [x0]
	ldr	w0, [x8]
	bl	_find_port_by_devt
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	str	x0, [x20]
	bl	_is_console_port
	cbz	x0, LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
Lloh2:
	adrp	x8, _ENXIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_4:
	add	x22, x19, #12
	mov	x0, x22
	bl	_spin_lock_irq
	ldr	w8, [x19]
	cbz	w8, LBB0_8
; %bb.5:
	mov	x0, x22
	bl	_spin_unlock_irq
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w20, w8
	add	x0, x19, #4
Lloh7:
	adrp	x8, _remove_port@GOTPAGE
Lloh8:
	ldr	x8, [x8, _remove_port@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_kref_put
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
	mov	w8, #1
	mov	x23, x19
	str	w8, [x23], #8
	mov	x0, x22
	bl	_spin_unlock_irq
	mov	x0, x23
	bl	_spin_lock_irq
	mov	x0, x19
	bl	_reclaim_consumed_buffers
	mov	x0, x23
	bl	_spin_unlock_irq
	mov	x0, x21
	mov	x1, x20
	bl	_nonseekable_open
	ldr	x0, [x20]
Lloh10:
	adrp	x8, _VIRTIO_CONSOLE_PORT_OPEN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VIRTIO_CONSOLE_PORT_OPEN@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_send_control_msg
	mov	w20, #0
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_VIRTIO_CONSOLE_PORT_OPEN,4,2   ; @VIRTIO_CONSOLE_PORT_OPEN
	.comm	_remove_port,4,2                ; @remove_port
	.no_dead_strip	_port_fops_open
.subsections_via_symbols
