	.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	$264, %rsp                      ## imm = 0x108
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_fork
	testl	%eax, %eax
	je	LBB0_1
## %bb.4:
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.5:
	leaq	L_.str.5(%rip), %r14
	leaq	L_.str.6(%rip), %rbx
	leaq	-304(%rbp), %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_rename
	xorl	%r13d, %r13d
	testl	%eax, %eax
	sete	%r13b
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rename
	leal	1(%r13), %r15d
	testl	%eax, %eax
	cmovnel	%r13d, %r15d
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rdi
	leaq	L_.str.7(%rip), %rsi
	movl	$256, %edx                      ## imm = 0x100
	callq	_strlcat
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	movl	$256, %edx                      ## imm = 0x100
	callq	_strlcat
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_fprintf
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str.2(%rip), %r14
	leaq	L_.str.3(%rip), %rbx
	leaq	-304(%rbp), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_rename
	xorl	%r13d, %r13d
	testl	%eax, %eax
	sete	%r13b
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_rename
	leal	1(%r13), %r15d
	testl	%eax, %eax
	cmovnel	%r13d, %r15d
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	leaq	L_.str.4(%rip), %rsi
	movl	$256, %edx                      ## imm = 0x100
	callq	_strlcat
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	movl	$256, %edx                      ## imm = 0x100
	callq	_strlcat
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_fprintf
	jmp	LBB0_2
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	callq	_perror
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rename() fails to handle race situation\n"

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

L_.str.2:                               ## @.str.2
	.asciz	"a/b/c"

L_.str.3:                               ## @.str.3
	.asciz	"1/2/3/c"

L_.str.4:                               ## @.str.4
	.asciz	"c_count: %d,"

	.comm	_stderr,4,2                     ## @stderr
L_.str.5:                               ## @.str.5
	.asciz	"1"

L_.str.6:                               ## @.str.6
	.asciz	"a/b/c/d/e/1"

L_.str.7:                               ## @.str.7
	.asciz	"p_count: %d,"

.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, #336
	.cfi_def_cfa_offset 336
	stp	x26, x25, [sp, #256]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #272]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #288]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #304]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #320]            ; 16-byte Folded Spill
	add	x29, sp, #320
	.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
	bl	_fork
	cbz	w0, LBB0_5
; %bb.1:
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.2:
Lloh0:
	adrp	x19, l_.str.5@PAGE
Lloh1:
	add	x19, x19, l_.str.5@PAGEOFF
Lloh2:
	adrp	x20, l_.str.6@PAGE
Lloh3:
	add	x20, x20, l_.str.6@PAGEOFF
	mov	w24, #1
Lloh4:
	adrp	x21, l_.str.7@PAGE
Lloh5:
	add	x21, x21, l_.str.7@PAGEOFF
Lloh6:
	adrp	x25, _stderr@GOTPAGE
Lloh7:
	ldr	x25, [x25, _stderr@GOTPAGEOFF]
Lloh8:
	adrp	x22, l_.str@PAGE
Lloh9:
	add	x22, x22, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_rename
	mov	x23, x0
	mov	x0, x20
	mov	x1, x19
	bl	_rename
	cmp	w23, #0
	cset	w8, eq
	cinc	w9, w24, eq
	cmp	w0, #0
	csel	w23, w9, w8, eq
	cbz	w23, LBB0_3
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, sp
	mov	x1, x21
	mov	w2, #256
	bl	_strlcat
	mov	x0, sp
	mov	x1, x22
	mov	w2, #256
	bl	_strlcat
	ldr	w0, [x25]
	mov	x1, sp
	mov	x2, x23
	bl	_fprintf
	b	LBB0_3
LBB0_5:
Lloh10:
	adrp	x19, l_.str.2@PAGE
Lloh11:
	add	x19, x19, l_.str.2@PAGEOFF
Lloh12:
	adrp	x20, l_.str.3@PAGE
Lloh13:
	add	x20, x20, l_.str.3@PAGEOFF
	mov	w24, #1
Lloh14:
	adrp	x21, l_.str.4@PAGE
Lloh15:
	add	x21, x21, l_.str.4@PAGEOFF
Lloh16:
	adrp	x25, _stderr@GOTPAGE
Lloh17:
	ldr	x25, [x25, _stderr@GOTPAGEOFF]
Lloh18:
	adrp	x22, l_.str@PAGE
Lloh19:
	add	x22, x22, l_.str@PAGEOFF
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_rename
	mov	x23, x0
	mov	x0, x20
	mov	x1, x19
	bl	_rename
	cmp	w23, #0
	cset	w8, eq
	cinc	w9, w24, eq
	cmp	w0, #0
	csel	w23, w9, w8, eq
	cbz	w23, LBB0_6
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, sp
	mov	x1, x21
	mov	w2, #256
	bl	_strlcat
	mov	x0, sp
	mov	x1, x22
	mov	w2, #256
	bl	_strlcat
	ldr	w0, [x25]
	mov	x1, sp
	mov	x2, x23
	bl	_fprintf
	b	LBB0_6
LBB0_8:
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perror
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rename() fails to handle race situation\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"a/b/c"

l_.str.3:                               ; @.str.3
	.asciz	"1/2/3/c"

l_.str.4:                               ; @.str.4
	.asciz	"c_count: %d,"

	.comm	_stderr,4,2                     ; @stderr
l_.str.5:                               ; @.str.5
	.asciz	"1"

l_.str.6:                               ; @.str.6
	.asciz	"a/b/c/d/e/1"

l_.str.7:                               ; @.str.7
	.asciz	"p_count: %d,"

.subsections_via_symbols
