	.file	"825052.c"
	.intel_syntax noprefix
	.text
	.globl	checksum
	.type	checksum, @function
checksum:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	DWORD PTR -12[rbp], 0
	jmp	.L2
.L3:
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 2[rax]
	mov	QWORD PTR -8[rbp], rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	add	DWORD PTR -12[rbp], eax
	sub	DWORD PTR -28[rbp], 2
.L2:
	cmp	DWORD PTR -28[rbp], 1
	ja	.L3
	cmp	DWORD PTR -28[rbp], 1
	jne	.L4
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	add	DWORD PTR -12[rbp], eax
.L4:
	mov	eax, DWORD PTR -12[rbp]
	shr	eax, 16
	mov	edx, eax
	mov	eax, DWORD PTR -12[rbp]
	movzx	eax, ax
	add	eax, edx
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	shr	eax, 16
	add	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	not	eax
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	checksum, .-checksum
	.section	.rodata
	.align 8
.LC0:
	.string	"IP packet:\n  version  : %d\n  IHL      : %d\n  ToS      : %d\n  Len      : %d\n  id       : %d\n  offset   : %d\n  TTL      : %d\n  protocol : %d\n  checksum : %d\n  source   : %s\n  dest     : %s\n"
	.text
	.globl	display_ip_hdr
	.type	display_ip_hdr, @function
display_ip_hdr:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 72
	.cfi_offset 3, -24
	mov	QWORD PTR -72[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -50[rbp], 0
	mov	DWORD PTR -42[rbp], 0
	mov	BYTE PTR -38[rbp], 0
	mov	QWORD PTR -37[rbp], 0
	mov	DWORD PTR -29[rbp], 0
	mov	BYTE PTR -25[rbp], 0
	mov	rax, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR 12[rax]
	mov	edi, eax
	call	inet_ntoa@PLT
	mov	rdx, rax
	lea	rax, -50[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	edi, eax
	call	inet_ntoa@PLT
	mov	rdx, rax
	lea	rax, -37[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, WORD PTR 10[rax]
	movzx	r9d, ax
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, BYTE PTR 9[rax]
	movzx	r8d, al
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, BYTE PTR 8[rax]
	movzx	edi, al
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	esi, ax
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, WORD PTR 4[rax]
	movzx	ebx, ax
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, WORD PTR 2[rax]
	movzx	r11d, ax
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, BYTE PTR 1[rax]
	movzx	ecx, al
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, BYTE PTR [rax]
	and	eax, 15
	movzx	edx, al
	mov	rax, QWORD PTR -72[rbp]
	movzx	eax, BYTE PTR [rax]
	shr	al, 4
	movzx	eax, al
	lea	r10, -37[rbp]
	push	r10
	lea	r10, -50[rbp]
	push	r10
	push	r9
	push	r8
	push	rdi
	push	rsi
	mov	r9d, ebx
	mov	r8d, r11d
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	add	rsp, 48
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	display_ip_hdr, .-display_ip_hdr
	.section	.rodata
	.align 8
.LC1:
	.string	"ICMP datagram:\n  type     : %d\n  code     : %d\n  checksum : %d\n  echo id  : %d\n  echo seq : %d\n\n"
	.text
	.globl	display_icmp_hdr
	.type	display_icmp_hdr, @function
display_icmp_hdr:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	edi, ax
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, WORD PTR 4[rax]
	movzx	esi, ax
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, WORD PTR 2[rax]
	movzx	ecx, ax
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR 1[rax]
	movzx	edx, al
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	r9d, edi
	mov	r8d, esi
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	display_icmp_hdr, .-display_icmp_hdr
	.section	.rodata
.LC2:
	.string	"(sender) socket"
.LC3:
	.string	"(sender) sendto"
.LC4:
	.string	"> Sent an echo request!"
	.text
	.globl	send_echo_requests
	.type	send_echo_requests, @function
send_echo_requests:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -16[rbp], 8
	mov	BYTE PTR -15[rbp], 0
	call	getppid@PLT
	mov	WORD PTR -12[rbp], ax
	mov	edx, 1
	mov	esi, 3
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jns	.L10
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	DWORD PTR -24[rbp], 0
	jmp	.L11
.L14:
	mov	eax, DWORD PTR -24[rbp]
	mov	WORD PTR -10[rbp], ax
	mov	WORD PTR -14[rbp], 0
	lea	rax, -16[rbp]
	mov	esi, 8
	mov	rdi, rax
	call	checksum
	mov	WORD PTR -14[rbp], ax
	mov	rdx, QWORD PTR -40[rbp]
	lea	rsi, -16[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	r9d, 16
	mov	r8, rdx
	mov	ecx, 0
	mov	edx, 8
	mov	edi, eax
	call	sendto@PLT
	test	rax, rax
	jg	.L12
	lea	rdi, .LC3[rip]
	call	perror@PLT
	jmp	.L13
.L12:
	lea	rdi, .LC4[rip]
	call	puts@PLT
.L13:
	mov	edi, 2
	call	sleep@PLT
	add	DWORD PTR -24[rbp], 1
.L11:
	cmp	DWORD PTR -24[rbp], 7
	jle	.L14
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	send_echo_requests, .-send_echo_requests
	.section	.rodata
.LC5:
	.string	"(listener) socket"
.LC6:
	.string	"(listener) recv"
.LC7:
	.string	"> Got an echo reply :"
.LC8:
	.string	"> Got something else\342\200\246"
	.text
	.globl	listen_echo_replies
	.type	listen_echo_replies, @function
listen_echo_replies:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 1080
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	edx, 1
	mov	esi, 3
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -1076[rbp], eax
	cmp	DWORD PTR -1076[rbp], 0
	jns	.L17
	lea	rdi, .LC5[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L17:
	lea	rax, -1056[rbp]
	mov	rsi, rax
	mov	eax, 0
	mov	edx, 128
	mov	rdi, rsi
	mov	rcx, rdx
	rep stosq
	lea	rsi, -1056[rbp]
	mov	eax, DWORD PTR -1076[rbp]
	mov	ecx, 0
	mov	edx, 1024
	mov	edi, eax
	call	recv@PLT
	test	rax, rax
	jg	.L18
	lea	rdi, .LC6[rip]
	call	perror@PLT
	jmp	.L17
.L18:
	lea	rax, -1056[rbp]
	mov	QWORD PTR -1072[rbp], rax
	mov	rax, QWORD PTR -1072[rbp]
	movzx	eax, BYTE PTR [rax]
	and	eax, 15
	movzx	eax, al
	sal	eax, 2
	cdqe
	lea	rdx, -1056[rbp]
	add	rax, rdx
	mov	QWORD PTR -1064[rbp], rax
	mov	rax, QWORD PTR -1064[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L20
	mov	rax, QWORD PTR -1064[rbp]
	movzx	eax, WORD PTR 4[rax]
	movzx	ebx, ax
	call	getpid@PLT
	cmp	ebx, eax
	jne	.L20
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -1072[rbp]
	mov	rdi, rax
	call	display_ip_hdr
	mov	rax, QWORD PTR -1064[rbp]
	mov	rdi, rax
	call	display_icmp_hdr
	mov	rax, QWORD PTR -1064[rbp]
	movzx	eax, WORD PTR 6[rax]
	cmp	ax, 7
	jne	.L19
	jmp	.L24
.L20:
	lea	rdi, .LC8[rip]
	call	puts@PLT
.L19:
	jmp	.L17
.L24:
	nop
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	listen_echo_replies, .-listen_echo_replies
	.section	.rodata
.LC9:
	.string	"Usage: %s <host>\n"
.LC10:
	.string	"gethostbyname"
.LC11:
	.string	"fork"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	DWORD PTR -52[rbp], edi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -52[rbp], 1
	jg	.L26
	mov	rax, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 1
	call	exit@PLT
.L26:
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L27
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L27:
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 16[rax]
	mov	WORD PTR -32[rbp], ax
	mov	WORD PTR -30[rbp], 0
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -28[rbp], eax
	call	fork@PLT
	mov	DWORD PTR -44[rbp], eax
	cmp	DWORD PTR -44[rbp], 0
	jns	.L28
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L28:
	cmp	DWORD PTR -44[rbp], 0
	jne	.L29
	lea	rax, -32[rbp]
	mov	rdi, rax
	call	send_echo_requests
	jmp	.L30
.L29:
	mov	eax, 0
	call	listen_echo_replies
.L30:
	mov	eax, 0
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"825052.c"
	.text
	.align	2
	.global	checksum
	.syntax unified
	.arm
	.fpu softvfp
	.type	checksum, %function
checksum:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L3:
	ldr	r3, [fp, #-12]
	add	r2, r3, #2
	str	r2, [fp, #-12]
	ldrh	r3, [r3]
	mov	r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-20]
	sub	r3, r3, #2
	str	r3, [fp, #-20]
.L2:
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	bhi	.L3
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	bne	.L4
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
.L4:
	ldr	r3, [fp, #-8]
	lsr	r2, r3, #16
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	lsr	r3, r3, #16
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mvn	r3, r3
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	checksum, .-checksum
	.section	.rodata
	.align	2
.LC0:
	.ascii	"IP packet:\012  version  : %d\012  IHL      : %d\012"
	.ascii	"  ToS      : %d\012  Len      : %d\012  id       : "
	.ascii	"%d\012  offset   : %d\012  TTL      : %d\012  proto"
	.ascii	"col : %d\012  checksum : %d\012  source   : %s\012 "
	.ascii	" dest     : %s\012\000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	display_ip_hdr
	.syntax unified
	.arm
	.fpu softvfp
	.type	display_ip_hdr, %function
display_ip_hdr:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, fp, lr}
	add	fp, sp, #20
	sub	sp, sp, #80
	str	r0, [fp, #-64]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-56]
	sub	r3, fp, #52
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	strb	r2, [r3, #8]
	mov	r3, #0
	str	r3, [fp, #-40]
	sub	r3, fp, #36
	mov	r2, #0
	str	r2, [r3]
	str	r2, [r3, #4]
	strb	r2, [r3, #8]
	ldr	r3, [fp, #-64]
	ldr	r3, [r3, #12]
	mov	r0, r3
	bl	inet_ntoa
	mov	r2, r0
	sub	r3, fp, #56
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	ldr	r3, [fp, #-64]
	ldr	r3, [r3, #16]
	mov	r0, r3
	bl	inet_ntoa
	mov	r2, r0
	sub	r3, fp, #40
	mov	r1, r2
	mov	r0, r3
	bl	strcpy
	ldr	r3, [fp, #-64]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsr	r3, r3, #4
	and	r3, r3, #255
	mov	r5, r3
	ldr	r3, [fp, #-64]
	ldrb	r3, [r3]
	and	r3, r3, #15
	and	r3, r3, #255
	mov	r6, r3
	ldr	r3, [fp, #-64]
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	mov	r7, r3
	ldr	r3, [fp, #-64]
	ldrh	r3, [r3, #2]
	mov	r2, r3
	ldr	r3, [fp, #-64]
	ldrh	r3, [r3, #4]
	mov	r1, r3
	ldr	r3, [fp, #-64]
	ldrh	r3, [r3, #6]
	mov	r0, r3
	ldr	r3, [fp, #-64]
	ldrb	r3, [r3, #8]	@ zero_extendqisi2
	mov	ip, r3
	ldr	r3, [fp, #-64]
	ldrb	r3, [r3, #9]	@ zero_extendqisi2
	mov	lr, r3
	ldr	r3, [fp, #-64]
	ldrh	r3, [r3, #10]
	mov	r4, r3
	sub	r3, fp, #40
	str	r3, [sp, #28]
	sub	r3, fp, #56
	str	r3, [sp, #24]
	str	r4, [sp, #20]
	str	lr, [sp, #16]
	str	ip, [sp, #12]
	str	r0, [sp, #8]
	str	r1, [sp, #4]
	str	r2, [sp]
	mov	r3, r7
	mov	r2, r6
	mov	r1, r5
	ldr	r0, .L8+4
	bl	printf
	nop
	ldr	r3, .L8
	ldr	r2, [r3]
	ldr	r3, [fp, #-24]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	sub	sp, fp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC1
	.word	.LC0
	.size	display_ip_hdr, .-display_ip_hdr
	.section	.rodata
	.align	2
.LC2:
	.ascii	"ICMP datagram:\012  type     : %d\012  code     : %"
	.ascii	"d\012  checksum : %d\012  echo id  : %d\012  echo s"
	.ascii	"eq : %d\012\012\000"
	.text
	.align	2
	.global	display_icmp_hdr
	.syntax unified
	.arm
	.fpu softvfp
	.type	display_icmp_hdr, %function
display_icmp_hdr:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r1, r3
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3, #1]	@ zero_extendqisi2
	mov	r0, r3
	ldr	r3, [fp, #-8]
	ldrh	r3, [r3, #2]
	mov	ip, r3
	ldr	r3, [fp, #-8]
	ldrh	r3, [r3, #4]
	mov	r2, r3
	ldr	r3, [fp, #-8]
	ldrh	r3, [r3, #6]
	str	r3, [sp, #4]
	str	r2, [sp]
	mov	r3, ip
	mov	r2, r0
	ldr	r0, .L11
	bl	printf
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC2
	.size	display_icmp_hdr, .-display_icmp_hdr
	.section	.rodata
	.align	2
.LC3:
	.ascii	"(sender) socket\000"
	.align	2
.LC4:
	.ascii	"(sender) sendto\000"
	.align	2
.LC5:
	.ascii	"> Sent an echo request!\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	send_echo_requests
	.syntax unified
	.arm
	.fpu softvfp
	.type	send_echo_requests, %function
send_echo_requests:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #8
	strb	r3, [fp, #-16]
	mov	r3, #0
	strb	r3, [fp, #-15]
	bl	getppid
	mov	r3, r0
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	strh	r3, [fp, #-12]	@ movhi
	mov	r2, #1
	mov	r1, #3
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bge	.L14
	ldr	r0, .L20+4
	bl	perror
	mov	r0, #1
	bl	exit
.L14:
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L15
.L18:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	strh	r3, [fp, #-10]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-14]	@ movhi
	sub	r3, fp, #16
	mov	r1, #8
	mov	r0, r3
	bl	checksum
	mov	r3, r0
	strh	r3, [fp, #-14]	@ movhi
	sub	r1, fp, #16
	mov	r3, #16
	str	r3, [sp, #4]
	ldr	r3, [fp, #-32]
	str	r3, [sp]
	mov	r3, #0
	mov	r2, #8
	ldr	r0, [fp, #-20]
	bl	sendto
	mov	r3, r0
	cmp	r3, #0
	bgt	.L16
	ldr	r0, .L20+8
	bl	perror
	b	.L17
.L16:
	ldr	r0, .L20+12
	bl	puts
.L17:
	mov	r0, #2
	bl	sleep
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L15:
	ldr	r3, [fp, #-24]
	cmp	r3, #7
	ble	.L18
	nop
	ldr	r3, .L20
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC6
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	send_echo_requests, .-send_echo_requests
	.section	.rodata
	.align	2
.LC7:
	.ascii	"(listener) socket\000"
	.align	2
.LC8:
	.ascii	"(listener) recv\000"
	.align	2
.LC9:
	.ascii	"> Got an echo reply :\000"
	.align	2
.LC10:
	.ascii	"> Got something else\342\200\246\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	listen_echo_replies
	.syntax unified
	.arm
	.fpu softvfp
	.type	listen_echo_replies, %function
listen_echo_replies:
	@ args = 0, pretend = 0, frame = 1040
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #1040
	sub	sp, sp, #4
	ldr	r3, .L31
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r2, #1
	mov	r1, #3
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-1052]
	ldr	r3, [fp, #-1052]
	cmp	r3, #0
	bge	.L23
	ldr	r0, .L31+4
	bl	perror
	mov	r0, #1
	bl	exit
.L23:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r0, r3
	mov	r3, #1024
	mov	r2, r3
	mov	r1, #0
	bl	memset
	sub	r1, fp, #1024
	sub	r1, r1, #12
	sub	r1, r1, #4
	mov	r3, #0
	mov	r2, #1024
	ldr	r0, [fp, #-1052]
	bl	recv
	mov	r3, r0
	cmp	r3, #0
	bgt	.L24
	ldr	r0, .L31+8
	bl	perror
	b	.L23
.L24:
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	str	r3, [fp, #-1048]
	ldr	r3, [fp, #-1048]
	ldrb	r3, [r3]
	and	r3, r3, #15
	and	r3, r3, #255
	lsl	r3, r3, #2
	mov	r2, r3
	sub	r3, fp, #1024
	sub	r3, r3, #12
	sub	r3, r3, #4
	add	r3, r3, r2
	str	r3, [fp, #-1044]
	ldr	r3, [fp, #-1044]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L26
	ldr	r3, [fp, #-1044]
	ldrh	r3, [r3, #4]
	mov	r4, r3
	bl	getpid
	mov	r3, r0
	cmp	r4, r3
	bne	.L26
	ldr	r0, .L31+12
	bl	puts
	ldr	r0, [fp, #-1048]
	bl	display_ip_hdr
	ldr	r0, [fp, #-1044]
	bl	display_icmp_hdr
	ldr	r3, [fp, #-1044]
	ldrh	r3, [r3, #6]
	cmp	r3, #7
	bne	.L25
	b	.L30
.L26:
	ldr	r0, .L31+16
	bl	puts
.L25:
	b	.L23
.L30:
	nop
	ldr	r3, .L31
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L29
	bl	__stack_chk_fail
.L29:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC11
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	listen_echo_replies, .-listen_echo_replies
	.section	.rodata
	.align	2
.LC12:
	.ascii	"Usage: %s <host>\012\000"
	.align	2
.LC13:
	.ascii	"gethostbyname\000"
	.align	2
.LC14:
	.ascii	"fork\000"
	.align	2
.LC15:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, .L41
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-40]
	cmp	r3, #1
	bgt	.L34
	ldr	r3, [fp, #-44]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L41+4
	bl	printf
	mov	r0, #1
	bl	exit
.L34:
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	gethostbyname
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L35
	ldr	r0, .L41+8
	bl	perror
	mov	r0, #1
	bl	exit
.L35:
	ldr	r3, [fp, #-32]
	ldr	r3, [r3, #8]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	strh	r3, [fp, #-24]	@ movhi
	mov	r3, #0
	strh	r3, [fp, #-22]	@ movhi
	ldr	r3, [fp, #-32]
	ldr	r3, [r3, #16]
	ldr	r3, [r3]
	ldr	r3, [r3]
	str	r3, [fp, #-20]
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bge	.L36
	ldr	r0, .L41+12
	bl	perror
	mov	r0, #1
	bl	exit
.L36:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L37
	sub	r3, fp, #24
	mov	r0, r3
	bl	send_echo_requests
	b	.L38
.L37:
	bl	listen_echo_replies
.L38:
	mov	r3, #0
	ldr	r2, .L41
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L40
	bl	__stack_chk_fail
.L40:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L42:
	.align	2
.L41:
	.word	.LC15
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
