	.file	"extr_fsl_rio.c_rio_open_inb_mbox.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"msg_rx"
	.text
	.p2align 4
	.globl	rio_open_inb_mbox
	.type	rio_open_inb_mbox, @function
rio_open_inb_mbox:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	DWORD PTR RIO_MIN_RX_RING_SIZE[rip], ecx
	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
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	jg	.L4
	cmp	DWORD PTR RIO_MAX_RX_RING_SIZE[rip], ecx
	mov	ebp, ecx
	jge	.L16
.L4:
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	rbx, QWORD PTR [rdi]
	mov	r13, rdi
	mov	edi, ecx
	mov	r12, rsi
	call	is_power_of_2@PLT
	test	eax, eax
	je	.L4
	mov	QWORD PTR 72[rbx], r12
	mov	DWORD PTR 32[rbx], ebp
	mov	QWORD PTR 64[rbx], 0
	test	ebp, ebp
	jle	.L9
	mov	rax, QWORD PTR 56[rbx]
	lea	edx, -1[rbp]
	lea	rcx, [rax+rdx*8]
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdx, rax
	mov	QWORD PTR [rax], 0
	add	rax, 8
	cmp	rdx, rcx
	jne	.L6
	movsx	r14, ebp
.L5:
	mov	esi, DWORD PTR RIO_MAX_MSG_SIZE[rip]
	mov	edi, DWORD PTR 24[rbx]
	lea	rdx, 40[rbx]
	mov	ecx, DWORD PTR GFP_KERNEL[rip]
	imul	esi, ebp
	call	dma_alloc_coherent@PLT
	mov	DWORD PTR 48[rbx], eax
	test	eax, eax
	jne	.L7
	mov	r12d, DWORD PTR ENOMEM[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	rax, QWORD PTR [rbx]
	mov	esi, DWORD PTR 40[rbx]
	lea	rdi, 12[rax]
	call	out_be32@PLT
	mov	rax, QWORD PTR [rbx]
	mov	esi, DWORD PTR 40[rbx]
	lea	rdi, 8[rax]
	call	out_be32@PLT
	mov	rax, QWORD PTR [rbx]
	mov	esi, 145
	lea	rdi, 4[rax]
	call	out_be32@PLT
	mov	r12d, DWORD PTR fsl_rio_rx_handler[rip]
	mov	rdi, r13
	call	IRQ_RIO_RX@PLT
	mov	r8, r13
	lea	rcx, .LC0[rip]
	xor	edx, edx
	mov	esi, r12d
	mov	edi, eax
	call	request_irq@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L17
.L3:
	endbr64
	mov	rdi, QWORD PTR [rbx]
	mov	esi, 1769568
	call	out_be32@PLT
	mov	edi, ebp
	call	get_bitmask_order@PLT
	mov	rdi, QWORD PTR [rbx]
	lea	esi, -2[rax]
	sal	esi, 12
	call	setbits32@PLT
	mov	rdi, QWORD PTR [rbx]
	mov	esi, 1
	call	setbits32@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	xor	r14d, r14d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rax, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR 24[rbx]
	mov	esi, DWORD PTR RIO_MSG_BUFFER_SIZE[rip]
	mov	ecx, DWORD PTR [rax+r14*4]
	mov	rax, QWORD PTR 16[rbx]
	mov	edx, DWORD PTR [rax+r14*4]
	call	dma_free_coherent@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	rio_open_inb_mbox, .-rio_open_inb_mbox
	.comm	fsl_rio_rx_handler,4,4
	.comm	RIO_MSG_BUFFER_SIZE,4,4
	.comm	RIO_MIN_RX_RING_SIZE,4,4
	.comm	RIO_MAX_RX_RING_SIZE,4,4
	.comm	RIO_MAX_MSG_SIZE,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,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_fsl_rio.c_rio_open_inb_mbox.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"msg_rx\000"
	.text
	.align	2
	.global	rio_open_inb_mbox
	.syntax unified
	.arm
	.fpu softvfp
	.type	rio_open_inb_mbox, %function
rio_open_inb_mbox:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r4, r3
	ldr	r3, .L18
	sub	sp, sp, #12
	ldr	r3, [r3]
	cmp	r3, r4
	bgt	.L4
	ldr	r3, .L18+4
	ldr	r3, [r3]
	cmp	r3, r4
	bge	.L16
.L4:
	ldr	r3, .L18+8
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L16:
	mov	r5, r0
	mov	r0, r4
	mov	r6, r1
	ldr	r7, [r5]
	bl	is_power_of_2
	cmp	r0, #0
	beq	.L4
	mov	r2, #0
	cmp	r4, r2
	str	r6, [r7, #36]
	str	r4, [r7, #16]
	str	r2, [r7, #32]
	ble	.L9
	ldr	r3, [r7, #28]
	add	r1, r3, r4, lsl #2
	sub	r1, r1, #4
	sub	r3, r3, #4
.L6:
	str	r2, [r3, #4]!
	cmp	r3, r1
	bne	.L6
	mov	r6, r4
.L5:
	ldr	r2, .L18+12
	ldr	r3, .L18+16
	ldr	r1, [r2]
	ldr	r3, [r3]
	mul	r1, r4, r1
	ldr	r0, [r7, #12]
	add	r2, r7, #20
	bl	dma_alloc_coherent
	cmp	r0, #0
	str	r0, [r7, #24]
	bne	.L7
	ldr	r3, .L18+20
	ldr	r5, [r3]
	rsb	r5, r5, #0
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L7:
	ldr	r0, [r7]
	ldr	r1, [r7, #20]
	add	r0, r0, #12
	bl	out_be32
	ldr	r0, [r7]
	ldr	r1, [r7, #20]
	add	r0, r0, #8
	bl	out_be32
	ldr	r0, [r7]
	mov	r1, #145
	add	r0, r0, #4
	bl	out_be32
	mov	r0, r5
	bl	IRQ_RIO_RX
	ldr	r3, .L18+24
	str	r5, [sp]
	ldr	r1, [r3]
	mov	r2, #0
	ldr	r3, .L18+28
	bl	request_irq
	subs	r5, r0, #0
	blt	.L17
.L3:
	ldr	r1, .L18+32
	ldr	r0, [r7]
	bl	out_be32
	mov	r0, r4
	ldr	r4, [r7]
	bl	get_bitmask_order
	sub	r1, r0, #2
	lsl	r1, r1, #12
	mov	r0, r4
	bl	setbits32
	mov	r1, #1
	ldr	r0, [r7]
	bl	setbits32
	b	.L1
.L9:
	mov	r6, r2
	b	.L5
.L17:
	ldr	r3, [r7, #4]
	ldr	r2, [r7, #8]
	ldr	r1, .L18+36
	ldr	r3, [r3, r6, lsl #2]
	ldr	r2, [r2, r6, lsl #2]
	ldr	r0, [r7, #12]
	ldr	r1, [r1]
	bl	dma_free_coherent
	b	.L1
.L19:
	.align	2
.L18:
	.word	RIO_MIN_RX_RING_SIZE
	.word	RIO_MAX_RX_RING_SIZE
	.word	EINVAL
	.word	RIO_MAX_MSG_SIZE
	.word	GFP_KERNEL
	.word	ENOMEM
	.word	fsl_rio_rx_handler
	.word	.LC0
	.word	1769568
	.word	RIO_MSG_BUFFER_SIZE
	.size	rio_open_inb_mbox, .-rio_open_inb_mbox
	.comm	fsl_rio_rx_handler,4,4
	.comm	RIO_MSG_BUFFER_SIZE,4,4
	.comm	RIO_MIN_RX_RING_SIZE,4,4
	.comm	RIO_MAX_RX_RING_SIZE,4,4
	.comm	RIO_MAX_MSG_SIZE,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
