	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_cmd_init                  ## -- Begin function mlx4_cmd_init
	.p2align	4, 0x90
_mlx4_cmd_init:                         ## @mlx4_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	%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, %r14
	callq	_mlx4_priv
	movq	%rax, %r12
	xorl	%r15d, %r15d
	cmpl	$0, (%rax)
	jne	LBB0_2
## %bb.1:
	leaq	40(%r12), %rdi
	callq	_init_rwsem
	leaq	36(%r12), %rdi
	callq	_mutex_init
	leaq	32(%r12), %rdi
	movl	$1, %esi
	callq	_sema_init
	movq	$0, 24(%r12)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, (%r12)
	movq	_MLX4_CMD_CLEANUP_STRUCT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_2:
	movq	%r14, %rdi
	callq	_mlx4_is_slave
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	cmpq	$0, 16(%r12)
	jne	LBB0_7
## %bb.4:
	movq	(%r14), %rax
	movq	(%rax), %rdi
	xorl	%esi, %esi
	callq	_pci_resource_start
	movq	_MLX4_HCR_BASE@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	_MLX4_HCR_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_ioremap
	movq	%rax, 16(%r12)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	_MLX4_CMD_CLEANUP_HCR@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
LBB0_7:
	movq	%r14, %rdi
	callq	_mlx4_is_mfunc
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	cmpq	$0, 48(%r12)
	jne	LBB0_11
## %bb.9:
	movq	(%r14), %rax
	movq	(%rax), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdx
	addq	$56, %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_alloc_coherent
	movq	%rax, 48(%r12)
	testq	%rax, %rax
	je	LBB0_13
## %bb.10:
	movq	_MLX4_CMD_CLEANUP_VHCR@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
LBB0_11:
	xorl	%ebx, %ebx
	cmpq	$0, 8(%r12)
	jne	LBB0_14
## %bb.12:
	movq	(%r14), %rax
	movq	(%rax), %rsi
	movq	_MLX4_MAILBOX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%ecx, %edx
	xorl	%r8d, %r8d
	callq	_dma_pool_create
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	jne	LBB0_14
	jmp	LBB0_13
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_mlx4_err
LBB0_13:
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_mlx4_cmd_cleanup
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_CMD_CLEANUP_STRUCT,4,2    ## @MLX4_CMD_CLEANUP_STRUCT
	.comm	_MLX4_HCR_BASE,8,3              ## @MLX4_HCR_BASE
	.comm	_MLX4_HCR_SIZE,4,2              ## @MLX4_HCR_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't map command register\n"

	.comm	_MLX4_CMD_CLEANUP_HCR,4,2       ## @MLX4_CMD_CLEANUP_HCR
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_MLX4_CMD_CLEANUP_VHCR,4,2      ## @MLX4_CMD_CLEANUP_VHCR
L_.str.1:                               ## @.str.1
	.asciz	"mlx4_cmd"

	.comm	_MLX4_MAILBOX_SIZE,4,2          ## @MLX4_MAILBOX_SIZE
	.comm	_MLX4_CMD_CLEANUP_POOL,4,2      ## @MLX4_CMD_CLEANUP_POOL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_cmd_init                  ; -- Begin function mlx4_cmd_init
	.p2align	2
_mlx4_cmd_init:                         ; @mlx4_cmd_init
	.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	_mlx4_priv
	mov	x20, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	mov	w21, #0
	b	LBB0_3
LBB0_2:
	add	x0, x20, #40
	bl	_init_rwsem
	add	x0, x20, #36
	bl	_mutex_init
	add	x0, x20, #32
	mov	w1, #1
	bl	_sema_init
	str	xzr, [x20, #24]
	movi.2s	v0, #1
	str	d0, [x20]
Lloh0:
	adrp	x8, _MLX4_CMD_CLEANUP_STRUCT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX4_CMD_CLEANUP_STRUCT@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
LBB0_3:
	mov	x0, x19
	bl	_mlx4_is_slave
	cbnz	w0, LBB0_7
; %bb.4:
	ldr	x8, [x20, #16]
	cbnz	x8, LBB0_7
; %bb.5:
	ldr	x8, [x19]
	ldr	x0, [x8]
	mov	w1, #0
	bl	_pci_resource_start
Lloh3:
	adrp	x8, _MLX4_HCR_BASE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MLX4_HCR_BASE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x0, x8, x0
Lloh6:
	adrp	x8, _MLX4_HCR_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MLX4_HCR_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_ioremap
	str	x0, [x20, #16]
	cbz	x0, LBB0_14
; %bb.6:
Lloh9:
	adrp	x8, _MLX4_CMD_CLEANUP_HCR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MLX4_CMD_CLEANUP_HCR@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	orr	w21, w8, w21
LBB0_7:
	mov	x0, x19
	bl	_mlx4_is_mfunc
	cbz	x0, LBB0_9
; %bb.8:
	ldr	x8, [x20, #48]
	cbz	x8, LBB0_11
LBB0_9:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_13
LBB0_10:
	mov	w0, #0
	b	LBB0_16
LBB0_11:
	ldr	x8, [x19]
Lloh12:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x0, [x8]
Lloh14:
	ldr	w1, [x9]
	add	x2, x20, #56
Lloh15:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	bl	_dma_alloc_coherent
	str	x0, [x20, #48]
	cbz	x0, LBB0_15
; %bb.12:
Lloh18:
	adrp	x8, _MLX4_CMD_CLEANUP_VHCR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MLX4_CMD_CLEANUP_VHCR@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	orr	w21, w8, w21
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_10
LBB0_13:
	ldr	x8, [x19]
	ldr	x1, [x8]
Lloh21:
	adrp	x8, _MLX4_MAILBOX_SIZE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MLX4_MAILBOX_SIZE@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x3, x2
	mov	w4, #0
	bl	_dma_pool_create
	mov	x8, x0
	mov	w0, #0
	str	x8, [x20, #8]
	cbnz	x8, LBB0_16
	b	LBB0_15
LBB0_14:
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mlx4_err
LBB0_15:
	mov	x0, x19
	mov	x1, x21
	bl	_mlx4_cmd_cleanup
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_CMD_CLEANUP_STRUCT,4,2    ; @MLX4_CMD_CLEANUP_STRUCT
	.comm	_MLX4_HCR_BASE,8,3              ; @MLX4_HCR_BASE
	.comm	_MLX4_HCR_SIZE,4,2              ; @MLX4_HCR_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't map command register\n"

	.comm	_MLX4_CMD_CLEANUP_HCR,4,2       ; @MLX4_CMD_CLEANUP_HCR
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_MLX4_CMD_CLEANUP_VHCR,4,2      ; @MLX4_CMD_CLEANUP_VHCR
l_.str.1:                               ; @.str.1
	.asciz	"mlx4_cmd"

	.comm	_MLX4_MAILBOX_SIZE,4,2          ; @MLX4_MAILBOX_SIZE
	.comm	_MLX4_CMD_CLEANUP_POOL,4,2      ; @MLX4_CMD_CLEANUP_POOL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
