	.file	"865293.c"
	.intel_syntax noprefix
	.text
	.globl	solution
	.type	solution, @function
solution:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 72
	.cfi_offset 3, -24
	mov	QWORD PTR -72[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -52[rbp], 0
	mov	rax, QWORD PTR -72[rbp]
	mov	QWORD PTR -48[rbp], rax
	jmp	.L2
.L3:
	add	DWORD PTR -52[rbp], 1
	add	QWORD PTR -48[rbp], 1
.L2:
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L3
	mov	eax, DWORD PTR -52[rbp]
	mov	rdx, rsp
	mov	rsi, rdx
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -40[rbp], rdx
	movsx	rdx, eax
	mov	r8, rdx
	mov	r9d, 0
	movsx	rdx, eax
	mov	rcx, rdx
	mov	ebx, 0
	cdqe
	mov	edx, 16
	sub	rdx, 1
	add	rax, rdx
	mov	edi, 16
	mov	edx, 0
	div	rdi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L4:
	cmp	rsp, rdx
	je	.L5
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L4
.L5:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L6
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L6:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -32[rbp], rax
	mov	DWORD PTR -60[rbp], 1
	mov	rax, QWORD PTR -32[rbp]
	mov	BYTE PTR [rax], 49
	mov	DWORD PTR -56[rbp], 0
	jmp	.L7
.L12:
	mov	eax, DWORD PTR -56[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 40
	jne	.L8
	mov	eax, DWORD PTR -56[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	movzx	ecx, BYTE PTR [rax]
	mov	rdx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	mov	BYTE PTR [rdx+rax], cl
	add	DWORD PTR -60[rbp], 1
	jmp	.L9
.L8:
	mov	eax, DWORD PTR -56[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 41
	jne	.L10
	mov	eax, DWORD PTR -60[rbp]
	sub	eax, 1
	mov	rdx, QWORD PTR -32[rbp]
	cdqe
	movzx	eax, BYTE PTR [rdx+rax]
	cmp	al, 40
	je	.L10
	mov	eax, 0
	jmp	.L11
.L10:
	sub	DWORD PTR -60[rbp], 1
	cmp	DWORD PTR -60[rbp], 0
	jg	.L9
	mov	eax, 0
	jmp	.L11
.L9:
	add	DWORD PTR -56[rbp], 1
.L7:
	mov	eax, DWORD PTR -56[rbp]
	cmp	eax, DWORD PTR -52[rbp]
	jl	.L12
	cmp	DWORD PTR -60[rbp], 1
	jne	.L13
	mov	eax, 1
	jmp	.L11
.L13:
	mov	eax, 0
.L11:
	mov	rsp, rsi
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	solution, .-solution
	.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	"865293.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	solution
	.syntax unified
	.arm
	.fpu softvfp
	.type	solution, %function
solution:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-40]
	str	r3, [fp, #-20]
	b	.L2
.L3:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L2:
	ldr	r3, [fp, #-20]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L3
	ldr	ip, [fp, #-24]
	mov	r3, sp
	mov	lr, r3
	sub	r3, ip, #1
	str	r3, [fp, #-16]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, ip
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #0
	str	r3, [fp, #-12]
	mov	r3, #1
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-12]
	mov	r2, #49
	strb	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L4
.L9:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #40
	bne	.L5
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	ldrb	r1, [r3]	@ zero_extendqisi2
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-32]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
	b	.L6
.L5:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #41
	bne	.L7
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	ldr	r2, [fp, #-12]
	ldrb	r3, [r2, r3]	@ zero_extendqisi2
	cmp	r3, #40
	beq	.L7
	mov	r3, #0
	b	.L8
.L7:
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bgt	.L6
	mov	r3, #0
	b	.L8
.L6:
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L4:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L9
	ldr	r3, [fp, #-32]
	cmp	r3, #1
	bne	.L10
	mov	r3, #1
	b	.L8
.L10:
	mov	r3, #0
.L8:
	mov	sp, lr
	ldr	r2, .L13
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L12
	bl	__stack_chk_fail
.L12:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC0
	.size	solution, .-solution
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
