	.file	"1053926.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"getaddrinfo: %s\n"
	.align 8
.LC1:
	.string	"Could not connect to address %s on port %s."
	.text
	.globl	socket_create
	.type	socket_create, @function
socket_create:
.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, 112
	mov	QWORD PTR -104[rbp], rdi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -88[rbp], -1
	mov	QWORD PTR -64[rbp], 0
	mov	QWORD PTR -56[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	QWORD PTR -32[rbp], 0
	mov	QWORD PTR -24[rbp], 0
	mov	QWORD PTR -80[rbp], 0
	mov	DWORD PTR -60[rbp], 0
	mov	DWORD PTR -56[rbp], 2
	mov	DWORD PTR -64[rbp], 1
	mov	DWORD PTR -64[rbp], 0
	mov	DWORD PTR -52[rbp], 0
	lea	rcx, -80[rbp]
	lea	rdx, -64[rbp]
	mov	rsi, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR -104[rbp]
	mov	rdi, rax
	call	getaddrinfo@PLT
	mov	DWORD PTR -84[rbp], eax
	cmp	DWORD PTR -84[rbp], 0
	je	.L2
	mov	eax, DWORD PTR -84[rbp]
	mov	edi, eax
	call	gai_strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	QWORD PTR -72[rbp], 0
	mov	rax, QWORD PTR -80[rbp]
	mov	QWORD PTR -72[rbp], rax
	jmp	.L3
.L8:
	mov	rax, QWORD PTR -72[rbp]
	mov	edx, DWORD PTR 12[rax]
	mov	rax, QWORD PTR -72[rbp]
	mov	ecx, DWORD PTR 8[rax]
	mov	rax, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	esi, ecx
	mov	edi, eax
	call	socket@PLT
	mov	DWORD PTR -88[rbp], eax
	cmp	DWORD PTR -88[rbp], -1
	je	.L12
	mov	rax, QWORD PTR -72[rbp]
	mov	edx, DWORD PTR 16[rax]
	mov	rax, QWORD PTR -72[rbp]
	mov	rcx, QWORD PTR 24[rax]
	mov	eax, DWORD PTR -88[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	test	eax, eax
	je	.L13
	mov	eax, DWORD PTR -88[rbp]
	mov	edi, eax
	call	close@PLT
	jmp	.L5
.L12:
	nop
.L5:
	mov	rax, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR 40[rax]
	mov	QWORD PTR -72[rbp], rax
.L3:
	cmp	QWORD PTR -72[rbp], 0
	jne	.L8
	jmp	.L7
.L13:
	nop
.L7:
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	freeaddrinfo@PLT
	cmp	QWORD PTR -72[rbp], 0
	jne	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, QWORD PTR -112[rbp]
	mov	rdx, QWORD PTR -104[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L9:
	mov	eax, DWORD PTR -88[rbp]
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	socket_create, .-socket_create
	.section	.rodata
	.align 8
.LC2:
	.string	"write: failed to write to socket\n"
	.align 8
.LC3:
	.string	"write: only wrote part of buffer\n"
	.text
	.globl	socket_write
	.type	socket_write, @function
socket_write:
.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	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	rdx, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L15
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 33
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L15:
	mov	rax, QWORD PTR -8[rbp]
	cmp	QWORD PTR -40[rbp], rax
	jbe	.L17
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 33
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L17:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	socket_write, .-socket_write
	.section	.rodata
.LC4:
	.string	"read"
	.text
	.globl	socket_read
	.type	socket_read, @function
socket_read:
.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, 48
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	rdx, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -20[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], -1
	jne	.L20
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L20:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	socket_read, .-socket_read
	.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	"1053926.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"getaddrinfo: %s\012\000"
	.align	2
.LC1:
	.ascii	"Could not connect to address %s on port %s.\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	socket_create
	.syntax unified
	.arm
	.fpu softvfp
	.type	socket_create, %function
socket_create:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #68
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mvn	r3, #0
	str	r3, [fp, #-60]
	sub	r3, fp, #48
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-64]
	mov	r3, #0
	str	r3, [fp, #-44]
	mov	r3, #2
	str	r3, [fp, #-40]
	mov	r3, #1
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-36]
	sub	r3, fp, #64
	sub	r2, fp, #48
	ldr	r1, [fp, #-76]
	ldr	r0, [fp, #-72]
	bl	getaddrinfo
	str	r0, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmp	r3, #0
	beq	.L2
	ldr	r3, .L14+4
	ldr	r4, [r3]
	ldr	r0, [fp, #-52]
	bl	gai_strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L14+8
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L2:
	mov	r3, #0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-64]
	str	r3, [fp, #-56]
	b	.L3
.L8:
	ldr	r3, [fp, #-56]
	ldr	r0, [r3, #4]
	ldr	r3, [fp, #-56]
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-56]
	ldr	r3, [r3, #12]
	mov	r2, r3
	bl	socket
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-60]
	cmn	r3, #1
	beq	.L12
	ldr	r3, [fp, #-56]
	ldr	r1, [r3, #20]
	ldr	r3, [fp, #-56]
	ldr	r3, [r3, #16]
	mov	r2, r3
	ldr	r0, [fp, #-60]
	bl	connect
	mov	r3, r0
	cmp	r3, #0
	beq	.L13
	ldr	r0, [fp, #-60]
	bl	close
	b	.L5
.L12:
	nop
.L5:
	ldr	r3, [fp, #-56]
	ldr	r3, [r3, #28]
	str	r3, [fp, #-56]
.L3:
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L8
	b	.L7
.L13:
	nop
.L7:
	ldr	r3, [fp, #-64]
	mov	r0, r3
	bl	freeaddrinfo
	ldr	r3, [fp, #-56]
	cmp	r3, #0
	bne	.L9
	ldr	r3, .L14+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-76]
	ldr	r2, [fp, #-72]
	ldr	r1, .L14+12
	bl	fprintf
	mov	r0, #1
	bl	exit
.L9:
	ldr	r3, [fp, #-60]
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC2
	.word	stderr
	.word	.LC0
	.word	.LC1
	.size	socket_create, .-socket_create
	.section	.rodata
	.align	2
.LC3:
	.ascii	"write: failed to write to socket\012\000"
	.align	2
.LC4:
	.ascii	"write: only wrote part of buffer\012\000"
	.text
	.align	2
	.global	socket_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	socket_write, %function
socket_write:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	write
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L17
	ldr	r3, .L20
	ldr	r3, [r3]
	mov	r2, #33
	mov	r1, #1
	ldr	r0, .L20+4
	bl	fwrite
	mov	r0, #1
	bl	exit
.L17:
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	bls	.L19
	ldr	r3, .L20
	ldr	r3, [r3]
	mov	r2, #33
	mov	r1, #1
	ldr	r0, .L20+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L19:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	stderr
	.word	.LC3
	.word	.LC4
	.size	socket_write, .-socket_write
	.section	.rodata
	.align	2
.LC5:
	.ascii	"read\000"
	.text
	.align	2
	.global	socket_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	socket_read, %function
socket_read:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	read
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L24
	ldr	r0, .L25
	bl	perror
	mov	r0, #1
	bl	exit
.L24:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L26:
	.align	2
.L25:
	.word	.LC5
	.size	socket_read, .-socket_read
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
