	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function leader_takeover_tapes
_leader_takeover_tapes:                 ## @leader_takeover_tapes
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	80(%rdi), %r14
	movl	(%rdi), %ebx
	callq	_LEADER
	movl	%eax, %edi
	callq	_Assert
	xorl	%edi, %edi
	testl	%ebx, %ebx
	setg	%dil
	callq	_Assert
	leaq	12(%r14), %r15
	movq	%r15, %rdi
	callq	_SpinLockAcquire
	movl	(%r14), %r13d
	movq	%r15, %rdi
	callq	_SpinLockRelease
	cmpl	%r13d, %ebx
	je	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_2:
	leal	1(%rbx), %r15d
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_inittapestate
	movl	8(%r14), %esi
	addq	$4, %r14
	movl	72(%r12), %ecx
	movl	%r15d, %edi
	movq	%r14, %rdx
	callq	_LogicalTapeSetCreate
	movl	%eax, 76(%r12)
	movl	%ebx, 4(%r12)
	cmpl	$0, 8(%r12)
	movq	16(%r12), %rax
	movq	24(%r12), %rcx
	movq	32(%r12), %rdx
	jle	LBB0_5
## %bb.3:
	movq	40(%r12), %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, (%rax,%rdi,4)
	movl	$1, (%rcx,%rdi,4)
	movl	$0, (%rdx,%rdi,4)
	movl	%edi, (%rsi,%rdi,4)
	incq	%rdi
	movslq	8(%r12), %rbx
	cmpq	%rbx, %rdi
	jl	LBB0_4
LBB0_5:
	movq	48(%r12), %rsi
	movl	$0, (%rax,%rsi,4)
	movl	$0, (%rcx,%rsi,4)
	movl	$1, (%rdx,%rsi,4)
	movl	$1, 56(%r12)
	movq	$0, 64(%r12)
	movq	_TSS_BUILDRUNS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%r12)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot take over tapes before all workers finish"

	.comm	_TSS_BUILDRUNS,4,2              ## @TSS_BUILDRUNS
	.no_dead_strip	_leader_takeover_tapes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function leader_takeover_tapes
_leader_takeover_tapes:                 ; @leader_takeover_tapes
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x22, [x0, #80]
	ldr	w21, [x0]
	bl	_LEADER
	bl	_Assert
	cmp	w21, #0
	cset	w0, gt
	bl	_Assert
	add	x20, x22, #12
	mov	x0, x20
	bl	_SpinLockAcquire
	ldr	w23, [x22]
	mov	x0, x20
	bl	_SpinLockRelease
	cmp	w21, w23
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_2:
	add	w20, w21, #1
	mov	x0, x19
	mov	x1, x20
	bl	_inittapestate
	ldr	w1, [x22, #8]
	add	x2, x22, #4
	ldr	w3, [x19, #72]
	mov	x0, x20
	bl	_LogicalTapeSetCreate
	str	w0, [x19, #76]
	str	w21, [x19, #4]
	ldr	w11, [x19, #8]
	ldp	x8, x9, [x19, #16]
	ldr	x10, [x19, #32]
	cmp	w11, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x11, #0
	ldr	x12, [x19, #40]
	mov	w13, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x14, x11, #2
	str	w13, [x8, x14]
	str	w13, [x9, x14]
	str	wzr, [x10, x14]
	str	w11, [x12, x14]
	add	x11, x11, #1
	ldrsw	x14, [x19, #8]
	cmp	x11, x14
	b.lt	LBB0_4
LBB0_5:
	ldr	x11, [x19, #48]
	lsl	x11, x11, #2
	str	wzr, [x8, x11]
	str	wzr, [x9, x11]
	mov	w8, #1
	str	w8, [x10, x11]
	str	xzr, [x19, #64]
Lloh5:
	adrp	x9, _TSS_BUILDRUNS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _TSS_BUILDRUNS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	stp	w8, w9, [x19, #56]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot take over tapes before all workers finish"

	.comm	_TSS_BUILDRUNS,4,2              ; @TSS_BUILDRUNS
	.no_dead_strip	_leader_takeover_tapes
.subsections_via_symbols
