	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rtl8366_smi_read_bits
_rtl8366_smi_read_bits:                 ## @rtl8366_smi_read_bits
	.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	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	(%rdi), %r15d
	movl	4(%rdi), %r13d
	movl	%r15d, %edi
	callq	_gpio_direction_input
	movq	$0, (%r14)
	testq	%r12, %r12
	jle	LBB0_3
## %bb.1:
	incq	%r12
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_rtl8366_smi_clk_delay
	movl	%r13d, %edi
	movl	$1, %esi
	callq	_gpio_set_value
	movq	%rbx, %rdi
	callq	_rtl8366_smi_clk_delay
	movl	%r15d, %edi
	callq	_gpio_get_value
	movq	%r14, %r15
	xorl	%r14d, %r14d
	testl	%eax, %eax
	setne	%r14b
	movl	%r13d, %edi
	xorl	%esi, %esi
	callq	_gpio_set_value
	leal	-2(%r12), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %r14
	orq	%r14, (%r15)
	movq	%r15, %r14
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	decq	%r12
	cmpq	$1, %r12
	ja	LBB0_2
LBB0_3:
	movl	%r15d, %edi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gpio_direction_output          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_rtl8366_smi_read_bits
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rtl8366_smi_read_bits
_rtl8366_smi_read_bits:                 ; @rtl8366_smi_read_bits
	.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	x19, x2
	mov	x23, x1
	mov	x21, x0
	ldp	w20, w22, [x0]
	mov	x0, x20
	bl	_gpio_direction_input
	str	xzr, [x19]
	cmp	x23, #1
	b.lt	LBB0_3
; %bb.1:
	add	x23, x23, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_rtl8366_smi_clk_delay
	mov	x0, x22
	mov	w1, #1
	bl	_gpio_set_value
	mov	x0, x21
	bl	_rtl8366_smi_clk_delay
	mov	x0, x20
	bl	_gpio_get_value
	cmp	w0, #0
	cset	w24, ne
	mov	x0, x22
	mov	w1, #0
	bl	_gpio_set_value
	sub	x8, x23, #2
	lsl	x8, x24, x8
	ldr	x9, [x19]
	orr	x8, x8, x9
	str	x8, [x19]
	sub	x23, x23, #1
	cmp	x23, #1
	b.hi	LBB0_2
LBB0_3:
	mov	x0, x20
	mov	w1, #0
	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
	b	_gpio_direction_output
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_rtl8366_smi_read_bits
.subsections_via_symbols
