	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40iw_add_sd_table_entry       ## -- Begin function i40iw_add_sd_table_entry
	.p2align	4, 0x90
_i40iw_add_sd_table_entry:              ## @i40iw_add_sd_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rsi), %r14
	imulq	$56, %rdx, %r15
	cmpl	$0, 48(%r14,%r15)
	je	LBB0_1
LBB0_9:
	movslq	(%r14,%r15), %rax
	movq	_I40IW_SD_TYPE_DIRECT@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	%rax, (%rcx)
	jne	LBB0_12
## %bb.10:
	leaq	(%r14,%r15), %rdi
	addq	$8, %rdi
	callq	_I40IW_INC_BP_REFCNT
	jmp	LBB0_12
LBB0_1:
	movq	%rdx, %r13
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	_I40IW_SD_TYPE_PAGED@GOTPCREL(%rip), %rax
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	cmpl	%ecx, (%rax)
	jne	LBB0_3
## %bb.2:
	movq	_I40IW_HMC_PAGED_BP_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
LBB0_3:
	movq	_I40IW_HMC_PD_BP_BUF_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %rsi
	movq	%rdi, %r12
	movl	%r8d, %edx
	callq	_i40iw_allocate_dma_mem
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_4
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movq	_I40IW_SD_TYPE_PAGED@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_7
## %bb.5:
	leaq	(%r14,%r15), %rax
	addq	$32, %rax
	movq	%r12, %r13
	movq	%rax, %r12
	movq	%r13, %rdi
	movq	%rax, %rsi
	movl	$2048, %edx                     ## imm = 0x800
	callq	_i40iw_allocate_virt_mem
	testl	%eax, %eax
	je	LBB0_6
## %bb.11:
	movl	%eax, %ebx
	leaq	-48(%rbp), %rsi
	movq	%r13, %rdi
	callq	_i40iw_free_dma_mem
	jmp	LBB0_12
LBB0_7:
	leaq	(%r14,%r15), %rdi
	addq	$16, %rdi
	leaq	-48(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	%r13, 8(%r14,%r15)
	jmp	LBB0_8
LBB0_6:
	movq	(%r12), %rax
	leaq	(%r14,%r15), %rdi
	addq	$24, %rdi
	movq	%rax, 40(%r14,%r15)
	leaq	-48(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
LBB0_8:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rax
	movl	%ebx, (%rax,%r15)
	callq	_I40IW_INC_SD_REFCNT
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_I40IW_SD_TYPE_PAGED,4,2        ## @I40IW_SD_TYPE_PAGED
	.comm	_I40IW_HMC_PAGED_BP_SIZE,4,2    ## @I40IW_HMC_PAGED_BP_SIZE
	.comm	_I40IW_HMC_PD_BP_BUF_ALIGNMENT,4,2 ## @I40IW_HMC_PD_BP_BUF_ALIGNMENT
	.comm	_I40IW_SD_TYPE_DIRECT,8,3       ## @I40IW_SD_TYPE_DIRECT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40iw_add_sd_table_entry       ; -- Begin function i40iw_add_sd_table_entry
	.p2align	2
_i40iw_add_sd_table_entry:              ; @i40iw_add_sd_table_entry
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x2
	ldr	x25, [x1]
	mov	w8, #56
	madd	x8, x2, x8, x25
	ldr	w8, [x8, #48]
	cbz	w8, LBB0_4
LBB0_1:
	mov	w8, #56
	mul	x8, x19, x8
	ldrsw	x8, [x25, x8]
Lloh0:
	adrp	x9, _I40IW_SD_TYPE_DIRECT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I40IW_SD_TYPE_DIRECT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_3
; %bb.2:
	mov	w8, #56
	madd	x8, x19, x8, x25
	add	x0, x8, #8
	bl	_I40IW_INC_BP_REFCNT
LBB0_3:
	mov	w23, #0
	b	LBB0_5
LBB0_4:
	mov	x21, x3
	mov	x20, x1
	mov	x22, x0
Lloh3:
	adrp	x24, _I40IW_SD_TYPE_PAGED@GOTPAGE
Lloh4:
	ldr	x24, [x24, _I40IW_SD_TYPE_PAGED@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh5:
	adrp	x9, _I40IW_HMC_PAGED_BP_SIZE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _I40IW_HMC_PAGED_BP_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w3
	csel	w2, w9, w4, eq
Lloh8:
	adrp	x8, _I40IW_HMC_PD_BP_BUF_ALIGNMENT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I40IW_HMC_PD_BP_BUF_ALIGNMENT@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	add	x1, sp, #8
	bl	_i40iw_allocate_dma_mem
	mov	x23, x0
	cbz	w0, LBB0_6
LBB0_5:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	ldr	w8, [x24]
	cmp	w8, w21
	b.ne	LBB0_9
; %bb.7:
	mov	w8, #56
	madd	x8, x19, x8, x25
	add	x24, x8, #32
	mov	x0, x22
	mov	x1, x24
	mov	w2, #2048
	bl	_i40iw_allocate_virt_mem
	cbz	w0, LBB0_10
; %bb.8:
	mov	x23, x0
	add	x1, sp, #8
	mov	x0, x22
	bl	_i40iw_free_dma_mem
	b	LBB0_5
LBB0_9:
	mov	w8, #56
	madd	x22, x19, x8, x25
	add	x0, x22, #16
	add	x1, sp, #8
	mov	w2, #4
	bl	_memcpy
	str	x19, [x22, #8]
	b	LBB0_11
LBB0_10:
	ldr	x8, [x24]
	mov	w9, #56
	madd	x9, x19, x9, x25
	add	x0, x9, #24
	str	x8, [x9, #40]
	add	x1, sp, #8
	mov	w2, #4
	bl	_memcpy
LBB0_11:
	ldr	x8, [x20]
	mov	w9, #56
	mul	x9, x19, x9
	str	w21, [x8, x9]
	mov	x0, x20
	bl	_I40IW_INC_SD_REFCNT
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_I40IW_SD_TYPE_PAGED,4,2        ; @I40IW_SD_TYPE_PAGED
	.comm	_I40IW_HMC_PAGED_BP_SIZE,4,2    ; @I40IW_HMC_PAGED_BP_SIZE
	.comm	_I40IW_HMC_PD_BP_BUF_ALIGNMENT,4,2 ; @I40IW_HMC_PD_BP_BUF_ALIGNMENT
	.comm	_I40IW_SD_TYPE_DIRECT,8,3       ; @I40IW_SD_TYPE_DIRECT
.subsections_via_symbols
