	.file	"extr_intel_pmc_ipc.c_intel_pmc_ipc_raw_cmd.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	intel_pmc_ipc_raw_cmd
	.type	intel_pmc_ipc_raw_cmd, @function
intel_pmc_ipc_raw_cmd:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pxor	xmm0, xmm0
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	DWORD PTR 12[rsp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR IPC_DATA_BUFFER_SIZE[rip]
	movaps	XMMWORD PTR 16[rsp], xmm0
	cmp	eax, ecx
	jl	.L2
	test	eax, eax
	mov	r15, rdx
	lea	edx, 3[rax]
	mov	r13d, r9d
	cmovs	eax, edx
	sar	eax, 2
	cmp	eax, r9d
	jge	.L3
.L2:
	mov	r14d, DWORD PTR EINVAL[rip]
	neg	r14d
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L15
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r14d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	r14d, edi
	lea	rdi, ipclock[rip]
	mov	ebx, ecx
	mov	r12, r8
	call	mutex_lock@PLT
	cmp	QWORD PTR ipcdev[rip+8], 0
	je	.L16
	lea	rbp, 16[rsp]
	mov	edx, ebx
	mov	rsi, r15
	mov	rdi, rbp
	lea	r15d, 6[rbx]
	call	memcpy@PLT
	mov	edi, DWORD PTR 112[rsp]
	mov	rsi, QWORD PTR IPC_DPTR[rip]
	add	rsi, QWORD PTR ipcdev[rip]
	call	writel@PLT
	mov	edi, DWORD PTR 120[rsp]
	mov	rsi, QWORD PTR IPC_SPTR[rip]
	add	rsi, QWORD PTR ipcdev[rip]
	call	writel@PLT
	mov	eax, ebx
	add	eax, 3
	cmovns	r15d, eax
	sar	r15d, 2
	mov	DWORD PTR 8[rsp], r15d
	test	ebx, ebx
	jle	.L6
	xor	r15d, r15d
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edi, DWORD PTR 0[rbp+r15*4]
	lea	esi, 0[0+r15*4]
	add	r15, 1
	call	ipc_data_writel@PLT
	cmp	DWORD PTR 8[rsp], r15d
	jg	.L7
.L6:
	mov	ecx, DWORD PTR IPC_CMD_SUBCMD[rip]
	mov	ebp, DWORD PTR 12[rsp]
	sal	ebp, cl
	mov	ecx, DWORD PTR IPC_CMD_SIZE[rip]
	or	r14d, ebp
	sal	ebx, cl
	mov	edi, r14d
	or	edi, ebx
	call	ipc_send_command@PLT
	xor	eax, eax
	call	intel_pmc_ipc_check_status@PLT
	mov	r14d, eax
	test	eax, eax
	jne	.L8
	test	r13d, r13d
	jle	.L8
	lea	eax, -1[r13]
	xor	ebx, ebx
	lea	rbp, 4[0+rax*4]
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edi, ebx
	call	ipc_data_readl@PLT
	mov	DWORD PTR [r12+rbx], eax
	add	rbx, 4
	cmp	rbp, rbx
	jne	.L9
.L8:
	lea	rdi, ipclock[rip]
	call	mutex_unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L16:
	lea	rdi, ipclock[rip]
	call	mutex_unlock@PLT
	mov	r14d, DWORD PTR ENODEV[rip]
	neg	r14d
	jmp	.L1
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	intel_pmc_ipc_raw_cmd, .-intel_pmc_ipc_raw_cmd
	.comm	ipclock,4,4
	.comm	ipcdev,16,16
	.comm	IPC_SPTR,8,8
	.comm	IPC_DPTR,8,8
	.comm	IPC_DATA_BUFFER_SIZE,4,4
	.comm	IPC_CMD_SUBCMD,4,4
	.comm	IPC_CMD_SIZE,4,4
	.comm	ENODEV,4,4
	.comm	EINVAL,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_intel_pmc_ipc.c_intel_pmc_ipc_raw_cmd.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	intel_pmc_ipc_raw_cmd
	.syntax unified
	.arm
	.fpu softvfp
	.type	intel_pmc_ipc_raw_cmd, %function
intel_pmc_ipc_raw_cmd:
	@ args = 16, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r6, r3
	mov	r4, #0
	ldr	r3, .L17
	mov	r5, r2
	ldr	r3, [r3]
	ldr	r2, .L17+4
	sub	sp, sp, #24
	cmp	r3, r6
	ldr	r2, [r2]
	str	r2, [sp, #20]
	mov	r2,#0
	ldr	r9, [sp, #56]
	str	r4, [sp, #4]
	str	r4, [sp, #8]
	str	r4, [sp, #12]
	str	r4, [sp, #16]
	blt	.L2
	add	r2, r3, #3
	cmp	r3, r4
	movlt	r3, r2
	ldr	r2, [sp, #60]
	cmp	r2, r3, asr #2
	ble	.L3
.L2:
	ldr	r3, .L17+8
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	ldr	r3, .L17+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L15
	mov	r0, r5
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L3:
	ldr	r10, .L17+12
	mov	r7, r0
	ldr	r0, .L17+16
	mov	r8, r1
	bl	mutex_lock
	ldr	r3, [r10, #4]
	cmp	r3, #0
	beq	.L16
	mov	r2, r6
	mov	r1, r5
	add	r0, sp, #4
	bl	memcpy
	ldr	r3, .L17+20
	ldr	r1, [r10]
	ldr	r3, [r3]
	ldr	r0, [sp, #64]
	add	r1, r1, r3
	bl	writel
	ldr	r3, .L17+24
	ldr	r1, [r10]
	ldr	r3, [r3]
	ldr	r0, [sp, #68]
	add	r1, r1, r3
	bl	writel
	adds	r10, r6, #3
	addmi	r10, r6, #6
	cmp	r6, #0
	asr	r10, r10, #2
	ble	.L6
	add	r5, sp, #4
.L7:
	lsl	r1, r4, #2
	ldr	r0, [r5], #4
	add	r4, r4, #1
	bl	ipc_data_writel
	cmp	r4, r10
	blt	.L7
.L6:
	ldr	r2, .L17+28
	ldr	r3, .L17+32
	ldr	r1, [r2]
	ldr	r0, [r3]
	orr	r7, r7, r8, lsl r1
	orr	r0, r7, r6, lsl r0
	bl	ipc_send_command
	bl	intel_pmc_ipc_check_status
	subs	r5, r0, #0
	bne	.L8
	ldr	r3, [sp, #60]
	cmp	r3, #0
	ble	.L8
	sub	r4, r9, #4
	add	r6, r4, r3, lsl #2
	rsb	r9, r9, #4
.L9:
	add	r0, r9, r4
	bl	ipc_data_readl
	str	r0, [r4, #4]!
	cmp	r6, r4
	bne	.L9
.L8:
	ldr	r0, .L17+16
	bl	mutex_unlock
	b	.L1
.L16:
	ldr	r0, .L17+16
	bl	mutex_unlock
	ldr	r3, .L17+36
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L15:
	bl	__stack_chk_fail
.L18:
	.align	2
.L17:
	.word	IPC_DATA_BUFFER_SIZE
	.word	.LC0
	.word	EINVAL
	.word	ipcdev
	.word	ipclock
	.word	IPC_DPTR
	.word	IPC_SPTR
	.word	IPC_CMD_SUBCMD
	.word	IPC_CMD_SIZE
	.word	ENODEV
	.size	intel_pmc_ipc_raw_cmd, .-intel_pmc_ipc_raw_cmd
	.comm	ipclock,4,4
	.comm	ipcdev,8,4
	.comm	IPC_SPTR,4,4
	.comm	IPC_DPTR,4,4
	.comm	IPC_DATA_BUFFER_SIZE,4,4
	.comm	IPC_CMD_SUBCMD,4,4
	.comm	IPC_CMD_SIZE,4,4
	.comm	ENODEV,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
