	.file	"985960.c"
	.intel_syntax noprefix
	.text
	.globl	period
	.bss
	.align 32
	.type	period, @object
	.size	period, 88
period:
	.zero	88
	.globl	state
	.align 32
	.type	state, @object
	.size	state, 44
state:
	.zero	44
	.globl	init
	.align 32
	.type	init, @object
	.size	init, 44
init:
	.zero	44
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	asleep
	.align 4
	.type	asleep, @object
	.size	asleep, 4
asleep:
	.zero	4
	.section	.rodata
.LC0:
	.string	"T%2d (awaken%2d asleep%2d): "
.LC1:
	.string	" %2d  "
.LC2:
	.string	"(%2d) "
	.text
	.globl	printState
	.type	printState, @function
printState:
.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, 16
	mov	edx, DWORD PTR asleep[rip]
	mov	eax, DWORD PTR N[rip]
	mov	ecx, DWORD PTR asleep[rip]
	sub	eax, ecx
	mov	esi, eax
	mov	eax, DWORD PTR T[rip]
	mov	ecx, edx
	mov	edx, esi
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L2
.L5:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, period[rip]
	mov	eax, DWORD PTR [rcx+rax]
	cmp	edx, eax
	jg	.L3
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L4
.L3:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
.L4:
	add	DWORD PTR -4[rbp], 1
.L2:
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L5
	mov	edi, 10
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	printState, .-printState
	.globl	simultate
	.type	simultate, @function
simultate:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -16[rbp], 0
	mov	eax, DWORD PTR asleep[rip]
	test	eax, eax
	sete	al
	movzx	eax, al
	mov	DWORD PTR -12[rbp], eax
	jmp	.L7
.L19:
	mov	eax, DWORD PTR T[rip]
	add	eax, 1
	mov	DWORD PTR T[rip], eax
	mov	eax, DWORD PTR asleep[rip]
	add	eax, eax
	mov	DWORD PTR asleep[rip], eax
	mov	DWORD PTR -16[rbp], 1
	mov	DWORD PTR -12[rbp], 1
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L8
.L17:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, period[rip]
	mov	eax, DWORD PTR [rcx+rax]
	cmp	edx, eax
	jne	.L9
	mov	edx, DWORD PTR asleep[rip]
	mov	eax, DWORD PTR N[rip]
	cmp	edx, eax
	jle	.L10
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	add	eax, 1
	jmp	.L11
.L10:
	mov	eax, 1
.L11:
	mov	edx, DWORD PTR -4[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, state[rip]
	mov	DWORD PTR [rcx+rdx], eax
	jmp	.L12
.L9:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, period[rip+4]
	mov	eax, DWORD PTR [rcx+rax]
	cmp	edx, eax
	je	.L13
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	add	eax, 1
	jmp	.L14
.L13:
	mov	eax, 1
.L14:
	mov	edx, DWORD PTR -4[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, state[rip]
	mov	DWORD PTR [rcx+rdx], eax
.L12:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, period[rip]
	mov	eax, DWORD PTR [rcx+rax]
	cmp	edx, eax
	jle	.L15
	add	DWORD PTR -8[rbp], 1
	mov	DWORD PTR -12[rbp], 0
.L15:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, init[rip]
	mov	eax, DWORD PTR [rcx+rax]
	cmp	edx, eax
	je	.L16
	mov	DWORD PTR -16[rbp], 0
.L16:
	add	DWORD PTR -4[rbp], 1
.L8:
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L17
	mov	eax, DWORD PTR -8[rbp]
	mov	DWORD PTR asleep[rip], eax
.L7:
	cmp	DWORD PTR -16[rbp], 0
	jne	.L18
	cmp	DWORD PTR -12[rbp], 0
	je	.L19
.L18:
	mov	eax, DWORD PTR -12[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	simultate, .-simultate
	.section	.rodata
.LC3:
	.string	"%d%d%d"
.LC4:
	.string	"Case %d: "
.LC5:
	.string	"%d\n"
.LC6:
	.string	"-1"
.LC7:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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	DWORD PTR -8[rbp], 0
	jmp	.L22
.L28:
	mov	DWORD PTR T[rip], 1
	mov	DWORD PTR asleep[rip], 0
	mov	DWORD PTR -4[rbp], 0
	jmp	.L23
.L25:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 3
	lea	rdx, 4[rax]
	lea	rax, period[rip]
	add	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rsi, 0[0+rax*8]
	lea	rax, period[rip]
	add	rax, rsi
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, period[rip+4]
	mov	ecx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, period[rip]
	mov	eax, DWORD PTR [rdx+rax]
	add	ecx, eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, period[rip+4]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rax, period[rip]
	mov	eax, DWORD PTR [rcx+rax]
	cmp	edx, eax
	jle	.L24
	mov	eax, DWORD PTR asleep[rip]
	add	eax, 1
	mov	DWORD PTR asleep[rip], eax
.L24:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, state[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -4[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, init[rip]
	mov	DWORD PTR [rcx+rdx], eax
	add	DWORD PTR -4[rbp], 1
.L23:
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -4[rbp], eax
	jl	.L25
	add	DWORD PTR -8[rbp], 1
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	call	simultate
	test	eax, eax
	je	.L26
	mov	eax, DWORD PTR T[rip]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L22
.L26:
	lea	rdi, .LC6[rip]
	call	puts@PLT
.L22:
	lea	rsi, N[rip]
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	cmp	eax, 1
	jne	.L27
	mov	eax, DWORD PTR N[rip]
	test	eax, eax
	jne	.L28
.L27:
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	"985960.c"
	.text
	.comm	period,88,4
	.comm	state,44,4
	.comm	init,44,4
	.comm	N,4,4
	.comm	T,4,4
	.comm	asleep,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"T%2d (awaken%2d asleep%2d): \000"
	.align	2
.LC1:
	.ascii	" %2d  \000"
	.align	2
.LC2:
	.ascii	"(%2d) \000"
	.text
	.align	2
	.global	printState
	.syntax unified
	.arm
	.fpu softvfp
	.type	printState, %function
printState:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r3, .L6
	ldr	r1, [r3]
	ldr	r3, .L6+4
	ldr	r2, [r3]
	ldr	r3, .L6+8
	ldr	r3, [r3]
	sub	r2, r2, r3
	ldr	r3, .L6+8
	ldr	r3, [r3]
	ldr	r0, .L6+12
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L2
.L5:
	ldr	r2, .L6+16
	ldr	r3, [fp, #-8]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L6+20
	ldr	r3, [fp, #-8]
	ldr	r3, [r1, r3, lsl #3]
	cmp	r2, r3
	bgt	.L3
	ldr	r2, .L6+16
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L6+24
	bl	printf
	b	.L4
.L3:
	ldr	r2, .L6+16
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	mov	r1, r3
	ldr	r0, .L6+28
	bl	printf
.L4:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, .L6+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L5
	mov	r0, #10
	bl	putchar
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	T
	.word	N
	.word	asleep
	.word	.LC0
	.word	state
	.word	period
	.word	.LC1
	.word	.LC2
	.size	printState, .-printState
	.align	2
	.global	simultate
	.syntax unified
	.arm
	.fpu softvfp
	.type	simultate, %function
simultate:
	@ 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
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, .L23
	ldr	r3, [r3]
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	str	r3, [fp, #-16]
	b	.L9
.L21:
	ldr	r3, .L23+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L23+4
	str	r3, [r2]
	ldr	r3, .L23
	ldr	r3, [r3]
	lsl	r3, r3, #1
	ldr	r2, .L23
	str	r3, [r2]
	mov	r3, #1
	str	r3, [fp, #-20]
	mov	r3, #1
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L10
.L19:
	ldr	r2, .L23+8
	ldr	r3, [fp, #-8]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L23+12
	ldr	r3, [fp, #-8]
	ldr	r3, [r1, r3, lsl #3]
	cmp	r2, r3
	bne	.L11
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, .L23+16
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L12
	ldr	r2, .L23+8
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	add	r3, r3, #1
	b	.L13
.L12:
	mov	r3, #1
.L13:
	ldr	r1, .L23+8
	ldr	r2, [fp, #-8]
	str	r3, [r1, r2, lsl #2]
	b	.L14
.L11:
	ldr	r2, .L23+8
	ldr	r3, [fp, #-8]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L23+12
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	add	r3, r1, r3
	ldr	r3, [r3, #4]
	cmp	r2, r3
	beq	.L15
	ldr	r2, .L23+8
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #2]
	add	r3, r3, #1
	b	.L16
.L15:
	mov	r3, #1
.L16:
	ldr	r1, .L23+8
	ldr	r2, [fp, #-8]
	str	r3, [r1, r2, lsl #2]
.L14:
	ldr	r2, .L23+8
	ldr	r3, [fp, #-8]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L23+12
	ldr	r3, [fp, #-8]
	ldr	r3, [r1, r3, lsl #3]
	cmp	r2, r3
	ble	.L17
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-16]
.L17:
	ldr	r2, .L23+8
	ldr	r3, [fp, #-8]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L23+20
	ldr	r3, [fp, #-8]
	ldr	r3, [r1, r3, lsl #2]
	cmp	r2, r3
	beq	.L18
	mov	r3, #0
	str	r3, [fp, #-20]
.L18:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L10:
	ldr	r3, .L23+16
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L19
	ldr	r2, .L23
	ldr	r3, [fp, #-12]
	str	r3, [r2]
.L9:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L20
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L21
.L20:
	ldr	r3, [fp, #-16]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L24:
	.align	2
.L23:
	.word	asleep
	.word	T
	.word	state
	.word	period
	.word	N
	.word	init
	.size	simultate, .-simultate
	.section	.rodata
	.align	2
.LC3:
	.ascii	"%d%d%d\000"
	.align	2
.LC4:
	.ascii	"Case %d: \000"
	.align	2
.LC5:
	.ascii	"%d\012\000"
	.align	2
.LC6:
	.ascii	"-1\000"
	.align	2
.LC7:
	.ascii	"%d\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L26
.L32:
	ldr	r3, .L34
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, .L34+4
	mov	r2, #0
	str	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L27
.L29:
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	ldr	r2, .L34+8
	add	r1, r3, r2
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	add	r3, r3, #4
	ldr	r2, .L34+8
	add	r2, r3, r2
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #2
	ldr	r0, .L34+12
	add	r3, r3, r0
	ldr	r0, .L34+16
	bl	__isoc99_scanf
	ldr	r2, .L34+8
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r2, [r3, #4]
	ldr	r1, .L34+8
	ldr	r3, [fp, #-8]
	ldr	r3, [r1, r3, lsl #3]
	add	r2, r2, r3
	ldr	r1, .L34+8
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	add	r3, r1, r3
	str	r2, [r3, #4]
	ldr	r2, .L34+12
	ldr	r3, [fp, #-8]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L34+8
	ldr	r3, [fp, #-8]
	ldr	r3, [r1, r3, lsl #3]
	cmp	r2, r3
	ble	.L28
	ldr	r3, .L34+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L34+4
	str	r3, [r2]
.L28:
	ldr	r2, .L34+12
	ldr	r3, [fp, #-8]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L34+20
	ldr	r3, [fp, #-8]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L27:
	ldr	r3, .L34+24
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	blt	.L29
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, .L34+28
	bl	printf
	bl	simultate
	mov	r3, r0
	cmp	r3, #0
	beq	.L30
	ldr	r3, .L34
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L34+32
	bl	printf
	b	.L26
.L30:
	ldr	r0, .L34+36
	bl	puts
.L26:
	ldr	r1, .L34+24
	ldr	r0, .L34+40
	bl	__isoc99_scanf
	mov	r3, r0
	cmp	r3, #1
	bne	.L31
	ldr	r3, .L34+24
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L32
.L31:
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L35:
	.align	2
.L34:
	.word	T
	.word	asleep
	.word	period
	.word	state
	.word	.LC3
	.word	init
	.word	N
	.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
