	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function btt_arena_write_layout
_btt_arena_write_layout:                ## @btt_arena_write_layout
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	80(%rdi), %rbx
	movq	8(%rbx), %rdi
	callq	_nd_dev_to_uuid
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_btt_map_init
	testl	%eax, %eax
	jne	LBB0_5
## %bb.1:
	movq	%r12, %rdi
	callq	_btt_log_init
	testl	%eax, %eax
	jne	LBB0_5
## %bb.2:
	movq	_GFP_NOIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$136, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r14
	movl	128(%rax), %edi
	movq	_BTT_SIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BTT_SIG_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_strncpy
	movl	124(%r14), %edi
	movq	(%rbx), %rsi
	movl	$16, %edx
	callq	_memcpy
	movl	120(%r14), %edi
	movq	%r15, %rsi
	movl	$16, %edx
	callq	_memcpy
	movl	(%r12), %edi
	callq	_cpu_to_le32
	movq	%rax, 8(%r14)
	movl	76(%r12), %edi
	callq	_cpu_to_le16
	movq	%rax, 112(%r14)
	movl	72(%r12), %edi
	callq	_cpu_to_le16
	movq	%rax, 104(%r14)
	movl	4(%r12), %edi
	callq	_cpu_to_le32
	movq	%rax, 96(%r14)
	movl	8(%r12), %edi
	callq	_cpu_to_le32
	movq	%rax, 88(%r14)
	movl	12(%r12), %edi
	callq	_cpu_to_le32
	movq	%rax, 80(%r14)
	movl	16(%r12), %edi
	callq	_cpu_to_le32
	movq	%rax, 72(%r14)
	movl	20(%r12), %edi
	callq	_cpu_to_le32
	movq	%rax, 64(%r14)
	movl	$136, %edi
	callq	_cpu_to_le32
	movq	%rax, 56(%r14)
	movq	64(%r12), %rdi
	callq	_cpu_to_le64
	movq	%rax, 48(%r14)
	movq	56(%r12), %rdi
	subq	24(%r12), %rdi
	callq	_cpu_to_le64
	movq	%rax, 40(%r14)
	movq	48(%r12), %rdi
	subq	24(%r12), %rdi
	callq	_cpu_to_le64
	movq	%rax, 32(%r14)
	movq	40(%r12), %rdi
	subq	24(%r12), %rdi
	callq	_cpu_to_le64
	movq	%rax, 24(%r14)
	movq	32(%r12), %rdi
	subq	24(%r12), %rdi
	callq	_cpu_to_le64
	movq	%rax, 16(%r14)
	movq	$0, 8(%r14)
	movq	%r14, %rdi
	callq	_nd_sb_checksum
	movq	%rax, %rdi
	callq	_cpu_to_le64
	movq	%rax, (%r14)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_btt_info_write
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_kfree
	movl	%ebx, %eax
	jmp	LBB0_5
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_NOIO,4,2                   ## @GFP_NOIO
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_BTT_SIG,4,2                    ## @BTT_SIG
	.comm	_BTT_SIG_LEN,4,2                ## @BTT_SIG_LEN
	.no_dead_strip	_btt_arena_write_layout
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function btt_arena_write_layout
_btt_arena_write_layout:                ; @btt_arena_write_layout
	.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, x0
	ldr	x22, [x0, #80]
	ldr	x0, [x22, #8]
	bl	_nd_dev_to_uuid
	mov	x21, x0
	mov	x0, x19
	bl	_btt_map_init
	cbnz	w0, LBB0_5
; %bb.1:
	mov	x0, x19
	bl	_btt_log_init
	cbnz	w0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _GFP_NOIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_NOIO@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #136
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.3:
	mov	x20, x0
	ldr	w0, [x0, #128]
Lloh3:
	adrp	x8, _BTT_SIG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BTT_SIG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _BTT_SIG_LEN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BTT_SIG_LEN@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_strncpy
	ldr	w0, [x20, #124]
	ldr	x1, [x22]
	mov	w2, #16
	bl	_memcpy
	ldr	w0, [x20, #120]
	mov	x1, x21
	mov	w2, #16
	bl	_memcpy
	ldr	w0, [x19]
	bl	_cpu_to_le32
	str	x0, [x20, #8]
	ldr	w0, [x19, #76]
	bl	_cpu_to_le16
	str	x0, [x20, #112]
	ldr	w0, [x19, #72]
	bl	_cpu_to_le16
	str	x0, [x20, #104]
	ldr	w0, [x19, #4]
	bl	_cpu_to_le32
	str	x0, [x20, #96]
	ldr	w0, [x19, #8]
	bl	_cpu_to_le32
	str	x0, [x20, #88]
	ldr	w0, [x19, #12]
	bl	_cpu_to_le32
	str	x0, [x20, #80]
	ldr	w0, [x19, #16]
	bl	_cpu_to_le32
	str	x0, [x20, #72]
	ldr	w0, [x19, #20]
	bl	_cpu_to_le32
	str	x0, [x20, #64]
	mov	w0, #136
	bl	_cpu_to_le32
	str	x0, [x20, #56]
	ldr	x0, [x19, #64]
	bl	_cpu_to_le64
	str	x0, [x20, #48]
	ldr	x8, [x19, #56]
	ldr	x9, [x19, #24]
	sub	x0, x8, x9
	bl	_cpu_to_le64
	str	x0, [x20, #40]
	ldr	x8, [x19, #48]
	ldr	x9, [x19, #24]
	sub	x0, x8, x9
	bl	_cpu_to_le64
	str	x0, [x20, #32]
	ldr	x8, [x19, #40]
	ldr	x9, [x19, #24]
	sub	x0, x8, x9
	bl	_cpu_to_le64
	str	x0, [x20, #24]
	ldp	x9, x8, [x19, #24]
	sub	x0, x8, x9
	bl	_cpu_to_le64
	stp	xzr, x0, [x20, #8]
	mov	x0, x20
	bl	_nd_sb_checksum
	bl	_cpu_to_le64
	str	x0, [x20]
	mov	x0, x19
	mov	x1, x20
	bl	_btt_info_write
	mov	x19, x0
	mov	x0, x20
	bl	_kfree
	mov	x0, x19
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_NOIO,4,2                   ; @GFP_NOIO
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_BTT_SIG,4,2                    ; @BTT_SIG
	.comm	_BTT_SIG_LEN,4,2                ; @BTT_SIG_LEN
	.no_dead_strip	_btt_arena_write_layout
.subsections_via_symbols
