	.file	"extr_ipmi_msghandler.c_handle_one_recv_msg.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Recv:"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"BMC returned too small a message for netfn %x cmd %x, got %d bytes\n"
	.align 8
.LC2:
	.string	"BMC returned incorrect response, expected netfn %x cmd %x, got netfn %x cmd %x\n"
	.text
	.p2align 4
	.type	handle_one_recv_msg, @function
handle_one_recv_msg:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdi
	lea	rdi, .LC0[rip]
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	edx, DWORD PTR 8[rsi]
	mov	rsi, QWORD PTR [rsi]
	call	ipmi_debug_msg@PLT
	mov	rcx, QWORD PTR 16[rbp]
	cmp	DWORD PTR 12[rbp], 1
	mov	edx, DWORD PTR [rcx]
	mov	r10d, DWORD PTR 4[rcx]
	jle	.L3
	mov	eax, DWORD PTR IPMI_NETFN_APP_REQUEST[rip]
	sal	eax, 2
	cmp	edx, eax
	je	.L31
.L3:
	mov	r8d, DWORD PTR 8[rbp]
	sar	edx, 2
	or	edx, 1
	cmp	r8d, 1
	jle	.L32
	mov	rax, QWORD PTR 0[rbp]
	mov	esi, DWORD PTR [rax]
	mov	r9d, DWORD PTR 4[rax]
	mov	r8d, esi
	sar	r8d, 2
	cmp	r8d, edx
	jne	.L11
	cmp	r10d, r9d
	je	.L10
.L11:
	mov	edi, DWORD PTR 8[r12]
	mov	ecx, r10d
	lea	rsi, .LC2[rip]
	xor	eax, eax
	call	dev_warn@PLT
.L29:
	mov	rcx, QWORD PTR 16[rbp]
	mov	rax, QWORD PTR 0[rbp]
	mov	edx, DWORD PTR [rcx]
	or	edx, 4
	mov	DWORD PTR [rax], edx
	mov	edx, DWORD PTR 4[rcx]
	mov	DWORD PTR 4[rax], edx
	mov	rdx, QWORD PTR IPMI_ERR_UNSPECIFIED[rip]
	mov	DWORD PTR 8[rax], edx
	mov	DWORD PTR 8[rbp], 3
	mov	esi, DWORD PTR [rax]
.L10:
	mov	ebx, DWORD PTR IPMI_NETFN_APP_REQUEST[rip]
	lea	edx, 0[0+rbx*4]
	or	edx, 4
	cmp	edx, esi
	je	.L33
.L12:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rsi, rbp
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	handle_bmc_rsp@PLT
	.p2align 4,,10
	.p2align 3
.L31:
	.cfi_restore_state
	cmp	DWORD PTR IPMI_SEND_MSG_CMD[rip], r10d
	jne	.L3
	cmp	QWORD PTR 24[rbp], 0
	jne	.L3
	cmp	QWORD PTR 16[r12], 0
	jne	.L1
	cmp	DWORD PTR 8[rbp], 2
	jle	.L6
	mov	rdx, QWORD PTR 0[rbp]
	mov	eax, DWORD PTR 8[rdx]
	test	eax, eax
	je	.L6
	cmp	eax, DWORD PTR IPMI_NODE_BUSY_ERR[rip]
	je	.L6
	cmp	eax, DWORD PTR IPMI_LOST_ARBITRATION_ERR[rip]
	je	.L6
	cmp	eax, DWORD PTR IPMI_BUS_ERR[rip]
	je	.L6
	cmp	eax, DWORD PTR IPMI_NAK_ON_WRITE_ERR[rip]
	je	.L6
	mov	edi, DWORD PTR [r12]
	mov	ebx, DWORD PTR 12[rdx]
	call	READ_ONCE@PLT
	and	ebx, 15
	mov	rax, QWORD PTR [rax]
	movsx	rbx, ebx
	mov	rax, QWORD PTR [rax+rbx*8]
	sub	rax, 129
	cmp	rax, 1
	jbe	.L34
	mov	esi, DWORD PTR sent_ipmb_command_errs[rip]
	mov	rdi, r12
	call	ipmi_inc_stat@PLT
.L8:
	mov	rax, QWORD PTR 0[rbp]
	mov	esi, DWORD PTR 32[rbp]
	mov	rdi, r12
	mov	edx, DWORD PTR 8[rax]
	call	intf_err_seq@PLT
.L5:
.L1:
	pop	rbx
	.cfi_remember_state
	.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
.L33:
	.cfi_restore_state
	mov	edx, DWORD PTR 4[rax]
	cmp	edx, DWORD PTR IPMI_SEND_MSG_CMD[rip]
	je	.L35
.L13:
	cmp	edx, DWORD PTR IPMI_GET_MSG_CMD[rip]
	je	.L36
	cmp	edx, DWORD PTR IPMI_READ_EVENT_MSG_BUFFER_CMD[rip]
	jne	.L12
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rsi, rbp
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	handle_read_event_rsp@PLT
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	mov	edi, DWORD PTR 8[r12]
	mov	ecx, r10d
	lea	rsi, .LC1[rip]
	xor	eax, eax
	call	dev_warn@PLT
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L35:
	mov	rsi, QWORD PTR 24[rbp]
	test	rsi, rsi
	je	.L13
	cmp	DWORD PTR 8[rbp], 1
	jle	.L1
	mov	edx, DWORD PTR 8[rcx]
	and	edx, 15
	cmp	DWORD PTR IPMI_MAX_CHANNELS[rip], edx
	jle	.L1
	mov	edx, DWORD PTR IPMI_RESPONSE_RESPONSE_TYPE[rip]
	mov	DWORD PTR 16[rsi], 1
	mov	rdi, r12
	mov	DWORD PTR 24[rsi], edx
	mov	rdx, QWORD PTR [rsi]
	mov	eax, DWORD PTR 8[rax]
	mov	QWORD PTR 8[rsi], rdx
	mov	DWORD PTR [rdx], eax
	call	deliver_local_response@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L36:
	mov	ebx, DWORD PTR 12[rax]
	and	ebx, 15
	cmp	DWORD PTR IPMI_MAX_CHANNELS[rip], ebx
	jle	.L1
	mov	eax, DWORD PTR 4[r12]
	test	eax, eax
	je	.L1
	mov	edi, DWORD PTR [r12]
	movsx	rbx, ebx
	call	READ_ONCE@PLT
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR [rax+rbx*8]
	cmp	rax, 128
	je	.L16
	lea	rdx, -129[rax]
	cmp	rdx, 1
	ja	.L17
	mov	rax, QWORD PTR 0[rbp]
	test	BYTE PTR 24[rax], 4
	je	.L37
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rsi, rbp
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	handle_lan_get_msg_rsp@PLT
.L17:
	.cfi_restore_state
	movsx	rdx, DWORD PTR IPMI_CHANNEL_MEDIUM_OEM_MIN[rip]
	cmp	rax, rdx
	jl	.L1
	movsx	rdx, DWORD PTR IPMI_CHANNEL_MEDIUM_OEM_MAX[rip]
	cmp	rax, rdx
	jg	.L1
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rsi, rbp
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	handle_oem_get_msg_cmd@PLT
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	rax, QWORD PTR 0[rbp]
	mov	rsi, rbp
	mov	rdi, r12
	test	BYTE PTR 16[rax], 4
	je	.L20
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	handle_ipmb_get_msg_rsp@PLT
.L6:
	.cfi_restore_state
	mov	esi, DWORD PTR 32[rbp]
	mov	rdi, r12
	call	intf_start_seq_timer@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L37:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rsi, rbp
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	handle_lan_get_msg_cmd@PLT
.L20:
	.cfi_restore_state
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	handle_ipmb_get_msg_cmd@PLT
.L34:
	.cfi_restore_state
	mov	esi, DWORD PTR sent_lan_command_errs[rip]
	mov	rdi, r12
	call	ipmi_inc_stat@PLT
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	handle_one_recv_msg, .-handle_one_recv_msg
	.comm	sent_lan_command_errs,4,4
	.comm	sent_ipmb_command_errs,4,4
	.comm	IPMI_SEND_MSG_CMD,4,4
	.comm	IPMI_RESPONSE_RESPONSE_TYPE,4,4
	.comm	IPMI_READ_EVENT_MSG_BUFFER_CMD,4,4
	.comm	IPMI_NODE_BUSY_ERR,4,4
	.comm	IPMI_NETFN_APP_REQUEST,4,4
	.comm	IPMI_NAK_ON_WRITE_ERR,4,4
	.comm	IPMI_MAX_CHANNELS,4,4
	.comm	IPMI_LOST_ARBITRATION_ERR,4,4
	.comm	IPMI_GET_MSG_CMD,4,4
	.comm	IPMI_ERR_UNSPECIFIED,8,8
	.comm	IPMI_CHANNEL_MEDIUM_OEM_MIN,4,4
	.comm	IPMI_CHANNEL_MEDIUM_OEM_MAX,4,4
	.comm	IPMI_BUS_ERR,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_ipmi_msghandler.c_handle_one_recv_msg.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Recv:\000"
	.align	2
.LC1:
	.ascii	"BMC returned too small a message for netfn %x cmd %"
	.ascii	"x, got %d bytes\012\000"
	.align	2
.LC2:
	.ascii	"BMC returned incorrect response, expected netfn %x "
	.ascii	"cmd %x, got netfn %x cmd %x\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	handle_one_recv_msg, %function
handle_one_recv_msg:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r4, r1
	ldm	r1, {r1, r2}
	mov	r5, r0
	sub	sp, sp, #12
	ldr	r0, .L40
	bl	ipmi_debug_msg
	ldr	r3, [r4, #8]
	ldr	r0, [r4, #12]
	cmp	r3, #1
	ldr	r6, .L40+4
	ldr	r2, [r0]
	ble	.L2
	ldr	r1, [r6]
	ldr	r3, [r0, #4]
	cmp	r2, r1, lsl #2
	beq	.L34
.L3:
	ldr	r1, [r4, #4]
	asr	r2, r2, #2
	cmp	r1, #1
	orr	r2, r2, #1
	ble	.L35
	ldr	ip, [r4]
	ldm	ip, {r1, lr}
	cmp	r2, r1, asr #2
	asr	r7, r1, #2
	bne	.L11
	cmp	r3, lr
	beq	.L10
.L11:
	stm	sp, {r7, lr}
	ldr	r1, .L40+8
	ldr	r0, [r5, #8]
	bl	dev_warn
.L32:
	mov	r2, #3
	ldr	r0, [r4, #12]
	ldr	ip, [r4]
	ldr	r3, [r0]
	ldr	lr, .L40+12
	orr	r3, r3, #4
	str	r3, [ip]
	ldr	r1, [r0, #4]
	ldr	r3, [lr]
	stmib	ip, {r1, r3}
	str	r2, [r4, #4]
	ldr	r1, [ip]
.L10:
	ldr	r3, [r6]
	lsl	r3, r3, #2
	orr	r3, r3, #4
	cmp	r3, r1
	beq	.L36
.L12:
	mov	r1, r4
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, lr}
	b	handle_bmc_rsp
.L34:
	ldr	r1, .L40+16
	ldr	r1, [r1]
	cmp	r1, r3
	bne	.L3
	ldr	r1, [r4, #16]
	cmp	r1, #0
	bne	.L3
	ldr	r3, [r5, #12]
	cmp	r3, #0
	bne	.L1
	ldr	r3, [r4, #4]
	cmp	r3, #2
	ble	.L6
	ldr	r2, [r4]
	ldr	r3, [r2, #8]
	cmp	r3, #0
	beq	.L6
	ldr	r1, .L40+20
	ldr	r1, [r1]
	cmp	r3, r1
	beq	.L6
	ldr	r1, .L40+24
	ldr	r1, [r1]
	cmp	r3, r1
	beq	.L6
	ldr	r1, .L40+28
	ldr	r1, [r1]
	cmp	r3, r1
	beq	.L6
	ldr	r1, .L40+32
	ldr	r1, [r1]
	cmp	r3, r1
	beq	.L6
	ldr	r0, [r5]
	ldr	r6, [r2, #12]
	bl	READ_ONCE
	ldr	r3, [r0]
	and	r6, r6, #15
	ldr	r3, [r3, r6, lsl #2]
	mov	r0, r5
	sub	r3, r3, #129
	cmp	r3, #1
	ldrls	r3, .L40+36
	ldrhi	r3, .L40+40
	ldr	r1, [r3]
	bl	ipmi_inc_stat
	ldr	r3, [r4]
	mov	r0, r5
	ldr	r2, [r3, #8]
	ldr	r1, [r4, #20]
	bl	intf_err_seq
.L5:
.L1:
	mov	r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L2:
	ldr	r3, [r0, #4]
	b	.L3
.L36:
	ldr	r2, .L40+16
	ldr	r3, [ip, #4]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L37
.L13:
	ldr	r2, .L40+44
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L38
	ldr	r2, .L40+48
	ldr	r2, [r2]
	cmp	r3, r2
	bne	.L12
	mov	r1, r4
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, lr}
	b	handle_read_event_rsp
.L35:
	str	r1, [sp]
	ldr	r0, [r5, #8]
	ldr	r1, .L40+52
	bl	dev_warn
	b	.L32
.L37:
	ldr	r1, [r4, #16]
	cmp	r1, #0
	beq	.L13
	ldr	r3, [r4, #4]
	cmp	r3, #1
	ble	.L1
	ldr	r2, .L40+56
	ldr	r3, [r0, #8]
	ldr	r2, [r2]
	and	r3, r3, #15
	cmp	r2, r3
	ble	.L1
	mov	r2, #1
	ldr	r3, .L40+60
	str	r2, [r1, #8]
	ldr	r2, [r3]
	ldr	r3, [r1]
	str	r2, [r1, #12]
	ldr	r2, [ip, #8]
	mov	r0, r5
	str	r3, [r1, #4]
	str	r2, [r3]
	bl	deliver_local_response
	b	.L1
.L38:
	ldr	r3, .L40+56
	ldr	r6, [ip, #12]
	ldr	r3, [r3]
	and	r6, r6, #15
	cmp	r3, r6
	ble	.L1
	ldr	r3, [r5, #4]
	cmp	r3, #0
	beq	.L1
	ldr	r0, [r5]
	bl	READ_ONCE
	ldr	r3, [r0]
	ldr	r3, [r3, r6, lsl #2]
	cmp	r3, #128
	beq	.L16
	sub	r2, r3, #129
	cmp	r2, #1
	bhi	.L17
	ldr	r3, [r4]
	ldr	r3, [r3, #24]
	tst	r3, #4
	beq	.L39
	mov	r1, r4
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, lr}
	b	handle_lan_get_msg_rsp
.L17:
	ldr	r2, .L40+64
	ldr	r2, [r2]
	cmp	r3, r2
	blt	.L1
	ldr	r2, .L40+68
	ldr	r2, [r2]
	cmp	r3, r2
	bgt	.L1
	mov	r1, r4
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, lr}
	b	handle_oem_get_msg_cmd
.L16:
	ldr	r3, [r4]
	mov	r1, r4
	ldr	r3, [r3, #16]
	mov	r0, r5
	tst	r3, #4
	beq	.L20
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, lr}
	b	handle_ipmb_get_msg_rsp
.L6:
	mov	r0, r5
	ldr	r1, [r4, #20]
	bl	intf_start_seq_timer
	b	.L1
.L39:
	mov	r1, r4
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, lr}
	b	handle_lan_get_msg_cmd
.L20:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, lr}
	b	handle_ipmb_get_msg_cmd
.L41:
	.align	2
.L40:
	.word	.LC0
	.word	IPMI_NETFN_APP_REQUEST
	.word	.LC2
	.word	IPMI_ERR_UNSPECIFIED
	.word	IPMI_SEND_MSG_CMD
	.word	IPMI_NODE_BUSY_ERR
	.word	IPMI_LOST_ARBITRATION_ERR
	.word	IPMI_BUS_ERR
	.word	IPMI_NAK_ON_WRITE_ERR
	.word	sent_lan_command_errs
	.word	sent_ipmb_command_errs
	.word	IPMI_GET_MSG_CMD
	.word	IPMI_READ_EVENT_MSG_BUFFER_CMD
	.word	.LC1
	.word	IPMI_MAX_CHANNELS
	.word	IPMI_RESPONSE_RESPONSE_TYPE
	.word	IPMI_CHANNEL_MEDIUM_OEM_MIN
	.word	IPMI_CHANNEL_MEDIUM_OEM_MAX
	.size	handle_one_recv_msg, .-handle_one_recv_msg
	.comm	sent_lan_command_errs,4,4
	.comm	sent_ipmb_command_errs,4,4
	.comm	IPMI_SEND_MSG_CMD,4,4
	.comm	IPMI_RESPONSE_RESPONSE_TYPE,4,4
	.comm	IPMI_READ_EVENT_MSG_BUFFER_CMD,4,4
	.comm	IPMI_NODE_BUSY_ERR,4,4
	.comm	IPMI_NETFN_APP_REQUEST,4,4
	.comm	IPMI_NAK_ON_WRITE_ERR,4,4
	.comm	IPMI_MAX_CHANNELS,4,4
	.comm	IPMI_LOST_ARBITRATION_ERR,4,4
	.comm	IPMI_GET_MSG_CMD,4,4
	.comm	IPMI_ERR_UNSPECIFIED,4,4
	.comm	IPMI_CHANNEL_MEDIUM_OEM_MIN,4,4
	.comm	IPMI_CHANNEL_MEDIUM_OEM_MAX,4,4
	.comm	IPMI_BUS_ERR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
