#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 timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct in_addr {
  int dummy;
};
struct sockaddr_in {
  struct in_addr sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  char *h_name;
  scalar_t__ h_addr;
  int /*<<< orphan*/ h_length;
  int /*<<< orphan*/ *h_addr_list;
};
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ cliet_add;
typedef int /*<<< orphan*/ buff;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
scalar_t__ close(int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, ...);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
char *inet_ntoa(struct in_addr);
int /*<<< orphan*/ memcpy(struct in_addr *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, struct timeval *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, ...);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
char *strstr(char *, char *);
int write(int, char *, int /*<<< orphan*/);
void get_rss(char *rss_url, char *rss_file) {
  char servername[256];
  char buff[1024 * 100];
  char *ch = NULL;
  char *ch2 = NULL;
  char *title = NULL;
  char *link = NULL;
  int ret = 0, rech = 0;
  int rss_socket;
  struct sockaddr_in cliet_add;
  struct hostent *site;
  struct timeval tv;
  fd_set readfds;
  FILE *fp;
  ch = strstr(rss_url, "http://");
  rss_url = ch;
  ch2 = ch + 7;
  ch = strstr(ch2, "/");
  snprintf(servername, ch - ch2 + 1, "%s", ch2);
  printf("servername: %s \n", servername);
  site = gethostbyname(servername);
  printf("Host name : %s\n", site->h_name);
  printf("IP Address : %s\n", inet_ntoa(*((struct in_addr *)site->h_addr)));
  printf("servername: %s \n", servername);
  if ((rss_socket = socket(PF_INET, SOCK_STREAM, 0)) > 0)
    printf("The socket has been created\n");
  else {
    perror("Could not create socket");
    exit(1);
  }
  memset(&cliet_add, 0, sizeof(struct sockaddr_in));
  cliet_add.sin_family = AF_INET;
  memcpy(&cliet_add.sin_addr, site->h_addr_list[0], site->h_length);
  cliet_add.sin_port = htons(80);
  if (connect(rss_socket, (struct sockaddr *)&cliet_add, sizeof(cliet_add)) ==
      0)
    printf("Connected to host %s\n", inet_ntoa(cliet_add.sin_addr));
  else {
    perror("Could not connect");
    exit(2);
  }
  printf("buff: %s \n", "buff");
  snprintf(buff, sizeof(buff), "GET %s HTTP/1.1\nHost: %s:%s\n%s%s", rss_url,
           inet_ntoa(*((struct in_addr *)site->h_addr)), "80",
           "Accept: "
           "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n",
           "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\nKeep-Alive: "
           "300\nConnection: keep-alive\n\n");
  printf("buff: %s \n", buff);
  if (write(rss_socket, buff, strlen(buff)) == -1)
    printf(" send error\n");
  FD_ZERO(&readfds);
  FD_SET(rss_socket, &readfds);
  tv.tv_sec = 5;
  tv.tv_usec = 0;
  select(rss_socket + 1, &readfds, NULL, NULL, &tv);
  if (FD_ISSET(rss_socket, &readfds)) {
    while ((ret = read(rss_socket, buff + rech, sizeof(buff) - rech)) > 0) {
      rech += ret;
    }
  }
  if (close(rss_socket) != 0)
    perror("Warning: problem closing our_socket");
  ch = strstr(buff, "<channel>");
  if (ch) {
    ch = strstr(ch, "<title>");
    ch2 = strstr(ch, "</title>");
    *ch2 = '\0';
    printf("title: %s \n", ch + 7);
  }
  fp = fopen(rss_file, "wb+");
  printf("rss_file : %s rss_url: %s\n", rss_file, rss_url);
  fprintf(fp, "%s\n", rss_url);
  do {
    ch = strstr(ch2 + 1, "<item>");
    if (ch) {
      ch2 = strstr(ch, "</item>");
      if (ch2) {
        ch = strstr(ch, "<title>");
        ch2 = strstr(ch, "</title>");
        *ch2 = '\0';
        title = ch + 7;
        ch = strstr(ch2 + 1, "<link>");
        ch2 = strstr(ch, "</link>");
        *ch2 = '\0';
        link = ch + 6;
        fprintf(fp, "%s %s\n", title, link);
      } else
        continue;
    } else
      continue;
  } while (ch);
  fclose(fp);
  printf("over\n");
  return;
}


x86 assembly (clang, -O0):
<get_rss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x191a0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x19118(%rbp)
movq   $0x0,-0x19120(%rbp)
movq   $0x0,-0x19128(%rbp)
movq   $0x0,-0x19130(%rbp)
movl   $0x0,-0x19134(%rbp)
movl   $0x0,-0x19138(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xd32(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19118(%rbp)
mov    -0x19118(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x19118(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x19120(%rbp)
mov    -0x19120(%rbp),%rdi
lea    0xd01(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19118(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x19118(%rbp),%rax
mov    -0x19120(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%esi
mov    -0x19120(%rbp),%rcx
lea    0xd88(%rip),%rdx
mov    $0x0,%al
call   10a0 <snprintf@plt>
lea    -0x110(%rbp),%rsi
lea    0xcb6(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x110(%rbp),%rdi
call   10e0 <gethostbyname@plt>
mov    %rax,-0x19150(%rbp)
mov    -0x19150(%rbp),%rax
mov    (%rax),%rsi
lea    0xc9c(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x19150(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%edi
call   1050 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xc89(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xc53(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    0x2c0d(%rip),%rax
mov    (%rax),%edi
mov    0x2c0c(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1190 <socket@plt>
mov    %eax,-0x1913c(%rbp)
cmp    $0x0,%eax
jle    13f7 <get_rss+0x187>
lea    0xc4f(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    140d <get_rss+0x19d>
lea    0xc59(%rip),%rdi
call   1140 <perror@plt>
mov    $0x1,%edi
call   1150 <exit@plt>
lea    -0x19148(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10b0 <memset@plt>
mov    0x2bc1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x19140(%rbp)
lea    -0x19148(%rbp),%rdi
mov    -0x19150(%rbp),%rax
mov    0x18(%rax),%rax
mov    (%rax),%esi
mov    -0x19150(%rbp),%rax
mov    0x10(%rax),%edx
call   1100 <memcpy@plt>
mov    $0x50,%edi
call   1080 <htons@plt>
mov    %eax,-0x19144(%rbp)
mov    -0x1913c(%rbp),%edi
lea    -0x19148(%rbp),%rsi
mov    $0xc,%edx
call   1160 <connect@plt>
cmp    $0x0,%rax
jne    14a4 <get_rss+0x234>
mov    -0x19148(%rbp),%edi
call   1050 <inet_ntoa@plt>
mov    %rax,%rsi
lea    0xbd7(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    14ba <get_rss+0x24a>
lea    0xbda(%rip),%rdi
call   1140 <perror@plt>
mov    $0x2,%edi
call   1150 <exit@plt>
lea    0xbd6(%rip),%rdi
lea    0xbda(%rip),%rsi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x19110(%rbp),%rax
mov    %rax,-0x19190(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x19188(%rbp)
mov    -0x19150(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%edi
call   1050 <inet_ntoa@plt>
mov    -0x19190(%rbp),%rdi
mov    -0x19188(%rbp),%rcx
mov    %rax,%r8
mov    $0x19000,%esi
lea    0xb90(%rip),%rdx
lea    0xbaa(%rip),%r9
lea    0xba6(%rip),%r10
lea    0xbe8(%rip),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   10a0 <snprintf@plt>
lea    -0x19110(%rbp),%rsi
lea    0xb4d(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x1913c(%rbp),%eax
mov    %eax,-0x1917c(%rbp)
lea    -0x19110(%rbp),%rax
mov    %rax,-0x19178(%rbp)
lea    -0x19110(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0x1917c(%rbp),%edi
mov    -0x19178(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    15a2 <get_rss+0x332>
lea    0xbd1(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x19164(%rbp),%rdi
call   1110 <FD_ZERO@plt>
mov    -0x1913c(%rbp),%edi
lea    -0x19164(%rbp),%rsi
call   1170 <FD_SET@plt>
movl   $0x5,-0x19160(%rbp)
movq   $0x0,-0x19158(%rbp)
mov    -0x1913c(%rbp),%edi
add    $0x1,%edi
lea    -0x19164(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x19160(%rbp),%r8
mov    %rcx,%rdx
call   1120 <select@plt>
mov    -0x1913c(%rbp),%edi
lea    -0x19164(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1671 <get_rss+0x401>
jmp    1619 <get_rss+0x3a9>
mov    -0x1913c(%rbp),%edi
lea    -0x19110(%rbp),%rsi
movslq -0x19138(%rbp),%rax
add    %rax,%rsi
movslq -0x19138(%rbp),%rcx
mov    $0x19000,%eax
sub    %rcx,%rax
mov    %eax,%edx
call   10d0 <read@plt>
mov    %eax,-0x19134(%rbp)
cmp    $0x0,%eax
jle    166c <get_rss+0x3fc>
mov    -0x19134(%rbp),%eax
add    -0x19138(%rbp),%eax
mov    %eax,-0x19138(%rbp)
jmp    1619 <get_rss+0x3a9>
jmp    1671 <get_rss+0x401>
mov    -0x1913c(%rbp),%edi
call   10c0 <close@plt>
cmp    $0x0,%rax
je     1692 <get_rss+0x422>
lea    0xaec(%rip),%rdi
call   1140 <perror@plt>
lea    -0x19110(%rbp),%rdi
lea    0xafd(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19118(%rbp)
cmpq   $0x0,-0x19118(%rbp)
je     1711 <get_rss+0x4a1>
mov    -0x19118(%rbp),%rdi
lea    0xadf(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19118(%rbp)
mov    -0x19118(%rbp),%rdi
lea    0xacd(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19120(%rbp)
mov    -0x19120(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x19118(%rbp),%rsi
add    $0x7,%rsi
lea    0xaae(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xaa8(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x19170(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xa91(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x19170(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0x8d5(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
mov    -0x19120(%rbp),%rdi
add    $0x1,%rdi
lea    0xa7a(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19118(%rbp)
cmpq   $0x0,-0x19118(%rbp)
je     1881 <get_rss+0x611>
mov    -0x19118(%rbp),%rdi
lea    0xa59(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19120(%rbp)
cmpq   $0x0,-0x19120(%rbp)
je     1877 <get_rss+0x607>
mov    -0x19118(%rbp),%rdi
lea    0x9ee(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19118(%rbp)
mov    -0x19118(%rbp),%rdi
lea    0x9dc(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19120(%rbp)
mov    -0x19120(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x19118(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x19128(%rbp)
mov    -0x19120(%rbp),%rdi
add    $0x1,%rdi
lea    0x9e5(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19118(%rbp)
mov    -0x19118(%rbp),%rdi
lea    0x9d2(%rip),%rsi
call   1180 <strstr@plt>
mov    %rax,-0x19120(%rbp)
mov    -0x19120(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x19118(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x19130(%rbp)
mov    -0x19170(%rbp),%rdi
mov    -0x19128(%rbp),%rdx
mov    -0x19130(%rbp),%rcx
lea    0x996(%rip),%rsi
mov    $0x0,%al
call   10f0 <fprintf@plt>
jmp    187c <get_rss+0x60c>
jmp    188b <get_rss+0x61b>
jmp    1886 <get_rss+0x616>
jmp    188b <get_rss+0x61b>
jmp    188b <get_rss+0x61b>
cmpq   $0x0,-0x19118(%rbp)
jne    1757 <get_rss+0x4e7>
mov    -0x19170(%rbp),%rdi
call   1060 <fclose@plt>
lea    0x95c(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
add    $0x191a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rss>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x19138,%rsp
mov    %rsi,0x10(%rsp)
lea    0xd53(%rip),%rsi
call   11a0 <strstr@plt>
mov    %rax,%r14
lea    0x7(%rax),%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   10a0 <strchr@plt>
sub    %ebx,%eax
lea    0x1(%rax),%esi
lea    0xdd6(%rip),%rdx
lea    0x30(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rcx
xor    %eax,%eax
call   10c0 <snprintf@plt>
lea    0xd1d(%rip),%r13
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    %rbp,%rdi
call   1100 <gethostbyname@plt>
mov    %rax,%r12
mov    (%rax),%rsi
lea    0xd0c(%rip),%rdi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    0x8(%r12),%rax
mov    (%rax),%edi
call   1060 <inet_ntoa@plt>
lea    0xd02(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
mov    0x2c8a(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   11b0 <socket@plt>
test   %eax,%eax
jle    1689 <get_rss+0x3f9>
mov    %eax,%r15d
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10d0 <memset@plt>
mov    0x2c61(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x18(%r12),%rax
mov    (%rax),%esi
mov    0x10(%r12),%edx
mov    %r13,%rdi
call   1120 <memcpy@plt>
mov    $0x50,%edi
call   1090 <htons@plt>
mov    %eax,0x4(%rsp)
mov    %r15d,%edi
mov    %r13,%rsi
mov    $0xc,%edx
call   1180 <connect@plt>
test   %rax,%rax
jne    169f <get_rss+0x40f>
mov    (%rsp),%edi
call   1060 <inet_ntoa@plt>
lea    0xc7b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
lea    0xc92(%rip),%r13
lea    0xc96(%rip),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    0x8(%r12),%rax
mov    (%rax),%edi
call   1060 <inet_ntoa@plt>
lea    0xceb(%rip),%rbp
lea    0xc9b(%rip),%r10
lea    0xc70(%rip),%rdx
lea    0xc8a(%rip),%r9
lea    0x130(%rsp),%r12
mov    %r12,%rdi
mov    $0x19000,%esi
mov    %r14,%rcx
mov    %rax,%r8
xor    %eax,%eax
push   %rbp
push   %r10
call   10c0 <snprintf@plt>
add    $0x10,%rsp
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    %r12,%rdi
call   1080 <strlen@plt>
mov    %r15d,%edi
mov    %r12,%rsi
mov    %eax,%edx
call   1040 <write@plt>
cmp    $0xffffffff,%eax
jne    1478 <get_rss+0x1e8>
lea    0xd8c(%rip),%rdi
call   1030 <puts@plt>
lea    0x1c(%rsp),%r12
mov    %r12,%rdi
call   1130 <FD_ZERO@plt>
mov    %r15d,%edi
mov    %r12,%rsi
call   1190 <FD_SET@plt>
movl   $0x5,0x20(%rsp)
movq   $0x0,0x28(%rsp)
mov    %r15d,%edi
add    $0x1,%edi
xor    %ebp,%ebp
lea    0x20(%rsp),%r8
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1140 <select@plt>
mov    %r15d,%edi
mov    %r12,%rsi
call   1050 <FD_ISSET@plt>
test   %rax,%rax
je     14f3 <get_rss+0x263>
nopw   0x0(%rax,%rax,1)
movslq %ebp,%rbp
lea    (%rsp,%rbp,1),%rsi
add    $0x130,%rsi
mov    $0x19000,%edx
sub    %ebp,%edx
mov    %r15d,%edi
call   10f0 <read@plt>
add    %eax,%ebp
test   %eax,%eax
jg     14d0 <get_rss+0x240>
mov    %r15d,%edi
call   10e0 <close@plt>
test   %rax,%rax
jne    1678 <get_rss+0x3e8>
lea    0xc68(%rip),%rsi
lea    0x130(%rsp),%rdi
call   11a0 <strstr@plt>
test   %rax,%rax
je     1559 <get_rss+0x2c9>
lea    0xc59(%rip),%rsi
mov    %rax,%rdi
call   11a0 <strstr@plt>
mov    %rax,%rbp
lea    0xc4f(%rip),%rsi
mov    %rax,%rdi
call   11a0 <strstr@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
add    $0x7,%rbp
lea    0xc3f(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
lea    0xc3a(%rip),%rsi
mov    0x10(%rsp),%r15
mov    %r15,%rdi
call   1150 <fopen@plt>
mov    %rax,%rbp
lea    0xc27(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   10b0 <printf@plt>
lea    0xa9a(%rip),%rsi
mov    %rbp,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1110 <fprintf@plt>
lea    0xc1a(%rip),%r14
lea    0xc1a(%rip),%r15
jmp    1620 <get_rss+0x390>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
lea    0xbc3(%rip),%rsi
call   11a0 <strstr@plt>
mov    %rax,%r12
mov    %rax,%rdi
lea    0xbb9(%rip),%rsi
call   11a0 <strstr@plt>
movb   $0x0,(%rax)
add    $0x7,%r12
lea    0x1(%rax),%rdi
lea    0xbe5(%rip),%rsi
call   11a0 <strstr@plt>
mov    %rax,%r13
mov    %rax,%rdi
lea    0xbda(%rip),%rsi
call   11a0 <strstr@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
mov    %r13,%rcx
add    $0x6,%rcx
mov    %rbp,%rdi
lea    0xbc6(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1110 <fprintf@plt>
test   %r13,%r13
je     1652 <get_rss+0x3c2>
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   11a0 <strstr@plt>
test   %rax,%rax
je     1652 <get_rss+0x3c2>
mov    %rax,%r13
mov    %rax,%rdi
mov    %r15,%rsi
call   11a0 <strstr@plt>
test   %rax,%rax
jne    15b0 <get_rss+0x320>
xor    %ebx,%ebx
test   %r13,%r13
jne    1620 <get_rss+0x390>
mov    %rbp,%rdi
call   1070 <fclose@plt>
lea    0xb99(%rip),%rdi
call   1030 <puts@plt>
add    $0x19138,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xad0(%rip),%rdi
call   1160 <perror@plt>
jmp    1504 <get_rss+0x274>
lea    0x9aa(%rip),%rdi
call   1160 <perror@plt>
mov    $0x1,%edi
call   1170 <exit@plt>
lea    0x9c2(%rip),%rdi
call   1160 <perror@plt>
mov    $0x2,%edi
call   1170 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.in_addr, i32, i32 }
%struct.in_addr = type { i32 }
%struct.hostent = type { i8*, i64, i32, i32* }
%struct.timeval = type { i32, i64 }
%struct.sockaddr = type { i32 }
@.str = [8 x i8] c"http://\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [17 x i8] c"servername: %s \0A\00"
@.str.4 = [16 x i8] c"Host name : %s\0A\00"
@.str.5 = [17 x i8] c"IP Address : %s\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.6 = [29 x i8] c"The socket has been created\0A\00"
@.str.7 = [24 x i8] c"Could not create socket\00"
@AF_INET = global i32 0
@.str.8 = [22 x i8] c"Connected to host %s\0A\00"
@.str.9 = [18 x i8] c"Could not connect\00"
@.str.10 = [11 x i8] c"buff: %s \0A\00"
@.str.11 = [5 x i8] c"buff\00"
@.str.12 = [33 x i8] c"GET %s HTTP/1.1\0AHost: %s:%s\0A%s%s\00"
@.str.13 = [3 x i8] c"80\00"
@.str.14 = [73 x i8] c"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\0A\00"
@.str.15 = [88 x i8] c"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\0AKeep-Alive: 300\0AConnection: keep-alive\0A\0A\00"
@.str.16 = [13 x i8] c" send error\0A\00"
@.str.17 = [36 x i8] c"Warning: problem closing our_socket\00"
@.str.18 = [10 x i8] c"<channel>\00"
@.str.19 = [8 x i8] c"<title>\00"
@.str.20 = [9 x i8] c"</title>\00"
@.str.21 = [12 x i8] c"title: %s \0A\00"
@.str.22 = [4 x i8] c"wb+\00"
@.str.23 = [27 x i8] c"rss_file : %s rss_url: %s\0A\00"
@.str.24 = [4 x i8] c"%s\0A\00"
@.str.25 = [7 x i8] c"<item>\00"
@.str.26 = [8 x i8] c"</item>\00"
@.str.27 = [7 x i8] c"<link>\00"
@.str.28 = [8 x i8] c"</link>\00"
@.str.29 = [7 x i8] c"%s %s\0A\00"
@.str.30 = [6 x i8] c"over\0A\00"
define void @get_rss(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
%6 = alloca [102400 x i8]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca %struct.sockaddr_in
%15 = alloca %struct.hostent*
%16 = alloca %struct.timeval
%17 = alloca i32
%18 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* null, i8** %7
store i8* null, i8** %8
store i8* null, i8** %9
store i8* null, i8** %10
store i32 0, i32* %11
store i32 0, i32* %12
%19 = load i8*, i8** %3
%20 = call i8* @strstr(i8* %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %20, i8** %7
%21 = load i8*, i8** %7
store i8* %21, i8** %3
%22 = load i8*, i8** %7
%23 = getelementptr inbounds i8, i8* %22, i64 7
store i8* %23, i8** %8
%24 = load i8*, i8** %8
%25 = call i8* @strstr(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %25, i8** %7
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%27 = load i8*, i8** %7
%28 = load i8*, i8** %8
%29 = ptrtoint i8* %27 to i64
%30 = ptrtoint i8* %28 to i64
%31 = sub i64 %29, %30
%32 = add nsw i64 %31, 1
%33 = trunc i64 %32 to i32
%34 = load i8*, i8** %8
%35 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %26, i32 %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %34)
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %36)
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%39 = call %struct.hostent* @gethostbyname(i8* %38)
store %struct.hostent* %39, %struct.hostent** %15
%40 = load %struct.hostent*, %struct.hostent** %15
%41 = getelementptr inbounds %struct.hostent, %struct.hostent* %40, i32 0, i32 0
%42 = load i8*, i8** %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %42)
%44 = load %struct.hostent*, %struct.hostent** %15
%45 = getelementptr inbounds %struct.hostent, %struct.hostent* %44, i32 0, i32 1
%46 = load i64, i64* %45
%47 = inttoptr i64 %46 to %struct.in_addr*
%48 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %47, i32 0, i32 0
%49 = load i32, i32* %48
%50 = call i8* @inet_ntoa(i32 %49)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %50)
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %52)
%54 = load i32, i32* @PF_INET
%55 = load i32, i32* @SOCK_STREAM
%56 = call i32 @socket(i32 %54, i32 %55, i32 0)
store i32 %56, i32* %13
%57 = icmp sgt i32 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %2
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
br label %63
60: ; preds = %2
%61 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%62 = call i32 @exit(i32 1)
unreachable
63: ; preds = %58
%64 = call i32 @memset(%struct.sockaddr_in* %14, i32 0, i32 12)
%65 = load i32, i32* @AF_INET
%66 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 2
store i32 %65, i32* %66
%67 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 0
%68 = load %struct.hostent*, %struct.hostent** %15
%69 = getelementptr inbounds %struct.hostent, %struct.hostent* %68, i32 0, i32 3
%70 = load i32*, i32** %69
%71 = getelementptr inbounds i32, i32* %70, i64 0
%72 = load i32, i32* %71
%73 = load %struct.hostent*, %struct.hostent** %15
%74 = getelementptr inbounds %struct.hostent, %struct.hostent* %73, i32 0, i32 2
%75 = load i32, i32* %74
%76 = call i32 @memcpy(%struct.in_addr* %67, i32 %72, i32 %75)
%77 = call i32 @htons(i32 80)
%78 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 1
store i32 %77, i32* %78
%79 = load i32, i32* %13
%80 = bitcast %struct.sockaddr_in* %14 to %struct.sockaddr*
%81 = call i64 @connect(i32 %79, %struct.sockaddr* %80, i32 12)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %89
83: ; preds = %63
%84 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 0
%85 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %84, i32 0, i32 0
%86 = load i32, i32* %85
%87 = call i8* @inet_ntoa(i32 %86)
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %87)
br label %92
89: ; preds = %63
%90 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%91 = call i32 @exit(i32 2)
unreachable
92: ; preds = %83
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%94 = getelementptr inbounds [102400 x i8], [102400 x i8]* %6, i64 0, i64 0
%95 = load i8*, i8** %3
%96 = load %struct.hostent*, %struct.hostent** %15
%97 = getelementptr inbounds %struct.hostent, %struct.hostent* %96, i32 0, i32 1
%98 = load i64, i64* %97
%99 = inttoptr i64 %98 to %struct.in_addr*
%100 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %99, i32 0, i32 0
%101 = load i32, i32* %100
%102 = call i8* @inet_ntoa(i32 %101)
%103 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %94, i32 102400, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i8* %95, i8* %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.15, i64 0, i64 0))
%104 = getelementptr inbounds [102400 x i8], [102400 x i8]* %6, i64 0, i64 0
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %104)
%106 = load i32, i32* %13
%107 = getelementptr inbounds [102400 x i8], [102400 x i8]* %6, i64 0, i64 0
%108 = getelementptr inbounds [102400 x i8], [102400 x i8]* %6, i64 0, i64 0
%109 = call i32 @strlen(i8* %108)
%110 = call i32 @write(i32 %106, i8* %107, i32 %109)
%111 = icmp eq i32 %110, -1
br i1 %111, label %112, label %114
112: ; preds = %92
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0))
br label %114
114: ; preds = %112, %92
%115 = call i32 @FD_ZERO(i32* %17)
%116 = load i32, i32* %13
%117 = call i32 @FD_SET(i32 %116, i32* %17)
%118 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 0
store i32 5, i32* %118
%119 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
store i64 0, i64* %119
%120 = load i32, i32* %13
%121 = add nsw i32 %120, 1
%122 = call i32 @select(i32 %121, i32* %17, i32* null, i32* null, %struct.timeval* %16)
%123 = load i32, i32* %13
%124 = call i64 @FD_ISSET(i32 %123, i32* %17)
%125 = icmp ne i64 %124, 0
br i1 %125, label %126, label %144
126: ; preds = %114
br label %127
127: ; preds = %139, %126
%128 = load i32, i32* %13
%129 = getelementptr inbounds [102400 x i8], [102400 x i8]* %6, i64 0, i64 0
%130 = load i32, i32* %12
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8, i8* %129, i64 %131
%133 = load i32, i32* %12
%134 = sext i32 %133 to i64
%135 = sub i64 102400, %134
%136 = trunc i64 %135 to i32
%137 = call i32 @read(i32 %128, i8* %132, i32 %136)
store i32 %137, i32* %11
%138 = icmp sgt i32 %137, 0
br i1 %138, label %139, label %143
139: ; preds = %127
%140 = load i32, i32* %11
%141 = load i32, i32* %12
%142 = add nsw i32 %141, %140
store i32 %142, i32* %12
br label %127
143: ; preds = %127
br label %144
144: ; preds = %143, %114
%145 = load i32, i32* %13
%146 = call i64 @close(i32 %145)
%147 = icmp ne i64 %146, 0
br i1 %147, label %148, label %150
148: ; preds = %144
%149 = call i32 @perror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.17, i64 0, i64 0))
br label %150
150: ; preds = %148, %144
%151 = getelementptr inbounds [102400 x i8], [102400 x i8]* %6, i64 0, i64 0
%152 = call i8* @strstr(i8* %151, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
store i8* %152, i8** %7
%153 = load i8*, i8** %7
%154 = icmp ne i8* %153, null
br i1 %154, label %155, label %164
155: ; preds = %150
%156 = load i8*, i8** %7
%157 = call i8* @strstr(i8* %156, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
store i8* %157, i8** %7
%158 = load i8*, i8** %7
%159 = call i8* @strstr(i8* %158, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0))
store i8* %159, i8** %8
%160 = load i8*, i8** %8
store i8 0, i8* %160
%161 = load i8*, i8** %7
%162 = getelementptr inbounds i8, i8* %161, i64 7
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i8* %162)
br label %164
164: ; preds = %155, %150
%165 = load i8*, i8** %4
%166 = call i32* @fopen(i8* %165, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i64 0, i64 0))
store i32* %166, i32** %18
%167 = load i8*, i8** %4
%168 = load i8*, i8** %3
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0), i8* %167, i8* %168)
%170 = load i32*, i32** %18
%171 = load i8*, i8** %3
%172 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %170, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i64 0, i64 0), i8* %171)
br label %173
173: ; preds = %208, %164
%174 = load i8*, i8** %8
%175 = getelementptr inbounds i8, i8* %174, i64 1
%176 = call i8* @strstr(i8* %175, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0))
store i8* %176, i8** %7
%177 = load i8*, i8** %7
%178 = icmp ne i8* %177, null
br i1 %178, label %179, label %206
179: ; preds = %173
%180 = load i8*, i8** %7
%181 = call i8* @strstr(i8* %180, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0))
store i8* %181, i8** %8
%182 = load i8*, i8** %8
%183 = icmp ne i8* %182, null
br i1 %183, label %184, label %204
184: ; preds = %179
%185 = load i8*, i8** %7
%186 = call i8* @strstr(i8* %185, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
store i8* %186, i8** %7
%187 = load i8*, i8** %7
%188 = call i8* @strstr(i8* %187, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0))
store i8* %188, i8** %8
%189 = load i8*, i8** %8
store i8 0, i8* %189
%190 = load i8*, i8** %7
%191 = getelementptr inbounds i8, i8* %190, i64 7
store i8* %191, i8** %9
%192 = load i8*, i8** %8
%193 = getelementptr inbounds i8, i8* %192, i64 1
%194 = call i8* @strstr(i8* %193, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0))
store i8* %194, i8** %7
%195 = load i8*, i8** %7
%196 = call i8* @strstr(i8* %195, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.28, i64 0, i64 0))
store i8* %196, i8** %8
%197 = load i8*, i8** %8
store i8 0, i8* %197
%198 = load i8*, i8** %7
%199 = getelementptr inbounds i8, i8* %198, i64 6
store i8* %199, i8** %10
%200 = load i32*, i32** %18
%201 = load i8*, i8** %9
%202 = load i8*, i8** %10
%203 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.29, i64 0, i64 0), i8* %201, i8* %202)
br label %205
204: ; preds = %179
br label %208
205: ; preds = %184
br label %207
206: ; preds = %173
br label %208
207: ; preds = %205
br label %208
208: ; preds = %207, %206, %204
%209 = load i8*, i8** %7
%210 = icmp ne i8* %209, null
br i1 %210, label %173, label %211
211: ; preds = %208
%212 = load i32*, i32** %18
%213 = call i32 @fclose(i32* %212)
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.in_addr, i32, i32 }
%struct.in_addr = type { i32 }
%struct.timeval = type { i32, i64 }
%struct.hostent = type { i8*, i64, i32, i32* }
%struct.sockaddr = type { i32 }
@.str = [8 x i8] c"http://\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [17 x i8] c"servername: %s \0A\00"
@.str.4 = [16 x i8] c"Host name : %s\0A\00"
@.str.5 = [17 x i8] c"IP Address : %s\0A\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.7 = [24 x i8] c"Could not create socket\00"
@AF_INET = global i32 0
@.str.8 = [22 x i8] c"Connected to host %s\0A\00"
@.str.9 = [18 x i8] c"Could not connect\00"
@.str.10 = [11 x i8] c"buff: %s \0A\00"
@.str.11 = [5 x i8] c"buff\00"
@.str.12 = [33 x i8] c"GET %s HTTP/1.1\0AHost: %s:%s\0A%s%s\00"
@.str.13 = [3 x i8] c"80\00"
@.str.14 = [73 x i8] c"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\0A\00"
@.str.15 = [88 x i8] c"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\0AKeep-Alive: 300\0AConnection: keep-alive\0A\0A\00"
@.str.17 = [36 x i8] c"Warning: problem closing our_socket\00"
@.str.18 = [10 x i8] c"<channel>\00"
@.str.19 = [8 x i8] c"<title>\00"
@.str.20 = [9 x i8] c"</title>\00"
@.str.21 = [12 x i8] c"title: %s \0A\00"
@.str.22 = [4 x i8] c"wb+\00"
@.str.23 = [27 x i8] c"rss_file : %s rss_url: %s\0A\00"
@.str.24 = [4 x i8] c"%s\0A\00"
@.str.25 = [7 x i8] c"<item>\00"
@.str.26 = [8 x i8] c"</item>\00"
@.str.27 = [7 x i8] c"<link>\00"
@.str.28 = [8 x i8] c"</link>\00"
@.str.29 = [7 x i8] c"%s %s\0A\00"
@str = [28 x i8] c"The socket has been created\00"
@str.31 = [5 x i8] c"over\00"
@str.32 = [12 x i8] c" send error\00"
define void @get_rss(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = alloca [102400 x i8]
%5 = alloca %struct.sockaddr_in
%6 = alloca %struct.timeval
%7 = alloca i32
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [102400 x i8], [102400 x i8]* %4, i64 0, i64 0
%10 = bitcast %struct.sockaddr_in* %5 to i8*
%11 = bitcast %struct.timeval* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds i8, i8* %13, i64 7
%15 = tail call i8* @strchr(i8* %14, i32 47)
%16 = ptrtoint i8* %15 to i64
%17 = ptrtoint i8* %14 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
%20 = add i32 %19, 1
%21 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %8, i32 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%23 = call %struct.hostent* @gethostbyname(i8* %8)
%24 = getelementptr inbounds %struct.hostent, %struct.hostent* %23, i64 0, i32 0
%25 = load i8*, i8** %24
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds %struct.hostent, %struct.hostent* %23, i64 0, i32 1
%28 = load i64, i64* %27
%29 = inttoptr i64 %28 to %struct.in_addr*
%30 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %29, i64 0, i32 0
%31 = load i32, i32* %30
%32 = call i8* @inet_ntoa(i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %32)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%35 = load i32, i32* @PF_INET
%36 = load i32, i32* @SOCK_STREAM
%37 = call i32 @socket(i32 %35, i32 %36, i32 0)
%38 = icmp sgt i32 %37, 0
br i1 %38, label %39, label %56
39: ; preds = %2
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%41 = call i32 @memset(%struct.sockaddr_in* %5, i32 0, i32 12)
%42 = load i32, i32* @AF_INET
%43 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i32 %42, i32* %43
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0
%45 = getelementptr inbounds %struct.hostent, %struct.hostent* %23, i64 0, i32 3
%46 = load i32*, i32** %45
%47 = load i32, i32* %46
%48 = getelementptr inbounds %struct.hostent, %struct.hostent* %23, i64 0, i32 2
%49 = load i32, i32* %48
%50 = call i32 @memcpy(%struct.in_addr* %44, i32 %47, i32 %49)
%51 = call i32 @htons(i32 80)
%52 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1
store i32 %51, i32* %52
%53 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%54 = call i64 @connect(i32 %37, %struct.sockaddr* %53, i32 12)
%55 = icmp eq i64 %54, 0
br i1 %55, label %59, label %75
56: ; preds = %2
%57 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %39
%60 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0, i32 0
%61 = load i32, i32* %60
%62 = call i8* @inet_ntoa(i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %62)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%65 = load i64, i64* %27
%66 = inttoptr i64 %65 to %struct.in_addr*
%67 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %66, i64 0, i32 0
%68 = load i32, i32* %67
%69 = call i8* @inet_ntoa(i32 %68)
%70 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %9, i32 102400, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i8* %13, i8* %69, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.15, i64 0, i64 0))
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %9)
%72 = call i32 @strlen(i8* %9)
%73 = call i32 @write(i32 %37, i8* %9, i32 %72)
%74 = icmp eq i32 %73, -1
br i1 %74, label %78, label %80
75: ; preds = %39
%76 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%77 = call i32 @exit(i32 2)
unreachable
78: ; preds = %59
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.32, i64 0, i64 0))
br label %80
80: ; preds = %78, %59
%81 = call i32 @FD_ZERO(i32* %7)
%82 = call i32 @FD_SET(i32 %37, i32* %7)
%83 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 0
store i32 5, i32* %83
%84 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 1
store i64 0, i64* %84
%85 = add nuw nsw i32 %37, 1
%86 = call i32 @select(i32 %85, i32* %7, i32* null, i32* null, %struct.timeval* %6)
%87 = call i64 @FD_ISSET(i32 %37, i32* %7)
%88 = icmp eq i64 %87, 0
br i1 %88, label %97, label %89
89: ; preds = %80, %89
%90 = phi i32 [ %96, %89 ], [ 0, %80 ]
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [102400 x i8], [102400 x i8]* %4, i64 0, i64 %91
%93 = sub i32 102400, %90
%94 = call i32 @read(i32 %37, i8* %92, i32 %93)
%95 = icmp sgt i32 %94, 0
%96 = add nsw i32 %94, %90
br i1 %95, label %89, label %97
97: ; preds = %89, %80
%98 = call i64 @close(i32 %37)
%99 = icmp eq i64 %98, 0
br i1 %99, label %102, label %100
100: ; preds = %97
%101 = call i32 @perror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.17, i64 0, i64 0))
br label %102
102: ; preds = %100, %97
%103 = call i8* @strstr(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
%104 = icmp eq i8* %103, null
br i1 %104, label %110, label %105
105: ; preds = %102
%106 = call i8* @strstr(i8* %103, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%107 = call i8* @strstr(i8* dereferenceable(1) %106, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0))
store i8 0, i8* %107
%108 = getelementptr inbounds i8, i8* %106, i64 7
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i8* %108)
br label %110
110: ; preds = %105, %102
%111 = phi i8* [ %107, %105 ], [ %14, %102 ]
%112 = call i32* @fopen(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i64 0, i64 0))
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.23, i64 0, i64 0), i8* %1, i8* %13)
%114 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %112, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.24, i64 0, i64 0), i8* %13)
br label %115
115: ; preds = %132, %110
%116 = phi i8* [ %111, %110 ], [ %133, %132 ]
%117 = getelementptr inbounds i8, i8* %116, i64 1
%118 = call i8* @strstr(i8* %117, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0))
%119 = icmp eq i8* %118, null
br i1 %119, label %136, label %120
120: ; preds = %115
%121 = call i8* @strstr(i8* %118, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0))
%122 = icmp eq i8* %121, null
br i1 %122, label %132, label %123
123: ; preds = %120
%124 = call i8* @strstr(i8* %118, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%125 = call i8* @strstr(i8* dereferenceable(1) %124, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i64 0, i64 0))
store i8 0, i8* %125
%126 = getelementptr inbounds i8, i8* %124, i64 7
%127 = getelementptr inbounds i8, i8* %125, i64 1
%128 = call i8* @strstr(i8* %127, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0))
%129 = call i8* @strstr(i8* dereferenceable(1) %128, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.28, i64 0, i64 0))
store i8 0, i8* %129
%130 = getelementptr inbounds i8, i8* %128, i64 6
%131 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %112, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.29, i64 0, i64 0), i8* %126, i8* %130)
br label %132
132: ; preds = %120, %123
%133 = phi i8* [ %129, %123 ], [ null, %120 ]
%134 = phi i8* [ %128, %123 ], [ %118, %120 ]
%135 = icmp eq i8* %134, null
br i1 %135, label %136, label %115
136: ; preds = %115, %132
%137 = call i32 @fclose(i32* %112)
%138 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.31, i64 0, i64 0))
ret void
}