#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 *, char *);
int print_help() {
  char buf[] = "Commands list in dwd:\n"
               "s/ step:\n"
               "\tForward a single step.\n"
               "c/ continue:\n"
               "\tContinue to run the process.\n"
               "q/ quit:\n"
               "\tQuit.\n"
               "b/ bp/ breakpoint <address>:\n"
               "\tSet a breakpoint.\n"
               "ds <address>:\n"
               "\tJust disassembly only one instruction.\n"
               "disas/ disass/ disassembly <address>:\n"
               "\tDisassembly codes.\n"
               "x/[len][format flag] <memory-address/register>:\n"
               "\tShow the value of memory or register.\n"
               "\tFormat flag can be 'x'(4 bytes) , 'b'(1 byte), "
               "or 's'(string). \n"
               "\tAnd register can be '$all', "
               "'$regs'(display all the registers), \n"
               "\t'$eip', '$esp', '$ebp', '$eax', '$ebx', '$ecx', '$edx', "
               "'$esi', \n"
               "\t'$edi', '$xds', '$xes', '$xfs', '$xgs', '$xcs', '$xss',"
               "'$eflags', \n"
               "\t'$orig_eax'.\n"
               "set <memory-address/register>=<value>:\n"
               "\tAlter the value of memory or register. \n"
               "\tAnd register can be '$eip', '$esp', '$ebp', '$eax', "
               "'$ebx',\n"
               "\t'$ecx', '$edx', '$esi', '$edi', '$xds', '$xes', '$xfs',\n"
               "\t'$xgs', '$xcs', '$xss', '$eflags', '$orig_eax'.\n";
  printf("%s", buf);
  return 0;
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x380,%rsp
lea    -0x380(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x378,%edx
call   1040 <memcpy@plt>
lea    -0x380(%rbp),%rsi
lea    0x1227(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x380,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
sub    $0x380,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0x378,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
lea    0x1232(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x380,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.print_help.buf = [888 x i8] c"Commands list in dwd:\0As/ step:\0A\09Forward a single step.\0Ac/ continue:\0A\09Continue to run the process.\0Aq/ quit:\0A\09Quit.\0Ab/ bp/ breakpoint <address>:\0A\09Set a breakpoint.\0Ads <address>:\0A\09Just disassembly only one instruction.\0Adisas/ disass/ disassembly <address>:\0A\09Disassembly codes.\0Ax/[len][format flag] <memory-address/register>:\0A\09Show the value of memory or register.\0A\09Format flag can be 'x'(4 bytes) , 'b'(1 byte), or 's'(string). \0A\09And register can be '$all', '$regs'(display all the registers), \0A\09'$eip', '$esp', '$ebp', '$eax', '$ebx', '$ecx', '$edx', '$esi', \0A\09'$edi', '$xds', '$xes', '$xfs', '$xgs', '$xcs', '$xss','$eflags', \0A\09'$orig_eax'.\0Aset <memory-address/register>=<value>:\0A\09Alter the value of memory or register. \0A\09And register can be '$eip', '$esp', '$ebp', '$eax', '$ebx',\0A\09'$ecx', '$edx', '$esi', '$edi', '$xds', '$xes', '$xfs',\0A\09'$xgs', '$xcs', '$xss', '$eflags', '$orig_eax'.\0A\00"
@.str = [3 x i8] c"%s\00"
define i32 @print_help() {
%1 = alloca [888 x i8]
%2 = bitcast [888 x i8]* %1 to i8*
%3 = getelementptr inbounds [888 x i8], [888 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@__const.print_help.buf = [888 x i8] c"Commands list in dwd:\0As/ step:\0A\09Forward a single step.\0Ac/ continue:\0A\09Continue to run the process.\0Aq/ quit:\0A\09Quit.\0Ab/ bp/ breakpoint <address>:\0A\09Set a breakpoint.\0Ads <address>:\0A\09Just disassembly only one instruction.\0Adisas/ disass/ disassembly <address>:\0A\09Disassembly codes.\0Ax/[len][format flag] <memory-address/register>:\0A\09Show the value of memory or register.\0A\09Format flag can be 'x'(4 bytes) , 'b'(1 byte), or 's'(string). \0A\09And register can be '$all', '$regs'(display all the registers), \0A\09'$eip', '$esp', '$ebp', '$eax', '$ebx', '$ecx', '$edx', '$esi', \0A\09'$edi', '$xds', '$xes', '$xfs', '$xgs', '$xcs', '$xss','$eflags', \0A\09'$orig_eax'.\0Aset <memory-address/register>=<value>:\0A\09Alter the value of memory or register. \0A\09And register can be '$eip', '$esp', '$ebp', '$eax', '$ebx',\0A\09'$ecx', '$edx', '$esi', '$edi', '$xds', '$xes', '$xfs',\0A\09'$xgs', '$xcs', '$xss', '$eflags', '$orig_eax'.\0A\00"
@.str = [3 x i8] c"%s\00"
define i32 @print_help() {
%1 = alloca [888 x i8]
%2 = getelementptr inbounds [888 x i8], [888 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}