	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function konicawc_adjust_picture
_konicawc_adjust_picture:               ## @konicawc_adjust_picture
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	callq	_konicawc_camera_off
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DEBUG
	movl	(%rbx), %eax
	movq	_MAX_BRIGHTNESS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	movl	%ecx, (%rbx)
	movslq	%ecx, %rax
	imulq	$780903145, %rax, %rdx          ## imm = 0x2E8BA2E9
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$33, %rdx
	addl	%eax, %edx
	cmpl	%edx, (%r14)
	je	LBB0_2
## %bb.1:
	movl	%edx, (%r14)
	leal	(%rdx,%rdx,4), %eax
	leal	(%rdx,%rax,2), %ecx
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_DEBUG
	movl	(%r14), %esi
	movq	_SetBrightness@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_konicawc_set_value
LBB0_2:
	movl	4(%rbx), %edx
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_DEBUG
	movl	4(%rbx), %eax
	movq	_MAX_CONTRAST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	movl	%ecx, 4(%rbx)
	movslq	%ecx, %rax
	imulq	$780903145, %rax, %rdx          ## imm = 0x2E8BA2E9
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$33, %rdx
	addl	%eax, %edx
	cmpl	%edx, 4(%r14)
	je	LBB0_4
## %bb.3:
	movl	%edx, 4(%r14)
	leal	(%rdx,%rdx,4), %eax
	leal	(%rdx,%rax,2), %ecx
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_DEBUG
	movl	4(%r14), %esi
	movq	_SetContrast@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_konicawc_set_value
LBB0_4:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_konicawc_camera_on             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"new brightness: %d"

	.comm	_MAX_BRIGHTNESS,4,2             ## @MAX_BRIGHTNESS
L_.str.1:                               ## @.str.1
	.asciz	"setting brightness to %d (%d)"

	.comm	_SetBrightness,4,2              ## @SetBrightness
L_.str.2:                               ## @.str.2
	.asciz	"new contrast: %d"

	.comm	_MAX_CONTRAST,4,2               ## @MAX_CONTRAST
L_.str.3:                               ## @.str.3
	.asciz	"setting contrast to %d (%d)"

	.comm	_SetContrast,4,2                ## @SetContrast
	.no_dead_strip	_konicawc_adjust_picture
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function konicawc_adjust_picture
_konicawc_adjust_picture:               ; @konicawc_adjust_picture
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	x20, [x0, #8]
	bl	_konicawc_camera_off
	ldr	w2, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
Lloh2:
	adrp	x8, _MAX_BRIGHTNESS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_BRIGHTNESS@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh4:
	ldr	w8, [x8]
	cmp	w9, w8
	csel	w8, w9, w8, lt
	str	w8, [x19]
	ldr	w9, [x20]
	mov	w21, #41705
	movk	w21, #11915, lsl #16
	smull	x8, w8, w21
	lsr	x10, x8, #63
	asr	x8, x8, #33
	add	w2, w8, w10
	cmp	w9, w2
	b.eq	LBB0_2
; %bb.1:
	str	w2, [x20]
	mov	w8, #11
	mul	w8, w2, w8
	str	x8, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	ldr	w1, [x20]
Lloh7:
	adrp	x8, _SetBrightness@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SetBrightness@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_konicawc_set_value
LBB0_2:
	ldr	w2, [x19, #4]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	ldr	w8, [x19, #4]
Lloh12:
	adrp	x9, _MAX_CONTRAST@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MAX_CONTRAST@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w8, w8, w9, lt
	str	w8, [x19, #4]
	ldr	w9, [x20, #4]
	smull	x8, w8, w21
	lsr	x10, x8, #63
	asr	x8, x8, #33
	add	w2, w8, w10
	cmp	w9, w2
	b.eq	LBB0_4
; %bb.3:
	str	w2, [x20, #4]
	mov	w8, #11
	mul	w8, w2, w8
	str	x8, [sp]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_DEBUG
	ldr	w1, [x20, #4]
Lloh17:
	adrp	x8, _SetContrast@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SetContrast@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_konicawc_set_value
LBB0_4:
	mov	x0, x19
	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
	add	sp, sp, #64
	b	_konicawc_camera_on
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"new brightness: %d"

	.comm	_MAX_BRIGHTNESS,4,2             ; @MAX_BRIGHTNESS
l_.str.1:                               ; @.str.1
	.asciz	"setting brightness to %d (%d)"

	.comm	_SetBrightness,4,2              ; @SetBrightness
l_.str.2:                               ; @.str.2
	.asciz	"new contrast: %d"

	.comm	_MAX_CONTRAST,4,2               ; @MAX_CONTRAST
l_.str.3:                               ; @.str.3
	.asciz	"setting contrast to %d (%d)"

	.comm	_SetContrast,4,2                ; @SetContrast
	.no_dead_strip	_konicawc_adjust_picture
.subsections_via_symbols
