	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbp2_alloc_device
_sbp2_alloc_device:                     ## @sbp2_alloc_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	%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	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$80, %edi
	callq	_kzalloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	8(%r14), %rax
	movq	%rax, 72(%rbx)
	movq	%r14, 64(%rbx)
	movq	_IEEE1394_SPEED_100@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rcx, (%rbx)
	movq	_sbp2_speedto_max_payload@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax), %rax
	movl	(%rcx,%rax,4), %eax
	movl	%eax, 60(%rbx)
	movq	_CSR1212_INVALID_ADDR_SPACE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	leaq	56(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	leaq	52(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	leaq	24(%rbx), %r15
	movq	%r15, %rdi
	callq	_INIT_LIST_HEAD
	leaq	48(%rbx), %rdi
	callq	_spin_lock_init
	leaq	44(%rbx), %rdi
	movq	_SBP2LU_STATE_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_atomic_set
	movq	%rbx, %rdi
	addq	$40, %rdi
	xorl	%esi, %esi
	callq	_INIT_WORK
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_dev_set_drvdata
	movq	8(%r14), %rax
	movq	(%rax), %rsi
	movq	_sbp2_highlevel@GOTPCREL(%rip), %rdi
	callq	_hpsb_get_hostinfo
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:
	movq	8(%r14), %rax
	movq	(%rax), %rsi
	movq	_sbp2_highlevel@GOTPCREL(%rip), %rdi
	movl	$16, %edx
	callq	_hpsb_create_hostinfo
	testq	%rax, %rax
	je	LBB0_14
## %bb.3:
	movq	%rax, %r12
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r12)
	movq	%r12, %rdi
	callq	_INIT_LIST_HEAD
LBB0_4:
	movq	8(%r12), %rax
	movl	16(%rax), %edi
	callq	_dma_get_max_seg_size
	movq	_SBP2_MAX_SEG_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	cmpq	%rsi, %rax
	jle	LBB0_6
## %bb.5:
	movq	8(%r12), %rax
	movl	16(%rax), %edi
	callq	_dma_set_max_seg_size
	movl	%eax, %edi
	callq	_BUG_ON
LBB0_6:
	movq	8(%r12), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	callq	_try_module_get
	testl	%eax, %eax
	je	LBB0_10
## %bb.7:
	movq	%r12, 32(%rbx)
	movq	_sbp2_hi_logical_units_lock@GOTPCREL(%rip), %r13
	movq	%r13, %rdi
	callq	_write_lock_irqsave
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_list_add_tail
	movq	%r13, %rdi
	callq	_write_unlock_irqrestore
	movq	8(%r14), %rax
	movq	(%rax), %rsi
	movl	(%rsi), %r9d
	movq	_CSR1212_ALL_SPACE_END@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	_sbp2_highlevel@GOTPCREL(%rip), %rdi
	movq	_sbp2_ops@GOTPCREL(%rip), %rdx
	movl	$4, %ecx
	movl	$4, %r8d
	callq	_hpsb_allocate_and_register_addrspace
	movq	%rax, 8(%rbx)
	movq	_CSR1212_INVALID_ADDR_SPACE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.8:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_16
LBB0_9:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_16
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_16
LBB0_11:
	movq	_sbp2_shost_template@GOTPCREL(%rip), %rdi
	movl	$8, %esi
	callq	_scsi_host_alloc
	testq	%rax, %rax
	je	LBB0_15
## %bb.12:
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	%rbx, (%rax)
	movq	_SBP2_MAX_CDB_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_scsi_add_host
	testl	%eax, %eax
	je	LBB0_19
## %bb.13:
	leaq	L_.str.5(%rip), %rdi
	callq	_SBP2_ERR
	movq	%r15, %rdi
	callq	_scsi_host_put
	jmp	LBB0_17
LBB0_14:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_16
LBB0_15:
	leaq	L_.str.4(%rip), %rdi
LBB0_16:
	callq	_SBP2_ERR
LBB0_17:
	movq	%rbx, %rdi
	callq	_sbp2_remove_device
	xorl	%ebx, %ebx
LBB0_18:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	%r15, 16(%rbx)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to create lu"

	.comm	_IEEE1394_SPEED_100,8,3         ## @IEEE1394_SPEED_100
	.comm	_sbp2_speedto_max_payload,8,3   ## @sbp2_speedto_max_payload
	.comm	_CSR1212_INVALID_ADDR_SPACE,8,3 ## @CSR1212_INVALID_ADDR_SPACE
	.comm	_SBP2LU_STATE_RUNNING,4,2       ## @SBP2LU_STATE_RUNNING
	.comm	_sbp2_highlevel,4,2             ## @sbp2_highlevel
L_.str.1:                               ## @.str.1
	.asciz	"failed to allocate hostinfo"

	.comm	_SBP2_MAX_SEG_SIZE,8,3          ## @SBP2_MAX_SEG_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"failed to get a reference on 1394 host driver"

	.comm	_sbp2_hi_logical_units_lock,4,2 ## @sbp2_hi_logical_units_lock
	.comm	_sbp2_ops,4,2                   ## @sbp2_ops
	.comm	_CSR1212_ALL_SPACE_END,4,2      ## @CSR1212_ALL_SPACE_END
L_.str.3:                               ## @.str.3
	.asciz	"failed to allocate status FIFO address range"

	.comm	_sbp2_shost_template,4,2        ## @sbp2_shost_template
L_.str.4:                               ## @.str.4
	.asciz	"failed to register scsi host"

	.comm	_SBP2_MAX_CDB_SIZE,4,2          ## @SBP2_MAX_CDB_SIZE
L_.str.5:                               ## @.str.5
	.asciz	"failed to add scsi host"

	.comm	_sbp2_physdma_ops,4,2           ## @sbp2_physdma_ops
	.no_dead_strip	_sbp2_alloc_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbp2_alloc_device
_sbp2_alloc_device:                     ; @sbp2_alloc_device
	.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	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #80
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_9
; %bb.1:
	ldr	x8, [x20, #8]
	stp	x20, x8, [x19, #64]
Lloh3:
	adrp	x8, _IEEE1394_SPEED_100@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IEEE1394_SPEED_100@GOTPAGEOFF]
	ldr	x9, [x8]
	str	x9, [x19]
Lloh5:
	adrp	x9, _sbp2_speedto_max_payload@GOTPAGE
Lloh6:
	ldr	x9, [x9, _sbp2_speedto_max_payload@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	ldr	x8, [x8]
	ldr	w8, [x9, x8, lsl #2]
	str	w8, [x19, #60]
Lloh8:
	adrp	x24, _CSR1212_INVALID_ADDR_SPACE@GOTPAGE
Lloh9:
	ldr	x24, [x24, _CSR1212_INVALID_ADDR_SPACE@GOTPAGEOFF]
	ldr	x8, [x24]
	str	x8, [x19, #8]
	add	x0, x19, #56
	bl	_INIT_LIST_HEAD
	add	x0, x19, #52
	bl	_INIT_LIST_HEAD
	add	x21, x19, #24
	mov	x0, x21
	bl	_INIT_LIST_HEAD
	add	x0, x19, #48
	bl	_spin_lock_init
	add	x0, x19, #44
Lloh10:
	adrp	x8, _SBP2LU_STATE_RUNNING@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SBP2LU_STATE_RUNNING@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_atomic_set
	add	x0, x19, #40
	mov	x1, #0
	bl	_INIT_WORK
	mov	x0, x20
	mov	x1, x19
	bl	_dev_set_drvdata
	ldr	x8, [x20, #8]
	ldr	x1, [x8]
Lloh13:
	adrp	x0, _sbp2_highlevel@GOTPAGE
Lloh14:
	ldr	x0, [x0, _sbp2_highlevel@GOTPAGEOFF]
	bl	_hpsb_get_hostinfo
	mov	x22, x0
	cbnz	x0, LBB0_4
; %bb.2:
	ldr	x8, [x20, #8]
	ldr	x1, [x8]
Lloh15:
	adrp	x0, _sbp2_highlevel@GOTPAGE
Lloh16:
	ldr	x0, [x0, _sbp2_highlevel@GOTPAGEOFF]
	mov	w2, #16
	bl	_hpsb_create_hostinfo
	cbz	x0, LBB0_14
; %bb.3:
	mov	x22, x0
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	str	x8, [x0, #8]
	bl	_INIT_LIST_HEAD
LBB0_4:
	ldr	x8, [x22, #8]
	ldr	w0, [x8, #16]
	bl	_dma_get_max_seg_size
Lloh17:
	adrp	x8, _SBP2_MAX_SEG_SIZE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SBP2_MAX_SEG_SIZE@GOTPAGEOFF]
Lloh19:
	ldr	x1, [x8]
	cmp	x0, x1
	b.le	LBB0_6
; %bb.5:
	ldr	x8, [x22, #8]
	ldr	w0, [x8, #16]
	bl	_dma_set_max_seg_size
	bl	_BUG_ON
LBB0_6:
	ldr	x8, [x22, #8]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	bl	_try_module_get
	cbz	w0, LBB0_10
; %bb.7:
	str	x22, [x19, #32]
Lloh20:
	adrp	x23, _sbp2_hi_logical_units_lock@GOTPAGE
Lloh21:
	ldr	x23, [x23, _sbp2_hi_logical_units_lock@GOTPAGEOFF]
	mov	x0, x23
	bl	_write_lock_irqsave
	mov	x0, x21
	mov	x1, x22
	bl	_list_add_tail
	mov	x0, x23
	bl	_write_unlock_irqrestore
	ldr	x8, [x20, #8]
	ldr	x1, [x8]
	ldr	w5, [x1]
Lloh22:
	adrp	x8, _CSR1212_ALL_SPACE_END@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CSR1212_ALL_SPACE_END@GOTPAGEOFF]
Lloh24:
	ldr	w6, [x8]
Lloh25:
	adrp	x0, _sbp2_highlevel@GOTPAGE
Lloh26:
	ldr	x0, [x0, _sbp2_highlevel@GOTPAGEOFF]
Lloh27:
	adrp	x2, _sbp2_ops@GOTPAGE
Lloh28:
	ldr	x2, [x2, _sbp2_ops@GOTPAGEOFF]
	mov	w3, #4
	mov	w4, #4
	bl	_hpsb_allocate_and_register_addrspace
	str	x0, [x19, #8]
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.8:
Lloh29:
	adrp	x0, l_.str.3@PAGE
Lloh30:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_16
LBB0_9:
Lloh31:
	adrp	x0, l_.str@PAGE
Lloh32:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_16
LBB0_10:
Lloh33:
	adrp	x0, l_.str.2@PAGE
Lloh34:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_16
LBB0_11:
Lloh35:
	adrp	x0, _sbp2_shost_template@GOTPAGE
Lloh36:
	ldr	x0, [x0, _sbp2_shost_template@GOTPAGEOFF]
	mov	w1, #8
	bl	_scsi_host_alloc
	cbz	x0, LBB0_15
; %bb.12:
	mov	x21, x0
	ldr	x8, [x0]
	str	x19, [x8]
Lloh37:
	adrp	x8, _SBP2_MAX_CDB_SIZE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _SBP2_MAX_CDB_SIZE@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	mov	x1, x20
	bl	_scsi_add_host
	cbz	w0, LBB0_19
; %bb.13:
Lloh40:
	adrp	x0, l_.str.5@PAGE
Lloh41:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_SBP2_ERR
	mov	x0, x21
	bl	_scsi_host_put
	b	LBB0_17
LBB0_14:
Lloh42:
	adrp	x0, l_.str.1@PAGE
Lloh43:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_16
LBB0_15:
Lloh44:
	adrp	x0, l_.str.4@PAGE
Lloh45:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_16:
	bl	_SBP2_ERR
LBB0_17:
	mov	x0, x19
	bl	_sbp2_remove_device
	mov	x19, #0
LBB0_18:
	mov	x0, x19
	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_19:
	str	x21, [x19, #16]
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to create lu"

	.comm	_IEEE1394_SPEED_100,8,3         ; @IEEE1394_SPEED_100
	.comm	_sbp2_speedto_max_payload,8,3   ; @sbp2_speedto_max_payload
	.comm	_CSR1212_INVALID_ADDR_SPACE,8,3 ; @CSR1212_INVALID_ADDR_SPACE
	.comm	_SBP2LU_STATE_RUNNING,4,2       ; @SBP2LU_STATE_RUNNING
	.comm	_sbp2_highlevel,4,2             ; @sbp2_highlevel
l_.str.1:                               ; @.str.1
	.asciz	"failed to allocate hostinfo"

	.comm	_SBP2_MAX_SEG_SIZE,8,3          ; @SBP2_MAX_SEG_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"failed to get a reference on 1394 host driver"

	.comm	_sbp2_hi_logical_units_lock,4,2 ; @sbp2_hi_logical_units_lock
	.comm	_sbp2_ops,4,2                   ; @sbp2_ops
	.comm	_CSR1212_ALL_SPACE_END,4,2      ; @CSR1212_ALL_SPACE_END
l_.str.3:                               ; @.str.3
	.asciz	"failed to allocate status FIFO address range"

	.comm	_sbp2_shost_template,4,2        ; @sbp2_shost_template
l_.str.4:                               ; @.str.4
	.asciz	"failed to register scsi host"

	.comm	_SBP2_MAX_CDB_SIZE,4,2          ; @SBP2_MAX_CDB_SIZE
l_.str.5:                               ; @.str.5
	.asciz	"failed to add scsi host"

	.comm	_sbp2_physdma_ops,4,2           ; @sbp2_physdma_ops
	.no_dead_strip	_sbp2_alloc_device
.subsections_via_symbols
