	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dsicm_memory_read
_dsicm_memory_read:                     ## @dsicm_memory_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	%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	%r9d, %r12d
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r14
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	callq	_to_panel_data
	movq	%rax, %r13
	movl	%r12d, %eax
	imull	16(%rbp), %eax
	leal	(%rax,%rax,2), %r15d
	movslq	%r15d, %rax
	cmpq	%r14, %rax
	jbe	LBB0_2
## %bb.1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_17
LBB0_2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	32(%r13), %r14
	movq	%r13, %rdi
	callq	_mutex_lock
	cmpl	$0, 24(%r13)
	je	LBB0_3
## %bb.4:
	movl	16(%r13), %eax
	imull	20(%r13), %eax
	leal	(%rax,%rax,2), %esi
	movl	%r15d, %edi
	callq	_min
	movq	%rax, %rbx
	movq	(%r14), %rax
	movq	%r14, %rdi
	callq	*24(%rax)
	movq	%r13, %rdi
	callq	_dsicm_wake_up
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.5:
	movl	%ebx, %eax
	andl	$1, %eax
	movl	$2, %r8d
	subl	%eax, %r8d
	movq	%r13, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r12d, %ecx
	movl	%r8d, %r12d
	movl	16(%rbp), %r8d
	callq	_dsicm_set_update_window
	movq	(%r14), %rax
	movl	4(%r13), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	*(%rax)
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.6:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	xorl	%r15d, %r15d
	movl	$46, %edx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %ecx
	movq	%rbx, %r8
	subq	%rcx, %r8
	jbe	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %r12
	movq	(%r14), %rax
	movl	4(%r13), %esi
	addq	-64(%rbp), %rcx                 ## 8-byte Folded Reload
	movq	%r14, %rdi
	callq	*8(%rax)
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	addl	%ebx, %r15d
	cmpl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	jl	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	movl	$62, %edx
	testq	%rax, %rax
	movq	%r12, %rbx
	je	LBB0_7
## %bb.13:
	movq	8(%r13), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_16
LBB0_9:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movl	%ebx, %r15d
	jmp	LBB0_14
LBB0_11:
	movq	8(%r13), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_14:
	movq	(%r14), %rax
	movl	4(%r13), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	*(%rax)
LBB0_15:
	movq	(%r14), %rax
	movq	%r14, %rdi
	callq	*16(%rax)
LBB0_16:
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_17:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read error\n"

L_.str.1:                               ## @.str.1
	.asciz	"short read\n"

	.comm	_current,4,2                    ## @current
L_.str.2:                               ## @.str.2
	.asciz	"signal pending, aborting memory read\n"

	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.no_dead_strip	_dsicm_memory_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dsicm_memory_read
_dsicm_memory_read:                     ; @dsicm_memory_read
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [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 w27, -88
	.cfi_offset w28, -96
	mov	x26, x6
	mov	x27, x5
	mov	x28, x4
	mov	x25, x3
	mov	x20, x2
	mov	x22, x1
	mov	x21, x0
	bl	_to_panel_data
	mul	w8, w27, w26
	add	w23, w8, w8, lsl #1
	sxtw	x8, w23
	cmp	x8, x20
	b.ls	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_17
LBB0_2:
	mov	x19, x0
	ldr	x20, [x0, #32]
	bl	_mutex_lock
	ldr	w8, [x19, #24]
	cbz	w8, LBB0_11
; %bb.3:
	ldp	w8, w9, [x19, #16]
	mul	w8, w8, w9
	add	w1, w8, w8, lsl #1
	mov	x0, x23
	bl	_min
	mov	x24, x0
	ldr	x8, [x20]
	ldr	x8, [x8, #24]
	mov	x0, x20
	blr	x8
	mov	x0, x19
	bl	_dsicm_wake_up
	mov	x23, x0
	cbnz	w0, LBB0_15
; %bb.4:
	tst	x24, #0x1
	mov	w8, #1
	cinc	w8, w8, eq
	mov	x0, x19
	mov	x1, x25
	mov	x2, x28
	mov	x3, x27
	mov	x27, x8
	mov	x4, x26
	bl	_dsicm_set_update_window
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w1, [x19, #4]
	mov	x0, x20
	mov	x2, x27
	blr	x8
	mov	x23, x0
	cbnz	w0, LBB0_15
; %bb.5:
	mov	w2, #46
Lloh3:
	adrp	x26, _current@GOTPAGE
Lloh4:
	ldr	x26, [x26, _current@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	w8, w23
	subs	x4, x24, x8
	b.ls	LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x9, [x20]
	ldr	x9, [x9, #8]
	ldr	w1, [x19, #4]
	add	x3, x22, x8
	mov	x0, x20
	blr	x9
	mov	x25, x0
	tbnz	w0, #31, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w23, w25, w23
	cmp	w25, w27
	b.lt	LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x26]
	bl	_signal_pending
	mov	w2, #62
	cbz	x0, LBB0_6
; %bb.10:
	ldr	x0, [x19, #8]
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh7:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_14
LBB0_11:
Lloh10:
	adrp	x8, _ENODEV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_16
LBB0_12:
	ldr	x0, [x21, #8]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x23, x25
	b	LBB0_14
LBB0_13:
	ldr	x0, [x19, #8]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_14:
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w1, [x19, #4]
	mov	x0, x20
	mov	w2, #1
	blr	x8
LBB0_15:
	ldr	x8, [x20]
	ldr	x8, [x8, #16]
	mov	x0, x20
	blr	x8
LBB0_16:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_17:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read error\n"

l_.str.1:                               ; @.str.1
	.asciz	"short read\n"

	.comm	_current,4,2                    ; @current
l_.str.2:                               ; @.str.2
	.asciz	"signal pending, aborting memory read\n"

	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.no_dead_strip	_dsicm_memory_read
.subsections_via_symbols
