	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psb_lvds_i2c_set_brightness
_psb_lvds_i2c_set_brightness:           ## @psb_lvds_i2c_set_brightness
	.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
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %eax
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -40(%rbp)
	movq	8(%rdi), %r12
	movq	8(%r12), %rdi
	movl	$2, -96(%rbp)
	leaq	-64(%rbp), %rcx
	movq	%rcx, -88(%rbp)
	movl	$0, -80(%rbp)
	movl	4(%rdi), %ecx
	movl	%ecx, -76(%rbp)
	movq	_BRIGHTNESS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	imull	%ebx, %eax
	movq	_BRIGHTNESS_MAX_LEVEL@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	xorl	%edx, %edx
	divl	(%rcx)
	andl	%ebx, %eax
	movq	(%r12), %rcx
	movq	_BLC_POLARITY_INVERSE@GOTPCREL(%rip), %rdx
	subl	%eax, %ebx
	movq	(%rcx), %rsi
	movq	8(%rcx), %rcx
	cmpq	(%rdx), %rsi
	cmovnel	%eax, %ebx
	movq	%rcx, -64(%rbp)
	movq	%rbx, -56(%rbp)
	leaq	-96(%rbp), %rsi
	movl	$1, %edx
	callq	_i2c_transfer
	movl	(%r15), %edi
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.1:
	movq	(%r12), %rax
	movq	8(%rax), %rdx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %ecx
	callq	_dev_dbg
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	$-1, %r14d
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	movl	%r14d, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BRIGHTNESS_MASK,4,2            ## @BRIGHTNESS_MASK
	.comm	_BRIGHTNESS_MAX_LEVEL,4,2       ## @BRIGHTNESS_MAX_LEVEL
	.comm	_BLC_POLARITY_INVERSE,8,3       ## @BLC_POLARITY_INVERSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"I2C set brightness.(command, value) (%d, %d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"I2C transfer error\n"

	.no_dead_strip	_psb_lvds_i2c_set_brightness
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psb_lvds_i2c_set_brightness
_psb_lvds_i2c_set_brightness:           ; @psb_lvds_i2c_set_brightness
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldr	x21, [x0, #8]
	ldr	x0, [x21, #8]
	mov	w8, #2
	str	w8, [sp]
	add	x8, sp, #24
	str	x8, [sp, #8]
	str	wzr, [sp, #16]
	ldr	w8, [x0, #4]
	str	w8, [sp, #20]
Lloh3:
	adrp	x8, _BRIGHTNESS_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BRIGHTNESS_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mul	w9, w8, w1
Lloh6:
	adrp	x10, _BRIGHTNESS_MAX_LEVEL@GOTPAGE
Lloh7:
	ldr	x10, [x10, _BRIGHTNESS_MAX_LEVEL@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	udiv	w9, w9, w10
	and	w9, w9, w8
	ldr	x10, [x21]
Lloh9:
	adrp	x11, _BLC_POLARITY_INVERSE@GOTPAGE
Lloh10:
	ldr	x11, [x11, _BLC_POLARITY_INVERSE@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
	sub	w8, w8, w9
	ldp	x12, x10, [x10]
	cmp	x12, x11
	csel	w19, w8, w9, eq
	stp	x10, x19, [sp, #24]
	mov	x1, sp
	mov	w2, #1
	bl	_i2c_transfer
	mov	x8, x0
	ldr	w0, [x20]
	cmp	w8, #1
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x21]
	ldr	x2, [x8, #8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x19
	bl	_dev_dbg
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	mov	w0, #-1
LBB0_3:
	ldr	x8, [sp, #40]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	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
	add	sp, sp, #96
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_BRIGHTNESS_MASK,4,2            ; @BRIGHTNESS_MASK
	.comm	_BRIGHTNESS_MAX_LEVEL,4,2       ; @BRIGHTNESS_MAX_LEVEL
	.comm	_BLC_POLARITY_INVERSE,8,3       ; @BLC_POLARITY_INVERSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"I2C set brightness.(command, value) (%d, %d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"I2C transfer error\n"

	.no_dead_strip	_psb_lvds_i2c_set_brightness
.subsections_via_symbols
