	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nbio_write_test
_nbio_write_test:                       ## @nbio_write_test
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_NBIO_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_nbio_open
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	callq	_puts
LBB0_2:
	movq	%rbx, %rdi
	movl	$1048576, %esi                  ## imm = 0x100000
	callq	_nbio_resize
	leaq	-24(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_nbio_get_ptr
	movq	%rax, %r14
	cmpq	$1048576, -24(%rbp)             ## imm = 0x100000
	je	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rdi
	callq	_puts
LBB0_4:
	movq	%r14, %rdi
	movl	$66, %esi
	movl	$1048576, %edx                  ## imm = 0x100000
	callq	_memset
	movq	%rbx, %rdi
	callq	_nbio_begin_write
	movq	%rbx, %rdi
	callq	_nbio_iterate
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movl	%eax, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_nbio_iterate
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	testl	%r14d, %r14d
	je	LBB0_9
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
	callq	_puts
LBB0_9:
	movq	%rbx, %rdi
	callq	_nbio_free
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"test.bin"

	.comm	_NBIO_WRITE,4,2                 ## @NBIO_WRITE
L_.str.1:                               ## @.str.1
	.asciz	"[ERROR]: nbio_open failed (1)"

L_.str.2:                               ## @.str.2
	.asciz	"[ERROR]: wrong size (1)"

L_.str.3:                               ## @.str.3
	.asciz	"[SUCCESS]: Write finished immediately."

	.no_dead_strip	_nbio_write_test
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nbio_write_test
_nbio_write_test:                       ; @nbio_write_test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
Lloh0:
	adrp	x8, _NBIO_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NBIO_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_nbio_open
	mov	x19, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_puts
LBB0_2:
	mov	x0, x19
	mov	w1, #1048576
	bl	_nbio_resize
	add	x1, sp, #8
	mov	x0, x19
	bl	_nbio_get_ptr
	mov	x20, x0
	ldr	x8, [sp, #8]
	cmp	x8, #256, lsl #12               ; =1048576
	b.eq	LBB0_4
; %bb.3:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_puts
LBB0_4:
	mov	x0, x20
	mov	w1, #66
	mov	w2, #1048576
	bl	_memset
	mov	x0, x19
	bl	_nbio_begin_write
	mov	x0, x19
	bl	_nbio_iterate
	cbnz	w0, LBB0_8
; %bb.5:
	mov	x20, x0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_nbio_iterate
	cbz	w0, LBB0_6
; %bb.7:
	cbz	w20, LBB0_9
LBB0_8:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_puts
LBB0_9:
	mov	x0, x19
	bl	_nbio_free
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"test.bin"

	.comm	_NBIO_WRITE,4,2                 ; @NBIO_WRITE
l_.str.1:                               ; @.str.1
	.asciz	"[ERROR]: nbio_open failed (1)"

l_.str.2:                               ; @.str.2
	.asciz	"[ERROR]: wrong size (1)"

l_.str.3:                               ; @.str.3
	.asciz	"[SUCCESS]: Write finished immediately."

	.no_dead_strip	_nbio_write_test
.subsections_via_symbols
