	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function us5182d_set_opmode
_us5182d_set_opmode:                    ## @us5182d_set_opmode
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r14d, %r14d
	cmpl	%esi, (%rdi)
	je	LBB0_8
## %bb.1:
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	movq	_US5182D_REG_CFG0@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_7
## %bb.2:
	movq	_US5182D_OPMODE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	movq	_US5182D_OPMODE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r15d, %edx
	shll	%cl, %edx
	andl	%esi, %eax
	orl	%eax, %edx
	movl	4(%rbx), %edi
	movl	(%r12), %esi
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_7
## %bb.3:
	movl	4(%rbx), %edi
	movq	_US5182D_REG_MODE_STORE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_US5182D_STORE_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_i2c_smbus_write_byte_data
	testl	%eax, %eax
	js	LBB0_7
## %bb.4:
	movl	%r15d, (%rbx)
	movq	_US5182D_OPSTORE_SLEEP_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	jmp	LBB0_8
LBB0_7:
	movl	%eax, %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_US5182D_REG_CFG0,4,2           ## @US5182D_REG_CFG0
	.comm	_US5182D_OPMODE_MASK,4,2        ## @US5182D_OPMODE_MASK
	.comm	_US5182D_OPMODE_SHIFT,4,2       ## @US5182D_OPMODE_SHIFT
	.comm	_US5182D_REG_MODE_STORE,4,2     ## @US5182D_REG_MODE_STORE
	.comm	_US5182D_STORE_MODE,4,2         ## @US5182D_STORE_MODE
	.comm	_US5182D_OPSTORE_SLEEP_TIME,4,2 ## @US5182D_OPSTORE_SLEEP_TIME
	.no_dead_strip	_us5182d_set_opmode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function us5182d_set_opmode
_us5182d_set_opmode:                    ; @us5182d_set_opmode
	.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]
	cmp	w8, w1
	b.ne	LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_6
LBB0_2:
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #4]
Lloh0:
	adrp	x21, _US5182D_REG_CFG0@GOTPAGE
Lloh1:
	ldr	x21, [x21, _US5182D_REG_CFG0@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_6
; %bb.3:
Lloh2:
	adrp	x8, _US5182D_OPMODE_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _US5182D_OPMODE_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _US5182D_OPMODE_SHIFT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _US5182D_OPMODE_SHIFT@GOTPAGEOFF]
	bic	w8, w0, w8
Lloh7:
	ldr	w9, [x9]
	lsl	w9, w19, w9
	orr	w2, w9, w8
	ldr	w0, [x20, #4]
	ldr	w1, [x21]
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_6
; %bb.4:
	ldr	w0, [x20, #4]
Lloh8:
	adrp	x8, _US5182D_REG_MODE_STORE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _US5182D_REG_MODE_STORE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _US5182D_STORE_MODE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _US5182D_STORE_MODE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	bl	_i2c_smbus_write_byte_data
	tbnz	w0, #31, LBB0_6
; %bb.5:
	str	w19, [x20]
Lloh14:
	adrp	x8, _US5182D_OPSTORE_SLEEP_TIME@GOTPAGE
Lloh15:
	ldr	x8, [x8, _US5182D_OPSTORE_SLEEP_TIME@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_msleep
	b	LBB0_1
LBB0_6:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_US5182D_REG_CFG0,4,2           ; @US5182D_REG_CFG0
	.comm	_US5182D_OPMODE_MASK,4,2        ; @US5182D_OPMODE_MASK
	.comm	_US5182D_OPMODE_SHIFT,4,2       ; @US5182D_OPMODE_SHIFT
	.comm	_US5182D_REG_MODE_STORE,4,2     ; @US5182D_REG_MODE_STORE
	.comm	_US5182D_STORE_MODE,4,2         ; @US5182D_STORE_MODE
	.comm	_US5182D_OPSTORE_SLEEP_TIME,4,2 ; @US5182D_OPSTORE_SLEEP_TIME
	.no_dead_strip	_us5182d_set_opmode
.subsections_via_symbols
