	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ehca_reg_mr                    ## -- Begin function ehca_reg_mr
	.p2align	4, 0x90
_ehca_reg_mr:                           ## @ehca_reg_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, -80(%rbp)                  ## 8-byte Spill
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%rcx, %r14
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	16(%rbp), %rbx
	leaq	-44(%rbp), %r13
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movl	%r8d, %edi
	movq	%r13, %rsi
	callq	_ehca_mrmw_map_acl
	movl	8(%rbx), %edi
	movq	%r13, %rsi
	callq	_ehca_mrmw_set_pgsize_hipz_acl
	movq	_ehca_use_hp_mr@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	movl	-44(%rbp), %r8d
	jne	LBB0_2
## %bb.1:
	orl	$1, %r8d
	movl	%r8d, -44(%rbp)
LBB0_2:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r9d
	movl	4(%r12), %edi
	subq	$8, %rsp
	leaq	-96(%rbp), %rax
	movq	%r15, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%r14, %rcx
	pushq	%rax
	callq	_hipz_h_alloc_resource_mr
	addq	$16, %rsp
	movq	_H_SUCCESS@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_5
## %bb.3:
	movl	40(%rbp), %eax
	movl	-88(%rbp), %ecx
	movl	%ecx, 36(%r15)
	movq	_EHCA_REG_BUSMAP_MR@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jne	LBB0_6
## %bb.4:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	16(%rbp), %rdx
	callq	_ehca_reg_bmap_mr_rpages
	jmp	LBB0_8
LBB0_5:
	movq	%rax, %rbx
	movl	4(%r12), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_ehca_err
	movq	%rbx, %rdi
	callq	_ehca2ib_return_code
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_11
	jmp	LBB0_14
LBB0_6:
	movq	_EHCA_REG_MR@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jne	LBB0_12
## %bb.7:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	16(%rbp), %rdx
	callq	_ehca_reg_mr_rpages
LBB0_8:
	movl	%eax, %r14d
	testl	%r14d, %r14d
	je	LBB0_13
LBB0_9:
	movl	4(%r12), %edi
	movq	%r15, %rsi
	callq	_hipz_h_free_resource_mr
	cmpq	(%r13), %rax
	je	LBB0_11
## %bb.10:
	movl	-96(%rbp), %r10d
	movq	16(%rbp), %r13
	movl	(%r13), %ebx
	movl	4(%r13), %r11d
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movq	%rax, %rdx
	movq	%r12, %rcx
	movq	%r15, %r8
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	xorl	%eax, %eax
	pushq	%r14
	pushq	%rbx
	pushq	%r11
	pushq	%r13
	pushq	%r10
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	callq	_ehca_err
	addq	$64, %rsp
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_ehca_err
LBB0_11:
	movq	16(%rbp), %r11
	movl	(%r11), %ebx
	movl	4(%r11), %r10d
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	movl	%r14d, %edx
	movq	%r12, %rcx
	movq	%r15, %r8
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	xorl	%eax, %eax
	pushq	%rbx
	pushq	%r10
	pushq	%r11
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	callq	_ehca_err
	addq	$48, %rsp
	movl	%r14d, %r13d
	jmp	LBB0_14
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	testl	%r14d, %r14d
	jne	LBB0_9
LBB0_13:
	movq	32(%rbp), %rax
	movq	24(%rbp), %rcx
	movq	16(%rbp), %rsi
	movl	4(%rsi), %edx
	movl	%edx, 32(%r15)
	movl	(%rsi), %edx
	movl	%edx, 28(%r15)
	movl	8(%rsi), %edx
	movl	%edx, 24(%r15)
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, (%r15)
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, 16(%r15)
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%edx, 8(%r15)
	movl	-96(%rbp), %edx
	movl	%edx, (%rcx)
	movl	-92(%rbp), %ecx
	movl	%ecx, (%rax)
	xorl	%r13d, %r13d
LBB0_14:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ehca_use_hp_mr,4,2             ## @ehca_use_hp_mr
	.comm	_H_SUCCESS,8,3                  ## @H_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hipz_alloc_mr failed, h_ret=%lli hca_hndl=%llx"

	.comm	_EHCA_REG_BUSMAP_MR,4,2         ## @EHCA_REG_BUSMAP_MR
	.comm	_EHCA_REG_MR,4,2                ## @EHCA_REG_MR
	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"h_ret=%lli shca=%p e_mr=%p iova_start=%p size=%llx acl=%x e_pd=%p lkey=%x pginfo=%p num_kpages=%llx num_hwpages=%llx ret=%i"

L_.str.2:                               ## @.str.2
	.asciz	"internal error in ehca_reg_mr, not recoverable"

L_.str.3:                               ## @.str.3
	.asciz	"ret=%i shca=%p e_mr=%p iova_start=%p size=%llx acl=%x e_pd=%p pginfo=%p num_kpages=%llx num_hwpages=%llx"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ehca_reg_mr                    ; -- Begin function ehca_reg_mr
	.p2align	2
_ehca_reg_mr:                           ; @ehca_reg_mr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x28, x27, [sp, #112]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #128]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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	x27, x7
	mov	x23, x6
	mov	x25, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x24, x0
	sub	x1, x29, #84
	mov	x0, x4
	bl	_ehca_mrmw_map_acl
	ldr	w0, [x23, #8]
	sub	x1, x29, #84
	bl	_ehca_mrmw_set_pgsize_hipz_acl
Lloh0:
	adrp	x8, _ehca_use_hp_mr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ehca_use_hp_mr@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldur	w4, [x29, #-84]
	cmp	w8, #1
	b.ne	LBB0_2
; %bb.1:
	orr	w4, w4, #0x1
	stur	w4, [x29, #-84]
LBB0_2:
	ldr	w5, [x25]
	ldr	w0, [x24, #4]
	add	x6, sp, #96
	mov	x1, x19
	mov	x2, x22
	mov	x3, x21
	bl	_hipz_h_alloc_resource_mr
Lloh3:
	adrp	x28, _H_SUCCESS@GOTPAGE
Lloh4:
	ldr	x28, [x28, _H_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x28]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.3:
	ldr	w8, [x29, #24]
	ldr	w9, [sp, #104]
	str	w9, [x19, #36]
Lloh5:
	adrp	x9, _EHCA_REG_BUSMAP_MR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _EHCA_REG_BUSMAP_MR@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w9, w8
	b.ne	LBB0_6
; %bb.4:
	mov	x0, x24
	mov	x1, x19
	mov	x2, x23
	bl	_ehca_reg_bmap_mr_rpages
	mov	x26, x0
	cbnz	w26, LBB0_8
	b	LBB0_12
LBB0_5:
	mov	x26, x0
	ldr	w8, [x24, #4]
	stp	x0, x8, [sp]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	bl	_ehca_err
	mov	x0, x26
	bl	_ehca2ib_return_code
	mov	x26, x0
	cbnz	w0, LBB0_10
	b	LBB0_13
LBB0_6:
Lloh10:
	adrp	x9, _EHCA_REG_MR@GOTPAGE
Lloh11:
	ldr	x9, [x9, _EHCA_REG_MR@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	w9, w8
	b.ne	LBB0_11
; %bb.7:
	mov	x0, x24
	mov	x1, x19
	mov	x2, x23
	bl	_ehca_reg_mr_rpages
	mov	x26, x0
	cbz	w26, LBB0_12
LBB0_8:
	ldr	w0, [x24, #4]
	mov	x1, x19
	bl	_hipz_h_free_resource_mr
	ldr	x8, [x28]
	cmp	x0, x8
	b.eq	LBB0_10
; %bb.9:
	mov	x8, x26
	ldr	w9, [sp, #96]
	ldp	w11, w10, [x23]
	stp	x11, x8, [sp, #80]
	stp	x23, x10, [sp, #64]
	stp	x25, x9, [sp, #48]
	mov	x8, x20
	stp	x21, x8, [sp, #32]
	stp	x19, x22, [sp, #16]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	stp	x0, x24, [sp]
	mov	x0, x24
	bl	_ehca_err
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x24
	bl	_ehca_err
LBB0_10:
	ldp	w9, w8, [x23]
	stp	x8, x9, [sp, #64]
	stp	x25, x23, [sp, #48]
	stp	x21, x20, [sp, #32]
	stp	x19, x22, [sp, #16]
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	stp	x26, x24, [sp]
	mov	x0, x24
	bl	_ehca_err
	b	LBB0_13
LBB0_11:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w26, w8
	cbnz	w26, LBB0_8
LBB0_12:
	ldr	x8, [x29, #16]
	ldr	d0, [x23]
	stur	d0, [x19, #28]
	ldr	w9, [x23, #8]
	str	w9, [x19, #24]
	str	x22, [x19]
	str	x21, [x19, #16]
	str	w20, [x19, #8]
	ldp	w9, w10, [sp, #96]
	str	w9, [x27]
	str	w10, [x8]
LBB0_13:
	mov	x0, x26
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #128]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ehca_use_hp_mr,4,2             ; @ehca_use_hp_mr
	.comm	_H_SUCCESS,8,3                  ; @H_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hipz_alloc_mr failed, h_ret=%lli hca_hndl=%llx"

	.comm	_EHCA_REG_BUSMAP_MR,4,2         ; @EHCA_REG_BUSMAP_MR
	.comm	_EHCA_REG_MR,4,2                ; @EHCA_REG_MR
	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"h_ret=%lli shca=%p e_mr=%p iova_start=%p size=%llx acl=%x e_pd=%p lkey=%x pginfo=%p num_kpages=%llx num_hwpages=%llx ret=%i"

l_.str.2:                               ; @.str.2
	.asciz	"internal error in ehca_reg_mr, not recoverable"

l_.str.3:                               ; @.str.3
	.asciz	"ret=%i shca=%p e_mr=%p iova_start=%p size=%llx acl=%x e_pd=%p pginfo=%p num_kpages=%llx num_hwpages=%llx"

.subsections_via_symbols
