	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ehca_reg_mr_section
_ehca_reg_mr_section:                   ## @ehca_reg_mr_section
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movq	%r8, %r15
	movl	%edx, %r13d
	movl	%esi, %ebx
	movl	%edi, %r14d
	movq	16(%rbp), %r12
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rdi
	callq	_virt_to_abs
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %edi
	movl	%ebx, %esi
	movl	%r13d, %edx
	callq	_ehca_calc_sectbase
	movq	%rax, %rbx
	movslq	(%r12), %rcx
	leaq	-1(%rcx), %rax
	testq	%rbx, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_ehca_err
	movl	(%r12), %ecx
LBB0_2:
	movq	_EHCA_SECTSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%ecx
	testl	%eax, %eax
	je	LBB0_16
## %bb.3:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movslq	%eax, %r12
	xorl	%r15d, %r15d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%r12, %r15
	jae	LBB0_17
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	_MAX_RPAGES@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jle	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%r12, %r15
	jae	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leaq	(%r15,%r14), %rax
	movq	16(%rbp), %rcx
	movslq	(%rcx), %rdi
	imulq	%rax, %rdi
	addq	%rbx, %rdi
	callq	_virt_to_abs
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx,%r14,8)
	leaq	1(%r14), %r13
	movq	_MAX_RPAGES@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	leaq	(%r15,%r14), %rax
	incq	%rax
	movq	%r13, %r14
	cmpq	%r12, %rax
	jb	LBB0_8
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	addq	%r13, %r15
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %r14d
	movq	16(%rbp), %rax
	movslq	(%rax), %rdi
	callq	_ehca_encode_hwpage_size
	movl	%r14d, %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%ecx, %ecx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	movq	%r13, %r9
	callq	_hipz_h_register_rpage_mr
	movq	%rax, %r14
	movq	_H_SUCCESS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	je	LBB0_4
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_H_PAGE_REGISTERED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	je	LBB0_4
## %bb.15:
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ehca_err
	jmp	LBB0_17
LBB0_16:
	xorl	%r14d, %r14d
LBB0_17:
	movq	%r14, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg_mr_section will probably fail:hwpage_size does not fit to section start address"

	.comm	_EHCA_SECTSIZE,4,2              ## @EHCA_SECTSIZE
	.comm	_MAX_RPAGES,8,3                 ## @MAX_RPAGES
	.comm	_H_SUCCESS,8,3                  ## @H_SUCCESS
	.comm	_H_PAGE_REGISTERED,8,3          ## @H_PAGE_REGISTERED
L_.str.1:                               ## @.str.1
	.asciz	"register_rpage_mr failed"

	.no_dead_strip	_ehca_reg_mr_section
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ehca_reg_mr_section
_ehca_reg_mr_section:                   ; @ehca_reg_mr_section
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x6
	str	x5, [sp, #8]                    ; 8-byte Folded Spill
	mov	x19, x4
	mov	x22, x3
	mov	x24, x2
	mov	x25, x1
	mov	x26, x0
	mov	x0, x3
	bl	_virt_to_abs
	mov	x23, x0
	mov	x0, x26
	mov	x1, x25
	mov	x2, x24
	bl	_ehca_calc_sectbase
	mov	x24, x0
	ldrsw	x8, [x20]
	sub	x9, x8, #1
	tst	x9, x0
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ehca_err
	ldr	w8, [x20]
LBB0_2:
Lloh2:
	adrp	x9, _EHCA_SECTSIZE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _EHCA_SECTSIZE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	sdiv	w8, w9, w8
	cbz	w8, LBB0_9
; %bb.3:
	mov	x27, #0
	sxtw	x28, w8
Lloh5:
	adrp	x21, _MAX_RPAGES@GOTPAGE
Lloh6:
	ldr	x21, [x21, _MAX_RPAGES@GOTPAGEOFF]
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	ldr	x8, [x21]
	cmp	x8, #1
	mov	x25, #0
	ccmp	x27, x28, #2, ge
	b.hs	LBB0_7
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x8, x27, x25
	add	x26, x8, #1
	ldrsw	x9, [x20]
	madd	x0, x8, x9, x24
	bl	_virt_to_abs
	str	x0, [x22, x25, lsl #3]
	add	x25, x25, #1
	ldr	x8, [x21]
	cmp	x25, x8
	ccmp	x26, x28, #2, lt
	b.lo	LBB0_5
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x27, x27, x25
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w26, [x19, #4]
	ldrsw	x0, [x20]
	bl	_ehca_encode_hwpage_size
	mov	x2, x0
	mov	x0, x26
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	mov	w3, #0
	mov	x4, x23
	mov	x5, x25
	bl	_hipz_h_register_rpage_mr
	mov	x25, x0
Lloh7:
	adrp	x8, _H_SUCCESS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _H_SUCCESS@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _H_PAGE_REGISTERED@GOTPAGE
Lloh11:
	ldr	x9, [x9, _H_PAGE_REGISTERED@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x0, x8
	ccmp	x0, x9, #4, ne
	b.ne	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x27, x28
	b.lo	LBB0_4
	b	LBB0_11
LBB0_9:
	mov	x25, #0
	b	LBB0_11
LBB0_10:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ehca_err
LBB0_11:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg_mr_section will probably fail:hwpage_size does not fit to section start address"

	.comm	_EHCA_SECTSIZE,4,2              ; @EHCA_SECTSIZE
	.comm	_MAX_RPAGES,8,3                 ; @MAX_RPAGES
	.comm	_H_SUCCESS,8,3                  ; @H_SUCCESS
	.comm	_H_PAGE_REGISTERED,8,3          ; @H_PAGE_REGISTERED
l_.str.1:                               ; @.str.1
	.asciz	"register_rpage_mr failed"

	.no_dead_strip	_ehca_reg_mr_section
.subsections_via_symbols
