#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 *);
int /*<<< orphan*/ system(char *);
void rules() {
  char link;
  printf("\tTic-Tac-Toe\n\n");
  printf(
      "Welcome to the most played 2D game and a sort of fun using X and O\n\n");
  printf("Rules:-\n");
  printf("\n1:Each player will be entering the number to put respective X or O "
         "in the desired position");
  printf(
      "\n2:Player who gets a combination of 3 same characters either diagonal "
      "or horizontally or \n  vertically will be declared as the winner");
  printf("\n\nEnjoy the game! Be a Winner!\n\n");
  printf("For more clarifications press Y else type any other character:- ");
  scanf("%c", &link);
  if (link == 'y' || link == 'Y') {
    system("start http://www.wikihow.com/Play-Tic-Tac-Toe");
  }
}


x86 assembly (clang, -O0):
<rules>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xefd(%rip),%rdi
call   1040 <printf@plt>
lea    0xefa(%rip),%rdi
call   1040 <printf@plt>
lea    0xf4a(%rip),%rdi
call   1040 <printf@plt>
lea    0xfc4(%rip),%rdi
call   1040 <printf@plt>
lea    0xfd9(%rip),%rdi
call   1040 <printf@plt>
lea    0x100e(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x79,%eax
je     11b6 <rules+0x86>
movsbl -0x1(%rbp),%eax
cmp    $0x59,%eax
jne    11c2 <rules+0x92>
lea    0xfe7(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rules>:
push   %rax
lea    0x100c(%rip),%rdi
call   1030 <puts@plt>
lea    0x100e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1046(%rip),%rdi
call   1030 <puts@plt>
lea    0xe94(%rip),%rdi
call   1050 <printf@plt>
lea    0xee4(%rip),%rdi
call   1050 <printf@plt>
lea    0x102a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf52(%rip),%rdi
call   1050 <printf@plt>
lea    0xf87(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x7(%rsp),%al
and    $0xdf,%al
cmp    $0x59,%al
jne    11bc <rules+0x7c>
lea    0xf6f(%rip),%rdi
call   1040 <system@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\09Tic-Tac-Toe\0A\0A\00"
@.str.1 = [69 x i8] c"Welcome to the most played 2D game and a sort of fun using X and O\0A\0A\00"
@.str.2 = [9 x i8] c"Rules:-\0A\00"
@.str.3 = [92 x i8] c"\0A1:Each player will be entering the number to put respective X or O in the desired position\00"
@.str.4 = [134 x i8] c"\0A2:Player who gets a combination of 3 same characters either diagonal or horizontally or \0A vertically will be declared as the winner\00"
@.str.5 = [33 x i8] c"\0A\0AEnjoy the game! Be a Winner!\0A\0A\00"
@.str.6 = [65 x i8] c"For more clarifications press Y else type any other character:- \00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [46 x i8] c"start http://www.wikihow.com/Play-Tic-Tac-Toe\00"
define void @rules() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %1)
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 121
br i1 %12, label %17, label %13
13: ; preds = %0
%14 = load i8, i8* %1
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 89
br i1 %16, label %17, label %19
17: ; preds = %13, %0
%18 = call i32 @system(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
@.str.3 = [92 x i8] c"\0A1:Each player will be entering the number to put respective X or O in the desired position\00"
@.str.4 = [134 x i8] c"\0A2:Player who gets a combination of 3 same characters either diagonal or horizontally or \0A vertically will be declared as the winner\00"
@.str.6 = [65 x i8] c"For more clarifications press Y else type any other character:- \00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [46 x i8] c"start http://www.wikihow.com/Play-Tic-Tac-Toe\00"
@str = [14 x i8] c"\09Tic-Tac-Toe\0A\00"
@str.9 = [68 x i8] c"Welcome to the most played 2D game and a sort of fun using X and O\0A\00"
@str.10 = [8 x i8] c"Rules:-\00"
@str.11 = [32 x i8] c"\0A\0AEnjoy the game! Be a Winner!\0A\00"
define void @rules() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.9, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.10, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([134 x i8], [134 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %1)
%10 = load i8, i8* %1
%11 = and i8 %10, -33
%12 = icmp eq i8 %11, 89
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @system(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0))
br label %15
15: ; preds = %0, %13
ret void
}