	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_init_av_table            ## -- Begin function mthca_init_av_table
	.p2align	4, 0x90
_mthca_init_av_table:                   ## @mthca_init_av_table
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_mthca_is_memfree
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_7
## %bb.1:
	leaq	12(%rbx), %r14
	movl	8(%rbx), %esi
	leal	-1(%rsi), %edx
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%ecx, %ecx
	callq	_mthca_alloc_init
	testl	%eax, %eax
	jne	LBB0_7
## %bb.2:
	movq	48(%rbx), %rsi
	movq	_MTHCA_AV_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%ecx, %edx
	xorl	%r8d, %r8d
	callq	_dma_pool_create
	movl	%eax, 16(%rbx)
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:
	movq	_MTHCA_FLAG_DDR_HIDDEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_4
## %bb.8:
	movq	$0, 24(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_4:
	movq	48(%rbx), %rdi
	movl	$4, %esi
	callq	_pci_resource_start
	addq	32(%rbx), %rax
	subq	40(%rbx), %rax
	movl	(%r12), %esi
	imull	8(%rbx), %esi
	movq	%rax, %rdi
	callq	_ioremap
	movq	%rax, %rcx
	movq	%rax, 24(%rbx)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_7
## %bb.5:
	movl	16(%rbx), %edi
	callq	_dma_pool_destroy
LBB0_6:
	movq	%r14, %rdi
	callq	_mthca_alloc_cleanup
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	movl	%r15d, %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mthca_av"

	.comm	_MTHCA_AV_SIZE,4,2              ## @MTHCA_AV_SIZE
	.comm	_MTHCA_FLAG_DDR_HIDDEN,4,2      ## @MTHCA_FLAG_DDR_HIDDEN
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_init_av_table            ; -- Begin function mthca_init_av_table
	.p2align	2
_mthca_init_av_table:                   ; @mthca_init_av_table
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	bl	_mthca_is_memfree
	cbz	x0, LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_9
LBB0_2:
	add	x20, x19, #12
	ldr	w1, [x19, #8]
	sub	w2, w1, #1
	mov	x0, x20
	mov	w3, #0
	bl	_mthca_alloc_init
	cbnz	w0, LBB0_9
; %bb.3:
	ldr	x1, [x19, #48]
Lloh0:
	adrp	x21, _MTHCA_AV_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MTHCA_AV_SIZE@GOTPAGEOFF]
	ldr	w2, [x21]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x2
	mov	w4, #0
	bl	_dma_pool_create
	str	w0, [x19, #16]
	cbz	w0, LBB0_8
; %bb.4:
	ldr	w8, [x19]
Lloh4:
	adrp	x9, _MTHCA_FLAG_DDR_HIDDEN@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MTHCA_FLAG_DDR_HIDDEN@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	mov	w0, #0
	str	xzr, [x19, #24]
	b	LBB0_9
LBB0_6:
	ldr	x0, [x19, #48]
	mov	w1, #4
	bl	_pci_resource_start
	ldp	x8, x9, [x19, #32]
	add	x8, x8, x0
	sub	x0, x8, x9
	ldr	w8, [x19, #8]
	ldr	w9, [x21]
	mul	w1, w9, w8
	bl	_ioremap
	str	x0, [x19, #24]
	cbnz	x0, LBB0_1
; %bb.7:
	ldr	w0, [x19, #16]
	bl	_dma_pool_destroy
LBB0_8:
	mov	x0, x20
	bl	_mthca_alloc_cleanup
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mthca_av"

	.comm	_MTHCA_AV_SIZE,4,2              ; @MTHCA_AV_SIZE
	.comm	_MTHCA_FLAG_DDR_HIDDEN,4,2      ; @MTHCA_FLAG_DDR_HIDDEN
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
