	.file	"890605.c"
	.intel_syntax noprefix
	.text
	.globl	debug
	.type	debug, @function
debug:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	rdx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -8[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	debug, .-debug
	.section	.rodata
	.align 8
.LC0:
	.string	"Successfully allocated %zu bytes. Testing ..."
.LC1:
	.string	"Error for a[%zu]"
.LC2:
	.string	"success\n"
.LC3:
	.string	" failure [%zu errors]\n"
	.align 8
.LC4:
	.string	"Unable to allocate %zu bytes.\n"
	.text
	.globl	test
	.type	test, @function
test:
.LFB7:
	.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 -40[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L3
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	call	debug
	mov	QWORD PTR -24[rbp], 0
	mov	rax, QWORD PTR -40[rbp]
	sub	rax, 1
	mov	QWORD PTR -16[rbp], rax
	jmp	.L4
.L6:
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 42
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 42
	je	.L5
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -24[rbp], rdx
	test	rax, rax
	jne	.L5
	mov	rax, QWORD PTR -16[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	call	debug
.L5:
	shr	QWORD PTR -16[rbp]
.L4:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L6
	cmp	QWORD PTR -24[rbp], 0
	jne	.L7
	lea	rax, .LC2[rip]
	jmp	.L8
.L7:
	lea	rax, .LC3[rip]
.L8:
	mov	rdx, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	debug
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -24[rbp]
	jmp	.L9
.L3:
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	call	debug
	mov	rax, -1
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	test, .-test
	.section	.rodata
.LC5:
	.string	"SIZE_MAX = %zu\n"
	.align 8
.LC6:
	.string	"Maximum size successfully allocated: %zu bytes.\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 48
	mov	rsi, -1
	lea	rdi, .LC5[rip]
	call	debug
	mov	QWORD PTR -40[rbp], 0
	mov	QWORD PTR -24[rbp], -1
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -32[rbp], rax
	jmp	.L11
.L13:
	mov	rax, QWORD PTR -32[rbp]
	shr	rax
	mov	QWORD PTR -16[rbp], rax
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	test
	test	rax, rax
	jne	.L12
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	sub	rax, QWORD PTR -16[rbp]
	sub	rax, 1
	mov	QWORD PTR -32[rbp], rax
	jmp	.L11
.L12:
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR -32[rbp], rax
.L11:
	cmp	QWORD PTR -32[rbp], 0
	jne	.L13
	mov	rax, QWORD PTR -40[rbp]
	sub	rax, 1
	mov	rsi, rax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.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	"890605.c"
	.text
	.align	2
	.global	debug
	.syntax unified
	.arm
	.fpu softvfp
	.type	debug, %function
debug:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-8]
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	debug, .-debug
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Successfully allocated %zu bytes. Testing ...\000"
	.align	2
.LC1:
	.ascii	"Error for a[%zu]\000"
	.align	2
.LC2:
	.ascii	"success\012\000"
	.align	2
.LC3:
	.ascii	" failure [%zu errors]\012\000"
	.align	2
.LC4:
	.ascii	"Unable to allocate %zu bytes.\012\000"
	.text
	.align	2
	.global	test
	.syntax unified
	.arm
	.fpu softvfp
	.type	test, %function
test:
	@ 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	r0, [fp, #-24]
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L3
	ldr	r1, [fp, #-24]
	ldr	r0, .L10
	bl	debug
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	b	.L4
.L6:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #42
	strb	r2, [r3]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #42
	beq	.L5
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	str	r2, [fp, #-16]
	cmp	r3, #0
	bne	.L5
	ldr	r1, [fp, #-12]
	ldr	r0, .L10+4
	bl	debug
.L5:
	ldr	r3, [fp, #-12]
	lsr	r3, r3, #1
	str	r3, [fp, #-12]
.L4:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L6
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L7
	ldr	r3, .L10+8
	b	.L8
.L7:
	ldr	r3, .L10+12
.L8:
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	debug
	ldr	r0, [fp, #-8]
	bl	free
	ldr	r3, [fp, #-16]
	b	.L9
.L3:
	ldr	r1, [fp, #-24]
	ldr	r0, .L10+16
	bl	debug
	mvn	r3, #0
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	test, .-test
	.section	.rodata
	.align	2
.LC5:
	.ascii	"SIZE_MAX = %zu\012\000"
	.align	2
.LC6:
	.ascii	"Maximum size successfully allocated: %zu bytes.\012"
	.ascii	"\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	mvn	r1, #0
	ldr	r0, .L17
	bl	debug
	mov	r3, #0
	str	r3, [fp, #-24]
	mvn	r3, #0
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	sub	r3, r2, r3
	str	r3, [fp, #-20]
	b	.L13
.L15:
	ldr	r3, [fp, #-20]
	lsr	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	test
	mov	r3, r0
	cmp	r3, #0
	bne	.L14
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-24]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-12]
	sub	r3, r2, r3
	sub	r3, r3, #1
	str	r3, [fp, #-20]
	b	.L13
.L14:
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-20]
.L13:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L15
	ldr	r3, [fp, #-24]
	sub	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L17+4
	bl	printf
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
