	.file	"mancala.c"
	.comm	board,48,32
	.comm	player,60,32
	.comm	playerScore,8,4
	.comm	it,4,4
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	getPlayerNames
.L2:
	movl	$0, %eax
	call	setUpGame
	movl	$0, %eax
	call	playGame
	movl	$0, %eax
	call	anotherGame
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC0:
	.string	"Enter first player's name: "
.LC1:
	.string	"%s"
.LC2:
	.string	"Enter second player's name: "
	.text
	.globl	getPlayerNames
	.type	getPlayerNames, @function
getPlayerNames:
.LFB1:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$.LC0, %edi
	movl	$0, %eax
	call	printf
	movl	$player, %esi
	movl	$.LC1, %edi
	movl	$0, %eax
	call	__isoc99_scanf
	movl	$.LC2, %edi
	movl	$0, %eax
	call	printf
	movl	$player+30, %esi
	movl	$.LC1, %edi
	movl	$0, %eax
	call	__isoc99_scanf
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	getPlayerNames, .-getPlayerNames
	.globl	setUpGame
	.type	setUpGame, @function
setUpGame:
.LFB2:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	jmp	.L6
.L7:
	movl	-4(%rbp), %eax
	cltq
	movl	$4, board(,%rax,4)
	addl	$1, -4(%rbp)
.L6:
	cmpl	$11, -4(%rbp)
	jle	.L7
	movl	$0, playerScore(%rip)
	movl	$0, playerScore+4(%rip)
	movl	$0, it(%rip)
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	setUpGame, .-setUpGame
	.globl	playGame
	.type	playGame, @function
playGame:
.LFB3:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
.L10:
	movl	$0, %eax
	call	displayBoard
	movl	$0, %eax
	call	pickHole
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	distributePebbles
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, %edi
	call	updateScore
	movl	it(%rip), %eax
	movl	$1, %edx
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	movl	%eax, it(%rip)
	movl	$0, %eax
	call	hopeless
	testl	%eax, %eax
	jne	.L9
	movl	$0, %eax
	call	outOfPebbles
	testl	%eax, %eax
	je	.L10
.L9:
	movl	$0, %eax
	call	declareWinner
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	playGame, .-playGame
	.section	.rodata
.LC3:
	.string	"\n"
.LC4:
	.string	"  1   2   3   4   5   6   "
.LC5:
	.string	"+---+---+---+---+---+---+ "
.LC6:
	.string	"|%3d"
.LC7:
	.string	"| "
.LC8:
	.string	" 12  11  10   9   8   7   "
.LC9:
	.string	"%s: %d     %s: %d \n"
	.text
	.globl	displayBoard
	.type	displayBoard, @function
displayBoard:
.LFB4:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$.LC3, %edi
	call	puts
	movl	$.LC4, %edi
	call	puts
	movl	$.LC5, %edi
	call	puts
	movl	$0, -4(%rbp)
	jmp	.L12
.L13:
	movl	-4(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	movl	%eax, %esi
	movl	$.LC6, %edi
	movl	$0, %eax
	call	printf
	addl	$1, -4(%rbp)
.L12:
	cmpl	$5, -4(%rbp)
	jle	.L13
	movl	$.LC7, %edi
	call	puts
	movl	$.LC5, %edi
	call	puts
	movl	$11, -4(%rbp)
	jmp	.L14
.L15:
	movl	-4(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	movl	%eax, %esi
	movl	$.LC6, %edi
	movl	$0, %eax
	call	printf
	subl	$1, -4(%rbp)
.L14:
	cmpl	$5, -4(%rbp)
	jg	.L15
	movl	$.LC7, %edi
	call	puts
	movl	$.LC5, %edi
	call	puts
	movl	$.LC8, %edi
	call	puts
	movl	$10, %edi
	call	putchar
	movl	playerScore+4(%rip), %edx
	movl	playerScore(%rip), %eax
	movl	%edx, %r8d
	movl	$player+30, %ecx
	movl	%eax, %edx
	movl	$player, %esi
	movl	$.LC9, %edi
	movl	$0, %eax
	call	printf
	movl	$.LC3, %edi
	call	puts
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	displayBoard, .-displayBoard
	.globl	hopeless
	.type	hopeless, @function
hopeless:
.LFB5:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	maxPebbleCount
	cmpl	$1, %eax
	jne	.L17
	movl	$0, %eax
	call	noneAdjacent
	testl	%eax, %eax
	je	.L17
	movl	$0, %eax
	call	bigGap
	testl	%eax, %eax
	je	.L17
	movl	$1, %eax
	jmp	.L18
.L17:
	movl	$0, %eax
.L18:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	hopeless, .-hopeless
	.globl	outOfPebbles
	.type	outOfPebbles, @function
outOfPebbles:
.LFB6:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	maxPebbleCount
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	outOfPebbles, .-outOfPebbles
	.globl	maxPebbleCount
	.type	maxPebbleCount, @function
maxPebbleCount:
.LFB7:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L23
.L25:
	movl	-4(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	cmpl	-8(%rbp), %eax
	jle	.L24
	movl	-4(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	movl	%eax, -8(%rbp)
.L24:
	addl	$1, -4(%rbp)
.L23:
	cmpl	$11, -4(%rbp)
	jle	.L25
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	maxPebbleCount, .-maxPebbleCount
	.globl	noneAdjacent
	.type	noneAdjacent, @function
noneAdjacent:
.LFB8:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L28
.L30:
	movl	-4(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	testl	%eax, %eax
	jle	.L29
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	$715827883, %edx
	movl	%ecx, %eax
	imull	%edx
	sarl	%edx
	movl	%ecx, %eax
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	sall	$2, %eax
	movl	%ecx, %edx
	subl	%eax, %edx
	movslq	%edx, %rax
	movl	board(,%rax,4), %eax
	testl	%eax, %eax
	jle	.L29
	movl	$1, -8(%rbp)
.L29:
	addl	$1, -4(%rbp)
.L28:
	cmpl	$11, -4(%rbp)
	jle	.L30
	cmpl	$0, -8(%rbp)
	sete	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	noneAdjacent, .-noneAdjacent
	.globl	bigGap
	.type	bigGap, @function
bigGap:
.LFB9:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L33
.L36:
	movl	-4(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	testl	%eax, %eax
	jne	.L34
	addl	$1, -8(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L35
	movl	-8(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L35
.L34:
	movl	$0, -8(%rbp)
.L35:
	addl	$1, -4(%rbp)
.L33:
	cmpl	$11, -4(%rbp)
	jle	.L36
	cmpl	$1, -12(%rbp)
	jg	.L37
	movl	board(%rip), %eax
	testl	%eax, %eax
	jne	.L38
	movl	board+44(%rip), %eax
	testl	%eax, %eax
	jne	.L38
.L37:
	movl	$1, %eax
	jmp	.L39
.L38:
	movl	$0, %eax
.L39:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	bigGap, .-bigGap
	.section	.rodata
.LC10:
	.string	"Choose your hole, 1-12, %s: "
.LC11:
	.string	"%d"
	.text
	.globl	pickHole
	.type	pickHole, @function
pickHole:
.LFB10:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	it(%rip), %eax
	cltq
	addq	%rax, %rax
	movq	%rax, %rdx
	salq	$4, %rdx
	subq	%rax, %rdx
	leaq	player(%rdx), %rax
	movq	%rax, %rsi
	movl	$.LC10, %edi
	movl	$0, %eax
	call	printf
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	movl	$.LC11, %edi
	movl	$0, %eax
	call	__isoc99_scanf
	movl	-4(%rbp), %eax
	subl	$1, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	pickHole, .-pickHole
	.globl	distributePebbles
	.type	distributePebbles, @function
distributePebbles:
.LFB11:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	.cfi_offset 3, -24
	movl	%edi, -28(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-28(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	movl	%eax, -12(%rbp)
	movl	-28(%rbp), %eax
	cltq
	movl	$0, board(,%rax,4)
	movl	-28(%rbp), %eax
	leal	1(%rax), %ecx
	movl	$715827883, %edx
	movl	%ecx, %eax
	imull	%edx
	sarl	%edx
	movl	%ecx, %eax
	sarl	$31, %eax
	movl	%edx, %ebx
	subl	%eax, %ebx
	movl	%ebx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	sall	$2, %eax
	movl	%ecx, %edx
	subl	%eax, %edx
	movl	%edx, %eax
	movl	%eax, -16(%rbp)
	jmp	.L44
.L45:
	movl	-16(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	movl	%edx, board(,%rax,4)
	subl	$1, -12(%rbp)
	cmpl	$0, -12(%rbp)
	jle	.L44
	movl	-16(%rbp), %eax
	leal	1(%rax), %ecx
	movl	$715827883, %edx
	movl	%ecx, %eax
	imull	%edx
	sarl	%edx
	movl	%ecx, %eax
	sarl	$31, %eax
	movl	%edx, %ebx
	subl	%eax, %ebx
	movl	%ebx, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	%edx, %eax
	addl	%eax, %eax
	addl	%edx, %eax
	sall	$2, %eax
	movl	%ecx, %edx
	subl	%eax, %edx
	movl	%edx, %eax
	movl	%eax, -16(%rbp)
.L44:
	cmpl	$0, -12(%rbp)
	jg	.L45
	movl	-16(%rbp), %eax
	popq	%rbx
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	distributePebbles, .-distributePebbles
	.globl	updateScore
	.type	updateScore, @function
updateScore:
.LFB12:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	cmpl	$2, %eax
	je	.L48
	movl	-4(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	cmpl	$3, %eax
	jne	.L47
.L48:
	movl	it(%rip), %ecx
	movl	it(%rip), %eax
	cltq
	movl	playerScore(,%rax,4), %edx
	movl	-4(%rbp), %eax
	cltq
	movl	board(,%rax,4), %eax
	addl	%eax, %edx
	movslq	%ecx, %rax
	movl	%edx, playerScore(,%rax,4)
	movl	-4(%rbp), %eax
	cltq
	movl	$0, board(,%rax,4)
.L47:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	updateScore, .-updateScore
	.section	.rodata
.LC12:
	.string	"Congrats, %s!  You win!\n"
.LC13:
	.string	"Tie game!"
	.text
	.globl	declareWinner
	.type	declareWinner, @function
declareWinner:
.LFB13:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, %eax
	call	displayBoard
	movl	playerScore(%rip), %edx
	movl	playerScore+4(%rip), %eax
	cmpl	%eax, %edx
	jle	.L51
	movl	$player, %esi
	movl	$.LC12, %edi
	movl	$0, %eax
	call	printf
	jmp	.L50
.L51:
	movl	playerScore(%rip), %edx
	movl	playerScore+4(%rip), %eax
	cmpl	%eax, %edx
	jge	.L53
	movl	$player+30, %esi
	movl	$.LC12, %edi
	movl	$0, %eax
	call	printf
	jmp	.L50
.L53:
	movl	$.LC13, %edi
	call	puts
.L50:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	declareWinner, .-declareWinner
	.section	.rodata
	.align 8
.LC14:
	.string	"Another game (1 if yes, 0 if no)? "
	.text
	.globl	anotherGame
	.type	anotherGame, @function
anotherGame:
.LFB14:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$.LC14, %edi
	movl	$0, %eax
	call	printf
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	movl	$.LC11, %edi
	movl	$0, %eax
	call	__isoc99_scanf
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	anotherGame, .-anotherGame
	.ident	"GCC: (SUSE Linux) 4.7.2 20130108 [gcc-4_7-branch revision 195012]"
	.section	.comment.SUSE.OPTs,"MS",@progbits,1
	.string	"ospwg"
	.section	.note.GNU-stack,"",@progbits
