	.file	"459407.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage : %s dest\n"
.LC1:
	.string	"socket"
.LC2:
	.string	"host not found : %s\n"
.LC3:
	.string	"%s : %s\n"
.LC4:
	.string	"connect"
.LC5:
	.string	"GET / HTTP/1.0\r\n\r\n"
.LC6:
	.string	"write"
.LC7:
	.string	"read"
	.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, 112
	mov	DWORD PTR -100[rbp], edi
	mov	QWORD PTR -112[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	DWORD PTR -100[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L18
.L2:
	mov	rax, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -80[rbp], rax
	mov	edx, 0
	mov	esi, 1
	mov	edi, 2
	call	socket@PLT
	mov	DWORD PTR -92[rbp], eax
	cmp	DWORD PTR -92[rbp], 0
	jns	.L4
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L18
.L4:
	mov	WORD PTR -64[rbp], 2
	mov	edi, 80
	call	htons@PLT
	mov	WORD PTR -62[rbp], ax
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	inet_addr@PLT
	mov	DWORD PTR -60[rbp], eax
	mov	eax, DWORD PTR -60[rbp]
	cmp	eax, -1
	jne	.L5
	mov	rax, QWORD PTR -80[rbp]
	mov	rdi, rax
	call	gethostbyname@PLT
	mov	QWORD PTR -72[rbp], rax
	cmp	QWORD PTR -72[rbp], 0
	jne	.L6
	call	__h_errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 1
	jne	.L7
	mov	rax, QWORD PTR -80[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L8
.L7:
	call	__h_errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	hstrerror@PLT
	mov	rcx, rax
	mov	rax, QWORD PTR -80[rbp]
	mov	rdx, rax
	mov	rsi, rcx
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L8:
	mov	eax, 1
	jmp	.L18
.L6:
	mov	rax, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	QWORD PTR -88[rbp], rax
	jmp	.L9
.L12:
	mov	rax, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -60[rbp], eax
	lea	rcx, -64[rbp]
	mov	eax, DWORD PTR -92[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	test	eax, eax
	je	.L20
	add	QWORD PTR -88[rbp], 8
.L9:
	mov	rax, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L12
	jmp	.L11
.L20:
	nop
.L11:
	mov	rax, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L13
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L18
.L5:
	lea	rcx, -64[rbp]
	mov	eax, DWORD PTR -92[rbp]
	mov	edx, 16
	mov	rsi, rcx
	mov	edi, eax
	call	connect@PLT
	test	eax, eax
	je	.L13
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L18
.L13:
	lea	rax, -48[rbp]
	mov	edx, 32
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, -48[rbp]
	lea	rdx, .LC5[rip]
	mov	esi, 32
	mov	rdi, rax
	mov	eax, 0
	call	snprintf@PLT
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	edx, eax
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -92[rbp]
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	write@PLT
	mov	DWORD PTR -96[rbp], eax
	cmp	DWORD PTR -96[rbp], 0
	jns	.L15
	lea	rdi, .LC6[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L18
.L17:
	lea	rax, -48[rbp]
	mov	edx, 32
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rcx, -48[rbp]
	mov	eax, DWORD PTR -92[rbp]
	mov	edx, 32
	mov	rsi, rcx
	mov	edi, eax
	mov	eax, 0
	call	read@PLT
	mov	DWORD PTR -96[rbp], eax
	cmp	DWORD PTR -96[rbp], 0
	jns	.L16
	lea	rdi, .LC7[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L18
.L16:
	mov	edx, DWORD PTR -96[rbp]
	lea	rax, -48[rbp]
	mov	rsi, rax
	mov	edi, 1
	mov	eax, 0
	call	write@PLT
.L15:
	cmp	DWORD PTR -96[rbp], 0
	jg	.L17
	mov	eax, DWORD PTR -92[rbp]
	mov	edi, eax
	mov	eax, 0
	call	close@PLT
	mov	eax, 0
.L18:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"459407.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage : %s dest\012\000"
	.align	2
.LC1:
	.ascii	"socket\000"
	.align	2
.LC2:
	.ascii	"host not found : %s\012\000"
	.align	2
.LC3:
	.ascii	"%s : %s\012\000"
	.align	2
.LC4:
	.ascii	"connect\000"
	.align	2
.LC5:
	.ascii	"GET / HTTP/1.0\015\012\015\012\000"
	.align	2
.LC6:
	.ascii	"write\000"
	.align	2
.LC7:
	.ascii	"read\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 80
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #80
	str	r0, [fp, #-80]
	str	r1, [fp, #-84]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-80]
	cmp	r3, #2
	beq	.L2
	ldr	r3, [fp, #-84]
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L21+4
	bl	printf
	mov	r3, #1
	b	.L18
.L2:
	ldr	r3, [fp, #-84]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-68]
	mov	r2, #0
	mov	r1, #1
	mov	r0, #2
	bl	socket
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L21+8
	bl	perror
	mov	r3, #1
	b	.L18
.L4:
	mov	r3, #2
	strh	r3, [fp, #-56]	@ movhi
	mov	r0, #80
	bl	htons
	mov	r3, r0
	strh	r3, [fp, #-54]	@ movhi
	ldr	r0, [fp, #-68]
	bl	inet_addr
	mov	r3, r0
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-52]
	cmn	r3, #1
	bne	.L5
	ldr	r0, [fp, #-68]
	bl	gethostbyname
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-60]
	cmp	r3, #0
	bne	.L6
	bl	__h_errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L7
	ldr	r1, [fp, #-68]
	ldr	r0, .L21+12
	bl	printf
	b	.L8
.L7:
	bl	__h_errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	hstrerror
	mov	r3, r0
	ldr	r2, [fp, #-68]
	mov	r1, r3
	ldr	r0, .L21+16
	bl	printf
.L8:
	mov	r3, #1
	b	.L18
.L6:
	ldr	r3, [fp, #-60]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-76]
	b	.L9
.L12:
	ldr	r3, [fp, #-76]
	ldr	r3, [r3]
	ldr	r3, [r3]
	str	r3, [fp, #-52]
	sub	r3, fp, #56
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-64]
	bl	connect
	mov	r3, r0
	cmp	r3, #0
	beq	.L20
	ldr	r3, [fp, #-76]
	add	r3, r3, #4
	str	r3, [fp, #-76]
.L9:
	ldr	r3, [fp, #-76]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L12
	b	.L11
.L20:
	nop
.L11:
	ldr	r3, [fp, #-76]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L13
	ldr	r0, .L21+20
	bl	perror
	mov	r3, #1
	b	.L18
.L5:
	sub	r3, fp, #56
	mov	r2, #16
	mov	r1, r3
	ldr	r0, [fp, #-64]
	bl	connect
	mov	r3, r0
	cmp	r3, #0
	beq	.L13
	ldr	r0, .L21+20
	bl	perror
	mov	r3, #1
	b	.L18
.L13:
	sub	r3, fp, #40
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #40
	ldr	r2, .L21+24
	mov	r1, #32
	mov	r0, r3
	bl	snprintf
	sub	r3, fp, #40
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	sub	r3, fp, #40
	mov	r1, r3
	ldr	r0, [fp, #-64]
	bl	write
	str	r0, [fp, #-72]
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	bge	.L15
	ldr	r0, .L21+28
	bl	perror
	mov	r3, #1
	b	.L18
.L17:
	sub	r3, fp, #40
	mov	r2, #32
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #40
	mov	r2, #32
	mov	r1, r3
	ldr	r0, [fp, #-64]
	bl	read
	str	r0, [fp, #-72]
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	bge	.L16
	ldr	r0, .L21+32
	bl	perror
	mov	r3, #1
	b	.L18
.L16:
	sub	r3, fp, #40
	ldr	r2, [fp, #-72]
	mov	r1, r3
	mov	r0, #1
	bl	write
.L15:
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	bgt	.L17
	ldr	r0, [fp, #-64]
	bl	close
	mov	r3, #0
.L18:
	ldr	r2, .L21
	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}
.L22:
	.align	2
.L21:
	.word	.LC8
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
