	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mem_setup
_mem_setup:                             ## @mem_setup
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movq	_mem_cleanup@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rdi)
	movl	16(%rdi), %r15d
	cmpl	$1, %r15d
	je	LBB0_3
## %bb.4:
	cmpl	$4, %r15d
	je	LBB0_8
## %bb.5:
	cmpl	$2, %r15d
	jne	LBB0_7
## %bb.6:
	movq	_intf_mem_outw@GOTPCREL(%rip), %rax
	movq	_intf_mem_inw@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_3:
	movq	_intf_mem_outb@GOTPCREL(%rip), %rax
	movq	_intf_mem_inb@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_8:
	movq	_intf_mem_outl@GOTPCREL(%rip), %rax
	movq	_intf_mem_inl@GOTPCREL(%rip), %rcx
LBB0_9:
	movl	(%rcx), %ecx
	movl	%ecx, 36(%rbx)
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movl	20(%rbx), %eax
	movl	(%rbx), %ecx
	imull	%eax, %ecx
	subl	%eax, %r15d
	addl	%ecx, %r15d
	movq	_DEVICE_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_request_mem_region
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_ioremap
	movq	%rax, %rcx
	movq	%rax, 24(%rbx)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_14
## %bb.11:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_release_mem_region
LBB0_12:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_7:
	movl	40(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_warn
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_13:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_mem_cleanup,4,2                ## @mem_cleanup
	.comm	_intf_mem_inb,4,2               ## @intf_mem_inb
	.comm	_intf_mem_outb,4,2              ## @intf_mem_outb
	.comm	_intf_mem_inw,4,2               ## @intf_mem_inw
	.comm	_intf_mem_outw,4,2              ## @intf_mem_outw
	.comm	_intf_mem_inl,4,2               ## @intf_mem_inl
	.comm	_intf_mem_outl,4,2              ## @intf_mem_outl
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid register size: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DEVICE_NAME,4,2                ## @DEVICE_NAME
	.comm	_EIO,4,2                        ## @EIO
	.comm	_mem_inq,4,2                    ## @mem_inq
	.comm	_mem_outq,4,2                   ## @mem_outq
	.no_dead_strip	_mem_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mem_setup
_mem_setup:                             ; @mem_setup
	.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	x19, [x0, #8]
	cbz	x19, LBB0_5
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _mem_cleanup@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mem_cleanup@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #44]
	ldr	w2, [x0, #16]
	cmp	w2, #1
	b.eq	LBB0_6
; %bb.2:
	cmp	w2, #4
	b.eq	LBB0_7
; %bb.3:
	cmp	w2, #2
	b.ne	LBB0_11
; %bb.4:
Lloh3:
	adrp	x8, _intf_mem_outw@GOTPAGE
Lloh4:
	ldr	x8, [x8, _intf_mem_outw@GOTPAGEOFF]
Lloh5:
	adrp	x9, _intf_mem_inw@GOTPAGE
Lloh6:
	ldr	x9, [x9, _intf_mem_inw@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_14
LBB0_6:
Lloh9:
	adrp	x8, _intf_mem_outb@GOTPAGE
Lloh10:
	ldr	x8, [x8, _intf_mem_outb@GOTPAGEOFF]
Lloh11:
	adrp	x9, _intf_mem_inb@GOTPAGE
Lloh12:
	ldr	x9, [x9, _intf_mem_inb@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh13:
	adrp	x8, _intf_mem_outl@GOTPAGE
Lloh14:
	ldr	x8, [x8, _intf_mem_outl@GOTPAGEOFF]
Lloh15:
	adrp	x9, _intf_mem_inl@GOTPAGE
Lloh16:
	ldr	x9, [x9, _intf_mem_inl@GOTPAGEOFF]
LBB0_8:
	ldr	w9, [x9]
	ldr	w8, [x8]
	stp	w8, w9, [x20, #32]
	ldr	w8, [x20]
	ldr	w9, [x20, #20]
	sub	w10, w2, w9
	madd	w21, w9, w8, w10
Lloh17:
	adrp	x8, _DEVICE_NAME@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DEVICE_NAME@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_request_mem_region
	cbz	x0, LBB0_13
; %bb.9:
	mov	x0, x19
	mov	x1, x21
	bl	_ioremap
	str	x0, [x20, #24]
	cbz	x0, LBB0_12
; %bb.10:
	mov	w0, #0
	b	LBB0_15
LBB0_11:
	ldr	w0, [x20, #40]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:
	mov	x0, x19
	mov	x1, x21
	bl	_release_mem_region
LBB0_13:
Lloh24:
	adrp	x8, _EIO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_mem_cleanup,4,2                ; @mem_cleanup
	.comm	_intf_mem_inb,4,2               ; @intf_mem_inb
	.comm	_intf_mem_outb,4,2              ; @intf_mem_outb
	.comm	_intf_mem_inw,4,2               ; @intf_mem_inw
	.comm	_intf_mem_outw,4,2              ; @intf_mem_outw
	.comm	_intf_mem_inl,4,2               ; @intf_mem_inl
	.comm	_intf_mem_outl,4,2              ; @intf_mem_outl
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid register size: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DEVICE_NAME,4,2                ; @DEVICE_NAME
	.comm	_EIO,4,2                        ; @EIO
	.comm	_mem_inq,4,2                    ; @mem_inq
	.comm	_mem_outq,4,2                   ; @mem_outq
	.no_dead_strip	_mem_setup
.subsections_via_symbols
