	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function apds9300_set_thresh_hi
_apds9300_set_thresh_hi:                ## @apds9300_set_thresh_hi
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, 16(%rdi)
	je	LBB0_1
## %bb.3:
	movl	%esi, %r14d
	movq	_APDS9300_THRESH_MAX@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jge	LBB0_5
## %bb.4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	movq	%rdi, %r15
	movq	_APDS9300_THRESHHIGHLOW@GOTPCREL(%rip), %rax
	movq	_APDS9300_CMD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	8(%rdi), %rdi
	movq	_APDS9300_WORD@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	%r14d, %edx
	callq	_i2c_smbus_write_word_data
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	movq	8(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_8
LBB0_7:
	movl	%r14d, (%r15)
	xorl	%ebx, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_APDS9300_THRESH_MAX,4,2        ## @APDS9300_THRESH_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_APDS9300_THRESHHIGHLOW,4,2     ## @APDS9300_THRESHHIGHLOW
	.comm	_APDS9300_CMD,4,2               ## @APDS9300_CMD
	.comm	_APDS9300_WORD,4,2              ## @APDS9300_WORD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to set thresh_hi\n"

	.no_dead_strip	_apds9300_set_thresh_hi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function apds9300_set_thresh_hi
_apds9300_set_thresh_hi:                ; @apds9300_set_thresh_hi
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	w8, [x0, #16]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x20, x1
Lloh0:
	adrp	x8, _APDS9300_THRESH_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _APDS9300_THRESH_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ge	LBB0_5
; %bb.2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_5:
	mov	x19, x0
	ldr	x0, [x0, #8]
Lloh7:
	adrp	x8, _APDS9300_THRESHHIGHLOW@GOTPAGE
Lloh8:
	ldr	x8, [x8, _APDS9300_THRESHHIGHLOW@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _APDS9300_CMD@GOTPAGE
Lloh11:
	ldr	x9, [x9, _APDS9300_CMD@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh13:
	adrp	x9, _APDS9300_WORD@GOTPAGE
Lloh14:
	ldr	x9, [x9, _APDS9300_WORD@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	x2, x20
	bl	_i2c_smbus_write_word_data
	mov	x21, x0
	cbz	w0, LBB0_7
; %bb.6:
	ldr	x0, [x19, #8]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_8
LBB0_7:
	str	w20, [x19]
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_APDS9300_THRESH_MAX,4,2        ; @APDS9300_THRESH_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_APDS9300_THRESHHIGHLOW,4,2     ; @APDS9300_THRESHHIGHLOW
	.comm	_APDS9300_CMD,4,2               ; @APDS9300_CMD
	.comm	_APDS9300_WORD,4,2              ; @APDS9300_WORD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to set thresh_hi\n"

	.no_dead_strip	_apds9300_set_thresh_hi
.subsections_via_symbols
