	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mma9551_gpio_config            ## -- Begin function mma9551_gpio_config
	.p2align	4, 0x90
_mma9551_gpio_config:                   ## @mma9551_gpio_config
	.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	%rdi, %r15
	movq	_mma9551_gpio_max@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jae	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_2:
	movl	%ecx, %r13d
	movl	%edx, %ecx
	movl	%esi, %r12d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	leal	(%r12,%r12), %r14d
	movq	_MMA9551_APPID_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_mma9551_write_config_byte
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	_MMA9551_APPID_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	$1, %r14d
	movq	%r15, %rdi
	movl	%r14d, %edx
	movl	%r13d, %ecx
	callq	_mma9551_write_config_byte
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	addl	$-128, %r12d
	movslq	%r12d, %rax
	leaq	l_switch.table.mma9551_gpio_config(%rip), %rcx
	movq	(%rcx,%rax,8), %rdx
	leaq	L_switch.table.mma9551_gpio_config.4(%rip), %rcx
	movl	(%rcx,%rax,4), %ecx
	movl	(%rdx), %edx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	testl	%r8d, %r8d
	cmovnel	%ecx, %r8d
	movq	_MMA9551_APPID_GPIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_mma9551_update_config_bits
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_9
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_8
LBB0_3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_8
LBB0_5:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
LBB0_8:
	movq	%r15, %rdi
	callq	_dev_err
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mma9551_gpio_max,4,2           ## @mma9551_gpio_max
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad GPIO pin\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MMA9551_APPID_GPIO,4,2         ## @MMA9551_APPID_GPIO
L_.str.1:                               ## @.str.1
	.asciz	"error setting GPIO app_id\n"

L_.str.2:                               ## @.str.2
	.asciz	"error setting GPIO bit number\n"

	.comm	_MMA9551_GPIO_POL_LSB,4,2       ## @MMA9551_GPIO_POL_LSB
	.comm	_MMA9551_GPIO_POL_MSB,4,2       ## @MMA9551_GPIO_POL_MSB
L_.str.3:                               ## @.str.3
	.asciz	"error setting GPIO polarity\n"

	.section	__DATA,__const
	.p2align	3                               ## @switch.table.mma9551_gpio_config
l_switch.table.mma9551_gpio_config:
	.quad	_MMA9551_GPIO_POL_MSB
	.quad	_MMA9551_GPIO_POL_MSB
	.quad	_MMA9551_GPIO_POL_LSB
	.quad	_MMA9551_GPIO_POL_LSB

	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ## @switch.table.mma9551_gpio_config.4
L_switch.table.mma9551_gpio_config.4:
	.long	2                               ## 0x2
	.long	1                               ## 0x1
	.long	128                             ## 0x80
	.long	64                              ## 0x40

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mma9551_gpio_config            ; -- Begin function mma9551_gpio_config
	.p2align	2
_mma9551_gpio_config:                   ; @mma9551_gpio_config
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _mma9551_gpio_max@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mma9551_gpio_max@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.hs	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_9
LBB0_2:
	mov	x21, x4
	mov	x23, x3
	mov	x3, x2
	mov	x22, x1
	lsl	w24, w1, #1
Lloh8:
	adrp	x25, _MMA9551_APPID_GPIO@GOTPAGE
Lloh9:
	ldr	x25, [x25, _MMA9551_APPID_GPIO@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	mov	x2, x24
	bl	_mma9551_write_config_byte
	tbnz	w0, #31, LBB0_6
; %bb.3:
	ldr	w1, [x25]
	orr	w2, w24, #0x1
	mov	x0, x19
	mov	x3, x23
	bl	_mma9551_write_config_byte
	tbnz	w0, #31, LBB0_7
; %bb.4:
	sub	w8, w22, #128
Lloh10:
	adrp	x9, l_switch.table.mma9551_gpio_config@PAGE
Lloh11:
	add	x9, x9, l_switch.table.mma9551_gpio_config@PAGEOFF
	ldr	x9, [x9, w8, sxtw #3]
Lloh12:
	adrp	x10, l_switch.table.mma9551_gpio_config.4@PAGE
Lloh13:
	add	x10, x10, l_switch.table.mma9551_gpio_config.4@PAGEOFF
	ldr	w3, [x10, w8, sxtw #2]
	ldr	w2, [x9]
	cmp	w21, #0
	csel	w4, wzr, w3, eq
	ldr	w1, [x25]
	mov	x0, x19
	bl	_mma9551_update_config_bits
	mov	x20, x0
	tbz	w0, #31, LBB0_9
; %bb.5:
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_6:
	mov	x20, x0
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
	mov	x20, x0
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_8:
	mov	x0, x19
	bl	_dev_err
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_mma9551_gpio_max,4,2           ; @mma9551_gpio_max
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad GPIO pin\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MMA9551_APPID_GPIO,4,2         ; @MMA9551_APPID_GPIO
l_.str.1:                               ; @.str.1
	.asciz	"error setting GPIO app_id\n"

l_.str.2:                               ; @.str.2
	.asciz	"error setting GPIO bit number\n"

	.comm	_MMA9551_GPIO_POL_LSB,4,2       ; @MMA9551_GPIO_POL_LSB
	.comm	_MMA9551_GPIO_POL_MSB,4,2       ; @MMA9551_GPIO_POL_MSB
l_.str.3:                               ; @.str.3
	.asciz	"error setting GPIO polarity\n"

	.section	__DATA,__const
	.p2align	3                               ; @switch.table.mma9551_gpio_config
l_switch.table.mma9551_gpio_config:
	.quad	_MMA9551_GPIO_POL_MSB
	.quad	_MMA9551_GPIO_POL_MSB
	.quad	_MMA9551_GPIO_POL_LSB
	.quad	_MMA9551_GPIO_POL_LSB

	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ; @switch.table.mma9551_gpio_config.4
l_switch.table.mma9551_gpio_config.4:
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.long	128                             ; 0x80
	.long	64                              ; 0x40

.subsections_via_symbols
