	.file	"extr_bts.c_bts_event_stop.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	bts_event_stop, @function
bts_event_stop:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	lea	rdi, cpu_hw_events[rip]
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	this_cpu_ptr@PLT
	lea	rdi, bts_ctx[rip]
	mov	r14, rax
	call	this_cpu_ptr@PLT
	mov	edi, DWORD PTR 16[rax]
	mov	rbx, rax
	call	READ_ONCE@PLT
	cmp	DWORD PTR BTS_STATE_ACTIVE[rip], eax
	mov	r12d, eax
	je	.L15
.L2:
	cmp	DWORD PTR BTS_STATE_STOPPED[rip], r12d
	jne	.L16
	mov	eax, DWORD PTR PERF_HES_STOPPED[rip]
	or	DWORD PTR 0[rbp], eax
	test	DWORD PTR PERF_EF_UPDATE[rip], r13d
	jne	.L8
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L16:
	.cfi_restore_state
	lea	r15, 12[rbx]
	mov	rdi, r15
	call	perf_get_aux@PLT
	mov	r12, rax
	mov	eax, DWORD PTR PERF_HES_STOPPED[rip]
	or	DWORD PTR 0[rbp], eax
	test	DWORD PTR PERF_EF_UPDATE[rip], r13d
	je	.L1
	mov	rdi, rbx
	call	bts_update@PLT
	test	r12, r12
	je	.L6
	cmp	QWORD PTR 8[r12], 0
	lea	rbp, 4[r12]
	jne	.L17
.L7:
	xor	esi, esi
	mov	rdi, rbp
	call	local_xchg@PLT
	mov	rdi, r15
	mov	esi, eax
	call	perf_aux_output_end@PLT
.L6:
	mov	edx, DWORD PTR 8[rbx]
	mov	rax, QWORD PTR [r14]
	mov	DWORD PTR 12[rax], edx
	mov	DWORD PTR 8[rax], edx
	mov	edx, DWORD PTR 4[rbx]
	mov	DWORD PTR 4[rax], edx
	mov	edx, DWORD PTR [rbx]
	mov	DWORD PTR [rax], edx
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L15:
	.cfi_restore_state
	mov	esi, DWORD PTR BTS_STATE_STOPPED[rip]
	mov	rdi, rbp
	call	__bts_event_stop@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, rbx
	call	bts_update@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L17:
	mov	esi, DWORD PTR [r12]
	mov	ecx, DWORD PTR PAGE_SHIFT[rip]
	mov	rdi, rbp
	sal	esi, cl
	call	local_xchg@PLT
	mov	DWORD PTR 12[rbx], eax
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	bts_event_stop, .-bts_event_stop
	.comm	cpu_hw_events,4,4
	.comm	bts_ctx,4,4
	.comm	PERF_HES_STOPPED,4,4
	.comm	PERF_EF_UPDATE,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	BTS_STATE_STOPPED,4,4
	.comm	BTS_STATE_ACTIVE,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_bts.c_bts_event_stop.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bts_event_stop, %function
bts_event_stop:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r0
	ldr	r0, .L22
	mov	r7, r1
	bl	this_cpu_ptr
	mov	r8, r0
	ldr	r0, .L22+4
	bl	this_cpu_ptr
	mov	r4, r0
	ldr	r0, [r0, #16]
	bl	READ_ONCE
	ldr	r3, .L22+8
	mov	r6, r0
	ldr	r3, [r3]
	ldr	r9, .L22+12
	cmp	r3, r0
	beq	.L17
.L2:
	ldr	r3, [r9]
	cmp	r3, r6
	bne	.L20
	ldr	r2, .L22+16
	ldr	r3, [r5]
	ldr	r1, [r2]
	ldr	r2, .L22+20
	orr	r3, r3, r1
	str	r3, [r5]
	ldr	r3, [r2]
	tst	r7, r3
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r0, r4
	bl	bts_update
	b	.L6
.L20:
	add	r6, r4, #12
	mov	r0, r6
	bl	perf_get_aux
	ldr	r2, .L22+16
	ldr	r3, [r5]
	ldr	r1, [r2]
	ldr	r2, .L22+20
	orr	r3, r3, r1
	str	r3, [r5]
	ldr	r3, [r2]
	mov	r5, r0
	tst	r7, r3
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r0, r4
	bl	bts_update
	cmp	r5, #0
	beq	.L6
	ldr	r3, [r5, #8]
	add	r7, r5, #4
	cmp	r3, #0
	bne	.L21
.L7:
	mov	r1, #0
	mov	r0, r7
	bl	local_xchg
	mov	r1, r0
	mov	r0, r6
	bl	perf_aux_output_end
.L6:
	ldmib	r4, {r0, r2}
	ldr	r3, [r8]
	ldr	r1, [r4]
	stmib	r3, {r0, r2}
	str	r2, [r3, #12]
	str	r1, [r3]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L17:
	mov	r0, r5
	ldr	r1, [r9]
	bl	__bts_event_stop
	b	.L2
.L21:
	ldr	r3, .L22+24
	ldr	r1, [r5]
	ldr	r3, [r3]
	mov	r0, r7
	lsl	r1, r1, r3
	bl	local_xchg
	str	r0, [r4, #12]
	b	.L7
.L23:
	.align	2
.L22:
	.word	cpu_hw_events
	.word	bts_ctx
	.word	BTS_STATE_ACTIVE
	.word	BTS_STATE_STOPPED
	.word	PERF_HES_STOPPED
	.word	PERF_EF_UPDATE
	.word	PAGE_SHIFT
	.size	bts_event_stop, .-bts_event_stop
	.comm	cpu_hw_events,4,4
	.comm	bts_ctx,4,4
	.comm	PERF_HES_STOPPED,4,4
	.comm	PERF_EF_UPDATE,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	BTS_STATE_STOPPED,4,4
	.comm	BTS_STATE_ACTIVE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
