	.file	"extr_ssm2518.c_ssm2518_set_power.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ssm2518_set_power, @function
ssm2518_set_power:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdi
	test	esi, esi
	je	.L15
	mov	edi, DWORD PTR 4[rdi]
	mov	ebp, esi
	call	gpio_is_valid@PLT
	test	rax, rax
	je	.L12
	mov	edi, DWORD PTR 4[rbx]
	mov	esi, ebp
	call	gpio_set_value@PLT
.L12:
	mov	edi, DWORD PTR [rbx]
	xor	esi, esi
	call	regcache_cache_only@PLT
	mov	edi, DWORD PTR [rbx]
	mov	esi, DWORD PTR SSM2518_REG_POWER1[rip]
	xor	ecx, ecx
	mov	edx, DWORD PTR SSM2518_POWER1_SPWDN[rip]
	or	edx, DWORD PTR SSM2518_POWER1_RESET[rip]
	call	regmap_update_bits@PLT
	mov	edi, DWORD PTR [rbx]
	mov	r12d, eax
	call	regcache_sync@PLT
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	edx, DWORD PTR SSM2518_POWER1_SPWDN[rip]
	mov	esi, DWORD PTR SSM2518_REG_POWER1[rip]
	mov	edi, DWORD PTR [rdi]
	mov	ecx, edx
	call	regmap_update_bits@PLT
	mov	edi, DWORD PTR [rbx]
	mov	r12d, eax
	call	regcache_mark_dirty@PLT
	mov	edi, DWORD PTR 4[rbx]
	call	gpio_is_valid@PLT
	test	rax, rax
	jne	.L16
.L13:
	mov	edi, DWORD PTR [rbx]
	mov	esi, 1
	call	regcache_cache_only@PLT
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
.L16:
	.cfi_restore_state
	mov	edi, DWORD PTR 4[rbx]
	xor	esi, esi
	call	gpio_set_value@PLT
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	ssm2518_set_power, .-ssm2518_set_power
	.comm	SSM2518_REG_POWER1,4,4
	.comm	SSM2518_POWER1_SPWDN,4,4
	.comm	SSM2518_POWER1_RESET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ssm2518.c_ssm2518_set_power.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ssm2518_set_power, %function
ssm2518_set_power:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	subs	r5, r1, #0
	mov	r4, r0
	beq	.L15
	ldr	r0, [r0, #4]
	bl	gpio_is_valid
	subs	r1, r0, #0
	beq	.L12
	mov	r1, r5
	ldr	r0, [r4, #4]
	bl	gpio_set_value
	mov	r1, #0
.L12:
	ldr	r0, [r4]
	bl	regcache_cache_only
	ldr	r2, .L17
	ldr	r3, .L17+4
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, .L17+8
	orr	r2, r1, r2
	ldr	r0, [r4]
	ldr	r1, [r3]
	mov	r3, #0
	bl	regmap_update_bits
	mov	r6, r0
	ldr	r0, [r4]
	bl	regcache_sync
	mov	r0, r6
	pop	{r4, r5, r6, pc}
.L15:
	ldr	r3, .L17
	ldr	r2, .L17+8
	ldr	r3, [r3]
	ldr	r1, [r2]
	ldr	r0, [r0]
	mov	r2, r3
	bl	regmap_update_bits
	mov	r6, r0
	ldr	r0, [r4]
	bl	regcache_mark_dirty
	ldr	r0, [r4, #4]
	bl	gpio_is_valid
	cmp	r0, #0
	bne	.L16
.L13:
	mov	r1, #1
	ldr	r0, [r4]
	bl	regcache_cache_only
	mov	r0, r6
	pop	{r4, r5, r6, pc}
.L16:
	mov	r1, r5
	ldr	r0, [r4, #4]
	bl	gpio_set_value
	b	.L13
.L18:
	.align	2
.L17:
	.word	SSM2518_POWER1_SPWDN
	.word	SSM2518_POWER1_RESET
	.word	SSM2518_REG_POWER1
	.size	ssm2518_set_power, .-ssm2518_set_power
	.comm	SSM2518_REG_POWER1,4,4
	.comm	SSM2518_POWER1_SPWDN,4,4
	.comm	SSM2518_POWER1_RESET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
