	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function da9150_fg_write_attr_sync
_da9150_fg_write_attr_sync:             ## @da9150_fg_write_attr_sync
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	leaq	4(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_DA9150_QIF_SYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DA9150_QIF_SYNC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_da9150_fg_read_attr
	movq	%rax, %r13
	movq	_DA9150_QIF_SYNC_RETRIES@GOTPCREL(%rip), %r14
	testq	%rax, %rax
	sete	%al
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	jne	LBB0_5
## %bb.1:
	cmpl	$0, (%r14)
	jle	LBB0_5
## %bb.2:
	movl	$1, %r15d
	movq	_DA9150_QIF_SYNC_TIMEOUT@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edi
	leal	(%rdi,%rdi), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_usleep_range
	movq	_DA9150_QIF_SYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DA9150_QIF_SYNC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_da9150_fg_read_attr
	movq	%rax, %r13
	testq	%rax, %rax
	sete	%al
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leal	1(%r15), %ecx
	cmpl	(%r14), %r15d
	movl	%ecx, %r15d
	jl	LBB0_3
LBB0_5:
	testb	%al, %al
	je	LBB0_6
## %bb.12:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_6:
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	callq	_da9150_fg_write_attr
	cmpl	$0, (%r14)
	jle	LBB0_13
## %bb.7:
	movl	$1, %r15d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	_DA9150_QIF_SYNC_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	(%rdi,%rdi), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_usleep_range
	movq	_DA9150_QIF_SYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DA9150_QIF_SYNC_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_da9150_fg_read_attr
	movq	%rax, %rbx
	cmpq	%r13, %rax
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	leal	1(%r15), %eax
	cmpl	(%r14), %r15d
	movl	%eax, %r15d
	jl	LBB0_8
LBB0_10:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	incq	%r13
	cmpq	%r13, %rbx
	jne	LBB0_14
## %bb.11:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
LBB0_14:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DA9150_QIF_SYNC,4,2            ## @DA9150_QIF_SYNC
	.comm	_DA9150_QIF_SYNC_SIZE,4,2       ## @DA9150_QIF_SYNC_SIZE
	.comm	_DA9150_QIF_SYNC_RETRIES,4,2    ## @DA9150_QIF_SYNC_RETRIES
	.comm	_DA9150_QIF_SYNC_TIMEOUT,4,2    ## @DA9150_QIF_SYNC_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout waiting for existing QIF sync!\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error performing QIF sync write for code %d\n"

	.no_dead_strip	_da9150_fg_write_attr_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function da9150_fg_write_attr_sync
_da9150_fg_write_attr_sync:             ; @da9150_fg_write_attr_sync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x24, x3
	mov	x23, x2
	mov	x28, x1
	mov	x20, x0
	add	x21, x0, #4
	mov	x0, x21
	bl	_mutex_lock
Lloh0:
	adrp	x25, _DA9150_QIF_SYNC@GOTPAGE
Lloh1:
	ldr	x25, [x25, _DA9150_QIF_SYNC@GOTPAGEOFF]
	ldr	w1, [x25]
Lloh2:
	adrp	x26, _DA9150_QIF_SYNC_SIZE@GOTPAGE
Lloh3:
	ldr	x26, [x26, _DA9150_QIF_SYNC_SIZE@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x0, x20
	bl	_da9150_fg_read_attr
	cmp	x0, #0
	cset	w8, eq
Lloh4:
	adrp	x27, _DA9150_QIF_SYNC_RETRIES@GOTPAGE
Lloh5:
	ldr	x27, [x27, _DA9150_QIF_SYNC_RETRIES@GOTPAGEOFF]
	ldr	w9, [x27]
	cmp	x0, #0
	ccmp	w9, #1, #8, eq
	b.ge	LBB0_6
; %bb.1:
	mov	x22, x0
	cbnz	w8, LBB0_9
LBB0_2:
	mov	x0, x20
	mov	x1, x28
	mov	x2, x23
	mov	x3, x24
	bl	_da9150_fg_write_attr
	ldr	w8, [x27]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.3:
	mov	w24, #1
Lloh6:
	adrp	x19, _DA9150_QIF_SYNC_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x19, [x19, _DA9150_QIF_SYNC_TIMEOUT@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	lsl	w1, w0, #1
	bl	_usleep_range
	ldr	w1, [x25]
	ldr	w2, [x26]
	mov	x0, x20
	bl	_da9150_fg_read_attr
	ldr	w8, [x27]
	cmp	x0, x22
	ccmp	w24, w8, #0, eq
	add	w24, w24, #1
	b.lt	LBB0_4
; %bb.5:
	mov	x23, x0
	mov	x0, x21
	bl	_mutex_unlock
	add	x8, x22, #1
	cmp	x23, x8
	b.ne	LBB0_11
	b	LBB0_12
LBB0_6:
	str	w23, [sp, #12]                  ; 4-byte Folded Spill
	mov	x23, x28
	mov	w28, #1
Lloh8:
	adrp	x19, _DA9150_QIF_SYNC_TIMEOUT@GOTPAGE
Lloh9:
	ldr	x19, [x19, _DA9150_QIF_SYNC_TIMEOUT@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	lsl	w1, w0, #1
	bl	_usleep_range
	ldr	w1, [x25]
	ldr	w2, [x26]
	mov	x0, x20
	bl	_da9150_fg_read_attr
	cmp	x0, #0
	cset	w8, eq
	ldr	w9, [x27]
	cmp	x0, #0
	ccmp	w28, w9, #0, eq
	add	w28, w28, #1
	b.lt	LBB0_7
; %bb.8:
	mov	x22, x0
	mov	x28, x23
	ldr	w23, [sp, #12]                  ; 4-byte Folded Reload
	cbz	w8, LBB0_2
LBB0_9:
	ldr	w0, [x20]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_mutex_unlock
LBB0_10:
	mov	x0, x21
	bl	_mutex_unlock
LBB0_11:
	ldr	w0, [x20]
	str	x28, [sp]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_12:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DA9150_QIF_SYNC,4,2            ; @DA9150_QIF_SYNC
	.comm	_DA9150_QIF_SYNC_SIZE,4,2       ; @DA9150_QIF_SYNC_SIZE
	.comm	_DA9150_QIF_SYNC_RETRIES,4,2    ; @DA9150_QIF_SYNC_RETRIES
	.comm	_DA9150_QIF_SYNC_TIMEOUT,4,2    ; @DA9150_QIF_SYNC_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout waiting for existing QIF sync!\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error performing QIF sync write for code %d\n"

	.no_dead_strip	_da9150_fg_write_attr_sync
.subsections_via_symbols
