#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*/ nsend(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void snpp_send_help(int fd) {
  char *helptext[] = {
      "214 KWFSNPPd Simple Network Paging Protocol daemon\r\n",
      "214 Commands are:\r\n",
      "214   PAGEr CALLSIGN - Identify pager for next message\r\n",
      "214   MESSage message contents - Short one-way message\r\n",
      "214   RESEt - Dump the pending message and start over\r\n",
      "214   SEND - Pass the entered message to the APRS-IS system\r\n",
      "214   QUIT - Terminate current session\r\n",
      "250 Ready for next command...\r\n"};
  int i;
  for (i = 0; i < 8; i++) {
    nsend(fd, helptext[i], strlen(helptext[i]));
  }
  return;
}


x86 assembly (clang, -O0):
<snpp_send_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0x2c9a(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x8,-0x54(%rbp)
jge    119e <snpp_send_help+0x6e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x64(%rbp)
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rax
mov    %rax,-0x60(%rbp)
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rdi
call   1030 <strlen@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rsi
mov    %eax,%edx
call   1050 <nsend@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1157 <snpp_send_help+0x27>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snpp_send_help>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <nsend@plt>
lea    0xeed(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <nsend@plt>
lea    0xee6(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <nsend@plt>
lea    0xf04(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <nsend@plt>
lea    0xf22(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <nsend@plt>
lea    0xf3f(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <nsend@plt>
lea    0xf62(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <nsend@plt>
lea    0xf70(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <nsend@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"214 KWFSNPPd Simple Network Paging Protocol daemon\0D\0A\00"
@.str.1 = [20 x i8] c"214 Commands are:\0D\0A\00"
@.str.2 = [57 x i8] c"214 PAGEr CALLSIGN - Identify pager for next message\0D\0A\00"
@.str.3 = [57 x i8] c"214 MESSage message contents - Short one-way message\0D\0A\00"
@.str.4 = [56 x i8] c"214 RESEt - Dump the pending message and start over\0D\0A\00"
@.str.5 = [62 x i8] c"214 SEND - Pass the entered message to the APRS-IS system\0D\0A\00"
@.str.6 = [41 x i8] c"214 QUIT - Terminate current session\0D\0A\00"
@.str.7 = [32 x i8] c"250 Ready for next command...\0D\0A\00"
@__const.snpp_send_help.helptext = [8 x i8*] [i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i32 0, i32 0)]
define void @snpp_send_help(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i8*]
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast [8 x i8*]* %3 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [8 x i8*], [8 x i8*]* %3, i64 0, i64 %12
%14 = load i8*, i8** %13
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [8 x i8*], [8 x i8*]* %3, i64 0, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 @strlen(i8* %18)
%20 = call i32 @nsend(i32 %10, i8* %14, i32 %19)
br label %21
21: ; preds = %9
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"214 KWFSNPPd Simple Network Paging Protocol daemon\0D\0A\00"
@.str.1 = [20 x i8] c"214 Commands are:\0D\0A\00"
@.str.2 = [57 x i8] c"214 PAGEr CALLSIGN - Identify pager for next message\0D\0A\00"
@.str.3 = [57 x i8] c"214 MESSage message contents - Short one-way message\0D\0A\00"
@.str.4 = [56 x i8] c"214 RESEt - Dump the pending message and start over\0D\0A\00"
@.str.5 = [62 x i8] c"214 SEND - Pass the entered message to the APRS-IS system\0D\0A\00"
@.str.6 = [41 x i8] c"214 QUIT - Terminate current session\0D\0A\00"
@.str.7 = [32 x i8] c"250 Ready for next command...\0D\0A\00"
define void @snpp_send_help(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @nsend(i32 %0, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @nsend(i32 %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @strlen(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @nsend(i32 %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = tail call i32 @strlen(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @nsend(i32 %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = tail call i32 @strlen(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call i32 @nsend(i32 %0, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = tail call i32 @strlen(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0))
%13 = tail call i32 @nsend(i32 %0, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0), i32 %12)
%14 = tail call i32 @strlen(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%15 = tail call i32 @nsend(i32 %0, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0), i32 %14)
%16 = tail call i32 @strlen(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
%17 = tail call i32 @nsend(i32 %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %16)
ret void
}