#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*/ close(int);
int connect_me(char *, int);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
scalar_t__ memcmp(char *, char *, int);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
scalar_t__ realloc(char *, int);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
int grep_google(char *host, int port, int proxl, char *query, int mode,
                int skip) {
  unsigned int results = 0;
  int sockfd, nbytes, stdlen = 31, prxlen = 38 + strlen("www.google.com"),
                      buflen = 100;
  char *sendthis = NULL;
  if (proxl) {
    if ((sockfd = connect_me(host, port)) == -1)
      results = -2;
    if ((sendthis = (char *)malloc(prxlen + strlen(query) + 7)) == NULL) {
      perror("malloc");
      results = -1;
    } else
      sprintf(sendthis, "GET http://%s/search?start=%d&q=%s HTTP/1.0\n\n",
              "www.google.com", skip, query);
  } else {
    if ((sockfd = connect_me("www.google.com", 80)) == -1)
      results = -2;
    if ((sendthis = (char *)malloc(stdlen + strlen(query) + 7)) == NULL) {
      perror("malloc");
      results = -1;
    } else
      sprintf(sendthis, "GET /search?start=%d&q=%s HTTP/1.0\n\n", skip, query);
  }
  char *readbuf = NULL;
  char *buffer = NULL;
  if (results == 0) {
    if (send(sockfd, sendthis, strlen(sendthis), 0) > 0) {
      free(sendthis);
      sendthis = NULL;
      if ((readbuf = (char *)malloc(255)) != NULL) {
        if ((buffer = (char *)malloc(1)) != NULL) {
          while ((results == 0) && (nbytes = read(sockfd, readbuf, 255)) > 0) {
            if ((buffer = (char *)realloc(buffer, buflen += nbytes)) == NULL) {
              perror("realloc");
              results = -1;
            } else {
              strcat(buffer, readbuf);
              memset(readbuf, 0x00, 255);
            }
          }
          free(readbuf);
          readbuf = NULL;
        } else {
          perror("malloc");
          results = -1;
        }
      } else {
        perror("malloc");
        results = -1;
      }
    } else {
      perror("send");
      results = -3;
    }
  }
  close(sockfd);
  if (results == 0) {
    char *ptr = buffer;
    while (buflen--) {
      if (mode) {
        if (memcmp(ptr++, "<h3 class=\"r\">", strlen("<h3 class=\"r\">")) ==
            0) {
          ptr += strlen("<h3 class=\"r\">") - 1;
          while (memcmp(ptr, "&", 1) != 0) {
            if (memcmp(ptr, "<b>", 3) == 0)
              ptr += 3;
            else if (memcmp(ptr, "</b>", 4) == 0)
              ptr += 4;
            else if (memcmp(ptr, "</a>", 4) == 0)
              break;
            else
              printf("%c", *ptr++);
          }
          printf("</a>\n");
          results++;
        } else
          continue;
      } else if (memcmp(ptr++, "<!--m>", strlen("<!--m>")) == 0) {
        ptr += strlen("<!--m>") - 1;
        results++;
        while (memcmp(ptr, " - ", 3) && buflen--)
          printf("%c", *ptr++);
        printf("\n");
      }
    }
  }
  return results;
}


x86 assembly (clang, -O0):
<grep_google>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x1f,-0x30(%rbp)
lea    0xdea(%rip),%rdi
call   1040 <strlen@plt>
add    $0x26,%eax
mov    %eax,-0x34(%rbp)
movl   $0x64,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     12c0 <grep_google+0xe0>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <connect_me@plt>
mov    %eax,-0x28(%rbp)
cmp    $0xffffffff,%eax
jne    1259 <grep_google+0x79>
movl   $0xfffffffe,-0x24(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x5c(%rbp),%edi
add    %eax,%edi
add    $0x7,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    129b <grep_google+0xbb>
lea    0xd85(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    12bb <grep_google+0xdb>
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xd69(%rip),%rsi
lea    0xd4c(%rip),%rdx
mov    $0x0,%al
call   1100 <sprintf@plt>
jmp    1344 <grep_google+0x164>
lea    0xd39(%rip),%rdi
mov    $0x50,%esi
call   1080 <connect_me@plt>
mov    %eax,-0x28(%rbp)
cmp    $0xffffffff,%eax
jne    12e4 <grep_google+0x104>
movl   $0xfffffffe,-0x24(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x60(%rbp),%edi
add    %eax,%edi
add    $0x7,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    1326 <grep_google+0x146>
lea    0xcfa(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    133f <grep_google+0x15f>
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1100 <sprintf@plt>
jmp    1344 <grep_google+0x164>
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    14c9 <grep_google+0x2e9>
mov    -0x28(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x6c(%rbp),%edi
mov    -0x68(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
cmp    $0x0,%rax
jle    14b1 <grep_google+0x2d1>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x40(%rbp)
mov    $0xff,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
je     1499 <grep_google+0x2b9>
mov    $0x1,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
je     1481 <grep_google+0x2a1>
jmp    13d5 <grep_google+0x1f5>
xor    %eax,%eax
cmpl   $0x0,-0x24(%rbp)
mov    %al,-0x6d(%rbp)
jne    1401 <grep_google+0x221>
mov    -0x28(%rbp),%edi
mov    -0x48(%rbp),%rsi
mov    $0xff,%edx
call   10a0 <read@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
setg   %al
mov    %al,-0x6d(%rbp)
mov    -0x6d(%rbp),%al
test   $0x1,%al
jne    1411 <grep_google+0x231>
jmp    146b <grep_google+0x28b>
mov    -0x50(%rbp),%rdi
mov    -0x2c(%rbp),%esi
add    -0x38(%rbp),%esi
mov    %esi,-0x38(%rbp)
call   10d0 <realloc@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
jne    1449 <grep_google+0x269>
lea    0xc31(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    1466 <grep_google+0x286>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   10f0 <strcat@plt>
mov    -0x48(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1070 <memset@plt>
jmp    13d5 <grep_google+0x1f5>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x48(%rbp)
jmp    1494 <grep_google+0x2b4>
lea    0xb87(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    14ac <grep_google+0x2cc>
lea    0xb6f(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    14c4 <grep_google+0x2e4>
lea    0xbb9(%rip),%rdi
call   10e0 <perror@plt>
movl   $0xfffffffd,-0x24(%rbp)
jmp    14c9 <grep_google+0x2e9>
mov    -0x28(%rbp),%edi
call   1090 <close@plt>
cmpl   $0x0,-0x24(%rbp)
jne    1746 <grep_google+0x566>
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x38(%rbp)
cmp    $0x0,%eax
je     1741 <grep_google+0x561>
cmpl   $0x0,-0x1c(%rbp)
je     1650 <grep_google+0x470>
mov    -0x58(%rbp),%rax
mov    %rax,-0x78(%rbp)
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
lea    0xb5e(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,%edx
lea    0xb4c(%rip),%rsi
call   10b0 <memcmp@plt>
cmp    $0x0,%rax
jne    1646 <grep_google+0x466>
lea    0xb36(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    0xb22(%rip),%rsi
mov    $0x1,%edx
call   10b0 <memcmp@plt>
cmp    $0x0,%rax
je     162a <grep_google+0x44a>
mov    -0x58(%rbp),%rdi
lea    0xb05(%rip),%rsi
mov    $0x3,%edx
call   10b0 <memcmp@plt>
cmp    $0x0,%rax
jne    15a7 <grep_google+0x3c7>
mov    -0x58(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x58(%rbp)
jmp    1625 <grep_google+0x445>
mov    -0x58(%rbp),%rdi
lea    0xad9(%rip),%rsi
mov    $0x4,%edx
call   10b0 <memcmp@plt>
cmp    $0x0,%rax
jne    15d7 <grep_google+0x3f7>
mov    -0x58(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x58(%rbp)
jmp    1620 <grep_google+0x440>
mov    -0x58(%rbp),%rdi
lea    0xaae(%rip),%rsi
mov    $0x4,%edx
call   10b0 <memcmp@plt>
cmp    $0x0,%rax
jne    15fb <grep_google+0x41b>
jmp    162a <grep_google+0x44a>
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x58(%rbp)
movsbl (%rax),%esi
lea    0xa81(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1620 <grep_google+0x440>
jmp    1625 <grep_google+0x445>
jmp    1558 <grep_google+0x378>
lea    0xa67(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    164b <grep_google+0x46b>
jmp    14e3 <grep_google+0x303>
jmp    173c <grep_google+0x55c>
mov    -0x58(%rbp),%rax
mov    %rax,-0x80(%rbp)
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
lea    0xa37(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x80(%rbp),%rdi
mov    %eax,%edx
lea    0xa25(%rip),%rsi
call   10b0 <memcmp@plt>
cmp    $0x0,%rax
jne    1737 <grep_google+0x557>
lea    0xa0f(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x58(%rbp),%rdi
lea    0x9ea(%rip),%rsi
mov    $0x3,%edx
call   10b0 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x81(%rbp)
je     16f1 <grep_google+0x511>
mov    -0x38(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x38(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x81(%rbp)
mov    -0x81(%rbp),%al
test   $0x1,%al
jne    1704 <grep_google+0x524>
jmp    1729 <grep_google+0x549>
mov    -0x58(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x58(%rbp)
movsbl (%rax),%esi
lea    0x978(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    16b0 <grep_google+0x4d0>
lea    0x937(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    173c <grep_google+0x55c>
jmp    14e3 <grep_google+0x303>
jmp    1746 <grep_google+0x566>
mov    -0x24(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grep_google>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,%r14d
mov    %r8d,0xc(%rsp)
mov    %rcx,%r15
mov    %edx,%ebx
mov    %esi,%r13d
mov    %rdi,%rbp
lea    0xde8(%rip),%rdi
call   1060 <strlen@plt>
test   %ebx,%ebx
je     159a <grep_google+0x3aa>
mov    %eax,%r12d
mov    %rbp,%rdi
mov    %r13d,%esi
call   1090 <connect_me@plt>
mov    %eax,%r13d
mov    %r15,%rdi
call   1060 <strlen@plt>
lea    (%r12,%rax,1),%edi
add    $0x2d,%edi
call   10d0 <malloc@plt>
test   %rax,%rax
je     15fc <grep_google+0x40c>
mov    %rax,%rbp
lea    0xdb9(%rip),%rsi
lea    0xd9c(%rip),%rdx
mov    %rax,%rdi
mov    %r14d,%ecx
mov    %r15,%r8
xor    %eax,%eax
call   1110 <sprintf@plt>
cmp    $0xffffffff,%r13d
je     15e7 <grep_google+0x3f7>
mov    %rbp,%rdi
call   1060 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
test   %rax,%rax
jle    160b <grep_google+0x41b>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    $0xffffffff,%r12d
lea    0xd52(%rip),%r15
test   %rax,%rax
je     1618 <grep_google+0x428>
mov    %rax,%rbp
mov    $0x1,%edi
call   10d0 <malloc@plt>
test   %rax,%rax
je     1618 <grep_google+0x428>
mov    %rax,%r14
mov    %r13d,%edi
mov    %rbp,%rsi
mov    $0xff,%edx
call   10b0 <read@plt>
test   %eax,%eax
setg   %bl
mov    $0x64,%r15d
jle    1351 <grep_google+0x161>
nopl   0x0(%rax)
mov    %r15d,%ecx
mov    %eax,%r15d
add    %ecx,%r15d
mov    %r14,%rdi
mov    %r15d,%esi
call   10e0 <realloc@plt>
test   %rax,%rax
je     163a <grep_google+0x44a>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbp,%rsi
call   1100 <strcat@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1080 <memset@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    $0xff,%edx
call   10b0 <read@plt>
test   %eax,%eax
setg   %bl
jg     1300 <grep_google+0x110>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r13d,%edi
call   10a0 <close@plt>
mov    $0xffffffff,%r12d
test   $0x1,%bl
jne    1628 <grep_google+0x438>
movl   $0x0,0x8(%rsp)
lea    0xcf7(%rip),%r12
lea    0x2(%r14),%rcx
mov    %rcx,0x10(%rsp)
neg    %r15d
mov    %r15d,%r13d
mov    %r14,%rbp
mov    0xc(%rsp),%r15d
cs nopw 0x0(%rax,%rax,1)
test   %r13d,%r13d
je     15f5 <grep_google+0x405>
test   %r15d,%r15d
je     13e0 <grep_google+0x1f0>
lea    0x1(%rbp),%rbx
mov    %r12,%rdi
call   1060 <strlen@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %eax,%edx
call   10c0 <memcmp@plt>
add    $0x1,%r13d
mov    %rbx,%rbp
test   %rax,%rax
jne    13a0 <grep_google+0x1b0>
jmp    14a0 <grep_google+0x2b0>
nopl   0x0(%rax,%rax,1)
lea    0x1(%r14),%rbp
lea    0xca5(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   10c0 <memcmp@plt>
mov    0x10(%rsp),%rcx
add    $0x1,%rcx
mov    %r13d,%r15d
not    %r15d
mov    %rbp,%r14
test   %rax,%rax
jne    1383 <grep_google+0x193>
lea    0xc6e(%rip),%rdi
call   1060 <strlen@plt>
movslq %eax,%rbx
lea    (%rbx,%rbp,1),%r14
add    $0xffffffffffffffff,%r14
mov    %r14,%rdi
lea    0xc5b(%rip),%rbp
mov    %rbp,%rsi
mov    $0x3,%edx
call   10c0 <memcmp@plt>
not    %r13d
test   %rax,%rax
je     158e <grep_google+0x39e>
add    $0xffffffffffffffff,%rbx
mov    0x10(%rsp),%rax
add    %rbx,%rax
mov    %rax,%rbx
sub    $0x1,%r13d
jb     1588 <grep_google+0x398>
movsbl (%r14),%edi
add    $0x1,%r14
call   1040 <putchar@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x3,%edx
call   10c0 <memcmp@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1464 <grep_google+0x274>
jmp    158e <grep_google+0x39e>
nopl   0x0(%rax)
mov    %r12,%rdi
call   1060 <strlen@plt>
cltq
lea    (%rax,%rbx,1),%r14
add    $0xffffffffffffffff,%r14
mov    %r14,%rdi
lea    0xbc9(%rip),%rbx
mov    %rbx,%rsi
mov    $0x1,%edx
call   10c0 <memcmp@plt>
lea    0xbcb(%rip),%r15
test   %rax,%rax
je     1570 <grep_google+0x380>
lea    0xba7(%rip),%rbp
jmp    1509 <grep_google+0x319>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x3,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   10c0 <memcmp@plt>
test   %rax,%rax
je     1570 <grep_google+0x380>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    $0x3,%edx
call   10c0 <memcmp@plt>
test   %rax,%rax
je     14f0 <grep_google+0x300>
mov    %r14,%rdi
lea    0xb63(%rip),%rsi
mov    $0x4,%edx
call   10c0 <memcmp@plt>
test   %rax,%rax
je     1560 <grep_google+0x370>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x4,%edx
call   10c0 <memcmp@plt>
test   %rax,%rax
je     1570 <grep_google+0x380>
movsbl (%r14),%edi
add    $0x1,%r14
call   1040 <putchar@plt>
jmp    14f4 <grep_google+0x304>
nopl   0x0(%rax,%rax,1)
add    $0x4,%r14
jmp    14f4 <grep_google+0x304>
cs nopw 0x0(%rax,%rax,1)
neg    %r13d
mov    %r15,%rdi
call   1050 <puts@plt>
addl   $0x1,0x8(%rsp)
mov    %r13d,%r15d
jmp    137f <grep_google+0x18f>
mov    $0xffffffff,%r13d
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    157b <grep_google+0x38b>
lea    0xa5f(%rip),%rdi
mov    $0x50,%esi
call   1090 <connect_me@plt>
mov    %eax,%r13d
mov    %r15,%rdi
call   1060 <strlen@plt>
lea    0x26(%rax),%edi
call   10d0 <malloc@plt>
test   %rax,%rax
je     15fc <grep_google+0x40c>
mov    %rax,%rbp
lea    0xa77(%rip),%rsi
mov    %rax,%rdi
mov    %r14d,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1110 <sprintf@plt>
cmp    $0xffffffff,%r13d
jne    127e <grep_google+0x8e>
mov    $0xfffffffe,%r12d
mov    $0xffffffff,%r13d
jmp    1620 <grep_google+0x430>
mov    0x8(%rsp),%r12d
jmp    1628 <grep_google+0x438>
mov    $0xffffffff,%r12d
lea    0xa06(%rip),%r15
jmp    1618 <grep_google+0x428>
mov    $0xfffffffd,%r12d
lea    0xa59(%rip),%r15
mov    %r15,%rdi
call   10f0 <perror@plt>
mov    %r13d,%edi
call   10a0 <close@plt>
mov    %r12d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa28(%rip),%rdi
call   10f0 <perror@plt>
xor    %r14d,%r14d
jmp    1351 <grep_google+0x161>

LLVM IR (-O0):
@.str = [15 x i8] c"www.google.com\00"
@.str.1 = [7 x i8] c"malloc\00"
@.str.2 = [46 x i8] c"GET http://%s/search?start=%d&q=%s HTTP/1.0\0A\0A\00"
@.str.3 = [37 x i8] c"GET /search?start=%d&q=%s HTTP/1.0\0A\0A\00"
@.str.4 = [8 x i8] c"realloc\00"
@.str.5 = [5 x i8] c"send\00"
@.str.6 = [15 x i8] c"<h3 class=\22r\22>\00"
@.str.7 = [2 x i8] c"&\00"
@.str.8 = [4 x i8] c"<b>\00"
@.str.9 = [5 x i8] c"</b>\00"
@.str.10 = [5 x i8] c"</a>\00"
@.str.11 = [3 x i8] c"%c\00"
@.str.12 = [6 x i8] c"</a>\0A\00"
@.str.13 = [7 x i8] c"<!--m>\00"
@.str.14 = [4 x i8] c" - \00"
@.str.15 = [2 x i8] c"\0A\00"
define i32 @grep_google(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
store i32 0, i32* %13
store i32 31, i32* %16
%23 = call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%24 = add nsw i32 38, %23
store i32 %24, i32* %17
store i32 100, i32* %18
store i8* null, i8** %19
%25 = load i32, i32* %9
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %50
27: ; preds = %6
%28 = load i8*, i8** %7
%29 = load i32, i32* %8
%30 = call i32 @connect_me(i8* %28, i32 %29)
store i32 %30, i32* %14
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %33
32: ; preds = %27
store i32 -2, i32* %13
br label %33
33: ; preds = %32, %27
%34 = load i32, i32* %17
%35 = load i8*, i8** %10
%36 = call i32 @strlen(i8* %35)
%37 = add nsw i32 %34, %36
%38 = add nsw i32 %37, 7
%39 = call i64 @malloc(i32 %38)
%40 = inttoptr i64 %39 to i8*
store i8* %40, i8** %19
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %44
42: ; preds = %33
%43 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %13
br label %49
44: ; preds = %33
%45 = load i8*, i8** %19
%46 = load i32, i32* %12
%47 = load i8*, i8** %10
%48 = call i32 (i8*, i8*, ...) @sprintf(i8* %45, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %46, i8* %47)
br label %49
49: ; preds = %44, %42
br label %71
50: ; preds = %6
%51 = call i32 @connect_me(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 80)
store i32 %51, i32* %14
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %54
53: ; preds = %50
store i32 -2, i32* %13
br label %54
54: ; preds = %53, %50
%55 = load i32, i32* %16
%56 = load i8*, i8** %10
%57 = call i32 @strlen(i8* %56)
%58 = add nsw i32 %55, %57
%59 = add nsw i32 %58, 7
%60 = call i64 @malloc(i32 %59)
%61 = inttoptr i64 %60 to i8*
store i8* %61, i8** %19
%62 = icmp eq i8* %61, null
br i1 %62, label %63, label %65
63: ; preds = %54
%64 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %13
br label %70
65: ; preds = %54
%66 = load i8*, i8** %19
%67 = load i32, i32* %12
%68 = load i8*, i8** %10
%69 = call i32 (i8*, i8*, ...) @sprintf(i8* %66, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 %67, i8* %68)
br label %70
70: ; preds = %65, %63
br label %71
71: ; preds = %70, %49
store i8* null, i8** %20
store i8* null, i8** %21
%72 = load i32, i32* %13
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %131
74: ; preds = %71
%75 = load i32, i32* %14
%76 = load i8*, i8** %19
%77 = load i8*, i8** %19
%78 = call i32 @strlen(i8* %77)
%79 = call i64 @send(i32 %75, i8* %76, i32 %78, i32 0)
%80 = icmp sgt i64 %79, 0
br i1 %80, label %81, label %128
81: ; preds = %74
%82 = load i8*, i8** %19
%83 = call i32 @free(i8* %82)
store i8* null, i8** %19
%84 = call i64 @malloc(i32 255)
%85 = inttoptr i64 %84 to i8*
store i8* %85, i8** %20
%86 = icmp ne i8* %85, null
br i1 %86, label %87, label %125
87: ; preds = %81
%88 = call i64 @malloc(i32 1)
%89 = inttoptr i64 %88 to i8*
store i8* %89, i8** %21
%90 = icmp ne i8* %89, null
br i1 %90, label %91, label %122
91: ; preds = %87
br label %92
92: ; preds = %118, %91
%93 = load i32, i32* %13
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %100
95: ; preds = %92
%96 = load i32, i32* %14
%97 = load i8*, i8** %20
%98 = call i32 @read(i32 %96, i8* %97, i32 255)
store i32 %98, i32* %15
%99 = icmp sgt i32 %98, 0
br label %100
100: ; preds = %95, %92
%101 = phi i1 [ false, %92 ], [ %99, %95 ]
br i1 %101, label %102, label %119
102: ; preds = %100
%103 = load i8*, i8** %21
%104 = load i32, i32* %15
%105 = load i32, i32* %18
%106 = add nsw i32 %105, %104
store i32 %106, i32* %18
%107 = call i64 @realloc(i8* %103, i32 %106)
%108 = inttoptr i64 %107 to i8*
store i8* %108, i8** %21
%109 = icmp eq i8* %108, null
br i1 %109, label %110, label %112
110: ; preds = %102
%111 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %13
br label %118
112: ; preds = %102
%113 = load i8*, i8** %21
%114 = load i8*, i8** %20
%115 = call i32 @strcat(i8* %113, i8* %114)
%116 = load i8*, i8** %20
%117 = call i32 @memset(i8* %116, i32 0, i32 255)
br label %118
118: ; preds = %112, %110
br label %92
119: ; preds = %100
%120 = load i8*, i8** %20
%121 = call i32 @free(i8* %120)
store i8* null, i8** %20
br label %124
122: ; preds = %87
%123 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %13
br label %124
124: ; preds = %122, %119
br label %127
125: ; preds = %81
%126 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %13
br label %127
127: ; preds = %125, %124
br label %130
128: ; preds = %74
%129 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
store i32 -3, i32* %13
br label %130
130: ; preds = %128, %127
br label %131
131: ; preds = %130, %71
%132 = load i32, i32* %14
%133 = call i32 @close(i32 %132)
%134 = load i32, i32* %13
%135 = icmp eq i32 %134, 0
br i1 %135, label %136, label %230
136: ; preds = %131
%137 = load i8*, i8** %21
store i8* %137, i8** %22
br label %138
138: ; preds = %228, %193, %136
%139 = load i32, i32* %18
%140 = add nsw i32 %139, -1
store i32 %140, i32* %18
%141 = icmp ne i32 %139, 0
br i1 %141, label %142, label %229
142: ; preds = %138
%143 = load i32, i32* %11
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %195
145: ; preds = %142
%146 = load i8*, i8** %22
%147 = getelementptr inbounds i8, i8* %146, i32 1
store i8* %147, i8** %22
%148 = call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%149 = call i64 @memcmp(i8* %146, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %148)
%150 = icmp eq i64 %149, 0
br i1 %150, label %151, label %193
151: ; preds = %145
%152 = call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%153 = sub nsw i32 %152, 1
%154 = load i8*, i8** %22
%155 = sext i32 %153 to i64
%156 = getelementptr inbounds i8, i8* %154, i64 %155
store i8* %156, i8** %22
br label %157
157: ; preds = %188, %151
%158 = load i8*, i8** %22
%159 = call i64 @memcmp(i8* %158, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i32 1)
%160 = icmp ne i64 %159, 0
br i1 %160, label %161, label %189
161: ; preds = %157
%162 = load i8*, i8** %22
%163 = call i64 @memcmp(i8* %162, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%164 = icmp eq i64 %163, 0
br i1 %164, label %165, label %168
165: ; preds = %161
%166 = load i8*, i8** %22
%167 = getelementptr inbounds i8, i8* %166, i64 3
store i8* %167, i8** %22
br label %188
168: ; preds = %161
%169 = load i8*, i8** %22
%170 = call i64 @memcmp(i8* %169, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 4)
%171 = icmp eq i64 %170, 0
br i1 %171, label %172, label %175
172: ; preds = %168
%173 = load i8*, i8** %22
%174 = getelementptr inbounds i8, i8* %173, i64 4
store i8* %174, i8** %22
br label %187
175: ; preds = %168
%176 = load i8*, i8** %22
%177 = call i64 @memcmp(i8* %176, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%178 = icmp eq i64 %177, 0
br i1 %178, label %179, label %180
179: ; preds = %175
br label %189
180: ; preds = %175
%181 = load i8*, i8** %22
%182 = getelementptr inbounds i8, i8* %181, i32 1
store i8* %182, i8** %22
%183 = load i8, i8* %181
%184 = sext i8 %183 to i32
%185 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %184)
br label %186
186: ; preds = %180
br label %187
187: ; preds = %186, %172
br label %188
188: ; preds = %187, %165
br label %157
189: ; preds = %179, %157
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%191 = load i32, i32* %13
%192 = add i32 %191, 1
store i32 %192, i32* %13
br label %194
193: ; preds = %145
br label %138
194: ; preds = %189
br label %228
195: ; preds = %142
%196 = load i8*, i8** %22
%197 = getelementptr inbounds i8, i8* %196, i32 1
store i8* %197, i8** %22
%198 = call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%199 = call i64 @memcmp(i8* %196, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 %198)
%200 = icmp eq i64 %199, 0
br i1 %200, label %201, label %227
201: ; preds = %195
%202 = call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%203 = sub nsw i32 %202, 1
%204 = load i8*, i8** %22
%205 = sext i32 %203 to i64
%206 = getelementptr inbounds i8, i8* %204, i64 %205
store i8* %206, i8** %22
%207 = load i32, i32* %13
%208 = add i32 %207, 1
store i32 %208, i32* %13
br label %209
209: ; preds = %219, %201
%210 = load i8*, i8** %22
%211 = call i64 @memcmp(i8* %210, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%212 = icmp ne i64 %211, 0
br i1 %212, label %213, label %217
213: ; preds = %209
%214 = load i32, i32* %18
%215 = add nsw i32 %214, -1
store i32 %215, i32* %18
%216 = icmp ne i32 %214, 0
br label %217
217: ; preds = %213, %209
%218 = phi i1 [ false, %209 ], [ %216, %213 ]
br i1 %218, label %219, label %225
219: ; preds = %217
%220 = load i8*, i8** %22
%221 = getelementptr inbounds i8, i8* %220, i32 1
store i8* %221, i8** %22
%222 = load i8, i8* %220
%223 = sext i8 %222 to i32
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %223)
br label %209
225: ; preds = %217
%226 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
br label %227
227: ; preds = %225, %195
br label %228
228: ; preds = %227, %194
br label %138
229: ; preds = %138
br label %230
230: ; preds = %229, %131
%231 = load i32, i32* %13
ret i32 %231
}

LLVM IR (-O2):
@.str = [15 x i8] c"www.google.com\00"
@.str.1 = [7 x i8] c"malloc\00"
@.str.2 = [46 x i8] c"GET http://%s/search?start=%d&q=%s HTTP/1.0\0A\0A\00"
@.str.3 = [37 x i8] c"GET /search?start=%d&q=%s HTTP/1.0\0A\0A\00"
@.str.4 = [8 x i8] c"realloc\00"
@.str.5 = [5 x i8] c"send\00"
@.str.6 = [15 x i8] c"<h3 class=\22r\22>\00"
@.str.7 = [2 x i8] c"&\00"
@.str.8 = [4 x i8] c"<b>\00"
@.str.9 = [5 x i8] c"</b>\00"
@.str.13 = [7 x i8] c"<!--m>\00"
@.str.14 = [4 x i8] c" - \00"
@str = [5 x i8] c"</a>\00"
define i32 @grep_google(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = tail call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %2, 0
br i1 %8, label %20, label %9
9: ; preds = %6
%10 = tail call i32 @connect_me(i8* %0, i32 %1)
%11 = tail call i32 @strlen(i8* %3)
%12 = add i32 %7, 45
%13 = add i32 %12, %11
%14 = tail call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i8*
%16 = icmp eq i64 %14, 0
br i1 %16, label %62, label %17
17: ; preds = %9
%18 = icmp eq i32 %10, -1
%19 = tail call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %3)
br i1 %18, label %67, label %30
20: ; preds = %6
%21 = tail call i32 @connect_me(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 80)
%22 = tail call i32 @strlen(i8* %3)
%23 = add nsw i32 %22, 38
%24 = tail call i64 @malloc(i32 %23)
%25 = inttoptr i64 %24 to i8*
%26 = icmp eq i64 %24, 0
br i1 %26, label %62, label %27
27: ; preds = %20
%28 = icmp eq i32 %21, -1
%29 = tail call i32 (i8*, i8*, ...) @sprintf(i8* %25, i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 %5, i8* %3)
br i1 %28, label %67, label %30
30: ; preds = %17, %27
%31 = phi i32 [ %21, %27 ], [ %10, %17 ]
%32 = phi i8* [ %25, %27 ], [ %15, %17 ]
%33 = tail call i32 @strlen(i8* %32)
%34 = tail call i64 @send(i32 %31, i8* %32, i32 %33, i32 0)
%35 = icmp sgt i64 %34, 0
br i1 %35, label %36, label %62
36: ; preds = %30
%37 = tail call i32 @free(i8* %32)
%38 = tail call i64 @malloc(i32 255)
%39 = inttoptr i64 %38 to i8*
%40 = icmp eq i64 %38, 0
br i1 %40, label %62, label %41
41: ; preds = %36
%42 = tail call i64 @malloc(i32 1)
%43 = icmp eq i64 %42, 0
br i1 %43, label %62, label %44
44: ; preds = %41
%45 = inttoptr i64 %42 to i8*
%46 = tail call i32 @read(i32 %31, i8* %39, i32 255)
%47 = icmp sgt i32 %46, 0
br i1 %47, label %48, label %75
48: ; preds = %44, %57
%49 = phi i1 [ %61, %57 ], [ %47, %44 ]
%50 = phi i32 [ %60, %57 ], [ %46, %44 ]
%51 = phi i32 [ %53, %57 ], [ 100, %44 ]
%52 = phi i8* [ %55, %57 ], [ %45, %44 ]
%53 = add nsw i32 %50, %51
%54 = tail call i64 @realloc(i8* %52, i32 %53)
%55 = inttoptr i64 %54 to i8*
%56 = icmp eq i64 %54, 0
br i1 %56, label %71, label %57
57: ; preds = %48
%58 = tail call i32 @strcat(i8* %55, i8* %39)
%59 = tail call i32 @memset(i8* %39, i32 0, i32 255)
%60 = tail call i32 @read(i32 %31, i8* %39, i32 255)
%61 = icmp sgt i32 %60, 0
br i1 %61, label %48, label %73
62: ; preds = %30, %36, %41, %20, %9
%63 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %9 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %20 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %41 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %36 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %30 ]
%64 = phi i32 [ %10, %9 ], [ %21, %20 ], [ %31, %41 ], [ %31, %36 ], [ %31, %30 ]
%65 = phi i32 [ -1, %9 ], [ -1, %20 ], [ -1, %41 ], [ -1, %36 ], [ -3, %30 ]
%66 = tail call i32 @perror(i8* %63)
br label %67
67: ; preds = %62, %27, %17
%68 = phi i32 [ -1, %17 ], [ -1, %27 ], [ %64, %62 ]
%69 = phi i32 [ -2, %17 ], [ -2, %27 ], [ %65, %62 ]
%70 = tail call i32 @close(i32 %68)
br label %166
71: ; preds = %48
%72 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %75
73: ; preds = %57
%74 = inttoptr i64 %54 to i8*
br label %75
75: ; preds = %73, %44, %71
%76 = phi i1 [ %49, %71 ], [ %47, %44 ], [ %61, %73 ]
%77 = phi i32 [ %53, %71 ], [ 100, %44 ], [ %53, %73 ]
%78 = phi i8* [ null, %71 ], [ %45, %44 ], [ %74, %73 ]
%79 = tail call i32 @free(i8* %39)
%80 = tail call i32 @close(i32 %31)
br i1 %76, label %166, label %81
81: ; preds = %75
%82 = icmp eq i32 %4, 0
br label %83
83: ; preds = %134, %81
%84 = phi i32 [ 0, %81 ], [ %137, %134 ]
%85 = phi i32 [ %77, %81 ], [ %135, %134 ]
%86 = phi i8* [ %78, %81 ], [ %136, %134 ]
br label %87
87: ; preds = %83, %138
%88 = phi i32 [ %93, %138 ], [ %85, %83 ]
%89 = phi i8* [ %139, %138 ], [ %86, %83 ]
br label %90
90: ; preds = %87, %96
%91 = phi i32 [ %93, %96 ], [ %88, %87 ]
%92 = phi i8* [ %97, %96 ], [ %89, %87 ]
%93 = add nsw i32 %91, -1
%94 = icmp eq i32 %91, 0
br i1 %94, label %166, label %95
95: ; preds = %90
br i1 %82, label %138, label %96
96: ; preds = %95
%97 = getelementptr inbounds i8, i8* %92, i64 1
%98 = tail call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%99 = tail call i64 @memcmp(i8* %92, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %98)
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %90
101: ; preds = %96
%102 = tail call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%103 = add nsw i32 %102, -1
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i8, i8* %97, i64 %104
%106 = tail call i64 @memcmp(i8* %105, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i32 1)
%107 = icmp eq i64 %106, 0
br i1 %107, label %131, label %108
108: ; preds = %101, %127
%109 = phi i8* [ %128, %127 ], [ %105, %101 ]
%110 = tail call i64 @memcmp(i8* %109, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %114
112: ; preds = %108
%113 = getelementptr inbounds i8, i8* %109, i64 3
br label %127
114: ; preds = %108
%115 = tail call i64 @memcmp(i8* %109, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 4)
%116 = icmp eq i64 %115, 0
br i1 %116, label %117, label %119
117: ; preds = %114
%118 = getelementptr inbounds i8, i8* %109, i64 4
br label %127
119: ; preds = %114
%120 = tail call i64 @memcmp(i8* %109, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0), i32 4)
%121 = icmp eq i64 %120, 0
br i1 %121, label %131, label %122
122: ; preds = %119
%123 = getelementptr inbounds i8, i8* %109, i64 1
%124 = load i8, i8* %109
%125 = sext i8 %124 to i32
%126 = tail call i32 @putchar(i32 %125)
br label %127
127: ; preds = %117, %122, %112
%128 = phi i8* [ %113, %112 ], [ %118, %117 ], [ %123, %122 ]
%129 = tail call i64 @memcmp(i8* %128, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i32 1)
%130 = icmp eq i64 %129, 0
br i1 %130, label %131, label %108
131: ; preds = %127, %119, %101
%132 = phi i8* [ %105, %101 ], [ %109, %119 ], [ %128, %127 ]
%133 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %134
134: ; preds = %131, %162
%135 = phi i32 [ %164, %162 ], [ %93, %131 ]
%136 = phi i8* [ %163, %162 ], [ %132, %131 ]
%137 = add i32 %84, 1
br label %83
138: ; preds = %95
%139 = getelementptr inbounds i8, i8* %89, i64 1
%140 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%141 = tail call i64 @memcmp(i8* %89, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i32 %140)
%142 = icmp eq i64 %141, 0
br i1 %142, label %143, label %87
143: ; preds = %138
%144 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%145 = add nsw i32 %144, -1
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i8, i8* %139, i64 %146
%148 = tail call i64 @memcmp(i8* %147, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%149 = icmp eq i64 %148, 0
br i1 %149, label %162, label %150
150: ; preds = %143, %154
%151 = phi i8* [ %156, %154 ], [ %147, %143 ]
%152 = phi i32 [ %155, %154 ], [ %93, %143 ]
%153 = icmp eq i32 %152, 0
br i1 %153, label %162, label %154
154: ; preds = %150
%155 = add nsw i32 %152, -1
%156 = getelementptr inbounds i8, i8* %151, i64 1
%157 = load i8, i8* %151
%158 = sext i8 %157 to i32
%159 = tail call i32 @putchar(i32 %158)
%160 = tail call i64 @memcmp(i8* %156, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%161 = icmp eq i64 %160, 0
br i1 %161, label %162, label %150
162: ; preds = %150, %154, %143
%163 = phi i8* [ %147, %143 ], [ %156, %154 ], [ %151, %150 ]
%164 = phi i32 [ %93, %143 ], [ %155, %154 ], [ -1, %150 ]
%165 = tail call i32 @putchar(i32 10)
br label %134
166: ; preds = %90, %67, %75
%167 = phi i32 [ -1, %75 ], [ %69, %67 ], [ %84, %90 ]
ret i32 %167
}