	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_opal_master_xfer
_i2c_opal_master_xfer:                  ## @i2c_opal_master_xfer
	.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
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	(%rdi), %r14
	leaq	-72(%rbp), %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	cmpl	$2, %r15d
	je	LBB0_6
## %bb.1:
	cmpl	$1, %r15d
	jne	LBB0_20
## %bb.2:
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r12), %eax
	jne	LBB0_3
## %bb.4:
	movq	_OPAL_I2C_RAW_WRITE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_6:
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	24(%r12), %eax
	jne	LBB0_7
## %bb.8:
	movq	_OPAL_I2C_SM_WRITE@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_3:
	movq	_OPAL_I2C_RAW_READ@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movl	16(%r12), %edi
	callq	_cpu_to_be16
	movq	%rax, -48(%rbp)
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_7:
	movq	_OPAL_I2C_SM_READ@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movl	16(%r12), %edi
	callq	_cpu_to_be16
	movq	%rax, -48(%rbp)
	movl	4(%r12), %edx
	movl	%edx, -72(%rbp)
	testl	%edx, %edx
	jle	LBB0_10
## %bb.11:
	movq	8(%r12), %rcx
	movl	-68(%rbp), %edi
	leaq	-1(%rdx), %rsi
	movl	%edx, %eax
	andl	$3, %eax
	cmpq	$3, %rsi
	jae	LBB0_13
## %bb.12:
	xorl	%esi, %esi
	jmp	LBB0_15
LBB0_10:
	movl	-68(%rbp), %edi
	jmp	LBB0_18
LBB0_13:
	andl	$-4, %edx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	shll	$8, %edi
	orl	(%rcx,%rsi,4), %edi
	movl	%edi, -68(%rbp)
	shll	$8, %edi
	orl	4(%rcx,%rsi,4), %edi
	movl	%edi, -68(%rbp)
	shll	$8, %edi
	orl	8(%rcx,%rsi,4), %edi
	movl	%edi, -68(%rbp)
	shll	$8, %edi
	orl	12(%rcx,%rsi,4), %edi
	movl	%edi, -68(%rbp)
	addq	$4, %rsi
	cmpq	%rsi, %rdx
	jne	LBB0_14
LBB0_15:
	testq	%rax, %rax
	je	LBB0_18
## %bb.16:
	leaq	(%rcx,%rsi,4), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	shll	$8, %edi
	orl	(%rcx,%rdx,4), %edi
	movl	%edi, -68(%rbp)
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_17
LBB0_18:
	callq	_cpu_to_be32
	movl	%eax, -68(%rbp)
	movl	$1, %eax
LBB0_19:
	leaq	(%rax,%rax,2), %rbx
	movl	4(%r12,%rbx,8), %edi
	callq	_cpu_to_be32
	movq	%rax, -56(%rbp)
	movq	8(%r12,%rbx,8), %rdi
	callq	___pa
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	%rax, -64(%rbp)
LBB0_20:
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_i2c_opal_send_request
	testl	%eax, %eax
	cmovel	%r15d, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_OPAL_I2C_RAW_READ,4,2          ## @OPAL_I2C_RAW_READ
	.comm	_OPAL_I2C_RAW_WRITE,4,2         ## @OPAL_I2C_RAW_WRITE
	.comm	_OPAL_I2C_SM_READ,4,2           ## @OPAL_I2C_SM_READ
	.comm	_OPAL_I2C_SM_WRITE,4,2          ## @OPAL_I2C_SM_WRITE
	.no_dead_strip	_i2c_opal_master_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_opal_master_xfer
_i2c_opal_master_xfer:                  ; @i2c_opal_master_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x2
	mov	x21, x1
	ldr	x20, [x0]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	cmp	w19, #2
	b.eq	LBB0_3
; %bb.1:
	cmp	w19, #1
	b.ne	LBB0_9
; %bb.2:
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh2:
	adrp	x10, _OPAL_I2C_RAW_READ@GOTPAGE
Lloh3:
	ldr	x10, [x10, _OPAL_I2C_RAW_READ@GOTPAGEOFF]
Lloh4:
	adrp	x11, _OPAL_I2C_RAW_WRITE@GOTPAGE
Lloh5:
	ldr	x11, [x11, _OPAL_I2C_RAW_WRITE@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w8, [x8]
	str	w8, [sp, #40]
	ldr	w0, [x21, #16]
	bl	_cpu_to_be16
	mov	x8, #0
	str	x0, [sp, #32]
	b	LBB0_8
LBB0_3:
	ldr	w8, [x21, #24]
Lloh7:
	adrp	x9, _I2C_M_RD@GOTPAGE
Lloh8:
	ldr	x9, [x9, _I2C_M_RD@GOTPAGEOFF]
Lloh9:
	adrp	x10, _OPAL_I2C_SM_READ@GOTPAGE
Lloh10:
	ldr	x10, [x10, _OPAL_I2C_SM_READ@GOTPAGEOFF]
Lloh11:
	adrp	x11, _OPAL_I2C_SM_WRITE@GOTPAGE
Lloh12:
	ldr	x11, [x11, _OPAL_I2C_SM_WRITE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w8, [x8]
	str	w8, [sp, #40]
	ldr	w0, [x21, #16]
	bl	_cpu_to_be16
	str	x0, [sp, #32]
	ldr	w8, [x21, #4]
	str	w8, [sp, #8]
	cmp	w8, #0
	b.le	LBB0_6
; %bb.4:
	ldr	x9, [x21, #8]
	ldr	w0, [sp, #12]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9], #4
	orr	w0, w10, w0, lsl #8
	str	w0, [sp, #12]
	subs	x8, x8, #1
	b.ne	LBB0_5
	b	LBB0_7
LBB0_6:
	ldr	w0, [sp, #12]
LBB0_7:
	bl	_cpu_to_be32
	str	w0, [sp, #12]
	mov	w8, #1
LBB0_8:
	mov	w9, #24
	madd	x21, x8, x9, x21
	ldr	w0, [x21, #4]
	bl	_cpu_to_be32
	str	x0, [sp, #24]
	ldr	x0, [x21, #8]
	bl	___pa
	bl	_cpu_to_be64
	str	x0, [sp, #16]
LBB0_9:
	add	x1, sp, #8
	mov	x0, x20
	bl	_i2c_opal_send_request
	cmp	w0, #0
	csel	w0, w19, w0, eq
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_OPAL_I2C_RAW_READ,4,2          ; @OPAL_I2C_RAW_READ
	.comm	_OPAL_I2C_RAW_WRITE,4,2         ; @OPAL_I2C_RAW_WRITE
	.comm	_OPAL_I2C_SM_READ,4,2           ; @OPAL_I2C_SM_READ
	.comm	_OPAL_I2C_SM_WRITE,4,2          ; @OPAL_I2C_SM_WRITE
	.no_dead_strip	_i2c_opal_master_xfer
.subsections_via_symbols
