#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr, "%s",
      "perftcpdns [-huvX0] [-4|-6] [-r<rate>] [-t<report>] [-p<test-period>]\n"
      "    [-n<num-request>]* [-d<lost-time>]* [-D<max-loss>]* "
      "[-T<template-file>]\n"
      "    [-l<local-addr>] [-L<local-port>]* [-a<aggressiveness>] [-s<seed>]\n"
      "    [-M<memory>] [-x<diagnostic-selector>] [-P<port>] server\n"
      "\f\n"
      "The server argument is the name/address of the DNS server to contact.\n"
      "\n"
      "Options:\n"
      "-0: Add EDNS0 option with DO flag.\n"
      "-4: TCP/IPv4 operation (default). This is incompatible with the -6 "
      "option.\n"
      "-6: TCP/IPv6 operation. This is incompatible with the -4 option.\n"
      "-a<aggressiveness>: When the target sending rate is not yet reached,\n"
      "    control how many connections are initiated before the next pause.\n"
      "-d<lost-time>: Specify the time after which a connection or a query is\n"
      "    treated as having been lost. The value is given in seconds and\n"
      "    may contain a fractional component. The default is 1 second.\n"
      "-h: Print this help.\n"
      "-l<local-addr>: Specify the local hostname/address to use when\n"
      "    communicating with the server.\n"
      "-L<local-port>: Specify the (minimal and maximal) local port number\n"
      "-M<memory>: Size of the tables (default 60000)\n"
      "-P<port>: Specify an alternate (i.e., not 53) port\n"
      "-r<rate>: Initiate <rate> TCP DNS connections per second.  A periodic\n"
      "    report is generated showing the number of exchanges which were not\n"
      "    completed, as well as the average response latency.  The program\n"
      "    continues until interrupted, at which point a final report is\n"
      "    generated.\n"
      "-s<seed>: Specify the seed for randomization, making it repeatable.\n"
      "-t<report>: Delay in seconds between two periodic reports.\n"
      "-T<template-file>: The name of a file containing the template to use\n"
      "    as a stream of hexadecimal digits.\n"
      "-u: Use UDP in place of TCP.\n"
      "-v: Report the version number of this program.\n"
      "-X: change default template to get NXDOMAIN responses.\n"
      "-x<diagnostic-selector>: Include extended diagnostics in the output.\n"
      "    <diagnostic-selector> is a string of single-keywords specifying\n"
      "    the operations for which verbose output is desired.  The selector\n"
      "    keyletters are:\n"
      "   * 'a': print the decoded command line arguments\n"
      "   * 'e': print the exit reason\n"
      "   * 'i': print rate processing details\n"
      "   * 'T': when finished, print templates\n"
      "\n"
      "Stopping conditions:\n"
      "-D<max-loss>: Abort the test if more than <max-loss> connections or\n"
      "   queries have been lost.  If <max-loss> includes the suffix '%', it\n"
      "   specifies a maximum percentage of losses before stopping.\n"
      "   In this case, testing of the threshold begins after 10\n"
      "   connections/responses have been expected to be accepted/received.\n"
      "-n<num-request>: Initiate <num-request> transactions.  No report is\n"
      "    generated until all transactions have been initiated/waited-for,\n"
      "    after which a report is generated and the program terminates.\n"
      "-p<test-period>: Send requests for the given test period, which is\n"
      "    specified in the same manner as -d.  This can be used as an\n"
      "    alternative to -n, or both options can be given, in which case the\n"
      "    testing is completed when either limit is reached.\n"
      "\n"
      "Errors:\n"
      "- locallimit: reached to local system limits when sending a message.\n"
      "- badconn: connection failed (from getsockopt(SO_ERROR))\n"
      "- collconn: connect() timed out\n"
      "- badsent: send() failed\n"
      "- callsent: timed out waiting from a response\n"
      "- recverr: recv() system call failed\n"
      "- tooshort: received a too short message\n"
      "- badid: the id mismatches between the query and the response\n"
      "- notresp: doesn't receive a response\n"
      "Rate stats:\n"
      "- loops: number of thread loop iterations\n"
      "- shortwait: no direct activity in a thread iteration\n"
      "- compconn: computed number of connect() calls\n"
      "- lateconn: connect() already dued when computing delay to the next "
      "one\n"
      "\n"
      "Exit status:\n"
      "The exit status is:\n"
      "0 on complete success.\n"
      "1 for a general error.\n"
      "2 if an error is found in the command line arguments.\n"
      "3 if there are no general failures in operation, but one or more\n"
      "  exchanges are not successfully completed.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x3ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xed8(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x3ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xedc(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [3905 x i8] c"perftcpdns [-huvX0] [-4|-6] [-r<rate>] [-t<report>] [-p<test-period>]\0A [-n<num-request>]* [-d<lost-time>]* [-D<max-loss>]* [-T<template-file>]\0A [-l<local-addr>] [-L<local-port>]* [-a<aggressiveness>] [-s<seed>]\0A [-M<memory>] [-x<diagnostic-selector>] [-P<port>] server\0A\0C\0AThe server argument is the name/address of the DNS server to contact.\0A\0AOptions:\0A-0: Add EDNS0 option with DO flag.\0A-4: TCP/IPv4 operation (default). This is incompatible with the -6 option.\0A-6: TCP/IPv6 operation. This is incompatible with the -4 option.\0A-a<aggressiveness>: When the target sending rate is not yet reached,\0A control how many connections are initiated before the next pause.\0A-d<lost-time>: Specify the time after which a connection or a query is\0A treated as having been lost. The value is given in seconds and\0A may contain a fractional component. The default is 1 second.\0A-h: Print this help.\0A-l<local-addr>: Specify the local hostname/address to use when\0A communicating with the server.\0A-L<local-port>: Specify the (minimal and maximal) local port number\0A-M<memory>: Size of the tables (default 60000)\0A-P<port>: Specify an alternate (i.e., not 53) port\0A-r<rate>: Initiate <rate> TCP DNS connections per second. A periodic\0A report is generated showing the number of exchanges which were not\0A completed, as well as the average response latency. The program\0A continues until interrupted, at which point a final report is\0A generated.\0A-s<seed>: Specify the seed for randomization, making it repeatable.\0A-t<report>: Delay in seconds between two periodic reports.\0A-T<template-file>: The name of a file containing the template to use\0A as a stream of hexadecimal digits.\0A-u: Use UDP in place of TCP.\0A-v: Report the version number of this program.\0A-X: change default template to get NXDOMAIN responses.\0A-x<diagnostic-selector>: Include extended diagnostics in the output.\0A <diagnostic-selector> is a string of single-keywords specifying\0A the operations for which verbose output is desired. The selector\0A keyletters are:\0A * 'a': print the decoded command line arguments\0A * 'e': print the exit reason\0A * 'i': print rate processing details\0A * 'T': when finished, print templates\0A\0AStopping conditions:\0A-D<max-loss>: Abort the test if more than <max-loss> connections or\0A queries have been lost. If <max-loss> includes the suffix '%', it\0A specifies a maximum percentage of losses before stopping.\0A In this case, testing of the threshold begins after 10\0A connections/responses have been expected to be accepted/received.\0A-n<num-request>: Initiate <num-request> transactions. No report is\0A generated until all transactions have been initiated/waited-for,\0A after which a report is generated and the program terminates.\0A-p<test-period>: Send requests for the given test period, which is\0A specified in the same manner as -d. This can be used as an\0A alternative to -n, or both options can be given, in which case the\0A testing is completed when either limit is reached.\0A\0AErrors:\0A- locallimit: reached to local system limits when sending a message.\0A- badconn: connection failed (from getsockopt(SO_ERROR))\0A- collconn: connect() timed out\0A- badsent: send() failed\0A- callsent: timed out waiting from a response\0A- recverr: recv() system call failed\0A- tooshort: received a too short message\0A- badid: the id mismatches between the query and the response\0A- notresp: doesn't receive a response\0ARate stats:\0A- loops: number of thread loop iterations\0A- shortwait: no direct activity in a thread iteration\0A- compconn: computed number of connect() calls\0A- lateconn: connect() already dued when computing delay to the next one\0A\0AExit status:\0AThe exit status is:\0A0 on complete success.\0A1 for a general error.\0A2 if an error is found in the command line arguments.\0A3 if there are no general failures in operation, but one or more\0A exchanges are not successfully completed.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3905 x i8], [3905 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [3905 x i8] c"perftcpdns [-huvX0] [-4|-6] [-r<rate>] [-t<report>] [-p<test-period>]\0A [-n<num-request>]* [-d<lost-time>]* [-D<max-loss>]* [-T<template-file>]\0A [-l<local-addr>] [-L<local-port>]* [-a<aggressiveness>] [-s<seed>]\0A [-M<memory>] [-x<diagnostic-selector>] [-P<port>] server\0A\0C\0AThe server argument is the name/address of the DNS server to contact.\0A\0AOptions:\0A-0: Add EDNS0 option with DO flag.\0A-4: TCP/IPv4 operation (default). This is incompatible with the -6 option.\0A-6: TCP/IPv6 operation. This is incompatible with the -4 option.\0A-a<aggressiveness>: When the target sending rate is not yet reached,\0A control how many connections are initiated before the next pause.\0A-d<lost-time>: Specify the time after which a connection or a query is\0A treated as having been lost. The value is given in seconds and\0A may contain a fractional component. The default is 1 second.\0A-h: Print this help.\0A-l<local-addr>: Specify the local hostname/address to use when\0A communicating with the server.\0A-L<local-port>: Specify the (minimal and maximal) local port number\0A-M<memory>: Size of the tables (default 60000)\0A-P<port>: Specify an alternate (i.e., not 53) port\0A-r<rate>: Initiate <rate> TCP DNS connections per second. A periodic\0A report is generated showing the number of exchanges which were not\0A completed, as well as the average response latency. The program\0A continues until interrupted, at which point a final report is\0A generated.\0A-s<seed>: Specify the seed for randomization, making it repeatable.\0A-t<report>: Delay in seconds between two periodic reports.\0A-T<template-file>: The name of a file containing the template to use\0A as a stream of hexadecimal digits.\0A-u: Use UDP in place of TCP.\0A-v: Report the version number of this program.\0A-X: change default template to get NXDOMAIN responses.\0A-x<diagnostic-selector>: Include extended diagnostics in the output.\0A <diagnostic-selector> is a string of single-keywords specifying\0A the operations for which verbose output is desired. The selector\0A keyletters are:\0A * 'a': print the decoded command line arguments\0A * 'e': print the exit reason\0A * 'i': print rate processing details\0A * 'T': when finished, print templates\0A\0AStopping conditions:\0A-D<max-loss>: Abort the test if more than <max-loss> connections or\0A queries have been lost. If <max-loss> includes the suffix '%', it\0A specifies a maximum percentage of losses before stopping.\0A In this case, testing of the threshold begins after 10\0A connections/responses have been expected to be accepted/received.\0A-n<num-request>: Initiate <num-request> transactions. No report is\0A generated until all transactions have been initiated/waited-for,\0A after which a report is generated and the program terminates.\0A-p<test-period>: Send requests for the given test period, which is\0A specified in the same manner as -d. This can be used as an\0A alternative to -n, or both options can be given, in which case the\0A testing is completed when either limit is reached.\0A\0AErrors:\0A- locallimit: reached to local system limits when sending a message.\0A- badconn: connection failed (from getsockopt(SO_ERROR))\0A- collconn: connect() timed out\0A- badsent: send() failed\0A- callsent: timed out waiting from a response\0A- recverr: recv() system call failed\0A- tooshort: received a too short message\0A- badid: the id mismatches between the query and the response\0A- notresp: doesn't receive a response\0ARate stats:\0A- loops: number of thread loop iterations\0A- shortwait: no direct activity in a thread iteration\0A- compconn: computed number of connect() calls\0A- lateconn: connect() already dued when computing delay to the next one\0A\0AExit status:\0AThe exit status is:\0A0 on complete success.\0A1 for a general error.\0A2 if an error is found in the command line arguments.\0A3 if there are no general failures in operation, but one or more\0A exchanges are not successfully completed.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3905 x i8], [3905 x i8]* @.str.1, i64 0, i64 0))
ret void
}