	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vrc4171_add_sockets
_vrc4171_add_sockets:                   ## @vrc4171_add_sockets
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_CARD_MAX_SLOTS@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_13
## %bb.1:
	xorl	%r12d, %r12d
	movq	_CARD_SLOTB@GOTPCREL(%rip), %r13
	xorl	%ebx, %ebx
	jmp	LBB0_2
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_I365_ADDRWIN@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	%ebx, %edi
	callq	_exca_read_byte
	andl	$31, %eax
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r14), %esi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_exca_write_byte
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %edi
	callq	_reserve_using_irq
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	addq	$40, %r12
	cmpq	%rax, %rbx
	jge	LBB0_13
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %eax
	cmpq	%rax, %rbx
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_vrc4171_slotb@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_SLOTB_IS_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_vrc4171_sockets@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movl	(%r14,%r12), %eax
	movq	_SLOT_PROBE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	32(%r14,%r12), %edi
	leal	65(%rbx), %eax
	movsbl	%al, %edx
	leaq	L_.str(%rip), %rsi
	callq	_sprintf
	leaq	(%r14,%r12), %rdi
	addq	$8, %rdi
	movq	_vrc4171_card_device@GOTPCREL(%rip), %rax
	movq	%rax, 24(%r14,%r12)
	movq	_vrc4171_pccard_operations@GOTPCREL(%rip), %rax
	movq	%rax, 16(%r14,%r12)
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14,%r12)
	callq	_pcmcia_register_socket
	testl	%eax, %eax
	js	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_I365_ADDRWIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_exca_write_byte
	movq	_GLOBAL_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	xorl	%edx, %edx
	callq	_exca_write_byte
	movq	_SLOT_INITIALIZED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14,%r12)
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$128, %eax
	je	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$129, %eax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_I365_ADDRWIN@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	%ebx, %edi
	callq	_exca_read_byte
	andl	$192, %eax
	jmp	LBB0_8
LBB0_13:
	xorl	%eax, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CARD_MAX_SLOTS,4,2             ## @CARD_MAX_SLOTS
	.comm	_CARD_SLOTB,4,2                 ## @CARD_SLOTB
	.comm	_vrc4171_slotb,8,3              ## @vrc4171_slotb
	.comm	_SLOTB_IS_NONE,8,3              ## @SLOTB_IS_NONE
	.comm	_vrc4171_sockets,8,3            ## @vrc4171_sockets
	.comm	_SLOT_PROBE,4,2                 ## @SLOT_PROBE
	.comm	_I365_ADDRWIN,4,2               ## @I365_ADDRWIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"NEC VRC4171 Card Slot %1c"

	.comm	_vrc4171_card_device,4,2        ## @vrc4171_card_device
	.comm	_vrc4171_pccard_operations,4,2  ## @vrc4171_pccard_operations
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_GLOBAL_CONTROL,4,2             ## @GLOBAL_CONTROL
	.comm	_SLOT_INITIALIZED,4,2           ## @SLOT_INITIALIZED
	.no_dead_strip	_vrc4171_add_sockets
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vrc4171_add_sockets
_vrc4171_add_sockets:                   ; @vrc4171_add_sockets
	.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
Lloh0:
	adrp	x22, _CARD_MAX_SLOTS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CARD_MAX_SLOTS@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x23, #0
	mov	x19, #0
Lloh2:
	adrp	x24, _CARD_SLOTB@GOTPAGE
Lloh3:
	ldr	x24, [x24, _CARD_SLOTB@GOTPAGEOFF]
Lloh4:
	adrp	x26, _SLOTB_IS_NONE@GOTPAGE
Lloh5:
	ldr	x26, [x26, _SLOTB_IS_NONE@GOTPAGEOFF]
Lloh6:
	adrp	x27, _vrc4171_sockets@GOTPAGE
Lloh7:
	ldr	x27, [x27, _vrc4171_sockets@GOTPAGEOFF]
Lloh8:
	adrp	x28, _SLOT_PROBE@GOTPAGE
Lloh9:
	ldr	x28, [x28, _SLOT_PROBE@GOTPAGEOFF]
Lloh10:
	adrp	x20, _I365_ADDRWIN@GOTPAGE
Lloh11:
	ldr	x20, [x20, _I365_ADDRWIN@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x20]
	mov	x0, x19
	bl	_exca_read_byte
	and	w2, w0, #0x1f
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x20]
	mov	x0, x19
	bl	_exca_write_byte
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	bl	_reserve_using_irq
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x19, x19, #1
	ldrsw	x8, [x22]
	add	x23, x23, #40
	cmp	x19, x8
	b.ge	LBB0_14
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	cmp	x19, x8
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh12:
	adrp	x8, _vrc4171_slotb@GOTPAGE
Lloh13:
	ldr	x8, [x8, _vrc4171_slotb@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	ldr	x9, [x26]
	cmp	x8, x9
	b.eq	LBB0_5
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x25, [x27]
	ldr	w8, [x25, x23]
	ldr	w9, [x28]
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x21, x25, x23
	ldr	w0, [x21, #32]
	add	w8, w19, #65
	sxtb	w2, w8
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_sprintf
Lloh17:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x21, #8]!
Lloh20:
	adrp	x8, _vrc4171_card_device@GOTPAGE
Lloh21:
	ldr	x8, [x8, _vrc4171_card_device@GOTPAGEOFF]
	str	x8, [x21, #16]
Lloh22:
	adrp	x8, _vrc4171_pccard_operations@GOTPAGE
Lloh23:
	ldr	x8, [x8, _vrc4171_pccard_operations@GOTPAGEOFF]
	str	x8, [x21, #8]
	mov	x0, x21
	bl	_pcmcia_register_socket
	tbnz	w0, #31, LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_exca_write_byte
Lloh24:
	adrp	x8, _GLOBAL_CONTROL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GLOBAL_CONTROL@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_exca_write_byte
Lloh27:
	adrp	x8, _SLOT_INITIALIZED@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SLOT_INITIALIZED@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	str	w8, [x25, x23]
	b	LBB0_5
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w8, #128
	b.eq	LBB0_2
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w8, #129
	b.ne	LBB0_4
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x20]
	mov	x0, x19
	bl	_exca_read_byte
	and	w2, w0, #0xc0
	b	LBB0_3
LBB0_14:
	mov	w0, #0
LBB0_15:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_CARD_MAX_SLOTS,4,2             ; @CARD_MAX_SLOTS
	.comm	_CARD_SLOTB,4,2                 ; @CARD_SLOTB
	.comm	_vrc4171_slotb,8,3              ; @vrc4171_slotb
	.comm	_SLOTB_IS_NONE,8,3              ; @SLOTB_IS_NONE
	.comm	_vrc4171_sockets,8,3            ; @vrc4171_sockets
	.comm	_SLOT_PROBE,4,2                 ; @SLOT_PROBE
	.comm	_I365_ADDRWIN,4,2               ; @I365_ADDRWIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"NEC VRC4171 Card Slot %1c"

	.comm	_vrc4171_card_device,4,2        ; @vrc4171_card_device
	.comm	_vrc4171_pccard_operations,4,2  ; @vrc4171_pccard_operations
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_GLOBAL_CONTROL,4,2             ; @GLOBAL_CONTROL
	.comm	_SLOT_INITIALIZED,4,2           ; @SLOT_INITIALIZED
	.no_dead_strip	_vrc4171_add_sockets
.subsections_via_symbols
