	.file	"extr_IPC.c_IPCDhcpAllocateIP.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	IPCDhcpAllocateIP
	.type	IPCDhcpAllocateIP, @function
IPCDhcpAllocateIP:
.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
	mov	r14, rsi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	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
	mov	rbx, rdx
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	QWORD PTR [rsp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	Rand32@PLT
	test	rbp, rbp
	je	.L28
	test	r14, r14
	je	.L28
	lea	r14, 16[rsp]
	mov	esi, 24
	mov	r13d, eax
	mov	rdi, r14
	call	Zero@PLT
	mov	edi, DWORD PTR 32[rsp]
	mov	edx, DWORD PTR 0[rbp]
	mov	esi, 4
	mov	QWORD PTR 16[rsp], 0
	mov	eax, DWORD PTR DHCP_DISCOVER[rip]
	mov	DWORD PTR 36[rsp], eax
	call	StrCpy@PLT
	mov	rsi, r14
	mov	rdi, rbp
	call	IPCDhcpSetConditionalUserClass@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 120
	xor	esi, esi
	mov	rdi, rbp
	push	rbx
	.cfi_def_cfa_offset 128
	mov	r9d, DWORD PTR IPC_DHCP_TIMEOUT[rip]
	mov	rcx, r14
	mov	edx, r13d
	mov	r8d, DWORD PTR DHCP_OFFER[rip]
	call	IPCSendDhcpRequest@PLT
	pop	rsi
	.cfi_def_cfa_offset 120
	pop	rdi
	.cfi_def_cfa_offset 112
	mov	r12, rax
	test	rax, rax
	je	.L28
	mov	rax, QWORD PTR [rax]
	mov	rdi, QWORD PTR 24[rax]
	call	IsValidUnicastIPAddressUINT4@PLT
	mov	DWORD PTR 12[rsp], eax
	mov	rax, QWORD PTR [r12]
	mov	rdi, QWORD PTR 16[rax]
	call	IsValidUnicastIPAddressUINT4@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L31
.L6:
	mov	rax, QWORD PTR [r12]
	mov	edx, 0
	cmp	QWORD PTR [rax], 0
	cmove	r15d, edx
	mov	rdx, QWORD PTR 8[rax]
	test	rdx, rdx
	jne	.L8
	mov	rdx, QWORD PTR IPC_DHCP_DEFAULT_LEASE[rip]
	mov	QWORD PTR 8[rax], rdx
.L8:
	mov	rcx, QWORD PTR IPC_DHCP_MIN_LEASE[rip]
	cmp	rcx, rdx
	jge	.L32
	test	r15d, r15d
	je	.L33
.L10:
	mov	esi, 24
	mov	rdi, r14
	call	Zero@PLT
	mov	edi, DWORD PTR 32[rsp]
	mov	edx, DWORD PTR 0[rbp]
	mov	esi, 4
	mov	eax, DWORD PTR DHCP_REQUEST[rip]
	mov	DWORD PTR 36[rsp], eax
	call	StrCpy@PLT
	mov	rax, QWORD PTR [r12]
	mov	rdi, rbp
	mov	rsi, r14
	mov	rdx, QWORD PTR 16[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	QWORD PTR 24[rsp], rdx
	mov	QWORD PTR 16[rsp], rax
	call	IPCDhcpSetConditionalUserClass@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 120
	mov	edx, r13d
	mov	rdi, rbp
	push	rbx
	.cfi_def_cfa_offset 128
	mov	r9d, DWORD PTR IPC_DHCP_TIMEOUT[rip]
	mov	rcx, r14
	xor	esi, esi
	mov	r8d, DWORD PTR DHCP_ACK[rip]
	call	IPCSendDhcpRequest@PLT
	mov	rbp, rax
	pop	rax
	.cfi_def_cfa_offset 120
	pop	rdx
	.cfi_def_cfa_offset 112
	test	rbp, rbp
	je	.L34
	mov	rax, QWORD PTR 0[rbp]
	mov	rdi, QWORD PTR 24[rax]
	call	IsValidUnicastIPAddressUINT4@PLT
	mov	ebx, eax
	mov	rax, QWORD PTR 0[rbp]
	mov	rdi, QWORD PTR 16[rax]
	call	IsValidUnicastIPAddressUINT4@PLT
	mov	r15d, eax
	test	eax, eax
	je	.L12
	xor	r15d, r15d
	test	ebx, ebx
	setne	r15b
.L12:
	mov	rsi, QWORD PTR 0[rbp]
	mov	eax, 0
	cmp	QWORD PTR [rsi], 0
	cmove	r15d, eax
	mov	rax, QWORD PTR 8[rsi]
	test	rax, rax
	jne	.L14
	mov	rax, QWORD PTR IPC_DHCP_DEFAULT_LEASE[rip]
	mov	QWORD PTR 8[rsi], rax
.L14:
	mov	rdx, QWORD PTR IPC_DHCP_MIN_LEASE[rip]
	cmp	rdx, rax
	jl	.L15
	mov	QWORD PTR 8[rsi], rdx
.L15:
	test	r15d, r15d
	je	.L29
	mov	rdi, QWORD PTR [rsp]
	mov	edx, 24
	call	Copy@PLT
.L29:
	mov	rdi, r12
	call	FreeDHCPv4Data@PLT
	mov	rdi, rbp
	call	FreeDHCPv4Data@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L34:
	mov	rdi, r12
	call	FreeDHCPv4Data@PLT
	.p2align 4,,10
	.p2align 3
.L28:
	xor	r15d, r15d
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L35
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
.L32:
	.cfi_restore_state
	mov	QWORD PTR 8[rax], rcx
	test	r15d, r15d
	jne	.L10
.L33:
	mov	rdi, r12
	call	FreeDHCPv4Data@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L31:
	mov	ecx, DWORD PTR 12[rsp]
	xor	r15d, r15d
	test	ecx, ecx
	setne	r15b
	jmp	.L6
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	IPCDhcpAllocateIP, .-IPCDhcpAllocateIP
	.comm	IPC_DHCP_TIMEOUT,4,4
	.comm	IPC_DHCP_MIN_LEASE,8,8
	.comm	IPC_DHCP_DEFAULT_LEASE,8,8
	.comm	DHCP_REQUEST,4,4
	.comm	DHCP_OFFER,4,4
	.comm	DHCP_DISCOVER,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_IPC.c_IPCDhcpAllocateIP.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	IPCDhcpAllocateIP
	.syntax unified
	.arm
	.fpu softvfp
	.type	IPCDhcpAllocateIP, %function
IPCDhcpAllocateIP:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r1
	ldr	r3, .L33
	sub	sp, sp, #44
	mov	r5, r0
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	mov	r8, r2
	bl	Rand32
	clz	r3, r6
	cmp	r5, #0
	lsr	r3, r3, #5
	movne	r4, r3
	moveq	r4, #1
	cmp	r4, #0
	beq	.L2
.L4:
	mov	r4, #0
.L1:
	ldr	r3, .L33
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L29
	mov	r0, r4
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	mov	r9, r0
	mov	r1, #16
	add	r0, sp, #20
	bl	Zero
	ldr	r3, .L33+4
	ldr	r2, [r5]
	ldr	r3, [r3]
	mov	r1, #4
	ldr	r0, [sp, #28]
	str	r3, [sp, #32]
	str	r4, [sp, #20]
	bl	StrCpy
	add	r1, sp, #20
	mov	r0, r5
	bl	IPCDhcpSetConditionalUserClass
	ldr	r10, .L33+8
	ldr	r3, .L33+12
	ldr	r2, [r10]
	ldr	r3, [r3]
	mov	r1, r4
	str	r2, [sp, #4]
	str	r3, [sp]
	mov	r2, r9
	mov	r0, r5
	str	r8, [sp, #8]
	add	r3, sp, #20
	bl	IPCSendDhcpRequest
	subs	r7, r0, #0
	beq	.L4
	ldr	r3, [r7]
	ldr	r0, [r3, #12]
	bl	IsValidUnicastIPAddressUINT4
	ldr	r3, [r7]
	mov	fp, r0
	ldr	r0, [r3, #8]
	bl	IsValidUnicastIPAddressUINT4
	subs	r4, r0, #0
	bne	.L30
.L5:
	ldr	r3, [r7]
	ldr	fp, .L33+16
	ldm	r3, {r1, r2}
	cmp	r1, #0
	moveq	r4, #0
	cmp	r2, #0
	ldreq	r2, .L33+20
	ldr	r1, [fp]
	ldreq	r2, [r2]
	streq	r2, [r3, #4]
	cmp	r1, r2
	strge	r1, [r3, #4]
	cmp	r4, #0
	beq	.L31
	mov	r1, #16
	add	r0, sp, #20
	bl	Zero
	ldr	r3, .L33+24
	ldr	r2, [r5]
	ldr	r3, [r3]
	mov	r1, #4
	ldr	r0, [sp, #28]
	str	r3, [sp, #32]
	bl	StrCpy
	ldr	r3, [r7]
	mov	r0, r5
	ldr	r2, [r3, #8]
	ldr	r3, [r3, #12]
	add	r1, sp, #20
	str	r2, [sp, #24]
	str	r3, [sp, #20]
	bl	IPCDhcpSetConditionalUserClass
	ldr	r2, .L33+28
	ldr	r3, [r10]
	ldr	r1, [r2]
	mov	r0, r5
	stmib	sp, {r3, r8}
	str	r1, [sp]
	mov	r2, r9
	mov	r1, #0
	add	r3, sp, #20
	bl	IPCSendDhcpRequest
	subs	r5, r0, #0
	beq	.L32
	ldr	r3, [r5]
	ldr	r0, [r3, #12]
	bl	IsValidUnicastIPAddressUINT4
	ldr	r3, [r5]
	mov	r8, r0
	ldr	r0, [r3, #8]
	bl	IsValidUnicastIPAddressUINT4
	subs	r4, r0, #0
	beq	.L11
	subs	r4, r8, #0
	movne	r4, #1
.L11:
	ldr	r1, [r5]
	ldm	r1, {r2, r3}
	cmp	r2, #0
	moveq	r4, #0
	cmp	r3, #0
	ldreq	r3, .L33+20
	ldr	r2, [fp]
	ldreq	r3, [r3]
	streq	r3, [r1, #4]
	cmp	r2, r3
	strge	r2, [r1, #4]
	cmp	r4, #0
	beq	.L27
	mov	r0, r6
	mov	r2, #16
	bl	Copy
.L27:
	mov	r0, r7
	bl	FreeDHCPv4Data
	mov	r0, r5
	bl	FreeDHCPv4Data
	b	.L1
.L30:
	subs	r4, fp, #0
	movne	r4, #1
	b	.L5
.L31:
	mov	r0, r7
	bl	FreeDHCPv4Data
	b	.L1
.L32:
	mov	r0, r7
	bl	FreeDHCPv4Data
	mov	r4, r5
	b	.L1
.L29:
	bl	__stack_chk_fail
.L34:
	.align	2
.L33:
	.word	.LC0
	.word	DHCP_DISCOVER
	.word	IPC_DHCP_TIMEOUT
	.word	DHCP_OFFER
	.word	IPC_DHCP_MIN_LEASE
	.word	IPC_DHCP_DEFAULT_LEASE
	.word	DHCP_REQUEST
	.word	DHCP_ACK
	.size	IPCDhcpAllocateIP, .-IPCDhcpAllocateIP
	.comm	IPC_DHCP_TIMEOUT,4,4
	.comm	IPC_DHCP_MIN_LEASE,4,4
	.comm	IPC_DHCP_DEFAULT_LEASE,4,4
	.comm	DHCP_REQUEST,4,4
	.comm	DHCP_OFFER,4,4
	.comm	DHCP_DISCOVER,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
