	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dump_screen
_dump_screen:                           ## @dump_screen
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movl	%edi, %r14d
	movl	$56, -152(%rbp)
	movq	_CONS_GETINFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-152(%rbp), %rdx
	xorl	%edi, %edi
	callq	_ioctl
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_revert
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	xorps	%xmm0, %xmm0
	movups	%xmm0, -56(%rbp)
	movl	-144(%rbp), %edi
	movl	-136(%rbp), %eax
	movl	%edi, -92(%rbp)
	movl	%eax, -84(%rbp)
	movq	_DUMP_ALL@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jne	LBB0_4
## %bb.3:
	addl	-120(%rbp), %eax
	movl	%eax, -84(%rbp)
LBB0_4:
	imull	%eax, %edi
	shll	$2, %edi
	callq	_alloca
	movq	%rax, -72(%rbp)
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	_revert
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_6:
	movq	_CONS_SCRSHOT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-96(%rbp), %rdx
	xorl	%edi, %edi
	callq	_ioctl
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	callq	_revert
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_8:
	movq	_DUMP_FMT_RAW@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_10
## %bb.9:
	movq	_DUMP_FMT_REV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-92(%rbp), %ecx
	movl	-84(%rbp), %r8d
	leaq	L_.str.3(%rip), %rdi
	movl	$2, %edx
	callq	_printf
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_fflush
	movq	_STDOUT_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-72(%rbp), %rsi
	movl	-92(%rbp), %edx
	imull	-84(%rbp), %edx
	shll	$2, %edx
	callq	_write
	jmp	LBB0_20
LBB0_10:
	movl	-92(%rbp), %edi
	incl	%edi
	callq	_alloca
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	cmpl	$0, -84(%rbp)
	jg	LBB0_13
	jmp	LBB0_19
LBB0_11:
	xorl	%eax, %eax
	callq	_revert
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	callq	_errx
	cmpl	$0, -84(%rbp)
	jle	LBB0_19
LBB0_13:
	xorl	%r14d, %r14d
	movl	$32, %r15d
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	%r12, %rdi
	callq	_puts
	incl	%r14d
	cmpl	-84(%rbp), %r14d
	jge	LBB0_19
LBB0_14:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_21 Depth 2
                                        ##     Child Loop BB0_16 Depth 2
	movl	-92(%rbp), %eax
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	LBB0_15
	.p2align	4, 0x90
LBB0_21:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-72(%rbp), %rcx
	imull	%r14d, %eax
	cltq
	addq	%rbx, %rax
	movl	(%rcx,%rax,4), %r13d
	movzbl	%r13b, %edi
	callq	_isprint
	testq	%rax, %rax
	cmovel	%r15d, %r13d
	movb	%r13b, (%r12,%rbx)
	incq	%rbx
	movslq	-92(%rbp), %rax
	cmpq	%rax, %rbx
	jl	LBB0_21
LBB0_15:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	%ebx, %eax
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movb	$0, (%r12,%rax)
	cmpb	$32, -1(%r12,%rax)
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=2
	leaq	-1(%rax), %rcx
	cmpq	$1, %rax
	movq	%rcx, %rax
	jne	LBB0_16
	jmp	LBB0_18
LBB0_19:
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_fflush
LBB0_20:
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CONS_GETINFO,4,2               ## @CONS_GETINFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"getting console information"

	.comm	_DUMP_ALL,4,2                   ## @DUMP_ALL
L_.str.1:                               ## @.str.1
	.asciz	"failed to allocate memory for dump"

	.comm	_CONS_SCRSHOT,4,2               ## @CONS_SCRSHOT
L_.str.2:                               ## @.str.2
	.asciz	"dumping screen"

	.comm	_DUMP_FMT_RAW,4,2               ## @DUMP_FMT_RAW
L_.str.3:                               ## @.str.3
	.asciz	"SCRSHOT_%c%c%c%c"

	.comm	_DUMP_FMT_REV,4,2               ## @DUMP_FMT_REV
	.comm	_stdout,4,2                     ## @stdout
	.comm	_STDOUT_FILENO,4,2              ## @STDOUT_FILENO
L_.str.4:                               ## @.str.4
	.asciz	"failed to allocate memory for line buffer"

	.no_dead_strip	_dump_screen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dump_screen
_dump_screen:                           ; @dump_screen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x19, x0
	mov	w8, #56
	str	w8, [sp]
Lloh0:
	adrp	x8, _CONS_GETINFO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CONS_GETINFO@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x2, sp
	mov	w0, #0
	bl	_ioctl
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
	bl	_revert
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	stp	xzr, xzr, [sp, #96]
	ldr	w8, [sp, #8]
	ldr	w9, [sp, #16]
	str	w8, [sp, #60]
	str	w9, [sp, #68]
Lloh5:
	adrp	x10, _DUMP_ALL@GOTPAGE
Lloh6:
	ldr	x10, [x10, _DUMP_ALL@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	w10, w20
	b.ne	LBB0_4
; %bb.3:
	ldr	w10, [sp, #32]
	add	w9, w9, w10
	str	w9, [sp, #68]
LBB0_4:
	mul	w8, w8, w9
	lsl	w0, w8, #2
	bl	_alloca
	str	x0, [sp, #80]
	cbnz	x0, LBB0_6
; %bb.5:
	bl	_revert
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_6:
Lloh10:
	adrp	x8, _CONS_SCRSHOT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CONS_SCRSHOT@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x2, sp, #56
	mov	w0, #0
	bl	_ioctl
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
	bl	_revert
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_8:
Lloh15:
	adrp	x8, _DUMP_FMT_RAW@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DUMP_FMT_RAW@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_10
; %bb.9:
Lloh18:
	adrp	x8, _DUMP_FMT_REV@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DUMP_FMT_REV@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldr	w3, [sp, #60]
	ldr	w4, [sp, #68]
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	w2, #2
	bl	_printf
Lloh23:
	adrp	x8, _stdout@GOTPAGE
Lloh24:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	bl	_fflush
Lloh26:
	adrp	x8, _STDOUT_FILENO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _STDOUT_FILENO@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	ldr	x1, [sp, #80]
	ldr	w8, [sp, #60]
	ldr	w9, [sp, #68]
	mul	w8, w8, w9
	lsl	w2, w8, #2
	bl	_write
	b	LBB0_22
LBB0_10:
	ldr	w8, [sp, #60]
	add	w0, w8, #1
	bl	_alloca
	mov	x19, x0
	cbnz	x0, LBB0_12
; %bb.11:
	bl	_revert
Lloh29:
	adrp	x1, l_.str.4@PAGE
Lloh30:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_12:
	ldr	w8, [sp, #68]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.13:
	mov	w20, #0
	mov	w21, #32
LBB0_14:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_16 Depth 2
                                        ;     Child Loop BB0_19 Depth 2
	ldr	w8, [sp, #60]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x22, #0
LBB0_16:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [sp, #80]
	mul	w8, w20, w8
	add	x8, x22, w8, sxtw
	ldr	w23, [x9, x8, lsl #2]
	and	w0, w23, #0xff
	bl	_isprint
	cmp	x0, #0
	csel	w8, w21, w23, eq
	strb	w8, [x19, x22]
	add	x22, x22, #1
	ldrsw	x8, [sp, #60]
	cmp	x22, x8
	b.lt	LBB0_16
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x22, #0
LBB0_18:                                ;   in Loop: Header=BB0_14 Depth=1
	and	x8, x22, #0xffffffff
LBB0_19:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x9, x19, x8
	ldurb	w10, [x9, #-1]
	cmp	w10, #32
	ccmp	x8, #1, #4, eq
	sub	x8, x8, #1
	strb	wzr, [x9]
	b.ne	LBB0_19
; %bb.20:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x19
	bl	_puts
	add	w20, w20, #1
	ldr	w8, [sp, #68]
	cmp	w20, w8
	b.lt	LBB0_14
LBB0_21:
Lloh31:
	adrp	x8, _stdout@GOTPAGE
Lloh32:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	bl	_fflush
LBB0_22:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_CONS_GETINFO,4,2               ; @CONS_GETINFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"getting console information"

	.comm	_DUMP_ALL,4,2                   ; @DUMP_ALL
l_.str.1:                               ; @.str.1
	.asciz	"failed to allocate memory for dump"

	.comm	_CONS_SCRSHOT,4,2               ; @CONS_SCRSHOT
l_.str.2:                               ; @.str.2
	.asciz	"dumping screen"

	.comm	_DUMP_FMT_RAW,4,2               ; @DUMP_FMT_RAW
l_.str.3:                               ; @.str.3
	.asciz	"SCRSHOT_%c%c%c%c"

	.comm	_DUMP_FMT_REV,4,2               ; @DUMP_FMT_REV
	.comm	_stdout,4,2                     ; @stdout
	.comm	_STDOUT_FILENO,4,2              ; @STDOUT_FILENO
l_.str.4:                               ; @.str.4
	.asciz	"failed to allocate memory for line buffer"

	.no_dead_strip	_dump_screen
.subsections_via_symbols
