	.file	"extr_coresight-tmc-etr.c_alloc_etr_buf.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	alloc_etr_buf, @function
alloc_etr_buf:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	ebx, edx
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	edi, DWORD PTR [rsi]
	mov	r13d, DWORD PTR NUMA_NO_NODE[rip]
	cmp	edi, -1
	je	.L3
	call	cpu_to_node@PLT
	mov	r13d, eax
.L3:
	mov	ecx, DWORD PTR PAGE_SHIFT[rip]
	mov	edx, ebx
	movsx	rbx, DWORD PTR 0[rbp]
	sal	edx, cl
	cmp	edx, ebx
	jle	.L6
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L19:
	shr	rbx
	cmp	QWORD PTR TMC_ETR_PERF_MIN_BUF_SIZE[rip], rbx
	ja	.L18
.L6:
	xor	r8d, r8d
	xor	edx, edx
	mov	rdi, rbp
	mov	ecx, r13d
	mov	rsi, rbx
	call	tmc_alloc_etr_buf@PLT
	mov	rdi, rax
	mov	r12, rax
	call	IS_ERR@PLT
	test	eax, eax
	jne	.L19
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	edi, DWORD PTR ENOMEM[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	neg	edi
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	ERR_PTR@PLT
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	movsx	rsi, edx
	xor	r8d, r8d
	xor	edx, edx
	mov	rdi, rbp
	mov	ecx, r13d
	call	tmc_alloc_etr_buf@PLT
	mov	rdi, rax
	mov	r12, rax
	call	IS_ERR@PLT
	test	eax, eax
	je	.L1
	movsx	rbx, DWORD PTR 0[rbp]
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	alloc_etr_buf, .-alloc_etr_buf
	.comm	TMC_ETR_PERF_MIN_BUF_SIZE,8,8
	.comm	PAGE_SHIFT,4,4
	.comm	NUMA_NO_NODE,4,4
	.comm	ENOMEM,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_coresight-tmc-etr.c_alloc_etr_buf.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	alloc_etr_buf, %function
alloc_etr_buf:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r3, [r1]
	mov	r6, r0
	cmn	r3, #1
	mov	r5, r2
	sub	sp, sp, #12
	bne	.L16
	ldr	r3, .L20
	ldr	r7, [r3]
.L3:
	ldr	r3, .L20+4
	ldr	r4, [r6]
	ldr	r1, [r3]
	cmp	r4, r5, lsl r1
	lsl	r1, r5, r1
	blt	.L17
.L4:
	mov	r8, #0
	ldr	r9, .L20+8
	b	.L6
.L19:
	ldr	r3, [r9]
	cmp	r3, r4
	bhi	.L18
.L6:
	mov	r1, r4
	mov	r3, r7
	mov	r2, #0
	mov	r0, r6
	str	r8, [sp]
	bl	tmc_alloc_etr_buf
	mov	r5, r0
	bl	IS_ERR
	cmp	r0, #0
	lsr	r4, r4, #1
	bne	.L19
.L1:
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L16:
	mov	r0, r3
	bl	cpu_to_node
	mov	r7, r0
	b	.L3
.L18:
	ldr	r3, .L20+12
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, lr}
	b	ERR_PTR
.L17:
	mov	r2, #0
	mov	r3, r7
	str	r2, [sp]
	mov	r0, r6
	bl	tmc_alloc_etr_buf
	mov	r5, r0
	bl	IS_ERR
	cmp	r0, #0
	beq	.L1
	ldr	r4, [r6]
	b	.L4
.L21:
	.align	2
.L20:
	.word	NUMA_NO_NODE
	.word	PAGE_SHIFT
	.word	TMC_ETR_PERF_MIN_BUF_SIZE
	.word	ENOMEM
	.size	alloc_etr_buf, .-alloc_etr_buf
	.comm	TMC_ETR_PERF_MIN_BUF_SIZE,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	NUMA_NO_NODE,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
