	.file	"877508.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"socket"
.LC1:
	.string	"My hostname is: %s\n"
.LC2:
	.string	"h_name: %s\n"
.LC3:
	.string	"bind"
.LC4:
	.string	"listen"
.LC5:
	.string	"Wow! got a call!"
.LC6:
	.string	"accept"
.LC7:
	.string	"w"
.LC8:
	.string	"fdopen"
.LC9:
	.string	"The time here is .."
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 368
	mov	DWORD PTR -356[rbp], edi
	mov	QWORD PTR -368[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -336[rbp], eax
	cmp	DWORD PTR -336[rbp], -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	lea	rax, -304[rbp]
	mov	QWORD PTR [rax], 0
	mov	QWORD PTR 8[rax], 0
	lea	rax, -272[rbp]
	mov	esi, 256
	mov	rdi, rax
	call	gethostname@PLT
	lea	rax, -272[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -272[rbp]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -320[rbp], rax
	mov	rax, QWORD PTR -320[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -320[rbp]
	mov	rdi, rax
	call	print_ip
	mov	edi, 13000
	call	htons@PLT
	mov	WORD PTR -302[rbp], ax
	mov	WORD PTR -304[rbp], 2
	lea	rcx, -304[rbp]
	mov	eax, DWORD PTR -336[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	je	.L3
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L3:
	mov	eax, DWORD PTR -336[rbp]
	mov	esi, 1
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	je	.L4
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L4:
	lea	rdx, -340[rbp]
	lea	rcx, -288[rbp]
	mov	eax, DWORD PTR -336[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	accept@PLT
	mov	DWORD PTR -332[rbp], eax
	lea	rax, -288[rbp]
	mov	rdi, rax
	call	print_ip
	lea	rdi, .LC5[rip]
	call	puts@PLT
	cmp	DWORD PTR -332[rbp], -1
	jne	.L5
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L5:
	mov	eax, DWORD PTR -332[rbp]
	lea	rsi, .LC7[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -312[rbp], rax
	cmp	QWORD PTR -312[rbp], 0
	jne	.L6
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L6:
	mov	edi, 0
	call	time@PLT
	mov	QWORD PTR -328[rbp], rax
	mov	rax, QWORD PTR -312[rbp]
	mov	rcx, rax
	mov	edx, 19
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	lea	rax, -328[rbp]
	mov	rdi, rax
	call	ctime@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -312[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	fputs@PLT
	mov	rax, QWORD PTR -312[rbp]
	mov	rdi, rax
	call	fclose@PLT
	jmp	.L4
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
.LC10:
	.string	"UNKNOWN sa_family"
.LC11:
	.string	"IP address: %s\n"
	.text
	.globl	print_ip
	.type	print_ip, @function
print_ip:
.LFB7:
	.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	QWORD PTR -24[rbp], 0
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	cmp	eax, 2
	je	.L9
	cmp	eax, 10
	je	.L10
	jmp	.L13
.L9:
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	mov	edi, 16
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, 4[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	ecx, 16
	mov	rdx, rax
	mov	edi, 2
	mov	eax, 0
	call	inet_ntop@PLT
	jmp	.L12
.L10:
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	edi, 46
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, 8[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	ecx, 46
	mov	rdx, rax
	mov	edi, 10
	mov	eax, 0
	call	inet_ntop@PLT
	jmp	.L12
.L13:
	lea	rdi, .LC10[rip]
	call	puts@PLT
	nop
.L12:
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	print_ip, .-print_ip
	.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	"877508.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"socket\000"
	.align	2
.LC1:
	.ascii	"My hostname is: %s\012\000"
	.align	2
.LC2:
	.ascii	"h_name: %s\012\000"
	.align	2
.LC3:
	.ascii	"bind\000"
	.align	2
.LC4:
	.ascii	"listen\000"
	.align	2
.LC5:
	.ascii	"Wow! got a call!\000"
	.align	2
.LC6:
	.ascii	"accept\000"
	.align	2
.LC7:
	.ascii	"w\000"
	.align	2
.LC8:
	.ascii	"fdopen\000"
	.align	2
.LC9:
	.ascii	"The time here is ..\000"
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 328
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #328
	str	r0, [fp, #-328]
	str	r1, [fp, #-332]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-312]
	ldr	r3, [fp, #-312]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L8+4
	bl	perror
	mov	r0, #1
	bl	exit
.L2:
	sub	r3, fp, #296
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2]
	str	r3, [r2, #4]
	str	r3, [r2, #8]
	str	r3, [r2, #12]
	sub	r3, fp, #264
	mov	r1, #256
	mov	r0, r3
	bl	gethostname
	sub	r3, fp, #264
	mov	r1, r3
	ldr	r0, .L8+8
	bl	printf
	sub	r3, fp, #264
	mov	r0, r3
	bl	gethostbyname
	str	r0, [fp, #-308]
	ldr	r3, [fp, #-308]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L8+12
	bl	printf
	ldr	r0, [fp, #-308]
	bl	print_ip
	ldr	r0, .L8+16
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4
	sub	r3, r3, #292
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #4
	sub	r3, r3, #292
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	sub	r3, fp, #296
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-312]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	beq	.L3
	ldr	r0, .L8+20
	bl	perror
	mov	r0, #1
	bl	exit
.L3:
	mov	r1, #1
	ldr	r0, [fp, #-312]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	beq	.L4
	ldr	r0, .L8+24
	bl	perror
	mov	r0, #1
	bl	exit
.L4:
	sub	r2, fp, #316
	sub	r3, fp, #280
	mov	r1, r3
	ldr	r0, [fp, #-312]
	bl	accept
	str	r0, [fp, #-304]
	sub	r3, fp, #280
	mov	r0, r3
	bl	print_ip
	ldr	r0, .L8+28
	bl	puts
	ldr	r3, [fp, #-304]
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L8+32
	bl	perror
	mov	r0, #1
	bl	exit
.L5:
	ldr	r1, .L8+36
	ldr	r0, [fp, #-304]
	bl	fdopen
	str	r0, [fp, #-300]
	ldr	r3, [fp, #-300]
	cmp	r3, #0
	bne	.L6
	ldr	r0, .L8+40
	bl	perror
	mov	r0, #1
	bl	exit
.L6:
	mov	r0, #0
	bl	time
	mov	r3, r0
	str	r3, [fp, #-320]
	ldr	r3, [fp, #-300]
	mov	r2, #19
	mov	r1, #1
	ldr	r0, .L8+44
	bl	fwrite
	sub	r3, fp, #320
	mov	r0, r3
	bl	ctime
	mov	r3, r0
	ldr	r1, [fp, #-300]
	mov	r0, r3
	bl	fputs
	ldr	r0, [fp, #-300]
	bl	fclose
	b	.L4
.L9:
	.align	2
.L8:
	.word	.LC10
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	13000
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.section	.rodata
	.align	2
.LC11:
	.ascii	"UNKNOWN sa_family\000"
	.align	2
.LC12:
	.ascii	"IP address: %s\012\000"
	.text
	.align	2
	.global	print_ip
	.syntax unified
	.arm
	.fpu softvfp
	.type	print_ip, %function
print_ip:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	ldrh	r3, [r3]
	cmp	r3, #2
	beq	.L11
	cmp	r3, #10
	beq	.L12
	b	.L15
.L11:
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-8]
	mov	r0, #16
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-8]
	add	r1, r3, #4
	mov	r3, #16
	ldr	r2, [fp, #-16]
	mov	r0, #2
	bl	inet_ntop
	b	.L14
.L12:
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-12]
	mov	r0, #46
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-12]
	add	r1, r3, #8
	mov	r3, #46
	ldr	r2, [fp, #-16]
	mov	r0, #10
	bl	inet_ntop
	b	.L14
.L15:
	ldr	r0, .L16
	bl	puts
	nop
.L14:
	ldr	r1, [fp, #-16]
	ldr	r0, .L16+4
	bl	printf
	ldr	r0, [fp, #-16]
	bl	free
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC11
	.word	.LC12
	.size	print_ip, .-print_ip
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
