	.file	"extr_dhcp.c_DHCP_run.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	DHCP_run
	.type	DHCP_run, @function
DHCP_run:
.LFB0:
	.cfi_startproc
	endbr64
	mov	eax, DWORD PTR STATE_DHCP_STOP[rip]
	cmp	DWORD PTR dhcp_state[rip], eax
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, DWORD PTR DHCP_STOPPED[rip]
	je	.L1
	mov	edi, DWORD PTR DHCP_SOCKET[rip]
	call	getSn_SR@PLT
	cmp	rax, QWORD PTR SOCK_UDP[rip]
	jne	.L21
.L4:
	xor	eax, eax
	mov	r12d, DWORD PTR DHCP_RUNNING[rip]
	call	parseDHCPMSG@PLT
	mov	esi, DWORD PTR dhcp_state[rip]
	lea	edx, -128[rsi]
	cmp	edx, 4
	ja	.L1
	lea	rcx, .L6[rip]
	movsx	rdx, DWORD PTR [rcx+rdx*4]
	add	rdx, rcx
	notrack jmp	rdx
	.section	.rodata
	.align 4
	.align 4
.L6:
	.long	.L10-.L6
	.long	.L9-.L6
	.long	.L8-.L6
	.long	.L7-.L6
	.long	.L5-.L6
	.text
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rax, QWORD PTR DHCP_allocated_ip[rip]
	mov	rdx, QWORD PTR OLD_allocated_ip[rip]
	mov	DWORD PTR dhcp_retry_count[rip], 0
	mov	edi, DWORD PTR [rax]
	cmp	DWORD PTR [rdx], edi
	jne	.L15
	mov	edi, DWORD PTR 4[rax]
	cmp	DWORD PTR 4[rdx], edi
	je	.L22
.L15:
	xor	eax, eax
	mov	r12d, DWORD PTR DHCP_IP_CHANGED[rip]
	call	dhcp_ip_update@PLT
.L16:
	xor	eax, eax
	call	reset_DHCP_timeout@PLT
	mov	DWORD PTR dhcp_state[rip], 130
.L1:
	mov	eax, r12d
	pop	r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	edx, DWORD PTR DHCP_CLIENT_PORT[rip]
	mov	esi, DWORD PTR Sn_MR_UDP[rip]
	xor	ecx, ecx
	mov	edi, DWORD PTR DHCP_SOCKET[rip]
	call	socket@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rax, QWORD PTR DHCP_allocated_ip[rip]
	mov	QWORD PTR [rax], 0
	mov	QWORD PTR 8[rax], 0
	xor	eax, eax
	call	send_DHCP_DISCOVER@PLT
	mov	eax, r12d
	pop	r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	mov	DWORD PTR dhcp_state[rip], 132
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	cmp	DWORD PTR DHCP_OFFER[rip], eax
	je	.L23
.L11:
	xor	eax, eax
	pop	r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	jmp	check_DHCP_timeout@PLT
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	cmp	DWORD PTR DHCP_ACK[rip], eax
	mov	r12d, DWORD PTR DHCP_IP_LEASED[rip]
	je	.L24
.L14:
	cmp	DWORD PTR DHCP_NAK[rip], eax
	jne	.L11
	xor	eax, eax
	call	reset_DHCP_timeout@PLT
	mov	DWORD PTR dhcp_state[rip], 132
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	cmp	DWORD PTR DHCP_ACK[rip], eax
	jne	.L14
	xor	eax, eax
	call	check_DHCP_leasedIP@PLT
	test	eax, eax
	mov	eax, 0
	je	.L13
	call	dhcp_ip_assign@PLT
	xor	eax, eax
	call	reset_DHCP_timeout@PLT
	mov	DWORD PTR dhcp_state[rip], 130
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	mov	edx, DWORD PTR dhcp_lease_time[rip]
	cmp	edx, DWORD PTR INFINITE_LEASETIME[rip]
	mov	r12d, DWORD PTR DHCP_IP_LEASED[rip]
	je	.L1
	mov	eax, edx
	shr	eax, 31
	add	eax, edx
	sar	eax
	cmp	eax, DWORD PTR dhcp_tick_1s[rip]
	jge	.L1
	mov	rdx, QWORD PTR DHCP_allocated_ip[rip]
	mov	rax, QWORD PTR OLD_allocated_ip[rip]
	mov	ecx, DWORD PTR [rdx]
	mov	DWORD PTR [rax], ecx
	mov	ecx, DWORD PTR 4[rdx]
	add	DWORD PTR DHCP_XID[rip], 1
	mov	DWORD PTR 4[rax], ecx
	mov	ecx, DWORD PTR 8[rdx]
	mov	DWORD PTR 8[rax], ecx
	mov	edx, DWORD PTR 12[rdx]
	mov	DWORD PTR 12[rax], edx
	xor	eax, eax
	call	send_DHCP_REQUEST@PLT
	xor	eax, eax
	call	reset_DHCP_timeout@PLT
	mov	DWORD PTR dhcp_state[rip], 128
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L23:
	mov	rax, QWORD PTR pDHCPMSG[rip]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR DHCP_allocated_ip[rip]
	mov	ecx, DWORD PTR [rdx]
	mov	DWORD PTR [rax], ecx
	mov	ecx, DWORD PTR 4[rdx]
	mov	DWORD PTR 4[rax], ecx
	mov	ecx, DWORD PTR 8[rdx]
	mov	DWORD PTR 8[rax], ecx
	mov	edx, DWORD PTR 12[rdx]
	mov	DWORD PTR 12[rax], edx
	xor	eax, eax
	call	send_DHCP_REQUEST@PLT
	mov	DWORD PTR dhcp_state[rip], 129
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	call	reset_DHCP_timeout@PLT
	xor	eax, eax
	call	dhcp_ip_conflict@PLT
	mov	DWORD PTR dhcp_state[rip], 131
	jmp	.L1
.L22:
	mov	edi, DWORD PTR 8[rax]
	cmp	DWORD PTR 8[rdx], edi
	jne	.L15
	mov	eax, DWORD PTR 12[rax]
	cmp	DWORD PTR 12[rdx], eax
	jne	.L15
	jmp	.L16
	.cfi_endproc
.LFE0:
	.size	DHCP_run, .-DHCP_run
	.comm	pDHCPMSG,8,8
	.comm	dhcp_tick_1s,4,4
	.comm	dhcp_state,4,4
	.comm	dhcp_retry_count,4,4
	.comm	dhcp_lease_time,4,4
	.comm	Sn_MR_UDP,4,4
	.comm	STATE_DHCP_STOP,4,4
	.comm	SOCK_UDP,8,8
	.comm	OLD_allocated_ip,8,8
	.comm	INFINITE_LEASETIME,4,4
	.comm	DHCP_allocated_ip,8,8
	.comm	DHCP_XID,4,4
	.comm	DHCP_STOPPED,4,4
	.comm	DHCP_SOCKET,4,4
	.comm	DHCP_RUNNING,4,4
	.comm	DHCP_OFFER,4,4
	.comm	DHCP_NAK,4,4
	.comm	DHCP_IP_LEASED,4,4
	.comm	DHCP_IP_CHANGED,4,4
	.comm	DHCP_CLIENT_PORT,4,4
	.comm	DHCP_ACK,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_dhcp.c_DHCP_run.c"
	.text
	.align	2
	.global	DHCP_run
	.syntax unified
	.arm
	.fpu softvfp
	.type	DHCP_run, %function
DHCP_run:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L26
	ldr	r4, .L26+4
	ldr	r3, [r3]
	ldr	r2, [r4]
	cmp	r2, r3
	beq	.L21
	ldr	r5, .L26+8
	ldr	r0, [r5]
	bl	getSn_SR
	ldr	r3, .L26+12
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L22
.L4:
	ldr	r3, .L26+16
	ldr	r5, [r3]
	bl	parseDHCPMSG
	ldr	r3, [r4]
	sub	r3, r3, #128
	cmp	r3, #4
	ldrls	pc, [pc, r3, asl #2]
	b	.L1
.L6:
	.word	.L10
	.word	.L9
	.word	.L8
	.word	.L7
	.word	.L5
.L25:
	mov	r0, #0
	ldr	r2, .L26+20
	ldr	r3, .L26+24
	ldr	r1, .L26+28
	ldr	r2, [r2]
	ldr	r3, [r3]
	str	r0, [r1]
	ldr	r0, [r2]
	ldr	r1, [r3]
	cmp	r0, r1
	bne	.L15
	ldr	r0, [r2, #4]
	ldr	r1, [r3, #4]
	cmp	r0, r1
	beq	.L23
.L15:
	ldr	r3, .L26+32
	ldr	r5, [r3]
	bl	dhcp_ip_update
.L16:
	bl	reset_DHCP_timeout
	mov	r3, #130
	str	r3, [r4]
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L22:
	ldr	r3, .L26+36
	ldr	r2, .L26+40
	ldr	r1, [r3]
	ldr	r0, [r5]
	mov	r3, #0
	ldr	r2, [r2]
	bl	socket
	b	.L4
.L21:
	ldr	r3, .L26+44
	ldr	r5, [r3]
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L5:
	ldr	r3, .L26+48
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L24
.L11:
	pop	{r4, r5, r6, lr}
	b	check_DHCP_timeout
.L10:
	ldr	r3, .L26+52
	ldr	r2, .L26+56
	ldr	r3, [r3]
	ldr	r5, [r2]
	cmp	r3, r0
	beq	.L25
.L14:
	ldr	r3, .L26+60
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L11
	bl	reset_DHCP_timeout
	mov	r3, #132
	str	r3, [r4]
	b	.L1
.L9:
	ldr	r3, .L26+52
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L14
	bl	check_DHCP_leasedIP
	cmp	r0, #0
	beq	.L13
	bl	dhcp_ip_assign
	bl	reset_DHCP_timeout
	mov	r3, #130
	str	r3, [r4]
	b	.L1
.L8:
	ldr	r2, .L26+64
	ldr	r3, .L26+68
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r2, .L26+56
	cmp	r3, r1
	ldr	r5, [r2]
	beq	.L1
	ldr	r2, .L26+72
	add	r3, r3, r3, lsr #31
	ldr	r2, [r2]
	cmp	r2, r3, asr #1
	ble	.L1
	ldr	r2, .L26+24
	ldr	r3, .L26+20
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r0, [r2]
	ldr	r1, .L26+76
	str	r0, [r3]
	ldr	r0, [r2, #4]
	str	r0, [r3, #4]
	ldr	r0, [r2, #8]
	str	r0, [r3, #8]
	ldr	r0, [r2, #12]
	ldr	r2, [r1]
	str	r0, [r3, #12]
	add	r3, r2, #1
	str	r3, [r1]
	bl	send_DHCP_REQUEST
	bl	reset_DHCP_timeout
	mov	r3, #128
	str	r3, [r4]
	b	.L1
.L7:
	mov	r2, #0
	ldr	r3, .L26+24
	ldr	r3, [r3]
	str	r2, [r3]
	str	r2, [r3, #4]
	str	r2, [r3, #8]
	str	r2, [r3, #12]
	bl	send_DHCP_DISCOVER
	mov	r3, #132
	mov	r0, r5
	str	r3, [r4]
	pop	{r4, r5, r6, pc}
.L24:
	ldr	r2, .L26+80
	ldr	r3, .L26+24
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r2]
	str	r1, [r3]
	ldr	r1, [r2, #4]
	str	r1, [r3, #4]
	ldr	r1, [r2, #8]
	str	r1, [r3, #8]
	ldr	r2, [r2, #12]
	str	r2, [r3, #12]
	bl	send_DHCP_REQUEST
	mov	r3, #129
	str	r3, [r4]
	b	.L1
.L13:
	bl	reset_DHCP_timeout
	bl	dhcp_ip_conflict
	mov	r3, #131
	str	r3, [r4]
	b	.L1
.L23:
	ldr	r0, [r2, #8]
	ldr	r1, [r3, #8]
	cmp	r0, r1
	bne	.L15
	ldr	r2, [r2, #12]
	ldr	r3, [r3, #12]
	cmp	r2, r3
	bne	.L15
	b	.L16
.L27:
	.align	2
.L26:
	.word	STATE_DHCP_STOP
	.word	dhcp_state
	.word	DHCP_SOCKET
	.word	SOCK_UDP
	.word	DHCP_RUNNING
	.word	OLD_allocated_ip
	.word	DHCP_allocated_ip
	.word	dhcp_retry_count
	.word	DHCP_IP_CHANGED
	.word	Sn_MR_UDP
	.word	DHCP_CLIENT_PORT
	.word	DHCP_STOPPED
	.word	DHCP_OFFER
	.word	DHCP_ACK
	.word	DHCP_IP_LEASED
	.word	DHCP_NAK
	.word	INFINITE_LEASETIME
	.word	dhcp_lease_time
	.word	dhcp_tick_1s
	.word	DHCP_XID
	.word	pDHCPMSG
	.size	DHCP_run, .-DHCP_run
	.comm	pDHCPMSG,4,4
	.comm	dhcp_tick_1s,4,4
	.comm	dhcp_state,4,4
	.comm	dhcp_retry_count,4,4
	.comm	dhcp_lease_time,4,4
	.comm	Sn_MR_UDP,4,4
	.comm	STATE_DHCP_STOP,4,4
	.comm	SOCK_UDP,4,4
	.comm	OLD_allocated_ip,4,4
	.comm	INFINITE_LEASETIME,4,4
	.comm	DHCP_allocated_ip,4,4
	.comm	DHCP_XID,4,4
	.comm	DHCP_STOPPED,4,4
	.comm	DHCP_SOCKET,4,4
	.comm	DHCP_RUNNING,4,4
	.comm	DHCP_OFFER,4,4
	.comm	DHCP_NAK,4,4
	.comm	DHCP_IP_LEASED,4,4
	.comm	DHCP_IP_CHANGED,4,4
	.comm	DHCP_CLIENT_PORT,4,4
	.comm	DHCP_ACK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
