	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hx711_write_raw
_hx711_write_raw:                       ## @hx711_write_raw
	.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
	movq	%r8, %rbx
	movl	%ecx, %r12d
	movl	%edx, %r14d
	callq	_iio_priv
	cmpq	$128, %rbx
	jne	LBB0_10
## %bb.1:
	testl	%r14d, %r14d
	je	LBB0_2
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rax, %r15
	leaq	8(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	%r12d, %edi
	callq	_hx711_get_scale_to_gain
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	cmpl	(%r15), %ebx
	je	LBB0_9
## %bb.5:
	movl	%ebx, (%r15)
	cmpl	$32, %ebx
	je	LBB0_7
## %bb.6:
	movl	%ebx, 4(%r15)
LBB0_7:
	movq	%r15, %rdi
	callq	_hx711_read
	testl	%eax, %eax
	js	LBB0_8
LBB0_9:
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_8:
	movl	%eax, %ebx
LBB0_3:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_hx711_write_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hx711_write_raw
_hx711_write_raw:                       ; @hx711_write_raw
	.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	x22, x4
	mov	x19, x3
	mov	x20, x2
	bl	_iio_priv
	cmp	x22, #128
	b.ne	LBB0_2
; %bb.1:
	cbz	w20, LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_3:
	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
	ret
LBB0_4:
	mov	x21, x0
	add	x20, x0, #8
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x19
	bl	_hx711_get_scale_to_gain
	mov	x19, x0
	tbnz	w0, #31, LBB0_11
; %bb.5:
	ldr	w8, [x21]
	cmp	w19, w8
	b.eq	LBB0_9
; %bb.6:
	str	w19, [x21]
	cmp	w19, #32
	b.eq	LBB0_8
; %bb.7:
	str	w19, [x21, #4]
LBB0_8:
	mov	x0, x21
	bl	_hx711_read
	tbnz	w0, #31, LBB0_10
LBB0_9:
	mov	x0, x20
	bl	_mutex_unlock
	mov	w19, #0
	b	LBB0_3
LBB0_10:
	mov	x19, x0
LBB0_11:
	mov	x0, x20
	bl	_mutex_unlock
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_hx711_write_raw
.subsections_via_symbols
