	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function as5011_configure_chip
_as5011_configure_chip:                 ## @as5011_configure_chip
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	(%rdi), %r14
	movq	_AS5011_CTRL1@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_AS5011_CTRL1_SOFT_RST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_as5011_i2c_write
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movl	$10, %edi
	callq	_mdelay
	movq	_AS5011_CTRL1_LP_PULSED@GOTPCREL(%rip), %rax
	movq	_AS5011_CTRL1_LP_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	(%r12), %esi
	movq	_AS5011_CTRL1_INT_ACT_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_as5011_i2c_write
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	_AS5011_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AS5011_CTRL2_INV_SPINNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_as5011_i2c_write
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movq	_AS5011_XP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_as5011_i2c_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movq	_AS5011_XN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	movq	%r14, %rdi
	callq	_as5011_i2c_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.10:
	movq	_AS5011_YP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r15), %edx
	movq	%r14, %rdi
	callq	_as5011_i2c_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.11:
	movq	_AS5011_YN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%r15), %edx
	movq	%r14, %rdi
	callq	_as5011_i2c_write
	testl	%eax, %eax
	js	LBB0_8
## %bb.12:
	movq	_AS5011_X_RES_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-33(%rbp), %rdx
	movq	%r14, %rdi
	callq	_as5011_i2c_read
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jns	LBB0_14
## %bb.13:
	movl	%eax, %r15d
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movl	%r15d, %ebx
	jmp	LBB0_14
LBB0_1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_8:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_2
LBB0_6:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
LBB0_2:
	movq	%r14, %rdi
	callq	_dev_err
LBB0_14:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AS5011_CTRL1,4,2               ## @AS5011_CTRL1
	.comm	_AS5011_CTRL1_SOFT_RST,4,2      ## @AS5011_CTRL1_SOFT_RST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Soft reset failed\n"

	.comm	_AS5011_CTRL1_LP_PULSED,4,2     ## @AS5011_CTRL1_LP_PULSED
	.comm	_AS5011_CTRL1_LP_ACTIVE,4,2     ## @AS5011_CTRL1_LP_ACTIVE
	.comm	_AS5011_CTRL1_INT_ACT_EN,4,2    ## @AS5011_CTRL1_INT_ACT_EN
L_.str.1:                               ## @.str.1
	.asciz	"Power config failed\n"

	.comm	_AS5011_CTRL2,4,2               ## @AS5011_CTRL2
	.comm	_AS5011_CTRL2_INV_SPINNING,4,2  ## @AS5011_CTRL2_INV_SPINNING
L_.str.2:                               ## @.str.2
	.asciz	"Can't invert spinning\n"

	.comm	_AS5011_XP,4,2                  ## @AS5011_XP
L_.str.3:                               ## @.str.3
	.asciz	"Can't write threshold\n"

	.comm	_AS5011_XN,4,2                  ## @AS5011_XN
	.comm	_AS5011_YP,4,2                  ## @AS5011_YP
	.comm	_AS5011_YN,4,2                  ## @AS5011_YN
	.comm	_AS5011_X_RES_INT,4,2           ## @AS5011_X_RES_INT
L_.str.4:                               ## @.str.4
	.asciz	"Can't read i2c X resolution value\n"

	.no_dead_strip	_as5011_configure_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function as5011_configure_chip
_as5011_configure_chip:                 ; @as5011_configure_chip
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x1
	ldr	x19, [x0]
Lloh0:
	adrp	x22, _AS5011_CTRL1@GOTPAGE
Lloh1:
	ldr	x22, [x22, _AS5011_CTRL1@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x8, _AS5011_CTRL1_SOFT_RST@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AS5011_CTRL1_SOFT_RST@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_as5011_i2c_write
	tbnz	w0, #31, LBB0_9
; %bb.1:
	mov	w0, #10
	bl	_mdelay
	ldr	w1, [x22]
Lloh5:
	adrp	x8, _AS5011_CTRL1_LP_PULSED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AS5011_CTRL1_LP_PULSED@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _AS5011_CTRL1_LP_ACTIVE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _AS5011_CTRL1_LP_ACTIVE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh11:
	adrp	x9, _AS5011_CTRL1_INT_ACT_EN@GOTPAGE
Lloh12:
	ldr	x9, [x9, _AS5011_CTRL1_INT_ACT_EN@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_as5011_i2c_write
	tbnz	w0, #31, LBB0_10
; %bb.2:
Lloh14:
	adrp	x8, _AS5011_CTRL2@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AS5011_CTRL2@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _AS5011_CTRL2_INV_SPINNING@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AS5011_CTRL2_INV_SPINNING@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_as5011_i2c_write
	tbnz	w0, #31, LBB0_12
; %bb.3:
Lloh20:
	adrp	x8, _AS5011_XP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AS5011_XP@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_as5011_i2c_write
	tbnz	w0, #31, LBB0_11
; %bb.4:
Lloh23:
	adrp	x8, _AS5011_XN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AS5011_XN@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldr	w2, [x21, #4]
	mov	x0, x19
	bl	_as5011_i2c_write
	tbnz	w0, #31, LBB0_11
; %bb.5:
Lloh26:
	adrp	x8, _AS5011_YP@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AS5011_YP@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	ldr	w2, [x21, #8]
	mov	x0, x19
	bl	_as5011_i2c_write
	tbnz	w0, #31, LBB0_11
; %bb.6:
Lloh29:
	adrp	x8, _AS5011_YN@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AS5011_YN@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	ldr	w2, [x21, #12]
	mov	x0, x19
	bl	_as5011_i2c_write
	tbnz	w0, #31, LBB0_11
; %bb.7:
Lloh32:
	adrp	x8, _AS5011_X_RES_INT@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AS5011_X_RES_INT@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	add	x2, sp, #15
	mov	x0, x19
	bl	_as5011_i2c_read
	tbnz	w0, #31, LBB0_15
; %bb.8:
	mov	w20, #0
	b	LBB0_14
LBB0_9:
	mov	x20, x0
Lloh35:
	adrp	x1, l_.str@PAGE
Lloh36:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_13
LBB0_10:
	mov	x20, x0
Lloh37:
	adrp	x1, l_.str.1@PAGE
Lloh38:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_11:
	mov	x20, x0
Lloh39:
	adrp	x1, l_.str.3@PAGE
Lloh40:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_13
LBB0_12:
	mov	x20, x0
Lloh41:
	adrp	x1, l_.str.2@PAGE
Lloh42:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_13:
	mov	x0, x19
	bl	_dev_err
LBB0_14:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
LBB0_15:
	mov	x20, x0
Lloh43:
	adrp	x1, l_.str.4@PAGE
Lloh44:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_AS5011_CTRL1,4,2               ; @AS5011_CTRL1
	.comm	_AS5011_CTRL1_SOFT_RST,4,2      ; @AS5011_CTRL1_SOFT_RST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Soft reset failed\n"

	.comm	_AS5011_CTRL1_LP_PULSED,4,2     ; @AS5011_CTRL1_LP_PULSED
	.comm	_AS5011_CTRL1_LP_ACTIVE,4,2     ; @AS5011_CTRL1_LP_ACTIVE
	.comm	_AS5011_CTRL1_INT_ACT_EN,4,2    ; @AS5011_CTRL1_INT_ACT_EN
l_.str.1:                               ; @.str.1
	.asciz	"Power config failed\n"

	.comm	_AS5011_CTRL2,4,2               ; @AS5011_CTRL2
	.comm	_AS5011_CTRL2_INV_SPINNING,4,2  ; @AS5011_CTRL2_INV_SPINNING
l_.str.2:                               ; @.str.2
	.asciz	"Can't invert spinning\n"

	.comm	_AS5011_XP,4,2                  ; @AS5011_XP
l_.str.3:                               ; @.str.3
	.asciz	"Can't write threshold\n"

	.comm	_AS5011_XN,4,2                  ; @AS5011_XN
	.comm	_AS5011_YP,4,2                  ; @AS5011_YP
	.comm	_AS5011_YN,4,2                  ; @AS5011_YN
	.comm	_AS5011_X_RES_INT,4,2           ; @AS5011_X_RES_INT
l_.str.4:                               ; @.str.4
	.asciz	"Can't read i2c X resolution value\n"

	.no_dead_strip	_as5011_configure_chip
.subsections_via_symbols
