	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_shmem_window
_setup_shmem_window:                    ## @setup_shmem_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%edx, %ebx
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	%rdi, -56(%rbp)
	movq	8(%rdi), %rdi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	callq	_PRIV
	movq	%rax, %r14
	subl	%r12d, %ebx
	shll	$8, %ebx
	cmpl	$32768, %ebx                    ## imm = 0x8000
	movl	$32768, %edi                    ## imm = 0x8000
	cmovll	%ebx, %edi
	callq	_roundup_pow_of_two
	movq	_WIN_DATA_WIDTH_16@GOTPCREL(%rip), %rcx
	movq	_WIN_MEMORY_TYPE_CM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_WIN_ENABLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	%eax, %r13d
	movq	_WIN_USE_WAIT@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, -88(%rbp)
	movq	$0, -80(%rbp)
	movl	%r13d, -84(%rbp)
	movq	_mem_speed@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -72(%rbp)
	movq	_RequestWindow@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	-56(%rbp), %rdi
	leaq	-88(%rbp), %rsi
	movq	%r15, %rdx
	callq	_pcmcia_request_window
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_CS_CHECK
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	shll	$8, %r12d
	addl	-48(%rbp), %r12d                ## 4-byte Folded Reload
	movl	%r12d, %eax
	cltd
	idivl	%r13d
	movl	%edx, %r15d
	subl	%edx, %r12d
	movl	%r12d, -112(%rbp)
	movq	$0, -104(%rbp)
	movq	_MapMemPage@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-56(%rbp), %rax
	movq	(%rax), %rdi
	leaq	-112(%rbp), %rsi
	callq	_pcmcia_map_mem_page
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_CS_CHECK
	movq	-80(%rbp), %rdi
	movl	%r13d, %esi
	callq	_ioremap
	movq	%rax, 8(%r14)
	movq	_TX_PAGES@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	shll	$8, %ecx
	movslq	%r15d, %rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	jle	LBB0_4
## %bb.1:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rsi
	xorl	%edi, %edi
	callq	___raw_writew
	movl	(%r12), %eax
	shll	$8, %eax
	cmpl	$3, %eax
	jl	LBB0_4
## %bb.2:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	8(,%rax,4), %r15
	movl	$2, %r13d
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rsi
	addq	%r15, %rsi
	movl	%ebx, %edi
	callq	___raw_writew
	addq	$2, %r13
	movl	(%r12), %eax
	shll	$8, %eax
	cltq
	addq	$8, %r15
	incl	%ebx
	cmpq	%rax, %r13
	jl	LBB0_3
LBB0_4:
	movl	$100, %edi
	callq	_udelay
	movl	(%r12), %eax
	shll	$8, %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.6:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(,%rax,4), %rbx
	movq	$-1, %r15
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rdi
	addq	%rbx, %rdi
	callq	___raw_readw
	movl	%eax, %eax
	incq	%r15
	cmpq	%rax, %r15
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	addq	$8, %rbx
	addq	$2, %r13
	movl	(%r12), %eax
	shll	$8, %eax
	cltq
	cmpq	%rax, %r13
	jl	LBB0_7
	jmp	LBB0_9
LBB0_5:
	xorl	%r13d, %r13d
LBB0_9:
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_pcnet_reset_8390
	movl	(%r12), %eax
	movl	%eax, %ecx
	shll	$8, %ecx
	movq	8(%r14), %rdi
	cmpl	%ecx, %r13d
	jne	LBB0_10
## %bb.11:
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	leaq	(%rdi,%r8,4), %rcx
	movq	_ei_status@GOTPCREL(%rip), %rdx
	movq	%rcx, 40(%rdx)
	movslq	-84(%rbp), %rsi
	movl	%esi, (%rdx)
	movq	%rcx, (%rbx)
	movq	%rsi, %rdi
	addq	%rcx, %rdi
	movq	%rdi, 8(%rbx)
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 4(%rdx)
	addl	%ecx, %eax
	movl	%eax, 8(%rdx)
	subl	%r8d, %esi
	sarl	$8, %esi
	addl	%ecx, %esi
	movl	%esi, 12(%rdx)
	movq	_shmem_get_8390_hdr@GOTPCREL(%rip), %rax
	movq	%rax, 32(%rdx)
	movq	_shmem_block_input@GOTPCREL(%rip), %rax
	movq	%rax, 24(%rdx)
	movq	_shmem_block_output@GOTPCREL(%rip), %rax
	movq	%rax, 16(%rdx)
	movq	_USE_SHMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_10:
	callq	_iounmap
	movq	-56(%rbp), %rax
	movq	(%rax), %rdi
	callq	_pcmcia_release_window
	movq	$0, 8(%r14)
	movq	-56(%rbp), %rax
	movq	$0, (%rax)
	movl	$1, %eax
LBB0_12:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WIN_DATA_WIDTH_16,4,2          ## @WIN_DATA_WIDTH_16
	.comm	_WIN_MEMORY_TYPE_CM,4,2         ## @WIN_MEMORY_TYPE_CM
	.comm	_WIN_ENABLE,4,2                 ## @WIN_ENABLE
	.comm	_WIN_USE_WAIT,4,2               ## @WIN_USE_WAIT
	.comm	_mem_speed,4,2                  ## @mem_speed
	.comm	_RequestWindow,4,2              ## @RequestWindow
	.comm	_MapMemPage,4,2                 ## @MapMemPage
	.comm	_TX_PAGES,4,2                   ## @TX_PAGES
	.comm	_ei_status,48,3                 ## @ei_status
	.comm	_shmem_get_8390_hdr,4,2         ## @shmem_get_8390_hdr
	.comm	_shmem_block_input,4,2          ## @shmem_block_input
	.comm	_shmem_block_output,4,2         ## @shmem_block_output
	.comm	_USE_SHMEM,4,2                  ## @USE_SHMEM
	.no_dead_strip	_setup_shmem_window
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_shmem_window
_setup_shmem_window:                    ; @setup_shmem_window
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x23, x3
	mov	x22, x2
	mov	x20, x1
	mov	x24, x0
	str	x0, [sp, #40]
	ldr	x21, [x0, #8]
	mov	x0, x21
	bl	_PRIV
	mov	x19, x0
	sub	w8, w22, w20
	lsl	w8, w8, #8
	mov	w9, #32768
	cmp	w8, #8, lsl #12                 ; =32768
	csel	w0, w8, w9, lt
	bl	_roundup_pow_of_two
	mov	x22, x0
Lloh0:
	adrp	x8, _WIN_DATA_WIDTH_16@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WIN_DATA_WIDTH_16@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _WIN_MEMORY_TYPE_CM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WIN_MEMORY_TYPE_CM@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _WIN_ENABLE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WIN_ENABLE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh9:
	adrp	x9, _WIN_USE_WAIT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _WIN_USE_WAIT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	xzr, [sp, #24]
Lloh12:
	adrp	x9, _mem_speed@GOTPAGE
Lloh13:
	ldr	x9, [x9, _mem_speed@GOTPAGEOFF]
	stp	w8, w0, [sp, #16]
Lloh14:
	ldr	w8, [x9]
	str	w8, [sp, #32]
Lloh15:
	adrp	x8, _RequestWindow@GOTPAGE
Lloh16:
	ldr	x8, [x8, _RequestWindow@GOTPAGEOFF]
Lloh17:
	ldr	w25, [x8]
	add	x0, sp, #40
	add	x1, sp, #16
	mov	x2, x24
	bl	_pcmcia_request_window
	mov	x1, x0
	mov	x0, x25
	bl	_CS_CHECK
	add	w8, w23, w20, lsl #8
	sdiv	w9, w8, w22
	mul	w9, w9, w22
	sub	w24, w8, w9
	str	w9, [sp]
	str	xzr, [sp, #8]
Lloh18:
	adrp	x8, _MapMemPage@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MapMemPage@GOTPAGEOFF]
Lloh20:
	ldr	w23, [x8]
	ldr	x8, [sp, #40]
	ldr	x0, [x8]
	mov	x1, sp
	bl	_pcmcia_map_mem_page
	mov	x1, x0
	mov	x0, x23
	bl	_CS_CHECK
	ldr	x0, [sp, #24]
	mov	x1, x22
	bl	_ioremap
	str	x0, [x19, #8]
Lloh21:
	adrp	x23, _TX_PAGES@GOTPAGE
Lloh22:
	ldr	x23, [x23, _TX_PAGES@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	w8, w8, #8
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	add	x1, x0, w24, sxtw #2
	mov	w0, #0
	bl	___raw_writew
	ldr	w8, [x23]
	lsl	w8, w8, #8
	cmp	w8, #3
	b.lt	LBB0_4
; %bb.2:
	sxtw	x8, w24
	lsl	x8, x8, #2
	add	x25, x8, #8
	mov	w22, #1
	mov	w26, #2
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x1, x8, x25
	mov	x0, x22
	bl	___raw_writew
	add	x26, x26, #2
	ldr	w8, [x23]
	lsl	w8, w8, #8
	add	x25, x25, #8
	add	w22, w22, #1
	cmp	x26, w8, sxtw
	b.lt	LBB0_3
LBB0_4:
	mov	w0, #100
	bl	_udelay
	ldr	w8, [x23]
	lsl	w8, w8, #8
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x22, #0
	mov	x8, x24
	sbfiz	x25, x8, #2, #32
	mov	x26, #-1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x25
	bl	___raw_readw
	add	x26, x26, #1
	cmp	x26, w0, uxtw
	b.ne	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x25, x25, #8
	add	x22, x22, #2
	ldr	w8, [x23]
	lsl	w8, w8, #8
	cmp	x22, w8, sxtw
	b.lt	LBB0_6
	b	LBB0_9
LBB0_8:
	mov	w22, #0
LBB0_9:
	mov	x0, x21
	bl	_pcnet_reset_8390
	ldr	w9, [x23]
	ldr	x8, [x19, #8]
	cmp	w22, w9, lsl #8
	b.ne	LBB0_11
; %bb.10:
	mov	w0, #0
	add	x8, x8, w24, sxtw #2
Lloh23:
	adrp	x10, _ei_status@GOTPAGE
Lloh24:
	ldr	x10, [x10, _ei_status@GOTPAGEOFF]
	str	x8, [x10, #40]
	ldrsw	x11, [sp, #20]
	str	w11, [x10]
	add	x12, x11, x8
	stp	x8, x12, [x21]
	add	w8, w9, w20
	stp	w20, w8, [x10, #4]
	sub	w8, w11, w24
	add	w8, w20, w8, asr #8
	str	w8, [x10, #12]
Lloh25:
	adrp	x8, _shmem_get_8390_hdr@GOTPAGE
Lloh26:
	ldr	x8, [x8, _shmem_get_8390_hdr@GOTPAGEOFF]
	str	x8, [x10, #32]
Lloh27:
	adrp	x8, _shmem_block_input@GOTPAGE
Lloh28:
	ldr	x8, [x8, _shmem_block_input@GOTPAGEOFF]
Lloh29:
	adrp	x9, _shmem_block_output@GOTPAGE
Lloh30:
	ldr	x9, [x9, _shmem_block_output@GOTPAGEOFF]
	stp	x9, x8, [x10, #16]
Lloh31:
	adrp	x8, _USE_SHMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _USE_SHMEM@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_12
LBB0_11:
	mov	x0, x8
	bl	_iounmap
	ldr	x8, [sp, #40]
	ldr	x0, [x8]
	bl	_pcmcia_release_window
	str	xzr, [x19, #8]
	ldr	x8, [sp, #40]
	str	xzr, [x8]
	mov	w0, #1
LBB0_12:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh21, Lloh22
	.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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_WIN_DATA_WIDTH_16,4,2          ; @WIN_DATA_WIDTH_16
	.comm	_WIN_MEMORY_TYPE_CM,4,2         ; @WIN_MEMORY_TYPE_CM
	.comm	_WIN_ENABLE,4,2                 ; @WIN_ENABLE
	.comm	_WIN_USE_WAIT,4,2               ; @WIN_USE_WAIT
	.comm	_mem_speed,4,2                  ; @mem_speed
	.comm	_RequestWindow,4,2              ; @RequestWindow
	.comm	_MapMemPage,4,2                 ; @MapMemPage
	.comm	_TX_PAGES,4,2                   ; @TX_PAGES
	.comm	_ei_status,48,3                 ; @ei_status
	.comm	_shmem_get_8390_hdr,4,2         ; @shmem_get_8390_hdr
	.comm	_shmem_block_input,4,2          ; @shmem_block_input
	.comm	_shmem_block_output,4,2         ; @shmem_block_output
	.comm	_USE_SHMEM,4,2                  ; @USE_SHMEM
	.no_dead_strip	_setup_shmem_window
.subsections_via_symbols
