	.file	"extr_chip.c_set_partition_keys.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Setting partition keys\n"
	.text
	.p2align 4
	.type	set_partition_keys, @function
set_partition_keys:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	lea	rsi, .LC0[rip]
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	xor	r13d, r13d
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	r14, QWORD PTR 8[rdi]
	xor	ebx, ebx
	mov	rdi, r14
	call	dd_dev_info@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	add	rbx, 1
.L2:
	mov	rdi, r14
	mov	r12d, ebx
	call	hfi1_get_npkeys@PLT
	cmp	eax, ebx
	jle	.L7
	mov	ecx, DWORD PTR RCV_PARTITION_KEY_PARTITION_KEY_B_SHIFT[rip]
	mov	edx, ebx
	mov	rax, QWORD PTR 0[rbp]
	and	edx, 3
	imul	ecx, edx
	mov	eax, DWORD PTR [rax+rbx*4]
	and	eax, DWORD PTR RCV_PARTITION_KEY_PARTITION_KEY_A_MASK[rip]
	sal	eax, cl
	or	r13d, eax
	cmp	edx, 3
	jne	.L3
	lea	esi, -6[r12+r12]
	mov	edx, r13d
	mov	rdi, r14
	xor	r13d, r13d
	movsx	rsi, esi
	add	rsi, QWORD PTR RCV_PARTITION_KEY[rip]
	call	write_csr@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	mov	esi, DWORD PTR RCV_CTRL_RCV_PARTITION_KEY_ENABLE_SMASK[rip]
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	rdi, r14
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	add_rcvctrl@PLT
	.cfi_endproc
.LFE0:
	.size	set_partition_keys, .-set_partition_keys
	.comm	RCV_PARTITION_KEY_PARTITION_KEY_B_SHIFT,4,4
	.comm	RCV_PARTITION_KEY_PARTITION_KEY_A_MASK,4,4
	.comm	RCV_PARTITION_KEY,8,8
	.comm	RCV_CTRL_RCV_PARTITION_KEY_ENABLE_SMASK,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_chip.c_set_partition_keys.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Setting partition keys\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	set_partition_keys, %function
set_partition_keys:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, #0
	ldr	r9, [r0, #4]
	mov	r5, r0
	ldr	r1, .L8
	mov	r0, r9
	bl	dd_dev_info
	mov	r10, r4
	ldr	r7, .L8+4
	ldr	r6, .L8+8
	ldr	r8, .L8+12
	b	.L2
.L3:
	add	r4, r4, #1
.L2:
	mov	r0, r9
	bl	hfi1_get_npkeys
	cmp	r0, r4
	and	r2, r4, #3
	ble	.L7
	ldr	r3, [r6]
	ldr	r1, [r5]
	mul	r3, r2, r3
	ldr	r1, [r1, r4, lsl #2]
	ldr	r0, [r7]
	cmp	r2, #3
	and	r1, r1, r0
	orr	r10, r10, r1, lsl r3
	bne	.L3
	ldr	r1, [r8]
	lsl	r3, r4, #1
	sub	r3, r3, #6
	mov	r2, r10
	mov	r0, r9
	add	r1, r3, r1
	bl	write_csr
	mov	r10, #0
	b	.L3
.L7:
	ldr	r3, .L8+16
	mov	r0, r9
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r1, [r3]
	b	add_rcvctrl
.L9:
	.align	2
.L8:
	.word	.LC0
	.word	RCV_PARTITION_KEY_PARTITION_KEY_A_MASK
	.word	RCV_PARTITION_KEY_PARTITION_KEY_B_SHIFT
	.word	RCV_PARTITION_KEY
	.word	RCV_CTRL_RCV_PARTITION_KEY_ENABLE_SMASK
	.size	set_partition_keys, .-set_partition_keys
	.comm	RCV_PARTITION_KEY_PARTITION_KEY_B_SHIFT,4,4
	.comm	RCV_PARTITION_KEY_PARTITION_KEY_A_MASK,4,4
	.comm	RCV_PARTITION_KEY,4,4
	.comm	RCV_CTRL_RCV_PARTITION_KEY_ENABLE_SMASK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
