	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hvc_instantiate                ## -- Begin function hvc_instantiate
	.p2align	4, 0x90
_hvc_instantiate:                       ## @hvc_instantiate
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$-1, %r14d
	testl	%esi, %esi
	js	LBB0_9
## %bb.1:
	movl	%esi, %ebx
	movq	_MAX_NR_HVC_CONSOLES@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_9
## %bb.2:
	movq	_vtermnos@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %r13d
	cmpl	$-1, (%rax,%r13,4)
	jne	LBB0_9
## %bb.3:
	movq	%rdx, %r15
	movl	%edi, %r12d
	movl	%ebx, %edi
	callq	_hvc_get_by_index
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_destroy_hvc_struct@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_kref_put
	jmp	LBB0_9
LBB0_5:
	movq	_vtermnos@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r12d, (%rax,%r13,4)
	movq	_cons_ops@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r15, (%rax,%r13,8)
	movq	_last_hvc@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jge	LBB0_7
## %bb.6:
	movl	%ebx, (%rax)
LBB0_7:
	movq	_hvc_con_driver@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpl	%ebx, (%rax)
	jne	LBB0_9
## %bb.8:
	movq	_hvc_con_driver@GOTPCREL(%rip), %rdi
	callq	_register_console
LBB0_9:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_NR_HVC_CONSOLES,4,2        ## @MAX_NR_HVC_CONSOLES
	.comm	_vtermnos,8,3                   ## @vtermnos
	.comm	_destroy_hvc_struct,4,2         ## @destroy_hvc_struct
	.comm	_cons_ops,8,3                   ## @cons_ops
	.comm	_last_hvc,4,2                   ## @last_hvc
	.comm	_hvc_con_driver,4,2             ## @hvc_con_driver
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hvc_instantiate                ; -- Begin function hvc_instantiate
	.p2align	2
_hvc_instantiate:                       ; @hvc_instantiate
	.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
	mov	w0, #-1
	tbnz	w1, #31, LBB0_11
; %bb.1:
	mov	x19, x1
Lloh0:
	adrp	x8, _MAX_NR_HVC_CONSOLES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_NR_HVC_CONSOLES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_11
; %bb.2:
Lloh3:
	adrp	x22, _vtermnos@GOTPAGE
Lloh4:
	ldr	x22, [x22, _vtermnos@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	w8, [x8, w19, uxtw #2]
	cmn	w8, #1
	b.eq	LBB0_4
; %bb.3:
	mov	w0, #-1
	b	LBB0_11
LBB0_4:
	mov	x20, x2
	mov	x0, x19
	bl	_hvc_get_by_index
	cbz	x0, LBB0_6
; %bb.5:
Lloh5:
	adrp	x8, _destroy_hvc_struct@GOTPAGE
Lloh6:
	ldr	x8, [x8, _destroy_hvc_struct@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_kref_put
	mov	w0, #-1
	b	LBB0_11
LBB0_6:
	mov	w8, w19
	ldr	x9, [x22]
	str	w21, [x9, x8, lsl #2]
Lloh8:
	adrp	x9, _cons_ops@GOTPAGE
Lloh9:
	ldr	x9, [x9, _cons_ops@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	str	x20, [x9, x8, lsl #3]
Lloh11:
	adrp	x8, _last_hvc@GOTPAGE
Lloh12:
	ldr	x8, [x8, _last_hvc@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, w19
	b.ge	LBB0_8
; %bb.7:
	str	w19, [x8]
LBB0_8:
Lloh13:
	adrp	x8, _hvc_con_driver@GOTPAGE
Lloh14:
	ldr	x8, [x8, _hvc_con_driver@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_10
; %bb.9:
Lloh16:
	adrp	x0, _hvc_con_driver@GOTPAGE
Lloh17:
	ldr	x0, [x0, _hvc_con_driver@GOTPAGEOFF]
	bl	_register_console
LBB0_10:
	mov	w0, #0
LBB0_11:
	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 AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_NR_HVC_CONSOLES,4,2        ; @MAX_NR_HVC_CONSOLES
	.comm	_vtermnos,8,3                   ; @vtermnos
	.comm	_destroy_hvc_struct,4,2         ; @destroy_hvc_struct
	.comm	_cons_ops,8,3                   ; @cons_ops
	.comm	_last_hvc,4,2                   ; @last_hvc
	.comm	_hvc_con_driver,4,2             ; @hvc_con_driver
.subsections_via_symbols
