	.file	"357670.c"
	.intel_syntax noprefix
	.text
	.globl	pointerToSharedSegment
	.bss
	.align 8
	.type	pointerToSharedSegment, @object
	.size	pointerToSharedSegment, 8
pointerToSharedSegment:
	.zero	8
	.globl	info
	.align 8
	.type	info, @object
	.size	info, 8
info:
	.zero	8
	.section	.rodata
.LC0:
	.string	"/sbmemlib"
	.text
	.globl	sbmem_init
	.type	sbmem_init, @function
sbmem_init:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	eax, DWORD PTR -20[rbp]
	mov	edi, eax
	call	is_pow2
	test	eax, eax
	jne	.L2
	mov	eax, -1
	jmp	.L3
.L2:
	cmp	DWORD PTR -20[rbp], 256000
	jg	.L4
	cmp	DWORD PTR -20[rbp], 31999
	jg	.L5
.L4:
	mov	eax, -1
	jmp	.L3
.L5:
	mov	edx, 438
	mov	esi, 578
	lea	rdi, .LC0[rip]
	call	shm_open@PLT
	mov	DWORD PTR -16[rbp], eax
	cmp	DWORD PTR -16[rbp], -1
	jne	.L6
	mov	eax, -1
	jmp	.L3
.L6:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	add	rax, 40
	mov	rdx, rax
	mov	eax, DWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	ftruncate@PLT
	test	eax, eax
	je	.L7
	mov	eax, -1
	jmp	.L3
.L7:
	mov	eax, DWORD PTR -16[rbp]
	mov	r9d, 0
	mov	r8d, eax
	mov	ecx, 1
	mov	edx, 3
	mov	esi, 48
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L8
	mov	eax, -1
	jmp	.L3
.L8:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 8
	mov	edx, 1
	mov	esi, 1
	mov	rdi, rax
	call	sem_init@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -12[rbp], 0
	je	.L9
	mov	eax, -1
	jmp	.L3
.L9:
	add	QWORD PTR -8[rbp], 40
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	sbmem_init, .-sbmem_init
	.globl	sbmem_remove
	.type	sbmem_remove, @function
sbmem_remove:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR info[rip]
	add	rax, 8
	mov	rdi, rax
	call	sem_destroy@PLT
	lea	rdi, .LC0[rip]
	call	shm_unlink@PLT
	cmp	eax, -1
	jne	.L11
	mov	eax, -1
	jmp	.L12
.L11:
	mov	eax, 0
.L12:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sbmem_remove, .-sbmem_remove
	.globl	sbmem_open
	.type	sbmem_open, @function
sbmem_open:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	edx, 438
	mov	esi, 2
	lea	rdi, .LC0[rip]
	call	shm_open@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L14
	mov	eax, -1
	jmp	.L15
.L14:
	mov	eax, DWORD PTR -4[rbp]
	mov	r9d, 0
	mov	r8d, eax
	mov	ecx, 1
	mov	edx, 3
	mov	esi, 40
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR info[rip], rax
	mov	rax, QWORD PTR info[rip]
	cmp	rax, -1
	jne	.L16
	mov	eax, -1
	jmp	.L15
.L16:
	mov	rax, QWORD PTR info[rip]
	mov	eax, DWORD PTR [rax]
	cdqe
	add	rax, 40
	mov	edx, DWORD PTR -4[rbp]
	mov	r9d, 0
	mov	r8d, edx
	mov	ecx, 1
	mov	edx, 3
	mov	rsi, rax
	mov	edi, 0
	call	mmap@PLT
	mov	QWORD PTR pointerToSharedSegment[rip], rax
	mov	rax, QWORD PTR pointerToSharedSegment[rip]
	cmp	rax, -1
	jne	.L17
	mov	eax, -1
	jmp	.L15
.L17:
	mov	rax, QWORD PTR pointerToSharedSegment[rip]
	add	rax, 40
	mov	QWORD PTR pointerToSharedSegment[rip], rax
	mov	eax, 0
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sbmem_open, .-sbmem_open
	.globl	sbmem_alloc
	.type	sbmem_alloc, @function
sbmem_alloc:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	rax, QWORD PTR info[rip]
	add	rax, 8
	mov	rdi, rax
	call	sem_wait@PLT
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 8
	mov	DWORD PTR -20[rbp], eax
	mov	rax, QWORD PTR pointerToSharedSegment[rip]
	mov	QWORD PTR -16[rbp], rax
	mov	QWORD PTR -8[rbp], 0
.L24:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	cmp	DWORD PTR -20[rbp], eax
	jg	.L19
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L19
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	split_chunck
	jmp	.L20
.L19:
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	eax, 1
	je	.L21
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	DWORD PTR -20[rbp], eax
	jle	.L22
.L21:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	get_next
	mov	QWORD PTR -16[rbp], rax
	jmp	.L20
.L22:
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR [rax], 1
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	QWORD PTR -8[rbp], rax
	jmp	.L23
.L20:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L24
.L23:
	mov	rax, QWORD PTR info[rip]
	add	rax, 8
	mov	rdi, rax
	call	sem_post@PLT
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	sbmem_alloc, .-sbmem_alloc
	.globl	sbmem_free
	.type	sbmem_free, @function
sbmem_free:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	cmp	QWORD PTR -24[rbp], 0
	je	.L32
	mov	rax, QWORD PTR info[rip]
	add	rax, 8
	mov	rdi, rax
	call	sem_wait@PLT
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, 8
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	find_buddy
	mov	QWORD PTR -8[rbp], rax
	jmp	.L29
.L31:
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	merge_buddies
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	find_buddy
	mov	QWORD PTR -8[rbp], rax
.L29:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	eax, 1
	je	.L30
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	edx, eax
	je	.L31
.L30:
	mov	rax, QWORD PTR info[rip]
	add	rax, 8
	mov	rdi, rax
	call	sem_post@PLT
	jmp	.L26
.L32:
	nop
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	sbmem_free, .-sbmem_free
	.globl	sbmem_close
	.type	sbmem_close, @function
sbmem_close:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR info[rip]
	mov	eax, DWORD PTR [rax]
	cdqe
	lea	rdx, 4[rax]
	mov	rax, QWORD PTR pointerToSharedSegment[rip]
	sub	rax, 160
	mov	rsi, rdx
	mov	rdi, rax
	call	munmap@PLT
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	sbmem_close, .-sbmem_close
	.globl	find_buddy
	.type	find_buddy, @function
find_buddy:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 40
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 4[rax]
	pxor	xmm2, xmm2
	cvtsi2sd	xmm2, eax
	movq	rax, xmm2
	movq	xmm0, rax
	call	log2@PLT
	cvttsd2si	eax, xmm0
	mov	DWORD PTR -20[rbp], eax
	mov	rdx, QWORD PTR pointerToSharedSegment[rip]
	mov	rax, QWORD PTR -40[rbp]
	sub	rax, rdx
	mov	rbx, rax
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 1
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	mov	rax, QWORD PTR .LC1[rip]
	movapd	xmm1, xmm0
	movq	xmm0, rax
	call	pow@PLT
	cvttsd2si	rcx, xmm0
	mov	rax, rbx
	cqo
	idiv	rcx
	mov	rax, rdx
	test	rax, rax
	jne	.L36
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 4[rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	jmp	.L37
.L36:
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 4[rax]
	cdqe
	neg	rax
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
.L37:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	find_buddy, .-find_buddy
	.globl	merge_buddies
	.type	merge_buddies, @function
merge_buddies:
.LFB13:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR -56[rbp]
	mov	eax, DWORD PTR 4[rax]
	pxor	xmm2, xmm2
	cvtsi2sd	xmm2, eax
	movq	rax, xmm2
	movq	xmm0, rax
	call	log2@PLT
	cvttsd2si	eax, xmm0
	mov	DWORD PTR -36[rbp], eax
	mov	rdx, QWORD PTR pointerToSharedSegment[rip]
	mov	rax, QWORD PTR -56[rbp]
	sub	rax, rdx
	mov	rbx, rax
	mov	eax, DWORD PTR -36[rbp]
	add	eax, 1
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, eax
	mov	rax, QWORD PTR .LC1[rip]
	movapd	xmm1, xmm0
	movq	xmm0, rax
	call	pow@PLT
	cvttsd2si	rcx, xmm0
	mov	rax, rbx
	cqo
	idiv	rcx
	mov	rax, rdx
	test	rax, rax
	jne	.L39
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	mov	QWORD PTR -24[rbp], rax
	jmp	.L40
.L39:
	mov	rax, QWORD PTR -64[rbp]
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR -24[rbp], rax
.L40:
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	add	edx, eax
	mov	rax, QWORD PTR -32[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	rax, QWORD PTR -32[rbp]
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	merge_buddies, .-merge_buddies
	.globl	split_chunck
	.type	split_chunck, @function
split_chunck:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	cdqe
	and	rax, -8
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 4[rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	DWORD PTR 4[rax], edx
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	split_chunck, .-split_chunck
	.section	.rodata
.LC2:
	.string	"---------------------------"
.LC3:
	.string	"     MEMORY CONTENT        "
.LC4:
	.string	"___________________________"
.LC5:
	.string	"| Addr:           \b %p \b\n"
.LC6:
	.string	"| size:           \b %d \b\n"
.LC7:
	.string	"| is Allocated:   \b %d \b\n"
.LC8:
	.string	"| next's address2: \b %p \b\n"
	.text
	.globl	print_memory
	.type	print_memory, @function
print_memory:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	rax, QWORD PTR pointerToSharedSegment[rip]
	mov	QWORD PTR -8[rbp], rax
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	jmp	.L44
.L45:
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	get_next
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	get_next
	mov	QWORD PTR -8[rbp], rax
.L44:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L45
	lea	rdi, .LC4[rip]
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	print_memory, .-print_memory
	.globl	is_pow2
	.type	is_pow2, @function
is_pow2:
.LFB16:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	cmp	DWORD PTR -4[rbp], 0
	je	.L47
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 1
	and	eax, DWORD PTR -4[rbp]
	test	eax, eax
	jne	.L47
	mov	eax, 1
	jmp	.L49
.L47:
	mov	eax, 0
.L49:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	is_pow2, .-is_pow2
	.globl	get_next
	.type	get_next, @function
get_next:
.LFB17:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	eax, DWORD PTR 4[rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	rdx, QWORD PTR pointerToSharedSegment[rip]
	mov	rax, QWORD PTR info[rip]
	mov	eax, DWORD PTR [rax]
	cdqe
	add	rax, rdx
	cmp	QWORD PTR -8[rbp], rax
	jnb	.L51
	mov	rax, QWORD PTR -8[rbp]
	jmp	.L52
.L51:
	mov	eax, 0
.L52:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	get_next, .-get_next
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1073741824
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"357670.c"
	.text
	.global	pointerToSharedSegment
	.bss
	.align	2
	.type	pointerToSharedSegment, %object
	.size	pointerToSharedSegment, 4
pointerToSharedSegment:
	.space	4
	.comm	info,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/sbmemlib\000"
	.text
	.align	2
	.global	sbmem_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbmem_init, %function
sbmem_init:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	ldr	r0, [fp, #-24]
	bl	is_pow2
	mov	r3, r0
	cmp	r3, #0
	bne	.L2
	mvn	r3, #0
	b	.L3
.L2:
	ldr	r3, [fp, #-24]
	cmp	r3, #256000
	bgt	.L4
	ldr	r3, [fp, #-24]
	cmp	r3, #32000
	bge	.L5
.L4:
	mvn	r3, #0
	b	.L3
.L5:
	ldr	r2, .L10
	ldr	r1, .L10+4
	ldr	r0, .L10+8
	bl	shm_open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L6
	mvn	r3, #0
	b	.L3
.L6:
	ldr	r3, [fp, #-24]
	add	r3, r3, #20
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	ftruncate
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	mvn	r3, #0
	b	.L3
.L7:
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-16]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r1, #28
	mov	r0, #0
	bl	mmap
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmn	r3, #1
	bne	.L8
	mvn	r3, #0
	b	.L3
.L8:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-24]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	mov	r2, #1
	mov	r1, #1
	mov	r0, r3
	bl	sem_init
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L9
	mvn	r3, #0
	b	.L3
.L9:
	ldr	r3, [fp, #-12]
	add	r3, r3, #20
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-24]
	str	r2, [r3, #4]
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	438
	.word	578
	.word	.LC0
	.size	sbmem_init, .-sbmem_init
	.align	2
	.global	sbmem_remove
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbmem_remove, %function
sbmem_remove:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L15
	ldr	r3, [r3]
	add	r3, r3, #4
	mov	r0, r3
	bl	sem_destroy
	ldr	r0, .L15+4
	bl	shm_unlink
	mov	r3, r0
	cmn	r3, #1
	bne	.L13
	mvn	r3, #0
	b	.L14
.L13:
	mov	r3, #0
.L14:
	mov	r0, r3
	pop	{fp, pc}
.L16:
	.align	2
.L15:
	.word	info
	.word	.LC0
	.size	sbmem_remove, .-sbmem_remove
	.align	2
	.global	sbmem_open
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbmem_open, %function
sbmem_open:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r2, .L22
	mov	r1, #2
	ldr	r0, .L22+4
	bl	shm_open
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L18
	mvn	r3, #0
	b	.L19
.L18:
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-8]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r1, #20
	mov	r0, #0
	bl	mmap
	mov	r3, r0
	ldr	r2, .L22+8
	str	r3, [r2]
	ldr	r3, .L22+8
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L20
	mvn	r3, #0
	b	.L19
.L20:
	ldr	r3, .L22+8
	ldr	r3, [r3]
	ldr	r3, [r3]
	add	r1, r3, #20
	mov	r3, #0
	str	r3, [sp, #4]
	ldr	r3, [fp, #-8]
	str	r3, [sp]
	mov	r3, #1
	mov	r2, #3
	mov	r0, #0
	bl	mmap
	mov	r3, r0
	ldr	r2, .L22+12
	str	r3, [r2]
	ldr	r3, .L22+12
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L21
	mvn	r3, #0
	b	.L19
.L21:
	ldr	r3, .L22+12
	ldr	r3, [r3]
	add	r3, r3, #20
	ldr	r2, .L22+12
	str	r3, [r2]
	mov	r3, #0
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	438
	.word	.LC0
	.word	info
	.word	pointerToSharedSegment
	.size	sbmem_open, .-sbmem_open
	.align	2
	.global	sbmem_alloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbmem_alloc, %function
sbmem_alloc:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, .L32
	ldr	r3, [r3]
	add	r3, r3, #4
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-16]
	add	r3, r3, #8
	str	r3, [fp, #-16]
	ldr	r3, .L32+4
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
.L30:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-16]
	cmp	r3, r2
	bgt	.L25
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L25
	ldr	r0, [fp, #-12]
	bl	split_chunck
	b	.L26
.L25:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	cmp	r3, #1
	beq	.L27
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	ble	.L28
.L27:
	ldr	r0, [fp, #-12]
	bl	get_next
	str	r0, [fp, #-12]
	b	.L26
.L28:
	ldr	r3, [fp, #-12]
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	str	r3, [fp, #-8]
	b	.L29
.L26:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L30
.L29:
	ldr	r3, .L32
	ldr	r3, [r3]
	add	r3, r3, #4
	mov	r0, r3
	bl	sem_post
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L33:
	.align	2
.L32:
	.word	info
	.word	pointerToSharedSegment
	.size	sbmem_alloc, .-sbmem_alloc
	.align	2
	.global	sbmem_free
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbmem_free, %function
sbmem_free:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L40
	ldr	r3, .L41
	ldr	r3, [r3]
	add	r3, r3, #4
	mov	r0, r3
	bl	sem_wait
	ldr	r3, [fp, #-16]
	sub	r3, r3, #8
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, [fp, #-12]
	bl	find_buddy
	str	r0, [fp, #-8]
	b	.L37
.L39:
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	merge_buddies
	str	r0, [fp, #-12]
	ldr	r0, [fp, #-12]
	bl	find_buddy
	str	r0, [fp, #-8]
.L37:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r3, #1
	beq	.L38
	ldr	r3, [fp, #-8]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #4]
	cmp	r2, r3
	beq	.L39
.L38:
	ldr	r3, .L41
	ldr	r3, [r3]
	add	r3, r3, #4
	mov	r0, r3
	bl	sem_post
	b	.L34
.L40:
	nop
.L34:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L42:
	.align	2
.L41:
	.word	info
	.size	sbmem_free, .-sbmem_free
	.align	2
	.global	sbmem_close
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbmem_close, %function
sbmem_close:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L45
	ldr	r3, [r3]
	sub	r2, r3, #80
	ldr	r3, .L45+4
	ldr	r3, [r3]
	ldr	r3, [r3]
	add	r3, r3, #4
	mov	r1, r3
	mov	r0, r2
	bl	munmap
	mov	r3, #0
	mov	r0, r3
	pop	{fp, pc}
.L46:
	.align	2
.L45:
	.word	pointerToSharedSegment
	.word	info
	.size	sbmem_close, .-sbmem_close
	.global	__aeabi_i2d
	.global	__aeabi_d2iz
	.global	__aeabi_idivmod
	.align	2
	.global	find_buddy
	.syntax unified
	.arm
	.fpu softvfp
	.type	find_buddy, %function
find_buddy:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	log2
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2iz
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, .L50
	ldr	r3, [r3]
	ldr	r2, [fp, #-24]
	sub	r4, r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, #0
	mov	r1, #1073741824
	bl	pow
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2iz
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	__aeabi_idivmod
	mov	r3, r1
	cmp	r3, #0
	bne	.L48
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, r2
	b	.L49
.L48:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	rsb	r3, r3, #0
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
.L49:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L51:
	.align	2
.L50:
	.word	pointerToSharedSegment
	.size	find_buddy, .-find_buddy
	.align	2
	.global	merge_buddies
	.syntax unified
	.arm
	.fpu softvfp
	.type	merge_buddies, %function
merge_buddies:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #28
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, [fp, #-32]
	ldr	r3, [r3, #4]
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	log2
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2iz
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, .L56
	ldr	r3, [r3]
	ldr	r2, [fp, #-32]
	sub	r4, r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	mov	r0, r3
	bl	__aeabi_i2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, #0
	mov	r1, #1073741824
	bl	pow
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2iz
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	__aeabi_idivmod
	mov	r3, r1
	cmp	r3, #0
	bne	.L53
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-36]
	str	r3, [fp, #-20]
	b	.L54
.L53:
	ldr	r3, [fp, #-36]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-20]
.L54:
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #4]
	add	r2, r2, r3
	ldr	r3, [fp, #-24]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-24]
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L57:
	.align	2
.L56:
	.word	pointerToSharedSegment
	.size	merge_buddies, .-merge_buddies
	.align	2
	.global	split_chunck
	.syntax unified
	.arm
	.fpu softvfp
	.type	split_chunck, %function
split_chunck:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	bic	r3, r3, #7
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-8]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-16]
	str	r2, [r3, #4]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	split_chunck, .-split_chunck
	.section	.rodata
	.align	2
.LC1:
	.ascii	"---------------------------\000"
	.align	2
.LC2:
	.ascii	"     MEMORY CONTENT        \000"
	.align	2
.LC3:
	.ascii	"___________________________\000"
	.align	2
.LC4:
	.ascii	"| Addr:           \010 %p \010\012\000"
	.align	2
.LC5:
	.ascii	"| size:           \010 %d \010\012\000"
	.align	2
.LC6:
	.ascii	"| is Allocated:   \010 %d \010\012\000"
	.align	2
.LC7:
	.ascii	"| next's address2: \010 %p \010\012\000"
	.text
	.align	2
	.global	print_memory
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_memory, %function
print_memory:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r3, .L62
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r0, .L62+4
	bl	puts
	ldr	r0, .L62+8
	bl	puts
	ldr	r0, .L62+12
	bl	puts
	b	.L60
.L61:
	ldr	r1, [fp, #-8]
	ldr	r0, .L62+16
	bl	printf
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	mov	r1, r3
	ldr	r0, .L62+20
	bl	printf
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L62+24
	bl	printf
	ldr	r0, [fp, #-8]
	bl	get_next
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L62+28
	bl	printf
	ldr	r0, .L62+12
	bl	puts
	ldr	r0, [fp, #-8]
	bl	get_next
	str	r0, [fp, #-8]
.L60:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L61
	ldr	r0, .L62+12
	bl	puts
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L63:
	.align	2
.L62:
	.word	pointerToSharedSegment
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	print_memory, .-print_memory
	.align	2
	.global	is_pow2
	.syntax unified
	.arm
	.fpu softvfp
	.type	is_pow2, %function
is_pow2:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L65
	ldr	r3, [fp, #-8]
	sub	r2, r3, #1
	ldr	r3, [fp, #-8]
	and	r3, r3, r2
	cmp	r3, #0
	bne	.L65
	mov	r3, #1
	b	.L67
.L65:
	mov	r3, #0
.L67:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	is_pow2, .-is_pow2
	.align	2
	.global	get_next
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_next, %function
get_next:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, .L71
	ldr	r3, [r3]
	ldr	r2, .L71+4
	ldr	r2, [r2]
	ldr	r2, [r2]
	add	r3, r3, r2
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bcs	.L69
	ldr	r3, [fp, #-8]
	b	.L70
.L69:
	mov	r3, #0
.L70:
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L72:
	.align	2
.L71:
	.word	pointerToSharedSegment
	.word	info
	.size	get_next, .-get_next
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
