	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad7298_update_scan_mode
_ad7298_update_scan_mode:               ## @ad7298_update_scan_mode
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_iio_priv
	movq	%rax, %rbx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_bitmap_weight
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_AD7298_WRITE@GOTPCREL(%rip), %rax
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movzwl	(%rbx), %r14d
	orw	(%rax), %r14w
	xorl	%edi, %edi
	callq	_AD7298_CH
	movl	%eax, %r13d
	movq	_AD7298_MAX_CHAN@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	movq	%r15, %rsi
	movq	%rax, %r12
	callq	_test_bit
	testq	%rax, %rax
	movl	%r13d, %eax
	movl	$0, %ecx
	cmovel	%ecx, %eax
	orl	%eax, %r14d
	movq	%r12, %rax
	incl	%ebx
	sarl	%r13d
	cmpl	(%rax), %ebx
	jl	LBB0_2
LBB0_3:
	movzwl	%r14w, %edi
	callq	_cpu_to_be16
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	32(%r15), %rcx
	movl	%eax, (%rcx)
	movq	8(%r15), %rax
	movq	%rcx, 16(%rax)
	movabsq	$4294967298, %rdx               ## imm = 0x100000002
	movq	%rdx, (%rax)
	addq	$4, %rcx
	movq	%rcx, 40(%rax)
	movq	%rdx, 24(%rax)
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	addq	$16, %r14
	movq	%r14, %rdi
	callq	_spi_message_init
	movq	8(%r15), %rdi
	movq	%r14, %rsi
	callq	_spi_message_add_tail
	movq	8(%r15), %rdi
	addq	$24, %rdi
	movq	%r14, %rsi
	callq	_spi_message_add_tail
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	testl	%eax, %eax
	jle	LBB0_4
## %bb.5:
	movl	%eax, %r12d
	shlq	$2, %r12
	movl	$48, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%r15), %rax
	addq	%r13, %rax
	movq	8(%r15), %rcx
	leaq	(%rcx,%rbx), %rdi
	movq	%rax, 8(%rcx,%rbx)
	movabsq	$4294967298, %rax               ## imm = 0x100000002
	movq	%rax, (%rcx,%rbx)
	movq	%r14, %rsi
	callq	_spi_message_add_tail
	addq	$24, %rbx
	addq	$4, %r13
	cmpq	%r13, %r12
	jne	LBB0_6
## %bb.7:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	incl	%ecx
	jmp	LBB0_8
LBB0_4:
	movl	$1, %ecx
LBB0_8:
	movq	8(%r15), %rax
	leaq	(%rcx,%rcx,2), %rcx
	movl	$0, 4(%rax,%rcx,8)
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AD7298_WRITE,2,1               ## @AD7298_WRITE
	.comm	_AD7298_MAX_CHAN,4,2            ## @AD7298_MAX_CHAN
	.no_dead_strip	_ad7298_update_scan_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function ad7298_update_scan_mode
lCPI0_0:
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_ad7298_update_scan_mode:               ; @ad7298_update_scan_mode
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -88
	.cfi_offset b9, -96
	mov	x21, x1
	mov	x20, x0
	bl	_iio_priv
	mov	x19, x0
	ldr	w1, [x20]
	mov	x0, x21
	bl	_bitmap_weight
	mov	x20, x0
Lloh0:
	adrp	x8, _AD7298_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AD7298_WRITE@GOTPAGEOFF]
	ldrh	w8, [x8]
	ldrh	w9, [x19]
	orr	w24, w9, w8
	mov	w0, #0
	bl	_AD7298_CH
Lloh2:
	adrp	x25, _AD7298_MAX_CHAN@GOTPAGE
Lloh3:
	ldr	x25, [x25, _AD7298_MAX_CHAN@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x22, x0
	mov	w23, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x21
	bl	_test_bit
	cmp	x0, #0
	csel	w8, wzr, w22, eq
	orr	w24, w8, w24
	add	w23, w23, #1
	asr	w22, w22, #1
	ldr	w8, [x25]
	cmp	w23, w8
	b.lt	LBB0_2
LBB0_3:
	and	w0, w24, #0xffff
	bl	_cpu_to_be16
	ldr	x8, [x19, #32]
	ldr	x9, [x19, #8]
	str	x8, [x9, #16]
	str	w0, [x8], #4
Lloh4:
	adrp	x10, lCPI0_0@PAGE
Lloh5:
	ldr	d8, [x10, lCPI0_0@PAGEOFF]
	str	d8, [x9]
	str	x8, [x9, #40]
	str	d8, [x9, #24]
	add	x21, x19, #16
	mov	x0, x21
	bl	_spi_message_init
	ldr	x0, [x19, #8]
	mov	x1, x21
	bl	_spi_message_add_tail
	ldr	x8, [x19, #8]
	add	x0, x8, #24
	mov	x1, x21
	bl	_spi_message_add_tail
	cmp	w20, #1
	b.lt	LBB0_7
; %bb.4:
	mov	x22, #0
	mov	w8, w20
	lsl	x23, x8, #2
	mov	w24, #48
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	add	x8, x8, x22
	ldr	x9, [x19, #8]
	add	x0, x9, x24
	str	x8, [x0, #8]
	str	d8, [x0]
	mov	x1, x21
	bl	_spi_message_add_tail
	add	x24, x24, #24
	add	x22, x22, #4
	cmp	x23, x22
	b.ne	LBB0_5
; %bb.6:
	add	w8, w20, #1
	b	LBB0_8
LBB0_7:
	mov	w8, #1
LBB0_8:
	ldr	x9, [x19, #8]
	mov	w10, #24
	madd	x8, x8, x10, x9
	str	wzr, [x8, #4]
	mov	w0, #0
	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	d9, d8, [sp], #96               ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdr	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_AD7298_WRITE,2,1               ; @AD7298_WRITE
	.comm	_AD7298_MAX_CHAN,4,2            ; @AD7298_MAX_CHAN
	.no_dead_strip	_ad7298_update_scan_mode
.subsections_via_symbols
