	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mma9551_transfer
_mma9551_transfer:                      ## @mma9551_transfer
	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r9d killed $r9d def $r9
	movq	%rdi, %r12
	cmpl	$4096, %ecx                     ## imm = 0x1000
	jl	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_21:
	subl	(%rax), %ebx
	jmp	LBB0_22
LBB0_3:
	movl	%esi, %r14d
	movl	24(%rbp), %esi
	movq	_MMA9551_MAILBOX_CTRL_REGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%r9,%rax), %ebx
	incl	%ebx
	movq	$0, -80(%rbp)
	movl	%r14d, -104(%rbp)
	movl	%ecx, %eax
	sarl	$8, %eax
	orl	%edx, %eax
	movl	%eax, -100(%rbp)
	movl	%ecx, -96(%rbp)
	movq	_MMA9551_CMD_WRITE_CONFIG@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	movl	%esi, %eax
	cmovel	%r9d, %eax
	movl	%eax, -92(%rbp)
	testl	%r9d, %r9d
	je	LBB0_5
## %bb.4:
	movq	%r8, %rsi
	movl	%r9d, %edx
	callq	_memcpy
LBB0_5:
	movl	8(%r12), %eax
	movl	%eax, -112(%rbp)
	movq	$0, -120(%rbp)
	movl	%ebx, -136(%rbp)
	leaq	-104(%rbp), %rax
	movq	%rax, -128(%rbp)
	movl	4(%r12), %edi
	leaq	-136(%rbp), %rsi
	movl	$1, %r13d
	movl	$1, %edx
	callq	_i2c_transfer
	testl	%eax, %eax
	js	LBB0_17
## %bb.6:
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movq	_MMA9551_I2C_READ_RETRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%r15d, %r15d
	cmovlel	%r15d, %r13d
	decl	%r13d
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	leaq	-168(%rbp), %r13
	movq	_MMA9551_RESPONSE_COCO@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MMA9551_I2C_READ_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_udelay
	movl	8(%r12), %eax
	movl	%eax, -144(%rbp)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -152(%rbp)
	movl	$24, -168(%rbp)
	leaq	-72(%rbp), %rax
	movq	%rax, -160(%rbp)
	movl	4(%r12), %edi
	movq	%r13, %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	testl	%eax, %eax
	js	LBB0_18
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	-72(%rbp), %edx
	movl	(%r14), %esi
	testl	%edx, %esi
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	leal	-1(%r15), %eax
	cmpl	$1, %r15d
	movl	%eax, %r15d
	jg	LBB0_7
## %bb.10:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r15d
LBB0_11:
	testl	%r15d, %r15d
	je	LBB0_20
## %bb.12:
	movl	-68(%rbp), %eax
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, %eax
	jne	LBB0_23
## %bb.13:
	notl	%esi
	andl	%esi, %edx
	movq	_MMA9551_MCI_ERROR_NONE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_25
## %bb.14:
	movl	-64(%rbp), %edx
	movl	-60(%rbp), %ecx
	cmpl	%ecx, %edx
	jne	LBB0_26
## %bb.15:
	xorl	%ebx, %ebx
	movl	24(%rbp), %edx
	testl	%edx, %edx
	je	LBB0_22
## %bb.16:
	movq	-56(%rbp), %rsi
	movq	16(%rbp), %rdi
	callq	_memcpy
	jmp	LBB0_22
LBB0_17:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_19
LBB0_18:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
LBB0_19:
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_22:
	movl	%ebx, %eax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_23:
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	%eax, %edx
LBB0_24:
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_2
LBB0_25:
	leaq	L_.str.5(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_2
LBB0_26:
	leaq	L_.str.6(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"register offset too large\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MMA9551_MAILBOX_CTRL_REGS,4,2  ## @MMA9551_MAILBOX_CTRL_REGS
	.comm	_MMA9551_CMD_WRITE_CONFIG,4,2   ## @MMA9551_CMD_WRITE_CONFIG
L_.str.1:                               ## @.str.1
	.asciz	"i2c write failed\n"

	.comm	_MMA9551_I2C_READ_RETRIES,4,2   ## @MMA9551_I2C_READ_RETRIES
	.comm	_MMA9551_I2C_READ_DELAY,4,2     ## @MMA9551_I2C_READ_DELAY
	.comm	_I2C_M_RD,8,3                   ## @I2C_M_RD
L_.str.2:                               ## @.str.2
	.asciz	"i2c read failed\n"

	.comm	_MMA9551_RESPONSE_COCO,4,2      ## @MMA9551_RESPONSE_COCO
L_.str.3:                               ## @.str.3
	.asciz	"timed out while waiting for command response\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.4:                               ## @.str.4
	.asciz	"app_id mismatch in response got %02x expected %02x\n"

	.comm	_MMA9551_MCI_ERROR_NONE,4,2     ## @MMA9551_MCI_ERROR_NONE
L_.str.5:                               ## @.str.5
	.asciz	"read returned error %x\n"

L_.str.6:                               ## @.str.6
	.asciz	"output length mismatch got %d expected %d\n"

	.no_dead_strip	_mma9551_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mma9551_transfer
_mma9551_transfer:                      ; @mma9551_transfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #256
	.cfi_def_cfa_offset 256
	stp	x28, x27, [sp, #160]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #176]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #192]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #208]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #224]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #240]            ; 16-byte Folded Spill
	add	x29, sp, #240
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	cmp	w3, #1, lsl #12                 ; =4096
	b.lt	LBB0_4
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	bl	_dev_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_22
LBB0_4:
	mov	x20, x7
	mov	x24, x6
	mov	x22, x1
Lloh4:
	adrp	x8, _MMA9551_MAILBOX_CTRL_REGS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MMA9551_MAILBOX_CTRL_REGS@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	add	w8, w5, w8
	add	w21, w8, #1
	str	xzr, [sp, #144]
	orr	w8, w2, w3, asr #8
Lloh7:
	adrp	x9, _MMA9551_CMD_WRITE_CONFIG@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MMA9551_CMD_WRITE_CONFIG@GOTPAGEOFF]
	stp	w1, w8, [sp, #120]
Lloh9:
	ldr	w8, [x9]
	cmp	w8, w2
	csel	w8, w5, w7, eq
	stp	w3, w8, [sp, #128]
	cbz	w5, LBB0_6
; %bb.5:
	mov	x1, x4
	mov	x2, x5
	bl	_memcpy
LBB0_6:
	ldp	w0, w8, [x19, #4]
	str	w8, [sp, #56]
	str	w21, [sp, #32]
	add	x8, sp, #120
	stp	x8, xzr, [sp, #40]
	add	x1, sp, #32
	mov	w2, #1
	bl	_i2c_transfer
	tbnz	w0, #31, LBB0_19
; %bb.7:
	str	x24, [sp, #16]                  ; 8-byte Folded Spill
Lloh10:
	adrp	x8, _MMA9551_I2C_READ_RETRIES@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MMA9551_I2C_READ_RETRIES@GOTPAGEOFF]
Lloh12:
	ldr	w24, [x8]
	cmp	w24, #1
	csinc	w8, w24, wzr, lt
	sub	w8, w8, #1
	str	w8, [sp, #28]                   ; 4-byte Folded Spill
Lloh13:
	adrp	x26, _MMA9551_I2C_READ_DELAY@GOTPAGE
Lloh14:
	ldr	x26, [x26, _MMA9551_I2C_READ_DELAY@GOTPAGEOFF]
Lloh15:
	adrp	x27, _I2C_M_RD@GOTPAGE
Lloh16:
	ldr	x27, [x27, _I2C_M_RD@GOTPAGEOFF]
	mov	w28, #24
	add	x25, sp, #96
Lloh17:
	adrp	x21, _MMA9551_RESPONSE_COCO@GOTPAGE
Lloh18:
	ldr	x21, [x21, _MMA9551_RESPONSE_COCO@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x26]
	bl	_udelay
	ldp	w0, w8, [x19, #4]
	str	w8, [sp, #88]
	ldr	x8, [x27]
	str	w28, [sp, #64]
	stp	x25, x8, [sp, #72]
	add	x1, sp, #64
	mov	w2, #1
	bl	_i2c_transfer
	tbnz	w0, #31, LBB0_20
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [sp, #96]
	ldr	w9, [x21]
	tst	w9, w8
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	subs	w24, w24, #1
	b.gt	LBB0_8
; %bb.11:
	ldr	w24, [sp, #28]                  ; 4-byte Folded Reload
LBB0_12:
	cbz	w24, LBB0_23
; %bb.13:
	ldr	w10, [sp, #100]
	cmp	w10, w22
	b.ne	LBB0_24
; %bb.14:
	bic	w8, w8, w9
Lloh19:
	adrp	x9, _MMA9551_MCI_ERROR_NONE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MMA9551_MCI_ERROR_NONE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_25
; %bb.15:
	ldp	w8, w9, [sp, #104]
	cmp	w8, w9
	b.ne	LBB0_26
; %bb.16:
	cbz	w20, LBB0_18
; %bb.17:
	ldr	x1, [sp, #112]
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	mov	x2, x20
	bl	_memcpy
LBB0_18:
	mov	w23, #0
	b	LBB0_22
LBB0_19:
	mov	x23, x0
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_21
LBB0_20:
	mov	x23, x0
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_21:
	mov	x0, x19
	bl	_dev_err
LBB0_22:
	mov	x0, x23
	ldp	x29, x30, [sp, #240]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #224]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #208]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #192]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #176]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #160]            ; 16-byte Folded Reload
	add	sp, sp, #256
	ret
LBB0_23:
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh28:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_3
LBB0_24:
	stp	x10, x22, [sp]
Lloh30:
	adrp	x1, l_.str.4@PAGE
Lloh31:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_2
LBB0_25:
	str	x8, [sp]
Lloh32:
	adrp	x1, l_.str.5@PAGE
Lloh33:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_2
LBB0_26:
	stp	x8, x9, [sp]
Lloh34:
	adrp	x1, l_.str.6@PAGE
Lloh35:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"register offset too large\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MMA9551_MAILBOX_CTRL_REGS,4,2  ; @MMA9551_MAILBOX_CTRL_REGS
	.comm	_MMA9551_CMD_WRITE_CONFIG,4,2   ; @MMA9551_CMD_WRITE_CONFIG
l_.str.1:                               ; @.str.1
	.asciz	"i2c write failed\n"

	.comm	_MMA9551_I2C_READ_RETRIES,4,2   ; @MMA9551_I2C_READ_RETRIES
	.comm	_MMA9551_I2C_READ_DELAY,4,2     ; @MMA9551_I2C_READ_DELAY
	.comm	_I2C_M_RD,8,3                   ; @I2C_M_RD
l_.str.2:                               ; @.str.2
	.asciz	"i2c read failed\n"

	.comm	_MMA9551_RESPONSE_COCO,4,2      ; @MMA9551_RESPONSE_COCO
l_.str.3:                               ; @.str.3
	.asciz	"timed out while waiting for command response\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.4:                               ; @.str.4
	.asciz	"app_id mismatch in response got %02x expected %02x\n"

	.comm	_MMA9551_MCI_ERROR_NONE,4,2     ; @MMA9551_MCI_ERROR_NONE
l_.str.5:                               ; @.str.5
	.asciz	"read returned error %x\n"

l_.str.6:                               ; @.str.6
	.asciz	"output length mismatch got %d expected %d\n"

	.no_dead_strip	_mma9551_transfer
.subsections_via_symbols
