	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function occ_getsram
_occ_getsram:                           ## @occ_getsram
	.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
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leal	7(%rcx), %eax
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	leal	14(%rcx), %r14d
	testl	%eax, %eax
	cmovnsl	%eax, %r14d
	movl	%r14d, %ebx
	sarl	$3, %ebx
	andl	$-8, %r14d
	movl	$5, %edi
	callq	_cpu_to_be32
	movl	%eax, -80(%rbp)
	movq	_SBEFIFO_CMD_GET_OCC_SRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_be32
	movl	%eax, -76(%rbp)
	movl	$1, %edi
	callq	_cpu_to_be32
	movl	%eax, -72(%rbp)
	movl	%r15d, %edi
	callq	_cpu_to_be32
	movl	%eax, -68(%rbp)
	movl	%r14d, %edi
	callq	_cpu_to_be32
	movl	%eax, -64(%rbp)
	movslq	%ebx, %rax
	movq	_OCC_SBE_STATUS_WORDS@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	leaq	(%rcx,%rax,2), %rdi
	movq	%rdi, -88(%rbp)
	shlq	$2, %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movl	4(%r12), %edi
	leaq	-80(%rbp), %rsi
	leaq	-88(%rbp), %r8
	movl	$5, %edx
	movq	%rax, %rcx
	callq	_sbefifo_submit
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movl	4(%r12), %edi
	movq	_SBEFIFO_CMD_GET_OCC_SRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-88(%rbp), %rcx
	leaq	-88(%rbp), %r8
	movq	%r13, %rdx
	callq	_sbefifo_parse_status
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_4
LBB0_6:
	testl	%r15d, %r15d
	jle	LBB0_8
LBB0_7:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r15d
LBB0_8:
	movq	%r13, %rdi
	callq	_kfree
	jmp	LBB0_9
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.10:
	movl	%r15d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	-88(%rbp), %rax
	movl	-4(%r13,%rax,4), %edi
	callq	_be32_to_cpu
	movslq	%r14d, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_5
## %bb.11:
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	-104(%rbp), %rdx                ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	xorl	%r15d, %r15d
	jmp	LBB0_8
LBB0_5:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movl	%r14d, %edx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	testl	%r15d, %r15d
	jg	LBB0_7
	jmp	LBB0_8
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SBEFIFO_CMD_GET_OCC_SRAM,4,2   ## @SBEFIFO_CMD_GET_OCC_SRAM
	.comm	_OCC_SBE_STATUS_WORDS,4,2       ## @OCC_SBE_STATUS_WORDS
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SRAM read expected %d bytes got %zd\n"

	.comm	_EBADMSG,4,2                    ## @EBADMSG
L_.str.1:                               ## @.str.1
	.asciz	"SRAM read returned failure status: %08x\n"

	.no_dead_strip	_occ_getsram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function occ_getsram
_occ_getsram:                           ; @occ_getsram
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	mov	x20, x3
	mov	x21, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	add	w8, w3, #7
	add	w9, w3, #14
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w24, w8, #3
	and	w22, w8, #0xfffffff8
	mov	w0, #5
	bl	_cpu_to_be32
	str	w0, [sp, #20]
Lloh3:
	adrp	x25, _SBEFIFO_CMD_GET_OCC_SRAM@GOTPAGE
Lloh4:
	ldr	x25, [x25, _SBEFIFO_CMD_GET_OCC_SRAM@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_cpu_to_be32
	str	w0, [sp, #24]
	mov	w0, #1
	bl	_cpu_to_be32
	str	w0, [sp, #28]
	mov	x0, x23
	bl	_cpu_to_be32
	str	w0, [sp, #32]
	mov	x0, x22
	bl	_cpu_to_be32
	str	w0, [sp, #36]
Lloh5:
	adrp	x8, _OCC_SBE_STATUS_WORDS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _OCC_SBE_STATUS_WORDS@GOTPAGEOFF]
Lloh7:
	ldrsw	x8, [x8]
	add	x8, x8, w24, sxtw #1
	str	x8, [sp, #8]
	lsl	x0, x8, #2
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x23, x0
	ldr	w0, [x19, #4]
	add	x1, sp, #20
	add	x4, sp, #8
	mov	w2, #5
	mov	x3, x23
	bl	_sbefifo_submit
	mov	x24, x0
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w0, [x19, #4]
	ldr	w1, [x25]
	ldr	x3, [sp, #8]
	add	x4, sp, #8
	mov	x2, x23
	bl	_sbefifo_parse_status
	mov	x24, x0
	cbz	w0, LBB0_9
LBB0_3:
	cmp	w24, #1
	b.lt	LBB0_5
LBB0_4:
	ldr	w0, [x19]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x24
	bl	_dev_err
Lloh13:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_5:
	mov	x0, x23
	bl	_kfree
	b	LBB0_7
LBB0_6:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_7:
	ldr	x8, [sp, #40]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.8:
	mov	x0, x24
	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
	add	sp, sp, #128
	ret
LBB0_9:
	ldr	x8, [sp, #8]
	add	x8, x23, x8, lsl #2
	ldur	w0, [x8, #-4]
	bl	_be32_to_cpu
	cmp	x0, w22, sxtw
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x21
	mov	x1, x23
	mov	x2, x20
	bl	_memcpy
	mov	w24, #0
	b	LBB0_5
LBB0_11:
	ldr	w8, [x19]
	str	x0, [sp]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	mov	x2, x22
	bl	_dev_err
Lloh24:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w24, w8
	cmp	w24, #1
	b.ge	LBB0_4
	b	LBB0_5
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_SBEFIFO_CMD_GET_OCC_SRAM,4,2   ; @SBEFIFO_CMD_GET_OCC_SRAM
	.comm	_OCC_SBE_STATUS_WORDS,4,2       ; @OCC_SBE_STATUS_WORDS
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SRAM read expected %d bytes got %zd\n"

	.comm	_EBADMSG,4,2                    ; @EBADMSG
l_.str.1:                               ; @.str.1
	.asciz	"SRAM read returned failure status: %08x\n"

	.no_dead_strip	_occ_getsram
.subsections_via_symbols
