	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function allocbuffer
_allocbuffer:                           ## @allocbuffer
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	24(%rdi), %esi
	movl	28(%rdi), %edi
	callq	_PNG_IMAGE_BUFFER_SIZE
	movq	%rax, %r14
	movq	%rax, %rbx
	addq	$32, %rbx
	movq	(%r15), %rdx
	cmpq	%rdx, %rbx
	jle	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_freebuffer
	movq	_png_bytep@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%rbx, %rdi
	callq	_malloc
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_voidcast
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%rax, %rdi
	movq	%rbx, (%r15)
	movq	%rbx, %rdx
	jmp	LBB0_4
LBB0_1:
	movq	16(%r15), %rdi
LBB0_4:
	movl	$95, %esi
	callq	_memset
	movq	16(%r15), %rdi
	addq	$64, %rdi
	movq	_BUFFER_INIT8@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_memset
	movq	%r14, 8(%r15)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_fflush
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdx
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_png_bytep,4,2                  ## @png_bytep
	.comm	_stdout,4,2                     ## @stdout
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"simpletest: out of memory allocating %lu(+32) byte buffer\n"

	.comm	_BUFFER_INIT8,4,2               ## @BUFFER_INIT8
	.no_dead_strip	_allocbuffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function allocbuffer
_allocbuffer:                           ; @allocbuffer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x0
	ldr	w0, [x0, #28]
	ldr	w1, [x20, #24]
	bl	_PNG_IMAGE_BUFFER_SIZE
	mov	x19, x0
	add	x21, x0, #32
	ldr	x8, [x20]
	cmp	x21, x8
	b.le	LBB0_3
; %bb.1:
	mov	x0, x20
	bl	_freebuffer
Lloh0:
	adrp	x8, _png_bytep@GOTPAGE
Lloh1:
	ldr	x8, [x8, _png_bytep@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	mov	x0, x21
	bl	_malloc
	mov	x1, x0
	mov	x0, x22
	bl	_voidcast
	str	x0, [x20, #16]
	cbz	x0, LBB0_5
; %bb.2:
	str	x21, [x20]
	b	LBB0_4
LBB0_3:
	ldr	x0, [x20, #16]
	mov	x21, x8
LBB0_4:
	mov	w1, #95
	mov	x2, x21
	bl	_memset
	ldr	x8, [x20, #16]
	add	x0, x8, #64
Lloh3:
	adrp	x8, _BUFFER_INIT8@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BUFFER_INIT8@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_memset
	str	x19, [x20, #8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
Lloh6:
	adrp	x8, _stdout@GOTPAGE
Lloh7:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_fflush
Lloh9:
	adrp	x8, _stderr@GOTPAGE
Lloh10:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_fprintf
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_png_bytep,4,2                  ; @png_bytep
	.comm	_stdout,4,2                     ; @stdout
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"simpletest: out of memory allocating %lu(+32) byte buffer\n"

	.comm	_BUFFER_INIT8,4,2               ; @BUFFER_INIT8
	.no_dead_strip	_allocbuffer
.subsections_via_symbols
