	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cardu_get_mem_map
_cardu_get_mem_map:                     ## @cardu_get_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %r14d
	cmpl	$5, %r14d
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_2:
	movq	%rsi, %r15
	movq	_cardu_sockets@GOTPCREL(%rip), %rax
	movl	%edi, %r12d
	shlq	$2, %r12
	addq	(%rax), %r12
	movq	_ADR_WIN_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_exca_readb
	movl	%eax, %ebx
	movl	%r14d, %edi
	callq	_MEM_WIN_EN
	andl	%ebx, %eax
	je	LBB0_4
## %bb.3:
	movq	_MAP_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	movl	%eax, 16(%r15)
	movl	%r14d, %edi
	callq	_MEM_WIN_SA
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_exca_readw
	movl	%eax, %ebx
	movq	_MEM_WIN_DSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	je	LBB0_6
## %bb.5:
	movq	_MAP_16BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_6:
	orl	%eax, 16(%r15)
	shll	$12, %ebx
	movl	%r14d, %edi
	callq	_MEM_WIN_EA
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_exca_readw
	movl	%r14d, %edi
	callq	_MEM_WIN_OA
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_exca_readw
	movq	_MEM_WIN_WP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	je	LBB0_8
## %bb.7:
	movq	_MAP_WRPROT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_8:
	orl	16(%r15), %ecx
	andl	$16773120, %ebx                 ## imm = 0xFFF000
	movq	_MEM_WIN_REGSET@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	%eax, %edx
	je	LBB0_10
## %bb.9:
	movq	_MAP_ATTRIB@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_10:
	orl	%ecx, %edx
	movl	%edx, 16(%r15)
	shll	$12, %eax
	addl	%ebx, %eax
	andl	$67104768, %eax                 ## imm = 0x3FFF000
	movl	%eax, 4(%r15)
	movl	%r14d, %edi
	callq	_MEM_WIN_SAU
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_exca_readb
	shll	$24, %eax
	orl	%ebx, %eax
	movl	%eax, 8(%r15)
	movl	%eax, 12(%r15)
	xorl	%eax, %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	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_ACTIVE,4,2                 ## @MAP_ACTIVE
	.comm	_MEM_WIN_DSIZE,4,2              ## @MEM_WIN_DSIZE
	.comm	_MAP_16BIT,4,2                  ## @MAP_16BIT
	.comm	_MEM_WIN_WP,4,2                 ## @MEM_WIN_WP
	.comm	_MAP_WRPROT,4,2                 ## @MAP_WRPROT
	.comm	_MEM_WIN_REGSET,4,2             ## @MEM_WIN_REGSET
	.comm	_MAP_ATTRIB,4,2                 ## @MAP_ATTRIB
	.no_dead_strip	_cardu_get_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_get_mem_map
_cardu_get_mem_map:                     ; @cardu_get_mem_map
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w20, [x1]
	cmp	w20, #5
	b.lt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	mov	x19, x1
Lloh3:
	adrp	x8, _cardu_sockets@GOTPAGE
Lloh4:
	ldr	x8, [x8, _cardu_sockets@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x21, x8, w0, uxtw #2
Lloh6:
	adrp	x8, _ADR_WIN_EN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ADR_WIN_EN@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_exca_readb
	mov	x22, x0
	mov	x0, x20
	bl	_MEM_WIN_EN
Lloh9:
	adrp	x8, _MAP_ACTIVE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAP_ACTIVE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w0, w22
	csel	w8, wzr, w8, eq
	str	w8, [x19, #16]
	mov	x0, x20
	bl	_MEM_WIN_SA
	mov	x1, x0
	mov	x0, x21
	bl	_exca_readw
Lloh12:
	adrp	x8, _MEM_WIN_DSIZE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MEM_WIN_DSIZE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _MAP_16BIT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MAP_16BIT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w8, w0
	csel	w8, wzr, w9, eq
	ldr	w9, [x19, #16]
	orr	w8, w8, w9
	str	w8, [x19, #16]
	ubfiz	w22, w0, #12, #12
	mov	x0, x20
	bl	_MEM_WIN_EA
	mov	x1, x0
	mov	x0, x21
	bl	_exca_readw
	mov	x0, x20
	bl	_MEM_WIN_OA
	mov	x1, x0
	mov	x0, x21
	bl	_exca_readw
Lloh18:
	adrp	x8, _MEM_WIN_WP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MEM_WIN_WP@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _MAP_WRPROT@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MAP_WRPROT@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w8, w0
	csel	w8, wzr, w9, eq
	ldr	w9, [x19, #16]
Lloh24:
	adrp	x10, _MEM_WIN_REGSET@GOTPAGE
Lloh25:
	ldr	x10, [x10, _MEM_WIN_REGSET@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh26:
	ldr	w9, [x10]
Lloh27:
	adrp	x10, _MAP_ATTRIB@GOTPAGE
Lloh28:
	ldr	x10, [x10, _MAP_ATTRIB@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	tst	w9, w0
	csel	w9, wzr, w10, eq
	orr	w8, w9, w8
	str	w8, [x19, #16]
	add	w8, w22, w0, lsl #12
	and	w8, w8, #0x3fff000
	str	w8, [x19, #4]
	mov	x0, x20
	bl	_MEM_WIN_SAU
	mov	x1, x0
	mov	x0, x21
	bl	_exca_readb
	mov	x8, x0
	mov	w0, #0
	bfi	w22, w8, #24, #8
	stp	w22, w22, [x19, #8]
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.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_ACTIVE,4,2                 ; @MAP_ACTIVE
	.comm	_MEM_WIN_DSIZE,4,2              ; @MEM_WIN_DSIZE
	.comm	_MAP_16BIT,4,2                  ; @MAP_16BIT
	.comm	_MEM_WIN_WP,4,2                 ; @MEM_WIN_WP
	.comm	_MAP_WRPROT,4,2                 ; @MAP_WRPROT
	.comm	_MEM_WIN_REGSET,4,2             ; @MEM_WIN_REGSET
	.comm	_MAP_ATTRIB,4,2                 ; @MAP_ATTRIB
	.no_dead_strip	_cardu_get_mem_map
.subsections_via_symbols
