	.file	"1200328.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Welcome to the game of Pig!"
.LC1:
	.string	"Here's how to play!"
	.align 8
.LC2:
	.string	"If the player rolls a 1, they score nothing and it becomes the next player's turn."
	.align 8
.LC3:
	.string	"If the player rolls any other number, it is added to their turn total and the player's turn continues."
	.align 8
.LC4:
	.string	"If a player chooses to \"hold\", their turn total is added to their score, and it becomes the next player's turn."
	.align 8
.LC5:
	.string	"The first player to score 100 or more points wins."
.LC6:
	.string	"\nPlayer 1!"
.LC7:
	.string	"Player 1 wins!"
.LC8:
	.string	"\nPlayer 2!"
.LC9:
	.string	"Player 2 wins!"
	.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, 32
	mov	edi, 0
	call	time@PLT
	mov	edi, eax
	call	srand@PLT
	mov	DWORD PTR -24[rbp], 0
	mov	DWORD PTR -20[rbp], 0
	mov	DWORD PTR -12[rbp], 1
	mov	DWORD PTR -8[rbp], 2
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -16[rbp], eax
	mov	DWORD PTR -4[rbp], 0
	mov	BYTE PTR -25[rbp], 0
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	puts@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	lea	rdi, .LC4[rip]
	call	puts@PLT
	lea	rdi, .LC5[rip]
	call	puts@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	jmp	.L2
.L6:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -12[rbp]
	jne	.L3
	mov	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -4[rbp], eax
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, edx
	mov	edi, eax
	call	play_game
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 99
	jle	.L4
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	mov	BYTE PTR -25[rbp], 1
	jmp	.L2
.L4:
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -8[rbp]
	mov	DWORD PTR -16[rbp], eax
	jmp	.L2
.L3:
	mov	eax, DWORD PTR -16[rbp]
	cmp	eax, DWORD PTR -8[rbp]
	jne	.L2
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -4[rbp], eax
	mov	edx, DWORD PTR -4[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, edx
	mov	edi, eax
	call	play_game
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 99
	jle	.L5
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	BYTE PTR -25[rbp], 1
	jmp	.L2
.L5:
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -16[rbp], eax
.L2:
	movzx	eax, BYTE PTR -25[rbp]
	xor	eax, 1
	test	al, al
	jne	.L6
	mov	eax, 0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC10:
	.string	"Please input \"1\" to roll the dice or \"2\" to hold: "
.LC11:
	.string	"%d"
.LC12:
	.string	"You rolled a %d!\n\n"
	.align 8
.LC13:
	.string	"Oh no! Because you rolled a 1 your turn is now over and your score stays at %d\n"
	.align 8
.LC14:
	.string	"You chose to hold.Your total score after this turn is %d.\n"
	.align 8
.LC15:
	.string	"Your overall total score is now %d.\n"
	.text
	.globl	play_game
	.type	play_game, @function
play_game:
.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	DWORD PTR -36[rbp], edi
	mov	DWORD PTR -40[rbp], esi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -20[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	mov	DWORD PTR -16[rbp], 0
	mov	BYTE PTR -21[rbp], 0
	jmp	.L9
.L11:
	lea	rdi, .LC10[rip]
	call	puts@PLT
	lea	rax, -20[rbp]
	mov	rsi, rax
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	call	getchar@PLT
.L10:
	mov	eax, DWORD PTR -20[rbp]
	test	eax, eax
	jle	.L11
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, 2
	jg	.L11
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, 1
	jne	.L12
	call	roll_die
	call	roll_die
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -12[rbp], 1
	jne	.L13
	mov	eax, DWORD PTR -40[rbp]
	mov	esi, eax
	lea	rdi, .LC13[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -16[rbp], 0
	mov	BYTE PTR -21[rbp], 1
	jmp	.L14
.L13:
	mov	eax, DWORD PTR -12[rbp]
	add	DWORD PTR -16[rbp], eax
	jmp	.L14
.L12:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, 2
	jne	.L14
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	BYTE PTR -21[rbp], 1
	mov	eax, DWORD PTR -16[rbp]
	add	DWORD PTR -40[rbp], eax
	mov	eax, DWORD PTR -40[rbp]
	mov	esi, eax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
.L14:
	mov	DWORD PTR -20[rbp], 0
.L9:
	movzx	eax, BYTE PTR -21[rbp]
	xor	eax, 1
	test	al, al
	jne	.L10
	mov	eax, DWORD PTR -40[rbp]
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	play_game, .-play_game
	.globl	roll_die
	.type	roll_die, @function
roll_die:
.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, 16
	call	rand@PLT
	mov	edx, eax
	movsx	rax, edx
	imul	rax, rax, 715827883
	shr	rax, 32
	mov	esi, edx
	sar	esi, 31
	mov	ecx, eax
	sub	ecx, esi
	mov	eax, ecx
	add	eax, eax
	add	eax, ecx
	add	eax, eax
	sub	edx, eax
	mov	ecx, edx
	lea	eax, 1[rcx]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	roll_die, .-roll_die
	.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	"1200328.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Welcome to the game of Pig!\000"
	.align	2
.LC1:
	.ascii	"Here's how to play!\000"
	.align	2
.LC2:
	.ascii	"If the player rolls a 1, they score nothing and it "
	.ascii	"becomes the next player's turn.\000"
	.align	2
.LC3:
	.ascii	"If the player rolls any other number, it is added t"
	.ascii	"o their turn total and the player's turn continues."
	.ascii	"\000"
	.align	2
.LC4:
	.ascii	"If a player chooses to \"hold\", their turn total i"
	.ascii	"s added to their score, and it becomes the next pla"
	.ascii	"yer's turn.\000"
	.align	2
.LC5:
	.ascii	"The first player to score 100 or more points wins.\000"
	.align	2
.LC6:
	.ascii	"\012Player 1!\000"
	.align	2
.LC7:
	.ascii	"Player 1 wins!\000"
	.align	2
.LC8:
	.ascii	"\012Player 2!\000"
	.align	2
.LC9:
	.ascii	"Player 2 wins!\000"
	.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	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	mov	r0, #0
	bl	time
	mov	r3, r0
	mov	r0, r3
	bl	srand
	mov	r3, #0
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-24]
	mov	r3, #1
	str	r3, [fp, #-16]
	mov	r3, #2
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-8]
	mov	r3, #0
	strb	r3, [fp, #-29]
	ldr	r0, .L8
	bl	puts
	ldr	r0, .L8+4
	bl	puts
	ldr	r0, .L8+8
	bl	puts
	ldr	r0, .L8+12
	bl	puts
	ldr	r0, .L8+16
	bl	puts
	ldr	r0, .L8+20
	bl	puts
	ldr	r0, .L8+24
	bl	puts
	b	.L2
.L6:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	bne	.L3
	ldr	r3, [fp, #-28]
	str	r3, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-20]
	bl	play_game
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #99
	ble	.L4
	ldr	r0, .L8+28
	bl	printf
	mov	r3, #1
	strb	r3, [fp, #-29]
	b	.L2
.L4:
	ldr	r0, .L8+32
	bl	puts
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-20]
	b	.L2
.L3:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bne	.L2
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-20]
	bl	play_game
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #99
	ble	.L5
	ldr	r0, .L8+36
	bl	printf
	mov	r3, #1
	strb	r3, [fp, #-29]
	b	.L2
.L5:
	ldr	r0, .L8+24
	bl	puts
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-20]
.L2:
	ldrb	r3, [fp, #-29]
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L6
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.section	.rodata
	.align	2
.LC10:
	.ascii	"Please input \"1\" to roll the dice or \"2\" to hol"
	.ascii	"d: \000"
	.align	2
.LC11:
	.ascii	"%d\000"
	.align	2
.LC12:
	.ascii	"You rolled a %d!\012\012\000"
	.align	2
.LC13:
	.ascii	"Oh no! Because you rolled a 1 your turn is now over"
	.ascii	" and your score stays at %d\012\000"
	.align	2
.LC14:
	.ascii	"You chose to hold.Your total score after this turn "
	.ascii	"is %d.\012\000"
	.align	2
.LC15:
	.ascii	"Your overall total score is now %d.\012\000"
	.align	2
.LC16:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	play_game
	.syntax unified
	.arm
	.fpu softvfp
	.type	play_game, %function
play_game:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L20
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	strb	r3, [fp, #-21]
	b	.L11
.L13:
	ldr	r0, .L20+4
	bl	puts
	sub	r3, fp, #20
	mov	r1, r3
	ldr	r0, .L20+8
	bl	__isoc99_scanf
	bl	getchar
.L12:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	ble	.L13
	ldr	r3, [fp, #-20]
	cmp	r3, #2
	bgt	.L13
	ldr	r3, [fp, #-20]
	cmp	r3, #1
	bne	.L14
	bl	roll_die
	bl	roll_die
	str	r0, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, .L20+12
	bl	printf
	ldr	r3, [fp, #-12]
	cmp	r3, #1
	bne	.L15
	ldr	r1, [fp, #-36]
	ldr	r0, .L20+16
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #1
	strb	r3, [fp, #-21]
	b	.L16
.L15:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	b	.L16
.L14:
	ldr	r3, [fp, #-20]
	cmp	r3, #2
	bne	.L16
	ldr	r1, [fp, #-16]
	ldr	r0, .L20+20
	bl	printf
	mov	r3, #1
	strb	r3, [fp, #-21]
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-36]
	ldr	r1, [fp, #-36]
	ldr	r0, .L20+24
	bl	printf
.L16:
	mov	r3, #0
	str	r3, [fp, #-20]
.L11:
	ldrb	r3, [fp, #-21]
	eor	r3, r3, #1
	and	r3, r3, #255
	cmp	r3, #0
	bne	.L12
	ldr	r3, [fp, #-36]
	ldr	r2, .L20
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L19
	bl	__stack_chk_fail
.L19:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L21:
	.align	2
.L20:
	.word	.LC16
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.size	play_game, .-play_game
	.align	2
	.global	roll_die
	.syntax unified
	.arm
	.fpu softvfp
	.type	roll_die, %function
roll_die:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	bl	rand
	mov	r1, r0
	ldr	r3, .L24
	smull	r0, r2, r3, r1
	asr	r3, r1, #31
	sub	r2, r2, r3
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, r1, r3
	add	r3, r2, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	715827883
	.size	roll_die, .-roll_die
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
