	.file	"595889.c"
	.intel_syntax noprefix
	.text
	.globl	stack
	.bss
	.align 32
	.type	stack, @object
	.size	stack, 16000
stack:
	.zero	16000
	.globl	top
	.data
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.long	-1
	.globl	tickets
	.bss
	.align 32
	.type	tickets, @object
	.size	tickets, 4000
tickets:
	.zero	4000
	.globl	t_top
	.data
	.align 4
	.type	t_top, @object
	.size	t_top, 4
t_top:
	.long	-1
	.globl	count
	.bss
	.align 32
	.type	count, @object
	.size	count, 8000
count:
	.zero	8000
	.globl	m
	.data
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.long	-1
	.section	.rodata
	.align 8
.LC0:
	.string	"\n\n##### LOTTERY SCHEDULING #####"
	.align 8
.LC1:
	.string	"Total number of process switch=%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.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, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 4096
	or	QWORD PTR [rsp], 0
	sub	rsp, 3840
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	lea	rdx, -12016[rbp]
	lea	rax, -12028[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	process_generator
	mov	eax, DWORD PTR -12028[rbp]
	lea	rdx, -12016[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	bubble_sort_2
	mov	eax, DWORD PTR -12028[rbp]
	lea	rdx, -12016[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	bubble_priority
	mov	DWORD PTR -12024[rbp], 100
	mov	eax, DWORD PTR -12028[rbp]
	lea	rdx, -12016[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	display_process
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	ecx, DWORD PTR -12028[rbp]
	mov	edx, DWORD PTR -12024[rbp]
	lea	rax, -12016[rbp]
	mov	esi, ecx
	mov	rdi, rax
	call	lottery_scheduler
	mov	DWORD PTR -12020[rbp], eax
	mov	eax, DWORD PTR -12020[rbp]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	call	display_count
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.string	"\n****TOTAL RUNNING TIME=%d*****\n"
.LC3:
	.string	"enrty_time=%d\texit_time=%d\n\n"
	.align 8
.LC4:
	.string	"enrty_time=%d\texit_time=%d PARTIALLY EXECUTED\n\n"
	.text
	.globl	lottery_scheduler
	.type	lottery_scheduler, @function
lottery_scheduler:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	DWORD PTR -48[rbp], edx
	mov	DWORD PTR -32[rbp], 0
	mov	eax, DWORD PTR -48[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -20[rbp], 0
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR -16[rbp], eax
	mov	DWORD PTR -28[rbp], 0
	jmp	.L5
.L12:
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR 4[rax]
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rcx, 1[rax]
	mov	rax, rcx
	add	rax, rax
	add	rax, rcx
	sal	rax, 2
	mov	rcx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR 4[rax]
	cmp	edx, eax
	je	.L6
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	sub	eax, 1
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -24[rbp], eax
	jmp	.L7
.L8:
	mov	eax, DWORD PTR -24[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR -24[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	add	rax, rax
	add	rax, rcx
	sal	rax, 2
	mov	rcx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rcx
	mov	ecx, DWORD PTR 4[rax]
	mov	eax, DWORD PTR -24[rbp]
	movsx	rsi, eax
	mov	rax, rsi
	add	rax, rax
	add	rax, rsi
	sal	rax, 2
	mov	rsi, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rsi
	mov	eax, DWORD PTR [rax]
	mov	esi, ecx
	mov	edi, eax
	call	push
	add	DWORD PTR -24[rbp], 1
.L7:
	mov	eax, DWORD PTR -24[rbp]
	cmp	eax, DWORD PTR -28[rbp]
	jle	.L8
	jmp	.L9
.L11:
	mov	eax, 0
	call	lottery_s
	mov	DWORD PTR -4[rbp], eax
	add	DWORD PTR -32[rbp], 1
	mov	edx, DWORD PTR -16[rbp]
	mov	eax, DWORD PTR -4[rbp]
	add	edx, eax
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4[rbp]
	add	DWORD PTR -16[rbp], eax
.L9:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jg	.L10
	mov	eax, DWORD PTR top[rip]
	cmp	eax, -1
	je	.L10
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -48[rbp]
	jle	.L11
.L10:
	mov	eax, DWORD PTR -28[rbp]
	add	eax, 1
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	cmp	DWORD PTR -16[rbp], eax
	cmovge	eax, DWORD PTR -16[rbp]
	mov	DWORD PTR -16[rbp], eax
.L6:
	add	DWORD PTR -28[rbp], 1
.L5:
	mov	eax, DWORD PTR -44[rbp]
	sub	eax, 1
	cmp	DWORD PTR -28[rbp], eax
	jl	.L12
	jmp	.L13
.L14:
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR -20[rbp]
	movsx	rcx, eax
	mov	rax, rcx
	add	rax, rax
	add	rax, rcx
	sal	rax, 2
	mov	rcx, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rcx
	mov	ecx, DWORD PTR 4[rax]
	mov	eax, DWORD PTR -20[rbp]
	movsx	rsi, eax
	mov	rax, rsi
	add	rax, rax
	add	rax, rsi
	sal	rax, 2
	mov	rsi, rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rsi
	mov	eax, DWORD PTR [rax]
	mov	esi, ecx
	mov	edi, eax
	call	push
	add	DWORD PTR -20[rbp], 1
.L13:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, DWORD PTR -44[rbp]
	jl	.L14
	jmp	.L15
.L19:
	mov	eax, 0
	call	lottery_s
	mov	DWORD PTR -12[rbp], eax
	add	DWORD PTR -32[rbp], 1
	mov	edx, DWORD PTR -16[rbp]
	mov	eax, DWORD PTR -12[rbp]
	add	eax, edx
	cmp	DWORD PTR -48[rbp], eax
	jge	.L16
	mov	edx, DWORD PTR -48[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L17
.L16:
	mov	edx, DWORD PTR -16[rbp]
	mov	eax, DWORD PTR -12[rbp]
	add	edx, eax
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
.L17:
	mov	eax, DWORD PTR -12[rbp]
	add	DWORD PTR -16[rbp], eax
.L15:
	mov	eax, DWORD PTR top[rip]
	test	eax, eax
	js	.L18
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -48[rbp]
	jle	.L19
.L18:
	mov	eax, DWORD PTR -32[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	lottery_scheduler, .-lottery_scheduler
	.globl	search
	.type	search, @function
search:
.LFB8:
	.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 -20[rbp], edi
	mov	DWORD PTR -8[rbp], -1
	mov	DWORD PTR -8[rbp], 0
	jmp	.L22
.L25:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, tickets[rip]
	mov	eax, DWORD PTR [rdx+rax]
	cmp	DWORD PTR -20[rbp], eax
	jg	.L23
	mov	eax, DWORD PTR -8[rbp]
	mov	DWORD PTR -4[rbp], eax
	jmp	.L24
.L23:
	add	DWORD PTR -8[rbp], 1
.L22:
	mov	eax, DWORD PTR t_top[rip]
	cmp	DWORD PTR -8[rbp], eax
	jle	.L25
.L24:
	mov	eax, DWORD PTR -8[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	search, .-search
	.globl	process_generator
	.type	process_generator, @function
process_generator:
.LFB9:
	.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, 40
	.cfi_offset 3, -24
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	call	rand@PLT
	mov	edx, eax
	movsx	rax, edx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	esi, edx
	sar	esi, 31
	sub	eax, esi
	mov	ecx, eax
	mov	eax, ecx
	sal	eax, 2
	add	eax, ecx
	add	eax, eax
	mov	ecx, edx
	sub	ecx, eax
	lea	edx, 1[rcx]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], edx
	mov	DWORD PTR -20[rbp], 0
	jmp	.L28
.L29:
	call	rand@PLT
	mov	ecx, eax
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	lea	rsi, [rdx+rax]
	movsx	rax, ecx
	imul	rax, rax, 1717986919
	shr	rax, 32
	sar	eax, 2
	mov	edi, ecx
	sar	edi, 31
	sub	eax, edi
	mov	edx, eax
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	sub	ecx, eax
	mov	edx, ecx
	mov	DWORD PTR 4[rsi], edx
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	lea	rbx, [rdx+rax]
	call	rand@PLT
	mov	DWORD PTR 8[rbx], eax
	add	DWORD PTR -20[rbp], 1
.L28:
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L29
	nop
	nop
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	process_generator, .-process_generator
	.globl	bubble_sort_2
	.type	bubble_sort_2, @function
bubble_sort_2:
.LFB10:
	.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 -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -12[rbp], 0
	jmp	.L31
.L35:
	mov	DWORD PTR -8[rbp], 0
	jmp	.L32
.L34:
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR 4[rax]
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rcx, 1[rax]
	mov	rax, rcx
	add	rax, rax
	add	rax, rcx
	sal	rax, 2
	mov	rcx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR 4[rax]
	cmp	edx, eax
	jle	.L33
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR 4[rcx]
	mov	DWORD PTR 4[rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR 4[rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR [rcx]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 8[rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR 8[rcx]
	mov	DWORD PTR 8[rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR 8[rdx], eax
.L33:
	add	DWORD PTR -8[rbp], 1
.L32:
	mov	eax, DWORD PTR -20[rbp]
	sub	eax, DWORD PTR -12[rbp]
	sub	eax, 1
	cmp	DWORD PTR -8[rbp], eax
	jl	.L34
	add	DWORD PTR -12[rbp], 1
.L31:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L35
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	bubble_sort_2, .-bubble_sort_2
	.globl	bubble_priority
	.type	bubble_priority, @function
bubble_priority:
.LFB11:
	.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 -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -8[rbp], 0
	mov	DWORD PTR -20[rbp], 0
	jmp	.L37
.L44:
	mov	eax, DWORD PTR -20[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR 4[rax]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rcx, 1[rax]
	mov	rax, rcx
	add	rax, rax
	add	rax, rcx
	sal	rax, 2
	mov	rcx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR 4[rax]
	cmp	edx, eax
	je	.L38
	mov	eax, DWORD PTR -8[rbp]
	mov	DWORD PTR -16[rbp], eax
	jmp	.L39
.L43:
	mov	eax, DWORD PTR -8[rbp]
	mov	DWORD PTR -12[rbp], eax
	jmp	.L40
.L42:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rcx, 1[rax]
	mov	rax, rcx
	add	rax, rax
	add	rax, rcx
	sal	rax, 2
	mov	rcx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	eax, DWORD PTR 8[rax]
	cmp	edx, eax
	jle	.L41
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 4[rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR 4[rcx]
	mov	DWORD PTR 4[rdx], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR 4[rdx], eax
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR [rcx]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	eax, DWORD PTR 8[rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR 8[rcx]
	mov	DWORD PTR 8[rdx], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 1[rax]
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	add	rdx, rax
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR 8[rdx], eax
.L41:
	add	DWORD PTR -12[rbp], 1
.L40:
	mov	eax, DWORD PTR -20[rbp]
	sub	eax, DWORD PTR -16[rbp]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L42
	add	DWORD PTR -16[rbp], 1
.L39:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jle	.L43
	mov	eax, DWORD PTR -20[rbp]
	add	eax, 1
	mov	DWORD PTR -8[rbp], eax
.L38:
	add	DWORD PTR -20[rbp], 1
.L37:
	mov	eax, DWORD PTR -36[rbp]
	sub	eax, 1
	cmp	DWORD PTR -20[rbp], eax
	jl	.L44
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	bubble_priority, .-bubble_priority
	.section	.rodata
	.align 8
.LC5:
	.string	"process_no\tarrival_timec\tPriority"
.LC6:
	.string	"%d\t\t%d\t\t%d\n"
	.text
	.globl	display_process
	.type	display_process, @function
display_process:
.LFB12:
	.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	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L46
.L47:
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	ecx, DWORD PTR 8[rax]
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	add	rax, rax
	add	rax, rdx
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR 4[rax]
	mov	eax, DWORD PTR -4[rbp]
	movsx	rsi, eax
	mov	rax, rsi
	add	rax, rax
	add	rax, rsi
	sal	rax, 2
	mov	rsi, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rsi
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -4[rbp], 1
.L46:
	mov	eax, DWORD PTR -4[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L47
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	display_process, .-display_process
	.globl	push
	.type	push, @function
push:
.LFB13:
	.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 -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	DWORD PTR -12[rbp], edx
	mov	eax, DWORD PTR top[rip]
	add	eax, 1
	mov	DWORD PTR top[rip], eax
	mov	eax, DWORD PTR top[rip]
	cdqe
	sal	rax, 4
	mov	rcx, rax
	lea	rdx, stack[rip]
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR top[rip]
	cdqe
	sal	rax, 4
	mov	rcx, rax
	lea	rdx, stack[rip+4]
	mov	eax, DWORD PTR -8[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR top[rip]
	cdqe
	sal	rax, 4
	mov	rcx, rax
	lea	rdx, stack[rip+8]
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	push, .-push
	.section	.rodata
.LC7:
	.string	"\n****ERROR ENCOUNTERED*****"
	.align 8
.LC8:
	.string	"Running ~ Process id: %d for %d sec\n"
	.text
	.globl	lottery_s
	.type	lottery_s, @function
lottery_s:
.LFB14:
	.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	eax, DWORD PTR top[rip]
	test	eax, eax
	jne	.L50
	mov	DWORD PTR -8[rbp], 0
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -24[rbp], eax
	mov	DWORD PTR -20[rbp], 2
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip+8]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR top[rip]
	sub	eax, 1
	mov	DWORD PTR top[rip], eax
	jmp	.L51
.L50:
	mov	eax, 0
	call	sort_stack
	mov	eax, 0
	call	assign_tickets
	mov	DWORD PTR -12[rbp], eax
	call	rand@PLT
	cdq
	idiv	DWORD PTR -12[rbp]
	mov	eax, edx
	add	eax, 1
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	mov	edi, eax
	call	search
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L52
	lea	rdi, .LC7[rip]
	call	puts@PLT
.L52:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -24[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip+8]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -16[rbp], eax
	mov	DWORD PTR -20[rbp], 2
.L51:
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, count[rip]
	mov	eax, DWORD PTR [rdx+rax]
	lea	ecx, 1[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, count[rip]
	mov	DWORD PTR [rdx+rax], ecx
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	lea	rdx, count[rip+4]
	mov	eax, DWORD PTR -16[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -20[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	lottery_s, .-lottery_s
	.globl	assign_tickets
	.type	assign_tickets, @function
assign_tickets:
.LFB15:
	.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 -4[rbp], 0
	mov	DWORD PTR -8[rbp], 0
	jmp	.L55
.L56:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip+8]
	mov	eax, DWORD PTR [rdx+rax]
	add	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR t_top[rip]
	add	eax, 1
	mov	DWORD PTR t_top[rip], eax
	mov	eax, DWORD PTR t_top[rip]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rdx, tickets[rip]
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	add	DWORD PTR -8[rbp], 1
.L55:
	mov	eax, DWORD PTR top[rip]
	cmp	DWORD PTR -8[rbp], eax
	jle	.L56
	mov	eax, DWORD PTR -4[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	assign_tickets, .-assign_tickets
	.globl	sort_stack
	.type	sort_stack, @function
sort_stack:
.LFB16:
	.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 -12[rbp], 0
	jmp	.L59
.L63:
	mov	DWORD PTR -8[rbp], 0
	jmp	.L60
.L62:
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip+8]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -8[rbp]
	add	eax, 1
	cdqe
	sal	rax, 4
	mov	rcx, rax
	lea	rax, stack[rip+8]
	mov	eax, DWORD PTR [rcx+rax]
	cmp	edx, eax
	jle	.L61
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip+8]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	add	eax, 1
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip+8]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -8[rbp]
	movsx	rdx, edx
	mov	rcx, rdx
	sal	rcx, 4
	lea	rdx, stack[rip+8]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	add	eax, 1
	cdqe
	sal	rax, 4
	mov	rcx, rax
	lea	rdx, stack[rip+8]
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip+4]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	add	eax, 1
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip+4]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -8[rbp]
	movsx	rdx, edx
	mov	rcx, rdx
	sal	rcx, 4
	lea	rdx, stack[rip+4]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	add	eax, 1
	cdqe
	sal	rax, 4
	mov	rcx, rax
	lea	rdx, stack[rip+4]
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	add	eax, 1
	cdqe
	sal	rax, 4
	mov	rdx, rax
	lea	rax, stack[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -8[rbp]
	movsx	rdx, edx
	mov	rcx, rdx
	sal	rcx, 4
	lea	rdx, stack[rip]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -8[rbp]
	add	eax, 1
	cdqe
	sal	rax, 4
	mov	rcx, rax
	lea	rdx, stack[rip]
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rcx+rdx], eax
.L61:
	add	DWORD PTR -8[rbp], 1
.L60:
	mov	eax, DWORD PTR top[rip]
	sub	eax, DWORD PTR -12[rbp]
	cmp	DWORD PTR -8[rbp], eax
	jl	.L62
	add	DWORD PTR -12[rbp], 1
.L59:
	mov	eax, DWORD PTR top[rip]
	cmp	DWORD PTR -12[rbp], eax
	jle	.L63
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE16:
	.size	sort_stack, .-sort_stack
	.section	.rodata
.LC9:
	.string	"\n\n#### ANALYSIS####"
	.align 8
.LC10:
	.string	"Process ID-->%d Sheduled %d times; Priority-->%d\n"
	.text
	.globl	display_count
	.type	display_count, @function
display_count:
.LFB17:
	.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
	lea	rdi, .LC9[rip]
	call	puts@PLT
	mov	DWORD PTR -4[rbp], 0
	jmp	.L65
.L67:
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, count[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	je	.L66
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, count[rip+4]
	mov	ecx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, count[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
.L66:
	add	DWORD PTR -4[rbp], 1
.L65:
	cmp	DWORD PTR -4[rbp], 999
	jle	.L67
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE17:
	.size	display_count, .-display_count
	.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	"595889.c"
	.text
	.comm	stack,16000,4
	.global	top
	.data
	.align	2
	.type	top, %object
	.size	top, 4
top:
	.word	-1
	.comm	tickets,4000,4
	.global	t_top
	.align	2
	.type	t_top, %object
	.size	t_top, 4
t_top:
	.word	-1
	.global	count
	.bss
	.align	2
	.type	count, %object
	.size	count, 8000
count:
	.space	8000
	.global	m
	.data
	.align	2
	.type	m, %object
	.size	m, 4
m:
	.word	-1
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012\012##### LOTTERY SCHEDULING #####\000"
	.align	2
.LC1:
	.ascii	"Total number of process switch=%d\012\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 12016
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #11968
	sub	sp, sp, #52
	ldr	r3, .L4
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	sub	r2, fp, #11968
	sub	r2, r2, #12
	sub	r2, r2, #36
	sub	r3, fp, #11968
	sub	r3, r3, #12
	sub	r3, r3, #48
	mov	r1, r2
	mov	r0, r3
	bl	process_generator
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r3, #-3824]
	sub	r3, fp, #11968
	sub	r3, r3, #12
	sub	r3, r3, #36
	mov	r1, r3
	mov	r0, r2
	bl	bubble_sort_2
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r3, #-3824]
	sub	r3, fp, #11968
	sub	r3, r3, #12
	sub	r3, r3, #36
	mov	r1, r3
	mov	r0, r2
	bl	bubble_priority
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	mov	r3, #100
	str	r3, [r2, #-3820]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r2, [r3, #-3824]
	sub	r3, fp, #11968
	sub	r3, r3, #12
	sub	r3, r3, #36
	mov	r1, r3
	mov	r0, r2
	bl	display_process
	ldr	r0, .L4+4
	bl	puts
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r1, [r3, #-3824]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r4, r3
	sub	r3, fp, #8192
	sub	r3, r3, #12
	mov	r2, r3
	sub	r3, fp, #11968
	sub	r3, r3, #12
	sub	r3, r3, #36
	ldr	r2, [r2, #-3820]
	mov	r0, r3
	bl	lottery_scheduler
	str	r0, [r4, #-3816]
	sub	r3, fp, #8192
	sub	r3, r3, #12
	ldr	r1, [r3, #-3816]
	ldr	r0, .L4+8
	bl	printf
	bl	display_count
	mov	r3, #0
	ldr	r2, .L4
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L3
	bl	__stack_chk_fail
.L3:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.size	main, .-main
	.section	.rodata
	.align	2
.LC3:
	.ascii	"\012****TOTAL RUNNING TIME=%d*****\012\000"
	.align	2
.LC4:
	.ascii	"enrty_time=%d\011exit_time=%d\012\012\000"
	.align	2
.LC5:
	.ascii	"enrty_time=%d\011exit_time=%d PARTIALLY EXECUTED\012"
	.ascii	"\012\000"
	.text
	.align	2
	.global	lottery_scheduler
	.syntax unified
	.arm
	.fpu softvfp
	.type	lottery_scheduler, %function
lottery_scheduler:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	str	r2, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-36]
	ldr	r1, [fp, #-48]
	ldr	r0, .L23
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-40]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L7
.L14:
	ldr	r2, [fp, #-32]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	ldr	r1, [r3, #4]
	ldr	r3, [fp, #-32]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	ldr	r3, [r3, #4]
	cmp	r1, r3
	beq	.L8
	ldr	r3, [fp, #-32]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	ldr	r3, [r3, #4]
	sub	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-28]
	b	.L9
.L10:
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	ldr	r0, [r3]
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	ldr	r1, [r3, #4]
	ldr	r2, [fp, #-28]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	ldr	r3, [r3, #8]
	mov	r2, r3
	bl	push
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L9:
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	ble	.L10
	b	.L11
.L13:
	bl	lottery_s
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, .L23+4
	bl	printf
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-20]
.L11:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bgt	.L12
	ldr	r3, .L23+8
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L12
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	ble	.L13
.L12:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-32]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	movge	r3, r2
	movlt	r3, r3
	str	r3, [fp, #-20]
.L8:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L7:
	ldr	r3, [fp, #-44]
	sub	r3, r3, #1
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L14
	b	.L15
.L16:
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	ldr	r0, [r3]
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	ldr	r1, [r3, #4]
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-40]
	add	r3, r3, r2
	ldr	r3, [r3, #8]
	mov	r2, r3
	bl	push
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L15:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-44]
	cmp	r2, r3
	blt	.L16
	b	.L17
.L21:
	bl	lottery_s
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	ldr	r2, [fp, #-48]
	cmp	r2, r3
	bge	.L18
	ldr	r2, [fp, #-48]
	ldr	r1, [fp, #-20]
	ldr	r0, .L23+12
	bl	printf
	b	.L19
.L18:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, [fp, #-20]
	ldr	r0, .L23+4
	bl	printf
.L19:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-20]
.L17:
	ldr	r3, .L23+8
	ldr	r3, [r3]
	cmp	r3, #0
	blt	.L20
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-48]
	cmp	r2, r3
	ble	.L21
.L20:
	ldr	r3, [fp, #-36]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC3
	.word	.LC4
	.word	top
	.word	.LC5
	.size	lottery_scheduler, .-lottery_scheduler
	.align	2
	.global	search
	.syntax unified
	.arm
	.fpu softvfp
	.type	search, %function
search:
	@ 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]
	mvn	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L26
.L29:
	ldr	r2, .L31
	ldr	r3, [fp, #-12]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	bgt	.L27
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-8]
	b	.L28
.L27:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L26:
	ldr	r3, .L31+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	ble	.L29
.L28:
	ldr	r3, [fp, #-12]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L32:
	.align	2
.L31:
	.word	tickets
	.word	t_top
	.size	search, .-search
	.align	2
	.global	process_generator
	.syntax unified
	.arm
	.fpu softvfp
	.type	process_generator, %function
process_generator:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	bl	rand
	mov	r1, r0
	ldr	r3, .L36
	smull	r2, r3, r1, r3
	asr	r2, r3, #2
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	add	r2, r2, #1
	ldr	r3, [fp, #-24]
	str	r2, [r3]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L34
.L35:
	bl	rand
	mov	r1, r0
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r0, r3, r2
	ldr	r3, .L36
	smull	r2, r3, r1, r3
	asr	r2, r3, #2
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	str	r2, [r0, #4]
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r4, r3, r2
	bl	rand
	mov	r3, r0
	str	r3, [r4, #8]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L34:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L35
	nop
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L37:
	.align	2
.L36:
	.word	1717986919
	.size	process_generator, .-process_generator
	.align	2
	.global	bubble_sort_2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bubble_sort_2, %function
bubble_sort_2:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #28
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L39
.L43:
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L40
.L42:
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r1, [r3, #4]
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r3, [r3, #4]
	cmp	r1, r3
	ble	.L41
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r1, r3, r2
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r2, [r1, #4]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r2, [fp, #-8]
	str	r2, [r3, #4]
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r1, r3, r2
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r2, [r1]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r3, [r3, #8]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r1, r3, r2
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r2, [r1, #8]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-28]
	add	r3, r3, r2
	ldr	r2, [fp, #-8]
	str	r2, [r3, #8]
.L41:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L40:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	sub	r3, r2, r3
	sub	r3, r3, #1
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L42
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L39:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L43
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	bubble_sort_2, .-bubble_sort_2
	.align	2
	.global	bubble_priority
	.syntax unified
	.arm
	.fpu softvfp
	.type	bubble_priority, %function
bubble_priority:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #36
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L45
.L52:
	ldr	r2, [fp, #-24]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r1, [r3, #4]
	ldr	r3, [fp, #-24]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r3, [r3, #4]
	cmp	r1, r3
	beq	.L46
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-20]
	b	.L47
.L51:
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-16]
	b	.L48
.L50:
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r1, [r3, #8]
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r3, [r3, #8]
	cmp	r1, r3
	ble	.L49
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r1, r3, r2
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r2, [r1, #4]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r2, [fp, #-8]
	str	r2, [r3, #4]
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r1, r3, r2
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r2, [r1]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r2, [fp, #-8]
	str	r2, [r3]
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r3, [r3, #8]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r1, r3, r2
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r2, [r1, #8]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-36]
	add	r3, r3, r2
	ldr	r2, [fp, #-8]
	str	r2, [r3, #8]
.L49:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L48:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	blt	.L50
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L47:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	ble	.L51
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L46:
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L45:
	ldr	r3, [fp, #-32]
	sub	r3, r3, #1
	ldr	r2, [fp, #-24]
	cmp	r2, r3
	blt	.L52
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	bubble_priority, .-bubble_priority
	.section	.rodata
	.align	2
.LC6:
	.ascii	"process_no\011arrival_timec\011Priority\000"
	.align	2
.LC7:
	.ascii	"%d\011\011%d\011\011%d\012\000"
	.text
	.align	2
	.global	display_process
	.syntax unified
	.arm
	.fpu softvfp
	.type	display_process, %function
display_process:
	@ 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	r0, .L56
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L54
.L55:
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-20]
	add	r3, r3, r2
	ldr	r1, [r3]
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-20]
	add	r3, r3, r2
	ldr	r0, [r3, #4]
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-20]
	add	r3, r3, r2
	ldr	r3, [r3, #8]
	mov	r2, r0
	ldr	r0, .L56+4
	bl	printf
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L54:
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	blt	.L55
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L57:
	.align	2
.L56:
	.word	.LC6
	.word	.LC7
	.size	display_process, .-display_process
	.align	2
	.global	push
	.syntax unified
	.arm
	.fpu softvfp
	.type	push, %function
push:
	@ 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, #-8]
	str	r1, [fp, #-12]
	str	r2, [fp, #-16]
	ldr	r3, .L59
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L59
	str	r3, [r2]
	ldr	r3, .L59
	ldr	r3, [r3]
	ldr	r1, .L59+4
	ldr	r2, [fp, #-8]
	str	r2, [r1, r3, lsl #4]
	ldr	r3, .L59
	ldr	r3, [r3]
	ldr	r2, .L59+4
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	str	r2, [r3, #4]
	ldr	r3, .L59
	ldr	r3, [r3]
	ldr	r2, .L59+4
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-16]
	str	r2, [r3, #8]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L60:
	.align	2
.L59:
	.word	top
	.word	stack
	.size	push, .-push
	.global	__aeabi_idivmod
	.section	.rodata
	.align	2
.LC8:
	.ascii	"\012****ERROR ENCOUNTERED*****\000"
	.align	2
.LC9:
	.ascii	"Running ~ Process id: %d for %d sec\012\000"
	.text
	.align	2
	.global	lottery_s
	.syntax unified
	.arm
	.fpu softvfp
	.type	lottery_s, %function
lottery_s:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	ldr	r3, .L66
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L62
	mov	r3, #0
	str	r3, [fp, #-12]
	ldr	r2, .L66+4
	ldr	r3, [fp, #-12]
	ldr	r3, [r2, r3, lsl #4]
	str	r3, [fp, #-28]
	mov	r3, #2
	str	r3, [fp, #-24]
	ldr	r2, .L66+4
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	str	r3, [fp, #-20]
	ldr	r3, .L66
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, .L66
	str	r3, [r2]
	b	.L63
.L62:
	bl	sort_stack
	bl	assign_tickets
	str	r0, [fp, #-16]
	bl	rand
	mov	r3, r0
	ldr	r1, [fp, #-16]
	mov	r0, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r0, [fp, #-12]
	bl	search
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmn	r3, #1
	bne	.L64
	ldr	r0, .L66+8
	bl	puts
.L64:
	ldr	r2, .L66+4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #4]
	str	r3, [fp, #-28]
	ldr	r2, .L66+4
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	str	r3, [fp, #-20]
	mov	r3, #2
	str	r3, [fp, #-24]
.L63:
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-28]
	ldr	r0, .L66+12
	bl	printf
	ldr	r2, .L66+16
	ldr	r3, [fp, #-28]
	ldr	r3, [r2, r3, lsl #3]
	add	r2, r3, #1
	ldr	r1, .L66+16
	ldr	r3, [fp, #-28]
	str	r2, [r1, r3, lsl #3]
	ldr	r2, .L66+16
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r2, [fp, #-20]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-24]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L67:
	.align	2
.L66:
	.word	top
	.word	stack
	.word	.LC8
	.word	.LC9
	.word	count
	.size	lottery_s, .-lottery_s
	.align	2
	.global	assign_tickets
	.syntax unified
	.arm
	.fpu softvfp
	.type	assign_tickets, %function
assign_tickets:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	mov	r3, #0
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L69
.L70:
	ldr	r2, .L72
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	ldr	r2, [fp, #-8]
	add	r3, r2, r3
	str	r3, [fp, #-8]
	ldr	r3, .L72+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L72+4
	str	r3, [r2]
	ldr	r3, .L72+4
	ldr	r3, [r3]
	ldr	r1, .L72+8
	ldr	r2, [fp, #-8]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L69:
	ldr	r3, .L72+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	ble	.L70
	ldr	r3, [fp, #-8]
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L73:
	.align	2
.L72:
	.word	stack
	.word	t_top
	.word	tickets
	.word	top
	.size	assign_tickets, .-assign_tickets
	.align	2
	.global	sort_stack
	.syntax unified
	.arm
	.fpu softvfp
	.type	sort_stack, %function
sort_stack:
	@ 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, #-16]
	b	.L75
.L79:
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L76
.L78:
	ldr	r2, .L80
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r1, .L80
	lsl	r3, r3, #4
	add	r3, r1, r3
	ldr	r3, [r3, #8]
	cmp	r2, r3
	ble	.L77
	ldr	r2, .L80
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r2, .L80
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [r3, #8]
	ldr	r1, .L80
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	add	r3, r1, r3
	str	r2, [r3, #8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r2, .L80
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	str	r2, [r3, #8]
	ldr	r2, .L80
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r2, .L80
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [r3, #4]
	ldr	r1, .L80
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #4
	add	r3, r1, r3
	str	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r2, .L80
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [fp, #-8]
	str	r2, [r3, #4]
	ldr	r2, .L80
	ldr	r3, [fp, #-12]
	ldr	r3, [r2, r3, lsl #4]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r2, .L80
	ldr	r2, [r2, r3, lsl #4]
	ldr	r1, .L80
	ldr	r3, [fp, #-12]
	str	r2, [r1, r3, lsl #4]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r1, .L80
	ldr	r2, [fp, #-8]
	str	r2, [r1, r3, lsl #4]
.L77:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L76:
	ldr	r3, .L80+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	sub	r3, r2, r3
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L78
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L75:
	ldr	r3, .L80+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	ble	.L79
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L81:
	.align	2
.L80:
	.word	stack
	.word	top
	.size	sort_stack, .-sort_stack
	.section	.rodata
	.align	2
.LC10:
	.ascii	"\012\012#### ANALYSIS####\000"
	.align	2
.LC11:
	.ascii	"Process ID-->%d Sheduled %d times; Priority-->%d\012"
	.ascii	"\000"
	.text
	.align	2
	.global	display_count
	.syntax unified
	.arm
	.fpu softvfp
	.type	display_count, %function
display_count:
	@ 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	r0, .L86
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L83
.L85:
	ldr	r2, .L86+4
	ldr	r3, [fp, #-8]
	ldr	r3, [r2, r3, lsl #3]
	cmp	r3, #0
	beq	.L84
	ldr	r2, .L86+4
	ldr	r3, [fp, #-8]
	ldr	r2, [r2, r3, lsl #3]
	ldr	r1, .L86+4
	ldr	r3, [fp, #-8]
	lsl	r3, r3, #3
	add	r3, r1, r3
	ldr	r3, [r3, #4]
	ldr	r1, [fp, #-8]
	ldr	r0, .L86+8
	bl	printf
.L84:
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L83:
	ldr	r3, [fp, #-8]
	cmp	r3, #1000
	blt	.L85
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L87:
	.align	2
.L86:
	.word	.LC10
	.word	count
	.word	.LC11
	.size	display_count, .-display_count
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
