	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drv_sgmode
_drv_sgmode:                            ## @drv_sgmode
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	$0, -36(%rbp)
	xorl	%eax, %eax
	callq	_AssertTCB
	movq	_ERR@GOTPCREL(%rip), %rax
	testq	%r15, %r15
	je	LBB0_9
## %bb.1:
	testq	%r14, %r14
	je	LBB0_9
## %bb.2:
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.3:
	movl	(%r14), %r12d
	movl	4(%r14), %ebx
	movl	8(%r15), %edi
	leaq	-36(%rbp), %rsi
	callq	_GetConsoleMode
	movq	_ICANON@GOTPCREL(%rip), %rcx
	movq	_ENABLE_LINE_INPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%ebx, (%rcx)
	je	LBB0_5
## %bb.4:
	orl	-36(%rbp), %eax
	jmp	LBB0_6
LBB0_7:
	movl	(%r15), %r12d
	movl	4(%r15), %ebx
	movl	8(%r15), %edi
	leaq	-36(%rbp), %rsi
	callq	_GetConsoleMode
	movl	-36(%rbp), %eax
	movq	_ENABLE_LINE_INPUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_ICANON@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, %esi
	orl	%ebx, %esi
	notl	%edx
	andl	%ebx, %edx
	testl	%ecx, %ecx
	cmovnel	%esi, %edx
	movq	_ENABLE_ECHO_INPUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_ECHO@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, %edi
	orl	%edx, %edi
	notl	%esi
	andl	%edx, %esi
	testl	%ecx, %ecx
	cmovnel	%edi, %esi
	movq	_ENABLE_PROCESSED_INPUT@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_BRKINT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	orl	%r12d, %edx
	notl	%ecx
	andl	%r12d, %ecx
	testl	%eax, %eax
	cmovnel	%edx, %ecx
	movl	%ecx, (%r15)
	movl	%esi, 4(%r15)
	movq	%r14, %rax
	movq	%r15, %r14
	movq	%rax, %r15
	jmp	LBB0_8
LBB0_5:
	notl	%eax
	andl	-36(%rbp), %eax
LBB0_6:
	movq	_ECHO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%ebx, %ecx
	movq	_ENABLE_ECHO_INPUT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movl	%esi, %edx
	notl	%edx
	andl	%eax, %edx
	orl	%eax, %esi
	testl	%ecx, %ecx
	cmovel	%edx, %esi
	movq	_BRKINT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r12d, %eax
	movq	_ENABLE_PROCESSED_INPUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	notl	%edx
	andl	%esi, %edx
	orl	%ecx, %esi
	testl	%eax, %eax
	cmovel	%edx, %esi
	movq	_ENABLE_MOUSE_INPUT@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	%esi, -36(%rbp)
	movl	%r12d, (%r14)
	movl	%ebx, 4(%r14)
	movl	8(%r15), %edi
	callq	_SetConsoleMode
LBB0_8:
	movq	(%r14), %rax
	movq	%rax, (%r15)
	movq	_OK@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERR,4,2                        ## @ERR
	.comm	_ICANON,4,2                     ## @ICANON
	.comm	_ENABLE_LINE_INPUT,4,2          ## @ENABLE_LINE_INPUT
	.comm	_ECHO,4,2                       ## @ECHO
	.comm	_ENABLE_ECHO_INPUT,4,2          ## @ENABLE_ECHO_INPUT
	.comm	_BRKINT,4,2                     ## @BRKINT
	.comm	_ENABLE_PROCESSED_INPUT,4,2     ## @ENABLE_PROCESSED_INPUT
	.comm	_ENABLE_MOUSE_INPUT,4,2         ## @ENABLE_MOUSE_INPUT
	.comm	_OK,4,2                         ## @OK
	.no_dead_strip	_drv_sgmode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drv_sgmode
_drv_sgmode:                            ; @drv_sgmode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x2
	mov	x21, x1
	mov	x20, x0
	str	wzr, [sp, #12]
	bl	_AssertTCB
Lloh0:
	adrp	x8, _ERR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERR@GOTPAGEOFF]
	cbz	x20, LBB0_9
; %bb.1:
	cbz	x19, LBB0_9
; %bb.2:
	cbz	w21, LBB0_5
; %bb.3:
	ldp	w21, w22, [x19]
	ldr	w0, [x20, #8]
	add	x1, sp, #12
	bl	_GetConsoleMode
Lloh2:
	adrp	x8, _ICANON@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ICANON@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x8]
Lloh5:
	adrp	x8, _ENABLE_LINE_INPUT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENABLE_LINE_INPUT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w9, w22
	b.eq	LBB0_6
; %bb.4:
	ldr	w9, [sp, #12]
	orr	w8, w9, w8
	b	LBB0_7
LBB0_5:
	ldp	w21, w22, [x20]
	ldr	w0, [x20, #8]
	add	x1, sp, #12
	bl	_GetConsoleMode
	ldr	w8, [sp, #12]
Lloh8:
	adrp	x9, _ENABLE_LINE_INPUT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ENABLE_LINE_INPUT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x10, _ICANON@GOTPAGE
Lloh12:
	ldr	x10, [x10, _ICANON@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	orr	w11, w10, w22
	bic	w10, w22, w10
	tst	w9, w8
Lloh14:
	adrp	x9, _ENABLE_ECHO_INPUT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ENABLE_ECHO_INPUT@GOTPAGEOFF]
	csel	w10, w10, w11, eq
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x11, _ECHO@GOTPAGE
Lloh18:
	ldr	x11, [x11, _ECHO@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	orr	w12, w11, w10
	bic	w10, w10, w11
	tst	w9, w8
	csel	w9, w10, w12, eq
Lloh20:
	adrp	x10, _ENABLE_PROCESSED_INPUT@GOTPAGE
Lloh21:
	ldr	x10, [x10, _ENABLE_PROCESSED_INPUT@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
Lloh23:
	adrp	x11, _BRKINT@GOTPAGE
Lloh24:
	ldr	x11, [x11, _BRKINT@GOTPAGEOFF]
Lloh25:
	ldr	w11, [x11]
	orr	w12, w11, w21
	bic	w11, w21, w11
	tst	w10, w8
	csel	w8, w11, w12, eq
	stp	w8, w9, [x20]
	mov	x0, x19
	mov	x19, x20
	mov	x20, x0
	b	LBB0_8
LBB0_6:
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
LBB0_7:
Lloh26:
	adrp	x9, _ECHO@GOTPAGE
Lloh27:
	ldr	x9, [x9, _ECHO@GOTPAGEOFF]
Lloh28:
	adrp	x10, _ENABLE_ECHO_INPUT@GOTPAGE
Lloh29:
	ldr	x10, [x10, _ENABLE_ECHO_INPUT@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
Lloh31:
	ldr	w10, [x10]
	bic	w11, w8, w10
	orr	w8, w10, w8
	tst	w9, w22
	csel	w8, w11, w8, eq
Lloh32:
	adrp	x9, _BRKINT@GOTPAGE
Lloh33:
	ldr	x9, [x9, _BRKINT@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
Lloh35:
	adrp	x10, _ENABLE_PROCESSED_INPUT@GOTPAGE
Lloh36:
	ldr	x10, [x10, _ENABLE_PROCESSED_INPUT@GOTPAGEOFF]
Lloh37:
	ldr	w10, [x10]
	bic	w11, w8, w10
	orr	w8, w10, w8
	tst	w9, w21
	csel	w8, w11, w8, eq
Lloh38:
	adrp	x9, _ENABLE_MOUSE_INPUT@GOTPAGE
Lloh39:
	ldr	x9, [x9, _ENABLE_MOUSE_INPUT@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	orr	w1, w9, w8
	str	w1, [sp, #12]
	stp	w21, w22, [x19]
	ldr	w0, [x20, #8]
	bl	_SetConsoleMode
LBB0_8:
	ldr	x8, [x19]
	str	x8, [x20]
Lloh41:
	adrp	x8, _OK@GOTPAGE
Lloh42:
	ldr	x8, [x8, _OK@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh30
	.loh AdrpLdrGot	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_ERR,4,2                        ; @ERR
	.comm	_ICANON,4,2                     ; @ICANON
	.comm	_ENABLE_LINE_INPUT,4,2          ; @ENABLE_LINE_INPUT
	.comm	_ECHO,4,2                       ; @ECHO
	.comm	_ENABLE_ECHO_INPUT,4,2          ; @ENABLE_ECHO_INPUT
	.comm	_BRKINT,4,2                     ; @BRKINT
	.comm	_ENABLE_PROCESSED_INPUT,4,2     ; @ENABLE_PROCESSED_INPUT
	.comm	_ENABLE_MOUSE_INPUT,4,2         ; @ENABLE_MOUSE_INPUT
	.comm	_OK,4,2                         ; @OK
	.no_dead_strip	_drv_sgmode
.subsections_via_symbols
