	.file	"553480.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Number of elements: "
.LC1:
	.string	"%d"
.LC2:
	.string	"Enter element %d: "
	.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
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 72
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	rbx, rax
	mov	DWORD PTR -100[rbp], 0
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -100[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -100[rbp]
	movsx	rdx, eax
	sub	rdx, 1
	mov	QWORD PTR -80[rbp], rdx
	movsx	rdx, eax
	mov	r14, rdx
	mov	r15d, 0
	movsx	rdx, eax
	mov	r12, rdx
	mov	r13d, 0
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	ecx, 16
	mov	edx, 0
	div	rcx
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L2:
	cmp	rsp, rdx
	je	.L3
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L2
.L3:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L4
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L4:
	mov	rax, rsp
	add	rax, 3
	shr	rax, 2
	sal	rax, 2
	mov	QWORD PTR -72[rbp], rax
	mov	DWORD PTR -92[rbp], 0
	jmp	.L5
.L6:
	mov	eax, DWORD PTR -92[rbp]
	add	eax, 1
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -92[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	add	DWORD PTR -92[rbp], 1
.L5:
	mov	eax, DWORD PTR -100[rbp]
	cmp	DWORD PTR -92[rbp], eax
	jl	.L6
	mov	rax, QWORD PTR -72[rbp]
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	createNode
	mov	QWORD PTR -88[rbp], rax
	mov	rax, QWORD PTR -88[rbp]
	mov	BYTE PTR 4[rax], 98
	mov	DWORD PTR -96[rbp], 1
	jmp	.L7
.L8:
	mov	rax, QWORD PTR -72[rbp]
	mov	edx, DWORD PTR -96[rbp]
	movsx	rdx, edx
	mov	edx, DWORD PTR [rax+rdx*4]
	mov	rax, QWORD PTR -88[rbp]
	mov	esi, edx
	mov	rdi, rax
	call	treeInsert
	mov	QWORD PTR -64[rbp], rax
	mov	rdx, QWORD PTR -64[rbp]
	mov	rax, QWORD PTR -88[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	fixRBT
	mov	QWORD PTR -88[rbp], rax
	add	DWORD PTR -96[rbp], 1
.L7:
	mov	eax, DWORD PTR -100[rbp]
	cmp	DWORD PTR -96[rbp], eax
	jl	.L8
	mov	rax, QWORD PTR -88[rbp]
	mov	rdi, rax
	call	printTree
	mov	rsp, rbx
	mov	eax, 0
	mov	rbx, QWORD PTR -56[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	createNode
	.type	createNode, @function
createNode:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	edi, 32
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR -20[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 16[rax], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	QWORD PTR 24[rax], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 4[rax], 114
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	createNode, .-createNode
	.globl	treeInsert
	.type	treeInsert, @function
treeInsert:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	createNode
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 4[rax], 114
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L14
.L18:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jge	.L15
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	test	rax, rax
	jne	.L16
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 24[rax], rdx
	mov	QWORD PTR -16[rbp], 0
	jmp	.L14
.L16:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L14
.L15:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 16[rax]
	test	rax, rax
	jne	.L17
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR 16[rax], rdx
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 24[rax], rdx
	mov	QWORD PTR -16[rbp], 0
	jmp	.L14
.L17:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -16[rbp], rax
.L14:
	cmp	QWORD PTR -16[rbp], 0
	jne	.L18
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	treeInsert, .-treeInsert
	.section	.rodata
.LC3:
	.string	"%d, color: %c\n"
	.text
	.globl	printTree
	.type	printTree, @function
printTree:
.LFB9:
	.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	QWORD PTR -8[rbp], rdi
	cmp	QWORD PTR -8[rbp], 0
	jne	.L21
	mov	eax, 0
	jmp	.L22
.L21:
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rdi, rax
	call	printTree
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR 4[rax]
	movsx	edx, al
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	rdi, rax
	call	printTree
	mov	eax, 1
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	printTree, .-printTree
	.globl	fixRBT
	.type	fixRBT, @function
fixRBT:
.LFB10:
	.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	QWORD PTR -32[rbp], rsi
	jmp	.L24
.L32:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR 24[rax]
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 8[rax]
	cmp	rdx, rax
	jne	.L25
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L26
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR 4[rax]
	cmp	al, 114
	jne	.L26
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	BYTE PTR 4[rax], 98
	mov	rax, QWORD PTR -8[rbp]
	mov	BYTE PTR 4[rax], 98
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	BYTE PTR 4[rax], 114
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	QWORD PTR -32[rbp], rax
	jmp	.L24
.L26:
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 16[rax]
	cmp	QWORD PTR -32[rbp], rax
	jne	.L28
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	QWORD PTR -32[rbp], rax
	mov	rcx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 108
	mov	rsi, rcx
	mov	rdi, rax
	call	rotate
	mov	QWORD PTR -24[rbp], rax
.L28:
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	BYTE PTR 4[rax], 98
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	BYTE PTR 4[rax], 114
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rcx, QWORD PTR 24[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 114
	mov	rsi, rcx
	mov	rdi, rax
	call	rotate
	mov	QWORD PTR -24[rbp], rax
	jmp	.L24
.L25:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR 24[rax]
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 16[rax]
	cmp	rdx, rax
	jne	.L24
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L29
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR 4[rax]
	cmp	al, 114
	jne	.L29
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	BYTE PTR 4[rax], 98
	mov	rax, QWORD PTR -16[rbp]
	mov	BYTE PTR 4[rax], 98
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	BYTE PTR 4[rax], 114
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	QWORD PTR -32[rbp], rax
	jmp	.L24
.L29:
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 8[rax]
	cmp	QWORD PTR -32[rbp], rax
	jne	.L30
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	QWORD PTR -32[rbp], rax
	mov	rcx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 114
	mov	rsi, rcx
	mov	rdi, rax
	call	rotate
	mov	QWORD PTR -24[rbp], rax
.L30:
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	BYTE PTR 4[rax], 98
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rax, QWORD PTR 24[rax]
	mov	BYTE PTR 4[rax], 114
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rcx, QWORD PTR 24[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 108
	mov	rsi, rcx
	mov	rdi, rax
	call	rotate
	mov	QWORD PTR -24[rbp], rax
.L24:
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	test	rax, rax
	je	.L31
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	movzx	eax, BYTE PTR 4[rax]
	cmp	al, 114
	je	.L32
.L31:
	mov	rax, QWORD PTR -24[rbp]
	mov	BYTE PTR 4[rax], 98
	mov	rax, QWORD PTR -24[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	fixRBT, .-fixRBT
	.globl	rotate
	.type	rotate, @function
rotate:
.LFB11:
	.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 -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	eax, edx
	mov	BYTE PTR -36[rbp], al
	mov	BYTE PTR -1[rbp], 0
	mov	rax, QWORD PTR -32[rbp]
	cmp	rax, QWORD PTR -24[rbp]
	jne	.L35
	mov	BYTE PTR -1[rbp], 1
.L35:
	cmp	BYTE PTR -36[rbp], 108
	jne	.L36
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	leftRotate
.L36:
	cmp	BYTE PTR -36[rbp], 114
	jne	.L37
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	rightRotate
.L37:
	cmp	BYTE PTR -1[rbp], 0
	je	.L38
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	QWORD PTR -24[rbp], rax
.L38:
	mov	rax, QWORD PTR -24[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	rotate, .-rotate
	.globl	leftRotate
	.type	leftRotate, @function
leftRotate:
.LFB12:
	.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	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L45
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 16[rax]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR 16[rax], rdx
	cmp	QWORD PTR -8[rbp], 0
	je	.L42
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 24[rax], rdx
.L42:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 24[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 24[rax], rdx
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 24[rax]
	test	rax, rax
	je	.L43
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jle	.L44
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 16[rax], rdx
	jmp	.L43
.L44:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], rdx
.L43:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 24[rax], rdx
.L45:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	leftRotate, .-leftRotate
	.globl	rightRotate
	.type	rightRotate, @function
rightRotate:
.LFB13:
	.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	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	je	.L51
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	mov	QWORD PTR 8[rax], rdx
	cmp	QWORD PTR -8[rbp], 0
	je	.L48
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 24[rax], rdx
.L48:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 24[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 24[rax], rdx
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 24[rax]
	test	rax, rax
	je	.L49
	mov	rax, QWORD PTR -16[rbp]
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	eax, DWORD PTR [rax]
	cmp	edx, eax
	jle	.L50
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 16[rax], rdx
	jmp	.L49
.L50:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], rdx
.L49:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 16[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	QWORD PTR 24[rax], rdx
.L51:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	rightRotate, .-rightRotate
	.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	"553480.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Number of elements: \000"
	.align	2
.LC1:
	.ascii	"%d\000"
	.align	2
.LC2:
	.ascii	"Enter element %d: \000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r4, r3
	mov	r3, #0
	str	r3, [fp, #-44]
	ldr	r0, .L8+4
	bl	printf
	sub	r3, fp, #44
	mov	r1, r3
	ldr	r0, .L8+8
	bl	__isoc99_scanf
	ldr	ip, [fp, #-44]
	sub	r3, ip, #1
	str	r3, [fp, #-28]
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #5
	orr	r3, r3, r0, lsr #27
	lsl	r2, r0, #5
	mov	r3, ip
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #3
	lsr	r3, r3, #2
	lsl	r3, r3, #2
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L2
.L3:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, .L8+12
	bl	printf
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-24]
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, .L8+8
	bl	__isoc99_scanf
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L2:
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-32]
	cmp	r2, r3
	blt	.L3
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	mov	r0, r3
	bl	createNode
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	mov	r2, #98
	strb	r2, [r3, #4]
	mov	r3, #1
	str	r3, [fp, #-40]
	b	.L4
.L5:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-40]
	ldr	r3, [r3, r2, lsl #2]
	mov	r1, r3
	ldr	r0, [fp, #-36]
	bl	treeInsert
	str	r0, [fp, #-20]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-36]
	bl	fixRBT
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-40]
	add	r3, r3, #1
	str	r3, [fp, #-40]
.L4:
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-40]
	cmp	r2, r3
	blt	.L5
	ldr	r0, [fp, #-36]
	bl	printTree
	mov	sp, r4
	mov	r3, #0
	ldr	r2, .L8
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	main, .-main
	.align	2
	.global	createNode
	.syntax unified
	.arm
	.fpu softvfp
	.type	createNode, %function
createNode:
	@ 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]
	mov	r0, #20
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r3]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #12]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3, #16]
	ldr	r3, [fp, #-8]
	mov	r2, #114
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	createNode, .-createNode
	.align	2
	.global	treeInsert
	.syntax unified
	.arm
	.fpu softvfp
	.type	treeInsert, %function
treeInsert:
	@ 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, [fp, #-20]
	bl	createNode
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r2, #114
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
	b	.L13
.L17:
	ldr	r3, [fp, #-8]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	cmp	r2, r3
	bge	.L14
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	bne	.L15
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	str	r2, [r3, #16]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L13
.L15:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-12]
	b	.L13
.L14:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #12]
	cmp	r3, #0
	bne	.L16
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	str	r2, [r3, #12]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	str	r2, [r3, #16]
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L13
.L16:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #12]
	str	r3, [fp, #-12]
.L13:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L17
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	treeInsert, .-treeInsert
	.section	.rodata
	.align	2
.LC4:
	.ascii	"%d, color: %c\012\000"
	.text
	.align	2
	.global	printTree
	.syntax unified
	.arm
	.fpu softvfp
	.type	printTree, %function
printTree:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L20
	mov	r3, #0
	b	.L21
.L20:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	printTree
	ldr	r3, [fp, #-8]
	ldr	r1, [r3]
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3, #4]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r0, .L22
	bl	printf
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #12]
	mov	r0, r3
	bl	printTree
	mov	r3, #1
.L21:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC4
	.size	printTree, .-printTree
	.align	2
	.global	fixRBT
	.syntax unified
	.arm
	.fpu softvfp
	.type	fixRBT, %function
fixRBT:
	@ 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]
	b	.L25
.L33:
	ldr	r3, [fp, #-20]
	ldr	r2, [r3, #16]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #8]
	cmp	r2, r3
	bne	.L26
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #12]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L27
	ldr	r3, [fp, #-8]
	ldrb	r3, [r3, #4]	@ zero_extendqisi2
	cmp	r3, #114
	bne	.L27
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	mov	r2, #98
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-8]
	mov	r2, #98
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	mov	r2, #114
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-20]
	b	.L25
.L27:
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #12]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bne	.L29
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-20]
	mov	r2, #108
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	rotate
	str	r0, [fp, #-16]
.L29:
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	mov	r2, #98
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	mov	r2, #114
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	mov	r2, #114
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	rotate
	str	r0, [fp, #-16]
	b	.L25
.L26:
	ldr	r3, [fp, #-20]
	ldr	r2, [r3, #16]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #12]
	cmp	r2, r3
	bne	.L25
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L30
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3, #4]	@ zero_extendqisi2
	cmp	r3, #114
	bne	.L30
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	mov	r2, #98
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-12]
	mov	r2, #98
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	mov	r2, #114
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-20]
	b	.L25
.L30:
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #8]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bne	.L31
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-20]
	mov	r2, #114
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	rotate
	str	r0, [fp, #-16]
.L31:
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	mov	r2, #98
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	mov	r2, #114
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldr	r3, [r3, #16]
	mov	r2, #108
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	rotate
	str	r0, [fp, #-16]
.L25:
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	cmp	r3, #0
	beq	.L32
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	ldrb	r3, [r3, #4]	@ zero_extendqisi2
	cmp	r3, #114
	beq	.L33
.L32:
	ldr	r3, [fp, #-16]
	mov	r2, #98
	strb	r2, [r3, #4]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	fixRBT, .-fixRBT
	.align	2
	.global	rotate
	.syntax unified
	.arm
	.fpu softvfp
	.type	rotate, %function
rotate:
	@ 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, #-16]
	str	r1, [fp, #-20]
	mov	r3, r2
	strb	r3, [fp, #-21]
	mov	r3, #0
	strb	r3, [fp, #-5]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	bne	.L36
	mov	r3, #1
	strb	r3, [fp, #-5]
.L36:
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	cmp	r3, #108
	bne	.L37
	ldr	r0, [fp, #-20]
	bl	leftRotate
.L37:
	ldrb	r3, [fp, #-21]	@ zero_extendqisi2
	cmp	r3, #114
	bne	.L38
	ldr	r0, [fp, #-20]
	bl	rightRotate
.L38:
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L39
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #16]
	str	r3, [fp, #-16]
.L39:
	ldr	r3, [fp, #-16]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	rotate, .-rotate
	.align	2
	.global	leftRotate
	.syntax unified
	.arm
	.fpu softvfp
	.type	leftRotate, %function
leftRotate:
	@ 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]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #12]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L46
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #12]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	str	r2, [r3, #12]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L43
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r3, #16]
.L43:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #16]
	ldr	r3, [fp, #-12]
	str	r2, [r3, #16]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	cmp	r3, #0
	beq	.L44
	ldr	r3, [fp, #-12]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L45
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	ldr	r2, [fp, #-12]
	str	r2, [r3, #12]
	b	.L44
.L45:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	ldr	r2, [fp, #-12]
	str	r2, [r3, #8]
.L44:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-16]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	str	r2, [r3, #16]
.L46:
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	leftRotate, .-leftRotate
	.align	2
	.global	rightRotate
	.syntax unified
	.arm
	.fpu softvfp
	.type	rightRotate, %function
rightRotate:
	@ 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]
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #8]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L52
	ldr	r3, [fp, #-16]
	ldr	r3, [r3, #8]
	ldr	r3, [r3, #12]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L49
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-16]
	str	r2, [r3, #16]
.L49:
	ldr	r3, [fp, #-16]
	ldr	r2, [r3, #16]
	ldr	r3, [fp, #-12]
	str	r2, [r3, #16]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	cmp	r3, #0
	beq	.L50
	ldr	r3, [fp, #-12]
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	ldr	r3, [r3]
	cmp	r2, r3
	ble	.L51
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	ldr	r2, [fp, #-12]
	str	r2, [r3, #12]
	b	.L50
.L51:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3, #16]
	ldr	r2, [fp, #-12]
	str	r2, [r3, #8]
.L50:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-16]
	str	r2, [r3, #12]
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-12]
	str	r2, [r3, #16]
.L52:
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	rightRotate, .-rightRotate
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
