	.file	"28262062.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Enter a binary number with up to %zu digits: "
	.align 8
.LC1:
	.string	"A binary number contains just 0s and 1s."
.LC2:
	.string	"%s is %d\n"
	.align 8
.LC3:
	.string	"Enter next value (empty line to quit):"
.LC4:
	.string	"Done"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	esi, 32
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L2
.L6:
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	check_val
	xor	eax, 1
	test	al, al
	je	.L3
	lea	rdi, .LC1[rip]
	call	puts@PLT
	jmp	.L4
.L3:
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	bstr_to_dec
	mov	edx, eax
	lea	rax, -48[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
.L4:
	lea	rdi, .LC3[rip]
	call	puts@PLT
.L2:
	lea	rax, -48[rbp]
	mov	esi, 33
	mov	rdi, rax
	call	s_gets
	test	rax, rax
	je	.L5
	movzx	eax, BYTE PTR -48[rbp]
	test	al, al
	jne	.L6
.L5:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	bstr_to_dec
	.type	bstr_to_dec, @function
bstr_to_dec:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -4[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -4[rbp]
	sub	eax, 24
	lea	ecx, [rax+rax]
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -24[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	add	eax, ecx
	mov	DWORD PTR -4[rbp], eax
.L10:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L11
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	bstr_to_dec, .-bstr_to_dec
	.globl	check_val
	.type	check_val, @function
check_val:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	BYTE PTR -1[rbp], 1
	jmp	.L14
.L17:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 48
	je	.L15
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 49
	je	.L15
	mov	BYTE PTR -1[rbp], 0
.L15:
	add	QWORD PTR -24[rbp], 1
.L14:
	cmp	BYTE PTR -1[rbp], 0
	je	.L16
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L17
.L16:
	movzx	eax, BYTE PTR -1[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	check_val, .-check_val
	.globl	s_gets
	.type	s_gets, @function
s_gets:
.LFB3:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	rdx, QWORD PTR stdin[rip]
	mov	ecx, DWORD PTR -28[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	fgets@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L20
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 10
	mov	rdi, rax
	call	strchr@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L22
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR [rax], 0
	jmp	.L20
.L23:
	nop
.L22:
	call	getchar@PLT
	cmp	eax, 10
	jne	.L23
.L20:
	mov	rax, QWORD PTR -16[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	s_gets, .-s_gets
	.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	"28262062.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Enter a binary number with up to %zu digits: \000"
	.align	2
.LC1:
	.ascii	"A binary number contains just 0s and 1s.\000"
	.align	2
.LC2:
	.ascii	"%s is %d\012\000"
	.align	2
.LC3:
	.ascii	"Enter next value (empty line to quit):\000"
	.align	2
.LC4:
	.ascii	"Done\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #32
	ldr	r0, .L9+4
	bl	printf
	b	.L2
.L6:
	sub	r3, fp, #44
	mov	r0, r3
	bl	check_val
	mov	r3, r0
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	beq	.L3
	ldr	r0, .L9+8
	bl	puts
	b	.L4
.L3:
	sub	r3, fp, #44
	mov	r0, r3
	bl	bstr_to_dec
	mov	r2, r0
	sub	r3, fp, #44
	mov	r1, r3
	ldr	r0, .L9+12
	bl	printf
.L4:
	ldr	r0, .L9+16
	bl	puts
.L2:
	sub	r3, fp, #44
	mov	r1, #33
	mov	r0, r3
	bl	s_gets
	mov	r3, r0
	cmp	r3, #0
	beq	.L5
	ldrb	r3, [fp, #-44]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L6
.L5:
	ldr	r0, .L9+20
	bl	puts
	mov	r3, #0
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC5
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.align	2
	.global	bstr_to_dec
	.syntax unified
	.arm
	.fpu softvfp
	.type	bstr_to_dec, %function
bstr_to_dec:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L12
.L13:
	ldr	r3, [fp, #-8]
	sub	r3, r3, #24
	lsl	r2, r3, #1
	ldr	r3, [fp, #-16]
	add	r1, r3, #1
	str	r1, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	add	r3, r2, r3
	str	r3, [fp, #-8]
.L12:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L13
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	bstr_to_dec, .-bstr_to_dec
	.align	2
	.global	check_val
	.syntax unified
	.arm
	.fpu softvfp
	.type	check_val, %function
check_val:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-16]
	mov	r3, #1
	strb	r3, [fp, #-5]
	b	.L16
.L19:
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #48
	beq	.L17
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #49
	beq	.L17
	mov	r3, #0
	strb	r3, [fp, #-5]
.L17:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L16:
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L18
	ldr	r3, [fp, #-16]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L19
.L18:
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	check_val, .-check_val
	.align	2
	.global	s_gets
	.syntax unified
	.arm
	.fpu softvfp
	.type	s_gets, %function
s_gets:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r3, .L27
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	fgets
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L22
	mov	r1, #10
	ldr	r0, [fp, #-16]
	bl	strchr
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L24
	ldr	r3, [fp, #-8]
	mov	r2, #0
	strb	r2, [r3]
	b	.L22
.L25:
	nop
.L24:
	bl	getchar
	mov	r3, r0
	cmp	r3, #10
	bne	.L25
.L22:
	ldr	r3, [fp, #-12]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	stdin
	.size	s_gets, .-s_gets
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
