#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*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ stk_print_hello();
void stk_usage() {
  stk_print_hello();
  printf("info - show my profile\n");
  printf("list - list my friend\n");
  printf("chat - chat to my friend\n");
  printf("exit - exit client\n");
  printf("====================================================\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<stk_usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <stk_print_hello@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stk_usage>:
push   %rax
xor    %eax,%eax
call   1050 <stk_print_hello@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"info - show my profile\0A\00"
@.str.1 = [23 x i8] c"list - list my friend\0A\00"
@.str.2 = [26 x i8] c"chat - chat to my friend\0A\00"
@.str.3 = [20 x i8] c"exit - exit client\0A\00"
@.str.4 = [54 x i8] c"====================================================\0A\00"
@stdout = global i32 0
define void @stk_usage() {
%1 = call i32 (...) @stk_print_hello()
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [23 x i8] c"info - show my profile\00"
@str.5 = [22 x i8] c"list - list my friend\00"
@str.6 = [25 x i8] c"chat - chat to my friend\00"
@str.7 = [19 x i8] c"exit - exit client\00"
@str.8 = [53 x i8] c"====================================================\00"
define void @stk_usage() {
%1 = tail call i32 (...) @stk_print_hello()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.7, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.8, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
ret void
}