	.file	"150999.c"
	.intel_syntax noprefix
	.text
	.globl	global_base
	.bss
	.align 8
	.type	global_base, @object
	.size	global_base, 8
global_base:
	.zero	8
	.section	.rodata
.LC0:
	.string	"finding a free block"
	.text
	.globl	find_free_block
	.type	find_free_block, @function
find_free_block:
.LFB0:
	.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
	mov	QWORD PTR -32[rbp], rsi
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	rax, QWORD PTR global_base[rip]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L2
.L4:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
.L2:
	cmp	QWORD PTR -8[rbp], 0
	je	.L3
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR 16[rax]
	test	eax, eax
	je	.L4
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	cmp	QWORD PTR -32[rbp], rax
	ja	.L4
.L3:
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	find_free_block, .-find_free_block
	.section	.rodata
.LC1:
	.string	"requesting new space "
.LC2:
	.string	"the_stack_data/150999.c"
.LC3:
	.string	"(void*)block == request"
	.text
	.globl	request_space
	.type	request_space, @function
request_space:
.LFB1:
	.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
	mov	QWORD PTR -32[rbp], rsi
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	edi, 0
	call	sbrk@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 24
	mov	rdi, rax
	call	sbrk@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	je	.L7
	lea	rcx, __PRETTY_FUNCTION__.0[rip]
	mov	edx, 38
	lea	rsi, .LC2[rip]
	lea	rdi, .LC3[rip]
	call	__assert_fail@PLT
.L7:
	cmp	QWORD PTR -8[rbp], -1
	jne	.L8
	mov	eax, 0
	jmp	.L9
.L8:
	cmp	QWORD PTR -24[rbp], 0
	je	.L10
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], rdx
.L10:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -32[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR 16[rax], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR 20[rax], 4660
	mov	rax, QWORD PTR -16[rbp]
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	request_space, .-request_space
	.globl	mymalloc
	.type	mymalloc, @function
mymalloc:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L12
	mov	eax, 0
	jmp	.L13
.L12:
	mov	rax, QWORD PTR global_base[rip]
	test	rax, rax
	jne	.L14
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rax
	mov	edi, 0
	call	request_space
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L15
	mov	eax, 0
	jmp	.L13
.L15:
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR global_base[rip], rax
	jmp	.L16
.L14:
	mov	rax, QWORD PTR global_base[rip]
	mov	QWORD PTR -24[rbp], rax
	mov	rdx, QWORD PTR -40[rbp]
	lea	rax, -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	find_free_block
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L17
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	request_space
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L16
	mov	eax, 0
	jmp	.L13
.L17:
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR 16[rax], 0
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR 20[rax], 30583
.L16:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 24
.L13:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	mymalloc, .-mymalloc
	.globl	get_block_ptr
	.type	get_block_ptr, @function
get_block_ptr:
.LFB3:
	.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 -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, 24
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	get_block_ptr, .-get_block_ptr
	.globl	free
	.type	free, @function
free:
.LFB4:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 24
	mov	QWORD PTR -24[rbp], rdi
	cmp	QWORD PTR -24[rbp], 0
	je	.L25
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	get_block_ptr
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 16[rax], 1
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR 20[rax], 21845
	jmp	.L22
.L25:
	nop
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	free, .-free
	.section	.rodata
.LC4:
	.string	"pointer val:%d \n"
.LC5:
	.string	"memory freed "
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.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	edi, 4
	call	mymalloc
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	DWORD PTR [rax], 5
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free
	mov	edi, 4
	call	mymalloc
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], 5
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free
	lea	rdi, .LC5[rip]
	call	puts@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	main, .-main
	.section	.rodata
	.align 8
	.type	__PRETTY_FUNCTION__.0, @object
	.size	__PRETTY_FUNCTION__.0, 14
__PRETTY_FUNCTION__.0:
	.string	"request_space"
	.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	"150999.c"
	.text
	.global	global_base
	.bss
	.align	2
	.type	global_base, %object
	.size	global_base, 4
global_base:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"finding a free block\000"
	.text
	.align	2
	.global	find_free_block
	.syntax unified
	.arm
	.fpu softvfp
	.type	find_free_block, %function
find_free_block:
	@ 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]
	str	r1, [fp, #-20]
	ldr	r0, .L6
	bl	puts
	ldr	r3, .L6+4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	b	.L2
.L4:
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
.L2:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L3
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bhi	.L4
.L3:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.word	global_base
	.size	find_free_block, .-find_free_block
	.section	.rodata
	.align	2
.LC1:
	.ascii	"requesting new space \000"
	.align	2
.LC2:
	.ascii	"the_stack_data/150999.c\000"
	.align	2
.LC3:
	.ascii	"(void*)block == request\000"
	.text
	.align	2
	.global	request_space
	.syntax unified
	.arm
	.fpu softvfp
	.type	request_space, %function
request_space:
	@ 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]
	str	r1, [fp, #-20]
	ldr	r0, .L13
	bl	puts
	mov	r0, #0
	bl	sbrk
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-20]
	add	r3, r3, #16
	mov	r0, r3
	bl	sbrk
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	beq	.L9
	ldr	r3, .L13+4
	mov	r2, #38
	ldr	r1, .L13+8
	ldr	r0, .L13+12
	bl	__assert_fail
.L9:
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L10
	mov	r3, #0
	b	.L11
.L10:
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L12
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	str	r2, [r3, #4]
.L12:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-20]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	mov	r2, #0
	str	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	mov	r2, #0
	str	r2, [r3, #8]
	ldr	r3, [fp, #-12]
	ldr	r2, .L13+16
	str	r2, [r3, #12]
	ldr	r3, [fp, #-12]
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC1
	.word	__PRETTY_FUNCTION__.5247
	.word	.LC2
	.word	.LC3
	.word	4660
	.size	request_space, .-request_space
	.section	.rodata
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	mymalloc
	.syntax unified
	.arm
	.fpu softvfp
	.type	mymalloc, %function
mymalloc:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L16
	mov	r3, #0
	b	.L17
.L16:
	ldr	r3, .L24+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L18
	ldr	r1, [fp, #-24]
	mov	r0, #0
	bl	request_space
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L19
	mov	r3, #0
	b	.L17
.L19:
	ldr	r2, .L24+4
	ldr	r3, [fp, #-12]
	str	r3, [r2]
	b	.L20
.L18:
	ldr	r3, .L24+4
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	sub	r3, fp, #16
	ldr	r1, [fp, #-24]
	mov	r0, r3
	bl	find_free_block
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L21
	ldr	r3, [fp, #-16]
	ldr	r1, [fp, #-24]
	mov	r0, r3
	bl	request_space
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L20
	mov	r3, #0
	b	.L17
.L21:
	ldr	r3, [fp, #-12]
	mov	r2, #0
	str	r2, [r3, #8]
	ldr	r3, [fp, #-12]
	ldr	r2, .L24+8
	str	r2, [r3, #12]
.L20:
	ldr	r3, [fp, #-12]
	add	r3, r3, #16
.L17:
	ldr	r2, .L24
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC4
	.word	global_base
	.word	30583
	.size	mymalloc, .-mymalloc
	.align	2
	.global	get_block_ptr
	.syntax unified
	.arm
	.fpu softvfp
	.type	get_block_ptr, %function
get_block_ptr:
	@ 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]
	sub	r3, r3, #16
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	get_block_ptr, .-get_block_ptr
	.align	2
	.global	free
	.syntax unified
	.arm
	.fpu softvfp
	.type	free, %function
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	.L31
	ldr	r0, [fp, #-16]
	bl	get_block_ptr
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r2, #1
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	ldr	r2, .L32
	str	r2, [r3, #12]
	b	.L28
.L31:
	nop
.L28:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L33:
	.align	2
.L32:
	.word	21845
	.size	free, .-free
	.section	.rodata
	.align	2
.LC5:
	.ascii	"pointer val:%d \012\000"
	.align	2
.LC6:
	.ascii	"memory freed \000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r0, #4
	bl	mymalloc
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	mov	r2, #5
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L35
	bl	printf
	ldr	r0, [fp, #-12]
	bl	free
	mov	r0, #4
	bl	mymalloc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r2, #5
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L35
	bl	printf
	ldr	r0, [fp, #-8]
	bl	free
	ldr	r0, .L35+4
	bl	puts
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L36:
	.align	2
.L35:
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.section	.rodata
	.align	2
	.type	__PRETTY_FUNCTION__.5247, %object
	.size	__PRETTY_FUNCTION__.5247, 14
__PRETTY_FUNCTION__.5247:
	.ascii	"request_space\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
