	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cardu_get_io_map
_cardu_get_io_map:                      ## @cardu_get_io_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), %r15d
	cmpl	$2, %r15d
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_2:
	movq	%rsi, %r14
	movq	_cardu_sockets@GOTPCREL(%rip), %rax
	movl	%edi, %ebx
	shlq	$2, %rbx
	addq	(%rax), %rbx
	movl	%r15d, %edi
	callq	_IO_WIN_SA
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_exca_readw
	movq	%rax, 16(%r14)
	movl	%r15d, %edi
	callq	_IO_WIN_EA
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_exca_readw
	movq	%rax, 8(%r14)
	movq	_IO_WIN_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_exca_readb
	movl	%eax, %r12d
	movq	_ADR_WIN_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_exca_readb
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_IO_WIN_EN
	andl	%ebx, %eax
	je	LBB0_4
## %bb.3:
	movq	_MAP_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	movl	%eax, 4(%r14)
	movl	%r15d, %edi
	callq	_IO_WIN_DATA_AUTOSZ
	testl	%r12d, %eax
	je	LBB0_6
## %bb.5:
	movq	_MAP_AUTOSZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r14)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_6:
	movl	%r15d, %edi
	callq	_IO_WIN_DATA_16BIT
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%r12d, %ecx
	je	LBB0_8
## %bb.7:
	movq	_MAP_16BIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 4(%r14)
LBB0_8:
	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	_IO_WIN_CNT,4,2                 ## @IO_WIN_CNT
	.comm	_ADR_WIN_EN,4,2                 ## @ADR_WIN_EN
	.comm	_MAP_ACTIVE,4,2                 ## @MAP_ACTIVE
	.comm	_MAP_AUTOSZ,4,2                 ## @MAP_AUTOSZ
	.comm	_MAP_16BIT,4,2                  ## @MAP_16BIT
	.no_dead_strip	_cardu_get_io_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_io_map
_cardu_get_io_map:                      ; @cardu_get_io_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, #2
	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_7
LBB0_2:
	mov	x19, x1
Lloh3:
	adrp	x8, _cardu_sockets@GOTPAGE
Lloh4:
	ldr	x8, [x8, _cardu_sockets@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x22, x8, w0, uxtw #2
	mov	x0, x20
	bl	_IO_WIN_SA
	mov	x1, x0
	mov	x0, x22
	bl	_exca_readw
	str	x0, [x19, #16]
	mov	x0, x20
	bl	_IO_WIN_EA
	mov	x1, x0
	mov	x0, x22
	bl	_exca_readw
	str	x0, [x19, #8]
Lloh6:
	adrp	x8, _IO_WIN_CNT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IO_WIN_CNT@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_exca_readb
	mov	x21, x0
Lloh9:
	adrp	x8, _ADR_WIN_EN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ADR_WIN_EN@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_exca_readb
	mov	x22, x0
	mov	x0, x20
	bl	_IO_WIN_EN
Lloh12:
	adrp	x8, _MAP_ACTIVE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAP_ACTIVE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	tst	w0, w22
	csel	w8, wzr, w8, eq
	str	w8, [x19, #4]
	mov	x0, x20
	bl	_IO_WIN_DATA_AUTOSZ
	tst	w0, w21
	b.eq	LBB0_4
; %bb.3:
	mov	w0, #0
Lloh15:
	adrp	x8, _MAP_AUTOSZ@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MAP_AUTOSZ@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	mov	x0, x20
	bl	_IO_WIN_DATA_16BIT
	tst	w0, w21
	b.eq	LBB0_8
; %bb.5:
	mov	w0, #0
Lloh17:
	adrp	x8, _MAP_16BIT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MAP_16BIT@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
LBB0_7:
	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
LBB0_8:
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_cardu_sockets,8,3              ; @cardu_sockets
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IO_WIN_CNT,4,2                 ; @IO_WIN_CNT
	.comm	_ADR_WIN_EN,4,2                 ; @ADR_WIN_EN
	.comm	_MAP_ACTIVE,4,2                 ; @MAP_ACTIVE
	.comm	_MAP_AUTOSZ,4,2                 ; @MAP_AUTOSZ
	.comm	_MAP_16BIT,4,2                  ; @MAP_16BIT
	.no_dead_strip	_cardu_get_io_map
.subsections_via_symbols
