	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_amd_check_cmd_completion
_i2c_amd_check_cmd_completion:          ## @i2c_amd_check_cmd_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, %rbx
	leaq	8(%rdi), %r14
	addq	$4, %rdi
	movl	(%rbx), %esi
	callq	_wait_for_completion_timeout
	movq	%rax, %r15
	movq	8(%rbx), %rax
	movq	_i2c_read@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	_i2c_write@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
LBB0_2:
	movq	24(%rbx), %rax
	cmpl	$33, (%rax)
	jl	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_i2c_amd_dma_unmap
LBB0_4:
	movq	%r14, %rdi
	testq	%r15, %r15
	je	LBB0_5
## %bb.6:
	callq	_amd_mp2_process_event
	xorl	%eax, %eax
	cmpl	$0, 16(%rbx)
	jne	LBB0_9
## %bb.7:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_8
LBB0_5:
	callq	_amd_mp2_rw_timeout
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
LBB0_8:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_i2c_read,8,3                   ## @i2c_read
	.comm	_i2c_write,8,3                  ## @i2c_write
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_i2c_amd_check_cmd_completion
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_amd_check_cmd_completion
_i2c_amd_check_cmd_completion:          ; @i2c_amd_check_cmd_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	w1, [x0], #4
	bl	_wait_for_completion_timeout
	mov	x21, x0
	mov	x20, x19
	ldr	x8, [x20, #8]!
Lloh0:
	adrp	x9, _i2c_read@GOTPAGE
Lloh1:
	ldr	x9, [x9, _i2c_read@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _i2c_write@GOTPAGE
Lloh4:
	ldr	x10, [x10, _i2c_write@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x19, #24]
	ldr	w8, [x8]
	cmp	w8, #33
	b.lt	LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_i2c_amd_dma_unmap
LBB0_3:
	mov	x0, x20
	cbz	x21, LBB0_6
; %bb.4:
	bl	_amd_mp2_process_event
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_7
; %bb.5:
	mov	w0, #0
	b	LBB0_9
LBB0_6:
	bl	_amd_mp2_rw_timeout
Lloh6:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_i2c_read,8,3                   ; @i2c_read
	.comm	_i2c_write,8,3                  ; @i2c_write
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_i2c_amd_check_cmd_completion
.subsections_via_symbols
