	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ehca_reg_bmap_mr_rpages
_ehca_reg_bmap_mr_rpages:               ## @ehca_reg_bmap_mr_rpages
	.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	%rdx, %r14
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ehca_alloc_fw_ctrlblock
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rax, %r13
	movq	_EHCA_MAP_ENTRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_9
## %bb.2:
	xorl	%ebx, %ebx
                                        ## implicit-def: $r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movq	_EHCA_MAP_ENTRIES@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jge	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_ehca_bmap@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_ehca_bmap_valid
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%ebx, %edi
	movq	%r13, %rsi
	movq	%r15, %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%r14, %r8
	callq	_ehca_reg_mr_dir_sections
	movq	%rax, %r12
	movq	_H_PAGE_REGISTERED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_H_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_6
LBB0_7:
	movq	%r13, %rdi
	callq	_ehca_free_fw_ctrlblock
	xorl	%r14d, %r14d
	movq	_H_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	je	LBB0_11
## %bb.8:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %r10d
	movl	4(%rcx), %r9d
	movl	(%r15), %r11d
	addq	$4, %r15
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	pushq	%r10
	pushq	%r11
	callq	_ehca_err
	addq	$16, %rsp
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ehca2ib_return_code            ## TAILCALL
LBB0_10:
	addq	$4, %r15
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ehca_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r13, %rdi
	callq	_ehca_free_fw_ctrlblock
	ud2
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kpage alloc failed"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EHCA_MAP_ENTRIES,4,2           ## @EHCA_MAP_ENTRIES
	.comm	_ehca_bmap,8,3                  ## @ehca_bmap
	.comm	_H_PAGE_REGISTERED,8,3          ## @H_PAGE_REGISTERED
	.comm	_H_SUCCESS,8,3                  ## @H_SUCCESS
L_.str.1:                               ## @.str.1
	.asciz	"ehca_reg_bmap_mr_rpages failed, h_ret=%lli e_mr=%p top=%x lkey=%x hca_hndl=%llx mr_hndl=%llx"

	.no_dead_strip	_ehca_reg_bmap_mr_rpages
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ehca_reg_bmap_mr_rpages
_ehca_reg_bmap_mr_rpages:               ; @ehca_reg_bmap_mr_rpages
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_ehca_alloc_fw_ctrlblock
	cbz	x0, LBB0_8
; %bb.1:
	mov	x22, x0
Lloh3:
	adrp	x25, _EHCA_MAP_ENTRIES@GOTPAGE
Lloh4:
	ldr	x25, [x25, _EHCA_MAP_ENTRIES@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.2:
	mov	x21, #0
Lloh5:
	adrp	x27, _ehca_bmap@GOTPAGE
Lloh6:
	ldr	x27, [x27, _ehca_bmap@GOTPAGEOFF]
Lloh7:
	adrp	x28, _H_PAGE_REGISTERED@GOTPAGE
Lloh8:
	ldr	x28, [x28, _H_PAGE_REGISTERED@GOTPAGEOFF]
                                        ; implicit-def: $x24
Lloh9:
	adrp	x26, _H_SUCCESS@GOTPAGE
Lloh10:
	ldr	x26, [x26, _H_SUCCESS@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x25]
	cmp	x21, x8
	b.ge	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x27]
	ldr	x8, [x8]
	ldr	w0, [x8, x21, lsl #2]
	bl	_ehca_bmap_valid
	cbz	w0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	mov	x1, x22
	mov	x2, x19
	mov	x3, x20
	mov	x4, x23
	bl	_ehca_reg_mr_dir_sections
	mov	x24, x0
	ldr	x8, [x28]
	ldr	x9, [x26]
	cmp	x0, x8
	ccmp	x0, x9, #4, ne
	b.eq	LBB0_3
LBB0_6:
	mov	x0, x22
	bl	_ehca_free_fw_ctrlblock
	ldr	x8, [x26]
	cmp	x24, x8
	b.ne	LBB0_10
; %bb.7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
	add	x0, x19, #4
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ehca_err
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_10:
	ldr	w8, [x19], #4
	ldp	w10, w9, [x20]
	stp	x8, x10, [sp, #32]
	stp	x21, x9, [sp, #16]
	stp	x24, x20, [sp]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ehca_err
	mov	x0, x24
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_ehca2ib_return_code
LBB0_11:
	mov	x0, x22
	bl	_ehca_free_fw_ctrlblock
	brk	#0x1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kpage alloc failed"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EHCA_MAP_ENTRIES,4,2           ; @EHCA_MAP_ENTRIES
	.comm	_ehca_bmap,8,3                  ; @ehca_bmap
	.comm	_H_PAGE_REGISTERED,8,3          ; @H_PAGE_REGISTERED
	.comm	_H_SUCCESS,8,3                  ; @H_SUCCESS
l_.str.1:                               ; @.str.1
	.asciz	"ehca_reg_bmap_mr_rpages failed, h_ret=%lli e_mr=%p top=%x lkey=%x hca_hndl=%llx mr_hndl=%llx"

	.no_dead_strip	_ehca_reg_bmap_mr_rpages
.subsections_via_symbols
