	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbp2_start_device
_sbp2_start_device:                     ## @sbp2_start_device
	.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
	movq	120(%rdi), %rbx
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	112(%r14), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movl	$4, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 104(%r14)
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	96(%r14), %rdx
	movl	(%r15), %ecx
	movl	$4, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 88(%r14)
	testq	%rax, %rax
	je	LBB0_15
## %bb.2:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	80(%r14), %rdx
	movl	(%r15), %ecx
	movl	$4, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 72(%r14)
	testq	%rax, %rax
	je	LBB0_15
## %bb.3:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	64(%r14), %rdx
	movl	(%r15), %ecx
	movl	$4, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 56(%r14)
	testq	%rax, %rax
	je	LBB0_15
## %bb.4:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	48(%r14), %rdx
	movl	(%r15), %ecx
	movl	$4, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 40(%r14)
	testq	%rax, %rax
	je	LBB0_15
## %bb.5:
	movq	(%rbx), %rax
	movl	(%rax), %edi
	leaq	32(%r14), %rdx
	movl	(%r15), %ecx
	movl	$4, %esi
	callq	_dma_alloc_coherent
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_15
## %bb.6:
	movq	%r14, %rdi
	callq	_sbp2util_create_command_orb_pool
	testq	%rax, %rax
	je	LBB0_7
LBB0_15:
	leaq	L_.str.1(%rip), %rdi
	callq	_SBP2_ERR
	movq	%r14, %rdi
	callq	_sbp2_remove_device
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_16:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msleep_interruptible
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r14, %rdi
	callq	_sbp2_remove_device
	movq	_EINTR@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_9:
	movq	%r14, %rdi
	callq	_sbp2_login_device
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%r14, %rdi
	callq	_sbp2_remove_device
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_11:
	movq	%r14, %rdi
	callq	_sbp2_set_busy_timeout
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_sbp2_agent_reset
	movq	%r14, %rdi
	callq	_sbp2_max_speed_and_size
	movq	_SBP2_WORKAROUND_DELAY_INQUIRY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_13
## %bb.12:
	movq	_SBP2_INQUIRY_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ssleep
LBB0_13:
	movl	16(%r14), %edi
	movq	8(%r14), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_scsi_add_device
	testl	%eax, %eax
	je	LBB0_17
## %bb.14:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rdi
	callq	_SBP2_ERR
	movq	%r14, %rdi
	callq	_sbp2_logout_device
	movq	%r14, %rdi
	callq	_sbp2_remove_device
	movl	%r15d, %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_SBP2_WORKAROUND_DELAY_INQUIRY,4,2 ## @SBP2_WORKAROUND_DELAY_INQUIRY
	.comm	_SBP2_INQUIRY_DELAY,4,2         ## @SBP2_INQUIRY_DELAY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"scsi_add_device failed"

L_.str.1:                               ## @.str.1
	.asciz	"Could not allocate memory for lu"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_sbp2_start_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbp2_start_device
_sbp2_start_device:                     ; @sbp2_start_device
	.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	x20, [x0, #120]
	ldr	x8, [x20]
	ldr	w0, [x8]
	add	x2, x19, #112
Lloh0:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x21]
	mov	w1, #4
	bl	_dma_alloc_coherent
	str	x0, [x19, #104]
	cbz	x0, LBB0_7
; %bb.1:
	ldr	x8, [x20]
	ldr	w0, [x8]
	add	x2, x19, #96
	ldr	w3, [x21]
	mov	w1, #4
	bl	_dma_alloc_coherent
	str	x0, [x19, #88]
	cbz	x0, LBB0_7
; %bb.2:
	ldr	x8, [x20]
	ldr	w0, [x8]
	add	x2, x19, #80
	ldr	w3, [x21]
	mov	w1, #4
	bl	_dma_alloc_coherent
	str	x0, [x19, #72]
	cbz	x0, LBB0_7
; %bb.3:
	ldr	x8, [x20]
	ldr	w0, [x8]
	add	x2, x19, #64
	ldr	w3, [x21]
	mov	w1, #4
	bl	_dma_alloc_coherent
	str	x0, [x19, #56]
	cbz	x0, LBB0_7
; %bb.4:
	ldr	x8, [x20]
	ldr	w0, [x8]
	add	x2, x19, #48
	ldr	w3, [x21]
	mov	w1, #4
	bl	_dma_alloc_coherent
	str	x0, [x19, #40]
	cbz	x0, LBB0_7
; %bb.5:
	ldr	x8, [x20]
	ldr	w0, [x8]
	add	x2, x19, #32
	ldr	w3, [x21]
	mov	w1, #4
	bl	_dma_alloc_coherent
	str	x0, [x19, #24]
	cbz	x0, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_sbp2util_create_command_orb_pool
	cbz	x0, LBB0_10
LBB0_7:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_SBP2_ERR
	mov	x0, x19
	bl	_sbp2_remove_device
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	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_10:
	mov	w0, #1000
	bl	_msleep_interruptible
	cbz	x0, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_sbp2_remove_device
Lloh6:
	adrp	x8, _EINTR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
	b	LBB0_8
LBB0_12:
	mov	x0, x19
	bl	_sbp2_login_device
	cbz	x0, LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_sbp2_remove_device
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_8
LBB0_14:
	mov	x0, x19
	bl	_sbp2_set_busy_timeout
	mov	x0, x19
	mov	w1, #1
	bl	_sbp2_agent_reset
	mov	x0, x19
	bl	_sbp2_max_speed_and_size
	ldr	w8, [x19]
Lloh10:
	adrp	x9, _SBP2_WORKAROUND_DELAY_INQUIRY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SBP2_WORKAROUND_DELAY_INQUIRY@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.15:
Lloh13:
	adrp	x8, _SBP2_INQUIRY_DELAY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SBP2_INQUIRY_DELAY@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_ssleep
LBB0_16:
	ldr	w0, [x19, #16]
	ldr	x8, [x19, #8]
	ldr	w2, [x8]
	mov	w1, #0
	mov	w3, #0
	bl	_scsi_add_device
	mov	x20, x0
	cbz	w0, LBB0_9
; %bb.17:
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	bl	_SBP2_ERR
	mov	x0, x19
	bl	_sbp2_logout_device
	mov	x0, x19
	bl	_sbp2_remove_device
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_SBP2_WORKAROUND_DELAY_INQUIRY,4,2 ; @SBP2_WORKAROUND_DELAY_INQUIRY
	.comm	_SBP2_INQUIRY_DELAY,4,2         ; @SBP2_INQUIRY_DELAY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"scsi_add_device failed"

l_.str.1:                               ; @.str.1
	.asciz	"Could not allocate memory for lu"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_sbp2_start_device
.subsections_via_symbols
