#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*/ Write(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ strLen(char *);
void displayHelp(void) {
  char WriteData[23];
  sprintf(WriteData, "train nn -s mnn -e mnn");
  Write(WriteData, strLen(WriteData), 1);
  sprintf(WriteData, "\nexample:\n");
  Write(WriteData, strLen(WriteData), 1);
  sprintf(WriteData, "train 12 -s A01 -e B15");
  Write(WriteData, strLen(WriteData), 1);
  sprintf(WriteData, "\n");
  Write(WriteData, strLen(WriteData), 1);
  sprintf(WriteData, "train 12 -s xxx -e B15");
  Write(WriteData, strLen(WriteData), 1);
  sprintf(WriteData, "\nrun mission\n");
  Write(WriteData, strLen(WriteData), 1);
  sprintf(WriteData, "run random\n");
  Write(WriteData, strLen(WriteData), 1);
  sprintf(WriteData, "run init\n");
  Write(WriteData, strLen(WriteData), 1);
  sprintf(WriteData, "halt\n");
  Write(WriteData, strLen(WriteData), 1);
}


x86 assembly (clang, -O0):
<displayHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x20(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strLen@plt>
mov    -0x68(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
lea    -0x20(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strLen@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
lea    -0x20(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strLen@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
lea    -0x20(%rbp),%rdi
lea    0xe4a(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strLen@plt>
mov    -0x50(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
lea    -0x20(%rbp),%rdi
lea    0xe32(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strLen@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
lea    -0x20(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strLen@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
lea    -0x20(%rbp),%rdi
lea    0xdf5(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strLen@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
lea    -0x20(%rbp),%rdi
lea    0xdd0(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strLen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
lea    -0x20(%rbp),%rdi
lea    0xda9(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strLen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayHelp>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movups 0xed2(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x6e6e6d20652d20,%rax
mov    %rax,0xf(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
movabs $0x656c706d6178650a,%rax
70 6c 65
mov    %rax,(%rsp)
movl   $0xa3a65,0x7(%rsp)
mov    %rbx,%rdi
call   1040 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
movabs $0x35314220652d20,%r14
mov    %r14,0xf(%rsp)
movups 0xe84(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
call   1040 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
movw   $0xa,(%rsp)
mov    %rbx,%rdi
call   1040 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
mov    %r14,0xf(%rsp)
movups 0xe57(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rbx,%rdi
call   1040 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
movabs $0x73696d206e75720a,%rax
6d 69 73
mov    %rax,(%rsp)
movabs $0xa6e6f69737369,%rax
mov    %rax,0x6(%rsp)
mov    %rbx,%rdi
call   1040 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
movabs $0x646e6172206e7572,%rax
61 6e 64
mov    %rax,(%rsp)
movl   $0xa6d6f,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
movabs $0x74696e69206e7572,%rax
6e 69 74
mov    %rax,(%rsp)
movw   $0xa,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
movl   $0x746c6168,(%rsp)
movw   $0xa,0x4(%rsp)
mov    %rbx,%rdi
call   1040 <strLen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <Write@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"train nn -s mnn -e mnn\00"
@.str.1 = [11 x i8] c"\0Aexample:\0A\00"
@.str.2 = [23 x i8] c"train 12 -s A01 -e B15\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [23 x i8] c"train 12 -s xxx -e B15\00"
@.str.5 = [14 x i8] c"\0Arun mission\0A\00"
@.str.6 = [12 x i8] c"run random\0A\00"
@.str.7 = [10 x i8] c"run init\0A\00"
@.str.8 = [6 x i8] c"halt\0A\00"
define void @displayHelp() {
%1 = alloca [23 x i8]
%2 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%6 = call i32 @strLen(i8* %5)
%7 = call i32 @Write(i8* %4, i32 %6, i32 1)
%8 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%9 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%11 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%12 = call i32 @strLen(i8* %11)
%13 = call i32 @Write(i8* %10, i32 %12, i32 1)
%14 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%15 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%17 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%18 = call i32 @strLen(i8* %17)
%19 = call i32 @Write(i8* %16, i32 %18, i32 1)
%20 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%21 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%22 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%23 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%24 = call i32 @strLen(i8* %23)
%25 = call i32 @Write(i8* %22, i32 %24, i32 1)
%26 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%27 = call i32 @sprintf(i8* %26, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%28 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%29 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%30 = call i32 @strLen(i8* %29)
%31 = call i32 @Write(i8* %28, i32 %30, i32 1)
%32 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%33 = call i32 @sprintf(i8* %32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%34 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%35 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%36 = call i32 @strLen(i8* %35)
%37 = call i32 @Write(i8* %34, i32 %36, i32 1)
%38 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%39 = call i32 @sprintf(i8* %38, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%40 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%41 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%42 = call i32 @strLen(i8* %41)
%43 = call i32 @Write(i8* %40, i32 %42, i32 1)
%44 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%45 = call i32 @sprintf(i8* %44, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%46 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%47 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%48 = call i32 @strLen(i8* %47)
%49 = call i32 @Write(i8* %46, i32 %48, i32 1)
%50 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%51 = call i32 @sprintf(i8* %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%52 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%53 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%54 = call i32 @strLen(i8* %53)
%55 = call i32 @Write(i8* %52, i32 %54, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"train nn -s mnn -e mnn\00"
@.str.1 = [11 x i8] c"\0Aexample:\0A\00"
@.str.2 = [23 x i8] c"train 12 -s A01 -e B15\00"
@.str.4 = [23 x i8] c"train 12 -s xxx -e B15\00"
@.str.5 = [14 x i8] c"\0Arun mission\0A\00"
@.str.6 = [12 x i8] c"run random\0A\00"
@.str.7 = [10 x i8] c"run init\0A\00"
@.str.8 = [6 x i8] c"halt\0A\00"
define void @displayHelp() {
%1 = alloca [23 x i8]
%2 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%3 = call i32 @strLen(i8* %2)
%4 = call i32 @Write(i8* %2, i32 %3, i32 1)
%5 = call i32 @strLen(i8* %2)
%6 = call i32 @Write(i8* %2, i32 %5, i32 1)
%7 = call i32 @strLen(i8* %2)
%8 = call i32 @Write(i8* %2, i32 %7, i32 1)
%9 = bitcast [23 x i8]* %1 to i16*
store i16 10, i16* %9
%10 = call i32 @strLen(i8* %2)
%11 = call i32 @Write(i8* %2, i32 %10, i32 1)
%12 = call i32 @strLen(i8* %2)
%13 = call i32 @Write(i8* %2, i32 %12, i32 1)
%14 = call i32 @strLen(i8* %2)
%15 = call i32 @Write(i8* %2, i32 %14, i32 1)
%16 = call i32 @strLen(i8* %2)
%17 = call i32 @Write(i8* %2, i32 %16, i32 1)
%18 = call i32 @strLen(i8* %2)
%19 = call i32 @Write(i8* %2, i32 %18, i32 1)
%20 = call i32 @strLen(i8* %2)
%21 = call i32 @Write(i8* %2, i32 %20, i32 1)
ret void
}