	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ttymode_sysctl
_ttymode_sysctl:                        ## @ttymode_sysctl
	.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
	movq	_hdr@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_printf
	movq	$4, -48(%rbp)
	movl	$4, %edi
	callq	_malloc
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	leaq	L_.str.2(%rip), %rdi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_sysctlbyname
	cmpl	$-1, %eax
	je	LBB0_3
LBB0_9:
	movq	-48(%rbp), %rax
	shrq	$2, %rax
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	movl	%eax, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_ttyprt
	addq	$4, %r14
	decq	%rbx
	jne	LBB0_11
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_errno@GOTPCREL(%rip), %rbx
	movq	_ENOMEM@GOTPCREL(%rip), %r13
	leaq	L_.str.2(%rip), %r15
	leaq	-48(%rbp), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rsi
	addq	%rsi, %rsi
	movq	%rsi, -48(%rbp)
	movq	%r14, %rdi
	callq	_realloc
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_7
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_sysctlbyname
	cmpl	$-1, %eax
	jne	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rax
	cmpq	(%r13), %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_err
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_err
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_hdr,8,3                        ## @hdr
L_.str.1:                               ## @.str.1
	.asciz	"malloc()"

L_.str.2:                               ## @.str.2
	.asciz	"kern.ttys"

	.comm	_errno,8,3                      ## @errno
	.comm	_ENOMEM,8,3                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"sysctlbyname()"

L_.str.4:                               ## @.str.4
	.asciz	"realloc()"

	.no_dead_strip	_ttymode_sysctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ttymode_sysctl
_ttymode_sysctl:                        ; @ttymode_sysctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _hdr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _hdr@GOTPAGEOFF]
Lloh2:
	ldr	x1, [x8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	mov	w8, #4
	str	x8, [sp, #8]
	mov	w0, #4
	bl	_malloc
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	add	x2, sp, #8
	mov	x1, x19
	mov	w3, #0
	mov	w4, #0
	bl	_sysctlbyname
	cmn	w0, #1
	b.eq	LBB0_7
LBB0_3:
	ldr	x8, [sp, #8]
	lsr	x9, x8, #2
	cbz	w9, LBB0_6
; %bb.4:
	ubfx	x20, x8, #2, #32
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_ttyprt
	add	x19, x19, #4
	subs	x20, x20, #1
	b.ne	LBB0_5
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_7:
Lloh9:
	adrp	x23, _errno@GOTPAGE
Lloh10:
	ldr	x23, [x23, _errno@GOTPAGEOFF]
Lloh11:
	adrp	x24, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x24, [x24, _ENOMEM@GOTPAGEOFF]
Lloh13:
	adrp	x20, l_.str.4@PAGE
Lloh14:
	add	x20, x20, l_.str.4@PAGEOFF
Lloh15:
	adrp	x21, l_.str.2@PAGE
Lloh16:
	add	x21, x21, l_.str.2@PAGEOFF
Lloh17:
	adrp	x22, l_.str.3@PAGE
Lloh18:
	add	x22, x22, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [sp, #8]
	lsl	x1, x8, #1
	str	x1, [sp, #8]
	mov	x0, x19
	bl	_realloc
	mov	x19, x0
	cbz	x0, LBB0_12
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x19
	mov	w3, #0
	mov	w4, #0
	bl	_sysctlbyname
	cmn	w0, #1
	b.ne	LBB0_3
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	w0, #1
	mov	x1, x22
	bl	_err
	b	LBB0_8
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	w0, #1
	mov	x1, x20
	bl	_err
	b	LBB0_9
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_hdr,8,3                        ; @hdr
l_.str.1:                               ; @.str.1
	.asciz	"malloc()"

l_.str.2:                               ; @.str.2
	.asciz	"kern.ttys"

	.comm	_errno,8,3                      ; @errno
	.comm	_ENOMEM,8,3                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"sysctlbyname()"

l_.str.4:                               ; @.str.4
	.asciz	"realloc()"

	.no_dead_strip	_ttymode_sysctl
.subsections_via_symbols
