	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bnxt_alloc_ctx_pg_tbls
_bnxt_alloc_ctx_pg_tbls:                ## @bnxt_alloc_ctx_pg_tbls
	.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
	xorl	%eax, %eax
	testl	%edx, %edx
	je	LBB0_8
## %bb.1:
	movl	%ecx, %r12d
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_BNXT_PAGE_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	%edx, %edi
	callq	_DIV_ROUND_UP
	movl	%eax, (%r15)
	movq	_MAX_CTX_TOTAL_PAGES@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jge	LBB0_3
## %bb.2:
	movl	$0, (%r15)
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_MAX_CTX_PAGES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	cmpl	$1, %r12d
	jg	LBB0_5
## %bb.4:
	cmpl	%eax, %edi
	jl	LBB0_5
## %bb.18:
	movl	(%r13), %esi
	movl	%ebx, %edi
	callq	_DIV_ROUND_UP
	movl	%eax, 28(%r15)
	testl	%r12d, %r12d
	jne	LBB0_20
## %bb.19:
	cmpl	$2, %eax
	jl	LBB0_21
LBB0_20:
	movl	$1, 24(%r15)
LBB0_21:
	movq	%r14, %rdi
	movq	%r15, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bnxt_alloc_ctx_mem_blk         ## TAILCALL
LBB0_5:
	movl	$2, 24(%r15)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 40(%r15)
	testq	%rax, %rax
	je	LBB0_6
## %bb.9:
	movl	(%r15), %edi
	movq	_MAX_CTX_PAGES@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_DIV_ROUND_UP
	movq	%rax, %rbx
	movl	%ebx, 28(%r15)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_bnxt_alloc_ctx_mem_blk
	testl	%eax, %eax
	jne	LBB0_8
## %bb.10:
	movl	$0, %eax
	testl	%ebx, %ebx
	jle	LBB0_8
## %bb.11:
	leal	-1(%rbx), %r12d
	movl	%ebx, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%rax, %rsi
	movq	40(%r15), %rax
	movq	%rsi, (%rax,%rbx,8)
	movq	16(%r15), %rax
	movl	(%rax,%rbx,4), %eax
	movl	%eax, 36(%rsi)
	movq	8(%r15), %rax
	movl	(%rax,%rbx,4), %eax
	movl	%eax, 32(%rsi)
	movl	$1, 24(%rsi)
	movl	(%r13), %ecx
	movl	%ecx, 28(%rsi)
	cmpq	%rbx, %r12
	jne	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	(%r15), %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%edx, 28(%rsi)
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%r14, %rdi
	callq	_bnxt_alloc_ctx_mem_blk
	testl	%eax, %eax
	jne	LBB0_8
## %bb.12:                              ##   in Loop: Header=BB0_13 Depth=1
	incq	%rbx
	xorl	%eax, %eax
	cmpq	%rbx, -48(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_13
	jmp	LBB0_8
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_BNXT_PAGE_SIZE,4,2             ## @BNXT_PAGE_SIZE
	.comm	_MAX_CTX_TOTAL_PAGES,4,2        ## @MAX_CTX_TOTAL_PAGES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MAX_CTX_PAGES,4,2              ## @MAX_CTX_PAGES
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_bnxt_alloc_ctx_pg_tbls
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bnxt_alloc_ctx_pg_tbls
_bnxt_alloc_ctx_pg_tbls:                ; @bnxt_alloc_ctx_pg_tbls
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	w2, LBB0_20
; %bb.1:
	mov	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _BNXT_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _BNXT_PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x2
	bl	_DIV_ROUND_UP
	mov	x8, x0
	str	w8, [x19]
Lloh2:
	adrp	x9, _MAX_CTX_TOTAL_PAGES@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MAX_CTX_TOTAL_PAGES@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w9, w8
	b.ge	LBB0_4
; %bb.2:
	str	wzr, [x19]
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_21
LBB0_4:
Lloh7:
	adrp	x23, _MAX_CTX_PAGES@GOTPAGE
Lloh8:
	ldr	x23, [x23, _MAX_CTX_PAGES@GOTPAGEOFF]
	ldr	w0, [x23]
	cmp	w21, #1
	b.gt	LBB0_10
; %bb.5:
	cmp	w0, w8
	b.lt	LBB0_10
; %bb.6:
	ldr	w1, [x24]
	mov	x0, x22
	bl	_DIV_ROUND_UP
	str	w0, [x19, #28]
	cbnz	w21, LBB0_8
; %bb.7:
	cmp	w0, #2
	b.lt	LBB0_9
LBB0_8:
	mov	w8, #1
	str	w8, [x19, #24]
LBB0_9:
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_bnxt_alloc_ctx_mem_blk
LBB0_10:
	mov	w8, #2
	str	w8, [x19, #24]
Lloh9:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #40]
	cbz	x0, LBB0_22
; %bb.11:
	ldr	w0, [x19]
	ldr	w1, [x23]
	bl	_DIV_ROUND_UP
	mov	x21, x0
	str	w21, [x19, #28]
	mov	x0, x20
	mov	x1, x19
	bl	_bnxt_alloc_ctx_mem_blk
	cbnz	w0, LBB0_21
; %bb.12:
	cmp	w21, #1
	b.lt	LBB0_20
; %bb.13:
	mov	x24, #0
	sub	w25, w21, #1
	and	x21, x21, #0xffffffff
	mov	w26, #1
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_22
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x1, x0
	ldr	x8, [x19, #40]
	str	x0, [x8, x24, lsl #3]
	lsl	x8, x24, #2
	ldp	x10, x9, [x19, #8]
	ldr	w9, [x9, x8]
	str	w9, [x0, #36]
	ldr	w9, [x10, x8]
	ldr	w8, [x23]
	str	w26, [x0, #24]
	stp	w8, w9, [x0, #28]
	cmp	x25, x24
	b.ne	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w9, [x19]
	sdiv	w10, w9, w8
	msub	w8, w10, w8, w9
	cbz	w8, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	str	w8, [x1, #28]
LBB0_18:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	x0, x20
	bl	_bnxt_alloc_ctx_mem_blk
	cbnz	w0, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_14 Depth=1
	add	x24, x24, #1
	cmp	x21, x24
	b.ne	LBB0_14
	b	LBB0_21
LBB0_20:
	mov	w0, #0
LBB0_21:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_22:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_BNXT_PAGE_SIZE,4,2             ; @BNXT_PAGE_SIZE
	.comm	_MAX_CTX_TOTAL_PAGES,4,2        ; @MAX_CTX_TOTAL_PAGES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MAX_CTX_PAGES,4,2              ; @MAX_CTX_PAGES
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_bnxt_alloc_ctx_pg_tbls
.subsections_via_symbols
