	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_cmd_init                 ## -- Begin function mthca_cmd_init
	.p2align	4, 0x90
_mthca_cmd_init:                        ## @mthca_cmd_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	addq	$28, %rdi
	callq	_mutex_init
	leaq	24(%rbx), %rdi
	movl	$1, %esi
	callq	_sema_init
	movq	$0, 16(%rbx)
	movq	32(%rbx), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_pci_resource_start
	movq	_MTHCA_HCR_BASE@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	_MTHCA_HCR_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_ioremap
	movl	%eax, (%rbx)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	32(%rbx), %rsi
	movq	_MTHCA_MAILBOX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rdi
	movl	%ecx, %edx
	xorl	%r8d, %r8d
	callq	_dma_pool_create
	movl	%eax, 8(%rbx)
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	movl	(%rbx), %edi
	callq	_iounmap
	jmp	LBB0_4
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mthca_err
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_5:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_HCR_BASE,8,3             ## @MTHCA_HCR_BASE
	.comm	_MTHCA_HCR_SIZE,4,2             ## @MTHCA_HCR_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't map command register."

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"mthca_cmd"

	.comm	_MTHCA_MAILBOX_SIZE,4,2         ## @MTHCA_MAILBOX_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mthca_cmd_init                 ; -- Begin function mthca_cmd_init
	.p2align	2
_mthca_cmd_init:                        ; @mthca_cmd_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	add	x0, x0, #28
	bl	_mutex_init
	add	x0, x19, #24
	mov	w1, #1
	bl	_sema_init
	str	xzr, [x19, #16]
	ldr	x0, [x19, #32]
	mov	w1, #0
	bl	_pci_resource_start
Lloh0:
	adrp	x8, _MTHCA_HCR_BASE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTHCA_HCR_BASE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x0, x8, x0
Lloh3:
	adrp	x8, _MTHCA_HCR_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MTHCA_HCR_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_ioremap
	str	w0, [x19]
	cbz	w0, LBB0_3
; %bb.1:
	ldr	x1, [x19, #32]
Lloh6:
	adrp	x8, _MTHCA_MAILBOX_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MTHCA_MAILBOX_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x3, x2
	mov	w4, #0
	bl	_dma_pool_create
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #8]
	cbnz	w8, LBB0_5
; %bb.2:
	ldr	w0, [x19]
	bl	_iounmap
	b	LBB0_4
LBB0_3:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mthca_err
LBB0_4:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_HCR_BASE,8,3             ; @MTHCA_HCR_BASE
	.comm	_MTHCA_HCR_SIZE,4,2             ; @MTHCA_HCR_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't map command register."

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"mthca_cmd"

	.comm	_MTHCA_MAILBOX_SIZE,4,2         ; @MTHCA_MAILBOX_SIZE
.subsections_via_symbols
