	.file	"extr_cx18-gpio.c_cx18_gpio_init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"GPIO initial dir: %08x/%08x out: %08x/%08x\n"
	.text
	.p2align 4
	.globl	cx18_gpio_init
	.type	cx18_gpio_init, @function
cx18_gpio_init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	lea	r12, 8[rdi]
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	mov	rdi, r12
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	mutex_lock@PLT
	mov	rax, QWORD PTR 16[rbp]
	mov	rbx, QWORD PTR TUNER_XC2028[rip]
	mov	edx, DWORD PTR 16[rax]
	mov	esi, DWORD PTR 20[rax]
	mov	rcx, QWORD PTR 8[rax]
	mov	DWORD PTR 0[rbp], edx
	mov	DWORD PTR 4[rbp], esi
	cmp	QWORD PTR [rcx], rbx
	jne	.L2
	mov	ecx, DWORD PTR [rax]
	mov	eax, 1
	sal	eax, cl
	or	edx, eax
	or	esi, eax
	mov	DWORD PTR 0[rbp], edx
	mov	DWORD PTR 4[rbp], esi
.L2:
	test	edx, edx
	je	.L5
	mov	esi, DWORD PTR CX18_REG_GPIO_OUT2[rip]
	mov	rdi, rbp
	call	cx18_read_reg@PLT
	mov	esi, DWORD PTR CX18_REG_GPIO_OUT1[rip]
	mov	rdi, rbp
	mov	ebx, eax
	call	cx18_read_reg@PLT
	mov	esi, DWORD PTR CX18_REG_GPIO_DIR2[rip]
	mov	rdi, rbp
	mov	r14d, eax
	call	cx18_read_reg@PLT
	mov	esi, DWORD PTR CX18_REG_GPIO_DIR1[rip]
	mov	rdi, rbp
	mov	r13d, eax
	call	cx18_read_reg@PLT
	mov	r8d, ebx
	mov	ecx, r14d
	mov	edx, r13d
	lea	rdi, .LC0[rip]
	mov	esi, eax
	call	CX18_DEBUG_INFO@PLT
	mov	rdi, rbp
	call	gpio_write@PLT
.L5:
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	rdi, r12
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	jmp	mutex_unlock@PLT
	.cfi_endproc
.LFE0:
	.size	cx18_gpio_init, .-cx18_gpio_init
	.comm	TUNER_XC2028,8,8
	.comm	CX18_REG_GPIO_OUT2,4,4
	.comm	CX18_REG_GPIO_OUT1,4,4
	.comm	CX18_REG_GPIO_DIR2,4,4
	.comm	CX18_REG_GPIO_DIR1,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_cx18-gpio.c_cx18_gpio_init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"GPIO initial dir: %08x/%08x out: %08x/%08x\012\000"
	.text
	.align	2
	.global	cx18_gpio_init
	.syntax unified
	.arm
	.fpu softvfp
	.type	cx18_gpio_init, %function
cx18_gpio_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	add	r5, r0, #8
	mov	r0, r5
	sub	sp, sp, #8
	bl	mutex_lock
	ldr	r3, [r4, #12]
	ldr	r1, .L7
	ldr	r2, [r3, #4]
	ldr	r1, [r1]
	ldr	r0, [r2]
	ldr	r2, [r3, #8]
	cmp	r0, r1
	ldr	r1, [r3, #12]
	str	r2, [r4]
	str	r1, [r4, #4]
	bne	.L2
	mov	r0, #1
	ldr	r3, [r3]
	lsl	r3, r0, r3
	orr	r2, r2, r3
	orr	r1, r1, r3
	str	r2, [r4]
	str	r1, [r4, #4]
.L2:
	cmp	r2, #0
	beq	.L5
	ldr	r3, .L7+4
	mov	r0, r4
	ldr	r1, [r3]
	bl	cx18_read_reg
	ldr	r3, .L7+8
	mov	r6, r0
	ldr	r1, [r3]
	mov	r0, r4
	bl	cx18_read_reg
	ldr	r3, .L7+12
	mov	r7, r0
	ldr	r1, [r3]
	mov	r0, r4
	bl	cx18_read_reg
	ldr	r3, .L7+16
	mov	r8, r0
	ldr	r1, [r3]
	mov	r0, r4
	bl	cx18_read_reg
	mov	r3, r8
	str	r0, [sp]
	mov	r2, r7
	mov	r1, r6
	ldr	r0, .L7+20
	bl	CX18_DEBUG_INFO
	mov	r0, r4
	bl	gpio_write
.L5:
	mov	r0, r5
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, lr}
	b	mutex_unlock
.L8:
	.align	2
.L7:
	.word	TUNER_XC2028
	.word	CX18_REG_GPIO_DIR1
	.word	CX18_REG_GPIO_DIR2
	.word	CX18_REG_GPIO_OUT1
	.word	CX18_REG_GPIO_OUT2
	.word	.LC0
	.size	cx18_gpio_init, .-cx18_gpio_init
	.comm	TUNER_XC2028,4,4
	.comm	CX18_REG_GPIO_OUT2,4,4
	.comm	CX18_REG_GPIO_OUT1,4,4
	.comm	CX18_REG_GPIO_DIR2,4,4
	.comm	CX18_REG_GPIO_DIR1,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
