	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adf7242_upload_firmware
_adf7242_upload_firmware:               ## @adf7242_upload_firmware
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %r15
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movq	8(%rdi), %rax
	movl	$2, -88(%rbp)
	movq	%rax, -80(%rbp)
	movq	_CMD_SPI_PRAM_WR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
	movq	$0, 8(%rax)
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_spi_message_init
	leaq	-88(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	leaq	-64(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	testl	%r12d, %r12d
	js	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_REG_PRAMPG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_adf7242_write_reg
	movq	_PRAM_PAGESIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	cmpl	%eax, %r12d
	movl	%eax, %ecx
	cmovll	%r12d, %ecx
	movl	%ecx, -64(%rbp)
	imull	%ebx, %eax
	cltq
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,8), %rax
	movq	%rax, -56(%rbp)
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	4(%r15), %edi
	leaq	-48(%rbp), %rsi
	callq	_spi_sync
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	_mutex_unlock
	incl	%ebx
	subl	(%r14), %r12d
	jns	LBB0_3
	jmp	LBB0_4
LBB0_1:
                                        ## implicit-def: $r13d
LBB0_4:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_SPI_PRAM_WR,8,3            ## @CMD_SPI_PRAM_WR
	.comm	_REG_PRAMPG,4,2                 ## @REG_PRAMPG
	.comm	_PRAM_PAGESIZE,4,2              ## @PRAM_PAGESIZE
	.no_dead_strip	_adf7242_upload_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adf7242_upload_firmware
_adf7242_upload_firmware:               ; @adf7242_upload_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	stp	xzr, xzr, [sp, #24]
	ldr	x8, [x0, #8]
	mov	w9, #2
	str	w9, [sp, #8]
	str	x8, [sp, #16]
Lloh0:
	adrp	x9, _CMD_SPI_PRAM_WR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CMD_SPI_PRAM_WR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	stp	x9, xzr, [x8]
	add	x0, sp, #40
	bl	_spi_message_init
	add	x0, sp, #8
	add	x1, sp, #40
	bl	_spi_message_add_tail
	add	x0, sp, #24
	add	x1, sp, #40
	bl	_spi_message_add_tail
	tbnz	w19, #31, LBB0_3
; %bb.1:
	mov	w22, #0
Lloh3:
	adrp	x24, _REG_PRAMPG@GOTPAGE
Lloh4:
	ldr	x24, [x24, _REG_PRAMPG@GOTPAGEOFF]
Lloh5:
	adrp	x25, _PRAM_PAGESIZE@GOTPAGE
Lloh6:
	ldr	x25, [x25, _PRAM_PAGESIZE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	mov	x0, x21
	mov	x2, x22
	bl	_adf7242_write_reg
	ldr	w8, [x25]
	cmp	w19, w8
	csel	w9, w19, w8, lt
	str	w9, [sp, #24]
	mul	w8, w8, w22
	add	x8, x20, w8, sxtw #3
	str	x8, [sp, #32]
	mov	x0, x21
	bl	_mutex_lock
	ldr	w0, [x21, #4]
	add	x1, sp, #40
	bl	_spi_sync
	mov	x23, x0
	mov	x0, x21
	bl	_mutex_unlock
	add	w22, w22, #1
	ldr	w8, [x25]
	subs	w19, w19, w8
	b.pl	LBB0_2
	b	LBB0_4
LBB0_3:
                                        ; implicit-def: $w23
LBB0_4:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_SPI_PRAM_WR,8,3            ; @CMD_SPI_PRAM_WR
	.comm	_REG_PRAMPG,4,2                 ; @REG_PRAMPG
	.comm	_PRAM_PAGESIZE,4,2              ; @PRAM_PAGESIZE
	.no_dead_strip	_adf7242_upload_firmware
.subsections_via_symbols
