	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_setup_cmd_doorbells
_mthca_setup_cmd_doorbells:             ## @mthca_setup_cmd_doorbells
	.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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_max
	movq	8(%rbx), %rcx
	movl	4(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movq	8(%rbx), %rcx
	movl	8(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movq	8(%rbx), %rcx
	movl	12(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movq	8(%rbx), %rcx
	movl	16(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movq	8(%rbx), %rcx
	movl	20(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movq	8(%rbx), %rcx
	movl	24(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movq	8(%rbx), %rcx
	movl	28(%rcx), %esi
	movl	%eax, %edi
	callq	_max
	movl	%eax, %r15d
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	leal	(%r15,%r14), %ecx
	xorl	%r14d, %ecx
	testl	%ecx, (%rax)
	je	LBB0_1
## %bb.3:
	movslq	%r14d, %rdx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mthca_warn                     ## TAILCALL
LBB0_1:
	movl	16(%rbx), %edi
	movl	$2, %esi
	callq	_pci_resource_start
	movq	%rax, %r12
	movl	16(%rbx), %edi
	movl	$2, %esi
	callq	_pci_resource_len
	decl	%eax
	andl	%r14d, %eax
	movslq	%eax, %rdi
	addq	%r12, %rdi
	addl	$4, %r15d
	movl	%r15d, %esi
	callq	_ioremap
	movl	%eax, 4(%rbx)
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movq	_MTHCA_CMD_POST_DOORBELLS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mthca_dbg                      ## TAILCALL
LBB0_2:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Firmware doorbell region at 0x%016llx, length 0x%x crosses a page boundary\n"

	.comm	_MTHCA_CMD_POST_DOORBELLS,4,2   ## @MTHCA_CMD_POST_DOORBELLS
L_.str.1:                               ## @.str.1
	.asciz	"Mapped doorbell page for posting FW commands\n"

	.no_dead_strip	_mthca_setup_cmd_doorbells
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_setup_cmd_doorbells
_mthca_setup_cmd_doorbells:             ; @mthca_setup_cmd_doorbells
	.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w1, [x8]
	mov	w0, #0
	bl	_max
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #4]
	bl	_max
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #8]
	bl	_max
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #12]
	bl	_max
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #16]
	bl	_max
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #20]
	bl	_max
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #24]
	bl	_max
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #28]
	bl	_max
	mov	x21, x0
Lloh0:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	add	w9, w0, w20
	eor	w9, w9, w20
	tst	w8, w9
	b.eq	LBB0_2
; %bb.1:
	sxtw	x2, w20
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x21
	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
	b	_mthca_warn
LBB0_2:
	ldr	w0, [x19, #16]
	mov	w1, #2
	bl	_pci_resource_start
	mov	x22, x0
	ldr	w0, [x19, #16]
	mov	w1, #2
	bl	_pci_resource_len
	sub	w8, w0, #1
	and	w8, w8, w20
	add	x0, x22, w8, sxtw
	add	w1, w21, #4
	bl	_ioremap
	str	w0, [x19, #4]
	cbz	w0, LBB0_4
; %bb.3:
Lloh5:
	adrp	x8, _MTHCA_CMD_POST_DOORBELLS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MTHCA_CMD_POST_DOORBELLS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	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
	b	_mthca_dbg
LBB0_4:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Firmware doorbell region at 0x%016llx, length 0x%x crosses a page boundary\n"

	.comm	_MTHCA_CMD_POST_DOORBELLS,4,2   ; @MTHCA_CMD_POST_DOORBELLS
l_.str.1:                               ; @.str.1
	.asciz	"Mapped doorbell page for posting FW commands\n"

	.no_dead_strip	_mthca_setup_cmd_doorbells
.subsections_via_symbols
