	.file	"extr_i2c-brcmstb.c_brcmstb_i2c_xfer_bsc_data.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s failure"
	.text
	.p2align 4
	.type	brcmstb_i2c_xfer_bsc_data, @function
brcmstb_i2c_xfer_bsc_data:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, edx
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	r14d, DWORD PTR [rcx]
	mov	rbp, QWORD PTR 8[rdi]
	mov	QWORD PTR 8[rsp], rsi
	and	r14d, DWORD PTR I2C_M_IGNORE_NAK[rip]
	call	brcmstb_i2c_get_data_regsz@PLT
	mov	r15d, eax
	mov	eax, DWORD PTR 0[r13]
	test	r14d, r14d
	je	.L2
	test	DWORD PTR I2C_M_RD[rip], eax
	mov	r13d, DWORD PTR CMD_RD_NOACK[rip]
	cmove	r13d, DWORD PTR CMD_WR_NOACK[rip]
	mov	esi, DWORD PTR 0[rbp]
	or	esi, DWORD PTR BSC_CTLHI_REG_IGNORE_ACK_MASK[rip]
	mov	DWORD PTR 40[rsp], r13d
	mov	DWORD PTR 0[rbp], esi
.L5:
	mov	edx, DWORD PTR ctlhi_reg[rip]
	mov	rdi, r12
	call	bsc_writel@PLT
	mov	eax, DWORD PTR BSC_CTL_REG_DTF_MASK[rip]
	mov	edi, DWORD PTR 40[rsp]
	not	eax
	and	eax, DWORD PTR 4[rbp]
	cmp	DWORD PTR CMD_WR[rip], edi
	je	.L8
	mov	edx, DWORD PTR DTF_RD_MASK[rip]
	or	edx, eax
	cmp	DWORD PTR CMD_WR_NOACK[rip], edi
	je	.L8
.L10:
	mov	DWORD PTR 4[rbp], edx
	mov	edi, r15d
	mov	r14d, DWORD PTR cnt_reg[rip]
	call	BSC_CNT_REG1_MASK@PLT
	mov	ecx, DWORD PTR BSC_CNT_REG1_SHIFT[rip]
	mov	esi, ebx
	mov	edx, r14d
	mov	rdi, r12
	sal	esi, cl
	and	esi, eax
	call	bsc_writel@PLT
	mov	eax, DWORD PTR 40[rsp]
	cmp	DWORD PTR CMD_WR[rip], eax
	je	.L14
	mov	eax, DWORD PTR 40[rsp]
	cmp	DWORD PTR CMD_WR_NOACK[rip], eax
	je	.L14
.L12:
	mov	esi, DWORD PTR 40[rsp]
	mov	rdi, r12
	call	brcmstb_send_i2c_cmd@PLT
	mov	DWORD PTR 44[rsp], eax
	test	eax, eax
	jne	.L39
	mov	eax, DWORD PTR 40[rsp]
	cmp	DWORD PTR CMD_RD[rip], eax
	je	.L23
	mov	eax, DWORD PTR 40[rsp]
	cmp	DWORD PTR CMD_RD_NOACK[rip], eax
	je	.L23
.L1:
	mov	eax, DWORD PTR 44[rsp]
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	test	ebx, ebx
	je	.L12
	movsx	r14, r15d
	mov	r10, QWORD PTR 8[rsp]
	mov	QWORD PTR [rsp], r12
	mov	ebp, r15d
	lea	rax, 0[0+r14*4]
	xor	r14d, r14d
	xor	r13d, r13d
	mov	QWORD PTR 16[rsp], rax
	lea	eax, -1[r15]
	mov	r12, r10
	mov	DWORD PTR 24[rsp], eax
	mov	eax, r14d
	mov	r14d, r15d
	mov	r15d, eax
	.p2align 4,,10
	.p2align 3
.L13:
	xor	esi, esi
	test	r14d, r14d
	jle	.L18
	mov	edi, DWORD PTR BITS_PER_BYTE[rip]
	mov	r11d, DWORD PTR 24[rsp]
	mov	eax, r15d
	xor	esi, esi
	mov	rdx, r12
	imul	r11d, edi
	.p2align 4,,10
	.p2align 3
.L16:
	mov	ecx, edi
	sar	esi, cl
	cmp	ebx, eax
	jbe	.L15
	mov	r8d, DWORD PTR [rdx]
	mov	ecx, r11d
	sal	r8d, cl
	or	esi, r8d
.L15:
	add	eax, 1
	add	rdx, 4
	cmp	eax, ebp
	jne	.L16
.L18:
	mov	rax, QWORD PTR data_in[rip]
	mov	rdi, QWORD PTR [rsp]
	add	r15d, r14d
	add	ebp, r14d
	mov	edx, DWORD PTR [rax+r13]
	add	r13, 4
	call	bsc_writel@PLT
	add	r12, QWORD PTR 16[rsp]
	cmp	ebx, r15d
	ja	.L13
	mov	r12, QWORD PTR [rsp]
	mov	r15d, r14d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L8:
	or	eax, DWORD PTR DTF_WR_MASK[rip]
	mov	edx, eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L2:
	mov	esi, DWORD PTR BSC_CTLHI_REG_IGNORE_ACK_MASK[rip]
	test	DWORD PTR I2C_M_RD[rip], eax
	mov	r13d, DWORD PTR CMD_RD[rip]
	cmove	r13d, DWORD PTR CMD_WR[rip]
	not	esi
	and	esi, DWORD PTR 0[rbp]
	mov	DWORD PTR 40[rsp], r13d
	mov	DWORD PTR 0[rbp], esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L23:
	test	ebx, ebx
	je	.L1
	movsx	rax, r15d
	mov	rdi, QWORD PTR 8[rsp]
	lea	r11d, -1[rbx]
	xor	ebp, ebp
	mov	QWORD PTR 16[rsp], rax
	sal	rax, 2
	xor	r13d, r13d
	mov	r14d, r15d
	mov	QWORD PTR [rsp], rax
	lea	eax, -1[r15]
	mov	r15d, ebp
	mov	ebp, r11d
	lea	rdx, [rdi+rax*4]
	lea	rax, 4[rdi]
	mov	QWORD PTR 24[rsp], r12
	mov	r12, r13
	mov	QWORD PTR 32[rsp], rax
	mov	DWORD PTR 40[rsp], ebx
	mov	rbx, rdx
	.p2align 4,,10
	.p2align 3
.L26:
	mov	rax, QWORD PTR data_out[rip]
	mov	rdi, QWORD PTR 24[rsp]
	mov	esi, DWORD PTR [rax+r12]
	call	bsc_readl@PLT
	test	r14d, r14d
	jle	.L27
	cmp	DWORD PTR 40[rsp], r15d
	jbe	.L27
	mov	rdi, QWORD PTR 8[rsp]
	mov	ecx, ebp
	add	rcx, r13
	lea	rsi, [rdi+r13*4]
	mov	rdi, QWORD PTR 32[rsp]
	lea	rdi, [rdi+rcx*4]
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L40:
	add	rsi, 4
	cmp	rsi, rdi
	je	.L27
.L28:
	movzx	edx, al
	mov	DWORD PTR [rsi], edx
	mov	ecx, DWORD PTR BITS_PER_BYTE[rip]
	sar	eax, cl
	cmp	rbx, rsi
	jne	.L40
.L27:
	add	r15d, r14d
	add	r12, 4
	add	rbx, QWORD PTR [rsp]
	sub	ebp, r14d
	add	r13, QWORD PTR 16[rsp]
	cmp	DWORD PTR 40[rsp], r15d
	ja	.L26
	jmp	.L1
.L39:
	mov	r13d, DWORD PTR 40[rsp]
	mov	rax, QWORD PTR cmd_string[rip]
	lea	rsi, .LC0[rip]
	mov	edi, DWORD PTR [r12]
	mov	edx, DWORD PTR [rax+r13*4]
	call	dev_dbg@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	brcmstb_i2c_xfer_bsc_data, .-brcmstb_i2c_xfer_bsc_data
	.comm	data_out,8,8
	.comm	data_in,8,8
	.comm	ctlhi_reg,4,4
	.comm	cnt_reg,4,4
	.comm	cmd_string,8,8
	.comm	I2C_M_RD,4,4
	.comm	I2C_M_IGNORE_NAK,4,4
	.comm	DTF_WR_MASK,4,4
	.comm	DTF_RD_MASK,4,4
	.comm	CMD_WR_NOACK,4,4
	.comm	CMD_WR,4,4
	.comm	CMD_RD_NOACK,4,4
	.comm	CMD_RD,4,4
	.comm	BSC_CTL_REG_DTF_MASK,4,4
	.comm	BSC_CTLHI_REG_IGNORE_ACK_MASK,4,4
	.comm	BSC_CNT_REG1_SHIFT,4,4
	.comm	BITS_PER_BYTE,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_i2c-brcmstb.c_brcmstb_i2c_xfer_bsc_data.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s failure\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	brcmstb_i2c_xfer_bsc_data, %function
brcmstb_i2c_xfer_bsc_data:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r3
	ldr	r3, .L41
	ldr	r10, [r8]
	ldr	r3, [r3]
	sub	sp, sp, #12
	and	r10, r10, r3
	mov	r4, r2
	mov	r9, r0
	mov	r7, r1
	ldr	r5, [r0, #4]
	bl	brcmstb_i2c_get_data_regsz
	ldr	r3, .L41+4
	cmp	r10, #0
	mov	r6, r0
	ldr	r2, [r8]
	ldr	r3, [r3]
	beq	.L2
	tst	r2, r3
	ldrne	r3, .L41+8
	ldreq	r3, .L41+12
	ldr	r1, [r5]
	ldr	r3, [r3]
	ldr	r8, .L41+16
	str	r3, [sp]
	ldr	r3, .L41+20
	ldr	r3, [r3]
	orr	r1, r1, r3
	str	r1, [r5]
.L5:
	ldr	r3, .L41+24
	mov	r0, r9
	ldr	r2, [r3]
	bl	bsc_writel
	ldr	r3, .L41+28
	ldr	r1, [r8]
	ldr	r0, [sp]
	ldr	r2, [r3]
	ldr	r3, [r5, #4]
	cmp	r1, r0
	bic	r3, r3, r2
	beq	.L8
	ldr	r2, .L41+12
	ldr	r2, [r2]
	cmp	r2, r0
	ldrne	r2, .L41+32
	ldrne	r2, [r2]
	orrne	r3, r3, r2
	bne	.L10
.L8:
	ldr	r2, .L41+36
	ldr	r2, [r2]
	orr	r3, r3, r2
.L10:
	str	r3, [r5, #4]
	mov	r0, r6
	bl	BSC_CNT_REG1_MASK
	ldr	r2, .L41+40
	ldr	r3, .L41+44
	ldr	r1, [r2]
	ldr	r2, [r3]
	and	r1, r0, r4, lsl r1
	mov	r0, r9
	bl	bsc_writel
	ldr	r3, [r8]
	ldr	r2, [sp]
	cmp	r3, r2
	beq	.L14
	ldr	r3, .L41+12
	ldr	r2, [sp]
	ldr	r3, [r3]
	cmp	r3, r2
	beq	.L14
.L12:
	mov	r0, r9
	ldr	r1, [sp]
	bl	brcmstb_send_i2c_cmd
	subs	r3, r0, #0
	str	r3, [sp, #4]
	bne	.L39
	ldr	r3, .L41+48
	ldr	r2, [sp]
	ldr	r3, [r3]
	cmp	r3, r2
	beq	.L23
	ldr	r3, .L41+8
	ldr	r2, [sp]
	ldr	r3, [r3]
	cmp	r3, r2
	beq	.L23
.L1:
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	cmp	r4, #0
	beq	.L12
	mov	r10, #0
	mov	r5, r6
	mov	r8, r10
	sub	r3, r6, #1
	ldr	fp, .L41+52
	str	r3, [sp, #4]
.L13:
	cmp	r6, #0
	movle	r1, #0
	ble	.L18
	mov	r2, r8
	mov	r1, #0
	ldr	r3, .L41+56
	ldr	lr, [sp, #4]
	ldr	r0, [r3]
	mul	lr, r0, lr
.L16:
	cmp	r2, r4
	ldrcc	r3, [r7, r2, lsl #2]
	asr	r1, r1, r0
	add	r2, r2, #1
	orrcc	r1, r1, r3, lsl lr
	cmp	r2, r5
	bne	.L16
.L18:
	ldr	r2, [fp]
	mov	r0, r9
	ldr	r2, [r2, r10]
	add	r8, r8, r6
	bl	bsc_writel
	cmp	r4, r8
	add	r5, r5, r6
	add	r10, r10, #4
	bhi	.L13
	b	.L12
.L2:
	tst	r2, r3
	ldrne	r3, .L41+48
	ldreq	r8, .L41+16
	ldrne	r3, [r3]
	ldreq	r3, [r8]
	ldr	r1, [r5]
	str	r3, [sp]
	ldr	r3, .L41+20
	ldrne	r8, .L41+16
	ldr	r3, [r3]
	bic	r1, r1, r3
	str	r1, [r5]
	b	.L5
.L23:
	cmp	r4, #0
	beq	.L1
	mov	r8, #0
	mov	fp, r8
	ldr	r3, .L41+60
	ldr	r5, .L41+56
	sub	r7, r7, #4
	sub	r10, r6, #1
.L26:
	ldr	r2, [r3]
	mov	r0, r9
	ldr	r1, [r2, fp]
	bl	bsc_readl
	cmp	r6, #0
	ldr	r3, .L41+60
	ble	.L27
	cmp	r4, r8
	mov	r2, r8
	bls	.L27
	add	r1, r7, r8, lsl #2
	b	.L28
.L40:
	cmp	r2, r4
	bcs	.L27
.L28:
	and	ip, r0, #255
	str	ip, [r1, #4]!
	ldr	ip, [r5]
	cmp	r10, r2
	asr	r0, r0, ip
	add	r2, r2, #1
	bne	.L40
.L27:
	add	r8, r8, r6
	cmp	r4, r8
	add	fp, fp, #4
	add	r10, r10, r6
	bhi	.L26
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L39:
	ldr	r3, .L41+64
	ldr	r2, [sp]
	ldr	r3, [r3]
	ldr	r0, [r9]
	ldr	r1, .L41+68
	ldr	r2, [r3, r2, lsl #2]
	bl	dev_dbg
	ldr	r0, [sp, #4]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L42:
	.align	2
.L41:
	.word	I2C_M_IGNORE_NAK
	.word	I2C_M_RD
	.word	CMD_RD_NOACK
	.word	CMD_WR_NOACK
	.word	CMD_WR
	.word	BSC_CTLHI_REG_IGNORE_ACK_MASK
	.word	ctlhi_reg
	.word	BSC_CTL_REG_DTF_MASK
	.word	DTF_RD_MASK
	.word	DTF_WR_MASK
	.word	BSC_CNT_REG1_SHIFT
	.word	cnt_reg
	.word	CMD_RD
	.word	data_in
	.word	BITS_PER_BYTE
	.word	data_out
	.word	cmd_string
	.word	.LC0
	.size	brcmstb_i2c_xfer_bsc_data, .-brcmstb_i2c_xfer_bsc_data
	.comm	data_out,4,4
	.comm	data_in,4,4
	.comm	ctlhi_reg,4,4
	.comm	cnt_reg,4,4
	.comm	cmd_string,4,4
	.comm	I2C_M_RD,4,4
	.comm	I2C_M_IGNORE_NAK,4,4
	.comm	DTF_WR_MASK,4,4
	.comm	DTF_RD_MASK,4,4
	.comm	CMD_WR_NOACK,4,4
	.comm	CMD_WR,4,4
	.comm	CMD_RD_NOACK,4,4
	.comm	CMD_RD,4,4
	.comm	BSC_CTL_REG_DTF_MASK,4,4
	.comm	BSC_CTLHI_REG_IGNORE_ACK_MASK,4,4
	.comm	BSC_CNT_REG1_SHIFT,4,4
	.comm	BITS_PER_BYTE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
