#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*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ system_clear();
void show_help() {
  char *HELP =
      "This is a very simple version of the Conway's Game of Life.\nIt uses a "
      "40x20 board represented by a Cartesian coordinate system. The\norigin "
      "is at the bottom left corner.\n\nThe status bar the the top shows the "
      "number of iterations (generations) and\nthe number of active "
      "cells.\n\nThe command line is located at the bottom. There are four "
      "posible commands:\n    - n: run the (n)ext iteration. The Return key "
      "performs the same action.\n    - t: (t)oggle the state of a given cell. "
      "Further input will be needed for\n         the coordinates in the form "
      "x,y.\n    - i: display (i)nformation about a given cell\n    - h: "
      "display this (h)elp text.\n    - q: (q)uit the game.\n\nThe first "
      "argument to the executable is optional, and should point to a "
      "text\nfile that contains coordinates (in the form x,y) for active "
      "cells.\nIn case the file cannot be opened, it will be ignored.\n";
  system_clear();
  printf("%s", HELP);
  getchar();
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <system_clear@plt>
mov    -0x8(%rbp),%rsi
lea    0x1206(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
push   %rax
xor    %eax,%eax
call   1050 <system_clear@plt>
lea    0x121c(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [859 x i8] c"This is a very simple version of the Conway's Game of Life.\0AIt uses a 40x20 board represented by a Cartesian coordinate system. The\0Aorigin is at the bottom left corner.\0A\0AThe status bar the the top shows the number of iterations (generations) and\0Athe number of active cells.\0A\0AThe command line is located at the bottom. There are four posible commands:\0A - n: run the (n)ext iteration. The Return key performs the same action.\0A - t: (t)oggle the state of a given cell. Further input will be needed for\0A the coordinates in the form x,y.\0A - i: display (i)nformation about a given cell\0A - h: display this (h)elp text.\0A - q: (q)uit the game.\0A\0AThe first argument to the executable is optional, and should point to a text\0Afile that contains coordinates (in the form x,y) for active cells.\0AIn case the file cannot be opened, it will be ignored.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @show_help() {
%1 = alloca i8*
store i8* getelementptr inbounds ([859 x i8], [859 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i32 (...) @system_clear()
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [859 x i8] c"This is a very simple version of the Conway's Game of Life.\0AIt uses a 40x20 board represented by a Cartesian coordinate system. The\0Aorigin is at the bottom left corner.\0A\0AThe status bar the the top shows the number of iterations (generations) and\0Athe number of active cells.\0A\0AThe command line is located at the bottom. There are four posible commands:\0A - n: run the (n)ext iteration. The Return key performs the same action.\0A - t: (t)oggle the state of a given cell. Further input will be needed for\0A the coordinates in the form x,y.\0A - i: display (i)nformation about a given cell\0A - h: display this (h)elp text.\0A - q: (q)uit the game.\0A\0AThe first argument to the executable is optional, and should point to a text\0Afile that contains coordinates (in the form x,y) for active cells.\0AIn case the file cannot be opened, it will be ignored.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @show_help() {
%1 = tail call i32 (...) @system_clear()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([859 x i8], [859 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
ret void
}