	.file	"extr_fm10k_mbx.c_fm10k_mbx_connect.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	fm10k_mbx_connect, @function
fm10k_mbx_connect:
.LFB0:
	.cfi_startproc
	endbr64
	mov	eax, DWORD PTR 28[rsi]
	test	eax, eax
	je	.L9
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rax, QWORD PTR FM10K_STATE_CLOSED[rip]
	cmp	QWORD PTR [rsi], rax
	je	.L4
	mov	eax, DWORD PTR FM10K_MBX_ERR_BUSY[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	eax, DWORD PTR FM10K_MBX_INIT_TIMEOUT[rip]
	mov	r12, rdi
	mov	rdi, rsi
	mov	DWORD PTR 24[rsi], eax
	mov	rax, QWORD PTR FM10K_STATE_CONNECT[rip]
	mov	QWORD PTR [rsi], rax
	call	fm10k_mbx_reset_work@PLT
	mov	rdi, rbp
	call	fm10k_mbx_create_fake_disconnect_hdr@PLT
	mov	edx, DWORD PTR 20[rbp]
	mov	esi, DWORD PTR 8[rbp]
	mov	rdi, r12
	xor	esi, DWORD PTR 12[rbp]
	call	fm10k_write_reg@PLT
	mov	eax, DWORD PTR FM10K_MBX_REQ_INTERRUPT[rip]
	mov	rdi, rbp
	or	eax, DWORD PTR FM10K_MBX_ACK_INTERRUPT[rip]
	or	eax, DWORD PTR FM10K_MBX_INTERRUPT_ENABLE[rip]
	mov	DWORD PTR 16[rbp], eax
	call	fm10k_mbx_create_connect_hdr@PLT
	mov	rsi, rbp
	mov	rdi, r12
	call	fm10k_mbx_write@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore 6
	.cfi_restore 12
	mov	eax, DWORD PTR FM10K_MBX_ERR_NO_SPACE[rip]
	ret
	.cfi_endproc
.LFE0:
	.size	fm10k_mbx_connect, .-fm10k_mbx_connect
	.comm	FM10K_STATE_CONNECT,8,8
	.comm	FM10K_STATE_CLOSED,8,8
	.comm	FM10K_MBX_REQ_INTERRUPT,4,4
	.comm	FM10K_MBX_INTERRUPT_ENABLE,4,4
	.comm	FM10K_MBX_INIT_TIMEOUT,4,4
	.comm	FM10K_MBX_ERR_NO_SPACE,4,4
	.comm	FM10K_MBX_ERR_BUSY,4,4
	.comm	FM10K_MBX_ACK_INTERRUPT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_fm10k_mbx.c_fm10k_mbx_connect.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	fm10k_mbx_connect, %function
fm10k_mbx_connect:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r1, #24]
	cmp	r3, #0
	beq	.L9
	ldr	r3, .L10
	ldr	r2, [r1]
	ldr	r3, [r3]
	push	{r4, r5, r6, lr}
	cmp	r2, r3
	mov	r4, r1
	beq	.L4
	ldr	r3, .L10+4
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L4:
	mov	r5, r0
	ldr	r2, .L10+8
	ldr	r3, .L10+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	str	r2, [r1, #20]
	mov	r0, r1
	str	r3, [r1]
	bl	fm10k_mbx_reset_work
	mov	r0, r4
	bl	fm10k_mbx_create_fake_disconnect_hdr
	ldmib	r4, {r1, r3}
	ldr	r2, [r4, #16]
	eor	r1, r1, r3
	mov	r0, r5
	bl	fm10k_write_reg
	ldr	r3, .L10+16
	ldr	r1, .L10+20
	ldr	r2, .L10+24
	ldr	r1, [r1]
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r3, r3, r1
	orr	r3, r3, r2
	str	r3, [r4, #12]
	mov	r0, r4
	bl	fm10k_mbx_create_connect_hdr
	mov	r1, r4
	mov	r0, r5
	bl	fm10k_mbx_write
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L9:
	ldr	r3, .L10+28
	ldr	r0, [r3]
	bx	lr
.L11:
	.align	2
.L10:
	.word	FM10K_STATE_CLOSED
	.word	FM10K_MBX_ERR_BUSY
	.word	FM10K_MBX_INIT_TIMEOUT
	.word	FM10K_STATE_CONNECT
	.word	FM10K_MBX_REQ_INTERRUPT
	.word	FM10K_MBX_ACK_INTERRUPT
	.word	FM10K_MBX_INTERRUPT_ENABLE
	.word	FM10K_MBX_ERR_NO_SPACE
	.size	fm10k_mbx_connect, .-fm10k_mbx_connect
	.comm	FM10K_STATE_CONNECT,4,4
	.comm	FM10K_STATE_CLOSED,4,4
	.comm	FM10K_MBX_REQ_INTERRUPT,4,4
	.comm	FM10K_MBX_INTERRUPT_ENABLE,4,4
	.comm	FM10K_MBX_INIT_TIMEOUT,4,4
	.comm	FM10K_MBX_ERR_NO_SPACE,4,4
	.comm	FM10K_MBX_ERR_BUSY,4,4
	.comm	FM10K_MBX_ACK_INTERRUPT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
