	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function srf04_read
_srf04_read:                            ## @srf04_read
	.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	%rdi, %r15
	callq	_mutex_lock
	leaq	16(%r15), %rbx
	movq	%rbx, %rdi
	callq	_reinit_completion
	leaq	12(%r15), %r14
	movq	%r14, %rdi
	callq	_reinit_completion
	movl	20(%r15), %edi
	movl	$1, %esi
	callq	_gpiod_set_value
	movq	24(%r15), %rax
	movl	(%rax), %edi
	callq	_udelay
	movl	20(%r15), %edi
	xorl	%esi, %esi
	callq	_gpiod_set_value
	movq	_HZ@GOTPCREL(%rip), %r12
	movslq	(%r12), %rax
	imulq	$1374389535, %rax, %rsi         ## imm = 0x51EB851F
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$36, %rsi
	addl	%eax, %esi
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_wait_for_completion_killable_timeout
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	je	LBB0_3
## %bb.4:
	movslq	(%r12), %rax
	imulq	$1717986919, %rax, %rsi         ## imm = 0x66666667
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$35, %rsi
	addl	%eax, %esi
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_wait_for_completion_killable_timeout
	testl	%eax, %eax
	js	LBB0_1
## %bb.5:
	je	LBB0_3
## %bb.6:
	movl	4(%r15), %esi
	movl	8(%r15), %edi
	callq	_ktime_sub
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%ebx, %edi
	callq	_ktime_to_ns
	cmpl	$40438872, %eax                 ## imm = 0x2690C58
	jl	LBB0_9
## %bb.7:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_1:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_10
LBB0_3:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
LBB0_8:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	imull	$106, %eax, %eax
	cltq
	imulq	$1824276879, %rax, %rbx         ## imm = 0x6CBC418F
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$50, %rbx
	addl	%eax, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_HZ,4,2                         ## @HZ
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_srf04_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function srf04_read
_srf04_read:                            ; @srf04_read
	.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	x19, x0
	bl	_mutex_lock
	add	x21, x19, #16
	mov	x0, x21
	bl	_reinit_completion
	add	x20, x19, #12
	mov	x0, x20
	bl	_reinit_completion
	ldr	w0, [x19, #20]
	mov	w1, #1
	bl	_gpiod_set_value
	ldr	x8, [x19, #24]
	ldr	w0, [x8]
	bl	_udelay
	ldr	w0, [x19, #20]
	mov	w1, #0
	bl	_gpiod_set_value
Lloh0:
	adrp	x22, _HZ@GOTPAGE
Lloh1:
	ldr	x22, [x22, _HZ@GOTPAGEOFF]
	ldrsw	x8, [x22]
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #36
	add	w1, w8, w9
	mov	x0, x21
	bl	_wait_for_completion_killable_timeout
	mov	x21, x0
	tbnz	w0, #31, LBB0_6
; %bb.1:
	cbz	w21, LBB0_7
; %bb.2:
	ldrsw	x8, [x22]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #35
	add	w1, w8, w9
	mov	x0, x20
	bl	_wait_for_completion_killable_timeout
	mov	x21, x0
	tbnz	w0, #31, LBB0_6
; %bb.3:
	cbz	w21, LBB0_7
; %bb.4:
	ldp	w1, w0, [x19, #4]
	bl	_ktime_sub
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	bl	_ktime_to_ns
	mov	w8, #3160
	movk	w8, #617, lsl #16
	cmp	w0, w8
	b.lt	LBB0_10
; %bb.5:
Lloh2:
	adrp	x8, _EIO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_9
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
Lloh4:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x21
	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_10:
	mov	w8, #106
	mul	w8, w0, w8
	mov	w9, #16783
	movk	w9, #27836, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w21, w8, w9
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_HZ,4,2                         ; @HZ
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_srf04_read
.subsections_via_symbols
