	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hideep_pgm_w_mem
_hideep_pgm_w_mem:                      ## @hideep_pgm_w_mem
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %rbx
	leaq	(,%rcx,4), %r12
	leaq	4(%rbx), %rax
	movq	%rax, -48(%rbp)
	leal	8(%r12), %eax
	movl	%eax, -40(%rbp)
	movq	(%rdi), %rax
	movl	4(%rax), %eax
	movl	%eax, -36(%rbp)
	movq	_HIDEEP_NVM_PAGE_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jbe	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_4
LBB0_2:
	movq	%rdx, %r14
	movq	%rdi, %r15
	decl	%ecx
	orl	$128, %ecx
	movl	%ecx, 4(%rbx)
	movl	%esi, %edi
	callq	_cpu_to_be32
	movl	%eax, 8(%rbx)
	movl	(%rbx), %edi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_memcpy
	movq	(%r15), %rax
	movl	(%rax), %edi
	leaq	-48(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	$1, %ecx
	je	LBB0_4
## %bb.3:
	movq	_EIO@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	testl	%ecx, %ecx
	cmovsl	%ecx, %eax
LBB0_4:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HIDEEP_NVM_PAGE_SIZE,8,3       ## @HIDEEP_NVM_PAGE_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_hideep_pgm_w_mem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hideep_pgm_w_mem
_hideep_pgm_w_mem:                      ; @hideep_pgm_w_mem
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	lsl	x21, x3, #2
	ldp	x8, x22, [x0]
	add	x9, x22, #4
	str	x9, [sp]
	add	w9, w21, #8
	str	w9, [sp, #8]
	ldr	w8, [x8, #4]
	str	w8, [sp, #12]
Lloh0:
	adrp	x8, _HIDEEP_NVM_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HIDEEP_NVM_PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x21, x8
	b.ls	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_2:
	mov	x20, x2
	mov	x19, x0
	sub	w8, w3, #1
	orr	w8, w8, #0x80
	str	w8, [x22, #4]
	mov	x0, x1
	bl	_cpu_to_be32
	str	w0, [x22, #8]
	ldr	w0, [x22]
	mov	x1, x20
	mov	x2, x21
	bl	_memcpy
	ldr	x8, [x19]
	ldr	w0, [x8]
	mov	x1, sp
	mov	w2, #1
	bl	_i2c_transfer
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #0
	b	LBB0_5
LBB0_4:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w0, #0
	csneg	w0, w0, w8, lt
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_HIDEEP_NVM_PAGE_SIZE,8,3       ; @HIDEEP_NVM_PAGE_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_hideep_pgm_w_mem
.subsections_via_symbols
