	.file	"extr_hub.c_hub_port_wait_reset.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"warm "
.LC1:
	.string	""
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"not %sreset yet, waiting %dms\n"
	.text
	.p2align 4
	.type	hub_port_wait_reset, @function
hub_port_wait_reset:
.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
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	QWORD PTR 24[rsp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR HUB_RESET_TIMEOUT[rip]
	mov	DWORD PTR 52[rsp], 0
	test	eax, eax
	jle	.L11
	test	r8d, r8d
	lea	rax, .LC1[rip]
	lea	r15, 48[rsp]
	lea	r13, .LC0[rip]
	cmove	r13, rax
	movsx	rax, esi
	xor	ebx, ebx
	lea	rax, -8[0+rax*8]
	mov	QWORD PTR 8[rsp], rax
	lea	rax, 44[rsp]
	mov	r14, r13
	mov	r13d, ecx
	mov	QWORD PTR [rsp], rax
	lea	rax, 52[rsp]
	mov	QWORD PTR 16[rsp], rax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L43:
	mov	r9, QWORD PTR 16[rsp]
	mov	rcx, QWORD PTR [rsp]
	mov	r8, r15
	mov	esi, r12d
	mov	edx, DWORD PTR HUB_EXT_PORT_STATUS[rip]
	mov	rdi, rbp
	call	hub_ext_port_status@PLT
	test	eax, eax
	js	.L1
.L44:
	mov	edx, DWORD PTR 44[rsp]
	test	DWORD PTR USB_PORT_STAT_RESET[rip], edx
	jne	.L8
	test	DWORD PTR USB_PORT_STAT_CONNECTION[rip], edx
	jne	.L4
.L8:
	mov	eax, DWORD PTR HUB_SHORT_RESET_TIME[rip]
	mov	rcx, QWORD PTR 8[rsp]
	mov	rdx, r14
	lea	rsi, .LC2[rip]
	add	eax, eax
	cmp	eax, ebx
	mov	rax, QWORD PTR 8[rbp]
	cmovle	r13d, DWORD PTR HUB_LONG_RESET_TIME[rip]
	mov	rdi, QWORD PTR [rax+rcx]
	mov	ecx, r13d
	add	ebx, r13d
	call	dev_dbg@PLT
	cmp	DWORD PTR HUB_RESET_TIMEOUT[rip], ebx
	jle	.L11
.L10:
	mov	edi, r13d
	call	msleep@PLT
	mov	edi, DWORD PTR 0[rbp]
	call	hub_is_superspeedplus@PLT
	test	rax, rax
	jne	.L43
	mov	rdx, QWORD PTR [rsp]
	mov	rcx, r15
	mov	esi, r12d
	mov	rdi, rbp
	call	hub_port_status@PLT
	test	eax, eax
	jns	.L44
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rsi, QWORD PTR 56[rsp]
	xor	rsi, QWORD PTR fs:40
	jne	.L45
	add	rsp, 72
	.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
.L11:
	.cfi_restore_state
	mov	eax, DWORD PTR EBUSY[rip]
	mov	edx, DWORD PTR 44[rsp]
	neg	eax
	test	DWORD PTR USB_PORT_STAT_RESET[rip], edx
	jne	.L1
.L4:
	mov	esi, r12d
	mov	rdi, rbp
	call	hub_port_warm_reset_required@PLT
	test	rax, rax
	jne	.L13
	mov	eax, DWORD PTR 44[rsp]
	test	DWORD PTR USB_PORT_STAT_CONNECTION[rip], eax
	je	.L13
	mov	edi, DWORD PTR 0[rbp]
	call	hub_is_superspeed@PLT
	test	rax, rax
	jne	.L14
	mov	eax, DWORD PTR 48[rsp]
	test	DWORD PTR USB_PORT_STAT_C_CONNECTION[rip], eax
	je	.L14
	mov	edx, DWORD PTR USB_PORT_FEAT_C_CONNECTION[rip]
	mov	edi, DWORD PTR 0[rbp]
	mov	esi, r12d
	call	usb_clear_port_feature@PLT
	mov	eax, DWORD PTR EAGAIN[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	eax, DWORD PTR ENOTCONN[rip]
	neg	eax
	jmp	.L1
.L14:
	mov	eax, DWORD PTR 44[rsp]
	test	DWORD PTR USB_PORT_STAT_ENABLE[rip], eax
	je	.L46
	xor	eax, eax
	cmp	QWORD PTR 24[rsp], 0
	je	.L1
	mov	edi, DWORD PTR 0[rbp]
	call	hub_is_superspeedplus@PLT
	test	rax, rax
	jne	.L47
	movabs	rsi, 4294967297
	mov	rax, QWORD PTR 24[rsp]
	mov	QWORD PTR [rax], rsi
.L17:
	mov	rdi, rbp
	call	hub_is_wusb@PLT
	test	rax, rax
	je	.L18
	mov	eax, DWORD PTR USB_SPEED_WIRELESS[rip]
	mov	rsi, QWORD PTR 24[rsp]
	mov	DWORD PTR 8[rsi], eax
	xor	eax, eax
	jmp	.L1
.L46:
	mov	eax, DWORD PTR EBUSY[rip]
	neg	eax
	jmp	.L1
.L18:
	mov	edi, DWORD PTR 0[rbp]
	call	hub_is_superspeedplus@PLT
	test	rax, rax
	je	.L19
	mov	edi, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR 52[rsp]
	and	esi, DWORD PTR USB_EXT_PORT_STAT_RX_SPEED_ID[rip]
	call	port_speed_is_ssp@PLT
	test	rax, rax
	je	.L19
	mov	eax, DWORD PTR USB_SPEED_SUPER_PLUS[rip]
	mov	rsi, QWORD PTR 24[rsp]
	mov	DWORD PTR 8[rsi], eax
	xor	eax, eax
	jmp	.L1
.L47:
	mov	edi, DWORD PTR 52[rsp]
	call	USB_EXT_PORT_RX_LANES@PLT
	mov	rbx, QWORD PTR 24[rsp]
	mov	edi, DWORD PTR 52[rsp]
	add	eax, 1
	mov	DWORD PTR [rbx], eax
	call	USB_EXT_PORT_TX_LANES@PLT
	add	eax, 1
	mov	DWORD PTR 4[rbx], eax
	jmp	.L17
.L19:
	mov	edi, DWORD PTR 0[rbp]
	call	hub_is_superspeed@PLT
	test	rax, rax
	je	.L20
	mov	eax, DWORD PTR USB_SPEED_SUPER[rip]
	mov	rsi, QWORD PTR 24[rsp]
	mov	DWORD PTR 8[rsi], eax
	xor	eax, eax
	jmp	.L1
.L20:
	mov	eax, DWORD PTR 44[rsp]
	test	DWORD PTR USB_PORT_STAT_HIGH_SPEED[rip], eax
	je	.L21
	mov	eax, DWORD PTR USB_SPEED_HIGH[rip]
	mov	rsi, QWORD PTR 24[rsp]
	mov	DWORD PTR 8[rsi], eax
	xor	eax, eax
	jmp	.L1
.L21:
	and	eax, DWORD PTR USB_PORT_STAT_LOW_SPEED[rip]
	je	.L22
	mov	eax, DWORD PTR USB_SPEED_LOW[rip]
	mov	rsi, QWORD PTR 24[rsp]
	mov	DWORD PTR 8[rsi], eax
	xor	eax, eax
	jmp	.L1
.L22:
	mov	edx, DWORD PTR USB_SPEED_FULL[rip]
	mov	rsi, QWORD PTR 24[rsp]
	mov	DWORD PTR 8[rsi], edx
	jmp	.L1
.L45:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	hub_port_wait_reset, .-hub_port_wait_reset
	.comm	USB_SPEED_WIRELESS,4,4
	.comm	USB_SPEED_SUPER_PLUS,4,4
	.comm	USB_SPEED_SUPER,4,4
	.comm	USB_SPEED_LOW,4,4
	.comm	USB_SPEED_HIGH,4,4
	.comm	USB_SPEED_FULL,4,4
	.comm	USB_PORT_STAT_RESET,4,4
	.comm	USB_PORT_STAT_LOW_SPEED,4,4
	.comm	USB_PORT_STAT_HIGH_SPEED,4,4
	.comm	USB_PORT_STAT_ENABLE,4,4
	.comm	USB_PORT_STAT_C_CONNECTION,4,4
	.comm	USB_PORT_STAT_CONNECTION,4,4
	.comm	USB_PORT_FEAT_C_CONNECTION,4,4
	.comm	USB_EXT_PORT_STAT_RX_SPEED_ID,4,4
	.comm	HUB_SHORT_RESET_TIME,4,4
	.comm	HUB_RESET_TIMEOUT,4,4
	.comm	HUB_LONG_RESET_TIME,4,4
	.comm	HUB_EXT_PORT_STATUS,4,4
	.comm	ENOTCONN,4,4
	.comm	EBUSY,4,4
	.comm	EAGAIN,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_hub.c_hub_port_wait_reset.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"warm \000"
	.align	2
.LC1:
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"not %sreset yet, waiting %dms\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	hub_port_wait_reset, %function
hub_port_wait_reset:
	@ args = 4, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, #0
	ldr	r9, .L51
	mov	r6, r0
	ldr	r0, [r9]
	sub	sp, sp, #44
	mov	r5, r3
	ldr	r3, .L51+4
	str	r2, [sp, #20]
	cmp	r0, r4
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	mov	r8, r1
	str	r4, [sp, #32]
	ble	.L45
	ldr	r1, [sp, #80]
	ldr	r3, .L51+8
	cmp	r1, #0
	ldr	r2, .L51+12
	moveq	r2, r3
	sub	r3, r8, #-1073741823
	lsl	r3, r3, #2
	mov	fp, r2
	ldr	r7, .L51+16
	ldr	r10, .L51+20
	str	r3, [sp, #12]
	b	.L10
.L47:
	add	r3, sp, #32
	add	r2, sp, #28
	stm	sp, {r2, r3}
	ldr	r2, .L51+24
	mov	r1, r8
	mov	r0, r6
	ldr	r2, [r2]
	add	r3, sp, #24
	bl	hub_ext_port_status
	cmp	r0, #0
	blt	.L40
.L48:
	ldr	r2, [sp, #24]
	ldr	r3, [r7]
	str	r7, [sp, #16]
	tst	r2, r3
	bne	.L8
	ldr	r3, .L51+28
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L4
.L8:
	ldr	r3, [r10]
	ldr	r2, [r6, #4]
	cmp	r4, r3, lsl #1
	ldrge	r3, .L51+32
	ldr	r1, [sp, #12]
	ldrge	r5, [r3]
	ldr	r0, [r2, r1]
	mov	r3, r5
	mov	r2, fp
	ldr	r1, .L51+36
	bl	dev_dbg
	ldr	r3, [r9]
	add	r4, r4, r5
	cmp	r3, r4
	ble	.L46
.L10:
	mov	r0, r5
	bl	msleep
	ldr	r0, [r6]
	bl	hub_is_superspeedplus
	cmp	r0, #0
	bne	.L47
	mov	r1, r8
	mov	r0, r6
	add	r3, sp, #28
	add	r2, sp, #24
	bl	hub_port_status
	cmp	r0, #0
	bge	.L48
.L40:
	mov	fp, r0
.L1:
	ldr	r3, .L51+4
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L49
	mov	r0, fp
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L46:
	ldr	fp, [sp, #16]
.L11:
	ldr	r3, [fp]
	ldr	r2, [sp, #24]
	tst	r2, r3
	beq	.L4
.L43:
	ldr	r3, .L51+40
	ldr	fp, [r3]
	rsb	fp, fp, #0
	b	.L1
.L4:
	mov	r1, r8
	mov	r0, r6
	bl	hub_port_warm_reset_required
	subs	fp, r0, #0
	bne	.L13
	ldr	r3, .L51+28
	ldr	r2, [sp, #24]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L13
	ldr	r0, [r6]
	bl	hub_is_superspeed
	cmp	r0, #0
	bne	.L14
	ldr	r3, .L51+44
	ldr	r2, [sp, #28]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L14
	ldr	r3, .L51+48
	mov	r1, r8
	ldr	r2, [r3]
	ldr	r0, [r6]
	bl	usb_clear_port_feature
	ldr	r3, .L51+52
	ldr	fp, [r3]
	rsb	fp, fp, #0
	b	.L1
.L13:
	ldr	r3, .L51+56
	ldr	fp, [r3]
	rsb	fp, fp, #0
	b	.L1
.L14:
	ldr	r3, .L51+60
	ldr	r2, [sp, #24]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L43
	ldr	r3, [sp, #20]
	cmp	r3, #0
	beq	.L1
	ldr	r0, [r6]
	bl	hub_is_superspeedplus
	cmp	r0, #0
	bne	.L50
	mov	r3, #1
	ldr	r2, [sp, #20]
	str	r3, [r2]
	str	r3, [r2, #4]
.L17:
	mov	r0, r6
	bl	hub_is_wusb
	subs	r4, r0, #0
	beq	.L18
	ldr	r3, .L51+64
	ldr	r2, [sp, #20]
	ldr	r3, [r3]
	str	r3, [r2, #8]
	b	.L1
.L45:
	ldr	fp, .L51+16
	b	.L11
.L18:
	ldr	r0, [r6]
	bl	hub_is_superspeedplus
	cmp	r0, #0
	beq	.L19
	ldr	r3, .L51+68
	ldr	r1, [sp, #32]
	ldr	r3, [r3]
	ldr	r0, [r6]
	and	r1, r1, r3
	bl	port_speed_is_ssp
	cmp	r0, #0
	beq	.L19
	ldr	r3, .L51+72
	ldr	r2, [sp, #20]
	ldr	r3, [r3]
	mov	fp, r4
	str	r3, [r2, #8]
	b	.L1
.L50:
	ldr	r0, [sp, #32]
	bl	USB_EXT_PORT_RX_LANES
	ldr	r4, [sp, #20]
	add	r3, r0, #1
	str	r3, [r4]
	ldr	r0, [sp, #32]
	bl	USB_EXT_PORT_TX_LANES
	add	r3, r0, #1
	str	r3, [r4, #4]
	b	.L17
.L19:
	ldr	r0, [r6]
	bl	hub_is_superspeed
	subs	fp, r0, #0
	beq	.L20
	ldr	r3, .L51+76
	ldr	r2, [sp, #20]
	ldr	r3, [r3]
	mov	fp, #0
	str	r3, [r2, #8]
	b	.L1
.L20:
	ldr	r3, .L51+80
	ldr	r2, [sp, #24]
	ldr	r3, [r3]
	ands	r3, r2, r3
	beq	.L21
	ldr	r3, .L51+84
	ldr	r2, [sp, #20]
	ldr	r3, [r3]
	str	r3, [r2, #8]
	b	.L1
.L21:
	ldr	r1, .L51+88
	ldr	fp, [r1]
	ands	fp, r2, fp
	ldrne	r2, .L51+92
	ldreq	r3, .L51+96
	movne	fp, r3
	ldreq	r3, [r3]
	ldrne	r3, [r2]
	ldr	r2, [sp, #20]
	str	r3, [r2, #8]
	b	.L1
.L49:
	bl	__stack_chk_fail
.L52:
	.align	2
.L51:
	.word	HUB_RESET_TIMEOUT
	.word	.LC3
	.word	.LC1
	.word	.LC0
	.word	USB_PORT_STAT_RESET
	.word	HUB_SHORT_RESET_TIME
	.word	HUB_EXT_PORT_STATUS
	.word	USB_PORT_STAT_CONNECTION
	.word	HUB_LONG_RESET_TIME
	.word	.LC2
	.word	EBUSY
	.word	USB_PORT_STAT_C_CONNECTION
	.word	USB_PORT_FEAT_C_CONNECTION
	.word	EAGAIN
	.word	ENOTCONN
	.word	USB_PORT_STAT_ENABLE
	.word	USB_SPEED_WIRELESS
	.word	USB_EXT_PORT_STAT_RX_SPEED_ID
	.word	USB_SPEED_SUPER_PLUS
	.word	USB_SPEED_SUPER
	.word	USB_PORT_STAT_HIGH_SPEED
	.word	USB_SPEED_HIGH
	.word	USB_PORT_STAT_LOW_SPEED
	.word	USB_SPEED_LOW
	.word	USB_SPEED_FULL
	.size	hub_port_wait_reset, .-hub_port_wait_reset
	.comm	USB_SPEED_WIRELESS,4,4
	.comm	USB_SPEED_SUPER_PLUS,4,4
	.comm	USB_SPEED_SUPER,4,4
	.comm	USB_SPEED_LOW,4,4
	.comm	USB_SPEED_HIGH,4,4
	.comm	USB_SPEED_FULL,4,4
	.comm	USB_PORT_STAT_RESET,4,4
	.comm	USB_PORT_STAT_LOW_SPEED,4,4
	.comm	USB_PORT_STAT_HIGH_SPEED,4,4
	.comm	USB_PORT_STAT_ENABLE,4,4
	.comm	USB_PORT_STAT_C_CONNECTION,4,4
	.comm	USB_PORT_STAT_CONNECTION,4,4
	.comm	USB_PORT_FEAT_C_CONNECTION,4,4
	.comm	USB_EXT_PORT_STAT_RX_SPEED_ID,4,4
	.comm	HUB_SHORT_RESET_TIME,4,4
	.comm	HUB_RESET_TIMEOUT,4,4
	.comm	HUB_LONG_RESET_TIME,4,4
	.comm	HUB_EXT_PORT_STATUS,4,4
	.comm	ENOTCONN,4,4
	.comm	EBUSY,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
