	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_flush_window_regs_user         ## -- Begin function flush_window_regs_user
	.p2align	4, 0x90
_flush_window_regs_user:                ## @flush_window_regs_user
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	16(%rdi), %eax
	xorl	%r12d, %r12d
	cmpl	$1, %eax
	je	LBB0_15
## %bb.1:
	movq	%rdi, %r15
	movq	8(%rdi), %rsi
	movq	(%rdi), %rdi
	movq	%rdi, %rbx
	movl	%esi, %ecx
	shrq	%cl, %rbx
	movq	_XCHAL_NUM_AREGS@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	leal	3(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$2, %edx
	movl	%edx, %ecx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	subl	%esi, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, %ecx
	sarl	$4, %ecx
	movl	%edx, %r14d
	subl	%ecx, %r14d
	testb	$2, %al
	jne	LBB0_4
## %bb.2:
	movq	24(%r15), %rax
	leal	1(,%r14,4), %ecx
	movslq	%ecx, %rcx
	movslq	(%rax,%rcx,4), %rsi
	addq	$-12, %rsi
	xorl	%edi, %edi
	callq	___get_user
	movl	$1, %r12d
	testq	%rax, %rax
	jne	LBB0_15
## %bb.3:
	movl	(%r13), %eax
	leal	3(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	sarl	$2, %edx
LBB0_4:
	cmpl	%edx, %r14d
	jge	LBB0_14
## %bb.5:
	orq	%rbx, -48(%rbp)                 ## 8-byte Folded Spill
	xorl	%edi, %edi
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, %ecx
	shrq	%cl, %rax
	movl	$1, %ebx
	testb	$2, %al
	jne	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	testb	$4, %al
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	xorl	%ebx, %ebx
	testb	$8, %al
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	addq	$-48, %rdi
	leal	4(,%r14,4), %eax
	movslq	%eax, %rsi
	shlq	$2, %rsi
	addq	24(%r15), %rsi
	movl	$32, %edx
	callq	_copy_to_user
	movq	_XCHAL_NUM_AREGS@GOTPCREL(%rip), %r13
	movl	$3, %ebx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	addq	$-32, %rdi
	leal	4(,%r14,4), %eax
	movslq	%eax, %rsi
	shlq	$2, %rsi
	addq	24(%r15), %rsi
	movl	$16, %edx
	callq	_copy_to_user
	movq	_XCHAL_NUM_AREGS@GOTPCREL(%rip), %r13
	movl	$2, %ebx
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	testq	%rax, %rax
	jne	LBB0_15
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	24(%r15), %rcx
	addl	%r14d, %ebx
	leal	1(,%rbx,4), %eax
	cltd
	idivl	(%r13)
	movslq	%edx, %rax
	movslq	(%rcx,%rax,4), %rdi
	addq	$-16, %rdi
	shll	$2, %r14d
	movslq	%r14d, %rax
	leaq	(%rcx,%rax,4), %rsi
	movl	$16, %edx
	callq	_copy_to_user
	testq	%rax, %rax
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	24(%r15), %rax
	orl	$1, %r14d
	movslq	%r14d, %rcx
	movslq	(%rax,%rcx,4), %rdi
	movl	(%r13), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	movl	%ebx, %r14d
	cmpl	%ecx, %ebx
	jl	LBB0_6
LBB0_14:
	movl	$1, %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $cl killed $cl killed $rcx
	shll	%cl, %eax
	movl	$1, 16(%r15)
	cltq
	movq	%rax, (%r15)
	xorl	%r12d, %r12d
LBB0_15:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XCHAL_NUM_AREGS,4,2            ## @XCHAL_NUM_AREGS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_flush_window_regs_user         ; -- Begin function flush_window_regs_user
	.p2align	2
_flush_window_regs_user:                ; @flush_window_regs_user
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	w8, [x0, #16]
	cmp	w8, #1
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_18
LBB0_2:
	mov	x19, x0
	ldp	x24, x21, [x0]
Lloh0:
	adrp	x22, _XCHAL_NUM_AREGS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _XCHAL_NUM_AREGS@GOTPAGEOFF]
	ldr	w9, [x22]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w25, w10, w9, lt
	asr	w9, w25, #2
	sub	w23, w9, w8, asr #4
	tbnz	w8, #1, LBB0_5
; %bb.3:
	ldr	x8, [x19, #24]
	mov	w20, #1
	mov	w9, #1
	bfi	w9, w23, #2, #30
	ldrsw	x8, [x8, w9, sxtw #2]
	sub	x1, x8, #12
	mov	x0, #0
	bl	___get_user
	cbnz	x0, LBB0_18
; %bb.4:
	ldr	w8, [x22]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w9, w8, #2
LBB0_5:
	cmp	w23, w9
	b.ge	LBB0_17
; %bb.6:
	mov	x8, #0
	lsr	x9, x24, x21
	sbfx	x10, x25, #2, #30
	sub	x10, x10, x21
	lsl	x10, x24, x10
	orr	x24, x10, x9
	mov	w20, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	lsr	x10, x24, x23
	mov	w9, #1
	tbnz	w10, #1, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	tbnz	w10, #2, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	tbnz	w10, #3, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	w9, #0
	b	LBB0_15
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	x0, x8, #32
	ldr	x8, [x19, #24]
	lsl	w9, w23, #2
	add	w9, w9, #4
	add	x1, x8, w9, sxtw #2
	mov	w2, #16
	bl	_copy_to_user
	cbnz	x0, LBB0_19
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	w9, #2
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	x0, x8, #48
	ldr	x8, [x19, #24]
	lsl	w9, w23, #2
	add	w9, w9, #4
	add	x1, x8, w9, sxtw #2
	mov	w2, #32
	bl	_copy_to_user
	cbnz	x0, LBB0_19
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	w9, #3
LBB0_15:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #24]
	add	w25, w9, w23
	mov	w9, #1
	bfi	w9, w25, #2, #30
	ldr	w10, [x22]
	sdiv	w11, w9, w10
	msub	w9, w11, w10, w9
	ldrsw	x9, [x8, w9, sxtw #2]
	sub	x0, x9, #16
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	sbfiz	x23, x23, #2, #32
	add	x1, x8, w23, sxtw #2
	mov	w2, #16
	bl	_copy_to_user
	cbnz	x0, LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #24]
	lsl	x9, x23, #2
	orr	x9, x9, #0x4
	ldrsw	x8, [x8, x9]
	ldr	w9, [x22]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w9, w10, w9, lt
	cmp	w25, w9, asr #2
	mov	x23, x25
	b.lt	LBB0_7
LBB0_17:
	mov	w20, #0
	mov	w8, #1
	str	w8, [x19, #16]
	lsl	w8, w8, w21
	sxtw	x8, w8
	str	x8, [x19]
LBB0_18:
	mov	x0, x20
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_19:
	mov	w20, #1
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_XCHAL_NUM_AREGS,4,2            ; @XCHAL_NUM_AREGS
.subsections_via_symbols
