	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov51x_v4l1_open
_ov51x_v4l1_open:                       ## @ov51x_v4l1_open
	.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
	movq	%rdi, %r15
	callq	_video_devdata
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_video_get_drvdata
	movq	%rax, %r13
	leaq	L_.str(%rip), %rsi
	movl	$4, %edi
	callq	_PDEBUG
	leaq	8(%r13), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpq	$0, 16(%r13)
	je	LBB0_3
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_2
LBB0_3:
	movq	$0, 48(%r13)
	movq	%r13, %rdi
	callq	_ov51x_set_default_params
	testl	%eax, %eax
	js	LBB0_13
## %bb.4:
	movq	_OV511_NUMFRAMES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_7
## %bb.5:
	movq	40(%r13), %rcx
	addq	$8, %rcx
	xorl	%edx, %edx
	movq	_FRAME_UNUSED@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %edi
	movl	%edi, (%rcx)
	movq	$0, -8(%rcx)
	incq	%rdx
	movslq	(%rax), %rdi
	addq	$16, %rcx
	cmpq	%rdi, %rdx
	jl	LBB0_6
LBB0_7:
	cmpq	$0, 32(%r13)
	je	LBB0_9
## %bb.8:
	cmpl	$0, 24(%r13)
	je	LBB0_14
LBB0_9:
	movq	%r13, %rdi
	callq	_ov51x_alloc
	testl	%eax, %eax
	js	LBB0_13
## %bb.10:
	movq	%r13, %rdi
	callq	_ov51x_init_isoc
	testl	%eax, %eax
	je	LBB0_16
## %bb.11:
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_ov51x_dealloc
	jmp	LBB0_2
LBB0_13:
	movl	%eax, %ebx
LBB0_2:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	%r13, %rdi
	callq	_request_decompressor
	testl	%eax, %eax
	je	LBB0_9
## %bb.15:
	movl	%eax, %ebx
	movq	_dumppix@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_2
	jmp	LBB0_9
LBB0_16:
	incq	16(%r13)
	movq	%r12, (%r15)
	movq	(%r13), %rax
	movq	_LED_AUTO@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.17:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_ov51x_led_control
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"opening"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_OV511_NUMFRAMES,4,2            ## @OV511_NUMFRAMES
	.comm	_FRAME_UNUSED,4,2               ## @FRAME_UNUSED
	.comm	_dumppix,4,2                    ## @dumppix
	.comm	_LED_AUTO,8,3                   ## @LED_AUTO
	.no_dead_strip	_ov51x_v4l1_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov51x_v4l1_open
_ov51x_v4l1_open:                       ; @ov51x_v4l1_open
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x0
	bl	_video_devdata
	mov	x22, x0
	bl	_video_get_drvdata
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #4
	bl	_PDEBUG
	add	x19, x20, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_12
LBB0_2:
	str	xzr, [x20, #48]
	mov	x0, x20
	bl	_ov51x_set_default_params
	tbnz	w0, #31, LBB0_11
; %bb.3:
Lloh5:
	adrp	x8, _OV511_NUMFRAMES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _OV511_NUMFRAMES@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.4:
	mov	x9, #0
	ldr	x10, [x20, #40]
	add	x10, x10, #8
Lloh7:
	adrp	x11, _FRAME_UNUSED@GOTPAGE
Lloh8:
	ldr	x11, [x11, _FRAME_UNUSED@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	str	w12, [x10]
	stur	xzr, [x10, #-8]
	add	x9, x9, #1
	ldrsw	x12, [x8]
	add	x10, x10, #16
	cmp	x9, x12
	b.lt	LBB0_5
LBB0_6:
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_8
; %bb.7:
	ldr	w8, [x20, #24]
	cbz	w8, LBB0_13
LBB0_8:
	mov	x0, x20
	bl	_ov51x_alloc
	tbnz	w0, #31, LBB0_11
; %bb.9:
	mov	x0, x20
	bl	_ov51x_init_isoc
	cbz	w0, LBB0_15
; %bb.10:
	mov	x23, x0
	mov	x0, x20
	bl	_ov51x_dealloc
	b	LBB0_12
LBB0_11:
	mov	x23, x0
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_13:
	mov	x0, x20
	bl	_request_decompressor
	cbz	w0, LBB0_8
; %bb.14:
	mov	x23, x0
Lloh9:
	adrp	x8, _dumppix@GOTPAGE
Lloh10:
	ldr	x8, [x8, _dumppix@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cbz	w8, LBB0_12
	b	LBB0_8
LBB0_15:
	ldr	x8, [x20, #16]
	add	x8, x8, #1
	str	x8, [x20, #16]
	str	x22, [x21]
	ldr	x8, [x20]
Lloh12:
	adrp	x9, _LED_AUTO@GOTPAGE
Lloh13:
	ldr	x9, [x9, _LED_AUTO@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x20
	mov	w1, #1
	bl	_ov51x_led_control
LBB0_17:
	mov	w23, #0
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"opening"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_OV511_NUMFRAMES,4,2            ; @OV511_NUMFRAMES
	.comm	_FRAME_UNUSED,4,2               ; @FRAME_UNUSED
	.comm	_dumppix,4,2                    ; @dumppix
	.comm	_LED_AUTO,8,3                   ; @LED_AUTO
	.no_dead_strip	_ov51x_v4l1_open
.subsections_via_symbols
