	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_sirfsoc_xfer_msg
_i2c_sirfsoc_xfer_msg:                  ## @i2c_sirfsoc_xfer_msg
	.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	%rsi, %r15
	movq	%rdi, %rbx
	movq	_SIRFSOC_I2C_CTRL@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movl	%eax, %r14d
	imull	$50, (%r15), %edi
	addl	$50, %edi
	callq	_msecs_to_jiffies
	movl	%eax, %r12d
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_i2c_sirfsoc_set_address
	movq	_SIRFSOC_I2C_CMD_DONE_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	%r14d, %edi
	movq	_SIRFSOC_I2C_ERR_INT_EN@GOTPCREL(%rip), %r15
	orl	(%r15), %edi
	movq	(%r13), %rsi
	addq	8(%rbx), %rsi
	callq	_writel
	movq	%rbx, %rdi
	callq	_i2c_sirfsoc_queue_cmd
	leaq	20(%rbx), %rdi
	movl	%r12d, %esi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_SIRFSOC_I2C_ERR_TIMEOUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	leaq	16(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_2:
	movl	(%r15), %eax
	movq	_SIRFSOC_I2C_CMD_DONE_EN@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	notl	%eax
	andl	%eax, %r14d
	movq	(%r13), %rsi
	addq	8(%rbx), %rsi
	movl	%r14d, %edi
	callq	_writel
	movq	_SIRFSOC_I2C_CMD_START@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%rbx), %rsi
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_writel
	movq	(%rbx), %rax
	movq	_SIRFSOC_I2C_ERR_TIMEOUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.3:
	movq	(%r13), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	_SIRFSOC_I2C_RESET@GOTPCREL(%rip), %r15
	orl	(%r15), %eax
	movq	(%r13), %rsi
	addq	8(%rbx), %rsi
	movl	%eax, %edi
	callq	_writel
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	testl	%eax, (%r15)
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	jmp	LBB0_5
LBB0_6:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	cmpq	$0, (%rbx)
	cmovel	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIRFSOC_I2C_CTRL,8,3           ## @SIRFSOC_I2C_CTRL
	.comm	_SIRFSOC_I2C_CMD_DONE_EN,4,2    ## @SIRFSOC_I2C_CMD_DONE_EN
	.comm	_SIRFSOC_I2C_ERR_INT_EN,4,2     ## @SIRFSOC_I2C_ERR_INT_EN
	.comm	_SIRFSOC_I2C_ERR_TIMEOUT,8,3    ## @SIRFSOC_I2C_ERR_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Transfer timeout\n"

	.comm	_SIRFSOC_I2C_CMD_START,8,3      ## @SIRFSOC_I2C_CMD_START
	.comm	_SIRFSOC_I2C_RESET,4,2          ## @SIRFSOC_I2C_RESET
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_i2c_sirfsoc_xfer_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_sirfsoc_xfer_msg
_i2c_sirfsoc_xfer_msg:                  ; @i2c_sirfsoc_xfer_msg
	.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	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x23, _SIRFSOC_I2C_CTRL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SIRFSOC_I2C_CTRL@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
	mov	x20, x0
	ldr	w8, [x21]
	mov	w9, #50
	mul	w8, w8, w9
	add	w0, w8, #50
	bl	_msecs_to_jiffies
	mov	x22, x0
	mov	x0, x19
	mov	x1, x21
	bl	_i2c_sirfsoc_set_address
Lloh2:
	adrp	x21, _SIRFSOC_I2C_CMD_DONE_EN@GOTPAGE
Lloh3:
	ldr	x21, [x21, _SIRFSOC_I2C_CMD_DONE_EN@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh4:
	adrp	x24, _SIRFSOC_I2C_ERR_INT_EN@GOTPAGE
Lloh5:
	ldr	x24, [x24, _SIRFSOC_I2C_ERR_INT_EN@GOTPAGEOFF]
	orr	w8, w8, w20
	ldr	w9, [x24]
	orr	w0, w8, w9
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	bl	_i2c_sirfsoc_queue_cmd
	add	x0, x19, #20
	mov	x1, x22
	bl	_wait_for_completion_timeout
Lloh6:
	adrp	x22, _SIRFSOC_I2C_ERR_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x22, [x22, _SIRFSOC_I2C_ERR_TIMEOUT@GOTPAGEOFF]
	cbnz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x22]
	mov	x0, x19
	str	x8, [x0], #16
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_2:
	ldr	w8, [x21]
	ldr	w9, [x24]
	orr	w8, w9, w8
	bic	w0, w20, w8
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x19, #8]
Lloh10:
	adrp	x9, _SIRFSOC_I2C_CMD_START@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SIRFSOC_I2C_CMD_START@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writel
	ldr	x8, [x19]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
Lloh13:
	adrp	x20, _SIRFSOC_I2C_RESET@GOTPAGE
Lloh14:
	ldr	x20, [x20, _SIRFSOC_I2C_RESET@GOTPAGEOFF]
	ldr	w8, [x20]
	orr	w0, w8, w0
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x20]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_cpu_relax
	b	LBB0_4
LBB0_6:
	ldr	x8, [x19]
Lloh15:
	adrp	x9, _EAGAIN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _EAGAIN@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	x8, #0
	csneg	w0, wzr, w9, eq
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SIRFSOC_I2C_CTRL,8,3           ; @SIRFSOC_I2C_CTRL
	.comm	_SIRFSOC_I2C_CMD_DONE_EN,4,2    ; @SIRFSOC_I2C_CMD_DONE_EN
	.comm	_SIRFSOC_I2C_ERR_INT_EN,4,2     ; @SIRFSOC_I2C_ERR_INT_EN
	.comm	_SIRFSOC_I2C_ERR_TIMEOUT,8,3    ; @SIRFSOC_I2C_ERR_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Transfer timeout\n"

	.comm	_SIRFSOC_I2C_CMD_START,8,3      ; @SIRFSOC_I2C_CMD_START
	.comm	_SIRFSOC_I2C_RESET,4,2          ; @SIRFSOC_I2C_RESET
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_i2c_sirfsoc_xfer_msg
.subsections_via_symbols
