	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function si1133_command
_si1133_command:                        ## @si1133_command
	.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
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	16(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addq	$4, %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movl	(%r13), %r12d
	incl	%r12d
	movq	_SI1133_MAX_CMD_CTR@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	movq	_SI1133_CMD_FORCE@GOTPCREL(%rip), %r14
	cmpl	%r15d, (%r14)
	jne	LBB0_2
## %bb.1:
	leaq	12(%r13), %rdi
	callq	_reinit_completion
LBB0_2:
	movl	8(%r13), %edi
	movq	_SI1133_REG_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
LBB0_4:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	%ebx, %ecx
	callq	_dev_warn
LBB0_15:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	cmpl	%r15d, (%r14)
	jne	LBB0_10
## %bb.6:
	leaq	12(%r13), %rbx
	movq	_SI1133_COMPLETION_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	8(%r13), %edi
	movq	_SI1133_REG_RESPONSE0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdx
	callq	_regmap_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.9:
	movl	-52(%rbp), %esi
	jmp	LBB0_12
LBB0_10:
	movl	8(%r13), %edi
	movq	_SI1133_REG_RESPONSE0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ecx, %ecx
	testl	%r12d, %r12d
	sete	%cl
	movq	_SI1133_CMD_MINSLEEP_US_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_SI1133_CMD_TIMEOUT_MS@GOTPCREL(%rip), %rax
	imull	$1000, (%rax), %r9d             ## imm = 0x3E8
	callq	_regmap_read_poll_timeout
	testl	%eax, %eax
	je	LBB0_11
## %bb.16:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_4
LBB0_7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_11:
                                        ## implicit-def: $esi
LBB0_12:
	movq	_SI1133_CMD_ERR_MASK@GOTPCREL(%rip), %rax
	testl	%esi, (%rax)
	je	LBB0_14
## %bb.13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_si1133_parse_response_err
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_si1133_cmd_reset_counter
	jmp	LBB0_15
LBB0_14:
	movl	%r12d, (%r13)
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_SI1133_MAX_CMD_CTR,4,2         ## @SI1133_MAX_CMD_CTR
	.comm	_SI1133_CMD_FORCE,4,2           ## @SI1133_CMD_FORCE
	.comm	_SI1133_REG_COMMAND,4,2         ## @SI1133_REG_COMMAND
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to write command %#02hhx, ret=%d\n"

	.comm	_SI1133_COMPLETION_TIMEOUT_MS,4,2 ## @SI1133_COMPLETION_TIMEOUT_MS
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_SI1133_REG_RESPONSE0,4,2       ## @SI1133_REG_RESPONSE0
	.comm	_SI1133_CMD_SEQ_MASK,4,2        ## @SI1133_CMD_SEQ_MASK
	.comm	_SI1133_CMD_ERR_MASK,4,2        ## @SI1133_CMD_ERR_MASK
	.comm	_SI1133_CMD_MINSLEEP_US_LOW,4,2 ## @SI1133_CMD_MINSLEEP_US_LOW
	.comm	_SI1133_CMD_TIMEOUT_MS,4,2      ## @SI1133_CMD_TIMEOUT_MS
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read command %#02hhx, ret=%d\n"

	.no_dead_strip	_si1133_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function si1133_command
_si1133_command:                        ; @si1133_command
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x1
	mov	x21, x0
	ldr	x22, [x0, #16]
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
Lloh0:
	adrp	x8, _SI1133_MAX_CMD_CTR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SI1133_MAX_CMD_CTR@GOTPAGEOFF]
	ldr	w26, [x21]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x25, _SI1133_CMD_FORCE@GOTPAGE
Lloh4:
	ldr	x25, [x25, _SI1133_CMD_FORCE@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, w20
	b.ne	LBB0_2
; %bb.1:
	add	x0, x21, #12
	bl	_reinit_completion
LBB0_2:
	ldr	w0, [x21, #8]
Lloh5:
	adrp	x8, _SI1133_REG_COMMAND@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SI1133_REG_COMMAND@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_regmap_write
	cbz	w0, LBB0_6
; %bb.3:
	mov	x23, x0
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	mov	x0, x22
	mov	x2, x20
	mov	x3, x23
	bl	_dev_warn
LBB0_5:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	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
	add	sp, sp, #96
	ret
LBB0_6:
	add	w8, w26, #1
	and	w24, w8, w24
	ldr	w8, [x25]
	cmp	w8, w20
	b.ne	LBB0_10
; %bb.7:
	add	x23, x21, #12
Lloh10:
	adrp	x8, _SI1133_COMPLETION_TIMEOUT_MS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SI1133_COMPLETION_TIMEOUT_MS@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x23
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_12
; %bb.8:
	ldr	w0, [x21, #8]
Lloh13:
	adrp	x8, _SI1133_REG_RESPONSE0@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SI1133_REG_RESPONSE0@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	mov	x23, x0
	cbnz	w0, LBB0_5
; %bb.9:
	ldr	w1, [sp, #12]
	b	LBB0_14
LBB0_10:
Lloh16:
	adrp	x8, _SI1133_REG_RESPONSE0@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SI1133_REG_RESPONSE0@GOTPAGEOFF]
	ldr	w0, [x21, #8]
Lloh18:
	ldr	w1, [x8]
	cmp	w24, #0
	cset	w3, eq
Lloh19:
	adrp	x8, _SI1133_CMD_MINSLEEP_US_LOW@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SI1133_CMD_MINSLEEP_US_LOW@GOTPAGEOFF]
Lloh21:
	ldr	w4, [x8]
Lloh22:
	adrp	x8, _SI1133_CMD_TIMEOUT_MS@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SI1133_CMD_TIMEOUT_MS@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	mov	w9, #1000
	mul	w5, w8, w9
	bl	_regmap_read_poll_timeout
	cbz	w0, LBB0_13
; %bb.11:
	mov	x23, x0
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_12:
Lloh27:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_5
LBB0_13:
                                        ; implicit-def: $w1
LBB0_14:
Lloh30:
	adrp	x8, _SI1133_CMD_ERR_MASK@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SI1133_CMD_ERR_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	tst	w8, w1
	b.eq	LBB0_16
; %bb.15:
	mov	x0, x22
	mov	x2, x20
	bl	_si1133_parse_response_err
	mov	x23, x0
	mov	x0, x21
	bl	_si1133_cmd_reset_counter
	b	LBB0_5
LBB0_16:
	mov	w23, #0
	str	w24, [x21]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_SI1133_MAX_CMD_CTR,4,2         ; @SI1133_MAX_CMD_CTR
	.comm	_SI1133_CMD_FORCE,4,2           ; @SI1133_CMD_FORCE
	.comm	_SI1133_REG_COMMAND,4,2         ; @SI1133_REG_COMMAND
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to write command %#02hhx, ret=%d\n"

	.comm	_SI1133_COMPLETION_TIMEOUT_MS,4,2 ; @SI1133_COMPLETION_TIMEOUT_MS
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_SI1133_REG_RESPONSE0,4,2       ; @SI1133_REG_RESPONSE0
	.comm	_SI1133_CMD_SEQ_MASK,4,2        ; @SI1133_CMD_SEQ_MASK
	.comm	_SI1133_CMD_ERR_MASK,4,2        ; @SI1133_CMD_ERR_MASK
	.comm	_SI1133_CMD_MINSLEEP_US_LOW,4,2 ; @SI1133_CMD_MINSLEEP_US_LOW
	.comm	_SI1133_CMD_TIMEOUT_MS,4,2      ; @SI1133_CMD_TIMEOUT_MS
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read command %#02hhx, ret=%d\n"

	.no_dead_strip	_si1133_command
.subsections_via_symbols
