	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function register_cache
_register_cache:                        ## @register_cache
	.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	%rcx, %r14
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r13
	movl	(%rcx), %esi
	movq	%rdx, %rdi
	callq	_bdevname
	leaq	8(%r14), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rsi
	movl	$4, %edx
	callq	_memcpy
	movq	%r12, 24(%r14)
	movq	%r14, 8(%r12)
	leaq	16(%r14), %rbx
	movl	16(%r14), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_bio_init
	movq	%rbx, %rdi
	callq	_bio_first_bvec_all
	movq	%r15, (%rax)
	movq	%r15, %rdi
	callq	_get_page
	movq	%r12, %rdi
	callq	_bdev_get_queue
	movl	%eax, %edi
	callq	_blk_queue_discard
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_CACHE_DISCARD
	movl	%eax, 12(%r14)
LBB0_2:
	movq	%r14, %rdi
	callq	_cache_alloc
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %r15d
	movq	_FMODE_READ@GOTPCREL(%rip), %rax
	movq	_FMODE_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_FMODE_EXCL@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r12, %rdi
	callq	_blkdev_put
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	jne	LBB0_11
## %bb.4:
	leaq	L_.str(%rip), %rbx
	jmp	LBB0_12
LBB0_5:
	leaq	4(%r14), %r13
	movl	(%r12), %edi
	callq	_part_to_dev
	leaq	L_.str.3(%rip), %rdx
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_kobject_add
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	leaq	L_.str.4(%rip), %rbx
	jmp	LBB0_9
LBB0_11:
	movq	_EPERM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rbx
	cmoveq	%rax, %rbx
	jmp	LBB0_12
LBB0_7:
	movq	_bch_register_lock@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_register_cache_set
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_mutex_unlock
	testq	%rbx, %rbx
	je	LBB0_10
## %bb.8:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	%r13, %rdi
	callq	_kobject_put
LBB0_12:
	movl	(%r14), %esi
	leaq	L_.str.6(%rip), %rdi
	movq	%rbx, %rdx
	callq	_pr_notice
LBB0_13:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r14), %esi
	leaq	L_.str.5(%rip), %rdi
	callq	_pr_info
	movq	%r13, %rdi
	callq	_kobject_put
	xorl	%r15d, %r15d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_FMODE_READ,4,2                 ## @FMODE_READ
	.comm	_FMODE_WRITE,4,2                ## @FMODE_WRITE
	.comm	_FMODE_EXCL,4,2                 ## @FMODE_EXCL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cache_alloc(): -ENOMEM"

	.comm	_EPERM,4,2                      ## @EPERM
L_.str.1:                               ## @.str.1
	.asciz	"cache_alloc(): cache device is too small"

L_.str.2:                               ## @.str.2
	.asciz	"cache_alloc(): unknown error"

L_.str.3:                               ## @.str.3
	.asciz	"bcache"

L_.str.4:                               ## @.str.4
	.asciz	"error calling kobject_add"

	.comm	_bch_register_lock,4,2          ## @bch_register_lock
	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.5:                               ## @.str.5
	.asciz	"registered cache device %s"

L_.str.6:                               ## @.str.6
	.asciz	"error %s: %s"

	.no_dead_strip	_register_cache
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function register_cache
_register_cache:                        ; @register_cache
	.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, x3
	mov	x20, x2
	mov	x22, x1
	mov	x23, x0
	ldr	w1, [x3]
	mov	x0, x2
	bl	_bdevname
	add	x21, x19, #8
	mov	x0, x21
	mov	x1, x23
	mov	w2, #4
	bl	_memcpy
	str	x20, [x19, #24]
	str	x19, [x20, #8]
	mov	x23, x19
	ldr	w1, [x23, #16]!
	mov	x0, x23
	mov	w2, #1
	bl	_bio_init
	mov	x0, x23
	bl	_bio_first_bvec_all
	str	x22, [x0]
	mov	x0, x22
	bl	_get_page
	mov	x0, x20
	bl	_bdev_get_queue
	bl	_blk_queue_discard
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_CACHE_DISCARD
	str	w0, [x19, #12]
LBB0_2:
	mov	x0, x19
	bl	_cache_alloc
	cbz	w0, LBB0_5
; %bb.3:
	mov	x22, x0
Lloh0:
	adrp	x8, _FMODE_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FMODE_READ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _FMODE_WRITE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FMODE_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _FMODE_EXCL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FMODE_EXCL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	x0, x20
	bl	_blkdev_put
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmn	w22, w8
	b.ne	LBB0_7
; %bb.4:
Lloh12:
	adrp	x20, l_.str@PAGE
Lloh13:
	add	x20, x20, l_.str@PAGEOFF
	b	LBB0_11
LBB0_5:
	add	x21, x19, #4
	ldr	w0, [x20]
	bl	_part_to_dev
	mov	x1, x0
Lloh14:
	adrp	x2, l_.str.3@PAGE
Lloh15:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_kobject_add
	cbz	x0, LBB0_8
; %bb.6:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	adrp	x20, l_.str.4@PAGE
Lloh19:
	add	x20, x20, l_.str.4@PAGEOFF
	b	LBB0_10
LBB0_7:
Lloh20:
	adrp	x8, _EPERM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	adrp	x9, l_.str.2@PAGE
Lloh24:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh25:
	adrp	x10, l_.str.1@PAGE
Lloh26:
	add	x10, x10, l_.str.1@PAGEOFF
	cmn	w22, w8
	csel	x20, x10, x9, eq
	b	LBB0_11
LBB0_8:
Lloh27:
	adrp	x22, _bch_register_lock@GOTPAGE
Lloh28:
	ldr	x22, [x22, _bch_register_lock@GOTPAGEOFF]
	mov	x0, x22
	bl	_mutex_lock
	mov	x0, x19
	bl	_register_cache_set
	mov	x20, x0
	mov	x0, x22
	bl	_mutex_unlock
	cbz	x20, LBB0_13
; %bb.9:
Lloh29:
	adrp	x8, _ENODEV@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w22, w8
	mov	x0, x21
	bl	_kobject_put
LBB0_11:
	ldr	w1, [x19]
Lloh31:
	adrp	x0, l_.str.6@PAGE
Lloh32:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x2, x20
	bl	_pr_notice
LBB0_12:
	mov	x0, x22
	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
LBB0_13:
	ldr	w1, [x19]
Lloh33:
	adrp	x0, l_.str.5@PAGE
Lloh34:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_info
	mov	x0, x21
	bl	_kobject_put
	mov	w22, #0
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_FMODE_READ,4,2                 ; @FMODE_READ
	.comm	_FMODE_WRITE,4,2                ; @FMODE_WRITE
	.comm	_FMODE_EXCL,4,2                 ; @FMODE_EXCL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cache_alloc(): -ENOMEM"

	.comm	_EPERM,4,2                      ; @EPERM
l_.str.1:                               ; @.str.1
	.asciz	"cache_alloc(): cache device is too small"

l_.str.2:                               ; @.str.2
	.asciz	"cache_alloc(): unknown error"

l_.str.3:                               ; @.str.3
	.asciz	"bcache"

l_.str.4:                               ; @.str.4
	.asciz	"error calling kobject_add"

	.comm	_bch_register_lock,4,2          ; @bch_register_lock
	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.5:                               ; @.str.5
	.asciz	"registered cache device %s"

l_.str.6:                               ; @.str.6
	.asciz	"error %s: %s"

	.no_dead_strip	_register_cache
.subsections_via_symbols
