	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function remap_window
_remap_window:                          ## @remap_window
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	8(%rdi), %r12
	movl	(%rdi), %r14d
	movl	24(%r12), %edi
	callq	_pcmcia_dev_present
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%r12), %eax
	movl	%eax, %ecx
	negl	%ecx
	movslq	%ecx, %rcx
	andq	%r15, %rcx
	movq	%rcx, -48(%rbp)
	movq	8(%r12), %rdx
	cmpq	%rdx, %rcx
	je	LBB0_6
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edi
	xorl	%eax, %eax
	callq	_DEBUG
	movq	$0, -40(%rbp)
	leaq	-48(%rbp), %rsi
	movl	%r14d, %edi
	callq	_pcmcia_map_mem_page
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	24(%r12), %edi
	movq	_MapMemPage@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edx
	callq	_cs_error
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DEBUG
	jmp	LBB0_7
LBB0_5:
	movq	-48(%rbp), %rax
	movq	%rax, 8(%r12)
	movl	(%r12), %eax
LBB0_6:
	decl	%eax
	movslq	%eax, %rbx
	andq	%r15, %rbx
	shlq	$2, %rbx
	addq	16(%r12), %rbx
LBB0_7:
	movq	%rbx, %rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"device removed"

L_.str.1:                               ## @.str.1
	.asciz	"Remapping window from 0x%8.8x to 0x%8.8x"

	.comm	_MapMemPage,4,2                 ## @MapMemPage
	.no_dead_strip	_remap_window
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function remap_window
_remap_window:                          ; @remap_window
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	ldr	x21, [x0, #8]
	ldr	w20, [x0]
	ldr	w0, [x21, #24]
	bl	_pcmcia_dev_present
	cbz	w0, LBB0_4
; %bb.1:
	ldr	w8, [x21]
	neg	w9, w8
	sxtw	x9, w9
	and	x9, x9, x19
	str	x9, [sp, #16]
	ldr	x10, [x21, #8]
	cmp	x9, x10
	b.eq	LBB0_6
; %bb.2:
	stp	x10, x9, [sp]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #2
	bl	_DEBUG
	str	xzr, [sp, #24]
	add	x1, sp, #16
	mov	x0, x20
	bl	_pcmcia_map_mem_page
	cbz	w0, LBB0_5
; %bb.3:
	mov	x2, x0
	ldr	w0, [x21, #24]
Lloh2:
	adrp	x8, _MapMemPage@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MapMemPage@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_cs_error
	mov	x0, #0
	b	LBB0_7
LBB0_4:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	mov	x0, #0
	b	LBB0_7
LBB0_5:
	ldr	x8, [sp, #16]
	str	x8, [x21, #8]
	ldr	w8, [x21]
LBB0_6:
	ldr	x9, [x21, #16]
	sub	w8, w8, #1
	sxtw	x8, w8
	and	x8, x8, x19
	add	x0, x9, x8, lsl #2
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"device removed"

l_.str.1:                               ; @.str.1
	.asciz	"Remapping window from 0x%8.8x to 0x%8.8x"

	.comm	_MapMemPage,4,2                 ; @MapMemPage
	.no_dead_strip	_remap_window
.subsections_via_symbols
