	.file	"790448.c"
	.intel_syntax noprefix
	.text
	.globl	getw
	.type	getw, @function
getw:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r13
	push	r12
	push	rbx
	sub	rsp, 24
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	mov	rbx, rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	lea	r13, -44[rbp]
	mov	r12d, 4
	jmp	.L2
.L3:
	mov	rdi, rbx
	call	getc@PLT
	mov	edx, eax
	mov	rax, r13
	lea	r13, 1[rax]
	mov	BYTE PTR [rax], dl
.L2:
	sub	r12d, 1
	test	r12d, r12d
	jns	.L3
	mov	rdi, rbx
	call	feof@PLT
	test	eax, eax
	jne	.L4
	mov	rdi, rbx
	call	ferror@PLT
	test	eax, eax
	jne	.L4
	mov	eax, DWORD PTR -44[rbp]
	jmp	.L6
.L4:
	mov	eax, -1
.L6:
	mov	rcx, QWORD PTR -40[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	add	rsp, 24
	pop	rbx
	pop	r12
	pop	r13
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getw, .-getw
	.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	"790448.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	getw
	.syntax unified
	.arm
	.fpu softvfp
	.type	getw, %function
getw:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, fp, lr}
	add	fp, sp, #16
	sub	sp, sp, #12
	mov	r5, r0
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	mov	r3,#0
	sub	r6, fp, #28
	mov	r4, #4
	b	.L2
.L3:
	mov	r0, r5
	bl	getc
	mov	r2, r0
	mov	r3, r6
	add	r6, r3, #1
	and	r2, r2, #255
	strb	r2, [r3]
.L2:
	sub	r4, r4, #1
	cmp	r4, #0
	bge	.L3
	mov	r0, r5
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	bne	.L4
	mov	r0, r5
	bl	ferror
	mov	r3, r0
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-28]
	b	.L6
.L4:
	mvn	r3, #0
.L6:
	ldr	r2, .L8
	ldr	r1, [r2]
	ldr	r2, [fp, #-24]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	mov	r0, r3
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r5, r6, fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC0
	.size	getw, .-getw
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
