#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void intro(void) {
  char input;
  printf("\nAwari\n");
  printf("------\n");
  printf("Do you need the rules? (y\\n) ");
  scanf("%c", &input);
  if ((input == 'y') || (input == 'Y')) {
    printf(
        "\nAwari is an ancient African counting game. Each player has 6\n"
        "places with 3 markers or stones in each to start and an empty home. "
        "A\n"
        "move is made by taking all the markers from any non-empty place on "
        "your\n"
        "side, then \"sowing\" the markers one at a time in a "
        "counter-clockwise\n"
        "direction around the board. If the last marker sown lands in your "
        "home\n"
        "then you get a second move. (No more than two moves in one turn.)\n\n"
        "If the last marker is sown in an empty spot and the spot opposite is "
        "not\n"
        "empty then you capture the last marker and all the markers in the\n"
        "opposite spot. When either side is empty then the game is "
        "finished.\n\n"
        "Player one is at the left with home at the bottom, player two (or "
        "the\n"
        "computer in a one player game) is at the right with home at the top.\n"
        "By the way, the computer opponent is designed so that the more you "
        "play\n"
        "it, the better it gets.\n\n"
        "Good luck and have fun!\n");
  }
}


x86 assembly (clang, -O0):
<intro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x79,%eax
je     1176 <intro+0x56>
movsbl -0x1(%rbp),%eax
cmp    $0x59,%eax
jne    1182 <intro+0x62>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intro>:
push   %rax
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x7(%rsp),%al
and    $0xdf,%al
cmp    $0x59,%al
jne    117c <intro+0x4c>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\0AAwari\0A\00"
@.str.1 = [8 x i8] c"------\0A\00"
@.str.2 = [30 x i8] c"Do you need the rules? (y\\n) \00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [880 x i8] c"\0AAwari is an ancient African counting game. Each player has 6\0Aplaces with 3 markers or stones in each to start and an empty home. A\0Amove is made by taking all the markers from any non-empty place on your\0Aside, then \22sowing\22 the markers one at a time in a counter-clockwise\0Adirection around the board. If the last marker sown lands in your home\0Athen you get a second move. (No more than two moves in one turn.)\0A\0AIf the last marker is sown in an empty spot and the spot opposite is not\0Aempty then you capture the last marker and all the markers in the\0Aopposite spot. When either side is empty then the game is finished.\0A\0APlayer one is at the left with home at the bottom, player two (or the\0Acomputer in a one player game) is at the right with home at the top.\0ABy the way, the computer opponent is designed so that the more you play\0Ait, the better it gets.\0A\0AGood luck and have fun!\0A\00"
define void @intro() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 121
br i1 %8, label %13, label %9
9: ; preds = %0
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 89
br i1 %12, label %13, label %15
13: ; preds = %9, %0
%14 = call i32 @printf(i8* getelementptr inbounds ([880 x i8], [880 x i8]* @.str.4, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str.2 = [30 x i8] c"Do you need the rules? (y\\n) \00"
@.str.3 = [3 x i8] c"%c\00"
@str = [7 x i8] c"\0AAwari\00"
@str.5 = [7 x i8] c"------\00"
@str.6 = [879 x i8] c"\0AAwari is an ancient African counting game. Each player has 6\0Aplaces with 3 markers or stones in each to start and an empty home. A\0Amove is made by taking all the markers from any non-empty place on your\0Aside, then \22sowing\22 the markers one at a time in a counter-clockwise\0Adirection around the board. If the last marker sown lands in your home\0Athen you get a second move. (No more than two moves in one turn.)\0A\0AIf the last marker is sown in an empty spot and the spot opposite is not\0Aempty then you capture the last marker and all the markers in the\0Aopposite spot. When either side is empty then the game is finished.\0A\0APlayer one is at the left with home at the bottom, player two (or the\0Acomputer in a one player game) is at the right with home at the top.\0ABy the way, the computer opponent is designed so that the more you play\0Ait, the better it gets.\0A\0AGood luck and have fun!\00"
define void @intro() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%6 = load i8, i8* %1
%7 = and i8 %6, -33
%8 = icmp eq i8 %7, 89
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([879 x i8], [879 x i8]* @str.6, i64 0, i64 0))
br label %11
11: ; preds = %0, %9
ret void
}