	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function threadfunc
_threadfunc:                            ## @threadfunc
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_printf
	movq	_barrier@GOTPCREL(%rip), %rdi
	callq	_pthread_barrier_wait
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_printf
	movq	_mutex@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_lock
	movl	%eax, %edi
	callq	_PTHREAD_REQUIRE
	movq	_after_barrier_count@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	_PTHREAD_BARRIER_SERIAL_THREAD@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_2
## %bb.1:
	movq	_serial_count@GOTPCREL(%rip), %rax
	incl	(%rax)
LBB0_2:
	movq	_mutex@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_unlock
	movl	%eax, %edi
	callq	_PTHREAD_REQUIRE
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"thread %d entering barrier\n"

	.comm	_barrier,4,2                    ## @barrier
L_.str.1:                               ## @.str.1
	.asciz	"thread %d leaving barrier -> %d\n"

	.comm	_mutex,4,2                      ## @mutex
	.comm	_after_barrier_count,4,2        ## @after_barrier_count
	.comm	_PTHREAD_BARRIER_SERIAL_THREAD,4,2 ## @PTHREAD_BARRIER_SERIAL_THREAD
	.comm	_serial_count,4,2               ## @serial_count
	.no_dead_strip	_threadfunc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function threadfunc
_threadfunc:                            ; @threadfunc
	.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
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_printf
Lloh2:
	adrp	x0, _barrier@GOTPAGE
Lloh3:
	ldr	x0, [x0, _barrier@GOTPAGEOFF]
	bl	_pthread_barrier_wait
	mov	x20, x0
	str	x20, [sp]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_printf
Lloh6:
	adrp	x0, _mutex@GOTPAGE
Lloh7:
	ldr	x0, [x0, _mutex@GOTPAGEOFF]
	bl	_pthread_mutex_lock
	bl	_PTHREAD_REQUIRE
Lloh8:
	adrp	x8, _after_barrier_count@GOTPAGE
Lloh9:
	ldr	x8, [x8, _after_barrier_count@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh10:
	adrp	x8, _PTHREAD_BARRIER_SERIAL_THREAD@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PTHREAD_BARRIER_SERIAL_THREAD@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_2
; %bb.1:
Lloh13:
	adrp	x8, _serial_count@GOTPAGE
Lloh14:
	ldr	x8, [x8, _serial_count@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_2:
Lloh15:
	adrp	x0, _mutex@GOTPAGE
Lloh16:
	ldr	x0, [x0, _mutex@GOTPAGEOFF]
	bl	_pthread_mutex_unlock
	bl	_PTHREAD_REQUIRE
	mov	x0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"thread %d entering barrier\n"

	.comm	_barrier,4,2                    ; @barrier
l_.str.1:                               ; @.str.1
	.asciz	"thread %d leaving barrier -> %d\n"

	.comm	_mutex,4,2                      ; @mutex
	.comm	_after_barrier_count,4,2        ; @after_barrier_count
	.comm	_PTHREAD_BARRIER_SERIAL_THREAD,4,2 ; @PTHREAD_BARRIER_SERIAL_THREAD
	.comm	_serial_count,4,2               ; @serial_count
	.no_dead_strip	_threadfunc
.subsections_via_symbols
