	.file	"extr_cs-etm.c_cs_etm_set_option.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	cs_etm_set_option, @function
cs_etm_set_option:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rsi
	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
	mov	ebp, edx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xor	ebx, ebx
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR [rsi]
	mov	r12d, DWORD PTR EINVAL[rip]
	mov	QWORD PTR 8[rsp], rdi
	xor	edi, edi
	mov	r13, QWORD PTR [rax]
	neg	r12d
	call	perf_cpu_map__new@PLT
	mov	r14, rax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	mov	eax, DWORD PTR ETM_OPT_TS[rip]
	test	eax, ebp
	jne	.L22
.L6:
	or	eax, DWORD PTR ETM_OPT_CTXTID[rip]
	not	eax
	test	eax, ebp
	jne	.L5
.L3:
	add	ebx, 1
.L2:
	xor	eax, eax
	call	cpu__max_cpu@PLT
	cmp	eax, ebx
	jle	.L23
	mov	esi, ebx
	mov	rdi, r13
	call	cpu_map__has@PLT
	test	eax, eax
	je	.L3
	mov	esi, ebx
	mov	rdi, r14
	call	cpu_map__has@PLT
	test	eax, eax
	je	.L3
	test	DWORD PTR ETM_OPT_CTXTID[rip], ebp
	je	.L4
	mov	rdi, QWORD PTR 8[rsp]
	mov	edx, ebx
	mov	rsi, r15
	call	cs_etm_set_context_id@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L4
.L5:
	mov	rdi, r14
	call	perf_cpu_map__put@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L22:
	.cfi_restore_state
	mov	rdi, QWORD PTR 8[rsp]
	mov	edx, ebx
	mov	rsi, r15
	call	cs_etm_set_timestamp@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L5
	mov	eax, DWORD PTR ETM_OPT_TS[rip]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L23:
	xor	r12d, r12d
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	cs_etm_set_option, .-cs_etm_set_option
	.comm	ETM_OPT_TS,4,4
	.comm	ETM_OPT_CTXTID,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_cs-etm.c_cs_etm_set_option.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cs_etm_set_option, %function
cs_etm_set_option:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, r1
	ldr	r1, .L24
	ldr	r3, [r10]
	ldr	r5, [r1]
	ldr	r6, [r3]
	sub	sp, sp, #12
	rsb	r3, r5, #0
	mov	fp, r0
	mov	r0, #0
	mov	r4, r2
	str	r3, [sp, #4]
	bl	perf_cpu_map__new
	mov	r5, #0
	mov	r8, r0
	ldr	r7, .L24+4
	ldr	r9, .L24+8
	b	.L2
.L4:
	ldr	r3, [r9]
	tst	r3, r4
	bne	.L22
.L6:
	ldr	r1, [r7]
	orr	r3, r3, r1
	bics	r3, r4, r3
	bne	.L5
.L3:
	add	r5, r5, #1
.L2:
	bl	cpu__max_cpu
	cmp	r0, r5
	ble	.L23
	mov	r1, r5
	mov	r0, r6
	bl	cpu_map__has
	cmp	r0, #0
	beq	.L3
	mov	r1, r5
	mov	r0, r8
	bl	cpu_map__has
	cmp	r0, #0
	beq	.L3
	ldr	r3, [r7]
	tst	r4, r3
	beq	.L4
	mov	r2, r5
	mov	r1, r10
	mov	r0, fp
	bl	cs_etm_set_context_id
	subs	r3, r0, #0
	str	r3, [sp, #4]
	beq	.L4
.L5:
	mov	r0, r8
	bl	perf_cpu_map__put
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L22:
	mov	r2, r5
	mov	r1, r10
	mov	r0, fp
	bl	cs_etm_set_timestamp
	subs	r3, r0, #0
	str	r3, [sp, #4]
	bne	.L5
	ldr	r3, [r9]
	b	.L6
.L23:
	mov	r3, #0
	str	r3, [sp, #4]
	b	.L5
.L25:
	.align	2
.L24:
	.word	EINVAL
	.word	ETM_OPT_CTXTID
	.word	ETM_OPT_TS
	.size	cs_etm_set_option, .-cs_etm_set_option
	.comm	ETM_OPT_TS,4,4
	.comm	ETM_OPT_CTXTID,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
