	.file	"extr_sn_hwperf.c_sn_hwperf_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sn_hwperf_init, @function
sn_hwperf_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	lea	rdi, sn_hwperf_init_mutex[rip]
	sub	rsp, 16
	.cfi_def_cfa_offset 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	mutex_lock@PLT
	cmp	QWORD PTR sn_hwperf_salheap[rip], 0
	je	.L2
	lea	rdi, sn_hwperf_init_mutex[rip]
	xor	r12d, r12d
	call	mutex_unlock@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	xor	eax, eax
	lea	r12, 4[rsp]
	call	ia64_sn_get_console_nasid@PLT
	push	0
	.cfi_def_cfa_offset 40
	mov	esi, DWORD PTR SN_HWPERF_GET_HEAPSIZE[rip]
	xor	r9d, r9d
	push	0
	.cfi_def_cfa_offset 48
	mov	r8d, r12d
	xor	edx, edx
	mov	rdi, rax
	mov	ecx, 4
	mov	QWORD PTR sn_hwperf_master_nasid[rip], rax
	call	ia64_sn_hwperf_op@PLT
	cmp	DWORD PTR SN_HWPERF_OP_OK[rip], eax
	pop	r8
	.cfi_def_cfa_offset 40
	pop	r9
	.cfi_def_cfa_offset 32
	je	.L4
.L16:
.L5:
	endbr64
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	test	r12d, r12d
	js	.L19
.L7:
	lea	rdi, sn_hwperf_init_mutex[rip]
	call	mutex_unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rdi, QWORD PTR sn_hwperf_salheap[rip]
	test	rdi, rdi
	je	.L7
	call	vfree@PLT
	mov	QWORD PTR sn_hwperf_salheap[rip], 0
	mov	DWORD PTR sn_hwperf_obj_cnt[rip], 0
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR 4[rsp]
	call	vmalloc@PLT
	mov	QWORD PTR sn_hwperf_salheap[rip], rax
	test	rax, rax
	je	.L20
	push	0
	.cfi_def_cfa_offset 40
	mov	esi, DWORD PTR SN_HWPERF_INSTALL_HEAP[rip]
	xor	r9d, r9d
	xor	edx, edx
	push	0
	.cfi_def_cfa_offset 48
	mov	rdi, QWORD PTR sn_hwperf_master_nasid[rip]
	mov	r8d, eax
	mov	ecx, DWORD PTR 20[rsp]
	call	ia64_sn_hwperf_op@PLT
	cmp	DWORD PTR SN_HWPERF_OP_OK[rip], eax
	pop	rsi
	.cfi_def_cfa_offset 40
	pop	rdi
	.cfi_def_cfa_offset 32
	jne	.L16
	push	0
	.cfi_def_cfa_offset 40
	mov	esi, DWORD PTR SN_HWPERF_OBJECT_COUNT[rip]
	xor	edx, edx
	xor	r9d, r9d
	push	0
	.cfi_def_cfa_offset 48
	mov	rdi, QWORD PTR sn_hwperf_master_nasid[rip]
	mov	ecx, 4
	mov	r8d, r12d
	call	ia64_sn_hwperf_op@PLT
	cmp	DWORD PTR SN_HWPERF_OP_OK[rip], eax
	pop	rdx
	.cfi_def_cfa_offset 40
	pop	rcx
	.cfi_def_cfa_offset 32
	jne	.L16
	mov	eax, DWORD PTR 4[rsp]
	xor	r12d, r12d
	mov	DWORD PTR sn_hwperf_obj_cnt[rip], eax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L7
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	sn_hwperf_init, .-sn_hwperf_init
	.comm	sn_hwperf_salheap,8,8
	.comm	sn_hwperf_obj_cnt,4,4
	.comm	sn_hwperf_master_nasid,8,8
	.comm	sn_hwperf_init_mutex,4,4
	.comm	SN_HWPERF_OP_OK,4,4
	.comm	SN_HWPERF_OBJECT_COUNT,4,4
	.comm	SN_HWPERF_INSTALL_HEAP,4,4
	.comm	SN_HWPERF_GET_HEAPSIZE,8,8
	.comm	ENOMEM,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_sn_hwperf.c_sn_hwperf_init.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sn_hwperf_init, %function
sn_hwperf_init:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L21
	ldr	r5, .L21+4
	sub	sp, sp, #28
	ldr	r0, .L21+8
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	bl	mutex_lock
	ldr	r4, [r5]
	cmp	r4, #0
	beq	.L2
	ldr	r0, .L21+8
	bl	mutex_unlock
	mov	r4, #0
.L1:
	ldr	r3, .L21
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L18
	mov	r0, r4
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L2:
	bl	ia64_sn_get_console_nasid
	ldr	r3, .L21+12
	str	r4, [sp, #12]
	str	r4, [sp, #8]
	str	r4, [sp, #4]
	ldr	r1, [r3]
	ldr	r7, .L21+16
	add	r3, sp, #16
	str	r3, [sp]
	mov	r2, r4
	mov	r3, #4
	str	r0, [r7]
	bl	ia64_sn_hwperf_op
	ldr	r6, .L21+20
	ldr	r3, [r6]
	cmp	r3, r0
	beq	.L4
.L16:
.L5:
	ldr	r3, .L21+24
	ldr	r4, [r3]
	rsb	r4, r4, #0
	cmp	r4, #0
	blt	.L19
.L7:
	ldr	r0, .L21+8
	bl	mutex_unlock
	b	.L1
.L19:
	ldr	r0, [r5]
	cmp	r0, #0
	beq	.L7
	bl	vfree
	mov	r3, #0
	ldr	r2, .L21+28
	str	r3, [r5]
	str	r3, [r2]
	b	.L7
.L4:
	ldr	r0, [sp, #16]
	bl	vmalloc
	cmp	r0, #0
	str	r0, [r5]
	beq	.L20
	stm	sp, {r0, r4}
	ldr	r3, .L21+32
	str	r4, [sp, #12]
	str	r4, [sp, #8]
	ldr	r1, [r3]
	mov	r2, r4
	ldr	r3, [sp, #16]
	ldr	r0, [r7]
	bl	ia64_sn_hwperf_op
	ldr	r3, [r6]
	cmp	r3, r0
	bne	.L16
	ldr	r3, .L21+36
	add	r2, sp, #16
	str	r2, [sp]
	str	r4, [sp, #12]
	str	r4, [sp, #8]
	str	r4, [sp, #4]
	ldr	r1, [r3]
	mov	r2, r4
	mov	r3, #4
	ldr	r0, [r7]
	bl	ia64_sn_hwperf_op
	ldr	r3, [r6]
	cmp	r3, r0
	bne	.L16
	ldr	r3, .L21+28
	ldr	r2, [sp, #16]
	str	r2, [r3]
	b	.L7
.L20:
	ldr	r3, .L21+40
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L7
.L18:
	bl	__stack_chk_fail
.L22:
	.align	2
.L21:
	.word	.LC0
	.word	sn_hwperf_salheap
	.word	sn_hwperf_init_mutex
	.word	SN_HWPERF_GET_HEAPSIZE
	.word	sn_hwperf_master_nasid
	.word	SN_HWPERF_OP_OK
	.word	EINVAL
	.word	sn_hwperf_obj_cnt
	.word	SN_HWPERF_INSTALL_HEAP
	.word	SN_HWPERF_OBJECT_COUNT
	.word	ENOMEM
	.size	sn_hwperf_init, .-sn_hwperf_init
	.comm	sn_hwperf_salheap,4,4
	.comm	sn_hwperf_obj_cnt,4,4
	.comm	sn_hwperf_master_nasid,4,4
	.comm	sn_hwperf_init_mutex,4,4
	.comm	SN_HWPERF_OP_OK,4,4
	.comm	SN_HWPERF_OBJECT_COUNT,4,4
	.comm	SN_HWPERF_INSTALL_HEAP,4,4
	.comm	SN_HWPERF_GET_HEAPSIZE,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
