	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc_do_resize
_vc_do_resize:                          ## @vc_do_resize
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, %r15
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_WARN_CONSOLE_UNLOCKED
	testq	%r14, %r14
	je	LBB0_6
## %bb.1:
	movq	%r15, -112(%rbp)                ## 8-byte Spill
	movl	(%r14), %r15d
	movl	$0, (%r14)
	movq	_VC_RESIZE_MAXCOL@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jb	LBB0_7
## %bb.2:
	movq	_VC_RESIZE_MAXROW@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jb	LBB0_7
## %bb.3:
	testl	%r13d, %r13d
	je	LBB0_8
## %bb.4:
	testl	%r12d, %r12d
	je	LBB0_9
LBB0_5:
	cmpl	4(%r14), %r13d
	je	LBB0_10
	jmp	LBB0_11
LBB0_6:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_8:
	movl	4(%r14), %r13d
	testl	%r12d, %r12d
	jne	LBB0_5
LBB0_9:
	movl	8(%r14), %r12d
	cmpl	4(%r14), %r13d
	jne	LBB0_11
LBB0_10:
	xorl	%ebx, %ebx
	cmpl	8(%r14), %r12d
	je	LBB0_17
LBB0_11:
	leal	(%r13,%r13), %eax
	movl	%r12d, %ebx
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	imull	%eax, %ebx
	movq	_GFP_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	8(%r14), %ecx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movl	12(%r14), %ecx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	movl	%r15d, %ecx
	movq	%rax, %r15
	callq	_resize_screen
	testq	%rax, %rax
	je	LBB0_18
## %bb.13:
	movq	%rax, %rbx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
	jmp	LBB0_17
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_15:
	xorl	%ebx, %ebx
LBB0_16:
	subl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, 8(%r14)
	movl	%r13d, 4(%r14)
	movl	-72(%rbp), %esi                 ## 4-byte Reload
	movl	%esi, 12(%r14)
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, 16(%r14)
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_min
	movq	%rax, %r13
	movq	24(%r14), %r15
	movl	%ebx, %r8d
	movl	32(%r14), %ecx
	cmpl	%r12d, %ecx
	jbe	LBB0_21
## %bb.19:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, %edx
	subl	%ecx, %edx
	cmpl	%r12d, %edx
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	jae	LBB0_24
## %bb.20:
	subl	%r12d, %eax
	imull	%edi, %eax
	addq	%rax, %r15
	jmp	LBB0_23
LBB0_21:
	cmpl	%r12d, -80(%rbp)                ## 4-byte Folded Reload
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	jbe	LBB0_23
## %bb.22:
	imull	%ecx, %r12d
	addq	%r15, %r12
	jmp	LBB0_25
LBB0_23:
	movl	36(%r14), %r12d
	jmp	LBB0_25
LBB0_24:
	movl	%r12d, %edx
	shrl	%edx
	subl	%edx, %ecx
	imull	%edi, %ecx
	addq	%rcx, %r15
	imull	%edi, %r12d
	addl	%r15d, %r12d
LBB0_25:
	addq	%r8, %rsi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_update_attr
	movl	%r12d, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	cmpq	%rax, %r15
	jae	LBB0_30
## %bb.26:
	movl	-72(%rbp), %r12d                ## 4-byte Reload
	movq	%r12, %rax
	subq	%r13, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_28 Depth=1
	addq	-88(%rbp), %r15                 ## 8-byte Folded Reload
	addq	%r12, %rbx
	cmpq	-80(%rbp), %r15                 ## 8-byte Folded Reload
	jae	LBB0_30
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_scr_memcpyw
	cmpq	%r12, %r13
	je	LBB0_27
## %bb.29:                              ##   in Loop: Header=BB0_28 Depth=1
	leaq	(%rbx,%r13), %rdi
	movl	72(%r14), %esi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_scr_memsetw
	jmp	LBB0_27
LBB0_30:
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	subq	%rbx, %rdx
	jbe	LBB0_32
## %bb.31:
	movl	72(%r14), %esi
	movq	%rbx, %rdi
	callq	_scr_memsetw
LBB0_32:
	movq	40(%r14), %rdi
	callq	_kfree
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 40(%r14)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 16(%r14)
	movq	%r14, %rdi
	callq	_set_origin
	movq	$0, 64(%r14)
	movl	8(%r14), %eax
	movl	32(%r14), %edx
	movl	%eax, 48(%r14)
	movl	60(%r14), %esi
	movq	%r14, %rdi
	callq	_gotoxy
	movq	%r14, %rdi
	callq	_save_cur
	movq	-112(%rbp), %rbx                ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_34
## %bb.33:
	leaq	-104(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	movl	8(%r14), %eax
	movl	%eax, -104(%rbp)
	movl	4(%r14), %eax
	movl	%eax, -100(%rbp)
	movl	56(%r14), %eax
	movl	%eax, -96(%rbp)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_tty_do_resize
LBB0_34:
	movq	%r14, %rdi
	callq	_CON_IS_VISIBLE
	testq	%rax, %rax
	je	LBB0_36
## %bb.35:
	movq	%r14, %rdi
	callq	_update_screen
LBB0_36:
	movq	_VT_EVENT_RESIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	52(%r14), %edx
	movl	%edx, %esi
	callq	_vt_event_post
	xorl	%ebx, %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_VC_RESIZE_MAXCOL,4,2           ## @VC_RESIZE_MAXCOL
	.comm	_VC_RESIZE_MAXROW,4,2           ## @VC_RESIZE_MAXROW
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_USER,4,2                   ## @GFP_USER
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VT_EVENT_RESIZE,4,2            ## @VT_EVENT_RESIZE
	.no_dead_strip	_vc_do_resize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc_do_resize
_vc_do_resize:                          ; @vc_do_resize
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x3
	mov	x26, x2
	mov	x19, x1
	mov	x20, x0
	bl	_WARN_CONSOLE_UNLOCKED
	cbz	x19, LBB0_3
; %bb.1:
	ldr	w27, [x19]
	str	wzr, [x19]
Lloh0:
	adrp	x8, _VC_RESIZE_MAXCOL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VC_RESIZE_MAXCOL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _VC_RESIZE_MAXROW@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VC_RESIZE_MAXROW@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w26
	ccmp	w9, w25, #0, hs
	b.hs	LBB0_6
; %bb.2:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh8:
	adrp	x8, _ENXIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w27, w8
LBB0_5:
	mov	x0, x27
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_6:
	cbz	w26, LBB0_13
; %bb.7:
	cbz	w25, LBB0_14
LBB0_8:
	ldr	w8, [x19, #4]
	cmp	w26, w8
	b.ne	LBB0_10
; %bb.9:
	ldr	w8, [x19, #8]
	cmp	w25, w8
	b.eq	LBB0_35
LBB0_10:
	lsl	w23, w26, #1
	mul	w28, w25, w23
Lloh10:
	adrp	x8, _GFP_USER@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GFP_USER@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x28
	bl	_kmalloc
	cbz	x0, LBB0_15
; %bb.11:
	mov	x22, x0
	ldp	w21, w24, [x19, #8]
	mov	x0, x19
	mov	x1, x26
	mov	x2, x25
	mov	x3, x27
	bl	_resize_screen
	cbz	x0, LBB0_16
; %bb.12:
	mov	x27, x0
	mov	x0, x22
	bl	_kfree
	b	LBB0_5
LBB0_13:
	ldr	w26, [x19, #4]
	cbnz	w25, LBB0_8
LBB0_14:
	ldr	w25, [x19, #8]
	b	LBB0_8
LBB0_15:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
LBB0_16:
	stp	w26, w25, [x19, #4]
	stp	w23, w28, [x19, #12]
	mov	x0, x24
	mov	x1, x23
	bl	_min
	mov	x26, x0
	ldr	x27, [x19, #24]
	ldr	w8, [x19, #32]
	cmp	w8, w25
	b.ls	LBB0_19
; %bb.17:
	sub	w9, w21, w8
	cmp	w9, w25
	b.hs	LBB0_22
; %bb.18:
	sub	w8, w21, w25
	mul	w8, w8, w24
	add	x27, x27, x8
	b	LBB0_21
LBB0_19:
	cmp	w21, w25
	b.ls	LBB0_21
; %bb.20:
	mul	w8, w24, w25
	add	x21, x27, x8
	b	LBB0_23
LBB0_21:
	ldr	w21, [x19, #36]
	b	LBB0_23
LBB0_22:
	sub	w8, w8, w25, lsr #1
	mul	w8, w8, w24
	add	x27, x27, x8
	madd	w21, w24, w25, w27
LBB0_23:
	str	w28, [sp, #12]                  ; 4-byte Folded Spill
	add	x8, x22, w28, uxtw
	str	x8, [sp]                        ; 8-byte Folded Spill
	mov	x0, x19
	bl	_update_attr
	mov	w21, w21
	mov	x25, x22
	cmp	x27, x21
	b.hs	LBB0_28
; %bb.24:
	sub	x28, x23, x26
	mov	x25, x22
	b	LBB0_26
LBB0_25:                                ;   in Loop: Header=BB0_26 Depth=1
	add	x25, x25, x23
	add	x27, x27, x24
	cmp	x27, x21
	b.hs	LBB0_28
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	mov	x1, x27
	mov	x2, x26
	bl	_scr_memcpyw
	cmp	x26, x23
	b.eq	LBB0_25
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=1
	add	x0, x26, x25
	ldr	w1, [x19, #72]
	mov	x2, x28
	bl	_scr_memsetw
	b	LBB0_25
LBB0_28:
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	subs	x2, x8, x25
	b.ls	LBB0_30
; %bb.29:
	ldr	w1, [x19, #72]
	mov	x0, x25
	bl	_scr_memsetw
LBB0_30:
	ldr	x0, [x19, #40]
	bl	_kfree
	str	x22, [x19, #40]
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	str	w8, [x19, #16]
	mov	x0, x19
	bl	_set_origin
	str	xzr, [x19, #64]
	ldr	w8, [x19, #8]
	str	w8, [x19, #48]
	ldr	w1, [x19, #60]
	ldr	w2, [x19, #32]
	mov	x0, x19
	bl	_gotoxy
	mov	x0, x19
	bl	_save_cur
	cbz	x20, LBB0_32
; %bb.31:
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #12
	bl	_memset
	ldur	d0, [x19, #4]
	rev64.2s	v0, v0
	str	d0, [sp, #16]
	ldr	w8, [x19, #56]
	str	w8, [sp, #24]
	add	x1, sp, #16
	mov	x0, x20
	bl	_tty_do_resize
LBB0_32:
	mov	x0, x19
	bl	_CON_IS_VISIBLE
	cbz	x0, LBB0_34
; %bb.33:
	mov	x0, x19
	bl	_update_screen
LBB0_34:
Lloh15:
	adrp	x8, _VT_EVENT_RESIZE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VT_EVENT_RESIZE@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldr	w1, [x19, #52]
	mov	x2, x1
	bl	_vt_event_post
LBB0_35:
	mov	w27, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_VC_RESIZE_MAXCOL,4,2           ; @VC_RESIZE_MAXCOL
	.comm	_VC_RESIZE_MAXROW,4,2           ; @VC_RESIZE_MAXROW
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_USER,4,2                   ; @GFP_USER
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VT_EVENT_RESIZE,4,2            ; @VT_EVENT_RESIZE
	.no_dead_strip	_vc_do_resize
.subsections_via_symbols
