	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ehca_set_pagebuf_fmr
_ehca_set_pagebuf_fmr:                  ## @ehca_set_pagebuf_fmr
	.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
	testq	%rsi, %rsi
	jle	LBB0_16
## %bb.1:
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movslq	16(%rdi), %rax
	shlq	$2, %rax
	addq	8(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%rbx), %ecx
	movl	%esi, %eax
	cltd
	idivl	%edi
	movl	%eax, %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	je	LBB0_13
## %bb.3:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%ecx
	movl	%ecx, 4(%rbx)
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	addq	$4, %r12
	incq	%r15
	cmpq	%r14, %r15
	je	LBB0_16
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movl	(%rbx), %edi
	movl	%edi, %eax
	negl	%eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	andl	(%rcx), %eax
	imull	4(%rbx), %edi
	addl	%eax, %edi
	callq	_phys_to_abs
	movl	%eax, (%r12)
	testl	%eax, %eax
	je	LBB0_17
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	32(%rbx)
	movl	(%rbx), %edi
	movl	20(%rbx), %esi
	cmpl	%edi, %esi
	jge	LBB0_2
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%edi, %eax
	cltd
	idivl	%esi
	cmpl	$1, %eax
	jbe	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	(%r12), %r14d
	negl	%edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	andl	4(%rax), %edi
	callq	_phys_to_abs
	movl	%eax, %r13d
	movl	20(%rbx), %eax
	addl	%r14d, %eax
	cmpl	%r13d, %eax
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	$2, %r15d
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	subq	%rax, %r15
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leaq	(%r15,%r12), %rax
	cmpq	$1, %rax
	je	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	xorl	%edi, %edi
	subl	(%rbx), %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	andl	4(%rax,%r12,4), %edi
	callq	_phys_to_abs
	movl	20(%rbx), %ecx
	addl	%r13d, %ecx
	incq	%r12
	movl	%r13d, %r14d
	movl	%eax, %r13d
	cmpl	%eax, %ecx
	je	LBB0_10
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %ecx
	jmp	LBB0_15
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	24(%rbx)
	incl	16(%rbx)
	addq	$4, -48(%rbp)                   ## 8-byte Folded Spill
	movl	$0, 4(%rbx)
	jmp	LBB0_4
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	addq	%rcx, 24(%rbx)
	addl	%eax, 16(%rbx)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
LBB0_16:
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_17:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %esi
	movl	4(%rbx), %r8d
	movl	16(%rbx), %ecx
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ehca_gen_err
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_18:
	movl	$1, %r12d
	movl	%r13d, %eax
LBB0_19:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	addq	%r12, %rcx
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r14d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_ehca_gen_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_20:
	subl	(%rax), %ebx
LBB0_21:
	movl	%ebx, %eax
	addq	$56, %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	"*fmrlist=%llx fmrlist=%p next_listelem=%llx next_hwpage=%llx"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.1:                               ## @.str.1
	.asciz	"uncontiguous fmr pages found prev=%llx p=%llx idx=%x"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ehca_set_pagebuf_fmr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ehca_set_pagebuf_fmr
_ehca_set_pagebuf_fmr:                  ; @ehca_set_pagebuf_fmr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cmp	x1, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	mov	x23, #0
	ldr	x8, [x0, #8]
	ldrsw	x9, [x0, #16]
	add	x25, x8, x9, lsl #2
	mov	w24, #1
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #24]
	add	x8, x8, x26
	str	x8, [x19, #24]
	ldr	w8, [x19, #16]
	add	w8, w8, w26
	str	w8, [x19, #16]
	add	x25, x25, x26, lsl #2
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x20, x20, #4
	add	x23, x23, #1
	cmp	x23, x21
	b.eq	LBB0_14
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	w8, [x25]
	ldp	w9, w10, [x19]
	neg	w11, w9
	and	w8, w8, w11
	madd	w0, w10, w9, w8
	bl	_phys_to_abs
	str	w0, [x20]
	cbz	w0, LBB0_17
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19, #32]
	add	w8, w8, #1
	str	w8, [x19, #32]
	ldr	w9, [x19, #20]
	ldr	w8, [x19]
	cmp	w9, w8
	b.ge	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	sdiv	w26, w8, w9
	cmp	w26, #1
	b.ls	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w22, [x20]
	ldr	w9, [x25, #4]
	neg	w8, w8
	and	w0, w9, w8
	bl	_phys_to_abs
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x19, #20]
	add	w8, w8, w22
	cmp	w8, w0
	b.ne	LBB0_16
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w27, #2
LBB0_9:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x26, x27
	b.eq	LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	x22, x0
	ldr	w8, [x19]
	ldr	w9, [x25, x27, lsl #2]
	neg	w8, w8
	and	w0, w9, w8
	bl	_phys_to_abs
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x19, #20]
	add	x27, x27, #1
	add	w8, w8, w22
	cmp	w8, w0
	b.eq	LBB0_9
	b	LBB0_15
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w10, [x19, #4]
	sdiv	w8, w9, w8
	sdiv	w9, w10, w8
	msub	w8, w9, w8, w10
	cbz	w8, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	add	w8, w10, #1
	str	w8, [x19, #4]
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #24]
	add	x8, x8, #1
	str	x8, [x19, #24]
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
	add	x25, x25, #4
	str	wzr, [x19, #4]
	b	LBB0_3
LBB0_14:
	mov	w0, #0
	b	LBB0_19
LBB0_15:
	sub	x24, x27, #1
LBB0_16:
	add	x8, x23, x24
	stp	x0, x8, [sp]
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x22
	bl	_ehca_gen_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:
	ldr	w1, [x25]
	ldr	w8, [x19, #16]
	ldr	w9, [x19, #4]
	stp	x8, x9, [sp, #8]
	str	x25, [sp]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ehca_gen_err
Lloh6:
	adrp	x8, _EFAULT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_19:
	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
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"*fmrlist=%llx fmrlist=%p next_listelem=%llx next_hwpage=%llx"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.1:                               ; @.str.1
	.asciz	"uncontiguous fmr pages found prev=%llx p=%llx idx=%x"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ehca_set_pagebuf_fmr
.subsections_via_symbols
