#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ main();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ system(char *);
void goToHelp() {
  char back;
  system("cls");
  printf("Welcome to BATTLESHIP - Help!\n\nIn this CMD edition the game is "
         "designed for 2 players behind one computer\n\n1) You will have to "
         "allocate your fleet on a map:\nBattleship - 4 cells\nSubmarine - 3 "
         "cells\nPatrol"
         " boat - 2 cells\n\n2) The game goes before somebody destroyed all "
         "opponents ships\n\n3) If player wants to surrender he/she should "
         "type 666 into next X firing\ncoordinate\n");
  printf("\nLEGEND\n~ - empty cell\n# - ship\no - missed shot\nX- shot on "
         "target/damaged ship\n");
  printf("Press Enter to go to main menu.");
  fflush(stdin);
  scanf("%c", &back);
  main();
}


x86 assembly (clang, -O0):
<goToHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1030 <system@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
lea    0x1000(%rip),%rdi
call   1040 <printf@plt>
lea    0x1044(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0x104a(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1060 <main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<goToHelp>:
push   %rax
lea    0xe98(%rip),%rdi
call   1040 <system@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0x1019(%rip),%rdi
call   1030 <puts@plt>
lea    0xe78(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xe7e(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1080 <scanf@plt>
xor    %eax,%eax
call   1070 <main@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [371 x i8] c"Welcome to BATTLESHIP - Help!\0A\0AIn this CMD edition the game is designed for 2 players behind one computer\0A\0A1) You will have to allocate your fleet on a map:\0ABattleship - 4 cells\0ASubmarine - 3 cells\0APatrol boat - 2 cells\0A\0A2) The game goes before somebody destroyed all opponents ships\0A\0A3) If player wants to surrender he/she should type 666 into next X firing\0Acoordinate\0A\00"
@.str.2 = [80 x i8] c"\0ALEGEND\0A~ - empty cell\0A# - ship\0Ao - missed shot\0AX- shot on target/damaged ship\0A\00"
@.str.3 = [32 x i8] c"Press Enter to go to main menu.\00"
@stdin = global i32 0
@.str.4 = [3 x i8] c"%c\00"
define void @goToHelp() {
%1 = alloca i8
%2 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([371 x i8], [371 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%9 = call i32 (...) @main()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.3 = [32 x i8] c"Press Enter to go to main menu.\00"
@stdin = global i32 0
@.str.4 = [3 x i8] c"%c\00"
@str = [370 x i8] c"Welcome to BATTLESHIP - Help!\0A\0AIn this CMD edition the game is designed for 2 players behind one computer\0A\0A1) You will have to allocate your fleet on a map:\0ABattleship - 4 cells\0ASubmarine - 3 cells\0APatrol boat - 2 cells\0A\0A2) The game goes before somebody destroyed all opponents ships\0A\0A3) If player wants to surrender he/she should type 666 into next X firing\0Acoordinate\00"
@str.5 = [79 x i8] c"\0ALEGEND\0A~ - empty cell\0A# - ship\0Ao - missed shot\0AX- shot on target/damaged ship\00"
define void @goToHelp() {
%1 = alloca i8
%2 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([370 x i8], [370 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = tail call i32 @fflush(i32 %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%9 = call i32 (...) @main()
ret void
}