	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amd_ec_read
_amd_ec_read:                           ## @amd_ec_read
	.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	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_amd_ec_wait_write
	testl	%eax, %eax
	jne	LBB0_4
## %bb.1:
	movq	_AMD_EC_CMD_RD@GOTPCREL(%rip), %rax
	movzbl	(%rax), %edi
	movq	_AMD_EC_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%rbx), %rsi
	callq	_outb
	movq	%rbx, %rdi
	callq	_amd_ec_wait_write
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movq	_AMD_EC_DATA@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	addq	(%rbx), %rsi
	movzbl	%r15b, %edi
	callq	_outb
	movq	%rbx, %rdi
	callq	_amd_ec_wait_read
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	(%r12), %rdi
	addq	(%rbx), %rdi
	callq	_inb
	movb	%al, (%r14)
	xorl	%eax, %eax
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMD_EC_CMD_RD,1,0              ## @AMD_EC_CMD_RD
	.comm	_AMD_EC_CMD,8,3                 ## @AMD_EC_CMD
	.comm	_AMD_EC_DATA,8,3                ## @AMD_EC_DATA
	.no_dead_strip	_amd_ec_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amd_ec_read
_amd_ec_read:                           ; @amd_ec_read
	.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
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	bl	_amd_ec_wait_write
	cbnz	w0, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _AMD_EC_CMD_RD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMD_EC_CMD_RD@GOTPAGEOFF]
	ldrb	w0, [x8]
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _AMD_EC_CMD@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AMD_EC_CMD@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_outb
	mov	x0, x20
	bl	_amd_ec_wait_write
	cbnz	w0, LBB0_4
; %bb.2:
	ldr	x8, [x20]
Lloh5:
	adrp	x22, _AMD_EC_DATA@GOTPAGE
Lloh6:
	ldr	x22, [x22, _AMD_EC_DATA@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x1, x9, x8
	mov	x0, x21
	bl	_outb
	mov	x0, x20
	bl	_amd_ec_wait_read
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_inb
	mov	x8, x0
	mov	w0, #0
	strb	w8, [x19]
LBB0_4:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_AMD_EC_CMD_RD,1,0              ; @AMD_EC_CMD_RD
	.comm	_AMD_EC_CMD,8,3                 ; @AMD_EC_CMD
	.comm	_AMD_EC_DATA,8,3                ; @AMD_EC_DATA
	.no_dead_strip	_amd_ec_read
.subsections_via_symbols
