	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_smc
_read_smc:                              ## @read_smc
	.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
	movl	%ecx, %ebx
	movq	%rdx, %r15
	movq	%rsi, %r14
	callq	_send_command
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_send_argument
	testq	%rax, %rax
	je	LBB0_5
LBB0_2:
	leaq	L_.str(%rip), %rdi
LBB0_3:
	xorl	%r12d, %r12d
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_pr_warn
LBB0_4:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_19:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_APPLESMC_DATA_PORT@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	%ebx, %edi
	callq	_send_byte
	testq	%rax, %rax
	je	LBB0_6
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_3
LBB0_6:
	testl	%ebx, %ebx
	jle	LBB0_12
## %bb.7:
	movl	%ebx, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_wait_read
	testq	%rax, %rax
	jne	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	(%r13), %edi
	callq	_inb
	movl	%eax, (%r15,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_8
LBB0_12:
	movq	_APPLESMC_MIN_WAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_udelay
	movq	_APPLESMC_CMD_PORT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_inb
	xorl	%r12d, %r12d
	movl	$0, %r14d
	movl	$0, %r15d
	testb	$1, %al
	je	LBB0_17
## %bb.13:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	callq	_inb
	movl	%eax, %r15d
	cmpl	$15, %r14d
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	_APPLESMC_MIN_WAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_udelay
	movl	(%rbx), %edi
	callq	_inb
	incl	%r14d
	testb	$1, %al
	jne	LBB0_15
LBB0_17:
	testl	%r14d, %r14d
	jne	LBB0_18
	jmp	LBB0_19
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r12d, %r12d
	movq	%r14, %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_pr_warn
	jmp	LBB0_4
LBB0_16:
	movl	$16, %r14d
LBB0_18:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%r14d, %esi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_pr_warn
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%.4s: read arg fail\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_APPLESMC_DATA_PORT,4,2         ## @APPLESMC_DATA_PORT
L_.str.1:                               ## @.str.1
	.asciz	"%.4s: read len fail\n"

L_.str.2:                               ## @.str.2
	.asciz	"%.4s: read data[%d] fail\n"

	.comm	_APPLESMC_MIN_WAIT,4,2          ## @APPLESMC_MIN_WAIT
	.comm	_APPLESMC_CMD_PORT,4,2          ## @APPLESMC_CMD_PORT
L_.str.3:                               ## @.str.3
	.asciz	"flushed %d bytes, last value is: %d\n"

	.no_dead_strip	_read_smc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_smc
_read_smc:                              ; @read_smc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x3
	mov	x20, x2
	mov	x19, x1
	bl	_send_command
	cbnz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_send_argument
	cbz	x0, LBB0_5
LBB0_2:
	str	x19, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
LBB0_3:
	bl	_pr_warn
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	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
	add	sp, sp, #80
	ret
LBB0_5:
Lloh5:
	adrp	x22, _APPLESMC_DATA_PORT@GOTPAGE
Lloh6:
	ldr	x22, [x22, _APPLESMC_DATA_PORT@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_send_byte
	cbz	x0, LBB0_7
; %bb.6:
	str	x19, [sp]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_7:
	cmp	w21, #1
	b.lt	LBB0_11
; %bb.8:
	mov	x23, #0
	mov	w21, w21
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	bl	_wait_read
	cbnz	x0, LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x22]
	bl	_inb
	str	w0, [x20, x23, lsl #2]
	add	x23, x23, #1
	cmp	x21, x23
	b.ne	LBB0_9
LBB0_11:
Lloh9:
	adrp	x21, _APPLESMC_MIN_WAIT@GOTPAGE
Lloh10:
	ldr	x21, [x21, _APPLESMC_MIN_WAIT@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_udelay
Lloh11:
	adrp	x23, _APPLESMC_CMD_PORT@GOTPAGE
Lloh12:
	ldr	x23, [x23, _APPLESMC_CMD_PORT@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_inb
	mov	w20, #0
	tbnz	w0, #0, LBB0_13
; %bb.12:
	mov	w19, #0
	b	LBB0_15
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x22]
	bl	_inb
	mov	x19, x0
	cmp	w20, #15
	b.eq	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w0, [x21]
	bl	_udelay
	ldr	w0, [x23]
	bl	_inb
	add	w20, w20, #1
	tbnz	w0, #0, LBB0_13
LBB0_15:
	cbnz	w20, LBB0_18
	b	LBB0_19
LBB0_16:
	stp	x19, x23, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_3
LBB0_17:
	mov	w20, #16
LBB0_18:
	stp	x20, x19, [sp]
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_warn
LBB0_19:
	mov	w0, #0
	b	LBB0_4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%.4s: read arg fail\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_APPLESMC_DATA_PORT,4,2         ; @APPLESMC_DATA_PORT
l_.str.1:                               ; @.str.1
	.asciz	"%.4s: read len fail\n"

l_.str.2:                               ; @.str.2
	.asciz	"%.4s: read data[%d] fail\n"

	.comm	_APPLESMC_MIN_WAIT,4,2          ; @APPLESMC_MIN_WAIT
	.comm	_APPLESMC_CMD_PORT,4,2          ; @APPLESMC_CMD_PORT
l_.str.3:                               ; @.str.3
	.asciz	"flushed %d bytes, last value is: %d\n"

	.no_dead_strip	_read_smc
.subsections_via_symbols
