	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nd_btt_arena_is_valid          ## -- Begin function nd_btt_arena_is_valid
	.p2align	4, 0x90
_nd_btt_arena_is_valid:                 ## @nd_btt_arena_is_valid
	.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	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %rdi
	callq	_nd_dev_to_uuid
	movq	%rax, %r12
	movl	12(%rbx), %edi
	movq	_BTT_SIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_BTT_SIG_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcmp
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_1
LBB0_6:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	8(%rbx), %r13
	movq	%r13, %rdi
	callq	_guid_is_null
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movl	4(%rbx), %edi
	callq	_le64_to_cpu
	movq	%rax, %r12
	movl	$0, 4(%rbx)
	movq	%rbx, %rdi
	callq	_nd_sb_checksum
	cmpq	%rax, %r12
	jne	LBB0_6
## %bb.4:
	movq	%r12, %rdi
	callq	_cpu_to_le64
	movl	%eax, 4(%rbx)
	movl	(%rbx), %edi
	callq	_le32_to_cpu
	movq	_IB_FLAG_ERROR_MASK@GOTPCREL(%rip), %rcx
	movl	$1, %r15d
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	jmp	LBB0_6
LBB0_2:
	movl	(%r13), %edi
	movq	%r12, %rsi
	movl	$16, %edx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_6
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_BTT_SIG,8,3                    ## @BTT_SIG
	.comm	_BTT_SIG_LEN,4,2                ## @BTT_SIG_LEN
	.comm	_IB_FLAG_ERROR_MASK,4,2         ## @IB_FLAG_ERROR_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Found arena with an error flag\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nd_btt_arena_is_valid          ; -- Begin function nd_btt_arena_is_valid
	.p2align	2
_nd_btt_arena_is_valid:                 ; @nd_btt_arena_is_valid
	.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	x20, x1
	mov	x19, x0
	ldr	x0, [x0, #8]
	bl	_nd_dev_to_uuid
	mov	x21, x0
	ldr	w0, [x20, #12]
Lloh0:
	adrp	x8, _BTT_SIG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BTT_SIG@GOTPAGEOFF]
Lloh2:
	ldr	x1, [x8]
Lloh3:
	adrp	x8, _BTT_SIG_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BTT_SIG_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_memcmp
	cbz	x0, LBB0_3
LBB0_1:
	mov	w0, #0
LBB0_2:
	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_3:
	add	x22, x20, #8
	mov	x0, x22
	bl	_guid_is_null
	cbz	w0, LBB0_8
LBB0_4:
	ldr	w0, [x20, #4]
	bl	_le64_to_cpu
	mov	x21, x0
	str	wzr, [x20, #4]
	mov	x0, x20
	bl	_nd_sb_checksum
	mov	x8, x0
	mov	w0, #0
	cmp	x21, x8
	b.ne	LBB0_2
; %bb.5:
	mov	x0, x21
	bl	_cpu_to_le64
	str	w0, [x20, #4]
	ldr	w0, [x20]
	bl	_le32_to_cpu
Lloh6:
	adrp	x8, _IB_FLAG_ERROR_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IB_FLAG_ERROR_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.6:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_info
LBB0_7:
	mov	w0, #1
	b	LBB0_2
LBB0_8:
	ldr	w0, [x22]
	mov	x1, x21
	mov	w2, #16
	bl	_memcmp
	cbnz	x0, LBB0_1
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_BTT_SIG,8,3                    ; @BTT_SIG
	.comm	_BTT_SIG_LEN,4,2                ; @BTT_SIG_LEN
	.comm	_IB_FLAG_ERROR_MASK,4,2         ; @IB_FLAG_ERROR_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Found arena with an error flag\n"

.subsections_via_symbols
