	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_siw_alloc_mr                   ## -- Begin function siw_alloc_mr
	.p2align	4, 0x90
_siw_alloc_mr:                          ## @siw_alloc_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	(%rdi), %edi
	callq	_to_siw_dev
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_atomic_inc_return
	movq	_SIW_MAX_MR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_siw_dbg_pd
	jmp	LBB0_10
LBB0_2:
	movq	_IB_MR_TYPE_MEM_REG@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_3
## %bb.4:
	movq	_SIW_MAX_SGE_PBL@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jge	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_siw_dbg_pd
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_siw_dbg_pd
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_11:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movq	%r14, %rdi
	callq	_atomic_dec
	movq	%r12, %rdi
	callq	_kfree
LBB0_16:
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_siw_dbg_pd
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_6:
	movl	%r13d, %edi
	callq	_siw_pbl_alloc
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	%r12, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_siw_dbg_pd
	jmp	LBB0_8
LBB0_9:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.12:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	imull	(%rcx), %r13d
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	xorl	%ecx, %ecx
	movl	%r13d, %r8d
	xorl	%r9d, %r9d
	callq	_siw_mr_add_mem
	testl	%eax, %eax
	je	LBB0_17
## %bb.13:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_atomic_dec
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	cmpq	$0, (%rdi)
	je	LBB0_15
## %bb.14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_siw_mr_drop_mem
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_15:
	movq	_rcu@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kfree_rcu
	jmp	LBB0_16
LBB0_17:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rax
	movl	$1, (%rax)
	movl	4(%rax), %edx
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_siw_dbg_pd
	addq	$8, %rbx
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIW_MAX_MR,8,3                 ## @SIW_MAX_MR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"too many mr's\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_IB_MR_TYPE_MEM_REG,4,2         ## @IB_MR_TYPE_MEM_REG
L_.str.1:                               ## @.str.1
	.asciz	"mr type %d unsupported\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_SIW_MAX_SGE_PBL,4,2            ## @SIW_MAX_SGE_PBL
L_.str.2:                               ## @.str.2
	.asciz	"too many sge's: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"pbl allocation failed: %d\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"[MEM %u]: success\n"

	.comm	_rcu,4,2                        ## @rcu
L_.str.5:                               ## @.str.5
	.asciz	"failed: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_siw_alloc_mr                   ; -- Begin function siw_alloc_mr
	.p2align	2
_siw_alloc_mr:                          ; @siw_alloc_mr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_to_siw_dev
	mov	x20, x0
	bl	_atomic_inc_return
Lloh0:
	adrp	x8, _SIW_MAX_MR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SIW_MAX_MR@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.le	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_5
LBB0_2:
Lloh5:
	adrp	x8, _IB_MR_TYPE_MEM_REG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IB_MR_TYPE_MEM_REG@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_7
; %bb.3:
Lloh8:
	adrp	x8, _SIW_MAX_SGE_PBL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SIW_MAX_SGE_PBL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ge	LBB0_11
; %bb.4:
	str	x21, [sp]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_5:
	mov	x0, x19
	bl	_siw_dbg_pd
	mov	x22, #0
LBB0_6:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
	str	x22, [sp]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_siw_dbg_pd
	mov	x22, #0
Lloh17:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x20
	bl	_atomic_dec
	mov	x0, x22
	bl	_kfree
LBB0_10:
	mov	x8, x21
	str	x8, [sp]
Lloh19:
	adrp	x1, l_.str.5@PAGE
Lloh20:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_siw_dbg_pd
	mov	x0, x21
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_ERR_PTR
LBB0_11:
	mov	x0, x21
	bl	_siw_pbl_alloc
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_13
; %bb.12:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x21, x0
	str	x21, [sp]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_siw_dbg_pd
	mov	x22, #0
	b	LBB0_9
LBB0_13:
Lloh23:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.14:
	mov	x23, x0
Lloh26:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	mul	w4, w8, w21
	mov	x1, x19
	mov	x2, x22
	mov	w3, #0
	mov	w5, #0
	bl	_siw_mr_add_mem
	cbz	w0, LBB0_18
; %bb.15:
	mov	x21, x0
	mov	x0, x20
	bl	_atomic_dec
	ldr	x8, [x23]
	cbz	x8, LBB0_17
; %bb.16:
	mov	x0, x23
	bl	_siw_mr_drop_mem
LBB0_17:
Lloh29:
	adrp	x8, _rcu@GOTPAGE
Lloh30:
	ldr	x8, [x8, _rcu@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_kfree_rcu
	b	LBB0_10
LBB0_18:
	ldr	x8, [x23], #8
	mov	w9, #1
	str	w9, [x8]
	ldr	w8, [x8, #4]
	str	x8, [sp]
Lloh32:
	adrp	x1, l_.str.4@PAGE
Lloh33:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_siw_dbg_pd
	mov	x0, x23
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_SIW_MAX_MR,8,3                 ; @SIW_MAX_MR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"too many mr's\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_IB_MR_TYPE_MEM_REG,4,2         ; @IB_MR_TYPE_MEM_REG
l_.str.1:                               ; @.str.1
	.asciz	"mr type %d unsupported\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_SIW_MAX_SGE_PBL,4,2            ; @SIW_MAX_SGE_PBL
l_.str.2:                               ; @.str.2
	.asciz	"too many sge's: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"pbl allocation failed: %d\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"[MEM %u]: success\n"

	.comm	_rcu,4,2                        ; @rcu
l_.str.5:                               ; @.str.5
	.asciz	"failed: %d\n"

.subsections_via_symbols
