	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sigchld_handler                ## -- Begin function sigchld_handler
	.p2align	4, 0x90
_sigchld_handler:                       ## @sigchld_handler
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$16, %rsp
	leaq	-4(%rbp), %rdi
	callq	_wait
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	movl	-4(%rbp), %edi
	callq	_WIFEXITED
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
LBB0_4:
	movl	-4(%rbp), %edi
	callq	_WEXITSTATUS
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	-4(%rbp), %edi
	callq	_WEXITSTATUS
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_errx
LBB0_6:
	movq	_sender_semid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_IPC_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-8(%rbp), %rcx
	xorl	%esi, %esi
	callq	_semctl
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_8:
	leaq	-8(%rbp), %rdi
	movl	$384, %esi                      ## imm = 0x180
	callq	_print_semid_ds
	movq	_child_count@GOTPCREL(%rip), %rax
	decq	(%rax)
	je	LBB0_10
## %bb.9:
	movq	_signal_was_sigchld@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	addq	$16, %rsp
	popq	%rbp
	retq
LBB0_10:
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wait"

L_.str.1:                               ## @.str.1
	.asciz	"receiver exited abnormally"

L_.str.2:                               ## @.str.2
	.asciz	"receiver exited with status %d"

	.comm	_sender_semid,4,2               ## @sender_semid
	.comm	_IPC_STAT,4,2                   ## @IPC_STAT
L_.str.3:                               ## @.str.3
	.asciz	"semctl IPC_STAT"

	.comm	_child_count,8,3                ## @child_count
	.comm	_signal_was_sigchld,4,2         ## @signal_was_sigchld
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sigchld_handler                ; -- Begin function sigchld_handler
	.p2align	2
_sigchld_handler:                       ; @sigchld_handler
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	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
	sub	x0, x29, #12
	bl	_wait
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	ldur	w0, [x29, #-12]
	bl	_WIFEXITED
	cbnz	x0, LBB0_4
; %bb.3:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_4:
	ldur	w0, [x29, #-12]
	bl	_WEXITSTATUS
	cbz	x0, LBB0_6
; %bb.5:
	ldur	w0, [x29, #-12]
	bl	_WEXITSTATUS
	str	x0, [sp]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_6:
Lloh6:
	adrp	x8, _sender_semid@GOTPAGE
Lloh7:
	ldr	x8, [x8, _sender_semid@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x8, _IPC_STAT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IPC_STAT@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	sub	x3, x29, #8
	mov	w1, #0
	bl	_semctl
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_8:
	sub	x0, x29, #8
	mov	w1, #384
	bl	_print_semid_ds
Lloh14:
	adrp	x8, _child_count@GOTPAGE
Lloh15:
	ldr	x8, [x8, _child_count@GOTPAGEOFF]
	ldr	x9, [x8]
	subs	x9, x9, #1
	str	x9, [x8]
	b.eq	LBB0_10
; %bb.9:
Lloh16:
	adrp	x8, _signal_was_sigchld@GOTPAGE
Lloh17:
	ldr	x8, [x8, _signal_was_sigchld@GOTPAGEOFF]
	mov	w9, #1
Lloh18:
	str	w9, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_10:
	mov	w0, #0
	bl	_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wait"

l_.str.1:                               ; @.str.1
	.asciz	"receiver exited abnormally"

l_.str.2:                               ; @.str.2
	.asciz	"receiver exited with status %d"

	.comm	_sender_semid,4,2               ; @sender_semid
	.comm	_IPC_STAT,4,2                   ; @IPC_STAT
l_.str.3:                               ; @.str.3
	.asciz	"semctl IPC_STAT"

	.comm	_child_count,8,3                ; @child_count
	.comm	_signal_was_sigchld,4,2         ; @signal_was_sigchld
.subsections_via_symbols
