	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_conversion_complete_gpio
_wait_conversion_complete_gpio:         ## @wait_conversion_complete_gpio
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	16(%rdi), %r14
	movq	_AK8975_MAX_CONVERSION_TIMEOUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.1:
	movq	%rdi, %r15
	movq	_AK8975_CONVERSION_DONE_POLL_TIME@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	callq	_msleep
	movl	8(%r15), %edi
	callq	_gpio_get_value
	testq	%rax, %rax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r12), %rdi
	subq	%rdi, %rbx
	jne	LBB0_2
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_5:
	movq	(%r15), %rax
	movq	(%rax), %rax
	movq	_ST1@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %esi
	movq	%r14, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AK8975_MAX_CONVERSION_TIMEOUT,8,3 ## @AK8975_MAX_CONVERSION_TIMEOUT
	.comm	_AK8975_CONVERSION_DONE_POLL_TIME,8,3 ## @AK8975_CONVERSION_DONE_POLL_TIME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Conversion timeout happened\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ST1,8,3                        ## @ST1
L_.str.1:                               ## @.str.1
	.asciz	"Error in reading ST1\n"

	.no_dead_strip	_wait_conversion_complete_gpio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_conversion_complete_gpio
_wait_conversion_complete_gpio:         ; @wait_conversion_complete_gpio
	.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
	ldr	x19, [x0, #16]
Lloh0:
	adrp	x8, _AK8975_MAX_CONVERSION_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AK8975_MAX_CONVERSION_TIMEOUT@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
	cbz	x21, LBB0_4
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x22, _AK8975_CONVERSION_DONE_POLL_TIME@GOTPAGE
Lloh4:
	ldr	x22, [x22, _AK8975_CONVERSION_DONE_POLL_TIME@GOTPAGEOFF]
	ldr	x0, [x22]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	bl	_msleep
	ldr	w0, [x20, #8]
	bl	_gpio_get_value
	cbnz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x0, [x22]
	subs	x21, x21, x0
	b.ne	LBB0_2
LBB0_4:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_7
LBB0_5:
	ldr	x8, [x20]
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _ST1@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ST1@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	ldr	w1, [x8, x9, lsl #2]
	mov	x0, x19
	bl	_i2c_smbus_read_byte_data
	mov	x20, x0
	tbz	w0, #31, LBB0_7
; %bb.6:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_7:
	mov	x0, x20
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_AK8975_MAX_CONVERSION_TIMEOUT,8,3 ; @AK8975_MAX_CONVERSION_TIMEOUT
	.comm	_AK8975_CONVERSION_DONE_POLL_TIME,8,3 ; @AK8975_CONVERSION_DONE_POLL_TIME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Conversion timeout happened\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ST1,8,3                        ; @ST1
l_.str.1:                               ; @.str.1
	.asciz	"Error in reading ST1\n"

	.no_dead_strip	_wait_conversion_complete_gpio
.subsections_via_symbols
