	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cardu_set_mem_map
_cardu_set_mem_map:                     ## @cardu_set_mem_map
	.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
	movl	(%rsi), %r15d
	cmpl	$4, %r15d
	jg	LBB0_4
## %bb.1:
	movq	%rsi, %rbx
	movl	4(%rsi), %ecx
	movl	8(%rsi), %r13d
	cmpl	%r13d, %ecx
	jg	LBB0_4
## %bb.2:
	movl	%r13d, %eax
	xorl	%ecx, %eax
	cmpl	$16777215, %eax                 ## imm = 0xFFFFFF
	ja	LBB0_4
## %bb.3:
	movl	12(%rbx), %eax
	cmpl	$67108864, %eax                 ## imm = 0x4000000
	jae	LBB0_4
## %bb.5:
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_cardu_sockets@GOTPCREL(%rip), %rax
	movl	%edi, %r14d
	shlq	$2, %r14
	addq	(%rax), %r14
	movq	_ADR_WIN_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_exca_readb
	movl	%eax, %r12d
	movl	%r15d, %edi
	callq	_MEM_WIN_EN
	testl	%r12d, %eax
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	je	LBB0_6
## %bb.7:
	notl	%eax
	andl	%eax, %r12d
	movq	_ADR_WIN_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	%r12d, %edx
	callq	_exca_writeb
	jmp	LBB0_8
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_6:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
LBB0_8:
	movl	%r15d, %edi
	callq	_MEM_WIN_SAU
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	sarl	$24, %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_exca_writeb
	movl	%ebx, %eax
	shrl	$12, %eax
	andl	$4095, %eax                     ## imm = 0xFFF
	movq	_MAP_16BIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	andl	16(%r12), %ebx
	je	LBB0_10
## %bb.9:
	movq	_MEM_WIN_DSIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
LBB0_10:
	orl	%eax, %ebx
	movl	%r15d, %edi
	callq	_MEM_WIN_SA
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_exca_writew
	shrl	$12, %r13d
	andl	$4095, %r13d                    ## imm = 0xFFF
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	movl	%r15d, %edi
	callq	_MEM_WIN_EA
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%r13d, %edx
	callq	_exca_writew
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	subl	-48(%rbp), %edx                 ## 4-byte Folded Reload
	shrl	$12, %edx
	andl	$16383, %edx                    ## imm = 0x3FFF
	movl	16(%r12), %eax
	movq	_MAP_WRPROT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	andl	%eax, %ebx
	je	LBB0_12
## %bb.11:
	movq	_MEM_WIN_WP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
LBB0_12:
	orl	%edx, %ebx
	movq	_MAP_ATTRIB@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	je	LBB0_14
## %bb.13:
	movq	_MEM_WIN_REGSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_14:
	orl	%eax, %ebx
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	callq	_MEM_WIN_OA
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_exca_writew
	movq	_MAP_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	testl	%eax, 16(%r12)
	movq	_ADR_WIN_EN@GOTPCREL(%rip), %rax
	je	LBB0_16
## %bb.15:
	movl	(%rax), %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	orl	-52(%rbp), %edx                 ## 4-byte Folded Reload
	movq	%r14, %rdi
	callq	_exca_writeb
LBB0_16:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cardu_sockets,8,3              ## @cardu_sockets
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ADR_WIN_EN,4,2                 ## @ADR_WIN_EN
	.comm	_MAP_16BIT,4,2                  ## @MAP_16BIT
	.comm	_MEM_WIN_DSIZE,4,2              ## @MEM_WIN_DSIZE
	.comm	_MAP_WRPROT,4,2                 ## @MAP_WRPROT
	.comm	_MEM_WIN_WP,4,2                 ## @MEM_WIN_WP
	.comm	_MAP_ATTRIB,4,2                 ## @MAP_ATTRIB
	.comm	_MEM_WIN_REGSET,4,2             ## @MEM_WIN_REGSET
	.comm	_MAP_ACTIVE,4,2                 ## @MAP_ACTIVE
	.no_dead_strip	_cardu_set_mem_map
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cardu_set_mem_map
_cardu_set_mem_map:                     ; @cardu_set_mem_map
	.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
	ldp	w21, w26, [x1]
	ldp	w28, w27, [x1, #8]
	eor	w8, w28, w26
	cmp	w21, #4
	ccmp	w26, w28, #0, le
	lsr	w8, w8, #24
	ccmp	w8, #0, #0, le
	lsr	w8, w27, #26
	ccmp	w8, #0, #0, eq
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_2:
	mov	x19, x1
Lloh3:
	adrp	x8, _cardu_sockets@GOTPAGE
Lloh4:
	ldr	x8, [x8, _cardu_sockets@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x20, x8, w0, uxtw #2
Lloh6:
	adrp	x25, _ADR_WIN_EN@GOTPAGE
Lloh7:
	ldr	x25, [x25, _ADR_WIN_EN@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x20
	bl	_exca_readb
	mov	x22, x0
	mov	x0, x21
	bl	_MEM_WIN_EN
	mov	x23, x0
	tst	w0, w22
	b.eq	LBB0_4
; %bb.3:
	bic	w22, w22, w23
	ldr	w1, [x25]
	mov	x0, x20
	mov	x2, x22
	bl	_exca_writeb
LBB0_4:
	mov	x0, x21
	bl	_MEM_WIN_SAU
	mov	x1, x0
	asr	w2, w26, #24
	mov	x0, x20
	bl	_exca_writeb
	ubfx	w8, w26, #12, #12
	ldr	w9, [x19, #16]
Lloh8:
	adrp	x10, _MAP_16BIT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _MAP_16BIT@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
Lloh11:
	adrp	x11, _MEM_WIN_DSIZE@GOTPAGE
Lloh12:
	ldr	x11, [x11, _MEM_WIN_DSIZE@GOTPAGEOFF]
Lloh13:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w9, wzr, w11, eq
	orr	w24, w9, w8
	mov	x0, x21
	bl	_MEM_WIN_SA
	mov	x1, x0
	mov	x0, x20
	mov	x2, x24
	bl	_exca_writew
	ubfx	w24, w28, #12, #12
	mov	x0, x21
	bl	_MEM_WIN_EA
	mov	x1, x0
	mov	x0, x20
	mov	x2, x24
	bl	_exca_writew
	sub	w8, w27, w26
	ubfx	w8, w8, #12, #14
	ldr	w9, [x19, #16]
Lloh14:
	adrp	x10, _MAP_WRPROT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _MAP_WRPROT@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
Lloh17:
	adrp	x11, _MEM_WIN_WP@GOTPAGE
Lloh18:
	ldr	x11, [x11, _MEM_WIN_WP@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w10, wzr, w11, eq
	orr	w8, w10, w8
Lloh20:
	adrp	x10, _MAP_ATTRIB@GOTPAGE
Lloh21:
	ldr	x10, [x10, _MAP_ATTRIB@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
Lloh23:
	adrp	x11, _MEM_WIN_REGSET@GOTPAGE
Lloh24:
	ldr	x11, [x11, _MEM_WIN_REGSET@GOTPAGEOFF]
Lloh25:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w9, wzr, w11, eq
	orr	w24, w8, w9
	mov	x0, x21
	bl	_MEM_WIN_OA
	mov	x1, x0
	mov	x0, x20
	mov	x2, x24
	bl	_exca_writew
	ldr	w8, [x19, #16]
Lloh26:
	adrp	x9, _MAP_ACTIVE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MAP_ACTIVE@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	ldr	w1, [x25]
	orr	w2, w22, w23
	mov	x0, x20
	bl	_exca_writeb
LBB0_6:
	mov	w0, #0
LBB0_7:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.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
	.cfi_endproc
                                        ; -- End function
	.comm	_cardu_sockets,8,3              ; @cardu_sockets
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ADR_WIN_EN,4,2                 ; @ADR_WIN_EN
	.comm	_MAP_16BIT,4,2                  ; @MAP_16BIT
	.comm	_MEM_WIN_DSIZE,4,2              ; @MEM_WIN_DSIZE
	.comm	_MAP_WRPROT,4,2                 ; @MAP_WRPROT
	.comm	_MEM_WIN_WP,4,2                 ; @MEM_WIN_WP
	.comm	_MAP_ATTRIB,4,2                 ; @MAP_ATTRIB
	.comm	_MEM_WIN_REGSET,4,2             ; @MEM_WIN_REGSET
	.comm	_MAP_ACTIVE,4,2                 ; @MAP_ACTIVE
	.no_dead_strip	_cardu_set_mem_map
.subsections_via_symbols
