	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ocrdma_mbx_create_ah_tbl
_ocrdma_mbx_create_ah_tbl:              ## @ocrdma_mbx_create_ah_tbl
	.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	%rdi, %r13
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	xorl	%ebx, %ebx
	movq	40(%rdi), %r15
	movq	_OCRDMA_CMD_CREATE_AH_TBL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$16, %esi
	callq	_ocrdma_init_emb_mqe
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	movq	%rax, %r14
	movq	_OCRDMA_MAX_AH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leal	(,%rax,4), %eax
	movl	%eax, (%r13)
	movq	_OCRDMA_AH_TBL_PAGES@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_OCRDMA_CREATE_AH_NUM_PAGES_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r8d
	movq	_OCRDMA_CREATE_AH_NUM_PAGES_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r8d
	movl	%r8d, (%r14)
	movq	_OCRDMA_MAX_Q_PAGE_SIZE_CNT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%edx, %edx
	jle	LBB0_6
## %bb.2:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_OCRDMA_MIN_Q_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, %edi
	movl	%ebx, %ecx
	shll	%cl, %edi
	cmpl	%edi, %esi
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	cmpl	%ebx, %edx
	jne	LBB0_3
## %bb.5:
	movl	%edx, %ebx
LBB0_6:
	movq	_OCRDMA_CREATE_AH_PAGE_SIZE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_OCRDMA_CREATE_AH_PAGE_SIZE_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	orl	%r8d, %ebx
	movl	%ebx, (%r14)
	movq	_OCRDMA_CREATE_AH_ENTRY_SIZE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$4, %eax
	shlq	%cl, %rax
	movq	_OCRDMA_CREATE_AH_ENTRY_SIZE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	orl	%ebx, %eax
	movl	%eax, (%r14)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	16(%r13), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movq	%r15, %rdi
	callq	_dma_alloc_coherent
	movq	%rax, 24(%r13)
	testq	%rax, %rax
	je	LBB0_15
## %bb.7:
	movl	(%r13), %esi
	movl	(%rbx), %ecx
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_dma_alloc_coherent
	movq	%rax, 32(%r13)
	testq	%rax, %rax
	je	LBB0_14
## %bb.8:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %edi
	movl	%edi, 4(%r13)
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, 8(%r13)
	movl	(%r13), %eax
	movq	_OCRDMA_MIN_Q_PAGE_SIZE@GOTPCREL(%rip), %r12
	cltd
	idivl	(%r12)
	testl	%eax, %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r14
	jle	LBB0_11
## %bb.9:
	movq	24(%r13), %rbx
	addq	$8, %rbx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	callq	_cpu_to_le32
	movq	%rax, (%rbx)
	movl	-44(%rbp), %edi
	callq	_upper_32_bits
	movl	%eax, %edi
	callq	_cpu_to_le32
	movq	%rax, -8(%rbx)
	movl	-44(%rbp), %edi
	addl	(%r14), %edi
	movl	%edi, -44(%rbp)
	movl	(%r13), %eax
	cltd
	idivl	(%r12)
	incq	%r15
	cltq
	addq	$16, %rbx
	cmpq	%rax, %r15
	jl	LBB0_10
LBB0_11:
	movl	16(%r13), %edi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	8(%r14), %rax
	movq	%rdi, 8(%rax)
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_upper_32_bits
	cltq
	movq	8(%r14), %rcx
	movq	%rax, (%rcx)
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_ocrdma_mbx_cmd
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	%eax, %r12d
	movq	32(%r13), %rdx
	movl	(%r13), %esi
	movl	4(%r13), %ecx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_dma_free_coherent
	movq	$0, 32(%r13)
LBB0_14:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	24(%r13), %rdx
	movl	16(%r13), %ecx
	movq	%r15, %rdi
	callq	_dma_free_coherent
	movq	$0, 24(%r13)
	movl	$0, (%r13)
	jmp	LBB0_15
LBB0_12:
	movzwl	(%r14), %eax
	movl	%eax, 12(%r13)
	xorl	%r12d, %r12d
LBB0_15:
	movq	%r14, %rdi
	callq	_kfree
LBB0_16:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_OCRDMA_CMD_CREATE_AH_TBL,4,2   ## @OCRDMA_CMD_CREATE_AH_TBL
	.comm	_OCRDMA_MAX_AH,4,2              ## @OCRDMA_MAX_AH
	.comm	_OCRDMA_AH_TBL_PAGES,4,2        ## @OCRDMA_AH_TBL_PAGES
	.comm	_OCRDMA_CREATE_AH_NUM_PAGES_SHIFT,4,2 ## @OCRDMA_CREATE_AH_NUM_PAGES_SHIFT
	.comm	_OCRDMA_CREATE_AH_NUM_PAGES_MASK,4,2 ## @OCRDMA_CREATE_AH_NUM_PAGES_MASK
	.comm	_OCRDMA_MAX_Q_PAGE_SIZE_CNT,4,2 ## @OCRDMA_MAX_Q_PAGE_SIZE_CNT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_OCRDMA_MIN_Q_PAGE_SIZE,4,2     ## @OCRDMA_MIN_Q_PAGE_SIZE
	.comm	_OCRDMA_CREATE_AH_PAGE_SIZE_SHIFT,4,2 ## @OCRDMA_CREATE_AH_PAGE_SIZE_SHIFT
	.comm	_OCRDMA_CREATE_AH_PAGE_SIZE_MASK,4,2 ## @OCRDMA_CREATE_AH_PAGE_SIZE_MASK
	.comm	_OCRDMA_CREATE_AH_ENTRY_SIZE_SHIFT,4,2 ## @OCRDMA_CREATE_AH_ENTRY_SIZE_SHIFT
	.comm	_OCRDMA_CREATE_AH_ENTRY_SIZE_MASK,4,2 ## @OCRDMA_CREATE_AH_ENTRY_SIZE_MASK
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_ocrdma_mbx_create_ah_tbl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ocrdma_mbx_create_ah_tbl
_ocrdma_mbx_create_ah_tbl:              ; @ocrdma_mbx_create_ah_tbl
	.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, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	ldr	x21, [x0, #40]
Lloh3:
	adrp	x8, _OCRDMA_CMD_CREATE_AH_TBL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OCRDMA_CMD_CREATE_AH_TBL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	w1, #16
	bl	_ocrdma_init_emb_mqe
	cbz	x0, LBB0_17
; %bb.1:
	mov	x20, x0
Lloh6:
	adrp	x8, _OCRDMA_MAX_AH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _OCRDMA_MAX_AH@GOTPAGEOFF]
Lloh8:
	ldr	w25, [x8]
	lsl	w8, w25, #2
	str	w8, [x19]
Lloh9:
	adrp	x8, _OCRDMA_AH_TBL_PAGES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _OCRDMA_AH_TBL_PAGES@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _OCRDMA_CREATE_AH_NUM_PAGES_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _OCRDMA_CREATE_AH_NUM_PAGES_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _OCRDMA_CREATE_AH_NUM_PAGES_MASK@GOTPAGE
Lloh16:
	ldr	x10, [x10, _OCRDMA_CREATE_AH_NUM_PAGES_MASK@GOTPAGEOFF]
	lsl	w8, w8, w9
Lloh17:
	ldr	w9, [x10]
	and	w8, w8, w9
	str	w8, [x0]
Lloh18:
	adrp	x9, _OCRDMA_MAX_Q_PAGE_SIZE_CNT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _OCRDMA_MAX_Q_PAGE_SIZE_CNT@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x9]
Lloh21:
	adrp	x23, _PAGE_SIZE@GOTPAGE
Lloh22:
	ldr	x23, [x23, _PAGE_SIZE@GOTPAGEOFF]
Lloh23:
	adrp	x24, _OCRDMA_MIN_Q_PAGE_SIZE@GOTPAGE
Lloh24:
	ldr	x24, [x24, _OCRDMA_MIN_Q_PAGE_SIZE@GOTPAGEOFF]
	cmp	w10, #1
	b.lt	LBB0_6
; %bb.2:
	mov	w9, #0
	ldr	w11, [x23]
	ldr	w12, [x24]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w13, w12, w9
	cmp	w11, w13
	b.eq	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w9, w9, #1
	cmp	w10, w9
	b.ne	LBB0_3
; %bb.5:
	mov	x9, x10
	b	LBB0_7
LBB0_6:
	mov	w9, #0
LBB0_7:
Lloh25:
	adrp	x10, _OCRDMA_CREATE_AH_PAGE_SIZE_SHIFT@GOTPAGE
Lloh26:
	ldr	x10, [x10, _OCRDMA_CREATE_AH_PAGE_SIZE_SHIFT@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
	lsl	w9, w9, w10
Lloh28:
	adrp	x10, _OCRDMA_CREATE_AH_PAGE_SIZE_MASK@GOTPAGE
Lloh29:
	ldr	x10, [x10, _OCRDMA_CREATE_AH_PAGE_SIZE_MASK@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	and	w9, w9, w10
	orr	w8, w9, w8
	str	w8, [x20]
Lloh31:
	adrp	x9, _OCRDMA_CREATE_AH_ENTRY_SIZE_SHIFT@GOTPAGE
Lloh32:
	ldr	x9, [x9, _OCRDMA_CREATE_AH_ENTRY_SIZE_SHIFT@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	mov	w10, #4
	lsl	x9, x10, x9
Lloh34:
	adrp	x10, _OCRDMA_CREATE_AH_ENTRY_SIZE_MASK@GOTPAGE
Lloh35:
	ldr	x10, [x10, _OCRDMA_CREATE_AH_ENTRY_SIZE_MASK@GOTPAGEOFF]
Lloh36:
	ldr	w10, [x10]
	and	w9, w10, w9
	orr	w8, w9, w8
	str	w8, [x20]
	ldr	w1, [x23]
	add	x2, x19, #16
Lloh37:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh38:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x26]
	mov	x0, x21
	bl	_dma_alloc_coherent
	str	x0, [x19, #24]
	cbz	x0, LBB0_16
; %bb.8:
	ldr	w1, [x19]
	ldr	w3, [x26]
	add	x2, sp, #12
	mov	x0, x21
	bl	_dma_alloc_coherent
	str	x0, [x19, #32]
	cbz	x0, LBB0_14
; %bb.9:
	ldr	w0, [sp, #12]
	stp	w0, w25, [x19, #4]
	ldr	w8, [x19]
	ldr	w9, [x24]
	sdiv	w8, w8, w9
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.10:
	mov	x22, #0
	ldr	x8, [x19, #24]
	add	x25, x8, #8
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	bl	_cpu_to_le32
	str	x0, [x25]
	ldr	w0, [sp, #12]
	bl	_upper_32_bits
	bl	_cpu_to_le32
	stur	x0, [x25, #-8]
	ldr	w8, [x23]
	ldr	w9, [sp, #12]
	add	w0, w9, w8
	str	w0, [sp, #12]
	add	x22, x22, #1
	ldr	w8, [x19]
	ldr	w9, [x24]
	sdiv	w8, w8, w9
	add	x25, x25, #16
	cmp	x22, w8, sxtw
	b.lt	LBB0_11
LBB0_12:
	ldr	w0, [x19, #16]
	ldr	x8, [x20, #8]
	str	x0, [x8, #8]
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_upper_32_bits
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	ldr	x9, [x20, #8]
	str	x8, [x9]
	mov	x0, x19
	mov	x1, x20
	bl	_ocrdma_mbx_cmd
	mov	x22, x0
	cbz	w0, LBB0_15
; %bb.13:
	ldr	x2, [x19, #32]
	ldp	w1, w3, [x19]
	mov	x0, x21
	bl	_dma_free_coherent
	str	xzr, [x19, #32]
LBB0_14:
	ldr	w1, [x23]
	ldr	x2, [x19, #24]
	ldr	w3, [x19, #16]
	mov	x0, x21
	bl	_dma_free_coherent
	str	xzr, [x19, #24]
	str	wzr, [x19]
	b	LBB0_16
LBB0_15:
	ldrh	w8, [x20]
	str	w8, [x19, #12]
LBB0_16:
	mov	x0, x20
	bl	_kfree
LBB0_17:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_OCRDMA_CMD_CREATE_AH_TBL,4,2   ; @OCRDMA_CMD_CREATE_AH_TBL
	.comm	_OCRDMA_MAX_AH,4,2              ; @OCRDMA_MAX_AH
	.comm	_OCRDMA_AH_TBL_PAGES,4,2        ; @OCRDMA_AH_TBL_PAGES
	.comm	_OCRDMA_CREATE_AH_NUM_PAGES_SHIFT,4,2 ; @OCRDMA_CREATE_AH_NUM_PAGES_SHIFT
	.comm	_OCRDMA_CREATE_AH_NUM_PAGES_MASK,4,2 ; @OCRDMA_CREATE_AH_NUM_PAGES_MASK
	.comm	_OCRDMA_MAX_Q_PAGE_SIZE_CNT,4,2 ; @OCRDMA_MAX_Q_PAGE_SIZE_CNT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_OCRDMA_MIN_Q_PAGE_SIZE,4,2     ; @OCRDMA_MIN_Q_PAGE_SIZE
	.comm	_OCRDMA_CREATE_AH_PAGE_SIZE_SHIFT,4,2 ; @OCRDMA_CREATE_AH_PAGE_SIZE_SHIFT
	.comm	_OCRDMA_CREATE_AH_PAGE_SIZE_MASK,4,2 ; @OCRDMA_CREATE_AH_PAGE_SIZE_MASK
	.comm	_OCRDMA_CREATE_AH_ENTRY_SIZE_SHIFT,4,2 ; @OCRDMA_CREATE_AH_ENTRY_SIZE_SHIFT
	.comm	_OCRDMA_CREATE_AH_ENTRY_SIZE_MASK,4,2 ; @OCRDMA_CREATE_AH_ENTRY_SIZE_MASK
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_ocrdma_mbx_create_ah_tbl
.subsections_via_symbols
