	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	$4, -72(%rbp)
	leaq	L_.str(%rip), %rdi
	leaq	-44(%rbp), %rsi
	leaq	-72(%rbp), %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_sysctlbyname
	testq	%rax, %rax
	js	LBB0_1
## %bb.2:
	cmpq	$4, -72(%rbp)
	jne	LBB0_3
LBB0_4:
	cmpl	$1, -44(%rbp)
	jg	LBB0_6
LBB0_5:
	leaq	L_.str.2(%rip), %rdi
	callq	_warnx
LBB0_6:
	movq	_socket_path@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_mkstemp
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_8:
	movl	(%r15), %edi
	callq	_unlink
	movq	_AF_LOCAL@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_10
## %bb.9:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_10:
	movl	(%r15), %edi
	callq	_unlink
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$16, %esi
	callq	_bzero
	movq	(%r13), %rax
	movq	%rax, -56(%rbp)
	movl	-64(%rbp), %edi
	movl	(%r15), %esi
	callq	_strcpy
	movl	%r12d, %edi
	movq	%rbx, %rsi
	movl	$16, %edx
	callq	_bind
	testq	%rax, %rax
	jns	LBB0_12
## %bb.11:
	leaq	L_.str.5(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_12:
	movl	%r12d, %edi
	movl	$1024, %esi                     ## imm = 0x400
	callq	_listen
	testq	%rax, %rax
	jns	LBB0_14
## %bb.13:
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_14:
	xorl	%eax, %eax
	callq	_fork
	testl	%eax, %eax
	jne	LBB0_20
## %bb.15:
	leaq	L_.str.10(%rip), %r14
	leaq	L_.str.11(%rip), %r15
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_accept
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	$1, %edi
	movq	%r14, %rsi
	callq	_err
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	%ebx, %edi
	callq	_close
	testq	%rax, %rax
	jns	LBB0_16
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	$1, %edi
	movq	%r15, %rsi
	callq	_err
	jmp	LBB0_16
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
	cmpq	$4, -72(%rbp)
	je	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_errx
	cmpl	$1, -44(%rbp)
	jle	LBB0_5
	jmp	LBB0_6
LBB0_20:
	movl	%eax, %r14d
	cmpl	$-1, %eax
	jne	LBB0_22
## %bb.21:
	leaq	L_.str.7(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_22:
	movl	%r12d, %edi
	callq	_close
	movl	$1, %edi
	callq	_sleep
	leaq	-64(%rbp), %rdi
	movl	$16, %esi
	callq	_bzero
	movq	(%r13), %rax
	movq	%rax, -56(%rbp)
	movl	-64(%rbp), %edi
	movl	(%r15), %esi
	callq	_strcpy
	movq	_LOOPS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_31
## %bb.23:
	xorl	%r12d, %r12d
	movq	_SIGTERM@GOTPCREL(%rip), %rbx
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_24 Depth=1
	movq	_USLEEP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_usleep
	incl	%r12d
	movq	_LOOPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jge	LBB0_31
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	%eax, %r15d
	testl	%eax, %eax
	jns	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=1
	movl	(%rbx), %esi
	movl	%r14d, %edi
	callq	_kill
	movl	$1, %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_err
LBB0_26:                                ##   in Loop: Header=BB0_24 Depth=1
	movl	%r15d, %edi
	leaq	-64(%rbp), %rsi
	movl	$16, %edx
	callq	_connect
	testq	%rax, %rax
	jns	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_24 Depth=1
	movl	(%rbx), %esi
	movl	%r14d, %edi
	callq	_kill
	movl	$1, %edi
	leaq	L_.str.8(%rip), %rsi
	callq	_err
LBB0_28:                                ##   in Loop: Header=BB0_24 Depth=1
	movl	%r15d, %edi
	callq	_close
	testq	%rax, %rax
	jns	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_24 Depth=1
	movl	(%rbx), %esi
	movl	%r14d, %edi
	callq	_kill
	movl	$1, %edi
	leaq	L_.str.9(%rip), %rsi
	callq	_err
	jmp	LBB0_30
LBB0_31:
	movq	_SIGTERM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_kill
	leaq	L_str(%rip), %rdi
	callq	_puts
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kern.smp.cpus"

L_.str.1:                               ## @.str.1
	.asciz	"kern.smp.cpus: invalid length"

L_.str.2:                               ## @.str.2
	.asciz	"SMP not present, test may be unable to trigger race"

	.comm	_socket_path,4,2                ## @socket_path
L_.str.3:                               ## @.str.3
	.asciz	"mkstemp failed"

	.comm	_AF_LOCAL,8,3                   ## @AF_LOCAL
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
L_.str.4:                               ## @.str.4
	.asciz	"parent: socket error"

L_.str.5:                               ## @.str.5
	.asciz	"parent: bind error"

L_.str.6:                               ## @.str.6
	.asciz	"parent: listen error"

L_.str.7:                               ## @.str.7
	.asciz	"fork()"

	.comm	_LOOPS,4,2                      ## @LOOPS
	.comm	_SIGTERM,4,2                    ## @SIGTERM
L_.str.8:                               ## @.str.8
	.asciz	"parent: connect error"

L_.str.9:                               ## @.str.9
	.asciz	"parent: close error"

	.comm	_USLEEP,4,2                     ## @USLEEP
L_.str.10:                              ## @.str.10
	.asciz	"child: accept error"

L_.str.11:                              ## @.str.11
	.asciz	"child: close error"

L_str:                                  ## @str
	.asciz	"OK"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	w8, #4
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	add	x1, sp, #12
	mov	x2, sp
	mov	x3, #0
	mov	w4, #0
	bl	_sysctlbyname
	tbz	x0, #63, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	ldr	x8, [sp]
	cmp	x8, #4
	b.eq	LBB0_4
; %bb.3:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_4:
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.gt	LBB0_6
; %bb.5:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_warnx
LBB0_6:
Lloh8:
	adrp	x21, _socket_path@GOTPAGE
Lloh9:
	ldr	x21, [x21, _socket_path@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_mkstemp
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_8:
	ldr	w0, [x21]
	bl	_unlink
Lloh12:
	adrp	x24, _AF_LOCAL@GOTPAGE
Lloh13:
	ldr	x24, [x24, _AF_LOCAL@GOTPAGEOFF]
	ldr	x0, [x24]
Lloh14:
	adrp	x25, _SOCK_STREAM@GOTPAGE
Lloh15:
	ldr	x25, [x25, _SOCK_STREAM@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	w2, #0
	bl	_socket
	mov	x20, x0
	tbz	w0, #31, LBB0_10
; %bb.9:
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_10:
	ldr	w0, [x21]
	bl	_unlink
	add	x0, sp, #16
	mov	w1, #16
	bl	_bzero
	ldr	x8, [x24]
	str	x8, [sp, #24]
	ldr	w0, [sp, #16]
	ldr	w1, [x21]
	bl	_strcpy
	add	x1, sp, #16
	mov	x0, x20
	mov	w2, #16
	bl	_bind
	tbz	x0, #63, LBB0_12
; %bb.11:
Lloh18:
	adrp	x1, l_.str.5@PAGE
Lloh19:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_12:
	mov	x0, x20
	mov	w1, #1024
	bl	_listen
	tbz	x0, #63, LBB0_14
; %bb.13:
Lloh20:
	adrp	x1, l_.str.6@PAGE
Lloh21:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_14:
	bl	_fork
	cbnz	w0, LBB0_20
; %bb.15:
Lloh22:
	adrp	x19, l_.str.10@PAGE
Lloh23:
	add	x19, x19, l_.str.10@PAGEOFF
Lloh24:
	adrp	x21, l_.str.11@PAGE
Lloh25:
	add	x21, x21, l_.str.11@PAGEOFF
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, #0
	mov	x2, #0
	bl	_accept
	mov	x22, x0
	tbz	w0, #31, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w0, #1
	mov	x1, x19
	bl	_err
LBB0_18:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x22
	bl	_close
	tbz	x0, #63, LBB0_16
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	w0, #1
	mov	x1, x21
	bl	_err
	b	LBB0_16
LBB0_20:
	mov	x19, x0
	cmn	w0, #1
	b.ne	LBB0_22
; %bb.21:
Lloh26:
	adrp	x1, l_.str.7@PAGE
Lloh27:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_22:
	mov	x0, x20
	bl	_close
	mov	w0, #1
	bl	_sleep
	add	x0, sp, #16
	mov	w1, #16
	bl	_bzero
	ldr	x8, [x24]
	str	x8, [sp, #24]
	ldr	w0, [sp, #16]
	ldr	w1, [x21]
	bl	_strcpy
Lloh28:
	adrp	x26, _LOOPS@GOTPAGE
Lloh29:
	ldr	x26, [x26, _LOOPS@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh30:
	adrp	x27, _SIGTERM@GOTPAGE
Lloh31:
	ldr	x27, [x27, _SIGTERM@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_31
; %bb.23:
	mov	w28, #0
Lloh32:
	adrp	x21, l_.str.8@PAGE
Lloh33:
	add	x21, x21, l_.str.8@PAGEOFF
Lloh34:
	adrp	x20, _USLEEP@GOTPAGE
Lloh35:
	ldr	x20, [x20, _USLEEP@GOTPAGEOFF]
Lloh36:
	adrp	x22, l_.str.9@PAGE
Lloh37:
	add	x22, x22, l_.str.9@PAGEOFF
	b	LBB0_25
LBB0_24:                                ;   in Loop: Header=BB0_25 Depth=1
	ldr	w0, [x20]
	bl	_usleep
	add	w28, w28, #1
	ldr	w8, [x26]
	cmp	w28, w8
	b.ge	LBB0_31
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x24]
	ldr	w1, [x25]
	mov	w2, #0
	bl	_socket
	mov	x23, x0
	tbz	w0, #31, LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=1
	ldr	w1, [x27]
	mov	x0, x19
	bl	_kill
	mov	w0, #1
Lloh38:
	adrp	x1, l_.str.4@PAGE
Lloh39:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_err
LBB0_27:                                ;   in Loop: Header=BB0_25 Depth=1
	add	x1, sp, #16
	mov	x0, x23
	mov	w2, #16
	bl	_connect
	tbz	x0, #63, LBB0_29
; %bb.28:                               ;   in Loop: Header=BB0_25 Depth=1
	ldr	w1, [x27]
	mov	x0, x19
	bl	_kill
	mov	w0, #1
	mov	x1, x21
	bl	_err
LBB0_29:                                ;   in Loop: Header=BB0_25 Depth=1
	mov	x0, x23
	bl	_close
	tbz	x0, #63, LBB0_24
; %bb.30:                               ;   in Loop: Header=BB0_25 Depth=1
	ldr	w1, [x27]
	mov	x0, x19
	bl	_kill
	mov	w0, #1
	mov	x1, x22
	bl	_err
	b	LBB0_24
LBB0_31:
	ldr	w1, [x27]
	mov	x0, x19
	bl	_kill
Lloh40:
	adrp	x0, l_str@PAGE
Lloh41:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #0
	bl	_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kern.smp.cpus"

l_.str.1:                               ; @.str.1
	.asciz	"kern.smp.cpus: invalid length"

l_.str.2:                               ; @.str.2
	.asciz	"SMP not present, test may be unable to trigger race"

	.comm	_socket_path,4,2                ; @socket_path
l_.str.3:                               ; @.str.3
	.asciz	"mkstemp failed"

	.comm	_AF_LOCAL,8,3                   ; @AF_LOCAL
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
l_.str.4:                               ; @.str.4
	.asciz	"parent: socket error"

l_.str.5:                               ; @.str.5
	.asciz	"parent: bind error"

l_.str.6:                               ; @.str.6
	.asciz	"parent: listen error"

l_.str.7:                               ; @.str.7
	.asciz	"fork()"

	.comm	_LOOPS,4,2                      ; @LOOPS
	.comm	_SIGTERM,4,2                    ; @SIGTERM
l_.str.8:                               ; @.str.8
	.asciz	"parent: connect error"

l_.str.9:                               ; @.str.9
	.asciz	"parent: close error"

	.comm	_USLEEP,4,2                     ; @USLEEP
l_.str.10:                              ; @.str.10
	.asciz	"child: accept error"

l_.str.11:                              ; @.str.11
	.asciz	"child: close error"

l_str:                                  ; @str
	.asciz	"OK"

.subsections_via_symbols
