	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fm10k_mbx_connect
_fm10k_mbx_connect:                     ## @fm10k_mbx_connect
	.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
	cmpl	$0, 28(%rsi)
	je	LBB0_3
## %bb.1:
	movq	%rsi, %rbx
	movq	(%rsi), %rax
	movq	_FM10K_STATE_CLOSED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	movq	%rdi, %r14
	movq	_FM10K_MBX_INIT_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_FM10K_STATE_CONNECT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	%rbx, %rdi
	callq	_fm10k_mbx_reset_work
	movq	%rbx, %rdi
	callq	_fm10k_mbx_create_fake_disconnect_hdr
	movl	12(%rbx), %esi
	movl	20(%rbx), %edx
	xorl	8(%rbx), %esi
	movq	%r14, %rdi
	callq	_fm10k_write_reg
	movq	_FM10K_MBX_REQ_INTERRUPT@GOTPCREL(%rip), %rax
	movq	_FM10K_MBX_ACK_INTERRUPT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_FM10K_MBX_INTERRUPT_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 16(%rbx)
	movq	%rbx, %rdi
	callq	_fm10k_mbx_create_connect_hdr
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_fm10k_mbx_write
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_3:
	movq	_FM10K_MBX_ERR_NO_SPACE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_4:
	movq	_FM10K_MBX_ERR_BUSY@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FM10K_MBX_ERR_NO_SPACE,4,2     ## @FM10K_MBX_ERR_NO_SPACE
	.comm	_FM10K_STATE_CLOSED,8,3         ## @FM10K_STATE_CLOSED
	.comm	_FM10K_MBX_ERR_BUSY,4,2         ## @FM10K_MBX_ERR_BUSY
	.comm	_FM10K_MBX_INIT_TIMEOUT,4,2     ## @FM10K_MBX_INIT_TIMEOUT
	.comm	_FM10K_STATE_CONNECT,8,3        ## @FM10K_STATE_CONNECT
	.comm	_FM10K_MBX_REQ_INTERRUPT,4,2    ## @FM10K_MBX_REQ_INTERRUPT
	.comm	_FM10K_MBX_ACK_INTERRUPT,4,2    ## @FM10K_MBX_ACK_INTERRUPT
	.comm	_FM10K_MBX_INTERRUPT_ENABLE,4,2 ## @FM10K_MBX_INTERRUPT_ENABLE
	.no_dead_strip	_fm10k_mbx_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fm10k_mbx_connect
_fm10k_mbx_connect:                     ; @fm10k_mbx_connect
	.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
	ldr	w8, [x1, #28]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x19, x1
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _FM10K_STATE_CLOSED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FM10K_STATE_CLOSED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	mov	x20, x0
Lloh3:
	adrp	x8, _FM10K_MBX_INIT_TIMEOUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FM10K_MBX_INIT_TIMEOUT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #24]
Lloh6:
	adrp	x8, _FM10K_STATE_CONNECT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FM10K_STATE_CONNECT@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x8, [x19]
	mov	x0, x19
	bl	_fm10k_mbx_reset_work
	mov	x0, x19
	bl	_fm10k_mbx_create_fake_disconnect_hdr
	ldp	w8, w9, [x19, #8]
	eor	w1, w9, w8
	ldr	w2, [x19, #20]
	mov	x0, x20
	bl	_fm10k_write_reg
Lloh9:
	adrp	x8, _FM10K_MBX_REQ_INTERRUPT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FM10K_MBX_REQ_INTERRUPT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _FM10K_MBX_ACK_INTERRUPT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _FM10K_MBX_ACK_INTERRUPT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _FM10K_MBX_INTERRUPT_ENABLE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _FM10K_MBX_INTERRUPT_ENABLE@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19, #16]
	mov	x0, x19
	bl	_fm10k_mbx_create_connect_hdr
	mov	x0, x20
	mov	x1, x19
	bl	_fm10k_mbx_write
	mov	w0, #0
	b	LBB0_6
LBB0_3:
Lloh18:
	adrp	x8, _FM10K_MBX_ERR_NO_SPACE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _FM10K_MBX_ERR_NO_SPACE@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh20:
	adrp	x8, _FM10K_MBX_ERR_BUSY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _FM10K_MBX_ERR_BUSY@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_FM10K_MBX_ERR_NO_SPACE,4,2     ; @FM10K_MBX_ERR_NO_SPACE
	.comm	_FM10K_STATE_CLOSED,8,3         ; @FM10K_STATE_CLOSED
	.comm	_FM10K_MBX_ERR_BUSY,4,2         ; @FM10K_MBX_ERR_BUSY
	.comm	_FM10K_MBX_INIT_TIMEOUT,4,2     ; @FM10K_MBX_INIT_TIMEOUT
	.comm	_FM10K_STATE_CONNECT,8,3        ; @FM10K_STATE_CONNECT
	.comm	_FM10K_MBX_REQ_INTERRUPT,4,2    ; @FM10K_MBX_REQ_INTERRUPT
	.comm	_FM10K_MBX_ACK_INTERRUPT,4,2    ; @FM10K_MBX_ACK_INTERRUPT
	.comm	_FM10K_MBX_INTERRUPT_ENABLE,4,2 ; @FM10K_MBX_INTERRUPT_ENABLE
	.no_dead_strip	_fm10k_mbx_connect
.subsections_via_symbols
