#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 */
struct telnetd_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ telnetd_output(struct telnetd_state *, char *, char *);
void help(struct telnetd_state *s, char *str) {
  telnetd_output(s, "Available commands:", "");
  telnetd_output(s, "stats - show uIP statistics", "");
  telnetd_output(s, "exit  - exit shell", "");
  telnetd_output(s, "?     - show this help", "");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
lea    0xee1(%rip),%rdx
call   1030 <telnetd_output@plt>
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
lea    0xeca(%rip),%rdx
call   1030 <telnetd_output@plt>
mov    -0x8(%rbp),%rdi
lea    0xed7(%rip),%rsi
lea    0xeb3(%rip),%rdx
call   1030 <telnetd_output@plt>
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
lea    0xe9c(%rip),%rdx
call   1030 <telnetd_output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rsi
lea    0xeee(%rip),%r14
mov    %r14,%rdx
call   1030 <telnetd_output@plt>
lea    0xee0(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <telnetd_output@plt>
lea    0xeea(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <telnetd_output@plt>
lea    0xeeb(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <telnetd_output@plt>

LLVM IR (-O0):
%struct.telnetd_state = type { i32 }
@.str = [20 x i8] c"Available commands:\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [28 x i8] c"stats - show uIP statistics\00"
@.str.3 = [19 x i8] c"exit - exit shell\00"
@.str.4 = [23 x i8] c"? - show this help\00"
define void @help(%struct.telnetd_state* %0, i8* %1) {
%3 = alloca %struct.telnetd_state*
%4 = alloca i8*
store %struct.telnetd_state* %0, %struct.telnetd_state** %3
store i8* %1, i8** %4
%5 = load %struct.telnetd_state*, %struct.telnetd_state** %3
%6 = call i32 @telnetd_output(%struct.telnetd_state* %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = load %struct.telnetd_state*, %struct.telnetd_state** %3
%8 = call i32 @telnetd_output(%struct.telnetd_state* %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%9 = load %struct.telnetd_state*, %struct.telnetd_state** %3
%10 = call i32 @telnetd_output(%struct.telnetd_state* %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%11 = load %struct.telnetd_state*, %struct.telnetd_state** %3
%12 = call i32 @telnetd_output(%struct.telnetd_state* %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.telnetd_state = type { i32 }
@.str = [20 x i8] c"Available commands:\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [28 x i8] c"stats - show uIP statistics\00"
@.str.3 = [19 x i8] c"exit - exit shell\00"
@.str.4 = [23 x i8] c"? - show this help\00"
define void @help(%struct.telnetd_state* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @telnetd_output(%struct.telnetd_state* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @telnetd_output(%struct.telnetd_state* %0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @telnetd_output(%struct.telnetd_state* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @telnetd_output(%struct.telnetd_state* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}