	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gspca_auto_gain_n_exposure     ## -- Begin function gspca_auto_gain_n_exposure
	.p2align	4, 0x90
_gspca_auto_gain_n_exposure:            ## @gspca_auto_gain_n_exposure
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -64(%rbp)                 ## 4-byte Spill
	movl	%r8d, -60(%rbp)                 ## 4-byte Spill
	movl	%ecx, -68(%rbp)                 ## 4-byte Spill
	movl	%edx, -76(%rbp)                 ## 4-byte Spill
	movl	%esi, -72(%rbp)                 ## 4-byte Spill
	movq	8(%rdi), %r11
	movl	(%r11), %edx
	testl	%edx, %edx
	jle	LBB0_8
## %bb.1:
	movq	%rdi, %r15
	movl	(%rdi), %ecx
	movq	_V4L2_CID_GAIN@GOTPCREL(%rip), %rsi
	movq	(%rsi), %r8
	movq	_V4L2_CID_EXPOSURE@GOTPCREL(%rip), %rsi
	movq	(%rsi), %r9
	movq	_V4L2_CID_AUTOGAIN@GOTPCREL(%rip), %rsi
	movq	(%rsi), %r10
	shlq	$3, %rdx
	leaq	(%rdx,%rdx,4), %rbx
	xorl	%edx, %edx
	xorl	%esi, %esi
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%esi
	addq	$40, %rdx
	cmpq	%rdx, %rbx
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	btl	%esi, %ecx
	jb	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r11), %rdi
	movq	8(%rdi,%rdx), %rax
	addq	%rdx, %rdi
	cmpq	%r8, %rax
	cmoveq	%rdi, %r13
	cmpq	%r9, %rax
	cmoveq	%rdi, %r12
	cmpq	%r10, %rax
	cmoveq	%rdi, %r14
	jmp	LBB0_4
LBB0_5:
	testq	%r13, %r13
	je	LBB0_8
## %bb.6:
	testq	%r12, %r12
	je	LBB0_8
## %bb.7:
	testq	%r14, %r14
	je	LBB0_8
## %bb.9:
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	callq	*32(%r13)
	movq	%r15, %rbx
	xorl	%r15d, %r15d
	testq	%rax, %rax
	jne	LBB0_37
## %bb.10:
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	*32(%r12)
	testq	%rax, %rax
	jne	LBB0_37
## %bb.11:
	leaq	-80(%rbp), %rsi
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	*32(%r14)
	testq	%rax, %rax
	jne	LBB0_37
## %bb.12:
	cmpl	$0, -80(%rbp)
	je	LBB0_37
## %bb.13:
	movl	-44(%rbp), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	-48(%rbp), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	-76(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %ecx
	movl	-72(%rbp), %ebx                 ## 4-byte Reload
	subl	%ebx, %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovsl	%ecx, %eax
	cltd
	idivl	-68(%rbp)                       ## 4-byte Folded Reload
	movl	%eax, %r14d
	movq	_D_FRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	xorl	%eax, %eax
	callq	_PDEBUG
	testl	%r14d, %r14d
	jle	LBB0_14
## %bb.15:
	movl	-48(%rbp), %eax
	movl	-44(%rbp), %esi
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_16
LBB0_8:
	movq	_D_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_PDEBUG
LBB0_37:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_29:                                ##   in Loop: Header=BB0_16 Depth=1
	cmpl	24(%r13), %esi
	jge	LBB0_33
LBB0_30:                                ##   in Loop: Header=BB0_16 Depth=1
	incl	%esi
LBB0_31:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	%esi, -44(%rbp)
LBB0_32:                                ##   in Loop: Header=BB0_16 Depth=1
	decl	%r14d
	je	LBB0_33
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%ebx, %r15d
	jge	LBB0_24
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	cmpl	%edx, %esi
	jle	LBB0_19
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	decl	%esi
	jmp	LBB0_31
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_16 Depth=1
	cmpl	16(%r13), %esi
	jl	LBB0_30
## %bb.25:                              ##   in Loop: Header=BB0_16 Depth=1
	cmpl	%ecx, %eax
	jge	LBB0_27
LBB0_26:                                ##   in Loop: Header=BB0_16 Depth=1
	incl	%eax
	movl	%eax, -48(%rbp)
	jmp	LBB0_32
LBB0_19:                                ##   in Loop: Header=BB0_16 Depth=1
	cmpl	%ecx, %eax
	jle	LBB0_21
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	decl	%eax
	movl	%eax, -48(%rbp)
	jmp	LBB0_32
LBB0_27:                                ##   in Loop: Header=BB0_16 Depth=1
	cmpl	%edx, %esi
	jl	LBB0_30
## %bb.28:                              ##   in Loop: Header=BB0_16 Depth=1
	cmpl	24(%r12), %eax
	jge	LBB0_29
	jmp	LBB0_26
LBB0_21:                                ##   in Loop: Header=BB0_16 Depth=1
	cmpl	16(%r13), %esi
	jg	LBB0_18
## %bb.22:                              ##   in Loop: Header=BB0_16 Depth=1
	cmpl	20(%r12), %eax
	jg	LBB0_20
## %bb.23:                              ##   in Loop: Header=BB0_16 Depth=1
	cmpl	20(%r13), %esi
	jg	LBB0_18
	jmp	LBB0_33
LBB0_14:
	movl	-44(%rbp), %esi
	movl	-52(%rbp), %edi                 ## 4-byte Reload
LBB0_33:
	xorl	%r15d, %r15d
	cmpl	%edi, %esi
	je	LBB0_35
## %bb.34:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	*(%r13)
	movl	$1, %r15d
LBB0_35:
	movl	-48(%rbp), %esi
	cmpl	-56(%rbp), %esi                 ## 4-byte Folded Reload
	je	LBB0_37
## %bb.36:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	*(%r12)
	movl	$1, %r15d
	jmp	LBB0_37
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_CID_GAIN,8,3              ## @V4L2_CID_GAIN
	.comm	_V4L2_CID_EXPOSURE,8,3          ## @V4L2_CID_EXPOSURE
	.comm	_V4L2_CID_AUTOGAIN,8,3          ## @V4L2_CID_AUTOGAIN
	.comm	_D_ERR,4,2                      ## @D_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error: gspca_auto_gain_n_exposure called on cam without (auto)gain/exposure"

	.comm	_D_FRAM,4,2                     ## @D_FRAM
L_.str.1:                               ## @.str.1
	.asciz	"autogain: lum: %d, desired: %d, steps: %d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gspca_auto_gain_n_exposure     ; -- Begin function gspca_auto_gain_n_exposure
	.p2align	2
_gspca_auto_gain_n_exposure:            ; @gspca_auto_gain_n_exposure
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	ldr	x8, [x0, #8]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x20, x5
	mov	x21, x4
	mov	x24, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	mov	x10, #0
	mov	x27, #0
	mov	x25, #0
	mov	x26, #0
	ldr	w11, [x0]
Lloh0:
	adrp	x12, _V4L2_CID_GAIN@GOTPAGE
Lloh1:
	ldr	x12, [x12, _V4L2_CID_GAIN@GOTPAGEOFF]
Lloh2:
	adrp	x13, _V4L2_CID_EXPOSURE@GOTPAGE
Lloh3:
	ldr	x13, [x13, _V4L2_CID_EXPOSURE@GOTPAGEOFF]
Lloh4:
	ldr	x12, [x12]
Lloh5:
	ldr	x13, [x13]
Lloh6:
	adrp	x14, _V4L2_CID_AUTOGAIN@GOTPAGE
Lloh7:
	ldr	x14, [x14, _V4L2_CID_AUTOGAIN@GOTPAGEOFF]
Lloh8:
	ldr	x14, [x14]
	mov	w15, #8
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x10, x10, #1
	add	x15, x15, #40
	cmp	x9, x10
	b.eq	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsr	w16, w11, w10
	tbnz	w16, #0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x16, [x8, #8]
	add	x16, x16, x15
	ldr	x17, [x16], #-8
	cmp	x17, x12
	csel	x26, x16, x26, eq
	cmp	x17, x13
	csel	x25, x16, x25, eq
	cmp	x17, x14
	csel	x27, x16, x27, eq
	b	LBB0_2
LBB0_5:
	cbz	x26, LBB0_14
; %bb.6:
	cbz	x25, LBB0_14
; %bb.7:
	cbz	x27, LBB0_14
; %bb.8:
	ldr	x8, [x26, #32]
	add	x1, sp, #44
	mov	x0, x19
	blr	x8
	cbnz	x0, LBB0_15
; %bb.9:
	ldr	x8, [x25, #32]
	add	x1, sp, #40
	mov	x0, x19
	blr	x8
	cbnz	x0, LBB0_15
; %bb.10:
	ldr	x8, [x27, #32]
	add	x1, sp, #36
	mov	x0, x19
	blr	x8
	mov	x8, x0
	mov	w0, #0
	cbnz	x8, LBB0_16
; %bb.11:
	ldr	w8, [sp, #36]
	cbz	w8, LBB0_16
; %bb.12:
	ldp	w27, w28, [sp, #40]
	subs	w8, w22, w23
	cneg	w8, w8, mi
Lloh9:
	adrp	x9, _D_FRAM@GOTPAGE
Lloh10:
	ldr	x9, [x9, _D_FRAM@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x9]
	sdiv	w24, w8, w24
	stp	x23, x22, [sp]
	str	x24, [sp, #16]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_PDEBUG
	cmp	w24, #0
	b.le	LBB0_34
; %bb.13:
	ldp	w8, w1, [sp, #40]
	b	LBB0_21
LBB0_14:
Lloh14:
	adrp	x8, _D_ERR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _D_ERR@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PDEBUG
LBB0_15:
	mov	w0, #0
LBB0_16:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_17:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	w9, [x26, #24]
	cmp	w1, w9
	b.ge	LBB0_35
LBB0_18:                                ;   in Loop: Header=BB0_21 Depth=1
	add	w1, w1, #1
LBB0_19:                                ;   in Loop: Header=BB0_21 Depth=1
	str	w1, [sp, #44]
LBB0_20:                                ;   in Loop: Header=BB0_21 Depth=1
	subs	w24, w24, #1
	b.eq	LBB0_35
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	cmp	w22, w23
	b.ge	LBB0_24
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	cmp	w1, w21
	b.le	LBB0_27
LBB0_23:                                ;   in Loop: Header=BB0_21 Depth=1
	sub	w1, w1, #1
	b	LBB0_19
LBB0_24:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	w9, [x26, #16]
	cmp	w1, w9
	b.lt	LBB0_18
; %bb.25:                               ;   in Loop: Header=BB0_21 Depth=1
	cmp	w8, w20
	b.ge	LBB0_29
LBB0_26:                                ;   in Loop: Header=BB0_21 Depth=1
	add	w8, w8, #1
	str	w8, [sp, #40]
	b	LBB0_20
LBB0_27:                                ;   in Loop: Header=BB0_21 Depth=1
	cmp	w8, w20
	b.le	LBB0_31
LBB0_28:                                ;   in Loop: Header=BB0_21 Depth=1
	sub	w8, w8, #1
	str	w8, [sp, #40]
	b	LBB0_20
LBB0_29:                                ;   in Loop: Header=BB0_21 Depth=1
	cmp	w1, w21
	b.lt	LBB0_18
; %bb.30:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	w9, [x25, #24]
	cmp	w8, w9
	b.ge	LBB0_17
	b	LBB0_26
LBB0_31:                                ;   in Loop: Header=BB0_21 Depth=1
	ldr	w9, [x26, #16]
	cmp	w1, w9
	b.gt	LBB0_23
; %bb.32:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	w9, [x25, #20]
	cmp	w8, w9
	b.gt	LBB0_28
; %bb.33:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	w9, [x26, #20]
	cmp	w1, w9
	b.gt	LBB0_23
	b	LBB0_35
LBB0_34:
	ldr	w1, [sp, #44]
LBB0_35:
	cmp	w1, w28
	b.ne	LBB0_37
; %bb.36:
	mov	w0, #0
	b	LBB0_38
LBB0_37:
	ldr	x8, [x26]
	mov	x0, x19
	blr	x8
	mov	w0, #1
LBB0_38:
	ldr	w1, [sp, #40]
	cmp	w1, w27
	b.eq	LBB0_16
; %bb.39:
	ldr	x8, [x25]
	mov	x0, x19
	blr	x8
	mov	w0, #1
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_CID_GAIN,8,3              ; @V4L2_CID_GAIN
	.comm	_V4L2_CID_EXPOSURE,8,3          ; @V4L2_CID_EXPOSURE
	.comm	_V4L2_CID_AUTOGAIN,8,3          ; @V4L2_CID_AUTOGAIN
	.comm	_D_ERR,4,2                      ; @D_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error: gspca_auto_gain_n_exposure called on cam without (auto)gain/exposure"

	.comm	_D_FRAM,4,2                     ; @D_FRAM
l_.str.1:                               ; @.str.1
	.asciz	"autogain: lum: %d, desired: %d, steps: %d"

.subsections_via_symbols
