	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function cnic_alloc_context
LCPI0_0:
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_cnic_alloc_context:                    ## @cnic_alloc_context
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	movq	%r12, %rdi
	callq	_BNX2_CHIP
	movq	%rax, %rcx
	movq	_BNX2_CHIP_5709@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_27
## %bb.1:
	movq	_CNIC_PAGE_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	movl	%eax, (%r12)
	movl	(%r15), %eax
	leal	127(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$7, %ecx
	movl	%ecx, 4(%r12)
	movq	_BNX2_MAX_CID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,4), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	movq	%rax, 16(%r12)
	testq	%rax, %rax
	je	LBB0_26
## %bb.2:
	movq	_BNX2_PG_CTX_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_cnic_reg_rd_ind
	movzwl	%ax, %ecx
	movl	%eax, %edi
	sarl	$16, %edi
	xorl	%r13d, %r13d
	cmpl	%ecx, %edi
	jge	LBB0_10
## %bb.3:
	movq	16(%r12), %r8
	movl	4(%r12), %esi
	leal	(%rsi,%rdi), %edx
	xorl	%ebx, %ebx
	cmpl	%ecx, %edx
	movl	%ecx, %eax
	cmovgl	%edx, %eax
	setl	%bl
	addl	%ebx, %edx
	subl	%edx, %eax
	xorl	%r13d, %r13d
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
	addl	%ebx, %eax
	cmpl	$7, %eax
	jae	LBB0_5
## %bb.4:
	movl	%edi, %edx
	jmp	LBB0_8
LBB0_5:
	incq	%rax
	movq	%rax, %r13
	andq	$-8, %r13
	movl	%esi, %edx
	imull	%r13d, %edx
	addl	%edi, %edx
	movd	%edi, %xmm0
	pshufd	$0, %xmm0, %xmm1                ## xmm1 = xmm0[0,0,0,0]
	movd	%esi, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movdqa	LCPI0_0(%rip), %xmm2            ## xmm2 = [0,1,2,3]
	pmulld	%xmm0, %xmm2
	paddd	%xmm1, %xmm2
	pslld	$2, %xmm0
	xorl	%edi, %edi
	movq	%r8, %rbx
	movdqa	%xmm2, %xmm1
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movd	%xmm2, (%rbx)
	pextrd	$1, %xmm2, 24(%rbx)
	pextrd	$2, %xmm2, 48(%rbx)
	pextrd	$3, %xmm2, 72(%rbx)
	paddd	%xmm0, %xmm1
	movd	%xmm1, 96(%rbx)
	pextrd	$1, %xmm1, 120(%rbx)
	pextrd	$2, %xmm1, 144(%rbx)
	pextrd	$3, %xmm1, 168(%rbx)
	addq	$8, %rdi
	paddd	%xmm0, %xmm1
	addq	$192, %rbx
	movdqa	%xmm1, %xmm2
	cmpq	%r13, %rdi
	jne	LBB0_6
## %bb.7:
	cmpq	%r13, %rax
	je	LBB0_10
LBB0_8:
	leaq	(,%r13,2), %rax
	addq	%r13, %rax
	leaq	(%r8,%rax,8), %rax
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edx, (%rax)
	incq	%r13
	addq	$24, %rax
	addl	%esi, %edx
	cmpl	%ecx, %edx
	jl	LBB0_9
LBB0_10:
	movq	_BNX2_ISCSI_CTX_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_cnic_reg_rd_ind
	movzwl	%ax, %esi
	movl	%eax, %ebx
	sarl	$16, %ebx
	cmpl	%esi, %ebx
	jge	LBB0_13
## %bb.11:
	movq	16(%r12), %r8
	movl	4(%r12), %r10d
	leal	(%r10,%rbx), %ecx
	xorl	%edi, %edi
	cmpl	%esi, %ecx
	movl	%esi, %eax
	cmovgl	%ecx, %eax
	movslq	%r13d, %r9
	setl	%dil
	addl	%edi, %ecx
	subl	%ecx, %eax
	xorl	%edx, %edx
	divl	%r10d
                                        ## kill: def $eax killed $eax def $rax
	addl	%edi, %eax
	cmpl	$7, %eax
	jae	LBB0_14
## %bb.12:
	movq	%r9, %r13
	movl	%ebx, %edx
	jmp	LBB0_17
LBB0_13:
	movl	4(%r12), %r10d
	jmp	LBB0_19
LBB0_14:
	incq	%rax
	movq	%rax, %rdi
	andq	$-8, %rdi
	leaq	(%rdi,%r9), %r13
	movl	%r10d, %edx
	imull	%edi, %edx
	addl	%ebx, %edx
	movd	%ebx, %xmm0
	pshufd	$0, %xmm0, %xmm1                ## xmm1 = xmm0[0,0,0,0]
	movd	%r10d, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movdqa	LCPI0_0(%rip), %xmm2            ## xmm2 = [0,1,2,3]
	pmulld	%xmm0, %xmm2
	paddd	%xmm1, %xmm2
	pslld	$2, %xmm0
	leaq	(%r9,%r9,2), %rcx
	leaq	(%r8,%rcx,8), %rbx
	xorl	%ecx, %ecx
	movdqa	%xmm2, %xmm1
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movd	%xmm2, (%rbx)
	pextrd	$1, %xmm2, 24(%rbx)
	pextrd	$2, %xmm2, 48(%rbx)
	pextrd	$3, %xmm2, 72(%rbx)
	paddd	%xmm0, %xmm1
	movd	%xmm1, 96(%rbx)
	pextrd	$1, %xmm1, 120(%rbx)
	pextrd	$2, %xmm1, 144(%rbx)
	pextrd	$3, %xmm1, 168(%rbx)
	addq	$8, %rcx
	paddd	%xmm0, %xmm1
	addq	$192, %rbx
	movdqa	%xmm1, %xmm2
	cmpq	%rdi, %rcx
	jne	LBB0_15
## %bb.16:
	cmpq	%rdi, %rax
	je	LBB0_19
LBB0_17:
	leaq	(,%r13,2), %rax
	addq	%r13, %rax
	leaq	(%r8,%rax,8), %rax
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movl	%edx, (%rax)
	incq	%r13
	addq	$24, %rax
	addl	%r10d, %edx
	cmpl	%esi, %edx
	jl	LBB0_18
LBB0_19:
	movq	_BNX2_MAX_CID@GOTPCREL(%rip), %rax
	movl	%r13d, 8(%r12)
	movl	(%rax), %eax
	cltd
	idivl	%r10d
	cmpl	%eax, %r13d
	jge	LBB0_25
## %bb.20:
	testl	%r13d, %r13d
	jle	LBB0_28
## %bb.21:
	movq	16(%r12), %rdx
	movl	$16, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movl	(%r15), %esi
	addq	%rbx, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	16(%r12), %rdx
	movq	%rax, -8(%rdx,%rbx)
	testq	%rax, %rax
	je	LBB0_26
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	incq	%r13
	movslq	8(%r12), %rax
	addq	$24, %rbx
	cmpq	%rax, %r13
	jl	LBB0_22
LBB0_28:
	xorl	%eax, %eax
	jmp	LBB0_27
LBB0_25:
	movl	$0, 8(%r12)
LBB0_26:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BNX2_CHIP_5709,8,3             ## @BNX2_CHIP_5709
	.comm	_CNIC_PAGE_SIZE,4,2             ## @CNIC_PAGE_SIZE
	.comm	_BNX2_MAX_CID,4,2               ## @BNX2_MAX_CID
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_BNX2_PG_CTX_MAP,4,2            ## @BNX2_PG_CTX_MAP
	.comm	_BNX2_ISCSI_CTX_MAP,4,2         ## @BNX2_ISCSI_CTX_MAP
	.no_dead_strip	_cnic_alloc_context
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cnic_alloc_context
_cnic_alloc_context:                    ; @cnic_alloc_context
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	ldr	x19, [x0, #8]
	mov	x0, x19
	bl	_BNX2_CHIP
Lloh0:
	adrp	x8, _BNX2_CHIP_5709@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BNX2_CHIP_5709@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_26
; %bb.1:
Lloh3:
	adrp	x21, _CNIC_PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _CNIC_PAGE_SIZE@GOTPAGEOFF]
	ldr	w8, [x21]
	str	w8, [x19]
	ldr	w8, [x21]
	add	w9, w8, #127
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #7
	str	w8, [x19, #4]
Lloh5:
	adrp	x23, _BNX2_MAX_CID@GOTPAGE
Lloh6:
	ldr	x23, [x23, _BNX2_MAX_CID@GOTPAGEOFF]
	ldr	w9, [x23]
	sdiv	w8, w9, w8
	lsl	w0, w8, #2
Lloh7:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_kzalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_28
; %bb.2:
Lloh9:
	adrp	x8, _BNX2_PG_CTX_MAP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BNX2_PG_CTX_MAP@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_cnic_reg_rd_ind
	asr	w12, w0, #16
	and	w8, w0, #0xffff
	cmp	w12, w8
	b.ge	LBB0_5
; %bb.3:
	ldr	w9, [x19, #4]
	add	w10, w9, w12
	cmp	w10, w8
	csel	w11, w10, w8, gt
	cinc	w13, w10, lt
	sub	w13, w11, w13
	cmp	w10, w8
	ldr	x11, [x19, #16]
	udiv	w10, w13, w9
	cinc	w10, w10, lt
	cmp	w10, #3
	b.hs	LBB0_6
; %bb.4:
	mov	x24, #0
	mov	x10, x12
	b	LBB0_9
LBB0_5:
	mov	w24, #0
	b	LBB0_11
LBB0_6:
	mov	x13, #0
	add	x14, x10, #1
	and	x24, x14, #0x1fffffffc
	madd	w10, w9, w24, w12
	lsl	w15, w9, #1
	add	w16, w15, w9
	lsl	w17, w9, #2
	add	x0, x11, #48
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	w1, w9, w12
	add	w2, w15, w12
	add	w3, w16, w12
	stur	w12, [x0, #-48]
	stur	w1, [x0, #-24]
	str	w2, [x0]
	str	w3, [x0, #24]
	add	x13, x13, #4
	add	w12, w12, w17
	add	x0, x0, #96
	cmp	x13, x24
	b.ne	LBB0_7
; %bb.8:
	cmp	x14, x24
	b.eq	LBB0_11
LBB0_9:
	mov	w12, #24
	mul	x12, x24, x12
	add	x11, x11, x12
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	str	w10, [x11], #24
	add	x24, x24, #1
	add	w10, w10, w9
	cmp	w10, w8
	b.lt	LBB0_10
LBB0_11:
Lloh12:
	adrp	x8, _BNX2_ISCSI_CTX_MAP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BNX2_ISCSI_CTX_MAP@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_cnic_reg_rd_ind
	asr	w12, w0, #16
	and	w9, w0, #0xffff
	cmp	w12, w9
	b.ge	LBB0_14
; %bb.12:
	ldr	w8, [x19, #4]
	add	w10, w8, w12
	cmp	w10, w9
	csel	w11, w10, w9, gt
	cinc	w13, w10, lt
	sub	w13, w11, w13
	cmp	w10, w9
	ldr	x11, [x19, #16]
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	sxtw	x1, w24
	udiv	w10, w13, w8
	cinc	w10, w10, lt
	cmp	w10, #3
	b.hs	LBB0_15
; %bb.13:
	mov	x24, x1
	mov	x10, x12
	b	LBB0_18
LBB0_14:
	ldr	w8, [x19, #4]
	b	LBB0_21
LBB0_15:
	mov	x13, #0
	add	x14, x10, #1
	and	x15, x14, #0x1fffffffc
	add	x24, x15, x1
	madd	w10, w8, w15, w12
	lsl	w16, w8, #1
	add	w17, w16, w8
	lsl	w0, w8, #2
	mov	w2, #24
	madd	x1, x1, x2, x11
	add	x1, x1, #48
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	add	w2, w8, w12
	add	w3, w16, w12
	add	w4, w17, w12
	stur	w12, [x1, #-48]
	stur	w2, [x1, #-24]
	str	w3, [x1]
	str	w4, [x1, #24]
	add	x13, x13, #4
	add	w12, w12, w0
	add	x1, x1, #96
	cmp	x13, x15
	b.ne	LBB0_16
; %bb.17:
	cmp	x14, x15
	b.eq	LBB0_20
LBB0_18:
	mov	w12, #24
	madd	x11, x24, x12, x11
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	str	w10, [x11], #24
	add	x24, x24, #1
	add	w10, w10, w8
	cmp	w10, w9
	b.lt	LBB0_19
LBB0_20:
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
LBB0_21:
	str	w24, [x19, #8]
	ldr	w9, [x23]
	sdiv	w8, w9, w8
	cmp	w24, w8
	b.ge	LBB0_27
; %bb.22:
	cmp	w24, #1
	b.lt	LBB0_26
; %bb.23:
	mov	x23, #0
	ldr	x8, [x19, #16]
	mov	w24, #8
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	ldr	w1, [x21]
	add	x8, x8, x24
	add	x2, x8, #8
	ldr	w3, [x22]
	bl	_dma_alloc_coherent
	ldr	x8, [x19, #16]
	str	x0, [x8, x24]
	cbz	x0, LBB0_28
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=1
	add	x23, x23, #1
	ldrsw	x9, [x19, #8]
	add	x24, x24, #24
	cmp	x23, x9
	b.lt	LBB0_24
LBB0_26:
	mov	w0, #0
	b	LBB0_29
LBB0_27:
	str	wzr, [x19, #8]
LBB0_28:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_29:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_BNX2_CHIP_5709,8,3             ; @BNX2_CHIP_5709
	.comm	_CNIC_PAGE_SIZE,4,2             ; @CNIC_PAGE_SIZE
	.comm	_BNX2_MAX_CID,4,2               ; @BNX2_MAX_CID
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_BNX2_PG_CTX_MAP,4,2            ; @BNX2_PG_CTX_MAP
	.comm	_BNX2_ISCSI_CTX_MAP,4,2         ; @BNX2_ISCSI_CTX_MAP
	.no_dead_strip	_cnic_alloc_context
.subsections_via_symbols
