#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 *);
int help_ping(int argc, char **argv) {
  printf(
      "\n\033[1mping <host> [-options]\033[0m\n"
      "  Ping the network <host>. <host> can be an ip address or name\n"
      "    options:\n"
      "     -1             ICMP mode, default\n"
      "     -2             UDP mode\n"
      "     -3             TCP mode\n"
      "     -P <protocol>  Same as above, setting ip protocol\n"
      "                    1 - icmp, 17 - udp, 6 - tcp\n"
      "     -c <count>     packet count, default 5\n"
      "     -l <size>      data size\n"
      "     -T <ttl>       set TTL, default 64\n"
      "     -s <port>      source port\n"
      "     -p <port>      destination port\n"
      "     -f <flag>      tcp head flag, |C|E|U|A|P|R|S|F|\n"
      "                              bits |7 6 5 4 3 2 1 0|\n"
      "     -t             send packet until interrupt by Ctrl+C\n"
      "     -i <ms>        wait <ms> milliseconds between sending each packet\n"
      "     -w <ms>        wait <ms> milliseconds to receive the response\n\n"
      "  Note: 1. Using names requires DNS to be set.\n"
      "        2. Use Ctrl+C to stop the command.\n");
  return 1;
}


x86 assembly (clang, -O0):
<help_ping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_ping>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [885 x i8] c"\0A\1B[1mping <host> [-options]\1B[0m\0A Ping the network <host>. <host> can be an ip address or name\0A options:\0A -1 ICMP mode, default\0A -2 UDP mode\0A -3 TCP mode\0A -P <protocol> Same as above, setting ip protocol\0A 1 - icmp, 17 - udp, 6 - tcp\0A -c <count> packet count, default 5\0A -l <size> data size\0A -T <ttl> set TTL, default 64\0A -s <port> source port\0A -p <port> destination port\0A -f <flag> tcp head flag, |C|E|U|A|P|R|S|F|\0A bits |7 6 5 4 3 2 1 0|\0A -t send packet until interrupt by Ctrl+C\0A -i <ms> wait <ms> milliseconds between sending each packet\0A -w <ms> wait <ms> milliseconds to receive the response\0A\0A Note: 1. Using names requires DNS to be set.\0A 2. Use Ctrl+C to stop the command.\0A\00"
define i32 @help_ping(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([885 x i8], [885 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [884 x i8] c"\0A\1B[1mping <host> [-options]\1B[0m\0A Ping the network <host>. <host> can be an ip address or name\0A options:\0A -1 ICMP mode, default\0A -2 UDP mode\0A -3 TCP mode\0A -P <protocol> Same as above, setting ip protocol\0A 1 - icmp, 17 - udp, 6 - tcp\0A -c <count> packet count, default 5\0A -l <size> data size\0A -T <ttl> set TTL, default 64\0A -s <port> source port\0A -p <port> destination port\0A -f <flag> tcp head flag, |C|E|U|A|P|R|S|F|\0A bits |7 6 5 4 3 2 1 0|\0A -t send packet until interrupt by Ctrl+C\0A -i <ms> wait <ms> milliseconds between sending each packet\0A -w <ms> wait <ms> milliseconds to receive the response\0A\0A Note: 1. Using names requires DNS to be set.\0A 2. Use Ctrl+C to stop the command.\00"
define i32 @help_ping(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([884 x i8], [884 x i8]* @str, i64 0, i64 0))
ret i32 1
}