	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40e_add_pd_table_entry        ## -- Begin function i40e_add_pd_table_entry
	.p2align	4, 0x90
_i40e_add_pd_table_entry:               ## @i40e_add_pd_table_entry
	.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	%rdx, %r13
	movq	_I40E_HMC_PD_CNT_IN_SD@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%rdx, %rax
	orq	%rbx, %rax
	shrq	$32, %rax
	je	LBB0_1
## %bb.2:
	movq	%r13, %rax
	xorl	%edx, %edx
	divq	%rbx
	movq	%rax, %r14
	cmpq	(%rsi), %r14
	jae	LBB0_4
LBB0_5:
	movq	_I40E_SD_TYPE_PAGED@GOTPCREL(%rip), %r8
	movq	(%r8), %rax
	movq	8(%rsi), %r15
	leaq	(%r14,%r14,2), %r12
	cmpq	(%r15,%r12,8), %rax
	jne	LBB0_12
## %bb.6:
	movq	16(%r15,%r12,8), %rsi
	leaq	(%rdx,%rdx,4), %rbx
	cmpl	$0, (%rsi,%rbx,8)
	jne	LBB0_11
## %bb.7:
	movl	$1, %eax
	testq	%rcx, %rcx
	je	LBB0_8
LBB0_10:
	leaq	(%r15,%r12,8), %r12
	addq	$8, %r12
	leaq	(%rsi,%rbx,8), %r15
	movl	%eax, 4(%rsi,%rbx,8)
	movl	(%rcx), %eax
	movl	%eax, 32(%rsi,%rbx,8)
	movq	%r13, 16(%rsi,%rbx,8)
	movq	(%r8), %rax
	movq	%rax, 24(%rsi,%rbx,8)
	movl	(%rcx), %eax
	orl	$1, %eax
	movl	%eax, -52(%rbp)
	shlq	$2, %rdx
	addq	(%r12), %rdx
	movq	%rsi, %r13
	leaq	-52(%rbp), %rsi
	movq	%rdx, %rdi
	movl	$4, %edx
	callq	_memcpy
	movq	%r14, 8(%r13,%rbx,8)
	movl	$1, (%r15)
	movq	%r12, %rdi
	callq	_I40E_INC_PD_REFCNT
	movq	%r13, %rsi
LBB0_11:
	leaq	(%rsi,%rbx,8), %rdi
	addq	$16, %rdi
	callq	_I40E_INC_BP_REFCNT
LBB0_12:
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_1:
	movl	%r13d, %eax
	xorl	%edx, %edx
	divl	%ebx
                                        ## kill: def $edx killed $edx def $rdx
	movl	%eax, %r14d
	cmpq	(%rsi), %r14
	jb	LBB0_5
LBB0_4:
	movq	_I40E_ERR_INVALID_PAGE_DESC_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	leaq	L_.str(%rip), %rsi
	callq	_hw_dbg
LBB0_13:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	_i40e_mem_bp@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_I40E_HMC_PAGED_BP_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_I40E_HMC_PD_BP_BUF_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	-48(%rbp), %rsi
	callq	_i40e_allocate_dma_mem
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_13
## %bb.9:
	xorl	%eax, %eax
	leaq	-48(%rbp), %rcx
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	_I40E_SD_TYPE_PAGED@GOTPCREL(%rip), %r8
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_I40E_HMC_PD_CNT_IN_SD,8,3      ## @I40E_HMC_PD_CNT_IN_SD
	.comm	_I40E_ERR_INVALID_PAGE_DESC_INDEX,8,3 ## @I40E_ERR_INVALID_PAGE_DESC_INDEX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"i40e_add_pd_table_entry: bad pd_index\n"

	.comm	_I40E_SD_TYPE_PAGED,8,3         ## @I40E_SD_TYPE_PAGED
	.comm	_i40e_mem_bp,4,2                ## @i40e_mem_bp
	.comm	_I40E_HMC_PAGED_BP_SIZE,4,2     ## @I40E_HMC_PAGED_BP_SIZE
	.comm	_I40E_HMC_PD_BP_BUF_ALIGNMENT,4,2 ## @I40E_HMC_PD_BP_BUF_ALIGNMENT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40e_add_pd_table_entry        ; -- Begin function i40e_add_pd_table_entry
	.p2align	2
_i40e_add_pd_table_entry:               ; @i40e_add_pd_table_entry
	.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
Lloh0:
	adrp	x8, _I40E_HMC_PD_CNT_IN_SD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I40E_HMC_PD_CNT_IN_SD@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	udiv	x22, x2, x8
	ldr	x9, [x1]
	cmp	x22, x9
	b.hs	LBB0_7
; %bb.1:
Lloh3:
	adrp	x25, _I40E_SD_TYPE_PAGED@GOTPAGE
Lloh4:
	ldr	x25, [x25, _I40E_SD_TYPE_PAGED@GOTPAGEOFF]
	ldr	x10, [x25]
	ldr	x9, [x1, #8]
	mov	w11, #24
	mul	x11, x22, x11
	ldr	x11, [x9, x11]
	cmp	x10, x11
	b.ne	LBB0_6
; %bb.2:
	mov	x19, x2
	msub	x23, x22, x8, x2
	mov	w8, #24
	madd	x28, x22, x8, x9
	ldr	x24, [x28, #16]
	mov	w8, #40
	madd	x26, x23, x8, x24
	ldr	w8, [x26]
	cbnz	w8, LBB0_5
; %bb.3:
	mov	x20, x3
	mov	w27, #1
	mov	w8, #1
	cbz	x3, LBB0_9
LBB0_4:
	add	x21, x28, #8
	mov	w9, #40
	madd	x28, x23, x9, x24
	str	w8, [x28, #4]
	ldr	w8, [x20]
	str	w8, [x28, #32]
	str	x19, [x28, #16]
	ldr	x8, [x25]
	str	x8, [x28, #24]
	ldr	w8, [x20]
	orr	w8, w8, #0x1
	str	w8, [sp, #4]
	ldr	x8, [x21]
	add	x0, x8, x23, lsl #2
	add	x1, sp, #4
	mov	w2, #4
	bl	_memcpy
	str	x22, [x28, #8]
	str	w27, [x26]
	mov	x0, x21
	bl	_I40E_INC_PD_REFCNT
LBB0_5:
	mov	w8, #40
	madd	x8, x23, x8, x24
	add	x0, x8, #16
	bl	_I40E_INC_BP_REFCNT
LBB0_6:
	mov	x21, #0
	b	LBB0_8
LBB0_7:
Lloh5:
	adrp	x8, _I40E_ERR_INVALID_PAGE_DESC_INDEX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I40E_ERR_INVALID_PAGE_DESC_INDEX@GOTPAGEOFF]
Lloh7:
	ldr	x21, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_hw_dbg
LBB0_8:
	mov	x0, x21
	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
LBB0_9:
Lloh10:
	adrp	x8, _i40e_mem_bp@GOTPAGE
Lloh11:
	ldr	x8, [x8, _i40e_mem_bp@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
Lloh13:
	adrp	x8, _I40E_HMC_PAGED_BP_SIZE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _I40E_HMC_PAGED_BP_SIZE@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
Lloh16:
	adrp	x8, _I40E_HMC_PD_BP_BUF_ALIGNMENT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _I40E_HMC_PD_BP_BUF_ALIGNMENT@GOTPAGEOFF]
Lloh18:
	ldr	w4, [x8]
	add	x20, sp, #8
	add	x1, sp, #8
	bl	_i40e_allocate_dma_mem
	mov	x21, x0
	cbnz	x0, LBB0_8
; %bb.10:
	mov	w8, #0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_I40E_HMC_PD_CNT_IN_SD,8,3      ; @I40E_HMC_PD_CNT_IN_SD
	.comm	_I40E_ERR_INVALID_PAGE_DESC_INDEX,8,3 ; @I40E_ERR_INVALID_PAGE_DESC_INDEX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"i40e_add_pd_table_entry: bad pd_index\n"

	.comm	_I40E_SD_TYPE_PAGED,8,3         ; @I40E_SD_TYPE_PAGED
	.comm	_i40e_mem_bp,4,2                ; @i40e_mem_bp
	.comm	_I40E_HMC_PAGED_BP_SIZE,4,2     ; @I40E_HMC_PAGED_BP_SIZE
	.comm	_I40E_HMC_PD_BP_BUF_ALIGNMENT,4,2 ; @I40E_HMC_PD_BP_BUF_ALIGNMENT
.subsections_via_symbols
