	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function se401_newframe
_se401_newframe:                        ## @se401_newframe
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_wait@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DECLARE_WAITQUEUE
	cmpq	$0, 72(%rbx)
	je	LBB0_1
## %bb.2:
	movslq	%r14d, %r13
	leaq	64(%rbx), %r14
	xorl	%r15d, %r15d
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	shlq	$4, %r13
	movq	_BUFFER_READY@GOTPCREL(%rip), %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	$0, 8(%rbx)
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %r12d
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	48(%rbx), %rdi
	callq	_dev_info
	movq	%rbx, %rdi
	callq	_se401_stop_stream
	movq	%rbx, %rdi
	callq	_se401_start_stream
	movl	%r12d, %r15d
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, 72(%rbx)
	movq	_BUFFER_READY@GOTPCREL(%rip), %r12
	je	LBB0_15
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%rbx), %rax
	movq	(%rax,%r13), %rcx
	movq	_FRAME_READY@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_FRAME_GRABBING@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_15
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$1, 12(%rax,%r13)
	adcl	$0, %r15d
	movq	(%rbx), %rax
	movq	56(%rbx), %rcx
	movq	(%rcx,%rax,8), %rax
	xorl	%edi, %edi
	cmpq	(%r12), %rax
	setne	%dil
	movq	%r14, %rsi
	movq	_wait@GOTPCREL(%rip), %rdx
	callq	_wait_interruptible
	movq	8(%rbx), %rax
	movq	_SE401_MAX_NULLPACKETS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx), %rax
	movq	56(%rbx), %rcx
	movq	(%rcx,%rax,8), %rdx
	cmpq	(%r12), %rdx
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_BUFFER_BUSY@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, (%rcx,%rax,8)
	movq	16(%rbx), %rdx
	leaq	(%rcx,%rax,8), %rsi
	movq	_FMT_JANGGU@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_decode_JangGu
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_decode_bayer
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_BUFFER_UNUSED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	movq	56(%rbx), %rdx
	movq	%rax, (%rdx,%rcx,8)
	incq	%rcx
	movq	%rcx, (%rbx)
	xorl	%r12d, %r12d
	movq	_SE401_NUMSCRATCH@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	cmovaeq	%r12, %rcx
	movq	%rcx, (%rbx)
	leaq	L_.str.1(%rip), %rsi
	movq	_SE401_MAX_ERRORS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jg	LBB0_13
	jmp	LBB0_14
LBB0_15:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_1:
	movslq	%r14d, %rsi
LBB0_16:
	movq	32(%rbx), %rax
	shlq	$4, %rsi
	movq	(%rax,%rsi), %rcx
	movq	_FRAME_DONE@GOTPCREL(%rip), %rdx
	xorl	%r14d, %r14d
	cmpq	(%rdx), %rcx
	jne	LBB0_19
## %bb.17:
	cmpq	$0, 40(%rbx)
	je	LBB0_19
## %bb.18:
	movl	8(%rax,%rsi), %edi
	movl	24(%rbx), %eax
	imull	28(%rbx), %eax
	leal	(%rax,%rax,2), %esi
	callq	_enhance_picture
	jmp	LBB0_19
LBB0_8:
	movq	_FRAME_ERROR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	32(%rbx), %rcx
	movq	%rax, (%rcx,%r13)
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_wait,4,2                       ## @wait
	.comm	_current,4,2                    ## @current
	.comm	_FRAME_READY,8,3                ## @FRAME_READY
	.comm	_FRAME_GRABBING,8,3             ## @FRAME_GRABBING
	.comm	_BUFFER_READY,8,3               ## @BUFFER_READY
	.comm	_SE401_MAX_NULLPACKETS,8,3      ## @SE401_MAX_NULLPACKETS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"too many null length packets, restarting capture\n"

	.comm	_FRAME_ERROR,8,3                ## @FRAME_ERROR
	.comm	_EIO,4,2                        ## @EIO
	.comm	_BUFFER_BUSY,8,3                ## @BUFFER_BUSY
	.comm	_FMT_JANGGU,8,3                 ## @FMT_JANGGU
	.comm	_BUFFER_UNUSED,8,3              ## @BUFFER_UNUSED
	.comm	_SE401_NUMSCRATCH,8,3           ## @SE401_NUMSCRATCH
	.comm	_SE401_MAX_ERRORS,4,2           ## @SE401_MAX_ERRORS
L_.str.1:                               ## @.str.1
	.asciz	"too many errors, restarting capture\n"

	.comm	_FRAME_DONE,8,3                 ## @FRAME_DONE
	.no_dead_strip	_se401_newframe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function se401_newframe
_se401_newframe:                        ; @se401_newframe
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _wait@GOTPAGE
Lloh1:
	ldr	x8, [x8, _wait@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _current@GOTPAGE
Lloh4:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_DECLARE_WAITQUEUE
	ldr	x8, [x19, #72]
	cbz	x8, LBB0_13
; %bb.1:
	mov	w23, #0
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	sxtw	x22, w20
	add	x20, x19, #64
	lsl	x24, x22, #4
Lloh6:
	adrp	x25, _FRAME_READY@GOTPAGE
Lloh7:
	ldr	x25, [x25, _FRAME_READY@GOTPAGEOFF]
Lloh8:
	adrp	x26, _FRAME_GRABBING@GOTPAGE
Lloh9:
	ldr	x26, [x26, _FRAME_GRABBING@GOTPAGEOFF]
Lloh10:
	adrp	x27, _BUFFER_READY@GOTPAGE
Lloh11:
	ldr	x27, [x27, _BUFFER_READY@GOTPAGEOFF]
Lloh12:
	adrp	x21, _wait@GOTPAGE
Lloh13:
	ldr	x21, [x21, _wait@GOTPAGEOFF]
Lloh14:
	adrp	x28, _SE401_MAX_NULLPACKETS@GOTPAGE
Lloh15:
	ldr	x28, [x28, _SE401_MAX_NULLPACKETS@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	xzr, [x19, #8]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x19, #48]
	bl	_dev_info
	mov	x0, x19
	bl	_se401_stop_stream
	mov	x0, x19
	bl	_se401_start_stream
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #72]
	cbz	x8, LBB0_14
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	ldr	x9, [x8, x24]
	ldr	x10, [x25]
	ldr	x11, [x26]
	cmp	x9, x10
	ccmp	x9, x11, #4, ne
	b.ne	LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x8, x22, lsl #4
	ldr	w8, [x8, #12]
	cmp	w8, #0
	cinc	w23, w23, eq
	ldr	x8, [x19, #56]
	ldr	x9, [x19]
	ldr	x8, [x8, x9, lsl #3]
	ldr	x9, [x27]
	cmp	x8, x9
	cset	w0, ne
	mov	x1, x20
	mov	x2, x21
	bl	_wait_interruptible
	ldr	x8, [x19, #8]
	ldr	x9, [x28]
	cmp	x8, x9
	b.gt	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #56]
	ldr	x9, [x19]
	ldr	x10, [x8, x9, lsl #3]
	ldr	x11, [x27]
	cmp	x10, x11
	b.ne	LBB0_19
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh18:
	adrp	x10, _BUFFER_BUSY@GOTPAGE
Lloh19:
	ldr	x10, [x10, _BUFFER_BUSY@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x10]
	add	x1, x8, x9, lsl #3
	str	x10, [x1]
	ldr	x8, [x19, #16]
Lloh21:
	adrp	x9, _FMT_JANGGU@GOTPAGE
Lloh22:
	ldr	x9, [x9, _FMT_JANGGU@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	mov	x0, x19
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_decode_JangGu
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_decode_bayer
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh24:
	adrp	x8, _BUFFER_UNUSED@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BUFFER_UNUSED@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	ldr	x9, [x19, #56]
	ldr	x10, [x19]
	str	x8, [x9, x10, lsl #3]
	add	x8, x10, #1
	str	x8, [x19]
Lloh27:
	adrp	x9, _SE401_NUMSCRATCH@GOTPAGE
Lloh28:
	ldr	x9, [x9, _SE401_NUMSCRATCH@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x8, x9
	csinc	x8, xzr, x10, hs
	str	x8, [x19]
Lloh30:
	adrp	x8, _SE401_MAX_ERRORS@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SE401_MAX_ERRORS@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	cmp	w23, w8
	b.le	LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	w23, #0
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_3
LBB0_13:
	sxtw	x22, w20
LBB0_14:
	ldr	x8, [x19, #32]
	lsl	x9, x22, #4
	ldr	x9, [x8, x9]
Lloh35:
	adrp	x10, _FRAME_DONE@GOTPAGE
Lloh36:
	ldr	x10, [x10, _FRAME_DONE@GOTPAGEOFF]
Lloh37:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_17
; %bb.15:
	ldr	x9, [x19, #40]
	cbz	x9, LBB0_17
; %bb.16:
	add	x8, x8, x22, lsl #4
	ldr	w0, [x8, #8]
	ldp	w8, w9, [x19, #24]
	mul	w8, w8, w9
	add	w1, w8, w8, lsl #1
	bl	_enhance_picture
LBB0_17:
	mov	w0, #0
LBB0_18:
	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
LBB0_19:
Lloh38:
	adrp	x8, _FRAME_ERROR@GOTPAGE
Lloh39:
	ldr	x8, [x8, _FRAME_ERROR@GOTPAGEOFF]
Lloh40:
	ldr	x8, [x8]
	ldr	x9, [x19, #32]
	str	x8, [x9, x24]
Lloh41:
	adrp	x8, _EIO@GOTPAGE
Lloh42:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_wait,4,2                       ; @wait
	.comm	_current,4,2                    ; @current
	.comm	_FRAME_READY,8,3                ; @FRAME_READY
	.comm	_FRAME_GRABBING,8,3             ; @FRAME_GRABBING
	.comm	_BUFFER_READY,8,3               ; @BUFFER_READY
	.comm	_SE401_MAX_NULLPACKETS,8,3      ; @SE401_MAX_NULLPACKETS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"too many null length packets, restarting capture\n"

	.comm	_FRAME_ERROR,8,3                ; @FRAME_ERROR
	.comm	_EIO,4,2                        ; @EIO
	.comm	_BUFFER_BUSY,8,3                ; @BUFFER_BUSY
	.comm	_FMT_JANGGU,8,3                 ; @FMT_JANGGU
	.comm	_BUFFER_UNUSED,8,3              ; @BUFFER_UNUSED
	.comm	_SE401_NUMSCRATCH,8,3           ; @SE401_NUMSCRATCH
	.comm	_SE401_MAX_ERRORS,4,2           ; @SE401_MAX_ERRORS
l_.str.1:                               ; @.str.1
	.asciz	"too many errors, restarting capture\n"

	.comm	_FRAME_DONE,8,3                 ; @FRAME_DONE
	.no_dead_strip	_se401_newframe
.subsections_via_symbols
