	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_memcpy_fromshmem               ## -- Begin function memcpy_fromshmem
	.p2align	4, 0x90
_memcpy_fromshmem:                      ## @memcpy_fromshmem
	.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	%rcx, %r14
	movq	%rdx, %r12
	movq	%rsi, %r15
	movl	%edi, %ebx
	callq	_IS_VALID_CARD
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	movq	_SRAM_PAGESIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	cmpq	%r14, %rcx
	jae	LBB0_2
## %bb.6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_debug                       ## TAILCALL
LBB0_2:
	movq	%r12, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.4:
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r13
	jmp	LBB0_5
LBB0_3:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r13d
LBB0_5:
	movq	_sc_adapter@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %r15
	movq	(%rax,%r15,8), %rax
	movl	16(%rax), %esi
	movzbl	%r13b, %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_sc_adapter@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rax,%r15,8), %rdi
	addq	$20, %rdi
	callq	_spin_lock_irqsave
	movq	(%rbx), %rax
	movq	(%rax,%r15,8), %rax
	movzbl	(%rax), %ecx
	movzbl	%r13b, %ebx
	movq	_SRAM_PAGESIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	imull	%ebx, %edx
	addl	%ecx, %edx
	shrl	$14, %edx
	orb	$-128, %dl
	movq	8(%rax), %rcx
	movq	32(%rax), %rax
	movl	(%rax,%rcx,4), %esi
	movzbl	%dl, %edi
	callq	_outb
	movq	_sc_adapter@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	(%rax,%r15,8), %rax
	andl	$16383, %r12d                   ## imm = 0x3FFF
	addq	24(%rax), %r12
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r14, %rdx
	callq	_memcpy_fromio
	movq	(%r13), %rax
	movq	(%rax,%r15,8), %rdi
	addq	$20, %rdi
	callq	_spin_unlock_irqrestore
	movq	(%r13), %rax
	movq	(%rax,%r15,8), %rax
	movl	16(%rax), %esi
	movzbl	(%rax), %eax
	movq	_SRAM_PAGESIZE@GOTPCREL(%rip), %rcx
	imulq	(%rcx), %rbx
	addq	%rax, %rbx
	shrq	$14, %rbx
	orq	$128, %rbx
	leaq	L_.str.2(%rip), %rdi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_debug                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid param: %d is not a valid card id\n"

	.comm	_SRAM_PAGESIZE,8,3              ## @SRAM_PAGESIZE
L_.str.1:                               ## @.str.1
	.asciz	"%s: loaded page %d\n"

	.comm	_sc_adapter,8,3                 ## @sc_adapter
L_.str.2:                               ## @.str.2
	.asciz	"%s: set page to %#x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_memcpy_fromshmem               ; -- Begin function memcpy_fromshmem
	.p2align	2
_memcpy_fromshmem:                      ; @memcpy_fromshmem
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
	bl	_IS_VALID_CARD
	cbz	w0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x23, _SRAM_PAGESIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SRAM_PAGESIZE@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x8, x19
	b.lo	LBB0_3
; %bb.2:
	udiv	x25, x21, x8
Lloh2:
	adrp	x24, _sc_adapter@GOTPAGE
Lloh3:
	ldr	x24, [x24, _sc_adapter@GOTPAGEOFF]
	ldr	x8, [x24]
	sbfiz	x22, x22, #3, #32
	ldr	x8, [x8, x22]
	ldr	w1, [x8, #16]
	and	w8, w25, #0xff
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	ldr	x8, [x24]
	ldr	x8, [x8, x22]
	add	x0, x8, #20
	bl	_spin_lock_irqsave
	ldr	x8, [x24]
	ldr	x8, [x8, x22]
	ldrb	w9, [x8]
	and	x25, x25, #0xff
	ldr	w10, [x23]
	madd	w9, w10, w25, w9
	lsr	w9, w9, #14
	orr	w9, w9, #0x80
	ldr	x10, [x8, #32]
	ldr	x8, [x8, #8]
	ldr	w1, [x10, x8, lsl #2]
	and	w0, w9, #0xff
	bl	_outb
	ldr	x8, [x24]
	ldr	x8, [x8, x22]
	ldr	x8, [x8, #24]
	and	x9, x21, #0x3fff
	add	x1, x8, x9
	mov	x0, x20
	mov	x2, x19
	bl	_memcpy_fromio
	ldr	x8, [x24]
	ldr	x8, [x8, x22]
	add	x0, x8, #20
	bl	_spin_unlock_irqrestore
	ldr	x8, [x24]
	ldr	x8, [x8, x22]
	ldr	w1, [x8, #16]
	ldrb	w8, [x8]
	ldr	x9, [x23]
	madd	x8, x9, x25, x8
	lsr	x8, x8, #14
	orr	x8, x8, #0x80
	str	x8, [sp]
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_debug
LBB0_3:
	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
	add	sp, sp, #96
	ret
LBB0_4:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	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
	add	sp, sp, #96
	b	_pr_debug
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid param: %d is not a valid card id\n"

	.comm	_SRAM_PAGESIZE,8,3              ; @SRAM_PAGESIZE
l_.str.1:                               ; @.str.1
	.asciz	"%s: loaded page %d\n"

	.comm	_sc_adapter,8,3                 ; @sc_adapter
l_.str.2:                               ; @.str.2
	.asciz	"%s: set page to %#x\n"

.subsections_via_symbols
