	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_fw_segment
_write_fw_segment:                      ## @write_fw_segment
	.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
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MXL_HYDRA_OEM_MAX_BLOCK_WRITE_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_MXL_HYDRA_I2C_HDR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_MXL_HYDRA_REG_SIZE_IN_BYTES@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movl	%r8d, %eax
	subl	%ebx, %eax
	negl	%ebx
	addl	%ebx, %r8d
	addl	$3, %r8d
	testl	%eax, %eax
	cmovnsl	%eax, %r8d
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	andl	$-4, %r8d
	movslq	%r8d, %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -72(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%r13), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, %r14
	subq	%r13, %r14
	cmpq	%rcx, %rax
	cmovleq	%rdx, %r14
	leaq	4(%r14), %r12
	andq	$-4, %r12
	testb	$3, %r14b
	cmoveq	%r14, %r12
	movq	%r15, %rdi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_memset
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_memcpy
	movl	$1, %edi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_convert_endian
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r12, %rdx
	movq	%r15, %rcx
	callq	_write_firmware_block
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	addq	%r12, %r13
	addq	%r12, %rbx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%r12,4), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	cmpq	-64(%rbp), %r13                 ## 8-byte Folded Reload
	jl	LBB0_1
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_5
## %bb.4:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MXL_HYDRA_OEM_MAX_BLOCK_WRITE_LENGTH,4,2 ## @MXL_HYDRA_OEM_MAX_BLOCK_WRITE_LENGTH
	.comm	_MXL_HYDRA_I2C_HDR_SIZE,4,2     ## @MXL_HYDRA_I2C_HDR_SIZE
	.comm	_MXL_HYDRA_REG_SIZE_IN_BYTES,4,2 ## @MXL_HYDRA_REG_SIZE_IN_BYTES
	.no_dead_strip	_write_fw_segment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_fw_segment
_write_fw_segment:                      ; @write_fw_segment
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _MXL_HYDRA_OEM_MAX_BLOCK_WRITE_LENGTH@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MXL_HYDRA_OEM_MAX_BLOCK_WRITE_LENGTH@GOTPAGEOFF]
	stur	x8, [x29, #-88]
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _MXL_HYDRA_I2C_HDR_SIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MXL_HYDRA_I2C_HDR_SIZE@GOTPAGEOFF]
Lloh8:
	adrp	x10, _MXL_HYDRA_REG_SIZE_IN_BYTES@GOTPAGE
Lloh9:
	ldr	x10, [x10, _MXL_HYDRA_REG_SIZE_IN_BYTES@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	ldr	w10, [x10]
	add	w9, w9, w10
	sub	w8, w8, w9
	add	w9, w8, #3
	cmp	w8, #0
	csel	w9, w9, w8, lt
	and	w9, w9, #0xfffffffc
	sxtw	x26, w9
	lsl	x9, x8, #2
	add	x8, x9, #15
	and	x8, x8, #0x7fffffff0
Lloh12:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh13:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x23, x9, x8
	mov	sp, x23
	mov	x27, #0
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	sub	x8, x20, x27
	add	x9, x27, x26
	cmp	x9, x20
	csel	x24, x8, x26, gt
	add	x8, x24, #4
	and	x8, x8, #0xfffffffffffffffc
	tst	x24, #0x3
	csel	x25, x24, x8, eq
	mov	x0, x23
	mov	w1, #0
	mov	x2, x25
	bl	_memset
	mov	x0, x23
	mov	x1, x19
	mov	x2, x24
	bl	_memcpy
	mov	w0, #1
	mov	x1, x25
	mov	x2, x23
	bl	_convert_endian
	mov	x0, x22
	mov	x1, x21
	mov	x2, x25
	mov	x3, x23
	bl	_write_firmware_block
	cmp	w0, #0
	add	x27, x25, x27
	add	x21, x25, x21
	add	x19, x19, x25, lsl #2
	ccmp	x27, x20, #0, eq
	b.lt	LBB0_1
; %bb.2:
	ldur	x8, [x29, #-88]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	sub	sp, x29, #80
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_4:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MXL_HYDRA_OEM_MAX_BLOCK_WRITE_LENGTH,4,2 ; @MXL_HYDRA_OEM_MAX_BLOCK_WRITE_LENGTH
	.comm	_MXL_HYDRA_I2C_HDR_SIZE,4,2     ; @MXL_HYDRA_I2C_HDR_SIZE
	.comm	_MXL_HYDRA_REG_SIZE_IN_BYTES,4,2 ; @MXL_HYDRA_REG_SIZE_IN_BYTES
	.no_dead_strip	_write_fw_segment
.subsections_via_symbols
