	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ehca_set_pagebuf_phys
_ehca_set_pagebuf_phys:                 ## @ehca_set_pagebuf_phys
	.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	$24, %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_21
## %bb.1:
	movq	%rdx, %r15
	movq	%rdi, %rbx
	movl	(%rdi), %r9d
	xorl	%r14d, %r14d
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	movq	48(%rbx), %r12
	movslq	40(%rbx), %r13
	shlq	$4, %r13
	leaq	(%r12,%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%r12,%r13), %eax
	cltd
	idivl	%r9d
	movslq	%edx, %rdi
	leaq	(%r12,%r13), %rax
	addq	$8, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	addq	8(%r12,%r13), %rdi
	movl	%r9d, %esi
	callq	_NUM_CHUNKS
	movl	%eax, %ecx
	movl	(%rbx), %r9d
	movl	%r9d, %eax
	negl	%eax
	andl	(%r12,%r13), %eax
	movl	4(%rbx), %edi
	cltd
	idivl	%r9d
	movl	%eax, %r13d
	addl	%ecx, %r13d
	leaq	1(%r14), %r12
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	%r12, %rax
	cmovgq	%rax, %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=2
	movl	%r9d, %eax
	cltd
	idivl	%ecx
	cltq
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=2
	addq	%rax, 8(%rbx)
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=2
	addq	$4, %r15
	incq	%r14
	cmpq	%r14, %r12
	je	LBB0_17
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%r13d, %edi
	jge	LBB0_18
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	8(%rbx), %rsi
	movq	16(%rbx), %rdx
	movq	24(%rbx), %rcx
	movq	32(%rbx), %r8
	cmpq	%rdx, %rsi
	jge	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	cmpq	%r8, %rcx
	jge	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=2
	movl	%r9d, %eax
	negl	%eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	andl	(%rcx), %eax
	imull	%r9d, %edi
	addl	%eax, %edi
	callq	_phys_to_abs
	movl	%eax, (%r15)
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	testl	%esi, %esi
	jne	LBB0_10
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=2
	incq	24(%rbx)
	movl	(%rbx), %r9d
	movl	4(%rbx), %edi
	incl	%edi
	movl	%edi, 4(%rbx)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%r9d, %ecx
	jl	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=2
	movl	%ecx, %eax
	cltd
	idivl	%r9d
	movl	%eax, %ecx
	movl	%edi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=2
	movl	$1, %eax
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %r14
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	cmpl	%r13d, %edi
	jl	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_2 Depth=1
	incl	40(%rbx)
	movl	$0, 4(%rbx)
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%rsi, %r14
	jl	LBB0_2
LBB0_21:
	xorl	%ebx, %ebx
	jmp	LBB0_22
LBB0_6:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
                                        ## kill: def $esi killed $esi killed $rsi
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	%r14, %r9
	xorl	%eax, %eax
	callq	_ehca_gen_err
	jmp	LBB0_7
LBB0_10:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdx
	movl	4(%rbx), %ecx
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ehca_gen_err
LBB0_7:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_22:
	movl	%ebx, %eax
	addq	$24, %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	"kpage_cnt >= num_kpages, kpage_cnt=%llx num_kpages=%llx hwpage_cnt=%llx num_hwpages=%llx i=%x"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.1:                               ## @.str.1
	.asciz	"pbuf->addr=%llx pbuf->size=%llx next_hwpage=%llx"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.no_dead_strip	_ehca_set_pagebuf_phys
.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_phys
_ehca_set_pagebuf_phys:                 ; @ehca_set_pagebuf_phys
	.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
	cmp	x1, #1
	b.lt	LBB0_18
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	mov	x22, #0
	ldr	w1, [x0]
Lloh0:
	adrp	x23, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PAGE_SIZE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	x22, x21
	b.ge	LBB0_18
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	ldr	x8, [x19, #48]
	ldrsw	x9, [x19, #40]
	add	x24, x8, x9, lsl #4
	ldr	w8, [x24]
	sdiv	w9, w8, w1
	msub	w8, w9, w1, w8
	mov	x25, x24
	ldr	x9, [x25, #8]!
	add	x0, x9, w8, sxtw
	bl	_NUM_CHUNKS
	ldr	w8, [x24]
	ldp	w1, w9, [x19]
	neg	w10, w1
	and	w8, w8, w10
	sdiv	w8, w8, w1
	add	w26, w8, w0
	add	x8, x22, #1
	cmp	x21, x8
	csinc	x27, x21, x22, gt
	b	LBB0_7
LBB0_4:                                 ;   in Loop: Header=BB0_7 Depth=2
	sdiv	w8, w1, w8
	sxtw	x8, w8
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	ldr	x10, [x19, #8]
	add	x8, x10, x8
	str	x8, [x19, #8]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x20, x20, #4
	add	x22, x22, #1
	cmp	x27, x22
	b.eq	LBB0_14
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w9, w26
	b.ge	LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldp	x8, x2, [x19, #8]
	ldp	x3, x10, [x19, #24]
	cmp	x8, x2
	ccmp	x3, x10, #0, lt
	b.ge	LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	w8, [x24]
	neg	w10, w1
	and	w8, w8, w10
	madd	w0, w1, w9, w8
	bl	_phys_to_abs
	str	w0, [x20]
	cbnz	w0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=2
	ldr	w1, [x24]
	cbnz	w1, LBB0_19
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [x19, #24]
	add	x8, x8, #1
	str	x8, [x19, #24]
	ldp	w1, w8, [x19]
	add	w9, w8, #1
	str	w9, [x19, #4]
	ldr	w8, [x23]
	cmp	w8, w1
	b.lt	LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=2
	sdiv	w8, w8, w1
	sdiv	w10, w9, w8
	msub	w8, w10, w8, w9
	cbnz	w8, LBB0_6
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=2
	mov	w8, #1
	b	LBB0_5
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x22, x27
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w9, w26
	b.lt	LBB0_2
; %bb.16:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19, #40]
	add	w8, w8, #1
	str	w8, [x19, #40]
	str	wzr, [x19, #4]
	b	LBB0_2
LBB0_17:
	stp	x10, x22, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x8
                                        ; kill: def $w3 killed $w3 killed $x3
	b	LBB0_20
LBB0_18:
	mov	w0, #0
	b	LBB0_21
LBB0_19:
	ldr	x2, [x25]
	ldr	w3, [x19, #4]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_20:
	bl	_ehca_gen_err
Lloh6:
	adrp	x8, _EFAULT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_21:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kpage_cnt >= num_kpages, kpage_cnt=%llx num_kpages=%llx hwpage_cnt=%llx num_hwpages=%llx i=%x"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.1:                               ; @.str.1
	.asciz	"pbuf->addr=%llx pbuf->size=%llx next_hwpage=%llx"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.no_dead_strip	_ehca_set_pagebuf_phys
.subsections_via_symbols
