	.file	"99788.c"
	.intel_syntax noprefix
	.text
	.local	deck
	.comm	deck,208,32
	.type	make_standard_deck, @function
make_standard_deck:
.LFB6:
	.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 -4[rbp], 0
	mov	DWORD PTR -12[rbp], 0
	jmp	.L2
.L5:
	mov	eax, DWORD PTR -20[rbp]
	mov	DWORD PTR -8[rbp], eax
	jmp	.L3
.L4:
	mov	eax, DWORD PTR -8[rbp]
	sal	eax, 8
	mov	ecx, eax
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -4[rbp], edx
	mov	edx, DWORD PTR -12[rbp]
	add	ecx, edx
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	DWORD PTR [rdx+rax], ecx
	add	DWORD PTR -8[rbp], 1
.L3:
	cmp	DWORD PTR -8[rbp], 13
	jle	.L4
	add	DWORD PTR -12[rbp], 1
.L2:
	cmp	DWORD PTR -12[rbp], 3
	jle	.L5
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	make_standard_deck, .-make_standard_deck
	.type	shuffle_deck, @function
shuffle_deck:
.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	DWORD PTR -12[rbp], 0
	jmp	.L7
.L8:
	call	random@PLT
	mov	edx, DWORD PTR -20[rbp]
	sub	edx, DWORD PTR -12[rbp]
	movsx	rcx, edx
	cqo
	idiv	rcx
	mov	rax, rdx
	mov	edx, eax
	mov	eax, DWORD PTR -12[rbp]
	add	eax, edx
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -8[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -8[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, deck[rip]
	mov	DWORD PTR [rcx+rdx], eax
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rdx, deck[rip]
	mov	eax, DWORD PTR -4[rbp]
	mov	DWORD PTR [rcx+rdx], eax
	add	DWORD PTR -12[rbp], 1
.L7:
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -20[rbp]
	jl	.L8
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	shuffle_deck, .-shuffle_deck
	.section	.rodata
.LC0:
	.string	"%i"
.LC1:
	.string	"Q"
.LC2:
	.string	"K"
.LC3:
	.string	"J"
	.text
	.type	card_to_string, @function
card_to_string:
.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, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	DWORD PTR -32[rbp], edx
	mov	DWORD PTR -36[rbp], ecx
	mov	eax, DWORD PTR -28[rbp]
	movzx	eax, al
	mov	DWORD PTR -8[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	sar	eax, 8
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 1
	jne	.L10
	mov	rax, QWORD PTR -24[rbp]
	mov	WORD PTR [rax], 65
	jmp	.L11
.L10:
	cmp	DWORD PTR -4[rbp], 9
	jg	.L12
	mov	edx, DWORD PTR -4[rbp]
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	jmp	.L11
.L12:
	cmp	DWORD PTR -4[rbp], 10
	jne	.L13
	cmp	DWORD PTR -36[rbp], 0
	je	.L14
	mov	rax, QWORD PTR -24[rbp]
	mov	WORD PTR [rax], 84
	jmp	.L11
.L14:
	mov	rax, QWORD PTR -24[rbp]
	mov	WORD PTR [rax], 12337
	mov	BYTE PTR 2[rax], 0
	jmp	.L11
.L13:
	cmp	DWORD PTR -4[rbp], 11
	je	.L15
	cmp	DWORD PTR -4[rbp], 12
	jne	.L16
	lea	rax, .LC1[rip]
	jmp	.L18
.L16:
	lea	rax, .LC2[rip]
	jmp	.L18
.L15:
	lea	rax, .LC3[rip]
.L18:
	mov	rdx, QWORD PTR -24[rbp]
	mov	rsi, rax
	mov	rdi, rdx
	call	strcpy@PLT
.L11:
	cmp	DWORD PTR -8[rbp], 3
	je	.L19
	cmp	DWORD PTR -8[rbp], 3
	jg	.L20
	cmp	DWORD PTR -8[rbp], 2
	je	.L21
	cmp	DWORD PTR -8[rbp], 2
	jg	.L20
	cmp	DWORD PTR -8[rbp], 0
	je	.L22
	cmp	DWORD PTR -8[rbp], 1
	je	.L23
	jmp	.L20
.L22:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	WORD PTR [rax], 67
	jmp	.L20
.L23:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	WORD PTR [rax], 68
	jmp	.L20
.L21:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	WORD PTR [rax], 72
	jmp	.L20
.L19:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	WORD PTR [rax], 83
	nop
.L20:
	cmp	DWORD PTR -32[rbp], 0
	jne	.L24
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	WORD PTR [rax], 32
.L24:
	mov	rax, QWORD PTR -24[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	card_to_string, .-card_to_string
	.section	.rodata
.LC4:
	.string	"-t"
.LC5:
	.string	"klondike"
.LC6:
	.string	"freecell"
.LC7:
	.string	"bakers_game"
.LC8:
	.string	"eight_off"
.LC9:
	.string	"seahaven"
.LC10:
	.string	"beleaguered_castle"
.LC11:
	.string	"streets_and_alleys"
.LC12:
	.string	"Unknown game type \"%s\"!\n"
.LC13:
	.string	"Talon: "
.LC14:
	.string	"%s"
.LC15:
	.string	"FC: %s\n"
.LC16:
	.string	"Foundations: H-A C-A D-A S-A"
	.text
	.globl	main
	.type	main, @function
main:
.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, 424
	.cfi_offset 3, -24
	mov	DWORD PTR -420[rbp], edi
	mov	QWORD PTR -432[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -400[rbp], 0
	mov	DWORD PTR -396[rbp], 0
	mov	DWORD PTR -392[rbp], 1
	mov	eax, DWORD PTR -392[rbp]
	cmp	eax, DWORD PTR -420[rbp]
	jge	.L27
	mov	eax, DWORD PTR -392[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -432[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L27
	mov	DWORD PTR -396[rbp], 1
	add	DWORD PTR -392[rbp], 1
.L27:
	mov	eax, DWORD PTR -392[rbp]
	cmp	eax, DWORD PTR -420[rbp]
	jge	.L28
	mov	eax, DWORD PTR -392[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -392[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -432[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	jmp	.L29
.L28:
	mov	edi, 0
	call	time@PLT
.L29:
	mov	DWORD PTR -388[rbp], eax
	mov	eax, DWORD PTR -388[rbp]
	mov	edi, eax
	call	srandom@PLT
	mov	eax, DWORD PTR -392[rbp]
	cmp	eax, DWORD PTR -420[rbp]
	jge	.L30
	mov	eax, DWORD PTR -392[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -432[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L31
	mov	DWORD PTR -400[rbp], 1
	jmp	.L30
.L31:
	mov	eax, DWORD PTR -392[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -432[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L32
	mov	eax, DWORD PTR -392[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -432[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L33
.L32:
	mov	DWORD PTR -400[rbp], 0
	jmp	.L30
.L33:
	mov	eax, DWORD PTR -392[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -432[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L34
	mov	DWORD PTR -400[rbp], 2
	jmp	.L30
.L34:
	mov	eax, DWORD PTR -392[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -432[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L35
	mov	DWORD PTR -400[rbp], 3
	jmp	.L30
.L35:
	mov	eax, DWORD PTR -392[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -432[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L36
	mov	DWORD PTR -400[rbp], 4
	jmp	.L30
.L36:
	mov	eax, DWORD PTR -392[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -432[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L37
	mov	DWORD PTR -400[rbp], 5
	jmp	.L30
.L37:
	mov	rax, QWORD PTR -432[rbp]
	add	rax, 16
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L99
.L30:
	cmp	DWORD PTR -400[rbp], 4
	jne	.L39
	mov	eax, 2
	jmp	.L40
.L39:
	mov	eax, 1
.L40:
	mov	edi, eax
	call	make_standard_deck
	cmp	DWORD PTR -400[rbp], 4
	jne	.L41
	mov	eax, 48
	jmp	.L42
.L41:
	mov	eax, 52
.L42:
	mov	edi, eax
	call	shuffle_deck
	cmp	DWORD PTR -400[rbp], 1
	jne	.L43
	mov	DWORD PTR -412[rbp], 0
	jmp	.L44
.L45:
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 368
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -412[rbp], 1
.L44:
	cmp	DWORD PTR -412[rbp], 6
	jle	.L45
	mov	DWORD PTR -404[rbp], 0
	mov	DWORD PTR -412[rbp], 0
	jmp	.L46
.L49:
	mov	eax, DWORD PTR -412[rbp]
	mov	DWORD PTR -408[rbp], eax
	jmp	.L47
.L48:
	mov	eax, DWORD PTR -408[rbp]
	cmp	eax, DWORD PTR -412[rbp]
	sete	al
	movzx	edx, al
	mov	eax, DWORD PTR -404[rbp]
	lea	ecx, 1[rax]
	mov	DWORD PTR -404[rbp], ecx
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	esi, DWORD PTR [rcx+rax]
	mov	ecx, DWORD PTR -396[rbp]
	lea	rax, -74[rbp]
	mov	rdi, rax
	call	card_to_string
	mov	rcx, rax
	lea	rsi, -384[rbp]
	mov	eax, DWORD PTR -408[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rsi
	mov	rsi, rcx
	mov	rdi, rax
	call	strcat@PLT
	add	DWORD PTR -408[rbp], 1
.L47:
	cmp	DWORD PTR -408[rbp], 6
	jle	.L48
	add	DWORD PTR -412[rbp], 1
.L46:
	cmp	DWORD PTR -412[rbp], 6
	jle	.L49
	lea	rsi, .LC13[rip]
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L50
.L51:
	cmp	DWORD PTR -404[rbp], 51
	sete	al
	movzx	edx, al
	mov	eax, DWORD PTR -404[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	esi, DWORD PTR [rcx+rax]
	mov	ecx, DWORD PTR -396[rbp]
	lea	rax, -74[rbp]
	mov	rdi, rax
	call	card_to_string
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -404[rbp], 1
.L50:
	cmp	DWORD PTR -404[rbp], 51
	jle	.L51
	mov	edi, 10
	call	putchar@PLT
	mov	DWORD PTR -412[rbp], 0
	jmp	.L52
.L53:
	lea	rcx, -384[rbp]
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rcx
	mov	rdi, rax
	call	puts@PLT
	add	DWORD PTR -412[rbp], 1
.L52:
	cmp	DWORD PTR -412[rbp], 6
	jle	.L53
	jmp	.L54
.L43:
	cmp	DWORD PTR -400[rbp], 0
	jne	.L55
	mov	DWORD PTR -412[rbp], 0
	jmp	.L56
.L57:
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 368
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -412[rbp], 1
.L56:
	cmp	DWORD PTR -412[rbp], 7
	jle	.L57
	mov	DWORD PTR -412[rbp], 0
	jmp	.L58
.L59:
	cmp	DWORD PTR -412[rbp], 43
	setg	al
	movzx	edx, al
	mov	eax, DWORD PTR -412[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	esi, DWORD PTR [rcx+rax]
	mov	ecx, DWORD PTR -396[rbp]
	lea	rax, -74[rbp]
	mov	rdi, rax
	call	card_to_string
	mov	rcx, rax
	mov	eax, DWORD PTR -412[rbp]
	cdq
	shr	edx, 29
	add	eax, edx
	and	eax, 7
	sub	eax, edx
	lea	rsi, -384[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rsi
	mov	rsi, rcx
	mov	rdi, rax
	call	strcat@PLT
	add	DWORD PTR -412[rbp], 1
.L58:
	cmp	DWORD PTR -412[rbp], 51
	jle	.L59
	mov	DWORD PTR -412[rbp], 0
	jmp	.L60
.L61:
	lea	rcx, -384[rbp]
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rcx
	mov	rdi, rax
	call	puts@PLT
	add	DWORD PTR -412[rbp], 1
.L60:
	cmp	DWORD PTR -412[rbp], 7
	jle	.L61
	jmp	.L54
.L55:
	cmp	DWORD PTR -400[rbp], 2
	jne	.L62
	mov	DWORD PTR -412[rbp], 0
	jmp	.L63
.L64:
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 368
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -412[rbp], 1
.L63:
	cmp	DWORD PTR -412[rbp], 7
	jle	.L64
	mov	DWORD PTR -412[rbp], 0
	jmp	.L65
.L66:
	cmp	DWORD PTR -412[rbp], 39
	setg	al
	movzx	edx, al
	mov	eax, DWORD PTR -412[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	esi, DWORD PTR [rcx+rax]
	mov	ecx, DWORD PTR -396[rbp]
	lea	rax, -74[rbp]
	mov	rdi, rax
	call	card_to_string
	mov	rcx, rax
	mov	eax, DWORD PTR -412[rbp]
	cdq
	shr	edx, 29
	add	eax, edx
	and	eax, 7
	sub	eax, edx
	lea	rsi, -384[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rsi
	mov	rsi, rcx
	mov	rdi, rax
	call	strcat@PLT
	add	DWORD PTR -412[rbp], 1
.L65:
	cmp	DWORD PTR -412[rbp], 47
	jle	.L66
	mov	BYTE PTR -64[rbp], 0
	jmp	.L67
.L68:
	cmp	DWORD PTR -412[rbp], 51
	sete	al
	movzx	edx, al
	mov	eax, DWORD PTR -412[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	esi, DWORD PTR [rcx+rax]
	mov	ecx, DWORD PTR -396[rbp]
	lea	rax, -74[rbp]
	mov	rdi, rax
	call	card_to_string
	mov	rdx, rax
	lea	rax, -64[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcat@PLT
	add	DWORD PTR -412[rbp], 1
.L67:
	cmp	DWORD PTR -412[rbp], 51
	jle	.L68
	lea	rax, -64[rbp]
	mov	rsi, rax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -412[rbp], 0
	jmp	.L69
.L70:
	lea	rcx, -384[rbp]
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rcx
	mov	rdi, rax
	call	puts@PLT
	add	DWORD PTR -412[rbp], 1
.L69:
	cmp	DWORD PTR -412[rbp], 7
	jle	.L70
	jmp	.L54
.L62:
	cmp	DWORD PTR -400[rbp], 3
	jne	.L71
	mov	DWORD PTR -412[rbp], 0
	jmp	.L72
.L73:
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 368
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -412[rbp], 1
.L72:
	cmp	DWORD PTR -412[rbp], 9
	jle	.L73
	mov	DWORD PTR -412[rbp], 0
	jmp	.L74
.L75:
	cmp	DWORD PTR -412[rbp], 39
	setg	al
	movzx	edx, al
	mov	eax, DWORD PTR -412[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	esi, DWORD PTR [rcx+rax]
	mov	ecx, DWORD PTR -396[rbp]
	lea	rax, -74[rbp]
	mov	rdi, rax
	call	card_to_string
	mov	rsi, rax
	mov	ecx, DWORD PTR -412[rbp]
	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
	lea	rcx, -384[rbp]
	movsx	rdx, edx
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rcx
	mov	rdi, rax
	call	strcat@PLT
	add	DWORD PTR -412[rbp], 1
.L74:
	cmp	DWORD PTR -412[rbp], 49
	jle	.L75
	lea	rax, -64[rbp]
	mov	DWORD PTR [rax], 540689222
	mov	WORD PTR 4[rax], 8237
	mov	BYTE PTR 6[rax], 0
	jmp	.L76
.L77:
	cmp	DWORD PTR -412[rbp], 51
	sete	al
	movzx	edx, al
	mov	eax, DWORD PTR -412[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	esi, DWORD PTR [rcx+rax]
	mov	ecx, DWORD PTR -396[rbp]
	lea	rax, -74[rbp]
	mov	rdi, rax
	call	card_to_string
	mov	rdx, rax
	lea	rax, -64[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcat@PLT
	add	DWORD PTR -412[rbp], 1
.L76:
	cmp	DWORD PTR -412[rbp], 51
	jle	.L77
	lea	rax, -64[rbp]
	mov	rdi, rax
	call	puts@PLT
	mov	DWORD PTR -412[rbp], 0
	jmp	.L78
.L79:
	lea	rcx, -384[rbp]
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rcx
	mov	rdi, rax
	call	puts@PLT
	add	DWORD PTR -412[rbp], 1
.L78:
	cmp	DWORD PTR -412[rbp], 9
	jle	.L79
	jmp	.L54
.L71:
	cmp	DWORD PTR -400[rbp], 4
	jne	.L80
	mov	DWORD PTR -412[rbp], 0
	jmp	.L81
.L82:
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 368
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -412[rbp], 1
.L81:
	cmp	DWORD PTR -412[rbp], 7
	jle	.L82
	mov	DWORD PTR -412[rbp], 0
	jmp	.L83
.L86:
	cmp	DWORD PTR -412[rbp], 39
	setg	al
	movzx	edx, al
	mov	eax, DWORD PTR -412[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	esi, DWORD PTR [rcx+rax]
	mov	ecx, DWORD PTR -396[rbp]
	lea	rax, -74[rbp]
	mov	rdi, rax
	call	card_to_string
	mov	rcx, rax
	mov	eax, DWORD PTR -412[rbp]
	cdq
	shr	edx, 29
	add	eax, edx
	and	eax, 7
	sub	eax, edx
	mov	edx, eax
	mov	eax, edx
	sar	eax, 31
	shr	eax, 31
	mov	esi, eax
	lea	eax, [rdx+rsi]
	and	eax, 1
	sub	eax, esi
	cmp	eax, 1
	jne	.L84
	mov	edi, 4
	jmp	.L85
.L84:
	mov	edi, 0
.L85:
	mov	eax, DWORD PTR -412[rbp]
	cdq
	shr	edx, 29
	add	eax, edx
	and	eax, 7
	sub	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	edx, eax
	mov	eax, edx
	sar	eax, 31
	shr	eax, 30
	mov	esi, eax
	lea	eax, [rdx+rsi]
	and	eax, 3
	sub	eax, esi
	add	eax, edi
	lea	rsi, -384[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rsi
	mov	rsi, rcx
	mov	rdi, rax
	call	strcat@PLT
	add	DWORD PTR -412[rbp], 1
.L83:
	cmp	DWORD PTR -412[rbp], 47
	jle	.L86
	lea	rdi, .LC16[rip]
	call	puts@PLT
	mov	DWORD PTR -412[rbp], 0
	jmp	.L87
.L88:
	lea	rcx, -384[rbp]
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rcx
	mov	rdi, rax
	call	puts@PLT
	add	DWORD PTR -412[rbp], 1
.L87:
	cmp	DWORD PTR -412[rbp], 7
	jle	.L88
	jmp	.L54
.L80:
	cmp	DWORD PTR -400[rbp], 5
	jne	.L54
	mov	DWORD PTR -412[rbp], 0
	jmp	.L89
.L90:
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	lea	rax, -16[rax]
	add	rax, rbp
	sub	rax, 368
	mov	BYTE PTR [rax], 0
	add	DWORD PTR -412[rbp], 1
.L89:
	cmp	DWORD PTR -412[rbp], 7
	jle	.L90
	mov	DWORD PTR -412[rbp], 0
	jmp	.L91
.L94:
	cmp	DWORD PTR -412[rbp], 39
	setg	al
	movzx	edx, al
	mov	eax, DWORD PTR -412[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	esi, DWORD PTR [rcx+rax]
	mov	ecx, DWORD PTR -396[rbp]
	lea	rax, -74[rbp]
	mov	rdi, rax
	call	card_to_string
	mov	rcx, rax
	mov	eax, DWORD PTR -412[rbp]
	cdq
	shr	edx, 29
	add	eax, edx
	and	eax, 7
	sub	eax, edx
	mov	edx, eax
	mov	eax, edx
	sar	eax, 31
	shr	eax, 31
	mov	esi, eax
	lea	eax, [rdx+rsi]
	and	eax, 1
	sub	eax, esi
	cmp	eax, 1
	jne	.L92
	mov	edi, 4
	jmp	.L93
.L92:
	mov	edi, 0
.L93:
	mov	eax, DWORD PTR -412[rbp]
	cdq
	shr	edx, 29
	add	eax, edx
	and	eax, 7
	sub	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	edx, eax
	mov	eax, edx
	sar	eax, 31
	shr	eax, 30
	mov	esi, eax
	lea	eax, [rdx+rsi]
	and	eax, 3
	sub	eax, esi
	add	eax, edi
	lea	rsi, -384[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rsi
	mov	rsi, rcx
	mov	rdi, rax
	call	strcat@PLT
	add	DWORD PTR -412[rbp], 1
.L91:
	cmp	DWORD PTR -412[rbp], 47
	jle	.L94
	jmp	.L95
.L96:
	mov	eax, DWORD PTR -412[rbp]
	cdq
	shr	edx, 29
	add	eax, edx
	and	eax, 7
	sub	eax, edx
	lea	rcx, -384[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	lea	rbx, [rcx+rax]
	mov	rdi, rbx
	call	strlen@PLT
	add	rax, rbx
	mov	WORD PTR [rax], 32
	mov	eax, DWORD PTR -412[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, deck[rip]
	mov	esi, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -396[rbp]
	lea	rax, -74[rbp]
	mov	ecx, edx
	mov	edx, 1
	mov	rdi, rax
	call	card_to_string
	mov	rcx, rax
	mov	eax, DWORD PTR -412[rbp]
	cdq
	shr	edx, 29
	add	eax, edx
	and	eax, 7
	sub	eax, edx
	lea	rsi, -384[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rsi
	mov	rsi, rcx
	mov	rdi, rax
	call	strcat@PLT
	add	DWORD PTR -412[rbp], 1
.L95:
	cmp	DWORD PTR -412[rbp], 51
	jle	.L96
	mov	DWORD PTR -412[rbp], 0
	jmp	.L97
.L98:
	lea	rcx, -384[rbp]
	mov	eax, DWORD PTR -412[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 4
	sub	rax, rdx
	add	rax, rax
	add	rax, rcx
	mov	rdi, rax
	call	puts@PLT
	add	DWORD PTR -412[rbp], 1
.L97:
	cmp	DWORD PTR -412[rbp], 7
	jle	.L98
.L54:
	mov	eax, 0
.L99:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L100
	call	__stack_chk_fail@PLT
.L100:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"99788.c"
	.text
	.local	deck
	.comm	deck,208,4
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	make_standard_deck, %function
make_standard_deck:
	@ 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]
	mov	r3, #0
	str	r3, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L2
.L5:
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-12]
	b	.L3
.L4:
	ldr	r3, [fp, #-12]
	lsl	r1, r3, #8
	ldr	r3, [fp, #-8]
	add	r2, r3, #1
	str	r2, [fp, #-8]
	ldr	r2, [fp, #-16]
	add	r2, r1, r2
	ldr	r1, .L6
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L3:
	ldr	r3, [fp, #-12]
	cmp	r3, #13
	ble	.L4
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L2:
	ldr	r3, [fp, #-16]
	cmp	r3, #3
	ble	.L5
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L7:
	.align	2
.L6:
	.word	deck
	.size	make_standard_deck, .-make_standard_deck
	.global	__aeabi_idivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	shuffle_deck, %function
shuffle_deck:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L9
.L10:
	bl	random
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	sub	r3, r2, r3
	mov	r1, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, r2
	str	r3, [fp, #-12]
	ldr	r2, .L11
	ldr	r3, [fp, #-12]
	ldr	r3, [r2, r3, lsl #2]
	str	r3, [fp, #-8]
	ldr	r2, .L11
	ldr	r3, [fp, #-16]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r1, .L11
	ldr	r3, [fp, #-12]
	str	r2, [r1, r3, lsl #2]
	ldr	r1, .L11
	ldr	r3, [fp, #-16]
	ldr	r2, [fp, #-8]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L9:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	blt	.L10
	nop
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	deck
	.size	shuffle_deck, .-shuffle_deck
	.section	.rodata
	.align	2
.LC0:
	.ascii	"A\000"
	.align	2
.LC1:
	.ascii	"%i\000"
	.align	2
.LC2:
	.ascii	"T\000"
	.align	2
.LC3:
	.ascii	"10\000"
	.align	2
.LC4:
	.ascii	"Q\000"
	.align	2
.LC5:
	.ascii	"K\000"
	.align	2
.LC6:
	.ascii	"J\000"
	.align	2
.LC7:
	.ascii	"C\000"
	.align	2
.LC8:
	.ascii	"D\000"
	.align	2
.LC9:
	.ascii	"H\000"
	.align	2
.LC10:
	.ascii	"S\000"
	.align	2
.LC11:
	.ascii	" \000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	card_to_string, %function
card_to_string:
	@ 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]
	str	r2, [fp, #-24]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-20]
	and	r3, r3, #255
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-20]
	asr	r3, r3, #8
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	bne	.L14
	ldr	r3, [fp, #-16]
	ldr	r2, .L31
	mov	r0, r3
	mov	r1, r2
	mov	r3, #2
	mov	r2, r3
	bl	memcpy
	b	.L15
.L14:
	ldr	r3, [fp, #-8]
	cmp	r3, #9
	bgt	.L16
	ldr	r2, [fp, #-8]
	ldr	r1, .L31+4
	ldr	r0, [fp, #-16]
	bl	sprintf
	b	.L15
.L16:
	ldr	r3, [fp, #-8]
	cmp	r3, #10
	bne	.L17
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L18
	ldr	r3, [fp, #-16]
	ldr	r2, .L31+8
	mov	r0, r3
	mov	r1, r2
	mov	r3, #2
	mov	r2, r3
	bl	memcpy
	b	.L15
.L18:
	ldr	r3, [fp, #-16]
	ldr	r2, .L31+12
	mov	r0, r3
	mov	r1, r2
	mov	r3, #3
	mov	r2, r3
	bl	memcpy
	b	.L15
.L17:
	ldr	r3, [fp, #-8]
	cmp	r3, #11
	beq	.L19
	ldr	r3, [fp, #-8]
	cmp	r3, #12
	bne	.L20
	ldr	r3, .L31+16
	b	.L22
.L20:
	ldr	r3, .L31+20
	b	.L22
.L19:
	ldr	r3, .L31+24
.L22:
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	strcpy
.L15:
	ldr	r3, [fp, #-12]
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L23
.L25:
	.word	.L28
	.word	.L27
	.word	.L26
	.word	.L24
.L28:
	ldr	r0, [fp, #-16]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, r2
	ldr	r2, .L31+28
	mov	r0, r3
	mov	r1, r2
	mov	r3, #2
	mov	r2, r3
	bl	memcpy
	b	.L23
.L27:
	ldr	r0, [fp, #-16]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, r2
	ldr	r2, .L31+32
	mov	r0, r3
	mov	r1, r2
	mov	r3, #2
	mov	r2, r3
	bl	memcpy
	b	.L23
.L26:
	ldr	r0, [fp, #-16]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, r2
	ldr	r2, .L31+36
	mov	r0, r3
	mov	r1, r2
	mov	r3, #2
	mov	r2, r3
	bl	memcpy
	b	.L23
.L24:
	ldr	r0, [fp, #-16]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, r2
	ldr	r2, .L31+40
	mov	r0, r3
	mov	r1, r2
	mov	r3, #2
	mov	r2, r3
	bl	memcpy
	nop
.L23:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L29
	ldr	r0, [fp, #-16]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-16]
	add	r3, r3, r2
	ldr	r2, .L31+44
	mov	r0, r3
	mov	r1, r2
	mov	r3, #2
	mov	r2, r3
	bl	memcpy
.L29:
	ldr	r3, [fp, #-16]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L32:
	.align	2
.L31:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	card_to_string, .-card_to_string
	.section	.rodata
	.align	2
.LC12:
	.ascii	"-t\000"
	.align	2
.LC13:
	.ascii	"klondike\000"
	.align	2
.LC14:
	.ascii	"freecell\000"
	.align	2
.LC15:
	.ascii	"bakers_game\000"
	.align	2
.LC16:
	.ascii	"eight_off\000"
	.align	2
.LC17:
	.ascii	"seahaven\000"
	.align	2
.LC18:
	.ascii	"beleaguered_castle\000"
	.align	2
.LC19:
	.ascii	"streets_and_alleys\000"
	.align	2
.LC20:
	.ascii	"Unknown game type \"%s\"!\012\000"
	.align	2
.LC21:
	.ascii	"Talon: \000"
	.align	2
.LC22:
	.ascii	"%s\000"
	.align	2
.LC23:
	.ascii	"FC: %s\012\000"
	.align	2
.LC24:
	.ascii	"FC: - \000"
	.align	2
.LC25:
	.ascii	"Foundations: H-A C-A D-A S-A\000"
	.align	2
.LC26:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 384
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #388
	str	r0, [fp, #-392]
	str	r1, [fp, #-396]
	ldr	r3, .L108
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-376]
	mov	r3, #0
	str	r3, [fp, #-372]
	mov	r3, #1
	str	r3, [fp, #-368]
	ldr	r2, [fp, #-368]
	ldr	r3, [fp, #-392]
	cmp	r2, r3
	bge	.L34
	ldr	r3, [fp, #-368]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L108+4
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L34
	mov	r3, #1
	str	r3, [fp, #-372]
	ldr	r3, [fp, #-368]
	add	r3, r3, #1
	str	r3, [fp, #-368]
.L34:
	ldr	r2, [fp, #-368]
	ldr	r3, [fp, #-392]
	cmp	r2, r3
	bge	.L35
	ldr	r3, [fp, #-368]
	add	r2, r3, #1
	str	r2, [fp, #-368]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	mov	r3, r0
	b	.L36
.L35:
	mov	r0, #0
	bl	time
	mov	r3, r0
.L36:
	str	r3, [fp, #-364]
	ldr	r3, [fp, #-364]
	mov	r0, r3
	bl	srandom
	ldr	r2, [fp, #-368]
	ldr	r3, [fp, #-392]
	cmp	r2, r3
	bge	.L37
	ldr	r3, [fp, #-368]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L108+8
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L38
	mov	r3, #1
	str	r3, [fp, #-376]
	b	.L37
.L38:
	ldr	r3, [fp, #-368]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L108+12
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L39
	ldr	r3, [fp, #-368]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L108+16
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L40
.L39:
	mov	r3, #0
	str	r3, [fp, #-376]
	b	.L37
.L40:
	ldr	r3, [fp, #-368]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L108+20
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L41
	mov	r3, #2
	str	r3, [fp, #-376]
	b	.L37
.L41:
	ldr	r3, [fp, #-368]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L108+24
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L42
	mov	r3, #3
	str	r3, [fp, #-376]
	b	.L37
.L42:
	ldr	r3, [fp, #-368]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L108+28
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L43
	mov	r3, #4
	str	r3, [fp, #-376]
	b	.L37
.L43:
	ldr	r3, [fp, #-368]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-396]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r1, .L108+32
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L44
	mov	r3, #5
	str	r3, [fp, #-376]
	b	.L37
.L44:
	ldr	r3, .L108+36
	ldr	r0, [r3]
	ldr	r3, [fp, #-396]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L108+40
	bl	fprintf
	mvn	r3, #0
	b	.L106
.L37:
	ldr	r3, [fp, #-376]
	cmp	r3, #4
	bne	.L46
	mov	r3, #2
	b	.L47
.L46:
	mov	r3, #1
.L47:
	mov	r0, r3
	bl	make_standard_deck
	ldr	r3, [fp, #-376]
	cmp	r3, #4
	bne	.L48
	mov	r3, #48
	b	.L49
.L48:
	mov	r3, #52
.L49:
	mov	r0, r3
	bl	shuffle_deck
	ldr	r3, [fp, #-376]
	cmp	r3, #1
	bne	.L50
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L51
.L52:
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	sub	r3, r3, #348
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L51:
	ldr	r3, [fp, #-388]
	cmp	r3, #6
	ble	.L52
	mov	r3, #0
	str	r3, [fp, #-380]
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L53
.L56:
	ldr	r3, [fp, #-388]
	str	r3, [fp, #-384]
	b	.L54
.L55:
	sub	r1, fp, #360
	ldr	r2, [fp, #-384]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r4, r1, r3
	ldr	r3, [fp, #-380]
	add	r2, r3, #1
	str	r2, [fp, #-380]
	ldr	r2, .L108+44
	ldr	r1, [r2, r3, lsl #2]
	ldr	r2, [fp, #-384]
	ldr	r3, [fp, #-388]
	cmp	r2, r3
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	sub	r0, fp, #60
	ldr	r3, [fp, #-372]
	bl	card_to_string
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	strcat
	ldr	r3, [fp, #-384]
	add	r3, r3, #1
	str	r3, [fp, #-384]
.L54:
	ldr	r3, [fp, #-384]
	cmp	r3, #6
	ble	.L55
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L53:
	ldr	r3, [fp, #-388]
	cmp	r3, #6
	ble	.L56
	ldr	r1, .L108+48
	ldr	r0, .L108+52
	bl	printf
	b	.L57
.L58:
	ldr	r2, .L108+44
	ldr	r3, [fp, #-380]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-380]
	cmp	r3, #51
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	sub	r0, fp, #60
	ldr	r3, [fp, #-372]
	bl	card_to_string
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L108+52
	bl	printf
	ldr	r3, [fp, #-380]
	add	r3, r3, #1
	str	r3, [fp, #-380]
.L57:
	ldr	r3, [fp, #-380]
	cmp	r3, #51
	ble	.L58
	mov	r0, #10
	bl	putchar
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L59
.L60:
	sub	r1, fp, #360
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r1, r3
	mov	r0, r3
	bl	puts
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L59:
	ldr	r3, [fp, #-388]
	cmp	r3, #6
	ble	.L60
	b	.L61
.L50:
	ldr	r3, [fp, #-376]
	cmp	r3, #0
	bne	.L62
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L63
.L64:
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	sub	r3, r3, #348
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L63:
	ldr	r3, [fp, #-388]
	cmp	r3, #7
	ble	.L64
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L65
.L66:
	ldr	r3, [fp, #-388]
	rsbs	r1, r3, #0
	and	r2, r3, #7
	and	r3, r1, #7
	rsbpl	r2, r3, #0
	sub	r1, fp, #360
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r4, r1, r3
	ldr	r2, .L108+44
	ldr	r3, [fp, #-388]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-388]
	cmp	r3, #43
	movgt	r3, #1
	movle	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	sub	r0, fp, #60
	ldr	r3, [fp, #-372]
	bl	card_to_string
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	strcat
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L65:
	ldr	r3, [fp, #-388]
	cmp	r3, #51
	ble	.L66
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L67
.L68:
	sub	r1, fp, #360
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r1, r3
	mov	r0, r3
	bl	puts
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L67:
	ldr	r3, [fp, #-388]
	cmp	r3, #7
	ble	.L68
	b	.L61
.L62:
	ldr	r3, [fp, #-376]
	cmp	r3, #2
	bne	.L69
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L70
.L71:
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	sub	r3, r3, #348
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L70:
	ldr	r3, [fp, #-388]
	cmp	r3, #7
	ble	.L71
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L72
.L73:
	ldr	r3, [fp, #-388]
	rsbs	r1, r3, #0
	and	r2, r3, #7
	and	r3, r1, #7
	rsbpl	r2, r3, #0
	sub	r1, fp, #360
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r4, r1, r3
	ldr	r2, .L108+44
	ldr	r3, [fp, #-388]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-388]
	cmp	r3, #39
	movgt	r3, #1
	movle	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	sub	r0, fp, #60
	ldr	r3, [fp, #-372]
	bl	card_to_string
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	strcat
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L72:
	ldr	r3, [fp, #-388]
	cmp	r3, #47
	ble	.L73
	mov	r3, #0
	strb	r3, [fp, #-48]
	b	.L74
.L75:
	ldr	r2, .L108+44
	ldr	r3, [fp, #-388]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-388]
	cmp	r3, #51
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	sub	r0, fp, #60
	ldr	r3, [fp, #-372]
	bl	card_to_string
	mov	r2, r0
	sub	r3, fp, #48
	mov	r1, r2
	mov	r0, r3
	bl	strcat
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L74:
	ldr	r3, [fp, #-388]
	cmp	r3, #51
	ble	.L75
	sub	r3, fp, #48
	mov	r1, r3
	ldr	r0, .L108+56
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L76
.L77:
	sub	r1, fp, #360
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r1, r3
	mov	r0, r3
	bl	puts
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L76:
	ldr	r3, [fp, #-388]
	cmp	r3, #7
	ble	.L77
	b	.L61
.L69:
	ldr	r3, [fp, #-376]
	cmp	r3, #3
	bne	.L78
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L79
.L80:
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	sub	r3, r3, #348
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L79:
	ldr	r3, [fp, #-388]
	cmp	r3, #9
	ble	.L80
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L81
.L82:
	ldr	r1, [fp, #-388]
	ldr	r3, .L108+60
	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
	sub	r1, fp, #360
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r4, r1, r3
	ldr	r2, .L108+44
	ldr	r3, [fp, #-388]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-388]
	cmp	r3, #39
	movgt	r3, #1
	movle	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	sub	r0, fp, #60
	ldr	r3, [fp, #-372]
	bl	card_to_string
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	strcat
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L81:
	ldr	r3, [fp, #-388]
	cmp	r3, #49
	ble	.L82
	sub	r3, fp, #48
	ldr	r2, .L108+64
	ldm	r2, {r0, r1}
	str	r0, [r3]
	add	r3, r3, #4
	strh	r1, [r3]	@ movhi
	add	r3, r3, #2
	lsr	r2, r1, #16
	strb	r2, [r3]
	b	.L83
.L84:
	ldr	r2, .L108+44
	ldr	r3, [fp, #-388]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-388]
	cmp	r3, #51
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	sub	r0, fp, #60
	ldr	r3, [fp, #-372]
	bl	card_to_string
	mov	r2, r0
	sub	r3, fp, #48
	mov	r1, r2
	mov	r0, r3
	bl	strcat
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L83:
	ldr	r3, [fp, #-388]
	cmp	r3, #51
	ble	.L84
	sub	r3, fp, #48
	mov	r0, r3
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L85
.L86:
	sub	r1, fp, #360
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r1, r3
	mov	r0, r3
	bl	puts
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L85:
	ldr	r3, [fp, #-388]
	cmp	r3, #9
	ble	.L86
	b	.L61
.L78:
	ldr	r3, [fp, #-376]
	cmp	r3, #4
	bne	.L87
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L88
.L89:
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	sub	r3, r3, #348
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L88:
	ldr	r3, [fp, #-388]
	cmp	r3, #7
	ble	.L89
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L90
.L93:
	ldr	r3, [fp, #-388]
	rsbs	r2, r3, #0
	and	r3, r3, #7
	and	r2, r2, #7
	rsbpl	r3, r2, #0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	cmp	r3, #1
	bne	.L91
	mov	r2, #4
	b	.L92
.L91:
	mov	r2, #0
.L92:
	ldr	r3, [fp, #-388]
	rsbs	r1, r3, #0
	and	r3, r3, #7
	and	r1, r1, #7
	rsbpl	r3, r1, #0
	lsr	r1, r3, #31
	add	r3, r1, r3
	asr	r3, r3, #1
	rsbs	r1, r3, #0
	and	r3, r3, #3
	and	r1, r1, #3
	rsbpl	r3, r1, #0
	add	r2, r2, r3
	sub	r1, fp, #360
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r4, r1, r3
	ldr	r2, .L108+44
	ldr	r3, [fp, #-388]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-388]
	cmp	r3, #39
	movgt	r3, #1
	movle	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	sub	r0, fp, #60
	ldr	r3, [fp, #-372]
	bl	card_to_string
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	strcat
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L90:
	ldr	r3, [fp, #-388]
	cmp	r3, #47
	ble	.L93
	ldr	r0, .L108+68
	bl	puts
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L94
.L95:
	sub	r1, fp, #360
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r1, r3
	mov	r0, r3
	bl	puts
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L94:
	ldr	r3, [fp, #-388]
	cmp	r3, #7
	ble	.L95
	b	.L61
.L87:
	ldr	r3, [fp, #-376]
	cmp	r3, #5
	bne	.L61
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L96
.L97:
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	sub	r3, r3, #348
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L96:
	ldr	r3, [fp, #-388]
	cmp	r3, #7
	ble	.L97
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L98
.L101:
	ldr	r3, [fp, #-388]
	rsbs	r2, r3, #0
	and	r3, r3, #7
	and	r2, r2, #7
	rsbpl	r3, r2, #0
	cmp	r3, #0
	and	r3, r3, #1
	rsblt	r3, r3, #0
	cmp	r3, #1
	bne	.L99
	mov	r2, #4
	b	.L100
.L99:
	mov	r2, #0
.L100:
	ldr	r3, [fp, #-388]
	rsbs	r1, r3, #0
	and	r3, r3, #7
	and	r1, r1, #7
	rsbpl	r3, r1, #0
	lsr	r1, r3, #31
	add	r3, r1, r3
	asr	r3, r3, #1
	rsbs	r1, r3, #0
	and	r3, r3, #3
	and	r1, r1, #3
	rsbpl	r3, r1, #0
	add	r2, r2, r3
	sub	r1, fp, #360
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r4, r1, r3
	ldr	r2, .L108+44
	ldr	r3, [fp, #-388]
	ldr	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-388]
	cmp	r3, #39
	movgt	r3, #1
	movle	r3, #0
	and	r3, r3, #255
	mov	r2, r3
	sub	r0, fp, #60
	ldr	r3, [fp, #-372]
	bl	card_to_string
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	strcat
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L98:
	ldr	r3, [fp, #-388]
	cmp	r3, #47
	ble	.L101
	b	.L102
.L103:
	ldr	r3, [fp, #-388]
	rsbs	r1, r3, #0
	and	r2, r3, #7
	and	r3, r1, #7
	rsbpl	r2, r3, #0
	sub	r1, fp, #360
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r4, r1, r3
	mov	r0, r4
	bl	strlen
	mov	r3, r0
	add	r3, r4, r3
	ldr	r2, .L108+72
	mov	r0, r3
	mov	r1, r2
	mov	r3, #2
	mov	r2, r3
	bl	memcpy
	ldr	r3, [fp, #-388]
	rsbs	r1, r3, #0
	and	r2, r3, #7
	and	r3, r1, #7
	rsbpl	r2, r3, #0
	sub	r1, fp, #360
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r4, r1, r3
	ldr	r2, .L108+44
	ldr	r3, [fp, #-388]
	ldr	r1, [r2, r3, lsl #2]
	sub	r0, fp, #60
	ldr	r3, [fp, #-372]
	mov	r2, #1
	bl	card_to_string
	mov	r3, r0
	mov	r1, r3
	mov	r0, r4
	bl	strcat
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L102:
	ldr	r3, [fp, #-388]
	cmp	r3, #51
	ble	.L103
	mov	r3, #0
	str	r3, [fp, #-388]
	b	.L104
.L105:
	sub	r1, fp, #360
	ldr	r2, [fp, #-388]
	mov	r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r1, r3
	mov	r0, r3
	bl	puts
	ldr	r3, [fp, #-388]
	add	r3, r3, #1
	str	r3, [fp, #-388]
.L104:
	ldr	r3, [fp, #-388]
	cmp	r3, #7
	ble	.L105
.L61:
	mov	r3, #0
.L106:
	ldr	r2, .L108
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L107
	bl	__stack_chk_fail
.L107:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L109:
	.align	2
.L108:
	.word	.LC26
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	stderr
	.word	.LC20
	.word	deck
	.word	.LC21
	.word	.LC22
	.word	.LC23
	.word	1717986919
	.word	.LC24
	.word	.LC25
	.word	.LC11
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
