#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*/ ungets();
void printUsage() {
  printf("\n");
  printf("Supported commands:\n\n");
  printf("Arithmetic: "
         "\n\t'+', '-', '*', '/, '^', "
         "\n\t'_s' (sin), '_c' (cos), '_e' (exp)\n\n");
  printf("Advanced: \n\t'p'- print stack, "
         "\n\t's' - swap the top two in stack,"
         "\n\t'd' - duplicate stack, "
         "\n\t'c' - clear stack\n\n");
  printf("Variables: "
         "\n\t'_l' (last result), "
         "\n\t'@[0-9]' (set gen. purpose variable),"
         "\n\t'_[0-9]' (use gen. purpose variable)\n\n");
  printf("example string '1 2 + 2 3 + +' loaded in stack\n");
  printf("\tthis results to (3 5 +) or:\n");
  ungets();
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0x1016(%rip),%rdi
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
lea    0xf14(%rip),%rdi
call   1040 <printf@plt>
lea    0xf77(%rip),%rdi
call   1040 <printf@plt>
lea    0xfdc(%rip),%rdi
call   1040 <printf@plt>
lea    0x1000(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <ungets@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
lea    0xf07(%rip),%rdi
call   1040 <puts@plt>
lea    0xf69(%rip),%rdi
call   1040 <puts@plt>
lea    0xfcd(%rip),%rdi
call   1040 <puts@plt>
lea    0xff0(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ungets@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [22 x i8] c"Supported commands:\0A\0A\00"
@.str.2 = [77 x i8] c"Arithmetic: \0A\09'+', '-', '*', '/, '^', \0A\09'_s' (sin), '_c' (cos), '_e' (exp)\0A\0A\00"
@.str.3 = [111 x i8] c"Advanced: \0A\09'p'- print stack, \0A\09's' - swap the top two in stack,\0A\09'd' - duplicate stack, \0A\09'c' - clear stack\0A\0A\00"
@.str.4 = [113 x i8] c"Variables: \0A\09'_l' (last result), \0A\09'@[0-9]' (set gen. purpose variable),\0A\09'_[0-9]' (use gen. purpose variable)\0A\0A\00"
@.str.5 = [48 x i8] c"example string '1 2 + 2 3 + +' loaded in stack\0A\00"
@.str.6 = [30 x i8] c"\09this results to (3 5 +) or:\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 (...) @ungets()
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Supported commands:\0A\00"
@str.7 = [76 x i8] c"Arithmetic: \0A\09'+', '-', '*', '/, '^', \0A\09'_s' (sin), '_c' (cos), '_e' (exp)\0A\00"
@str.8 = [110 x i8] c"Advanced: \0A\09'p'- print stack, \0A\09's' - swap the top two in stack,\0A\09'd' - duplicate stack, \0A\09'c' - clear stack\0A\00"
@str.9 = [112 x i8] c"Variables: \0A\09'_l' (last result), \0A\09'@[0-9]' (set gen. purpose variable),\0A\09'_[0-9]' (use gen. purpose variable)\0A\00"
@str.10 = [47 x i8] c"example string '1 2 + 2 3 + +' loaded in stack\00"
@str.11 = [29 x i8] c"\09this results to (3 5 +) or:\00"
define void @printUsage() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str.7, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([110 x i8], [110 x i8]* @str.8, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([112 x i8], [112 x i8]* @str.9, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.10, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 (...) @ungets()
ret void
}