	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function img_i2c_atomic_op
_img_i2c_atomic_op:                     ## @img_i2c_atomic_op
	.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
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	%esi, (%rdi)
	movl	%edx, 4(%rdi)
	movq	_CMD_GEN_DATA@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_5
## %bb.1:
	movq	8(%r15), %rax
	movq	_MODE_ATOMIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.2:
	movq	_SCB_STATUS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_img_i2c_readl
	testb	$-128, %r14b
	jne	LBB0_5
## %bb.3:
	movq	_LINESTAT_SDAT_LINE_STATUS@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	je	LBB0_5
## %bb.4:
	movq	_MODE_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_img_i2c_switch_mode
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_img_i2c_raw_op                 ## TAILCALL
LBB0_5:
	movl	32(%r15), %r12d
	movl	%ebx, %edi
	callq	_img_i2c_atomic_op_name
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edi
	movl	%eax, %edx
	movl	%ebx, %ecx
	movl	%r14d, %r8d
	callq	_dev_dbg
	movq	_CMD_RET_DATA@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	sete	%al
	movq	_CMD_RET_ACK@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %eax
	movl	%eax, 16(%r15)
	movl	$0, 20(%r15)
	movq	$0, 24(%r15)
	movq	_SCB_OVERRIDE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_OVERRIDE_CMD_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_OVERRIDE_CMD_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_OVERRIDE_MASTER@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_OVERRIDE_DIRECT@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_OVERRIDE_DATA_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r14d
	orl	%ebx, %r14d
	movq	%r15, %rdi
	movl	%r14d, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_img_i2c_writel                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_GEN_DATA,4,2               ## @CMD_GEN_DATA
	.comm	_MODE_ATOMIC,8,3                ## @MODE_ATOMIC
	.comm	_SCB_STATUS_REG,4,2             ## @SCB_STATUS_REG
	.comm	_LINESTAT_SDAT_LINE_STATUS,4,2  ## @LINESTAT_SDAT_LINE_STATUS
	.comm	_MODE_RAW,4,2                   ## @MODE_RAW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"atomic cmd=%s (%d) data=%#x\n"

	.comm	_CMD_RET_DATA,4,2               ## @CMD_RET_DATA
	.comm	_CMD_RET_ACK,4,2                ## @CMD_RET_ACK
	.comm	_SCB_OVERRIDE_REG,4,2           ## @SCB_OVERRIDE_REG
	.comm	_OVERRIDE_CMD_MASK,4,2          ## @OVERRIDE_CMD_MASK
	.comm	_OVERRIDE_CMD_SHIFT,4,2         ## @OVERRIDE_CMD_SHIFT
	.comm	_OVERRIDE_MASTER,4,2            ## @OVERRIDE_MASTER
	.comm	_OVERRIDE_DIRECT,4,2            ## @OVERRIDE_DIRECT
	.comm	_OVERRIDE_DATA_SHIFT,4,2        ## @OVERRIDE_DATA_SHIFT
	.no_dead_strip	_img_i2c_atomic_op
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function img_i2c_atomic_op
_img_i2c_atomic_op:                     ; @img_i2c_atomic_op
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	stp	w1, w2, [x0]
Lloh0:
	adrp	x8, _CMD_GEN_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CMD_GEN_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_5
; %bb.1:
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _MODE_ATOMIC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MODE_ATOMIC@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _SCB_STATUS_REG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SCB_STATUS_REG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_img_i2c_readl
	tbnz	w20, #7, LBB0_5
; %bb.3:
Lloh9:
	adrp	x8, _LINESTAT_SDAT_LINE_STATUS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LINESTAT_SDAT_LINE_STATUS@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w0
	cbz	w8, LBB0_5
; %bb.4:
Lloh12:
	adrp	x8, _MODE_RAW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MODE_RAW@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_img_i2c_switch_mode
	mov	x0, x19
	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
	b	_img_i2c_raw_op
LBB0_5:
	ldr	w22, [x19, #32]
	mov	x0, x21
	bl	_img_i2c_atomic_op_name
	mov	x2, x0
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x3, x21
	mov	x4, x20
	bl	_dev_dbg
Lloh17:
	adrp	x8, _CMD_RET_DATA@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CMD_RET_DATA@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	cmp	w8, w21
Lloh20:
	adrp	x8, _CMD_RET_ACK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CMD_RET_ACK@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ccmp	w8, w21, #4, ne
	cset	w8, eq
	stp	w8, wzr, [x19, #16]
	str	xzr, [x19, #24]
Lloh23:
	adrp	x8, _SCB_OVERRIDE_REG@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SCB_OVERRIDE_REG@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _OVERRIDE_CMD_MASK@GOTPAGE
Lloh27:
	ldr	x8, [x8, _OVERRIDE_CMD_MASK@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	and	w8, w8, w21
Lloh29:
	adrp	x9, _OVERRIDE_CMD_SHIFT@GOTPAGE
Lloh30:
	ldr	x9, [x9, _OVERRIDE_CMD_SHIFT@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	lsl	w8, w8, w9
Lloh32:
	adrp	x9, _OVERRIDE_MASTER@GOTPAGE
Lloh33:
	ldr	x9, [x9, _OVERRIDE_MASTER@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh35:
	adrp	x9, _OVERRIDE_DIRECT@GOTPAGE
Lloh36:
	ldr	x9, [x9, _OVERRIDE_DIRECT@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh38:
	adrp	x9, _OVERRIDE_DATA_SHIFT@GOTPAGE
Lloh39:
	ldr	x9, [x9, _OVERRIDE_DATA_SHIFT@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	lsl	w9, w20, w9
	orr	w2, w8, w9
	mov	x0, x19
	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
	b	_img_i2c_writel
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_GEN_DATA,4,2               ; @CMD_GEN_DATA
	.comm	_MODE_ATOMIC,8,3                ; @MODE_ATOMIC
	.comm	_SCB_STATUS_REG,4,2             ; @SCB_STATUS_REG
	.comm	_LINESTAT_SDAT_LINE_STATUS,4,2  ; @LINESTAT_SDAT_LINE_STATUS
	.comm	_MODE_RAW,4,2                   ; @MODE_RAW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"atomic cmd=%s (%d) data=%#x\n"

	.comm	_CMD_RET_DATA,4,2               ; @CMD_RET_DATA
	.comm	_CMD_RET_ACK,4,2                ; @CMD_RET_ACK
	.comm	_SCB_OVERRIDE_REG,4,2           ; @SCB_OVERRIDE_REG
	.comm	_OVERRIDE_CMD_MASK,4,2          ; @OVERRIDE_CMD_MASK
	.comm	_OVERRIDE_CMD_SHIFT,4,2         ; @OVERRIDE_CMD_SHIFT
	.comm	_OVERRIDE_MASTER,4,2            ; @OVERRIDE_MASTER
	.comm	_OVERRIDE_DIRECT,4,2            ; @OVERRIDE_DIRECT
	.comm	_OVERRIDE_DATA_SHIFT,4,2        ; @OVERRIDE_DATA_SHIFT
	.no_dead_strip	_img_i2c_atomic_op
.subsections_via_symbols
