	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i3c_master_add_i3c_dev_locked  ## -- Begin function i3c_master_add_i3c_dev_locked
	.p2align	4, 0x90
_i3c_master_add_i3c_dev_locked:         ## @i3c_master_add_i3c_dev_locked
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -88(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -80(%rbp)
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r12
	movq	%rdi, %r15
	leaq	-88(%rbp), %rsi
	callq	_i3c_master_alloc_i3c_dev
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_40
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_40
LBB0_4:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_i3c_master_attach_i3c_dev
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_39
## %bb.5:
	movq	%r14, %rdi
	callq	_i3c_master_retrieve_dev_info
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_35
## %bb.6:
	movq	%r14, %rdi
	callq	_i3c_master_search_i3c_dev_duplicate
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r13
	movq	%rax, %rbx
	movq	32(%r13), %rax
	movq	%rax, 32(%r14)
	movl	28(%r13), %eax
	movl	%eax, 28(%r14)
	movq	(%r13), %rax
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r14, (%rax)
LBB0_10:
	addq	$8, %r13
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	40(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	16(%rax), %rdx
	movq	%rdx, %rcx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -80(%rbp)
	movl	12(%rax), %ecx
	movl	%ecx, -68(%rbp)
	movl	8(%rax), %ecx
	movl	%ecx, -72(%rbp)
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.14:
	movq	%rbx, %rdi
	callq	_i3c_dev_disable_ibi_locked
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_15
LBB0_7:
	xorl	%r13d, %r13d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_17
LBB0_11:
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_16
LBB0_13:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_15:
	movq	%rbx, %rdi
	callq	_i3c_dev_free_ibi_locked
LBB0_16:
	movq	%r13, %rdi
	callq	_mutex_unlock
	movq	16(%rbx), %r12
	movq	%rbx, %rdi
	callq	_i3c_master_detach_i3c_dev
	movq	%rbx, %rdi
	callq	_i3c_master_free_i3c_dev
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_17:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_i3c_master_reattach_i3c_dev
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_18
LBB0_35:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_38
## %bb.36:
	cmpq	$0, (%rax)
	je	LBB0_38
## %bb.37:
	movq	$0, (%rax)
LBB0_38:
	movq	%r14, %rdi
	callq	_i3c_master_detach_i3c_dev
LBB0_39:
	movq	%r14, %rdi
	callq	_i3c_master_free_i3c_dev
LBB0_40:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	testq	%r12, %r12
	je	LBB0_20
## %bb.19:
	movq	16(%r14), %rsi
	cmpq	%rsi, %r12
	jne	LBB0_23
LBB0_20:
	movq	32(%r14), %rax
	testq	%rax, %rax
	je	LBB0_27
## %bb.21:
	movq	(%rax), %r12
	testq	%r12, %r12
	je	LBB0_27
## %bb.22:
	movq	16(%r14), %rsi
LBB0_23:
	cmpq	%r12, %rsi
	je	LBB0_27
## %bb.24:
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_i3c_master_setnewda_locked
	testl	%eax, %eax
	je	LBB0_25
## %bb.26:
	leaq	4(%r15), %rdi
	movl	(%r15), %edx
	movl	24(%r14), %ecx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_27
LBB0_25:
	movq	16(%r14), %rsi
	movq	%r12, 16(%r14)
	movq	%r14, %rdi
	callq	_i3c_master_reattach_i3c_dev
LBB0_27:
	xorl	%ebx, %ebx
	testq	%r13, %r13
	je	LBB0_40
## %bb.28:
	movq	%r14, %r12
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	leaq	-80(%rbp), %rsi
	movq	%r14, %rdi
	callq	_i3c_dev_request_ibi_locked
	testl	%eax, %eax
	je	LBB0_30
## %bb.29:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_33
LBB0_30:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_34
## %bb.31:
	movq	%r14, %rdi
	callq	_i3c_dev_enable_ibi_locked
	testl	%eax, %eax
	je	LBB0_34
## %bb.32:
	leaq	L_.str.2(%rip), %rsi
LBB0_33:
	movl	(%r15), %edx
	addq	$4, %r15
	movl	24(%r14), %ecx
	movq	%r15, %rdi
	callq	_dev_err
LBB0_34:
	movq	%r12, %rdi
	callq	_mutex_unlock
	jmp	LBB0_40
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to assign reserved/old address to device %d%llx"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to request IBI on device %d-%llx"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to re-enable IBI on device %d-%llx"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i3c_master_add_i3c_dev_locked  ; -- Begin function i3c_master_add_i3c_dev_locked
	.p2align	2
_i3c_master_add_i3c_dev_locked:         ; @i3c_master_add_i3c_dev_locked
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	stp	xzr, x1, [sp, #16]
	str	xzr, [sp, #8]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x1
	mov	x20, x0
	add	x1, sp, #24
	bl	_i3c_master_alloc_i3c_dev
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_23
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_23
LBB0_4:
	mov	x0, x20
	mov	x1, x19
	bl	_i3c_master_attach_i3c_dev
	mov	x22, x0
	cbnz	w0, LBB0_22
; %bb.5:
	mov	x0, x19
	bl	_i3c_master_retrieve_dev_info
	mov	x22, x0
	cbnz	w0, LBB0_18
; %bb.6:
	mov	x0, x19
	bl	_i3c_master_search_i3c_dev_duplicate
	cbz	x0, LBB0_12
; %bb.7:
	mov	x22, x0
	ldr	x8, [x0, #32]
	str	x8, [x19, #32]
	ldr	w8, [x0, #28]
	str	w8, [x19, #28]
	ldr	x8, [x0]
	str	x8, [x19]
	cbz	x8, LBB0_9
; %bb.8:
	str	x19, [x8]
LBB0_9:
	add	x21, x22, #8
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x22, #40]
	cbz	x8, LBB0_13
; %bb.10:
	ldr	x23, [x8, #16]
	str	x23, [sp, #8]
	ldr	d0, [x8, #8]
	str	d0, [sp, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_14
; %bb.11:
	mov	x0, x22
	bl	_i3c_dev_disable_ibi_locked
	mov	w24, #1
	b	LBB0_15
LBB0_12:
	mov	x23, #0
	mov	w24, #0
	b	LBB0_17
LBB0_13:
	mov	x23, #0
	mov	w24, #0
	b	LBB0_16
LBB0_14:
	mov	w24, #0
LBB0_15:
	mov	x0, x22
	bl	_i3c_dev_free_ibi_locked
LBB0_16:
	mov	x0, x21
	bl	_mutex_unlock
	ldr	x21, [x22, #16]
	mov	x0, x22
	bl	_i3c_master_detach_i3c_dev
	mov	x0, x22
	bl	_i3c_master_free_i3c_dev
LBB0_17:
	mov	x0, x19
	mov	x1, x21
	bl	_i3c_master_reattach_i3c_dev
	mov	x22, x0
	cbz	w0, LBB0_24
LBB0_18:
	ldr	x8, [x19]
	cbz	x8, LBB0_21
; %bb.19:
	ldr	x9, [x8]
	cbz	x9, LBB0_21
; %bb.20:
	str	xzr, [x8]
LBB0_21:
	mov	x0, x19
	bl	_i3c_master_detach_i3c_dev
LBB0_22:
	mov	x0, x19
	bl	_i3c_master_free_i3c_dev
LBB0_23:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_24:
	cbz	x21, LBB0_26
; %bb.25:
	ldr	x1, [x19, #16]
	cmp	x21, x1
	b.ne	LBB0_29
LBB0_26:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_33
; %bb.27:
	ldr	x21, [x8]
	cbz	x21, LBB0_33
; %bb.28:
	ldr	x1, [x19, #16]
LBB0_29:
	cmp	x1, x21
	b.eq	LBB0_33
; %bb.30:
	mov	x0, x20
	mov	x2, x21
	bl	_i3c_master_setnewda_locked
	cbz	w0, LBB0_32
; %bb.31:
	mov	x0, x20
	ldr	w2, [x0], #4
	ldr	w3, [x19, #24]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_33
LBB0_32:
	ldr	x1, [x19, #16]
	str	x21, [x19, #16]
	mov	x0, x19
	bl	_i3c_master_reattach_i3c_dev
LBB0_33:
	cbz	x23, LBB0_36
; %bb.34:
	add	x21, x19, #8
	mov	x0, x21
	bl	_mutex_lock
	add	x1, sp, #8
	mov	x0, x19
	bl	_i3c_dev_request_ibi_locked
	cbz	w0, LBB0_37
; %bb.35:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_40
LBB0_36:
	mov	w22, #0
	b	LBB0_23
LBB0_37:
	cbz	w24, LBB0_41
; %bb.38:
	mov	x0, x19
	bl	_i3c_dev_enable_ibi_locked
	cbz	w0, LBB0_41
; %bb.39:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_40:
	ldr	w2, [x20], #4
	ldr	w3, [x19, #24]
	mov	x0, x20
	bl	_dev_err
LBB0_41:
	mov	x0, x21
	bl	_mutex_unlock
	mov	w22, #0
	b	LBB0_23
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to assign reserved/old address to device %d%llx"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to request IBI on device %d-%llx"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to re-enable IBI on device %d-%llx"

.subsections_via_symbols
