	.file	"540206.c"
	.intel_syntax noprefix
	.text
	.globl	error
	.type	error, @function
error:
.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, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	error, .-error
	.section	.rodata
.LC0:
	.string	"api.somesite.com"
	.align 8
.LC1:
	.string	"POST /apikey=%s&command=%s HTTP/1.0\r\n\r\n"
	.align 8
.LC2:
	.string	"Parameters: <apikey> <command>"
.LC3:
	.string	"Request:\n%s\n"
.LC4:
	.string	"ERROR opening socket"
.LC5:
	.string	"ERROR, no such host"
.LC6:
	.string	"ERROR connecting"
	.align 8
.LC7:
	.string	"ERROR writing message to socket"
	.align 8
.LC8:
	.string	"ERROR reading response from socket"
	.align 8
.LC9:
	.string	"ERROR storing complete response from socket"
.LC10:
	.string	"Response:\n%s\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 1120
	mov	DWORD PTR -5204[rbp], edi
	mov	QWORD PTR -5216[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -5192[rbp], 80
	lea	rax, .LC0[rip]
	mov	QWORD PTR -5176[rbp], rax
	lea	rax, .LC1[rip]
	mov	QWORD PTR -5168[rbp], rax
	cmp	DWORD PTR -5204[rbp], 2
	jg	.L3
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edi, 0
	call	exit@PLT
.L3:
	mov	rax, QWORD PTR -5216[rbp]
	add	rax, 16
	mov	rcx, QWORD PTR [rax]
	mov	rax, QWORD PTR -5216[rbp]
	add	rax, 8
	mov	rdx, QWORD PTR [rax]
	mov	rsi, QWORD PTR -5168[rbp]
	lea	rax, -5136[rbp]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -5136[rbp]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -5188[rbp], eax
	cmp	DWORD PTR -5188[rbp], 0
	jns	.L4
	lea	rdi, .LC4[rip]
	call	error
.L4:
	mov	rax, QWORD PTR -5176[rbp]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -5160[rbp], rax
	cmp	QWORD PTR -5160[rbp], 0
	jne	.L5
	lea	rdi, .LC5[rip]
	call	error
.L5:
	lea	rax, -5152[rbp]
	mov	edx, 16
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	WORD PTR -5152[rbp], 2
	mov	eax, DWORD PTR -5192[rbp]
	movzx	eax, ax
	mov	edi, eax
	call	htons@PLT
	mov	WORD PTR -5150[rbp], ax
	mov	rax, QWORD PTR -5160[rbp]
	mov	eax, DWORD PTR 20[rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -5160[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR [rax]
	lea	rcx, -5152[rbp]
	add	rcx, 4
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	lea	rcx, -5152[rbp]
	mov	eax, DWORD PTR -5188[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	test	eax, eax
	jns	.L6
	lea	rdi, .LC6[rip]
	call	error
.L6:
	lea	rax, -5136[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -5184[rbp], eax
	mov	DWORD PTR -5200[rbp], 0
.L10:
	mov	eax, DWORD PTR -5184[rbp]
	sub	eax, DWORD PTR -5200[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -5200[rbp]
	cdqe
	lea	rcx, -5136[rbp]
	add	rcx, rax
	mov	eax, DWORD PTR -5188[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -5180[rbp], eax
	cmp	DWORD PTR -5180[rbp], 0
	jns	.L7
	lea	rdi, .LC7[rip]
	call	error
.L7:
	cmp	DWORD PTR -5180[rbp], 0
	je	.L18
	mov	eax, DWORD PTR -5180[rbp]
	add	DWORD PTR -5200[rbp], eax
	mov	eax, DWORD PTR -5200[rbp]
	cmp	eax, DWORD PTR -5184[rbp]
	jl	.L10
	jmp	.L9
.L18:
	nop
.L9:
	lea	rax, -4112[rbp]
	mov	edx, 4096
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -5184[rbp], 4095
	mov	DWORD PTR -5196[rbp], 0
.L14:
	mov	eax, DWORD PTR -5184[rbp]
	sub	eax, DWORD PTR -5196[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -5196[rbp]
	cdqe
	lea	rcx, -4112[rbp]
	add	rcx, rax
	mov	eax, DWORD PTR -5188[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -5180[rbp], eax
	cmp	DWORD PTR -5180[rbp], 0
	jns	.L11
	lea	rdi, .LC8[rip]
	call	error
.L11:
	cmp	DWORD PTR -5180[rbp], 0
	je	.L19
	mov	eax, DWORD PTR -5180[rbp]
	add	DWORD PTR -5196[rbp], eax
	mov	eax, DWORD PTR -5196[rbp]
	cmp	eax, DWORD PTR -5184[rbp]
	jl	.L14
	jmp	.L13
.L19:
	nop
.L13:
	mov	eax, DWORD PTR -5196[rbp]
	cmp	eax, DWORD PTR -5184[rbp]
	jne	.L15
	lea	rdi, .LC9[rip]
	call	error
.L15:
	mov	eax, DWORD PTR -5188[rbp]
	mov	edi, eax
	call	close@PLT
	lea	rax, -4112[rbp]
	mov	rsi, rax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	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	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	"540206.c"
	.text
	.align	2
	.global	error
	.syntax unified
	.arm
	.fpu softvfp
	.type	error, %function
error:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r0, [fp, #-8]
	bl	perror
	mov	r0, #0
	bl	exit
	.size	error, .-error
	.section	.rodata
	.align	2
.LC0:
	.ascii	"api.somesite.com\000"
	.align	2
.LC1:
	.ascii	"POST /apikey=%s&command=%s HTTP/1.0\015\012\015\012"
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"Parameters: <apikey> <command>\000"
	.align	2
.LC3:
	.ascii	"Request:\012%s\012\000"
	.align	2
.LC4:
	.ascii	"ERROR opening socket\000"
	.align	2
.LC5:
	.ascii	"ERROR, no such host\000"
	.align	2
.LC6:
	.ascii	"ERROR connecting\000"
	.align	2
.LC7:
	.ascii	"ERROR writing message to socket\000"
	.align	2
.LC8:
	.ascii	"ERROR reading response from socket\000"
	.align	2
.LC9:
	.ascii	"ERROR storing complete response from socket\000"
	.align	2
.LC10:
	.ascii	"Response:\012%s\012\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 5184
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #5184
	sub	sp, sp, #4
	sub	r3, fp, #4096
	sub	r3, r3, #12
	str	r0, [r3, #-1084]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	str	r1, [r3, #-1088]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #80
	str	r3, [r2, #-1072]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L20+4
	str	r3, [r2, #-1068]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L20+8
	str	r3, [r2, #-1064]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1084]
	cmp	r3, #2
	bgt	.L3
	ldr	r0, .L20+12
	bl	puts
	mov	r0, #0
	bl	exit
.L3:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1088]
	add	r3, r3, #4
	ldr	r2, [r3]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1088]
	add	r3, r3, #8
	ldr	r3, [r3]
	sub	r1, fp, #4096
	sub	r1, r1, #12
	sub	r0, fp, #5120
	sub	r0, r0, #12
	sub	r0, r0, #4
	ldr	r1, [r1, #-1064]
	bl	sprintf
	sub	r3, fp, #5120
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L20+16
	bl	printf
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [r4, #-1060]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1060]
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L20+20
	bl	error
.L4:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-1068]
	bl	gethostbyname
	str	r0, [r4, #-1056]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1056]
	cmp	r3, #0
	bne	.L5
	ldr	r0, .L20+24
	bl	error
.L5:
	sub	r3, fp, #5120
	sub	r3, r3, #12
	sub	r3, r3, #20
	mov	r2, #16
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #1040
	sub	r3, r3, #4
	mov	r2, #2
	strh	r2, [r3]	@ movhi
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1072]
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	mov	r0, r3
	bl	htons
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #1040
	sub	r3, r3, #4
	strh	r2, [r3, #2]	@ movhi
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1056]
	ldr	r3, [r3, #16]
	ldr	r1, [r3]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1056]
	ldr	r3, [r3, #12]
	mov	r2, r3
	sub	r3, fp, #5120
	sub	r3, r3, #12
	sub	r3, r3, #20
	add	r3, r3, #4
	mov	r0, r3
	bl	memcpy
	sub	r3, fp, #5120
	sub	r3, r3, #12
	sub	r3, r3, #20
	sub	r2, fp, #4096
	sub	r2, r2, #12
	mov	r0, r2
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [r0, #-1060]
	bl	connect
	mov	r3, r0
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L20+28
	bl	error
.L6:
	sub	r3, fp, #5120
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r2, fp, #4096
	sub	r2, r2, #12
	str	r3, [r2, #-1052]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1080]
.L10:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r3, #-1080]
	sub	r3, fp, #5120
	sub	r3, r3, #12
	sub	r3, r3, #4
	add	r1, r3, r2
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r2, #-1052]
	ldr	r3, [r3, #-1080]
	sub	r3, r2, r3
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-1060]
	bl	write
	str	r0, [r4, #-1048]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1048]
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L20+32
	bl	error
.L7:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1048]
	cmp	r3, #0
	beq	.L18
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r2, #-1080]
	ldr	r3, [r3, #-1048]
	add	r3, r2, r3
	str	r3, [r1, #-1080]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r2, #-1080]
	ldr	r3, [r3, #-1052]
	cmp	r2, r3
	blt	.L10
	b	.L9
.L18:
	nop
.L9:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r2, #4096
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	ldr	r3, .L20+36
	str	r3, [r2, #-1052]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #0
	str	r3, [r2, #-1076]
.L14:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r3, #-1076]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	add	r1, r3, r2
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r2, #-1052]
	ldr	r3, [r3, #-1076]
	sub	r3, r2, r3
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-1060]
	bl	read
	str	r0, [r4, #-1048]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1048]
	cmp	r3, #0
	bge	.L11
	ldr	r0, .L20+40
	bl	error
.L11:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r3, [r3, #-1048]
	cmp	r3, #0
	beq	.L19
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r1, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r2, #-1076]
	ldr	r3, [r3, #-1048]
	add	r3, r2, r3
	str	r3, [r1, #-1076]
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r2, #-1076]
	ldr	r3, [r3, #-1052]
	cmp	r2, r3
	blt	.L14
	b	.L13
.L19:
	nop
.L13:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r2, [r2, #-1076]
	ldr	r3, [r3, #-1052]
	cmp	r2, r3
	bne	.L15
	ldr	r0, .L20+44
	bl	error
.L15:
	sub	r3, fp, #4096
	sub	r3, r3, #12
	ldr	r0, [r3, #-1060]
	bl	close
	sub	r3, fp, #4096
	sub	r3, r3, #12
	sub	r3, r3, #4
	mov	r1, r3
	ldr	r0, .L20+48
	bl	printf
	mov	r3, #0
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC11
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	4095
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
