	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opal_i2c_transfer
_opal_i2c_transfer:                     ## @opal_i2c_transfer
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r12
	callq	_device_get_softc
	movq	%rax, %r14
	leaq	-56(%rbp), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	%r14, %rdi
	callq	_I2C_LOCK
	testl	%r15d, %r15d
	jle	LBB0_6
## %bb.1:
	movl	%r15d, %eax
	shlq	$3, %rax
	leaq	(%rax,%rax,2), %r13
	xorl	%r15d, %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	4(%r12,%r15), %edi
	sarl	%edi
	callq	_htobe16
	movl	%eax, -48(%rbp)
	movl	16(%r12,%r15), %edi
	callq	_htobe32
	movl	%eax, -52(%rbp)
	movl	8(%r12,%r15), %edi
	callq	_pmap_kextract
	movl	%eax, %edi
	callq	_htobe64
	movl	%eax, -56(%rbp)
	movl	(%r14), %edi
	leaq	-56(%rbp), %rsi
	callq	_i2c_opal_send_request
	addq	$24, %r15
	cmpq	%r15, %r13
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_IIC_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_OPAL_I2C_RAW_READ@GOTPCREL(%rip), %rax
	andl	(%r12,%r15), %ecx
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_OPAL_I2C_RAW_WRITE@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_5:
	movl	%eax, %ebx
LBB0_6:
	movq	%r14, %rdi
	callq	_I2C_UNLOCK
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IIC_M_RD,4,2                   ## @IIC_M_RD
	.comm	_OPAL_I2C_RAW_READ,4,2          ## @OPAL_I2C_RAW_READ
	.comm	_OPAL_I2C_RAW_WRITE,4,2         ## @OPAL_I2C_RAW_WRITE
	.no_dead_strip	_opal_i2c_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opal_i2c_transfer
_opal_i2c_transfer:                     ; @opal_i2c_transfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x2
	mov	x21, x1
	bl	_device_get_softc
	mov	x19, x0
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	mov	x0, x19
	bl	_I2C_LOCK
	cmp	w20, #1
	b.lt	LBB0_4
; %bb.1:
Lloh0:
	adrp	x22, _IIC_M_RD@GOTPAGE
Lloh1:
	ldr	x22, [x22, _IIC_M_RD@GOTPAGEOFF]
	add	x21, x21, #8
Lloh2:
	adrp	x23, _OPAL_I2C_RAW_READ@GOTPAGE
Lloh3:
	ldr	x23, [x23, _OPAL_I2C_RAW_READ@GOTPAGEOFF]
Lloh4:
	adrp	x24, _OPAL_I2C_RAW_WRITE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _OPAL_I2C_RAW_WRITE@GOTPAGEOFF]
	mov	w25, w20
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22]
	ldp	w9, w10, [x21, #-8]
	tst	w8, w9
	csel	x8, x24, x23, eq
	ldr	w8, [x8]
	str	w8, [sp, #12]
	asr	w0, w10, #1
	bl	_htobe16
	str	w0, [sp, #8]
	ldr	w0, [x21, #8]
	bl	_htobe32
	str	w0, [sp, #4]
	ldr	w0, [x21], #24
	bl	_pmap_kextract
	bl	_htobe64
	str	w0, [sp]
	ldr	w0, [x19]
	mov	x1, sp
	bl	_i2c_opal_send_request
	subs	x25, x25, #1
	b.ne	LBB0_2
; %bb.3:
	mov	x20, x0
	b	LBB0_5
LBB0_4:
	mov	w20, #0
LBB0_5:
	mov	x0, x19
	bl	_I2C_UNLOCK
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_IIC_M_RD,4,2                   ; @IIC_M_RD
	.comm	_OPAL_I2C_RAW_READ,4,2          ; @OPAL_I2C_RAW_READ
	.comm	_OPAL_I2C_RAW_WRITE,4,2         ; @OPAL_I2C_RAW_WRITE
	.no_dead_strip	_opal_i2c_transfer
.subsections_via_symbols
