	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function simple_child_read_cb
_simple_child_read_cb:                  ## @simple_child_read_cb
	.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	%rbx
	subq	$264, %rsp                      ## imm = 0x108
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	leaq	-288(%rbp), %rsi
	movl	$256, %edx                      ## imm = 0x100
	callq	_read
	movl	%eax, %ebx
	movq	_child_pair@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	$1, %edx
	callq	_write
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	callq	_tt_fail_perror
LBB0_2:
	movq	_called@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.3:
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_event_add
	cmpl	$-1, %eax
	je	LBB0_6
## %bb.5:
	movl	(%r15), %eax
	jmp	LBB0_9
LBB0_7:
	cmpl	$1, %eax
	jne	LBB0_9
## %bb.8:
	movq	_test_ok@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movl	$1, %eax
LBB0_9:
	incl	%eax
	movl	%eax, (%r15)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	addq	$264, %rsp                      ## imm = 0x108
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
LBB0_6:
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_child_pair,8,3                 ## @child_pair
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

L_.str.1:                               ## @.str.1
	.asciz	"write"

	.comm	_called,4,2                     ## @called
	.comm	_test_ok,4,2                    ## @test_ok
	.no_dead_strip	_simple_child_read_cb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function simple_child_read_cb
_simple_child_read_cb:                  ; @simple_child_read_cb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #320
	.cfi_def_cfa_offset 320
	stp	x22, x21, [sp, #272]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #288]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #304]            ; 16-byte Folded Spill
	add	x29, sp, #304
	.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	x19, x2
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	add	x1, sp, #8
	mov	w2, #256
	bl	_read
	mov	x20, x0
Lloh3:
	adrp	x8, _child_pair@GOTPAGE
Lloh4:
	ldr	x8, [x8, _child_pair@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #1
	bl	_write
	tbz	x0, #63, LBB0_2
; %bb.1:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_tt_fail_perror
LBB0_2:
Lloh10:
	adrp	x21, _called@GOTPAGE
Lloh11:
	ldr	x21, [x21, _called@GOTPAGEOFF]
	ldr	w8, [x21]
	cbz	w20, LBB0_6
; %bb.3:
	cbnz	w8, LBB0_8
; %bb.4:
	mov	x0, x19
	mov	x1, #0
	bl	_event_add
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.5:
	ldr	w8, [x21]
	b	LBB0_8
LBB0_6:
	cmp	w8, #1
	b.ne	LBB0_8
; %bb.7:
Lloh12:
	adrp	x9, _test_ok@GOTPAGE
Lloh13:
	ldr	x9, [x9, _test_ok@GOTPAGEOFF]
Lloh14:
	str	w8, [x9]
LBB0_8:
	add	w8, w8, #1
	str	w8, [x21]
	ldur	x8, [x29, #-40]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	ldp	x29, x30, [sp, #304]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #288]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #272]            ; 16-byte Folded Reload
	add	sp, sp, #320
	ret
LBB0_10:
	bl	___stack_chk_fail
LBB0_11:
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_child_pair,8,3                 ; @child_pair
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

l_.str.1:                               ; @.str.1
	.asciz	"write"

	.comm	_called,4,2                     ; @called
	.comm	_test_ok,4,2                    ; @test_ok
	.no_dead_strip	_simple_child_read_cb
.subsections_via_symbols
