	.file	"667509.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"socket"
.LC1:
	.string	"gethostbyname"
.LC2:
	.string	"bind"
.LC3:
	.string	"listen"
	.align 8
.LC4:
	.string	"[webserv]: server started, listening on: %s:%d\n"
	.text
	.globl	make_server_socket
	.type	make_server_socket, @function
make_server_socket:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	add	rsp, -128
	mov	eax, edi
	mov	DWORD PTR -120[rbp], esi
	mov	WORD PTR -116[rbp], ax
	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 -108[rbp], eax
	cmp	DWORD PTR -108[rbp], -1
	jne	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L8
.L2:
	lea	rax, -96[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	movzx	eax, WORD PTR -116[rbp]
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -94[rbp], ax
	mov	WORD PTR -96[rbp], 2
	mov	edi, 2130706433
	call	htonl@PLT
	mov	DWORD PTR -92[rbp], eax
	lea	rax, -80[rbp]
	mov	edx, 64
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, -80[rbp]
	mov	esi, 64
	mov	rdi, rax
	call	gethostname@PLT
	lea	rax, -80[rbp]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -104[rbp], rax
	cmp	QWORD PTR -104[rbp], 0
	je	.L4
	mov	rax, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR 16[rax]
	cmp	eax, 2
	je	.L5
.L4:
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L8
.L5:
	mov	rax, QWORD PTR -104[rbp]
	mov	eax, DWORD PTR 20[rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -104[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	lea	rcx, -96[rbp]
	add	rcx, 4
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	lea	rcx, -96[rbp]
	mov	eax, DWORD PTR -108[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	bind@PLT
	test	eax, eax
	je	.L6
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L8
.L6:
	mov	edx, DWORD PTR -120[rbp]
	mov	eax, DWORD PTR -108[rbp]
	mov	esi, edx
	mov	edi, eax
	call	listen@PLT
	test	eax, eax
	je	.L7
	lea	rdi, .LC3[rip]
	call	perror@PLT
	mov	eax, -1
	jmp	.L8
.L7:
	movzx	edx, WORD PTR -116[rbp]
	lea	rax, -80[rbp]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -108[rbp]
.L8:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	make_server_socket, .-make_server_socket
	.globl	connect_to_server
	.type	connect_to_server, @function
connect_to_server:
.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, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	eax, esi
	mov	WORD PTR -60[rbp], ax
	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 -44[rbp], eax
	cmp	DWORD PTR -44[rbp], -1
	jne	.L11
	mov	eax, -1
	jmp	.L16
.L11:
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -40[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	je	.L13
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 16[rax]
	cmp	eax, 2
	je	.L14
.L13:
	mov	eax, -1
	jmp	.L16
.L14:
	lea	rax, -32[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 20[rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	lea	rcx, -32[rbp]
	add	rcx, 4
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	mov	WORD PTR -32[rbp], 2
	movzx	eax, WORD PTR -60[rbp]
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -30[rbp], ax
	lea	rcx, -32[rbp]
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	test	eax, eax
	je	.L15
	mov	eax, -1
	jmp	.L16
.L15:
	mov	eax, DWORD PTR -44[rbp]
.L16:
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	connect_to_server, .-connect_to_server
	.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	"667509.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"socket\000"
	.align	2
.LC1:
	.ascii	"gethostbyname\000"
	.align	2
.LC2:
	.ascii	"bind\000"
	.align	2
.LC3:
	.ascii	"listen\000"
	.align	2
.LC4:
	.ascii	"[webserv]: server started, listening on: %s:%d\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	make_server_socket
	.syntax unified
	.arm
	.fpu softvfp
	.type	make_server_socket, %function
make_server_socket:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #104
	mov	r3, r0
	str	r1, [fp, #-108]
	strh	r3, [fp, #-102]	@ movhi
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-96]
	ldr	r3, [fp, #-96]
	cmn	r3, #1
	bne	.L2
	ldr	r0, .L10+4
	bl	perror
	mvn	r3, #0
	b	.L8
.L2:
	sub	r3, fp, #88
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldrh	r3, [fp, #-102]
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-86]	@ movhi
	mov	r3, #2
	strh	r3, [fp, #-88]	@ movhi
	ldr	r0, .L10+8
	bl	htonl
	mov	r3, r0
	str	r3, [fp, #-84]
	sub	r3, fp, #72
	mov	r2, #64
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #72
	mov	r1, #64
	mov	r0, r3
	bl	gethostname
	sub	r3, fp, #72
	mov	r0, r3
	bl	gethostbyname
	str	r0, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #8]
	cmp	r3, #2
	beq	.L5
.L4:
	ldr	r0, .L10+12
	bl	perror
	mvn	r3, #0
	b	.L8
.L5:
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #16]
	ldr	r1, [r3]
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #12]
	mov	r2, r3
	sub	r3, fp, #88
	add	r3, r3, #4
	mov	r0, r3
	bl	memcpy
	sub	r3, fp, #88
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-96]
	bl	bind
	mov	r3, r0
	cmp	r3, #0
	beq	.L6
	ldr	r0, .L10+16
	bl	perror
	mvn	r3, #0
	b	.L8
.L6:
	ldr	r1, [fp, #-108]
	ldr	r0, [fp, #-96]
	bl	listen
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	ldr	r0, .L10+20
	bl	perror
	mvn	r3, #0
	b	.L8
.L7:
	ldrh	r2, [fp, #-102]
	sub	r3, fp, #72
	mov	r1, r3
	ldr	r0, .L10+24
	bl	printf
	ldr	r3, [fp, #-96]
.L8:
	ldr	r2, .L10
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC5
	.word	.LC0
	.word	2130706433
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	make_server_socket, .-make_server_socket
	.section	.rodata
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	connect_to_server
	.syntax unified
	.arm
	.fpu softvfp
	.type	connect_to_server, %function
connect_to_server:
	@ 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]
	mov	r3, r1
	strh	r3, [fp, #-42]	@ movhi
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmn	r3, #1
	bne	.L13
	mvn	r3, #0
	b	.L18
.L13:
	ldr	r0, [fp, #-40]
	bl	gethostbyname
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L15
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #8]
	cmp	r3, #2
	beq	.L16
.L15:
	mvn	r3, #0
	b	.L18
.L16:
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #16]
	ldr	r1, [r3]
	ldr	r3, [fp, #-28]
	ldr	r3, [r3, #12]
	mov	r2, r3
	sub	r3, fp, #24
	add	r3, r3, #4
	mov	r0, r3
	bl	memcpy
	mov	r3, #2
	strh	r3, [fp, #-24]	@ movhi
	ldrh	r3, [fp, #-42]
	mov	r0, r3
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-22]	@ movhi
	sub	r3, fp, #24
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-32]
	bl	connect
	mov	r3, r0
	cmp	r3, #0
	beq	.L17
	mvn	r3, #0
	b	.L18
.L17:
	ldr	r3, [fp, #-32]
.L18:
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC6
	.size	connect_to_server, .-connect_to_server
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
