	.file	"extr_legousbtower.c_tower_open.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"error, can't find device for minor %d\n"
	.align 8
.LC1:
	.string	"LEGO USB Tower reset control request failed\n"
	.align 8
.LC2:
	.string	"Couldn't submit interrupt_in_urb %d\n"
	.text
	.p2align 4
	.type	tower_open, @function
tower_open:
.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, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	mov	edi, 4
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	call	kmalloc@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L13
	mov	rsi, r13
	mov	rdi, r12
	call	nonseekable_open@PLT
	mov	rdi, r12
	call	iminor@PLT
	lea	rdi, tower_driver[rip]
	mov	esi, eax
	mov	r12d, eax
	call	usb_find_interface@PLT
	mov	rdi, rax
	test	rax, rax
	je	.L14
	call	usb_get_intfdata@PLT
	mov	r12d, DWORD PTR ENODEV[rip]
	mov	rbx, rax
	neg	r12d
	test	rax, rax
	je	.L3
	lea	r14, 8[rax]
	mov	rdi, r14
	call	mutex_lock_interruptible@PLT
	mov	r12d, DWORD PTR ERESTARTSYS[rip]
	neg	r12d
	test	rax, rax
	jne	.L3
	mov	ecx, DWORD PTR [rbx]
	test	ecx, ecx
	je	.L7
	mov	r12d, DWORD PTR EBUSY[rip]
	neg	r12d
.L8:
	mov	rdi, r14
	call	mutex_unlock@PLT
.L3:
	mov	rdi, rbp
	call	kfree@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L13:
	.cfi_restore_state
	mov	r12d, DWORD PTR ENOMEM[rip]
	neg	r12d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, QWORD PTR 16[rbx]
	xor	esi, esi
	mov	r12d, DWORD PTR USB_TYPE_VENDOR[rip]
	mov	r15d, DWORD PTR LEGO_USB_TOWER_REQUEST_RESET[rip]
	or	r12d, DWORD PTR USB_DIR_IN[rip]
	or	r12d, DWORD PTR USB_RECIP_DEVICE[rip]
	call	usb_rcvctrlpipe@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	mov	rdi, QWORD PTR 16[rbx]
	mov	ecx, r12d
	push	1000
	.cfi_def_cfa_offset 96
	mov	esi, eax
	xor	r9d, r9d
	xor	r8d, r8d
	push	4
	.cfi_def_cfa_offset 104
	mov	edx, r15d
	push	rbp
	.cfi_def_cfa_offset 112
	call	usb_control_msg@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 80
	mov	r12d, eax
	test	eax, eax
	js	.L15
	mov	ecx, DWORD PTR 40[rbx]
	mov	QWORD PTR 72[rbx], 0
	mov	QWORD PTR 64[rbx], 0
	mov	r9d, DWORD PTR tower_interrupt_in_callback[rip]
	mov	rdi, QWORD PTR 48[rbx]
	mov	DWORD PTR 12[rsp], ecx
	mov	DWORD PTR 8[rsp], r9d
	call	usb_endpoint_maxp@PLT
	mov	rdi, QWORD PTR 16[rbx]
	mov	r15d, DWORD PTR 56[rbx]
	mov	r12d, eax
	mov	rax, QWORD PTR 48[rbx]
	mov	esi, DWORD PTR [rax]
	call	usb_rcvintpipe@PLT
	mov	ecx, DWORD PTR 12[rsp]
	mov	rsi, QWORD PTR 16[rbx]
	mov	r8d, r12d
	mov	edi, DWORD PTR 24[rbx]
	mov	edx, eax
	push	rcx
	.cfi_def_cfa_offset 88
	mov	ecx, r15d
	push	rbx
	.cfi_def_cfa_offset 96
	mov	r9d, DWORD PTR 24[rsp]
	call	usb_fill_int_urb@PLT
	mov	DWORD PTR 4[rbx], 1
	xor	eax, eax
	mov	QWORD PTR 32[rbx], 0
	call	mb@PLT
	mov	edi, DWORD PTR 24[rbx]
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	call	usb_submit_urb@PLT
	mov	r12d, eax
	pop	rax
	.cfi_def_cfa_offset 88
	pop	rdx
	.cfi_def_cfa_offset 80
	test	r12d, r12d
	jne	.L16
	mov	QWORD PTR 0[r13], rbx
	mov	DWORD PTR [rbx], 1
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L14:
	mov	esi, r12d
	lea	rdi, .LC0[rip]
	call	pr_err@PLT
	mov	r12d, DWORD PTR ENODEV[rip]
	neg	r12d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L15:
	mov	rdi, QWORD PTR 16[rbx]
	lea	rsi, .LC1[rip]
	xor	eax, eax
	call	dev_err@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rdi, QWORD PTR 16[rbx]
	mov	edx, r12d
	lea	rsi, .LC2[rip]
	xor	eax, eax
	call	dev_err@PLT
	mov	DWORD PTR 4[rbx], 0
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	tower_open, .-tower_open
	.comm	tower_interrupt_in_callback,4,4
	.comm	tower_driver,4,4
	.comm	USB_TYPE_VENDOR,4,4
	.comm	USB_RECIP_DEVICE,4,4
	.comm	USB_DIR_IN,4,4
	.comm	LEGO_USB_TOWER_REQUEST_RESET,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ERESTARTSYS,4,4
	.comm	ENOMEM,4,4
	.comm	ENODEV,4,4
	.comm	EBUSY,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_legousbtower.c_tower_open.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"error, can't find device for minor %d\012\000"
	.align	2
.LC1:
	.ascii	"LEGO USB Tower reset control request failed\012\000"
	.align	2
.LC2:
	.ascii	"Couldn't submit interrupt_in_urb %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tower_open, %function
tower_open:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r7, .L18
	mov	r5, r0
	mov	r6, r1
	mov	r0, #4
	ldr	r1, [r7]
	sub	sp, sp, #44
	bl	kmalloc
	subs	r4, r0, #0
	beq	.L13
	mov	r1, r6
	mov	r0, r5
	bl	nonseekable_open
	mov	r0, r5
	bl	iminor
	mov	r5, r0
	ldr	r0, .L18+4
	mov	r1, r5
	bl	usb_find_interface
	cmp	r0, #0
	beq	.L14
	bl	usb_get_intfdata
	subs	r5, r0, #0
	beq	.L15
	add	r9, r5, #8
	mov	r0, r9
	bl	mutex_lock_interruptible
	cmp	r0, #0
	bne	.L16
	ldr	r8, [r5]
	cmp	r8, #0
	beq	.L7
	ldr	r3, .L18+8
	ldr	r10, [r3]
	rsb	r10, r10, #0
.L8:
	mov	r0, r9
	bl	mutex_unlock
	b	.L3
.L13:
	ldr	r3, .L18+12
	ldr	r10, [r3]
	rsb	r10, r10, #0
.L3:
	mov	r0, r4
	bl	kfree
	mov	r0, r10
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	ldr	r3, .L18+16
	ldr	r10, [r3]
	rsb	r10, r10, #0
	b	.L3
.L7:
	ldr	r10, [r5, #12]
	mov	r1, r8
	mov	r0, r10
	bl	usb_rcvctrlpipe
	mov	r2, #1000
	mov	ip, #4
	mov	r1, r0
	ldr	r3, .L18+20
	ldr	r0, .L18+24
	ldr	r3, [r3]
	ldr	lr, [r0]
	ldr	r0, .L18+28
	orr	r3, lr, r3
	ldr	lr, [r0]
	str	r2, [sp, #16]
	ldr	r2, .L18+32
	str	r4, [sp, #8]
	str	r8, [sp, #4]
	str	r8, [sp]
	str	ip, [sp, #12]
	mov	r0, r10
	ldr	r2, [r2]
	orr	r3, r3, lr
	bl	usb_control_msg
	subs	r10, r0, #0
	blt	.L17
	ldr	r3, [r5, #28]
	ldr	r10, [r5, #12]
	ldr	r1, [r3]
	ldr	r3, [r5, #16]
	mov	r0, r10
	str	r8, [r5, #40]
	str	r8, [r5, #36]
	str	r3, [sp, #28]
	bl	usb_rcvintpipe
	mov	r2, r0
	ldr	r3, [r5, #32]
	ldr	r0, [r5, #28]
	str	r2, [sp, #36]
	str	r3, [sp, #32]
	bl	usb_endpoint_maxp
	mov	ip, r0
	mov	fp, #1
	ldr	r1, .L18+36
	ldr	lr, [r5, #24]
	ldr	r2, [r1]
	ldr	r3, [sp, #32]
	mov	r1, r10
	str	ip, [sp]
	str	lr, [sp, #12]
	str	r2, [sp, #4]
	ldr	r0, [sp, #28]
	ldr	r2, [sp, #36]
	str	r5, [sp, #8]
	bl	usb_fill_int_urb
	str	r8, [r5, #20]
	str	fp, [r5, #4]
	bl	mb
	ldr	r1, [r7]
	ldr	r0, [r5, #16]
	bl	usb_submit_urb
	subs	r10, r0, #0
	streq	r5, [r6]
	streq	fp, [r5]
	beq	.L8
	mov	r2, r10
	ldr	r1, .L18+40
	ldr	r0, [r5, #12]
	bl	dev_err
	str	r8, [r5, #4]
	b	.L8
.L16:
	ldr	r3, .L18+44
	ldr	r10, [r3]
	rsb	r10, r10, #0
	b	.L3
.L14:
	mov	r1, r5
	ldr	r0, .L18+48
	bl	pr_err
	ldr	r3, .L18+16
	ldr	r10, [r3]
	rsb	r10, r10, #0
	b	.L3
.L17:
	ldr	r0, [r5, #12]
	ldr	r1, .L18+52
	bl	dev_err
	b	.L8
.L19:
	.align	2
.L18:
	.word	GFP_KERNEL
	.word	tower_driver
	.word	EBUSY
	.word	ENOMEM
	.word	ENODEV
	.word	USB_DIR_IN
	.word	USB_TYPE_VENDOR
	.word	USB_RECIP_DEVICE
	.word	LEGO_USB_TOWER_REQUEST_RESET
	.word	tower_interrupt_in_callback
	.word	.LC2
	.word	ERESTARTSYS
	.word	.LC0
	.word	.LC1
	.size	tower_open, .-tower_open
	.comm	tower_interrupt_in_callback,4,4
	.comm	tower_driver,4,4
	.comm	USB_TYPE_VENDOR,4,4
	.comm	USB_RECIP_DEVICE,4,4
	.comm	USB_DIR_IN,4,4
	.comm	LEGO_USB_TOWER_REQUEST_RESET,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ERESTARTSYS,4,4
	.comm	ENOMEM,4,4
	.comm	ENODEV,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
