	.file	"extr_mce_amd.c_threshold_restart_bank.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	threshold_restart_bank, @function
threshold_restart_bank:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xor	r12d, r12d
	xor	esi, esi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	mov	edx, r12d
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rax, QWORD PTR 16[rdi]
	mov	edi, DWORD PTR 4[rax]
	call	rdmsr@PLT
	mov	rdi, QWORD PTR 16[rbp]
	mov	edx, DWORD PTR THRESHOLD_MAX[rip]
	mov	eax, DWORD PTR [rdi]
	test	eax, eax
	jns	.L2
	mov	DWORD PTR 0[rbp], 1
.L3:
	sub	edx, eax
	mov	r12d, edx
.L5:
	mov	ebx, DWORD PTR MASK_INT_TYPE_HI[rip]
	mov	eax, DWORD PTR 16[rdi]
	not	ebx
	and	ebx, r12d
	test	eax, eax
	je	.L6
	cmp	QWORD PTR 24[rbp], 0
	jne	.L15
	cmp	QWORD PTR 8[rdi], 0
	je	.L6
.L16:
	or	ebx, DWORD PTR INT_TYPE_APIC[rip]
.L6:
	mov	edx, DWORD PTR MASK_COUNT_EN_HI[rip]
	mov	edi, DWORD PTR 4[rdi]
	xor	esi, esi
	or	edx, ebx
	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	wrmsr@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	ecx, DWORD PTR 0[rbp]
	test	ecx, ecx
	jne	.L3
	mov	ecx, DWORD PTR 4[rbp]
	mov	ebx, r12d
	mov	r12d, ecx
	sub	r12d, eax
	and	r12d, edx
	test	ecx, ecx
	cmove	r12d, ebx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	mov	r8d, DWORD PTR 8[rbp]
	xor	esi, esi
	mov	ecx, ebx
	mov	edx, esi
	mov	esi, r8d
	call	lvt_off_valid@PLT
	test	rax, rax
	je	.L13
	mov	edx, DWORD PTR MASK_LVTOFF_HI[rip]
	not	edx
	and	ebx, edx
	mov	edx, DWORD PTR 8[rbp]
	sal	edx, 20
	or	ebx, edx
.L13:
	mov	rdi, QWORD PTR 16[rbp]
	cmp	QWORD PTR 8[rdi], 0
	je	.L6
	jmp	.L16
	.cfi_endproc
.LFE0:
	.size	threshold_restart_bank, .-threshold_restart_bank
	.comm	THRESHOLD_MAX,4,4
	.comm	MASK_OVERFLOW_HI,4,4
	.comm	MASK_LVTOFF_HI,4,4
	.comm	MASK_INT_TYPE_HI,4,4
	.comm	MASK_ERR_COUNT_HI,4,4
	.comm	MASK_COUNT_EN_HI,4,4
	.comm	INT_TYPE_APIC,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_mce_amd.c_threshold_restart_bank.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	threshold_restart_bank, %function
threshold_restart_bank:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r6, #0
	mov	r4, r0
	ldr	r3, [r0, #12]
	mov	r1, r6
	ldr	r0, [r3, #4]
	mov	r2, r6
	bl	rdmsr
	ldr	r0, [r4, #12]
	ldr	r3, .L24
	ldr	r1, [r0]
	ldr	ip, [r3]
	cmp	r1, r6
	movlt	r3, #1
	strlt	r3, [r4]
	blt	.L3
	ldr	r3, [r4]
	cmp	r3, #0
	bne	.L3
	ldr	r2, [r4, #4]
	cmp	r2, #0
	subne	r1, r2, r1
	andne	r6, r1, ip
.L5:
	ldr	r2, .L24+4
	ldr	r3, [r0, #12]
	ldr	r5, [r2]
	cmp	r3, #0
	bic	r5, r6, r5
	beq	.L6
	ldr	r3, [r4, #16]
	cmp	r3, #0
	bne	.L23
.L7:
	ldr	r3, [r0, #8]
	cmp	r3, #0
	ldrne	r3, .L24+8
	ldrne	r3, [r3]
	orrne	r5, r5, r3
.L6:
	ldr	r3, .L24+12
	mov	r1, #0
	ldr	r2, [r3]
	ldr	r0, [r0, #4]
	orr	r2, r5, r2
	pop	{r4, r5, r6, lr}
	b	wrmsr
.L3:
	sub	r6, ip, r1
	b	.L5
.L23:
	mov	r3, r5
	mov	r2, #0
	ldr	r1, [r4, #8]
	bl	lvt_off_valid
	cmp	r0, #0
	ldrne	r3, .L24+16
	ldrne	r2, [r4, #8]
	ldrne	r3, [r3]
	ldreq	r0, [r4, #12]
	bicne	r5, r5, r3
	ldrne	r0, [r4, #12]
	orrne	r5, r5, r2, lsl #20
	b	.L7
.L25:
	.align	2
.L24:
	.word	THRESHOLD_MAX
	.word	MASK_INT_TYPE_HI
	.word	INT_TYPE_APIC
	.word	MASK_COUNT_EN_HI
	.word	MASK_LVTOFF_HI
	.size	threshold_restart_bank, .-threshold_restart_bank
	.comm	THRESHOLD_MAX,4,4
	.comm	MASK_OVERFLOW_HI,4,4
	.comm	MASK_LVTOFF_HI,4,4
	.comm	MASK_INT_TYPE_HI,4,4
	.comm	MASK_ERR_COUNT_HI,4,4
	.comm	MASK_COUNT_EN_HI,4,4
	.comm	INT_TYPE_APIC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
