	.file	"317654.c"
	.intel_syntax noprefix
	.text
	.globl	alarm_mutex
	.bss
	.align 32
	.type	alarm_mutex, @object
	.size	alarm_mutex, 40
alarm_mutex:
	.zero	40
	.globl	alarm_cond
	.align 32
	.type	alarm_cond, @object
	.size	alarm_cond, 48
alarm_cond:
	.zero	48
	.globl	alarm_list
	.align 8
	.type	alarm_list, @object
	.size	alarm_list, 8
alarm_list:
	.zero	8
	.globl	current_alarm
	.align 8
	.type	current_alarm, @object
	.size	current_alarm, 8
current_alarm:
	.zero	8
	.section	.rodata
.LC0:
	.string	"pthread_cond_signal"
	.text
	.globl	alarm_insert
	.type	alarm_insert, @function
alarm_insert:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	lea	rax, alarm_list[rip]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L2
.L5:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR 16[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 16[rax]
	cmp	rdx, rax
	jl	.L3
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR [rax], rdx
	jmp	.L4
.L3:
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -8[rbp], rax
.L2:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L5
.L4:
	cmp	QWORD PTR -8[rbp], 0
	jne	.L6
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR [rax], 0
.L6:
	mov	rax, QWORD PTR current_alarm[rip]
	test	rax, rax
	je	.L7
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR 16[rax]
	mov	rax, QWORD PTR current_alarm[rip]
	cmp	rdx, rax
	jge	.L9
.L7:
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR current_alarm[rip], rax
	lea	rdi, alarm_cond[rip]
	call	pthread_cond_signal@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	je	.L9
	lea	rdi, .LC0[rip]
	call	perror@PLT
.L9:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	alarm_insert, .-alarm_insert
	.section	.rodata
.LC1:
	.string	"pthread_mutex_lock"
.LC2:
	.string	"pthread_cond_wait"
.LC3:
	.string	"pthread_cond_timedwait"
.LC4:
	.string	"(%d) %s\n"
	.text
	.globl	alarm_thread
	.type	alarm_thread, @function
alarm_thread:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -72[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rdi, alarm_mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	je	.L21
	lea	rdi, .LC1[rip]
	call	perror@PLT
.L21:
	mov	QWORD PTR current_alarm[rip], 0
	jmp	.L12
.L13:
	lea	rsi, alarm_mutex[rip]
	lea	rdi, alarm_cond[rip]
	call	pthread_cond_wait@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	je	.L12
	lea	rdi, .LC2[rip]
	call	perror@PLT
.L12:
	mov	rax, QWORD PTR alarm_list[rip]
	test	rax, rax
	je	.L13
	mov	rax, QWORD PTR alarm_list[rip]
	mov	QWORD PTR -48[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR alarm_list[rip], rax
	mov	edi, 0
	call	time@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	DWORD PTR -56[rbp], 0
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR 16[rax]
	cmp	QWORD PTR -40[rbp], rax
	jge	.L14
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -32[rbp], rax
	mov	QWORD PTR -24[rbp], 0
	mov	rax, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR current_alarm[rip], rax
	jmp	.L15
.L18:
	lea	rax, -32[rbp]
	mov	rdx, rax
	lea	rsi, alarm_mutex[rip]
	lea	rdi, alarm_cond[rip]
	call	pthread_cond_timedwait@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 110
	jne	.L16
	mov	DWORD PTR -56[rbp], 1
	jmp	.L17
.L16:
	cmp	DWORD PTR -52[rbp], 0
	je	.L15
	lea	rdi, .LC3[rip]
	call	perror@PLT
.L15:
	mov	rax, QWORD PTR -48[rbp]
	mov	rdx, QWORD PTR 16[rax]
	mov	rax, QWORD PTR current_alarm[rip]
	cmp	rdx, rax
	je	.L18
.L17:
	cmp	DWORD PTR -56[rbp], 0
	jne	.L19
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	alarm_insert
	jmp	.L19
.L14:
	mov	DWORD PTR -56[rbp], 1
.L19:
	cmp	DWORD PTR -56[rbp], 0
	je	.L21
	mov	rax, QWORD PTR -48[rbp]
	lea	rdx, 24[rax]
	mov	rax, QWORD PTR -48[rbp]
	mov	eax, DWORD PTR 8[rax]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L21
	.cfi_endproc
.LFE7:
	.size	alarm_thread, .-alarm_thread
	.section	.rodata
.LC5:
	.string	"pthread_create"
.LC6:
	.string	"Alarm> "
.LC7:
	.string	"malloc"
.LC8:
	.string	"%d %64[^\n]"
.LC9:
	.string	"Bad command\n"
.LC10:
	.string	"pthread_mutex_unlock"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 192
	mov	DWORD PTR -180[rbp], edi
	mov	QWORD PTR -192[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -160[rbp]
	mov	ecx, 0
	lea	rdx, alarm_thread[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	DWORD PTR -164[rbp], eax
	cmp	DWORD PTR -164[rbp], 0
	je	.L31
	lea	rdi, .LC5[rip]
	call	perror@PLT
.L31:
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rdx, QWORD PTR stdin[rip]
	lea	rax, -144[rbp]
	mov	esi, 128
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L25
	mov	edi, 0
	call	exit@PLT
.L25:
	lea	rax, -144[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rax, 1
	jbe	.L33
	mov	edi, 88
	call	malloc@PLT
	mov	QWORD PTR -152[rbp], rax
	cmp	QWORD PTR -152[rbp], 0
	jne	.L28
	lea	rdi, .LC7[rip]
	call	perror@PLT
.L28:
	mov	rax, QWORD PTR -152[rbp]
	lea	rcx, 24[rax]
	mov	rax, QWORD PTR -152[rbp]
	lea	rdx, 8[rax]
	lea	rax, -144[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	cmp	eax, 1
	jg	.L29
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 12
	mov	esi, 1
	lea	rdi, .LC9[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L31
.L29:
	lea	rdi, alarm_mutex[rip]
	call	pthread_mutex_lock@PLT
	mov	DWORD PTR -164[rbp], eax
	cmp	DWORD PTR -164[rbp], 0
	je	.L30
	lea	rdi, .LC1[rip]
	call	perror@PLT
.L30:
	mov	edi, 0
	call	time@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -152[rbp]
	mov	eax, DWORD PTR 8[rax]
	cdqe
	add	rdx, rax
	mov	rax, QWORD PTR -152[rbp]
	mov	QWORD PTR 16[rax], rdx
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	alarm_insert
	lea	rdi, alarm_mutex[rip]
	call	pthread_mutex_unlock@PLT
	mov	DWORD PTR -164[rbp], eax
	cmp	DWORD PTR -164[rbp], 0
	je	.L31
	lea	rdi, .LC10[rip]
	call	perror@PLT
	jmp	.L31
.L33:
	nop
	jmp	.L31
	.cfi_endproc
.LFE8:
	.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	"317654.c"
	.text
	.global	alarm_mutex
	.bss
	.align	2
	.type	alarm_mutex, %object
	.size	alarm_mutex, 24
alarm_mutex:
	.space	24
	.global	alarm_cond
	.align	3
	.type	alarm_cond, %object
	.size	alarm_cond, 48
alarm_cond:
	.space	48
	.global	alarm_list
	.align	2
	.type	alarm_list, %object
	.size	alarm_list, 4
alarm_list:
	.space	4
	.global	current_alarm
	.align	2
	.type	current_alarm, %object
	.size	current_alarm, 4
current_alarm:
	.space	4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"pthread_cond_signal\000"
	.text
	.align	2
	.global	alarm_insert
	.syntax unified
	.arm
	.fpu softvfp
	.type	alarm_insert, %function
alarm_insert:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	ldr	r3, .L10
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	b	.L2
.L5:
	ldr	r3, [fp, #-12]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	cmp	r2, r3
	blt	.L3
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-12]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-24]
	str	r2, [r3]
	b	.L4
.L3:
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L5
.L4:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L6
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-24]
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	mov	r2, #0
	str	r2, [r3]
.L6:
	ldr	r3, .L10+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L7
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #8]
	ldr	r3, .L10+4
	ldr	r3, [r3]
	cmp	r2, r3
	bge	.L9
.L7:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	ldr	r2, .L10+4
	str	r3, [r2]
	ldr	r0, .L10+8
	bl	pthread_cond_signal
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L9
	ldr	r0, .L10+12
	bl	perror
.L9:
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	alarm_list
	.word	current_alarm
	.word	alarm_cond
	.word	.LC0
	.size	alarm_insert, .-alarm_insert
	.section	.rodata
	.align	2
.LC1:
	.ascii	"pthread_mutex_lock\000"
	.align	2
.LC2:
	.ascii	"pthread_cond_wait\000"
	.align	2
.LC3:
	.ascii	"pthread_cond_timedwait\000"
	.align	2
.LC4:
	.ascii	"(%d) %s\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	alarm_thread
	.syntax unified
	.arm
	.fpu softvfp
	.type	alarm_thread, %function
alarm_thread:
	@ 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, .L25
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r0, .L25+4
	bl	pthread_mutex_lock
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L23
	ldr	r0, .L25+8
	bl	perror
.L23:
	ldr	r3, .L25+12
	mov	r2, #0
	str	r2, [r3]
	b	.L14
.L15:
	ldr	r1, .L25+4
	ldr	r0, .L25+16
	bl	pthread_cond_wait
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L14
	ldr	r0, .L25+20
	bl	perror
.L14:
	ldr	r3, .L25+24
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L15
	ldr	r3, .L25+24
	ldr	r3, [r3]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	ldr	r2, .L25+24
	str	r3, [r2]
	mov	r0, #0
	bl	time
	str	r0, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bge	.L16
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #8]
	ldr	r2, .L25+12
	str	r3, [r2]
	b	.L17
.L20:
	sub	r3, fp, #16
	mov	r2, r3
	ldr	r1, .L25+4
	ldr	r0, .L25+16
	bl	pthread_cond_timedwait
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #110
	bne	.L18
	mov	r3, #1
	str	r3, [fp, #-32]
	b	.L19
.L18:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L17
	ldr	r0, .L25+28
	bl	perror
.L17:
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #8]
	ldr	r3, .L25+12
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L20
.L19:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L21
	ldr	r0, [fp, #-24]
	bl	alarm_insert
	b	.L21
.L16:
	mov	r3, #1
	str	r3, [fp, #-32]
.L21:
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	beq	.L23
	ldr	r3, [fp, #-24]
	ldr	r1, [r3, #4]
	ldr	r3, [fp, #-24]
	add	r3, r3, #12
	mov	r2, r3
	ldr	r0, .L25+32
	bl	printf
	ldr	r0, [fp, #-24]
	bl	free
	b	.L23
.L26:
	.align	2
.L25:
	.word	.LC5
	.word	alarm_mutex
	.word	.LC1
	.word	current_alarm
	.word	alarm_cond
	.word	.LC2
	.word	alarm_list
	.word	.LC3
	.word	.LC4
	.size	alarm_thread, .-alarm_thread
	.section	.rodata
	.align	2
.LC6:
	.ascii	"pthread_create\000"
	.align	2
.LC7:
	.ascii	"Alarm> \000"
	.align	2
.LC8:
	.ascii	"malloc\000"
	.align	2
.LC9:
	.ascii	"%d %64[^\012]\000"
	.align	2
.LC10:
	.ascii	"Bad command\012\000"
	.align	2
.LC11:
	.ascii	"pthread_mutex_unlock\000"
	.align	2
.LC12:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #152
	str	r0, [fp, #-152]
	str	r1, [fp, #-156]
	ldr	r3, .L38
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r0, fp, #148
	mov	r3, #0
	ldr	r2, .L38+4
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-144]
	ldr	r3, [fp, #-144]
	cmp	r3, #0
	beq	.L35
	ldr	r0, .L38+8
	bl	perror
.L35:
	ldr	r0, .L38+12
	bl	printf
	ldr	r3, .L38+16
	ldr	r2, [r3]
	sub	r3, fp, #136
	mov	r1, #128
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L29
	mov	r0, #0
	bl	exit
.L29:
	sub	r3, fp, #136
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	cmp	r3, #1
	bls	.L37
	mov	r0, #76
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-140]
	ldr	r3, [fp, #-140]
	cmp	r3, #0
	bne	.L32
	ldr	r0, .L38+20
	bl	perror
.L32:
	ldr	r3, [fp, #-140]
	add	r2, r3, #4
	ldr	r3, [fp, #-140]
	add	r3, r3, #12
	sub	r0, fp, #136
	ldr	r1, .L38+24
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #1
	bgt	.L33
	ldr	r3, .L38+28
	ldr	r3, [r3]
	mov	r2, #12
	mov	r1, #1
	ldr	r0, .L38+32
	bl	fwrite
	ldr	r0, [fp, #-140]
	bl	free
	b	.L35
.L33:
	ldr	r0, .L38+36
	bl	pthread_mutex_lock
	str	r0, [fp, #-144]
	ldr	r3, [fp, #-144]
	cmp	r3, #0
	beq	.L34
	ldr	r0, .L38+40
	bl	perror
.L34:
	mov	r0, #0
	bl	time
	mov	r2, r0
	ldr	r3, [fp, #-140]
	ldr	r3, [r3, #4]
	add	r2, r2, r3
	ldr	r3, [fp, #-140]
	str	r2, [r3, #8]
	ldr	r0, [fp, #-140]
	bl	alarm_insert
	ldr	r0, .L38+36
	bl	pthread_mutex_unlock
	str	r0, [fp, #-144]
	ldr	r3, [fp, #-144]
	cmp	r3, #0
	beq	.L35
	ldr	r0, .L38+44
	bl	perror
	b	.L35
.L37:
	nop
	b	.L35
.L39:
	.align	2
.L38:
	.word	.LC12
	.word	alarm_thread
	.word	.LC6
	.word	.LC7
	.word	stdin
	.word	.LC8
	.word	.LC9
	.word	stderr
	.word	.LC10
	.word	alarm_mutex
	.word	.LC1
	.word	.LC11
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
