	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zoran_close_end_session
_zoran_close_end_session:               ## @zoran_close_end_session
	.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, %rbx
	movq	32(%rdi), %r14
	movq	_ZORAN_FREE@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	cmpq	%rax, (%rdi)
	je	LBB0_4
## %bb.1:
	movq	%rax, (%r14)
	movq	%rax, (%rbx)
	movq	$0, 64(%r14)
	cmpl	$0, 56(%r14)
	jne	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_zr36057_overlay
LBB0_3:
	movq	$0, 48(%r14)
LBB0_4:
	movq	_ZORAN_MAP_MODE_RAW@GOTPCREL(%rip), %rdx
	movq	8(%rbx), %rsi
	movq	16(%rbx), %rax
	movq	(%r12), %rcx
	cmpq	(%rdx), %rsi
	jne	LBB0_9
## %bb.5:
	cmpq	%rcx, %rax
	je	LBB0_7
## %bb.6:
	leaq	24(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_zr36057_set_memgrab
	movq	$0, 40(%r14)
	movq	(%r12), %rax
	movq	%rax, 16(%rbx)
	movq	%rax, 32(%r14)
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
LBB0_7:
	cmpq	$0, 24(%rbx)
	je	LBB0_12
## %bb.8:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_v4l_fbuffer_free               ## TAILCALL
LBB0_9:
	cmpq	%rcx, %rax
	je	LBB0_11
## %bb.10:
	movq	_BUZ_MODE_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_zr36057_enable_jpg
	movq	$0, 16(%r14)
	movq	(%r12), %rax
	movq	%rax, 16(%rbx)
	movq	%rax, 8(%r14)
LBB0_11:
	cmpq	$0, 24(%rbx)
	je	LBB0_12
## %bb.13:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_jpg_fbuffer_free               ## TAILCALL
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ZORAN_FREE,8,3                 ## @ZORAN_FREE
	.comm	_ZORAN_MAP_MODE_RAW,8,3         ## @ZORAN_MAP_MODE_RAW
	.comm	_BUZ_MODE_IDLE,4,2              ## @BUZ_MODE_IDLE
	.no_dead_strip	_zoran_close_end_session
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zoran_close_end_session
_zoran_close_end_session:               ; @zoran_close_end_session
	.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
	ldr	x20, [x0, #32]
	ldr	x9, [x0]
Lloh0:
	adrp	x22, _ZORAN_FREE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ZORAN_FREE@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x9, x8
	b.eq	LBB0_4
; %bb.1:
	str	x8, [x20]
	str	x8, [x19]
	str	xzr, [x20, #64]
	ldr	w8, [x20, #56]
	cbnz	w8, LBB0_3
; %bb.2:
	mov	x0, x20
	mov	w1, #0
	bl	_zr36057_overlay
LBB0_3:
	str	xzr, [x20, #48]
LBB0_4:
Lloh2:
	adrp	x8, _ZORAN_MAP_MODE_RAW@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ZORAN_MAP_MODE_RAW@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x8]
	ldp	x11, x8, [x19, #8]
	ldr	x9, [x22]
	cmp	x11, x10
	b.ne	LBB0_9
; %bb.5:
	cmp	x8, x9
	b.eq	LBB0_7
; %bb.6:
	add	x21, x20, #24
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x20
	mov	w1, #0
	bl	_zr36057_set_memgrab
	ldr	x8, [x22]
	str	x8, [x19, #16]
	stp	x8, xzr, [x20, #32]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
LBB0_7:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_13
; %bb.8:
	mov	x0, x19
	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
	b	_v4l_fbuffer_free
LBB0_9:
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.10:
Lloh5:
	adrp	x8, _BUZ_MODE_IDLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BUZ_MODE_IDLE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_zr36057_enable_jpg
	ldr	x8, [x22]
	str	x8, [x19, #16]
	stp	x8, xzr, [x20, #8]
LBB0_11:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_13
; %bb.12:
	mov	x0, x19
	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
	b	_jpg_fbuffer_free
LBB0_13:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ZORAN_FREE,8,3                 ; @ZORAN_FREE
	.comm	_ZORAN_MAP_MODE_RAW,8,3         ; @ZORAN_MAP_MODE_RAW
	.comm	_BUZ_MODE_IDLE,4,2              ; @BUZ_MODE_IDLE
	.no_dead_strip	_zoran_close_end_session
.subsections_via_symbols
