	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function con_open
_con_open:                              ## @con_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, %r14
	movl	(%rdi), %r15d
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_acquire_console_sem
	cmpq	$0, 24(%r14)
	jne	LBB0_11
## %bb.1:
	movl	%r15d, %edi
	callq	_vc_allocate
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_2
LBB0_11:
	xorl	%eax, %eax
	callq	_release_console_sem
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_vc_cons@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%r15,8), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_4
## %bb.3:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_release_console_sem
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_4:
	movq	%rax, 24(%r14)
	movq	%r14, 16(%rax)
	cmpl	$0, 20(%r14)
	jne	LBB0_7
## %bb.5:
	cmpl	$0, 16(%r14)
	jne	LBB0_7
## %bb.6:
	movl	12(%rax), %ecx
	movl	%ecx, 20(%r14)
	movl	8(%rax), %ecx
	movl	%ecx, 16(%r14)
LBB0_7:
	cmpq	$0, (%rax)
	movq	_IUTF8@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	je	LBB0_9
## %bb.8:
	movq	8(%r14), %rcx
	orl	%eax, (%rcx)
	jmp	LBB0_10
LBB0_9:
	notl	%eax
	movq	8(%r14), %rcx
	andl	%eax, (%rcx)
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_vc_cons,8,3                    ## @vc_cons
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_IUTF8,4,2                      ## @IUTF8
	.no_dead_strip	_con_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function con_open
_con_open:                              ; @con_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	x19, x0
	ldr	w20, [x0]
	bl	_acquire_console_sem
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_2
; %bb.1:
	mov	w21, #0
	b	LBB0_3
LBB0_2:
	mov	x0, x20
	bl	_vc_allocate
	mov	x21, x0
	cbz	w0, LBB0_5
LBB0_3:
	bl	_release_console_sem
LBB0_4:
	mov	x0, x21
	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
LBB0_5:
Lloh0:
	adrp	x8, _vc_cons@GOTPAGE
Lloh1:
	ldr	x8, [x8, _vc_cons@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x8, x20, lsl #3]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_7
; %bb.6:
	bl	_release_console_sem
Lloh3:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_4
LBB0_7:
	str	x8, [x19, #24]
	str	x19, [x8, #16]
	ldr	w9, [x19, #20]
	cbnz	w9, LBB0_10
; %bb.8:
	ldr	w9, [x19, #16]
	cbnz	w9, LBB0_10
; %bb.9:
	ldr	d0, [x8, #8]
	str	d0, [x19, #16]
LBB0_10:
	ldr	x9, [x8]
Lloh6:
	adrp	x8, _IUTF8@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IUTF8@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cbz	x9, LBB0_12
; %bb.11:
	ldr	x9, [x19, #8]
	ldr	w10, [x9]
	orr	w8, w10, w8
	b	LBB0_13
LBB0_12:
	ldr	x9, [x19, #8]
	ldr	w10, [x9]
	bic	w8, w10, w8
LBB0_13:
	str	w8, [x9]
	bl	_release_console_sem
	mov	w21, #0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_vc_cons,8,3                    ; @vc_cons
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_IUTF8,4,2                      ; @IUTF8
	.no_dead_strip	_con_open
.subsections_via_symbols
