	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpc85xx_smp_timebase_sync
_mpc85xx_smp_timebase_sync:             ## @mpc85xx_smp_timebase_sync
	.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
	movl	%esi, %ebx
	testl	%edx, %edx
	je	LBB0_1
	.p2align	4, 0x90
## %bb.3:
	cmpl	$0, _mpc85xx_smp_timebase_sync.tb_ready(%rip)
	jne	LBB0_4
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_atomic_thread_fence_seq_cst
	cmpl	$0, _mpc85xx_smp_timebase_sync.tb_ready(%rip)
	je	LBB0_2
LBB0_4:
	movl	%ebx, %edi
	callq	_mttb
	leaq	_mpc85xx_smp_timebase_sync.cpu_done(%rip), %rdi
	movl	$1, %esi
	callq	_atomic_add_int
	movl	_mpc85xx_smp_timebase_sync.cpu_done(%rip), %eax
	movq	_mp_ncpus@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	jge	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_atomic_thread_fence_seq_cst
	movl	_mpc85xx_smp_timebase_sync.cpu_done(%rip), %eax
	cmpl	(%rbx), %eax
	jl	LBB0_5
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	_rcpm_dev@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movl	$1, %esi
	callq	_freeze_timebase
	movl	$1, _mpc85xx_smp_timebase_sync.tb_ready(%rip)
	movl	%ebx, %edi
	callq	_mttb
	leaq	_mpc85xx_smp_timebase_sync.cpu_done(%rip), %rdi
	movl	$1, %esi
	callq	_atomic_add_int
	movl	_mpc85xx_smp_timebase_sync.cpu_done(%rip), %eax
	movq	_mp_ncpus@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	jge	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_atomic_thread_fence_seq_cst
	movl	_mpc85xx_smp_timebase_sync.cpu_done(%rip), %eax
	cmpl	(%rbx), %eax
	jl	LBB0_8
LBB0_10:
	movl	(%r14), %edi
	xorl	%esi, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_freeze_timebase                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_mpc85xx_smp_timebase_sync.tb_ready,4,2 ## @mpc85xx_smp_timebase_sync.tb_ready
.zerofill __DATA,__bss,_mpc85xx_smp_timebase_sync.cpu_done,4,2 ## @mpc85xx_smp_timebase_sync.cpu_done
	.comm	_mp_ncpus,4,2                   ## @mp_ncpus
	.comm	_rcpm_dev,4,2                   ## @rcpm_dev
	.no_dead_strip	_mpc85xx_smp_timebase_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpc85xx_smp_timebase_sync
_mpc85xx_smp_timebase_sync:             ; @mpc85xx_smp_timebase_sync
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	cbz	w2, LBB0_7
; %bb.1:
	adrp	x20, _mpc85xx_smp_timebase_sync.tb_ready@PAGE
	ldr	w8, [x20, _mpc85xx_smp_timebase_sync.tb_ready@PAGEOFF]
	cbnz	w8, LBB0_3
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_atomic_thread_fence_seq_cst
	ldr	w8, [x20, _mpc85xx_smp_timebase_sync.tb_ready@PAGEOFF]
	cbz	w8, LBB0_2
LBB0_3:
	mov	x0, x19
	bl	_mttb
Lloh0:
	adrp	x19, _mpc85xx_smp_timebase_sync.cpu_done@PAGE
Lloh1:
	add	x19, x19, _mpc85xx_smp_timebase_sync.cpu_done@PAGEOFF
	mov	x0, x19
	mov	w1, #1
	bl	_atomic_add_int
	ldr	w8, [x19]
Lloh2:
	adrp	x19, _mp_ncpus@GOTPAGE
Lloh3:
	ldr	x19, [x19, _mp_ncpus@GOTPAGEOFF]
	ldr	w9, [x19]
	cmp	w8, w9
	b.ge	LBB0_6
; %bb.4:
	adrp	x20, _mpc85xx_smp_timebase_sync.cpu_done@PAGE
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	bl	_atomic_thread_fence_seq_cst
	ldr	w8, [x20, _mpc85xx_smp_timebase_sync.cpu_done@PAGEOFF]
	ldr	w9, [x19]
	cmp	w8, w9
	b.lt	LBB0_5
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
Lloh4:
	adrp	x20, _rcpm_dev@GOTPAGE
Lloh5:
	ldr	x20, [x20, _rcpm_dev@GOTPAGEOFF]
	ldr	w0, [x20]
	mov	w21, #1
	mov	w1, #1
	bl	_freeze_timebase
	adrp	x8, _mpc85xx_smp_timebase_sync.tb_ready@PAGE
	str	w21, [x8, _mpc85xx_smp_timebase_sync.tb_ready@PAGEOFF]
	mov	x0, x19
	bl	_mttb
Lloh6:
	adrp	x19, _mpc85xx_smp_timebase_sync.cpu_done@PAGE
Lloh7:
	add	x19, x19, _mpc85xx_smp_timebase_sync.cpu_done@PAGEOFF
	mov	x0, x19
	mov	w1, #1
	bl	_atomic_add_int
	ldr	w8, [x19]
Lloh8:
	adrp	x19, _mp_ncpus@GOTPAGE
Lloh9:
	ldr	x19, [x19, _mp_ncpus@GOTPAGEOFF]
	ldr	w9, [x19]
	cmp	w8, w9
	b.ge	LBB0_10
; %bb.8:
	adrp	x21, _mpc85xx_smp_timebase_sync.cpu_done@PAGE
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	bl	_atomic_thread_fence_seq_cst
	ldr	w8, [x21, _mpc85xx_smp_timebase_sync.cpu_done@PAGEOFF]
	ldr	w9, [x19]
	cmp	w8, w9
	b.lt	LBB0_9
LBB0_10:
	ldr	w0, [x20]
	mov	w1, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_freeze_timebase
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_mpc85xx_smp_timebase_sync.tb_ready,4,2 ; @mpc85xx_smp_timebase_sync.tb_ready
.zerofill __DATA,__bss,_mpc85xx_smp_timebase_sync.cpu_done,4,2 ; @mpc85xx_smp_timebase_sync.cpu_done
	.comm	_mp_ncpus,4,2                   ; @mp_ncpus
	.comm	_rcpm_dev,4,2                   ; @rcpm_dev
	.no_dead_strip	_mpc85xx_smp_timebase_sync
.subsections_via_symbols
