	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_siw_reg_user_mr                ## -- Begin function siw_reg_user_mr
	.p2align	4, 0x90
_siw_reg_user_mr:                       ## @siw_reg_user_mr
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -88(%rbp)                  ## 8-byte Spill
	movl	%r8d, -76(%rbp)                 ## 4-byte Spill
	movl	%ecx, %ebx
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r12
	movl	(%rdi), %edi
	callq	_to_siw_dev
	movq	%rax, %r13
	movq	_RLIMIT_MEMLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rlimit
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%r15d, -80(%rbp)                ## 4-byte Spill
	movslq	%r15d, %rdx
	movl	%r14d, %r15d
	movslq	%ebx, %rcx
	movslq	%r14d, %r8
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_siw_dbg_pd
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_atomic_inc_return
	movq	_SIW_MAX_MR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_3
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_siw_dbg_pd
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_3:
	testl	%r15d, %r15d
	je	LBB0_9
## %bb.4:
	movq	_RLIM_INFINITY@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	cmpq	(%rax), %r14
	movl	-80(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_7
## %bb.5:
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	notl	%edi
	andl	%r13d, %edi
	addl	%r15d, %edi
	callq	_PAGE_ALIGN
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrq	%cl, %rax
	shrq	%cl, %r14
	movq	_current@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %r8
	movq	%r14, %rcx
	subq	%r8, %rcx
	cmpq	%rcx, %rax
	jbe	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%rax, %rdx
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_siw_dbg_pd
	jmp	LBB0_2
LBB0_7:
	movl	-76(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edi
	callq	_ib_access_writable
	movl	%r13d, %edi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_siw_umem_get
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_14
## %bb.8:
	movq	%r14, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_siw_dbg_pd
	jmp	LBB0_11
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_10:
	subl	(%rax), %ebx
LBB0_11:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_atomic_dec
LBB0_12:
	movl	%ebx, %edi
	callq	_ERR_PTR
	movq	%rax, %r15
LBB0_13:
	movq	%r15, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.15:
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	movl	%r13d, %ecx
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	movl	%ebx, %r9d
	callq	_siw_mr_add_mem
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_21
LBB0_16:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_atomic_dec
	cmpq	$0, (%r15)
	je	LBB0_18
## %bb.17:
	movq	%r15, %rdi
	callq	_siw_mr_drop_mem
LBB0_18:
	movq	_rcu@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_kfree_rcu
	jmp	LBB0_12
LBB0_19:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_atomic_dec
	testq	%r14, %r14
	je	LBB0_12
## %bb.20:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_siw_umem_release
	jmp	LBB0_12
LBB0_21:
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	testq	%r12, %r12
	je	LBB0_27
## %bb.22:
	cmpl	$3, (%r12)
	ja	LBB0_24
LBB0_23:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_24:
	movq	(%r15), %r14
	leaq	-72(%rbp), %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_ib_copy_from_udata
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
## %bb.25:
	movl	-72(%rbp), %eax
	orl	%eax, 12(%r15)
	orl	%eax, 8(%r15)
	orl	4(%r14), %eax
	movl	%eax, 4(%r14)
	movl	%eax, -64(%rbp)
	cmpl	$3, 4(%r12)
	jbe	LBB0_23
## %bb.26:
	leaq	-64(%rbp), %rsi
	movq	%r12, %rdi
	movl	$4, %edx
	callq	_ib_copy_to_udata
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
LBB0_27:
	movq	(%r15), %rax
	movl	$1, (%rax)
	addq	$8, %r15
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_RLIMIT_MEMLOCK,4,2             ## @RLIMIT_MEMLOCK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"start: 0x%pK, va: 0x%pK, len: %llu\n"

	.comm	_SIW_MAX_MR,8,3                 ## @SIW_MAX_MR
L_.str.1:                               ## @.str.1
	.asciz	"too many mr's\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RLIM_INFINITY,8,3              ## @RLIM_INFINITY
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_current,8,3                    ## @current
L_.str.2:                               ## @.str.2
	.asciz	"pages req %lu, max %lu, lock %lu\n"

L_.str.3:                               ## @.str.3
	.asciz	"getting user memory failed: %d\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_rcu,4,2                        ## @rcu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_siw_reg_user_mr                ; -- Begin function siw_reg_user_mr
	.p2align	2
_siw_reg_user_mr:                       ; @siw_reg_user_mr
	.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	x20, x5
	mov	x23, x4
	mov	x26, x3
	mov	x24, x2
	mov	x25, x1
	mov	x21, x0
	ldr	w0, [x0]
	bl	_to_siw_dev
	mov	x19, x0
Lloh0:
	adrp	x8, _RLIMIT_MEMLOCK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RLIMIT_MEMLOCK@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_rlimit
	mov	x22, x0
	sxtw	x8, w25
	sxtw	x9, w26
	sxtw	x10, w24
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_siw_dbg_pd
	mov	x0, x19
	bl	_atomic_inc_return
Lloh5:
	adrp	x8, _SIW_MAX_MR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SIW_MAX_MR@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x0, x8
	b.le	LBB0_3
; %bb.1:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_2:
	mov	x0, x21
	bl	_siw_dbg_pd
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_10
LBB0_3:
	cbz	w24, LBB0_9
; %bb.4:
Lloh12:
	adrp	x8, _RLIM_INFINITY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RLIM_INFINITY@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x22, x8
	b.eq	LBB0_7
; %bb.5:
Lloh15:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	bic	w8, w25, w8
	add	w0, w8, w24
	bl	_PAGE_ALIGN
Lloh18:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x8]
	lsr	x8, x0, x9
Lloh21:
	adrp	x10, _current@GOTPAGE
Lloh22:
	ldr	x10, [x10, _current@GOTPAGEOFF]
	lsr	x9, x22, x9
Lloh23:
	ldr	x10, [x10]
	ldr	x10, [x10]
	ldr	x10, [x10]
	sub	x11, x9, x10
	cmp	x8, x11
	b.ls	LBB0_7
; %bb.6:
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_7:
	mov	x0, x23
	bl	_ib_access_writable
	mov	x2, x0
	mov	x0, x25
	mov	x1, x24
	bl	_siw_umem_get
	mov	x26, x0
	bl	_IS_ERR
	cbz	x0, LBB0_14
; %bb.8:
	mov	x0, x26
	bl	_PTR_ERR
	mov	x23, x0
	str	x23, [sp]
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_siw_dbg_pd
	b	LBB0_11
LBB0_9:
Lloh28:
	adrp	x8, _EINVAL@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_11:
	mov	x0, x19
	bl	_atomic_dec
LBB0_12:
	mov	x0, x23
	bl	_ERR_PTR
	mov	x22, x0
LBB0_13:
	mov	x0, x22
	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
LBB0_14:
Lloh30:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_19
; %bb.15:
	mov	x22, x0
	mov	x1, x21
	mov	x2, x26
	mov	x3, x25
	mov	x4, x24
	mov	x5, x23
	bl	_siw_mr_add_mem
	mov	x23, x0
	cbz	w0, LBB0_21
LBB0_16:
	mov	x0, x19
	bl	_atomic_dec
	ldr	x8, [x22]
	cbz	x8, LBB0_18
; %bb.17:
	mov	x0, x22
	bl	_siw_mr_drop_mem
LBB0_18:
Lloh33:
	adrp	x8, _rcu@GOTPAGE
Lloh34:
	ldr	x8, [x8, _rcu@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_kfree_rcu
	b	LBB0_12
LBB0_19:
Lloh36:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	neg	w23, w8
	mov	x0, x19
	bl	_atomic_dec
	cbz	x26, LBB0_12
; %bb.20:
	mov	x0, x26
	mov	w1, #0
	bl	_siw_umem_release
	b	LBB0_12
LBB0_21:
	cbz	x20, LBB0_27
; %bb.22:
	ldr	w8, [x20]
	cmp	w8, #3
	b.hi	LBB0_24
LBB0_23:
Lloh39:
	adrp	x8, _EINVAL@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_16
LBB0_24:
	ldr	x21, [x22]
	add	x0, sp, #40
	mov	x1, x20
	mov	w2, #4
	bl	_ib_copy_from_udata
	mov	x23, x0
	cbnz	w0, LBB0_16
; %bb.25:
	ldr	w8, [sp, #40]
	ldr	d0, [x22, #8]
	dup.2s	v1, w8
	orr.8b	v0, v0, v1
	str	d0, [x22, #8]
	ldr	w9, [x21, #4]
	orr	w8, w9, w8
	str	w8, [x21, #4]
	str	w8, [sp, #32]
	ldr	w8, [x20, #4]
	cmp	w8, #3
	b.ls	LBB0_23
; %bb.26:
	add	x1, sp, #32
	mov	x0, x20
	mov	w2, #4
	bl	_ib_copy_to_udata
	mov	x23, x0
	cbnz	w0, LBB0_16
LBB0_27:
	ldr	x8, [x22], #8
	mov	w9, #1
	str	w9, [x8]
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_RLIMIT_MEMLOCK,4,2             ; @RLIMIT_MEMLOCK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"start: 0x%pK, va: 0x%pK, len: %llu\n"

	.comm	_SIW_MAX_MR,8,3                 ; @SIW_MAX_MR
l_.str.1:                               ; @.str.1
	.asciz	"too many mr's\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RLIM_INFINITY,8,3              ; @RLIM_INFINITY
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_current,8,3                    ; @current
l_.str.2:                               ; @.str.2
	.asciz	"pages req %lu, max %lu, lock %lu\n"

l_.str.3:                               ; @.str.3
	.asciz	"getting user memory failed: %d\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_rcu,4,2                        ; @rcu
.subsections_via_symbols
