	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_bitmap_file
_set_bitmap_file:                       ## @set_bitmap_file
	.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, %r14
	movq	32(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	cmpl	$0, (%rax)
	je	LBB0_3
## %bb.2:
	cmpl	$0, 56(%r14)
	je	LBB0_3
## %bb.5:
	cmpq	$0, 48(%r14)
	jne	LBB0_3
## %bb.6:
	cmpq	$0, 40(%r14)
	je	LBB0_7
LBB0_3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_7:
	movq	24(%r14), %rcx
	testl	%esi, %esi
	js	LBB0_21
## %bb.8:
	testq	%rcx, %rcx
	jne	LBB0_10
## %bb.9:
	cmpq	$0, 8(%r14)
	je	LBB0_11
LBB0_10:
	movq	_EEXIST@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_21:
	testq	%rcx, %rcx
	je	LBB0_22
## %bb.26:
	testq	%rax, %rax
	je	LBB0_27
## %bb.31:
	movq	%r14, %rdi
	callq	_mddev_suspend
	xorl	%r15d, %r15d
LBB0_32:
	movq	%r14, %rdi
	callq	_md_bitmap_destroy
	movq	%r14, %rdi
	callq	_mddev_resume
	movl	%r15d, %ebx
	jmp	LBB0_33
LBB0_22:
	movq	_ENOENT@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_36:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	%esi, %edi
	callq	_fget
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	%rax, %r15
	movq	8(%rax), %rax
	movq	(%rax), %rbx
	movl	4(%rbx), %edi
	callq	_S_ISREG
	movq	_EBADF@GOTPCREL(%rip), %r12
	testl	%eax, %eax
	je	LBB0_14
## %bb.15:
	movq	_FMODE_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_16
## %bb.17:
	movq	%rbx, %rdi
	callq	_atomic_read
	cmpl	$1, %eax
	je	LBB0_23
## %bb.18:
	movq	_EBUSY@GOTPCREL(%rip), %r12
	leaq	L_.str.3(%rip), %rbx
	jmp	LBB0_19
LBB0_27:
	xorl	%ebx, %ebx
LBB0_33:
	movq	8(%r14), %r15
	testq	%r15, %r15
	je	LBB0_36
## %bb.34:
	movq	%r14, %rdi
	callq	_spin_lock
	movq	$0, 8(%r14)
	movq	%r14, %rdi
	callq	_spin_unlock
LBB0_35:
	movq	%r15, %rdi
	callq	_fput
	jmp	LBB0_36
LBB0_12:
	movq	%r14, %rdi
	callq	_mdname
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_warn
	movq	_EBADF@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_14:
	leaq	L_.str.1(%rip), %rbx
	jmp	LBB0_19
LBB0_16:
	leaq	L_.str.2(%rip), %rbx
LBB0_19:
	movq	%r14, %rdi
	callq	_mdname
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_pr_warn
	movl	(%r12), %ebx
	testl	%ebx, %ebx
	je	LBB0_23
## %bb.20:
	negl	%ebx
	jmp	LBB0_35
LBB0_23:
	movq	%r15, 8(%r14)
	movq	$0, 16(%r14)
	xorl	%ebx, %ebx
	cmpq	$0, 32(%r14)
	je	LBB0_36
## %bb.24:
	movq	%r14, %rdi
	movl	$-1, %esi
	callq	_md_bitmap_create
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_mddev_suspend
	movq	%r15, %rdi
	callq	_IS_ERR
	testl	%eax, %eax
	je	LBB0_25
## %bb.28:
	movq	%r15, %rdi
	callq	_PTR_ERR
	jmp	LBB0_29
LBB0_25:
	movq	%r15, 24(%r14)
	movq	%r14, %rdi
	callq	_md_bitmap_load
LBB0_29:
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_32
## %bb.30:
	movq	%r14, %rdi
	callq	_mddev_resume
	jmp	LBB0_36
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EEXIST,4,2                     ## @EEXIST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: error: failed to get bitmap file\n"

	.comm	_EBADF,4,2                      ## @EBADF
L_.str.1:                               ## @.str.1
	.asciz	"%s: error: bitmap file must be a regular file\n"

	.comm	_FMODE_WRITE,4,2                ## @FMODE_WRITE
L_.str.2:                               ## @.str.2
	.asciz	"%s: error: bitmap file must open for write\n"

L_.str.3:                               ## @.str.3
	.asciz	"%s: error: bitmap file is already in use\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.no_dead_strip	_set_bitmap_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_bitmap_file
_set_bitmap_file:                       ; @set_bitmap_file
	.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	x8, [x0, #32]
	cbz	x8, LBB0_6
; %bb.1:
	ldr	w9, [x8]
	cbz	w9, LBB0_5
; %bb.2:
	ldr	w9, [x19, #56]
	cbz	w9, LBB0_5
; %bb.3:
	ldr	x9, [x19, #48]
	cbnz	x9, LBB0_5
; %bb.4:
	ldr	x9, [x19, #40]
	cbz	x9, LBB0_6
LBB0_5:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_15
LBB0_6:
	ldr	x9, [x19, #24]
	tbnz	w1, #31, LBB0_10
; %bb.7:
	cbnz	x9, LBB0_9
; %bb.8:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_17
LBB0_9:
Lloh2:
	adrp	x8, _EEXIST@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
	b	LBB0_15
LBB0_10:
	cbz	x9, LBB0_14
; %bb.11:
	cbz	x8, LBB0_22
; %bb.12:
	mov	x0, x19
	bl	_mddev_suspend
	mov	w20, #0
LBB0_13:
	mov	x0, x19
	bl	_md_bitmap_destroy
	mov	x0, x19
	bl	_mddev_resume
	ldr	x21, [x19, #8]
	cbnz	x21, LBB0_23
	b	LBB0_16
LBB0_14:
Lloh4:
	adrp	x8, _ENOENT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_16:
	mov	x0, x20
	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_17:
	mov	x0, x1
	bl	_fget
	cbz	x0, LBB0_25
; %bb.18:
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	x20, [x8]
	ldr	w0, [x20, #4]
	bl	_S_ISREG
	cbz	w0, LBB0_26
; %bb.19:
	ldr	w8, [x21]
Lloh6:
	adrp	x9, _FMODE_WRITE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FMODE_WRITE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_27
; %bb.20:
	mov	x0, x20
	bl	_atomic_read
	cmp	w0, #1
	b.eq	LBB0_30
; %bb.21:
Lloh9:
	adrp	x22, _EBUSY@GOTPAGE
Lloh10:
	ldr	x22, [x22, _EBUSY@GOTPAGEOFF]
Lloh11:
	adrp	x20, l_.str.3@PAGE
Lloh12:
	add	x20, x20, l_.str.3@PAGEOFF
	b	LBB0_28
LBB0_22:
	mov	w20, #0
	ldr	x21, [x19, #8]
	cbz	x21, LBB0_16
LBB0_23:
	mov	x0, x19
	bl	_spin_lock
	str	xzr, [x19, #8]
	mov	x0, x19
	bl	_spin_unlock
LBB0_24:
	mov	x0, x21
	bl	_fput
	b	LBB0_16
LBB0_25:
	mov	x0, x19
	bl	_mdname
	mov	x1, x0
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
Lloh15:
	adrp	x8, _EBADF@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
	b	LBB0_15
LBB0_26:
Lloh17:
	adrp	x22, _EBADF@GOTPAGE
Lloh18:
	ldr	x22, [x22, _EBADF@GOTPAGEOFF]
Lloh19:
	adrp	x20, l_.str.1@PAGE
Lloh20:
	add	x20, x20, l_.str.1@PAGEOFF
	b	LBB0_28
LBB0_27:
Lloh21:
	adrp	x22, _EBADF@GOTPAGE
Lloh22:
	ldr	x22, [x22, _EBADF@GOTPAGEOFF]
Lloh23:
	adrp	x20, l_.str.2@PAGE
Lloh24:
	add	x20, x20, l_.str.2@PAGEOFF
LBB0_28:
	mov	x0, x19
	bl	_mdname
	mov	x1, x0
	mov	x0, x20
	bl	_pr_warn
	ldr	w8, [x22]
	cbz	w8, LBB0_30
; %bb.29:
	neg	w20, w8
	b	LBB0_24
LBB0_30:
	stp	x21, xzr, [x19, #8]
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_33
; %bb.31:
	mov	x0, x19
	mov	w1, #-1
	bl	_md_bitmap_create
	mov	x20, x0
	mov	x0, x19
	bl	_mddev_suspend
	mov	x0, x20
	bl	_IS_ERR
	cbz	w0, LBB0_34
; %bb.32:
	mov	x0, x20
	bl	_PTR_ERR
	b	LBB0_35
LBB0_33:
	mov	w20, #0
	b	LBB0_16
LBB0_34:
	str	x20, [x19, #24]
	mov	x0, x19
	bl	_md_bitmap_load
LBB0_35:
	mov	x20, x0
	cbnz	w0, LBB0_13
; %bb.36:
	mov	x0, x19
	bl	_mddev_resume
	mov	w20, #0
	b	LBB0_16
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EEXIST,4,2                     ; @EEXIST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: error: failed to get bitmap file\n"

	.comm	_EBADF,4,2                      ; @EBADF
l_.str.1:                               ; @.str.1
	.asciz	"%s: error: bitmap file must be a regular file\n"

	.comm	_FMODE_WRITE,4,2                ; @FMODE_WRITE
l_.str.2:                               ; @.str.2
	.asciz	"%s: error: bitmap file must open for write\n"

l_.str.3:                               ; @.str.3
	.asciz	"%s: error: bitmap file is already in use\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.no_dead_strip	_set_bitmap_file
.subsections_via_symbols
