	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_do_rmwstub                     ## -- Begin function do_rmwstub
	.p2align	4, 0x90
_do_rmwstub:                            ## @do_rmwstub
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_start@GOTPCREL(%rip), %rax
	movq	_stubs@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movslq	%edi, %rbx
	movq	(%rcx,%rbx,8), %rcx
	movslq	12(%rcx), %rsi
	addq	%rsi, %rsi
	addq	(%rax), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_assem_debug
	movq	(%r14), %rax
	movq	(%rax,%rbx,8), %rax
	movl	4(%rax), %edi
	movq	_out@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_set_jump_target
	movq	(%r14), %rax
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	(%rax,%rbx,8), %rax
	movl	(%rax), %r13d
	movl	16(%rax), %r12d
	movslq	12(%rax), %rdx
	movslq	20(%rax), %rcx
	movl	28(%rax), %r14d
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	(%rcx), %r15
	movq	_AGEN1@GOTPCREL(%rip), %rax
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %esi
	andl	$1, %esi
	addl	(%rax), %esi
	movq	%r15, %rdi
	callq	_get_reg
	movq	%rax, %rbx
	movl	%r12d, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	testl	%ebx, %ebx
	jns	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	movl	$-1, %esi
	callq	_get_reg
	movq	%rax, %rbx
LBB0_2:
	notl	%ebx
	shrl	$31, %ebx
	movl	%ebx, %edi
	callq	_assert
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	%r14d, %edi
	callq	_save_regs
	movl	%r12d, %edi
	movl	$1, %esi
	movl	%r12d, %edx
	callq	_emit_xorimm
	movq	_EAX@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	%r12d, %eax
	cmpl	%esi, %r12d
	je	LBB0_4
## %bb.3:
	movl	%r12d, %edi
	callq	_emit_mov
	movl	(%rbx), %eax
LBB0_4:
	movq	_ECX@GOTPCREL(%rip), %r14
	movq	_EDX@GOTPCREL(%rip), %r15
	cmpl	%eax, %r12d
	je	LBB0_7
## %bb.5:
	cmpl	(%r14), %r12d
	je	LBB0_7
## %bb.6:
	cmpl	(%r15), %r12d
	jne	LBB0_8
LBB0_7:
	movq	_ESP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %edi
	xorl	%esi, %esi
	callq	_emit_writeword_indexed
LBB0_8:
	movq	_MappedMemoryReadByte@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_emit_call
	movl	(%rbx), %edi
	movl	(%r15), %esi
	callq	_emit_mov
	movl	(%rbx), %edx
	cmpl	%edx, %r12d
	je	LBB0_11
## %bb.9:
	cmpl	(%r14), %r12d
	je	LBB0_11
## %bb.10:
	cmpl	(%r15), %r12d
	je	LBB0_11
## %bb.12:
	movl	%r12d, %edi
	movl	%edx, %esi
	callq	_emit_mov
	jmp	LBB0_13
LBB0_11:
	movq	_ESP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_emit_readword_indexed
LBB0_13:
	movq	_stubs@GOTPCREL(%rip), %r14
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	_RMWA_STUB@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_15
## %bb.14:
	movsbl	(%r15), %edi
	movq	_imm@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rbx,4), %esi
	movl	%edi, %edx
	callq	_emit_andimm
LBB0_15:
	movq	_RMWX_STUB@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_17
## %bb.16:
	movl	(%r15), %edi
	movq	_imm@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rbx,4), %esi
	movl	%edi, %edx
	callq	_emit_xorimm
LBB0_17:
	movq	_RMWO_STUB@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_19
## %bb.18:
	movl	(%r15), %edi
	movq	_imm@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rbx,4), %esi
	movl	%edi, %edx
	callq	_emit_orimm
LBB0_19:
	movq	_RMWT_STUB@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_21
## %bb.20:
	movl	(%r15), %edi
	movl	_rmw_temp@GOTPCREL(%rip), %esi
	callq	_emit_writeword
	movl	(%r15), %edi
	movl	$128, %esi
	movl	%edi, %edx
	callq	_emit_orimm
LBB0_21:
	movq	_WriteInvalidateByte@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_emit_call
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_restore_regs
	movq	_opcode2@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$11, (%rax,%rbx,4)
	jne	LBB0_23
## %bb.22:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	_SR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_get_reg
	movq	%rax, %rbx
	notb	%al
	shrb	$7, %al
	movzbl	%al, %edi
	callq	_assert
	movsbl	%bl, %ebx
	movl	%ebx, %edi
	movl	$-2, %esi
	movl	%ebx, %edx
	callq	_emit_andimm
	movl	_rmw_temp@GOTPCREL(%rip), %edi
	movl	$1, %esi
	callq	_emit_cmpmem_imm_byte
	xorl	%edi, %edi
	movl	%ebx, %esi
	callq	_emit_adcimm
LBB0_23:
	movq	(%r14), %rax
	movq	(%rax,%r12,8), %rax
	movl	8(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_emit_jmp                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"do_rmwstub %x\n"

	.comm	_start,8,3                      ## @start
	.comm	_stubs,8,3                      ## @stubs
	.comm	_out,8,3                        ## @out
	.comm	_AGEN1,4,2                      ## @AGEN1
	.comm	_EAX,4,2                        ## @EAX
	.comm	_ECX,4,2                        ## @ECX
	.comm	_EDX,4,2                        ## @EDX
	.comm	_ESP,4,2                        ## @ESP
	.comm	_MappedMemoryReadByte,8,3       ## @MappedMemoryReadByte
	.comm	_RMWA_STUB,4,2                  ## @RMWA_STUB
	.comm	_imm,8,3                        ## @imm
	.comm	_RMWX_STUB,4,2                  ## @RMWX_STUB
	.comm	_RMWO_STUB,4,2                  ## @RMWO_STUB
	.comm	_RMWT_STUB,4,2                  ## @RMWT_STUB
	.comm	_rmw_temp,4,2                   ## @rmw_temp
	.comm	_WriteInvalidateByte,8,3        ## @WriteInvalidateByte
	.comm	_opcode2,8,3                    ## @opcode2
	.comm	_SR,4,2                         ## @SR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_do_rmwstub                     ; -- Begin function do_rmwstub
	.p2align	2
_do_rmwstub:                            ; @do_rmwstub
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
Lloh0:
	adrp	x8, _start@GOTPAGE
Lloh1:
	ldr	x8, [x8, _start@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x24, _stubs@GOTPAGE
Lloh4:
	ldr	x24, [x24, _stubs@GOTPAGEOFF]
	ldr	x9, [x24]
	sbfiz	x20, x19, #3, #32
	ldr	x9, [x9, x20]
	ldrsw	x9, [x9, #12]
	add	x1, x8, x9, lsl #1
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_assem_debug
	ldr	x8, [x24]
	ldr	x8, [x8, x20]
	ldr	w0, [x8, #4]
Lloh7:
	adrp	x8, _out@GOTPAGE
Lloh8:
	ldr	x8, [x8, _out@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_set_jump_target
	ldr	x8, [x24]
	ldr	x8, [x8, x20]
	ldr	w27, [x8]
	ldp	w26, w21, [x8, #12]
                                        ; kill: def $w26 killed $w26 def $x26
	sxtw	x26, w26
	ldrsw	x25, [x8, #20]
	ldr	w20, [x8, #28]
	ldr	x22, [x25]
Lloh10:
	adrp	x8, _AGEN1@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AGEN1@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	and	w9, w26, #0x1
	add	w1, w8, w9
	mov	x0, x22
	bl	_get_reg
	mov	x23, x0
	mvn	w8, w21
	lsr	w0, w8, #31
	bl	_assert
	tbz	w23, #31, LBB0_2
; %bb.1:
	mov	x0, x22
	mov	w1, #-1
	bl	_get_reg
	mov	x23, x0
LBB0_2:
	mvn	w8, w23
	lsr	w0, w8, #31
	bl	_assert
	mov	x0, x20
	bl	_save_regs
	mov	x0, x21
	mov	w1, #1
	mov	x2, x21
	bl	_emit_xorimm
Lloh13:
	adrp	x23, _EAX@GOTPAGE
Lloh14:
	ldr	x23, [x23, _EAX@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x8, x21
	cmp	w21, w1
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_emit_mov
	ldr	w8, [x23]
LBB0_4:
Lloh15:
	adrp	x28, _ECX@GOTPAGE
Lloh16:
	ldr	x28, [x28, _ECX@GOTPAGEOFF]
	ldr	w9, [x28]
Lloh17:
	adrp	x22, _EDX@GOTPAGE
Lloh18:
	ldr	x22, [x22, _EDX@GOTPAGEOFF]
	ldr	w10, [x22]
	cmp	w21, w8
	ccmp	w21, w9, #4, ne
	ccmp	w21, w10, #4, ne
	b.ne	LBB0_6
; %bb.5:
Lloh19:
	adrp	x8, _ESP@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ESP@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w1, #0
	bl	_emit_writeword_indexed
LBB0_6:
Lloh22:
	adrp	x8, _MappedMemoryReadByte@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MappedMemoryReadByte@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	_emit_call
	ldr	w0, [x23]
	ldr	w1, [x22]
	bl	_emit_mov
	ldr	w2, [x23]
	cmp	w21, w2
	b.eq	LBB0_10
; %bb.7:
	ldr	w8, [x28]
	cmp	w21, w8
	b.eq	LBB0_10
; %bb.8:
	ldr	w8, [x22]
	cmp	w21, w8
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x21
	mov	x1, x2
	bl	_emit_mov
	b	LBB0_11
LBB0_10:
Lloh25:
	adrp	x8, _ESP@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ESP@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_emit_readword_indexed
LBB0_11:
Lloh28:
	adrp	x8, _RMWA_STUB@GOTPAGE
Lloh29:
	ldr	x8, [x8, _RMWA_STUB@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	cmp	w27, w8
	b.ne	LBB0_13
; %bb.12:
	ldrsb	w0, [x22]
Lloh31:
	adrp	x8, _imm@GOTPAGE
Lloh32:
	ldr	x8, [x8, _imm@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
	ldr	w1, [x8, x26, lsl #2]
	mov	x2, x0
	bl	_emit_andimm
LBB0_13:
Lloh34:
	adrp	x8, _RMWX_STUB@GOTPAGE
Lloh35:
	ldr	x8, [x8, _RMWX_STUB@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	cmp	w27, w8
	b.ne	LBB0_15
; %bb.14:
	ldr	w0, [x22]
Lloh37:
	adrp	x8, _imm@GOTPAGE
Lloh38:
	ldr	x8, [x8, _imm@GOTPAGEOFF]
Lloh39:
	ldr	x8, [x8]
	ldr	w1, [x8, x26, lsl #2]
	mov	x2, x0
	bl	_emit_xorimm
LBB0_15:
Lloh40:
	adrp	x8, _RMWO_STUB@GOTPAGE
Lloh41:
	ldr	x8, [x8, _RMWO_STUB@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	cmp	w27, w8
	b.ne	LBB0_17
; %bb.16:
	ldr	w0, [x22]
Lloh43:
	adrp	x8, _imm@GOTPAGE
Lloh44:
	ldr	x8, [x8, _imm@GOTPAGEOFF]
Lloh45:
	ldr	x8, [x8]
	ldr	w1, [x8, x26, lsl #2]
	mov	x2, x0
	bl	_emit_orimm
LBB0_17:
Lloh46:
	adrp	x8, _RMWT_STUB@GOTPAGE
Lloh47:
	ldr	x8, [x8, _RMWT_STUB@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	cmp	w27, w8
	b.ne	LBB0_19
; %bb.18:
	ldr	w0, [x22]
Lloh49:
	adrp	x1, _rmw_temp@GOTPAGE
Lloh50:
	ldr	x1, [x1, _rmw_temp@GOTPAGEOFF]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_emit_writeword
	ldr	w0, [x22]
	mov	w1, #128
	mov	x2, x0
	bl	_emit_orimm
LBB0_19:
	sxtw	x21, w19
Lloh51:
	adrp	x8, _WriteInvalidateByte@GOTPAGE
Lloh52:
	ldr	x8, [x8, _WriteInvalidateByte@GOTPAGEOFF]
Lloh53:
	ldr	w0, [x8]
	bl	_emit_call
	mov	x0, x20
	bl	_restore_regs
Lloh54:
	adrp	x8, _opcode2@GOTPAGE
Lloh55:
	ldr	x8, [x8, _opcode2@GOTPAGEOFF]
Lloh56:
	ldr	x8, [x8]
	ldr	w8, [x8, x26, lsl #2]
	cmp	w8, #11
	b.ne	LBB0_21
; %bb.20:
	ldr	x0, [x25]
Lloh57:
	adrp	x8, _SR@GOTPAGE
Lloh58:
	ldr	x8, [x8, _SR@GOTPAGEOFF]
Lloh59:
	ldr	w1, [x8]
	bl	_get_reg
	mov	x19, x0
	mvn	w8, w19
	ubfx	w0, w8, #7, #1
	bl	_assert
	sxtb	w19, w19
	mov	x0, x19
	mov	w1, #-2
	mov	x2, x19
	bl	_emit_andimm
Lloh60:
	adrp	x0, _rmw_temp@GOTPAGE
Lloh61:
	ldr	x0, [x0, _rmw_temp@GOTPAGEOFF]
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w1, #1
	bl	_emit_cmpmem_imm_byte
	mov	w0, #0
	mov	x1, x19
	bl	_emit_adcimm
LBB0_21:
	ldr	x8, [x24]
	ldr	x8, [x8, x21, lsl #3]
	ldr	w0, [x8, #8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_emit_jmp
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"do_rmwstub %x\n"

	.comm	_start,8,3                      ; @start
	.comm	_stubs,8,3                      ; @stubs
	.comm	_out,8,3                        ; @out
	.comm	_AGEN1,4,2                      ; @AGEN1
	.comm	_EAX,4,2                        ; @EAX
	.comm	_ECX,4,2                        ; @ECX
	.comm	_EDX,4,2                        ; @EDX
	.comm	_ESP,4,2                        ; @ESP
	.comm	_MappedMemoryReadByte,8,3       ; @MappedMemoryReadByte
	.comm	_RMWA_STUB,4,2                  ; @RMWA_STUB
	.comm	_imm,8,3                        ; @imm
	.comm	_RMWX_STUB,4,2                  ; @RMWX_STUB
	.comm	_RMWO_STUB,4,2                  ; @RMWO_STUB
	.comm	_RMWT_STUB,4,2                  ; @RMWT_STUB
	.comm	_rmw_temp,4,2                   ; @rmw_temp
	.comm	_WriteInvalidateByte,8,3        ; @WriteInvalidateByte
	.comm	_opcode2,8,3                    ; @opcode2
	.comm	_SR,4,2                         ; @SR
.subsections_via_symbols
