	.file	"extr_snmpclient.c_snmp_receive_packet.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"setsockopt: %s"
.LC2:
	.string	"getsockopt: %s"
.LC3:
	.string	"fcntl: %s"
.LC4:
	.string	"recv: %s"
.LC5:
	.string	"recv: socket closed by peer"
.LC6:
	.string	"snmp_decode_pdu: failed %d"
	.text
	.p2align 4
	.type	snmp_receive_packet, @function
snmp_receive_packet:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rsi
	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
	mov	rbx, rdi
	mov	edi, 1
	sub	rsp, 48
	.cfi_def_cfa_offset 96
	mov	esi, DWORD PTR snmp_client[rip+36]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	calloc@PLT
	test	rax, rax
	je	.L26
	mov	edi, DWORD PTR snmp_client[rip+32]
	mov	rbp, rax
	test	r13, r13
	je	.L11
	cmp	QWORD PTR 0[r13], 0
	jne	.L5
	cmp	QWORD PTR 8[r13], 0
	jne	.L5
.L6:
	mov	esi, DWORD PTR F_GETFL[rip]
	xor	edx, edx
	call	fcntl@PLT
	mov	r12d, eax
	cmp	eax, -1
	je	.L24
	mov	edx, DWORD PTR O_NONBLOCK[rip]
	mov	edi, DWORD PTR snmp_client[rip+32]
	test	edx, eax
	je	.L27
.L11:
	mov	edx, DWORD PTR snmp_client[rip+36]
	xor	ecx, ecx
	mov	rsi, rbp
	call	recv@PLT
	mov	r14d, DWORD PTR errno[rip]
	mov	r12d, eax
	cmp	r12d, -1
	jne	.L13
.L31:
	mov	rdi, rbp
	call	free@PLT
	mov	eax, DWORD PTR errno[rip]
	cmp	eax, DWORD PTR EAGAIN[rip]
	je	.L21
	cmp	eax, DWORD PTR EWOULDBLOCK[rip]
	je	.L21
	mov	edi, r14d
	call	strerror@PLT
	lea	rsi, .LC4[rip]
	lea	rdi, snmp_client[rip]
	mov	edx, eax
	xor	eax, eax
	call	seterr@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edx, DWORD PTR SO_RCVTIMEO[rip]
	mov	esi, DWORD PTR SOL_SOCKET[rip]
	mov	r8d, 16
	mov	rcx, r13
	call	setsockopt@PLT
	mov	r12d, eax
	cmp	eax, -1
	je	.L28
	mov	edx, DWORD PTR SO_RCVTIMEO[rip]
	mov	esi, DWORD PTR SOL_SOCKET[rip]
	lea	r8, 12[rsp]
	mov	rcx, r13
	mov	edi, DWORD PTR snmp_client[rip+32]
	mov	DWORD PTR 12[rsp], 16
	call	getsockopt@PLT
	mov	r12d, eax
	cmp	eax, -1
	je	.L29
	cmp	QWORD PTR 0[r13], 0
	mov	edi, DWORD PTR snmp_client[rip+32]
	je	.L30
.L9:
	mov	edx, DWORD PTR snmp_client[rip+36]
	xor	ecx, ecx
	mov	rsi, rbp
	call	recv@PLT
	mov	r14d, DWORD PTR errno[rip]
	mov	rcx, r13
	mov	QWORD PTR 0[r13], 0
	mov	edx, DWORD PTR SO_RCVTIMEO[rip]
	mov	esi, DWORD PTR SOL_SOCKET[rip]
	mov	r12d, eax
	mov	QWORD PTR 8[r13], 0
	mov	edi, DWORD PTR snmp_client[rip+32]
	mov	r8d, 16
	call	setsockopt@PLT
.L18:
	cmp	r12d, -1
	je	.L31
.L13:
	test	r12d, r12d
	je	.L32
	xor	esi, esi
	mov	edx, 16
	mov	rdi, rbx
	mov	QWORD PTR 24[rsp], rbp
	mov	DWORD PTR 16[rsp], r12d
	call	memset@PLT
	mov	rax, QWORD PTR SNMP_SECMODEL_USM[rip]
	cmp	QWORD PTR snmp_client[rip], rax
	je	.L33
.L15:
	lea	rdx, 8[rsp]
	lea	rdi, 16[rsp]
	mov	rsi, rbx
	call	snmp_pdu_decode@PLT
	cmp	DWORD PTR SNMP_CODE_OK[rip], eax
	mov	edx, eax
	jne	.L34
	mov	rdi, rbp
	call	free@PLT
	cmp	QWORD PTR snmp_client[rip+16], 0
	jne	.L35
.L17:
	mov	eax, DWORD PTR 4[rbx]
	mov	r12d, 1
	mov	DWORD PTR snmp_client[rip+12], eax
	mov	eax, DWORD PTR [rbx]
	mov	DWORD PTR snmp_client[rip+8], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L32:
	mov	rdi, rbp
	mov	r12d, -1
	call	free@PLT
	lea	rsi, .LC5[rip]
	lea	rdi, snmp_client[rip]
	xor	eax, eax
	call	seterr@PLT
	mov	eax, DWORD PTR EPIPE[rip]
	mov	DWORD PTR errno[rip], eax
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L36
	add	rsp, 48
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 40
	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
.L34:
	.cfi_restore_state
	lea	rsi, .LC6[rip]
	lea	rdi, snmp_client[rip]
	xor	eax, eax
	mov	r12d, -1
	call	seterr@PLT
	mov	rdi, rbp
	call	free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	cmp	QWORD PTR 8[r13], 0
	jne	.L9
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	mov	edi, DWORD PTR errno[rip]
	call	strerror@PLT
	lea	rsi, .LC1[rip]
	mov	edx, eax
.L23:
	lea	rdi, snmp_client[rip]
	xor	eax, eax
	call	seterr@PLT
	mov	rdi, rbp
	call	free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L26:
	mov	edi, DWORD PTR errno[rip]
	mov	r12d, -1
	call	strerror@PLT
	lea	rsi, .LC0[rip]
	lea	rdi, snmp_client[rip]
	mov	edx, eax
	xor	eax, eax
	call	seterr@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	xor	r12d, r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L33:
	mov	rdi, rbx
	mov	edx, 8
	lea	rsi, snmp_client[rip+8]
	call	memcpy@PLT
	lea	rdi, 8[rbx]
	mov	edx, 8
	lea	rsi, snmp_client[rip+24]
	call	memcpy@PLT
	mov	rdi, rbx
	call	snmp_pdu_init_secparams@PLT
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L35:
	mov	rdi, rbx
	call	snmp_pdu_dump@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L27:
	mov	esi, DWORD PTR F_SETFL[rip]
	or	edx, eax
	mov	r13d, edx
	call	fcntl@PLT
	mov	r12d, eax
	cmp	eax, -1
	je	.L24
	mov	edx, DWORD PTR snmp_client[rip+36]
	mov	edi, DWORD PTR snmp_client[rip+32]
	mov	rsi, rbp
	xor	ecx, ecx
	call	recv@PLT
	mov	edx, DWORD PTR O_NONBLOCK[rip]
	mov	esi, DWORD PTR F_SETFL[rip]
	mov	edi, DWORD PTR snmp_client[rip+32]
	mov	r14d, DWORD PTR errno[rip]
	mov	r12d, eax
	not	edx
	and	edx, r13d
	call	fcntl@PLT
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L24:
	mov	edi, DWORD PTR errno[rip]
	call	strerror@PLT
	lea	rsi, .LC3[rip]
	mov	edx, eax
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L29:
	mov	edi, DWORD PTR errno[rip]
	call	strerror@PLT
	lea	rsi, .LC2[rip]
	mov	edx, eax
	jmp	.L23
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	snmp_receive_packet, .-snmp_receive_packet
	.comm	snmp_client,40,32
	.comm	errno,4,4
	.comm	SO_RCVTIMEO,4,4
	.comm	SOL_SOCKET,4,4
	.comm	SNMP_SECMODEL_USM,8,8
	.comm	SNMP_CODE_OK,4,4
	.comm	O_NONBLOCK,4,4
	.comm	F_SETFL,4,4
	.comm	F_GETFL,4,4
	.comm	EWOULDBLOCK,4,4
	.comm	EPIPE,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_snmpclient.c_snmp_receive_packet.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s\000"
	.align	2
.LC1:
	.ascii	"setsockopt: %s\000"
	.align	2
.LC2:
	.ascii	"getsockopt: %s\000"
	.align	2
.LC3:
	.ascii	"fcntl: %s\000"
	.align	2
.LC4:
	.ascii	"recv: %s\000"
	.align	2
.LC5:
	.ascii	"recv: socket closed by peer\000"
	.align	2
.LC6:
	.ascii	"snmp_decode_pdu: failed %d\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	snmp_receive_packet, %function
snmp_receive_packet:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r7, .L42
	ldr	r3, .L42+4
	ldr	r4, [r7, #28]
	sub	sp, sp, #36
	mov	r8, r0
	mov	r5, r1
	mov	r0, #1
	mov	r1, r4
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	calloc
	subs	r6, r0, #0
	beq	.L32
	cmp	r5, #0
	ldr	r0, [r7, #24]
	beq	.L4
	ldr	r3, [r5]
	cmp	r3, #0
	bne	.L5
	ldr	r3, [r5, #4]
	cmp	r3, #0
	bne	.L5
.L6:
	ldr	r3, .L42+8
	mov	r2, #0
	ldr	r1, [r3]
	bl	fcntl
	cmn	r0, #1
	mov	r4, r0
	beq	.L30
	ldr	r10, .L42+12
	ldr	r0, [r7, #24]
	ldr	r2, [r10]
	ands	fp, r2, r4
	beq	.L33
	mov	r3, #0
	ldr	r2, [r7, #28]
.L29:
	mov	r1, r6
	bl	recv
	mov	r4, r0
	ldr	fp, .L42+16
	cmn	r4, #1
	ldr	r9, [fp]
	bne	.L13
.L37:
	mov	r0, r6
	bl	free
	ldr	r2, .L42+20
	ldr	r3, [fp]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L21
	ldr	r2, .L42+24
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L21
	mov	r0, r9
	bl	strerror
	ldr	r1, .L42+28
	mov	r2, r0
	ldr	r0, .L42
	bl	seterr
	b	.L1
.L5:
	mov	fp, #8
	ldr	r10, .L42+32
	ldr	r9, .L42+36
	str	fp, [sp]
	mov	r3, r5
	ldr	r2, [r10]
	ldr	r1, [r9]
	bl	setsockopt
	cmn	r0, #1
	mov	r4, r0
	beq	.L34
	add	r3, sp, #16
	str	r3, [sp]
	ldr	r2, [r10]
	mov	r3, r5
	ldr	r1, [r9]
	ldr	r0, [r7, #24]
	str	fp, [sp, #16]
	bl	getsockopt
	cmn	r0, #1
	mov	r4, r0
	beq	.L35
	ldr	r3, [r5]
	ldr	r0, [r7, #24]
	cmp	r3, #0
	beq	.L36
.L9:
	mov	r3, #0
	mov	r1, r6
	ldr	r2, [r7, #28]
	bl	recv
	mov	r3, #0
	mov	r4, r0
	mov	r0, #8
	ldr	fp, .L42+16
	ldr	r1, [r9]
	ldr	r2, [r10]
	ldr	r9, [fp]
	str	r3, [r5, #4]
	str	r3, [r5]
	str	r0, [sp]
	mov	r3, r5
	ldr	r0, [r7, #24]
	bl	setsockopt
.L18:
	cmn	r4, #1
	beq	.L37
.L13:
	cmp	r4, #0
	beq	.L38
	mov	r2, #16
	mov	r1, #0
	mov	r0, r8
	str	r6, [sp, #24]
	str	r4, [sp, #20]
	bl	memset
	ldr	r3, .L42+40
	ldr	r2, [r7]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L39
.L15:
	add	r2, sp, #12
	mov	r1, r8
	add	r0, sp, #20
	bl	snmp_pdu_decode
	ldr	r3, .L42+44
	mov	r2, r0
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L16
	ldr	r1, .L42+48
	ldr	r0, .L42
	bl	seterr
	mov	r0, r6
	bl	free
	mvn	r4, #0
.L1:
	ldr	r3, .L42+4
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L40
	mov	r0, r4
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L38:
	mov	r0, r6
	bl	free
	ldr	r1, .L42+52
	ldr	r0, .L42
	bl	seterr
	ldr	r3, .L42+56
	mvn	r4, #0
	ldr	r3, [r3]
	str	r3, [fp]
	b	.L1
.L36:
	ldr	r3, [r5, #4]
	cmp	r3, #0
	bne	.L9
	b	.L6
.L16:
	mov	r0, r6
	bl	free
	ldr	r3, [r7, #12]
	cmp	r3, #0
	bne	.L41
.L17:
	ldr	r2, [r8, #4]
	ldr	r3, [r8]
	mov	r4, #1
	str	r2, [r7, #8]
	str	r3, [r7, #4]
	b	.L1
.L34:
	ldr	r3, .L42+16
	ldr	r0, [r3]
	bl	strerror
	ldr	r1, .L42+60
	mov	r2, r0
	ldr	r0, .L42
	bl	seterr
	mov	r0, r6
	bl	free
	b	.L1
.L41:
	mov	r0, r8
	bl	snmp_pdu_dump
	b	.L17
.L4:
	mov	r3, r5
	mov	r2, r4
	b	.L29
.L21:
	mov	r4, #0
	b	.L1
.L39:
	mov	r2, #8
	mov	r0, r8
	ldr	r1, .L42+64
	bl	memcpy
	mov	r2, #8
	ldr	r1, .L42+68
	add	r0, r8, r2
	bl	memcpy
	mov	r0, r8
	bl	snmp_pdu_init_secparams
	b	.L15
.L35:
	ldr	r3, .L42+16
	ldr	r0, [r3]
	bl	strerror
	ldr	r1, .L42+72
	mov	r2, r0
	ldr	r0, .L42
	bl	seterr
	mov	r0, r6
	bl	free
	b	.L1
.L33:
	ldr	r9, .L42+76
	orr	r5, r2, r4
	mov	r2, r5
	ldr	r1, [r9]
	bl	fcntl
	cmn	r0, #1
	mov	r4, r0
	beq	.L30
	mov	r3, fp
	mov	r1, r6
	ldr	r2, [r7, #28]
	ldr	r0, [r7, #24]
	bl	recv
	ldr	r2, [r10]
	ldr	fp, .L42+16
	mov	r4, r0
	ldr	r1, [r9]
	ldr	r0, [r7, #24]
	bic	r2, r5, r2
	ldr	r9, [fp]
	bl	fcntl
	b	.L18
.L30:
	ldr	r3, .L42+16
	ldr	r0, [r3]
	bl	strerror
	ldr	r1, .L42+80
	mov	r2, r0
	ldr	r0, .L42
	bl	seterr
	mov	r0, r6
	bl	free
	b	.L1
.L32:
	ldr	r3, .L42+16
	mvn	r4, #0
	ldr	r0, [r3]
	bl	strerror
	ldr	r1, .L42+84
	mov	r2, r0
	mov	r0, r7
	bl	seterr
	b	.L1
.L40:
	bl	__stack_chk_fail
.L43:
	.align	2
.L42:
	.word	snmp_client
	.word	.LC7
	.word	F_GETFL
	.word	O_NONBLOCK
	.word	errno
	.word	EAGAIN
	.word	EWOULDBLOCK
	.word	.LC4
	.word	SO_RCVTIMEO
	.word	SOL_SOCKET
	.word	SNMP_SECMODEL_USM
	.word	SNMP_CODE_OK
	.word	.LC6
	.word	.LC5
	.word	EPIPE
	.word	.LC1
	.word	snmp_client+4
	.word	snmp_client+16
	.word	.LC2
	.word	F_SETFL
	.word	.LC3
	.word	.LC0
	.size	snmp_receive_packet, .-snmp_receive_packet
	.comm	snmp_client,32,4
	.comm	errno,4,4
	.comm	SO_RCVTIMEO,4,4
	.comm	SOL_SOCKET,4,4
	.comm	SNMP_SECMODEL_USM,4,4
	.comm	SNMP_CODE_OK,4,4
	.comm	O_NONBLOCK,4,4
	.comm	F_SETFL,4,4
	.comm	F_GETFL,4,4
	.comm	EWOULDBLOCK,4,4
	.comm	EPIPE,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
