	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function guc_read_update_log_buffer
_guc_read_update_log_buffer:            ## @guc_read_update_log_buffer
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_intel_guc_log_relay_enabled
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_15
## %bb.1:
	movq	8(%r14), %rbx
	movq	%r14, %rdi
	callq	_guc_get_write_buffer
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR_RATELIMITED
	incl	4(%r14)
	jmp	LBB0_15
LBB0_3:
	movq	_GUC_ISR_LOG_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_GUC_MAX_LOG_BUFFER@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jae	LBB0_14
## %bb.4:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%r15, %rcx
	addq	%rax, %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	addq	%rbx, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	-48(%rbp), %r13d                ## 4-byte Reload
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	subl	%r14d, %r13d
	movl	%r14d, %esi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	leaq	(%r15,%rsi), %rdi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	addq	%r14, %rsi
	movl	%r13d, %edx
	callq	_i915_memcpy_from_wc
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	addq	%rax, %r14
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	addq	%rax, %r15
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	incq	%r12
	movq	_GUC_MAX_LOG_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$24, %rbx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	addq	$24, %r15
	cmpq	%rax, %r12
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	jae	LBB0_14
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-104(%rbp), %rdi
	movq	%rbx, %rsi
	movl	$24, %edx
	callq	_memcpy
	movl	%r12d, %edi
	callq	_guc_get_log_buffer_size
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	-104(%rbp), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	-100(%rbp), %r13d
	movl	-96(%rbp), %edx
	movl	-88(%rbp), %eax
	movq	16(%r14), %rcx
	addl	%eax, (%rcx,%r12,4)
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_guc_check_log_buf_overflow
	movl	%eax, %r14d
	movl	%r13d, (%rbx)
	movq	$0, 16(%rbx)
	movq	%r15, %rdi
	leaq	-104(%rbp), %rsi
	movl	$24, %edx
	callq	_memcpy
	movl	%r13d, 12(%r15)
	movl	%r14d, %edi
	callq	_unlikely
	xorl	%r14d, %r14d
	testq	%rax, %rax
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	cmpl	%r15d, -44(%rbp)                ## 4-byte Folded Reload
	seta	%al
	cmpl	%r15d, %r13d
	seta	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_12
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpl	-44(%rbp), %r13d                ## 4-byte Folded Reload
	jae	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_i915_memcpy_from_wc
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%r15d, %r13d
	jmp	LBB0_13
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_13
LBB0_14:
	movq	%r14, %rdi
	callq	_guc_move_to_next_buf
LBB0_15:
	movq	%r14, %rdi
	callq	_mutex_unlock
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no sub-buffer to capture logs\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_GUC_ISR_LOG_BUFFER,4,2         ## @GUC_ISR_LOG_BUFFER
	.comm	_GUC_MAX_LOG_BUFFER,4,2         ## @GUC_MAX_LOG_BUFFER
L_.str.1:                               ## @.str.1
	.asciz	"invalid log buffer state\n"

	.no_dead_strip	_guc_read_update_log_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function guc_read_update_log_buffer
_guc_read_update_log_buffer:            ; @guc_read_update_log_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x19, x0
	bl	_mutex_lock
	mov	x0, x19
	bl	_intel_guc_log_relay_enabled
	cmp	w0, #0
	cset	w0, eq
	bl	_WARN_ON
	cbnz	x0, LBB0_14
; %bb.1:
	ldr	x20, [x19, #8]
	mov	x0, x19
	bl	_guc_get_write_buffer
	mov	x21, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR_RATELIMITED
	ldr	w8, [x19, #4]
	add	w8, w8, #1
	str	w8, [x19, #4]
	b	LBB0_14
LBB0_3:
Lloh2:
	adrp	x8, _GUC_ISR_LOG_BUFFER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GUC_ISR_LOG_BUFFER@GOTPAGEOFF]
Lloh4:
	ldr	w22, [x8]
Lloh5:
	adrp	x8, _GUC_MAX_LOG_BUFFER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GUC_MAX_LOG_BUFFER@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w22, w8
	b.hs	LBB0_13
; %bb.4:
Lloh8:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh10:
	ldrsw	x8, [x8]
	add	x23, x21, x8
	add	x24, x20, x8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	mov	x1, x20
	mov	w2, #24
	bl	_memcpy
	mov	x0, x22
	bl	_guc_get_log_buffer_size
	mov	x26, x0
	ldp	w25, w27, [sp, #8]
	ldr	w2, [sp, #16]
	ldr	w8, [sp, #24]
	ldr	x9, [x19, #16]
	lsl	x10, x22, #2
	ldr	w11, [x9, x10]
	add	w8, w11, w8
	str	w8, [x9, x10]
	mov	x0, x19
	mov	x1, x22
	bl	_guc_check_log_buf_overflow
	mov	x28, x0
	str	w27, [x20]
	str	xzr, [x20, #16]
	add	x1, sp, #8
	mov	x0, x21
	mov	w2, #24
	bl	_memcpy
	str	w27, [x21, #12]
	mov	x0, x28
	bl	_unlikely
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w25, #0
	b	LBB0_11
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmp	w25, w26
	ccmp	w27, w26, #2, ls
	cset	w0, hi
	bl	_unlikely
	cbz	x0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	mov	w25, #0
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmp	w27, w25
	b.hs	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	mov	x1, x24
	mov	x2, x27
	bl	_i915_memcpy_from_wc
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, x26
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	sub	w2, w27, w25
	mov	w8, w25
	add	x0, x23, x8
	add	x1, x24, x8
	bl	_i915_memcpy_from_wc
	mov	w8, w26
	add	x24, x24, x8
	add	x23, x23, x8
	add	x22, x22, #1
Lloh13:
	adrp	x8, _GUC_MAX_LOG_BUFFER@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GUC_MAX_LOG_BUFFER@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	add	x20, x20, #24
	add	x21, x21, #24
	cmp	x22, x8
	b.lo	LBB0_5
LBB0_13:
	mov	x0, x19
	bl	_guc_move_to_next_buf
LBB0_14:
	mov	x0, x19
	bl	_mutex_unlock
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no sub-buffer to capture logs\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GUC_ISR_LOG_BUFFER,4,2         ; @GUC_ISR_LOG_BUFFER
	.comm	_GUC_MAX_LOG_BUFFER,4,2         ; @GUC_MAX_LOG_BUFFER
l_.str.1:                               ; @.str.1
	.asciz	"invalid log buffer state\n"

	.no_dead_strip	_guc_read_update_log_buffer
.subsections_via_symbols
