	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mv64xxx_i2c_wait_for_completion
_mv64xxx_i2c_wait_for_completion:       ## @mv64xxx_i2c_wait_for_completion
	.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, %r15
	movl	28(%rdi), %edx
	movl	36(%rdi), %edi
	xorl	%esi, %esi
	cmpq	$0, 16(%r15)
	sete	%sil
	callq	_wait_event_interruptible_timeout
	movq	%rax, %rbx
	leaq	12(%r15), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	jns	LBB0_7
	jmp	LBB0_3
LBB0_1:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
LBB0_3:
	movq	%rbx, (%r15)
	cmpq	$0, 16(%r15)
	je	LBB0_7
## %bb.4:
	movl	$1, 8(%r15)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	28(%r15), %edx
	movl	36(%r15), %edi
	xorl	%esi, %esi
	cmpq	$0, 16(%r15)
	sete	%sil
	callq	_wait_event_timeout
	testq	%rax, %rax
	jle	LBB0_5
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock_irqrestore         ## TAILCALL
LBB0_5:
	movq	16(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.6:
	movq	_MV64XXX_I2C_STATE_IDLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%r15)
	leaq	24(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %ecx
	callq	_dev_err
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mv64xxx_i2c_hw_init            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ETIMEDOUT,8,3                  ## @ETIMEDOUT
	.comm	_MV64XXX_I2C_STATE_IDLE,4,2     ## @MV64XXX_I2C_STATE_IDLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mv64xxx: I2C bus locked, block: %d, time_left: %d\n"

	.no_dead_strip	_mv64xxx_i2c_wait_for_completion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mv64xxx_i2c_wait_for_completion
_mv64xxx_i2c_wait_for_completion:       ; @mv64xxx_i2c_wait_for_completion
	.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	w0, [x0, #36]
	ldr	x8, [x19, #16]
	cmp	x8, #0
	cset	w1, eq
	ldr	w2, [x19, #28]
	bl	_wait_event_interruptible_timeout
	mov	x21, x0
	add	x20, x19, #12
	mov	x0, x20
	bl	_spin_lock_irqsave
	cbz	x21, LBB0_2
; %bb.1:
	tbz	x21, #63, LBB0_6
	b	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	neg	x21, x8
LBB0_3:
	str	x21, [x19]
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_6
; %bb.4:
	mov	w8, #1
	str	w8, [x19, #8]
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	w0, [x19, #36]
	ldr	x8, [x19, #16]
	cmp	x8, #0
	cset	w1, eq
	ldr	w2, [x19, #28]
	bl	_wait_event_timeout
	cmp	x0, #0
	b.le	LBB0_7
LBB0_5:
	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_6:
	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
	b	_spin_unlock_irqrestore
LBB0_7:
	ldr	x2, [x19, #16]
	cbz	x2, LBB0_5
; %bb.8:
	mov	x3, x0
Lloh3:
	adrp	x8, _MV64XXX_I2C_STATE_IDLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MV64XXX_I2C_STATE_IDLE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	add	x0, x19, #24
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_dev_err
	mov	x0, x19
	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
	b	_mv64xxx_i2c_hw_init
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ETIMEDOUT,8,3                  ; @ETIMEDOUT
	.comm	_MV64XXX_I2C_STATE_IDLE,4,2     ; @MV64XXX_I2C_STATE_IDLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mv64xxx: I2C bus locked, block: %d, time_left: %d\n"

	.no_dead_strip	_mv64xxx_i2c_wait_for_completion
.subsections_via_symbols
