	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ehca_mr_chk_buf_and_calc_size  ## -- Begin function ehca_mr_chk_buf_and_calc_size
	.p2align	4, 0x90
_ehca_mr_chk_buf_and_calc_size:         ## @ehca_mr_chk_buf_and_calc_size
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testl	%esi, %esi
	je	LBB0_1
## %bb.2:
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movl	(%rdi), %r10d
	movl	4(%rdi), %r8d
	movl	%r10d, %ebx
	xorl	%edx, %ebx
	testl	%eax, %ebx
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movq	%rdx, %rsi
	movl	%r10d, %edx
	movl	%r8d, %ecx
	xorl	%eax, %eax
	callq	_ehca_gen_err
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_ehca_gen_err
	jmp	LBB0_13
LBB0_4:
	leal	(%r8,%r10), %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	cltd
	idivl	%r9d
	cmpl	$2, %esi
	jl	LBB0_6
## %bb.5:
	testl	%edx, %edx
	je	LBB0_6
## %bb.11:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%r10d, %esi
	movl	%r8d, %edx
	jmp	LBB0_12
LBB0_6:
	xorl	%r14d, %r14d
	movl	$0, %r11d
	testl	%esi, %esi
	jle	LBB0_20
## %bb.7:
	movl	%esi, %r10d
	decl	%esi
	xorl	%ebx, %ebx
	xorl	%r11d, %r11d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	testl	%ebx, %ebx
	je	LBB0_16
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	(%rdi,%rbx,8), %r8d
	movl	%r8d, %eax
	cltd
	idivl	%r9d
	testl	%edx, %edx
	jne	LBB0_10
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	%esi, %ebx
	jge	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	4(%rdi,%rbx,8), %r8d
	movl	%r8d, %eax
	cltd
	idivl	%r9d
	testl	%edx, %edx
	jne	LBB0_18
LBB0_16:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	4(%rdi,%rbx,8), %eax
	testl	%eax, %eax
	je	LBB0_17
## %bb.19:                              ##   in Loop: Header=BB0_8 Depth=1
	addl	%eax, %r11d
	incq	%rbx
	cmpl	%ebx, %r10d
	jne	LBB0_8
LBB0_20:
	movl	%r11d, (%rcx)
	jmp	LBB0_21
LBB0_17:
	xorl	%r8d, %r8d
LBB0_18:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	movl	%r8d, %edx
LBB0_12:
	xorl	%eax, %eax
	callq	_ehca_gen_err
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_21:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_10:
	movl	4(%rdi,%rbx,8), %ecx
	leaq	L_.str.3(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	movl	%r8d, %edx
	xorl	%eax, %eax
	callq	_ehca_gen_err
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad phys buf array len, num_phys_buf=0"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
L_.str.1:                               ## @.str.1
	.asciz	"iova_start/addr mismatch, iova_start=%p pbuf->addr=%llx pbuf->size=%llx"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"addr/size mismatch in 1st buf, pbuf->addr=%llx pbuf->size=%llx"

L_.str.3:                               ## @.str.3
	.asciz	"bad address, i=%x pbuf->addr=%llx pbuf->size=%llx"

L_.str.4:                               ## @.str.4
	.asciz	"bad size, i=%x pbuf->size=%llx"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ehca_mr_chk_buf_and_calc_size  ; -- Begin function ehca_mr_chk_buf_and_calc_size
	.p2align	2
_ehca_mr_chk_buf_and_calc_size:         ; @ehca_mr_chk_buf_and_calc_size
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	cbz	w1, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	ldp	w8, w10, [x0]
	eor	w11, w8, w2
	bics	wzr, w11, w9
	b.eq	LBB0_4
; %bb.2:
	stp	x8, x10, [sp, #8]
	str	x2, [sp]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_19
LBB0_3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_19
LBB0_4:
Lloh7:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w1, #1
	b.le	LBB0_7
; %bb.5:
	add	w11, w10, w8
	sdiv	w12, w11, w9
	msub	w11, w12, w9, w11
	cbz	w11, LBB0_7
; %bb.6:
                                        ; kill: def $w10 killed $w10 killed $x10 def $x10
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	stp	x8, x10, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_19
LBB0_7:
	subs	w11, w1, #1
	b.lt	LBB0_15
; %bb.8:
	mov	w8, #0
	mov	w10, #0
	add	x12, x0, #4
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	cbz	w8, LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldur	w13, [x12, #-4]
	sdiv	w14, w13, w9
	msub	w14, w14, w9, w13
	cbnz	w14, LBB0_18
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w8, w11
	b.ge	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w13, [x12]
	sdiv	w14, w13, w9
	msub	w14, w14, w9, w13
	cbnz	w14, LBB0_17
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w13, [x12]
	cbz	w13, LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w10, w13, w10
	add	w8, w8, #1
	add	x12, x12, #8
	cmp	w1, w8
	b.ne	LBB0_9
	b	LBB0_16
LBB0_15:
	mov	w10, #0
LBB0_16:
	mov	w0, #0
	str	w10, [x3]
	b	LBB0_20
LBB0_17:
	stp	x8, x13, [sp]
Lloh12:
	adrp	x0, l_.str.4@PAGE
Lloh13:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_19
LBB0_18:
	ldr	w9, [x12]
	stp	x13, x9, [sp, #8]
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_19:
	bl	_ehca_gen_err
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_20:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad phys buf array len, num_phys_buf=0"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
l_.str.1:                               ; @.str.1
	.asciz	"iova_start/addr mismatch, iova_start=%p pbuf->addr=%llx pbuf->size=%llx"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"addr/size mismatch in 1st buf, pbuf->addr=%llx pbuf->size=%llx"

l_.str.3:                               ; @.str.3
	.asciz	"bad address, i=%x pbuf->addr=%llx pbuf->size=%llx"

l_.str.4:                               ; @.str.4
	.asciz	"bad size, i=%x pbuf->size=%llx"

.subsections_via_symbols
