	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rsxx_setup_dev                 ## -- Begin function rsxx_setup_dev
	.p2align	4, 0x90
_rsxx_setup_dev:                        ## @rsxx_setup_dev
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	addq	$44, %rdi
	callq	_mutex_init
	movq	_enable_blkdev@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_12
## %bb.1:
	movq	_DRIVER_NAME@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_register_blkdev
	movq	%rax, (%r14)
	testq	%rax, %rax
	js	LBB0_2
## %bb.3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_blk_alloc_queue
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	_blkdev_minors@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_alloc_disk
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movzwl	40(%r14), %ebx
	movq	16(%r14), %rdi
	movq	_rsxx_make_request@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_blk_queue_make_request
	movq	16(%r14), %rdi
	movq	_BLK_BOUNCE_ANY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_blk_queue_bounce_limit
	movq	16(%r14), %rdi
	leal	-1(%rbx), %eax
	movzwl	%ax, %esi
	callq	_blk_queue_dma_alignment
	movq	16(%r14), %rdi
	movq	_blkdev_max_hw_sectors@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_blk_queue_max_hw_sectors
	movq	16(%r14), %rdi
	movl	%ebx, %esi
	callq	_blk_queue_logical_block_size
	movq	16(%r14), %rdi
	movq	_RSXX_HW_BLK_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_blk_queue_physical_block_size
	movq	_QUEUE_FLAG_NONROT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	16(%r14), %rsi
	callq	_queue_flag_set_unlocked
	movq	%r14, %rdi
	callq	_rsxx_discard_supported
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	_QUEUE_FLAG_DISCARD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	16(%r14), %rsi
	callq	_queue_flag_set_unlocked
	movq	16(%r14), %rdi
	movl	(%rbx), %esi
	sarl	$9, %esi
	callq	_blk_queue_max_discard_sectors
	movl	(%rbx), %ecx
	movq	16(%r14), %rax
	movl	%ecx, 8(%rax)
	movl	%ecx, 12(%rax)
	movl	$1, 16(%rax)
	jmp	LBB0_11
LBB0_2:
	movq	%r14, %rdi
	callq	_CARD_TO_DEV
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_4:
	movq	%r14, %rdi
	callq	_CARD_TO_DEV
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	jmp	LBB0_5
LBB0_7:
	movq	%r14, %rdi
	callq	_CARD_TO_DEV
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	movq	16(%r14), %rdi
	callq	_blk_cleanup_queue
LBB0_5:
	movq	(%r14), %rdi
	movl	(%r15), %esi
	callq	_unregister_blkdev
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_9:
	movq	16(%r14), %rax
LBB0_11:
	movq	%r14, (%rax)
	movq	24(%r14), %rax
	movl	48(%rax), %edi
	movl	8(%r14), %ecx
	leaq	L_.str.3(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movq	24(%r14), %rax
	movq	32(%r14), %rcx
	movq	%rcx, 40(%rax)
	movq	(%r14), %rcx
	movq	%rcx, (%rax)
	movq	$0, 32(%rax)
	movq	_rsxx_fops@GOTPCREL(%rip), %rcx
	movq	%rcx, 24(%rax)
	movq	%r14, 16(%rax)
	movq	16(%r14), %rcx
	movq	%rcx, 8(%rax)
LBB0_12:
	xorl	%ebx, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_enable_blkdev,4,2              ## @enable_blkdev
	.comm	_DRIVER_NAME,4,2                ## @DRIVER_NAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to get major number\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"Failed queue alloc\n"

	.comm	_blkdev_minors,4,2              ## @blkdev_minors
L_.str.2:                               ## @.str.2
	.asciz	"Failed disk alloc\n"

	.comm	_rsxx_make_request,4,2          ## @rsxx_make_request
	.comm	_BLK_BOUNCE_ANY,4,2             ## @BLK_BOUNCE_ANY
	.comm	_blkdev_max_hw_sectors,4,2      ## @blkdev_max_hw_sectors
	.comm	_RSXX_HW_BLK_SIZE,4,2           ## @RSXX_HW_BLK_SIZE
	.comm	_QUEUE_FLAG_NONROT,4,2          ## @QUEUE_FLAG_NONROT
	.comm	_QUEUE_FLAG_DISCARD,4,2         ## @QUEUE_FLAG_DISCARD
L_.str.3:                               ## @.str.3
	.asciz	"rsxx%d"

	.comm	_rsxx_fops,4,2                  ## @rsxx_fops
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rsxx_setup_dev                 ; -- Begin function rsxx_setup_dev
	.p2align	2
_rsxx_setup_dev:                        ; @rsxx_setup_dev
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	add	x0, x0, #44
	bl	_mutex_init
Lloh0:
	adrp	x8, _enable_blkdev@GOTPAGE
Lloh1:
	ldr	x8, [x8, _enable_blkdev@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_6
; %bb.1:
Lloh3:
	adrp	x20, _DRIVER_NAME@GOTPAGE
Lloh4:
	ldr	x20, [x20, _DRIVER_NAME@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	w0, #0
	bl	_register_blkdev
	str	x0, [x19]
	tbnz	x0, #63, LBB0_7
; %bb.2:
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_blk_alloc_queue
	str	x0, [x19, #16]
	cbz	x0, LBB0_8
; %bb.3:
Lloh8:
	adrp	x8, _blkdev_minors@GOTPAGE
Lloh9:
	ldr	x8, [x8, _blkdev_minors@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_alloc_disk
	str	x0, [x19, #24]
	cbz	x0, LBB0_9
; %bb.4:
	ldrh	w20, [x19, #40]
	ldr	x0, [x19, #16]
Lloh11:
	adrp	x8, _rsxx_make_request@GOTPAGE
Lloh12:
	ldr	x8, [x8, _rsxx_make_request@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_blk_queue_make_request
	ldr	x0, [x19, #16]
Lloh14:
	adrp	x8, _BLK_BOUNCE_ANY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BLK_BOUNCE_ANY@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_blk_queue_bounce_limit
	ldr	x0, [x19, #16]
	sub	w8, w20, #1
	and	w1, w8, #0xffff
	bl	_blk_queue_dma_alignment
	ldr	x0, [x19, #16]
Lloh17:
	adrp	x8, _blkdev_max_hw_sectors@GOTPAGE
Lloh18:
	ldr	x8, [x8, _blkdev_max_hw_sectors@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_blk_queue_max_hw_sectors
	ldr	x0, [x19, #16]
	mov	x1, x20
	bl	_blk_queue_logical_block_size
	ldr	x0, [x19, #16]
Lloh20:
	adrp	x20, _RSXX_HW_BLK_SIZE@GOTPAGE
Lloh21:
	ldr	x20, [x20, _RSXX_HW_BLK_SIZE@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_blk_queue_physical_block_size
Lloh22:
	adrp	x8, _QUEUE_FLAG_NONROT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _QUEUE_FLAG_NONROT@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	ldr	x1, [x19, #16]
	bl	_queue_flag_set_unlocked
	mov	x0, x19
	bl	_rsxx_discard_supported
	cbz	x0, LBB0_12
; %bb.5:
Lloh25:
	adrp	x8, _QUEUE_FLAG_DISCARD@GOTPAGE
Lloh26:
	ldr	x8, [x8, _QUEUE_FLAG_DISCARD@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	ldr	x1, [x19, #16]
	bl	_queue_flag_set_unlocked
	ldr	x0, [x19, #16]
	ldr	w8, [x20]
	asr	w1, w8, #9
	bl	_blk_queue_max_discard_sectors
	ldr	w9, [x20]
	ldr	x8, [x19, #16]
	stp	w9, w9, [x8, #8]
	mov	w9, #1
	str	w9, [x8, #16]
	b	LBB0_13
LBB0_6:
	mov	w0, #0
	b	LBB0_14
LBB0_7:
	mov	x0, x19
	bl	_CARD_TO_DEV
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_11
LBB0_8:
	mov	x0, x19
	bl	_CARD_TO_DEV
Lloh30:
	adrp	x1, l_.str.1@PAGE
Lloh31:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_CARD_TO_DEV
Lloh32:
	adrp	x1, l_.str.2@PAGE
Lloh33:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	ldr	x0, [x19, #16]
	bl	_blk_cleanup_queue
LBB0_10:
	ldr	x0, [x19]
	ldr	w1, [x20]
	bl	_unregister_blkdev
LBB0_11:
Lloh34:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_12:
	ldr	x8, [x19, #16]
LBB0_13:
	str	x19, [x8]
	ldr	x8, [x19, #24]
	ldr	w0, [x8, #48]
	ldr	w3, [x19, #8]
Lloh37:
	adrp	x2, l_.str.3@PAGE
Lloh38:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	mov	w0, #0
	ldp	x10, x8, [x19, #24]
	ldr	x9, [x19]
	ldr	x11, [x19, #16]
	stp	xzr, x8, [x10, #32]
Lloh39:
	adrp	x8, _rsxx_fops@GOTPAGE
Lloh40:
	ldr	x8, [x8, _rsxx_fops@GOTPAGEOFF]
	stp	x19, x8, [x10, #16]
	stp	x9, x11, [x10]
LBB0_14:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_enable_blkdev,4,2              ; @enable_blkdev
	.comm	_DRIVER_NAME,4,2                ; @DRIVER_NAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to get major number\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"Failed queue alloc\n"

	.comm	_blkdev_minors,4,2              ; @blkdev_minors
l_.str.2:                               ; @.str.2
	.asciz	"Failed disk alloc\n"

	.comm	_rsxx_make_request,4,2          ; @rsxx_make_request
	.comm	_BLK_BOUNCE_ANY,4,2             ; @BLK_BOUNCE_ANY
	.comm	_blkdev_max_hw_sectors,4,2      ; @blkdev_max_hw_sectors
	.comm	_RSXX_HW_BLK_SIZE,4,2           ; @RSXX_HW_BLK_SIZE
	.comm	_QUEUE_FLAG_NONROT,4,2          ; @QUEUE_FLAG_NONROT
	.comm	_QUEUE_FLAG_DISCARD,4,2         ; @QUEUE_FLAG_DISCARD
l_.str.3:                               ; @.str.3
	.asciz	"rsxx%d"

	.comm	_rsxx_fops,4,2                  ; @rsxx_fops
.subsections_via_symbols
