	.file	"440884.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"usage: alloc-1 [MBs]"
	.align 8
.LC1:
	.string	"alloc-1: allocating %lu MB (%lu bytes)\n"
.LC2:
	.string	"alloc-1: 0%%"
	.align 8
.LC3:
	.string	"\nalloc-1: calloc failed, cbDone=%lu MB (%lu bytes)\n"
.LC5:
	.string	"%u%%"
.LC6:
	.string	"\nalloc-1: done"
	.text
	.globl	main
	.type	main, @function
main:
.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, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	QWORD PTR -32[rbp], 1024
	cmp	DWORD PTR -52[rbp], 2
	jne	.L2
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	strtoul@PLT
	mov	QWORD PTR -32[rbp], rax
.L2:
	cmp	QWORD PTR -32[rbp], 0
	je	.L3
	cmp	DWORD PTR -52[rbp], 2
	jle	.L4
.L3:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L5
.L4:
	mov	rax, QWORD PTR -32[rbp]
	sal	rax, 20
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	shr	rax, 20
	cmp	QWORD PTR -32[rbp], rax
	je	.L6
	mov	QWORD PTR -24[rbp], -1048576
.L6:
	mov	rax, QWORD PTR -24[rbp]
	shr	rax, 20
	mov	rcx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, rax
	mov	rsi, rcx
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
	mov	QWORD PTR -40[rbp], 0
	mov	DWORD PTR -48[rbp], 0
	jmp	.L7
.L18:
	mov	eax, 10485760
	cmp	QWORD PTR -24[rbp], 10485760
	cmovbe	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L8
	mov	rax, QWORD PTR -40[rbp]
	shr	rax, 20
	mov	rcx, rax
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, rax
	mov	rsi, rcx
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L5
.L8:
	mov	rax, QWORD PTR -16[rbp]
	add	QWORD PTR -40[rbp], rax
	jmp	.L9
.L10:
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], dl
	add	QWORD PTR -8[rbp], 4096
	sub	QWORD PTR -16[rbp], 4096
.L9:
	cmp	QWORD PTR -16[rbp], 4095
	ja	.L10
	mov	rax, QWORD PTR -40[rbp]
	test	rax, rax
	js	.L11
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	jmp	.L12
.L11:
	mov	rdx, rax
	shr	rdx
	and	eax, 1
	or	rdx, rax
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rdx
	addsd	xmm0, xmm0
.L12:
	movsd	xmm1, QWORD PTR .LC4[rip]
	mulsd	xmm1, xmm0
	mov	rax, QWORD PTR -24[rbp]
	test	rax, rax
	js	.L13
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rax
	jmp	.L14
.L13:
	mov	rdx, rax
	shr	rdx
	and	eax, 1
	or	rdx, rax
	pxor	xmm0, xmm0
	cvtsi2sd	xmm0, rdx
	addsd	xmm0, xmm0
.L14:
	divsd	xmm1, xmm0
	cvttsd2si	rax, xmm1
	mov	DWORD PTR -44[rbp], eax
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, DWORD PTR -48[rbp]
	je	.L15
	mov	eax, DWORD PTR -44[rbp]
	and	eax, 1
	test	eax, eax
	jne	.L15
	mov	ecx, DWORD PTR -44[rbp]
	mov	edx, ecx
	mov	eax, 3435973837
	imul	rax, rdx
	shr	rax, 32
	mov	edx, eax
	shr	edx, 3
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	sub	ecx, eax
	mov	edx, ecx
	test	edx, edx
	jne	.L16
	mov	eax, DWORD PTR -44[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L17
.L16:
	mov	edi, 46
	call	putchar@PLT
.L17:
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fflush@PLT
.L15:
	mov	eax, DWORD PTR -44[rbp]
	mov	DWORD PTR -48[rbp], eax
.L7:
	mov	rax, QWORD PTR -40[rbp]
	cmp	rax, QWORD PTR -24[rbp]
	jb	.L18
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, 0
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.long	0
	.long	1079574528
	.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	"440884.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"usage: alloc-1 [MBs]\000"
	.align	2
.LC1:
	.ascii	"alloc-1: allocating %lu MB (%lu bytes)\012\000"
	.align	2
.LC2:
	.ascii	"alloc-1: 0%%\000"
	.align	2
.LC3:
	.ascii	"\012alloc-1: calloc failed, cbDone=%lu MB (%lu byte"
	.ascii	"s)\012\000"
	.global	__aeabi_ui2d
	.global	__aeabi_dmul
	.global	__aeabi_ddiv
	.global	__aeabi_d2uiz
	.align	2
.LC4:
	.ascii	"%u%%\000"
	.align	2
.LC5:
	.ascii	"\012alloc-1: done\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #40
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	mov	r3, #1024
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-48]
	cmp	r3, #2
	bne	.L2
	ldr	r3, [fp, #-52]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	strtoul
	str	r0, [fp, #-32]
.L2:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L3
	ldr	r3, [fp, #-48]
	cmp	r3, #2
	ble	.L4
.L3:
	ldr	r0, .L15
	bl	puts
	mov	r3, #1
	b	.L5
.L4:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #20
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	lsr	r3, r3, #20
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	beq	.L6
	ldr	r3, .L15+4
	str	r3, [fp, #-28]
.L6:
	ldr	r3, [fp, #-28]
	lsr	r3, r3, #20
	ldr	r2, [fp, #-28]
	mov	r1, r3
	ldr	r0, .L15+8
	bl	printf
	ldr	r0, .L15+12
	bl	printf
	ldr	r3, .L15+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
	mov	r3, #0
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-40]
	b	.L7
.L14:
	ldr	r3, [fp, #-28]
	cmp	r3, #10485760
	movcc	r3, r3
	movcs	r3, #10485760
	str	r3, [fp, #-24]
	ldr	r0, [fp, #-24]
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L8
	ldr	r3, [fp, #-36]
	lsr	r3, r3, #20
	ldr	r2, [fp, #-36]
	mov	r1, r3
	ldr	r0, .L15+20
	bl	printf
	mov	r3, #1
	b	.L5
.L8:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-24]
	add	r3, r2, r3
	str	r3, [fp, #-36]
	b	.L9
.L10:
	ldr	r3, [fp, #-24]
	and	r2, r3, #255
	ldr	r3, [fp, #-20]
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #4096
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-24]
	sub	r3, r3, #4096
	str	r3, [fp, #-24]
.L9:
	ldr	r3, [fp, #-24]
	cmp	r3, #4096
	bcs	.L10
	ldr	r0, [fp, #-36]
	bl	__aeabi_ui2d
	mov	r2, #0
	ldr	r3, .L15+24
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r4, r2
	mov	r5, r3
	ldr	r0, [fp, #-28]
	bl	__aeabi_ui2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2uiz
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	beq	.L11
	ldr	r3, [fp, #-16]
	and	r3, r3, #1
	cmp	r3, #0
	bne	.L11
	ldr	r1, [fp, #-16]
	ldr	r3, .L15+28
	umull	r2, r3, r1, r3
	lsr	r2, r3, #3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	cmp	r2, #0
	bne	.L12
	ldr	r1, [fp, #-16]
	ldr	r0, .L15+32
	bl	printf
	b	.L13
.L12:
	mov	r0, #46
	bl	putchar
.L13:
	ldr	r3, .L15+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fflush
.L11:
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-40]
.L7:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	bcc	.L14
	ldr	r0, .L15+36
	bl	puts
	mov	r3, #0
.L5:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L16:
	.align	2
.L15:
	.word	.LC0
	.word	-1048576
	.word	.LC1
	.word	.LC2
	.word	stdout
	.word	.LC3
	.word	1079574528
	.word	-858993459
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
