#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 */
char *calloc(int, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void print_help() {
  char *help = calloc(1024, sizeof(char));
  strcpy(help, "Welcome to this simple 3D Object Viewer\n\n");
  strcat(
      help,
      "The following commands are used to manage the view of your object:\n");
  strcat(help, "  1: The polygons are filled\n");
  strcat(help, "  2: The polygons are drawn as line segments\n");
  strcat(help, "  3: The polygons are drawn by their edges\n");
  strcat(help, "  4: Enable/Disable the smooth\n");
  strcat(help, "  5: Enable/Disable the axis and the floor\n");
  strcat(help, "  z: Set up the floor\n");
  strcat(help, "  s: Set down the floor\n");
  strcat(help, "  d: Next object\n");
  strcat(help, "  q: Previous object\n");
  strcat(help, "  e: Exit\n");
  strcat(help, "The mouse is available too\n\n");
  strcat(help, "Enjoy ;)\n");
  printf("%s", help);
  free(help);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xed8(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xee6(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xf04(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xf20(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xf30(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xf4c(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xf53(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xf5c(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xf5e(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xf64(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xf5f(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xf6c(%rip),%rsi
call   1070 <strcat@plt>
mov    -0x8(%rbp),%rsi
lea    0xf66(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    $0x400,%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%rbx
lea    0xe96(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xee6(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xef5(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf14(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf31(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf42(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf5f(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf67(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf71(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf74(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf7b(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf77(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf85(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcat@plt>
lea    0xf80(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Welcome to this simple 3D Object Viewer\0A\0A\00"
@.str.1 = [68 x i8] c"The following commands are used to manage the view of your object:\0A\00"
@.str.2 = [30 x i8] c" 1: The polygons are filled\0A\00"
@.str.3 = [46 x i8] c" 2: The polygons are drawn as line segments\0A\00"
@.str.4 = [44 x i8] c" 3: The polygons are drawn by their edges\0A\00"
@.str.5 = [32 x i8] c" 4: Enable/Disable the smooth\0A\00"
@.str.6 = [44 x i8] c" 5: Enable/Disable the axis and the floor\0A\00"
@.str.7 = [23 x i8] c" z: Set up the floor\0A\00"
@.str.8 = [25 x i8] c" s: Set down the floor\0A\00"
@.str.9 = [18 x i8] c" d: Next object\0A\00"
@.str.10 = [22 x i8] c" q: Previous object\0A\00"
@.str.11 = [11 x i8] c" e: Exit\0A\00"
@.str.12 = [29 x i8] c"The mouse is available too\0A\0A\00"
@.str.13 = [10 x i8] c"Enjoy ;)\0A\00"
@.str.14 = [3 x i8] c"%s\00"
define void @print_help() {
%1 = alloca i8*
%2 = call i8* @calloc(i32 1024, i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %1
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%9 = load i8*, i8** %1
%10 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%11 = load i8*, i8** %1
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%13 = load i8*, i8** %1
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%15 = load i8*, i8** %1
%16 = call i32 @strcat(i8* %15, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%17 = load i8*, i8** %1
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%19 = load i8*, i8** %1
%20 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
%21 = load i8*, i8** %1
%22 = call i32 @strcat(i8* %21, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%23 = load i8*, i8** %1
%24 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%25 = load i8*, i8** %1
%26 = call i32 @strcat(i8* %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%27 = load i8*, i8** %1
%28 = call i32 @strcat(i8* %27, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0))
%29 = load i8*, i8** %1
%30 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0))
%31 = load i8*, i8** %1
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i8* %31)
%33 = load i8*, i8** %1
%34 = call i32 @free(i8* %33)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Welcome to this simple 3D Object Viewer\0A\0A\00"
@.str.1 = [68 x i8] c"The following commands are used to manage the view of your object:\0A\00"
@.str.2 = [30 x i8] c" 1: The polygons are filled\0A\00"
@.str.3 = [46 x i8] c" 2: The polygons are drawn as line segments\0A\00"
@.str.4 = [44 x i8] c" 3: The polygons are drawn by their edges\0A\00"
@.str.5 = [32 x i8] c" 4: Enable/Disable the smooth\0A\00"
@.str.6 = [44 x i8] c" 5: Enable/Disable the axis and the floor\0A\00"
@.str.7 = [23 x i8] c" z: Set up the floor\0A\00"
@.str.8 = [25 x i8] c" s: Set down the floor\0A\00"
@.str.9 = [18 x i8] c" d: Next object\0A\00"
@.str.10 = [22 x i8] c" q: Previous object\0A\00"
@.str.11 = [11 x i8] c" e: Exit\0A\00"
@.str.12 = [29 x i8] c"The mouse is available too\0A\0A\00"
@.str.13 = [10 x i8] c"Enjoy ;)\0A\00"
@.str.14 = [3 x i8] c"%s\00"
define void @print_help() {
%1 = tail call dereferenceable_or_null(1024) i8* @calloc(i32 1024, i32 1)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
%11 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%12 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%13 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%14 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0))
%15 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0))
%16 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i8* %1)
%17 = tail call i32 @free(i8* %1)
ret void
}