#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 stat {
  int dummy;
};
struct rlimit {
  int rlim_cur;
  int rlim_max;
};
typedef int /*<<< orphan*/ memsyslim;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ RLIMIT_AS;
int RLIM_INFINITY;
unsigned long assert(int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int, int, ...);
double get_la();
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ memset(char *, char, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, char *, int);
char *read_file_lines(char *);
int /*<<< orphan*/ setrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ snprintf(char *, int, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, ...);
int stat(char *, struct stat *);
int /*<<< orphan*/ stdout;
int strlen(char *);
char *strstr(char *, char *);
scalar_t__ system;
int chk_calloc_prepare() {
  int e = EXIT_FAILURE;
  int overcommit_memory;
  {
    {
      char buf[32];
      struct stat s;
      assert(stat("/proc/sys/vm/"
                  "overcommit_memory",
                  &s) == EXIT_SUCCESS);
      int fh = open("/proc/sys/vm/"
                    "overcommit_memory",
                    O_RDONLY);
      read(fh, buf, sizeof(buf));
      sscanf(buf, "%i", &overcommit_memory);
      close(fh);
    };
  };
  if (overcommit_memory == 2) {
    {
      int type = 1;
      int fg = 30 + 0;
      int bg = 40 + 0;
      switch (0xFF & 3) {
      case 1:
        fg = 30 + 2;
        break;
      case 2:
        bg = 40 + 5;
        fg = 30 + 7;
        break;
      case 3:
        fg = 30 + 7;
        break;
      case 4:
        fg = 30 + 3;
        break;
      case 5:
        fg = 30 + 1;
        break;
      case 6:
        fg = 30 + 7;
        bg = 40 + 4;
        break;
      }
      if (3 & (1 << 8)) {
        char buf[82];
        memset(buf, ' ', 80);
        snprintf(buf, 70, "I Memory overcommit protection is ON; Good.\n");
        buf[strlen(buf)] = ' ';
        snprintf(buf + 70, 11, "LA:%7.2f", get_la());
        buf[81] = '\0';
        assert(strlen(buf) == 80);
        fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf, 0x1B,
                0);
      } else {
        fprintf(stdout,
                "%c[%d;%d;%dm"
                "I Memory overcommit protection is ON; Good.\n"
                "%c[%dm",
                0x1B, type, fg, bg, 0x1B, 0);
      }
      fflush(stdout);
    };
    char *meminfo;
    char *bufptr;
    unsigned long long mem_total = -1;
    unsigned long long swap_total = -1;
    while ((meminfo = read_file_lines("/proc/meminfo")) != NULL)
      if ((bufptr = strstr(meminfo, "MemTotal:")) != NULL) {
        sscanf(meminfo + 9, "%llu", &mem_total);
        mem_total *= ((unsigned long)(1 << 10));
      } else if ((bufptr = strstr(meminfo, "SwapTotal:")) != NULL) {
        sscanf(meminfo + 10, "%llu", &swap_total);
        swap_total *= ((unsigned long)(1 << 10));
      }
    {
      int type = 1;
      int fg = 30 + 0;
      int bg = 40 + 0;
      switch (0xFF & 3) {
      case 1:
        fg = 30 + 2;
        break;
      case 2:
        bg = 40 + 5;
        fg = 30 + 7;
        break;
      case 3:
        fg = 30 + 7;
        break;
      case 4:
        fg = 30 + 3;
        break;
      case 5:
        fg = 30 + 1;
        break;
      case 6:
        fg = 30 + 7;
        bg = 40 + 4;
        break;
      }
      if (3 & (1 << 8)) {
        char buf[82];
        memset(buf, ' ', 80);
        snprintf(buf, 70, "I MemTotal         : %llu\n", mem_total);
        buf[strlen(buf)] = ' ';
        snprintf(buf + 70, 11, "LA:%7.2f", get_la());
        buf[81] = '\0';
        assert(strlen(buf) == 80);
        fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf, 0x1B,
                0);
      } else {
        fprintf(stdout,
                "%c[%d;%d;%dm"
                "I MemTotal         : %llu\n"
                "%c[%dm",
                0x1B, type, fg, bg, mem_total, 0x1B, 0);
      }
      fflush(stdout);
    };
    {
      int type = 1;
      int fg = 30 + 0;
      int bg = 40 + 0;
      switch (0xFF & 3) {
      case 1:
        fg = 30 + 2;
        break;
      case 2:
        bg = 40 + 5;
        fg = 30 + 7;
        break;
      case 3:
        fg = 30 + 7;
        break;
      case 4:
        fg = 30 + 3;
        break;
      case 5:
        fg = 30 + 1;
        break;
      case 6:
        fg = 30 + 7;
        bg = 40 + 4;
        break;
      }
      if (3 & (1 << 8)) {
        char buf[82];
        memset(buf, ' ', 80);
        snprintf(buf, 70, "I SwapTotal        : %llu\n", swap_total);
        buf[strlen(buf)] = ' ';
        snprintf(buf + 70, 11, "LA:%7.2f", get_la());
        buf[81] = '\0';
        assert(strlen(buf) == 80);
        fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf, 0x1B,
                0);
      } else {
        fprintf(stdout,
                "%c[%d;%d;%dm"
                "I SwapTotal        : %llu\n"
                "%c[%dm",
                0x1B, type, fg, bg, swap_total, 0x1B, 0);
      }
      fflush(stdout);
    };
    int swappiness;
    {
      {
        char buf[32];
        struct stat s;
        assert(stat("/proc/sys/vm/"
                    "swappiness",
                    &s) == EXIT_SUCCESS);
        int fh = open("/proc/sys/vm/"
                      "swappiness",
                      O_RDONLY);
        read(fh, buf, sizeof(buf));
        sscanf(buf, "%i", &swappiness);
        close(fh);
      };
    };
    {
      int type = 1;
      int fg = 30 + 0;
      int bg = 40 + 0;
      switch (0xFF & 3) {
      case 1:
        fg = 30 + 2;
        break;
      case 2:
        bg = 40 + 5;
        fg = 30 + 7;
        break;
      case 3:
        fg = 30 + 7;
        break;
      case 4:
        fg = 30 + 3;
        break;
      case 5:
        fg = 30 + 1;
        break;
      case 6:
        fg = 30 + 7;
        bg = 40 + 4;
        break;
      }
      if (3 & (1 << 8)) {
        char buf[82];
        memset(buf, ' ', 80);
        snprintf(buf, 70, "I Swappiness:      : %i%%\n", swappiness);
        buf[strlen(buf)] = ' ';
        snprintf(buf + 70, 11, "LA:%7.2f", get_la());
        buf[81] = '\0';
        assert(strlen(buf) == 80);
        fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf, 0x1B,
                0);
      } else {
        fprintf(stdout,
                "%c[%d;%d;%dm"
                "I Swappiness:      : %i%%\n"
                "%c[%dm",
                0x1B, type, fg, bg, swappiness, 0x1B, 0);
      }
      fflush(stdout);
    };
    unsigned long long memsyslim_ll = swap_total;
    int overcommit_ratio = 0;
    {
      {
        char buf[32];
        struct stat s;
        assert(stat("/proc/sys/vm/"
                    "overcommit_ratio",
                    &s) == EXIT_SUCCESS);
        int fh = open("/proc/sys/vm/"
                      "overcommit_ratio",
                      O_RDONLY);
        read(fh, buf, sizeof(buf));
        sscanf(buf, "%i", &overcommit_ratio);
        close(fh);
      };
    };
    {
      int type = 1;
      int fg = 30 + 0;
      int bg = 40 + 0;
      switch (0xFF & 3) {
      case 1:
        fg = 30 + 2;
        break;
      case 2:
        bg = 40 + 5;
        fg = 30 + 7;
        break;
      case 3:
        fg = 30 + 7;
        break;
      case 4:
        fg = 30 + 3;
        break;
      case 5:
        fg = 30 + 1;
        break;
      case 6:
        fg = 30 + 7;
        bg = 40 + 4;
        break;
      }
      if (3 & (1 << 8)) {
        char buf[82];
        memset(buf, ' ', 80);
        snprintf(buf, 70, "I Overcommit ratio : %i%%\n", overcommit_ratio);
        buf[strlen(buf)] = ' ';
        snprintf(buf + 70, 11, "LA:%7.2f", get_la());
        buf[81] = '\0';
        assert(strlen(buf) == 80);
        fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf, 0x1B,
                0);
      } else {
        fprintf(stdout,
                "%c[%d;%d;%dm"
                "I Overcommit ratio : %i%%\n"
                "%c[%dm",
                0x1B, type, fg, bg, overcommit_ratio, 0x1B, 0);
      }
      fflush(stdout);
    };
    memsyslim_ll += (mem_total * overcommit_ratio) / 100;
    unsigned long memsyslim = (unsigned long)memsyslim_ll;
    assert((unsigned long long)memsyslim == memsyslim_ll);
    {
      unsigned long syslim =
          (assert(sizeof(unsigned long) >= sizeof(memsyslim)),
           (unsigned long)(memsyslim));
      int inf = 0;
      int change = 0;
      struct rlimit rlp;
      getrlimit(RLIMIT_AS, &rlp);
      {
        int type = 1;
        int fg = 30 + 0;
        int bg = 40 + 0;
        switch (0xFF & 3) {
        case 1:
          fg = 30 + 2;
          break;
        case 2:
          bg = 40 + 5;
          fg = 30 + 7;
          break;
        case 3:
          fg = 30 + 7;
          break;
        case 4:
          fg = 30 + 3;
          break;
        case 5:
          fg = 30 + 1;
          break;
        case 6:
          fg = 30 + 7;
          bg = 40 + 4;
          break;
        }
        if (3 & (1 << 8)) {
          char buf[82];
          memset(buf, ' ', 80);
          snprintf(buf, 70,
                   "I "
                   "AS"
                   " syslim:%lu usrlim:%lu:%lu\n",
                   syslim, rlp.rlim_cur, rlp.rlim_max);
          buf[strlen(buf)] = ' ';
          snprintf(buf + 70, 11, "LA:%7.2f", get_la());
          buf[81] = '\0';
          assert(strlen(buf) == 80);
          fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf, 0x1B,
                  0);
        } else {
          fprintf(stdout,
                  "%c[%d;%d;%dm"
                  "I "
                  "AS"
                  " syslim:%lu usrlim:%lu:%lu\n"
                  "%c[%dm",
                  0x1B, type, fg, bg, syslim, rlp.rlim_cur, rlp.rlim_max, 0x1B,
                  0);
        }
        fflush(stdout);
      };
      if (rlp.rlim_cur == RLIM_INFINITY) {
        inf = 1;
        {
          int type = 1;
          int fg = 30 + 0;
          int bg = 40 + 0;
          switch (0xFF & 4) {
          case 1:
            fg = 30 + 2;
            break;
          case 2:
            bg = 40 + 5;
            fg = 30 + 7;
            break;
          case 3:
            fg = 30 + 7;
            break;
          case 4:
            fg = 30 + 3;
            break;
          case 5:
            fg = 30 + 1;
            break;
          case 6:
            fg = 30 + 7;
            bg = 40 + 4;
            break;
          }
          if (4 & (1 << 8)) {
            char buf[82];
            memset(buf, ' ', 80);
            snprintf(buf, 70, "W \\___User limit is unbound!\n");
            buf[strlen(buf)] = ' ';
            snprintf(buf + 70, 11, "LA:%7.2f", get_la());
            buf[81] = '\0';
            assert(strlen(buf) == 80);
            fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf,
                    0x1B, 0);
          } else {
            fprintf(stdout,
                    "%c[%d;%d;%dm"
                    "W \\___User limit is unbound!\n"
                    "%c[%dm",
                    0x1B, type, fg, bg, 0x1B, 0);
          }
          fflush(stdout);
        };
      }
      if (((syslim) > 0) && (rlp.rlim_cur > (syslim))) {
        {
          int type = 1;
          int fg = 30 + 0;
          int bg = 40 + 0;
          switch (0xFF & 4) {
          case 1:
            fg = 30 + 2;
            break;
          case 2:
            bg = 40 + 5;
            fg = 30 + 7;
            break;
          case 3:
            fg = 30 + 7;
            break;
          case 4:
            fg = 30 + 3;
            break;
          case 5:
            fg = 30 + 1;
            break;
          case 6:
            fg = 30 + 7;
            bg = 40 + 4;
            break;
          }
          if (4 & (1 << 8)) {
            char buf[82];
            memset(buf, ' ', 80);
            snprintf(buf, 70, "W \\___ User limit exceeds system limit!\n");
            buf[strlen(buf)] = ' ';
            snprintf(buf + 70, 11, "LA:%7.2f", get_la());
            buf[81] = '\0';
            assert(strlen(buf) == 80);
            fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf,
                    0x1B, 0);
          } else {
            fprintf(stdout,
                    "%c[%d;%d;%dm"
                    "W \\___ User limit exceeds system limit!\n"
                    "%c[%dm",
                    0x1B, type, fg, bg, 0x1B, 0);
          }
          fflush(stdout);
        };
        change = 1;
      }
      if (change) {
        if (inf) {
          {
            int type = 1;
            int fg = 30 + 0;
            int bg = 40 + 0;
            switch (0xFF & 4) {
            case 1:
              fg = 30 + 2;
              break;
            case 2:
              bg = 40 + 5;
              fg = 30 + 7;
              break;
            case 3:
              fg = 30 + 7;
              break;
            case 4:
              fg = 30 + 3;
              break;
            case 5:
              fg = 30 + 1;
              break;
            case 6:
              fg = 30 + 7;
              bg = 40 + 4;
              break;
            }
            if (4 & (1 << 8)) {
              char buf[82];
              memset(buf, ' ', 80);
              snprintf(buf, 70, "W   \\___ Changing %s limit from INFINITY to",
                       "AS");
              buf[strlen(buf)] = ' ';
              snprintf(buf + 70, 11, "LA:%7.2f", get_la());
              buf[81] = '\0';
              assert(strlen(buf) == 80);
              fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf,
                      0x1B, 0);
            } else {
              fprintf(stdout,
                      "%c[%d;%d;%dm"
                      "W   \\___ Changing %s limit from INFINITY to"
                      "%c[%dm",
                      0x1B, type, fg, bg, "AS", 0x1B, 0);
            }
            fflush(stdout);
          };
        } else {
          {
            int type = 1;
            int fg = 30 + 0;
            int bg = 40 + 0;
            switch (0xFF & 4) {
            case 1:
              fg = 30 + 2;
              break;
            case 2:
              bg = 40 + 5;
              fg = 30 + 7;
              break;
            case 3:
              fg = 30 + 7;
              break;
            case 4:
              fg = 30 + 3;
              break;
            case 5:
              fg = 30 + 1;
              break;
            case 6:
              fg = 30 + 7;
              bg = 40 + 4;
              break;
            }
            if (4 & (1 << 8)) {
              char buf[82];
              memset(buf, ' ', 80);
              snprintf(buf, 70, "W   \\___ Changing %s limit from %lu:%lu to",
                       "AS", rlp.rlim_cur, rlp.rlim_max);
              buf[strlen(buf)] = ' ';
              snprintf(buf + 70, 11, "LA:%7.2f", get_la());
              buf[81] = '\0';
              assert(strlen(buf) == 80);
              fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf,
                      0x1B, 0);
            } else {
              fprintf(stdout,
                      "%c[%d;%d;%dm"
                      "W   \\___ Changing %s limit from %lu:%lu to"
                      "%c[%dm",
                      0x1B, type, fg, bg, "AS", rlp.rlim_cur, rlp.rlim_max,
                      0x1B, 0);
            }
            fflush(stdout);
          };
        }
        {
          if (((system) > 0) && ((syslim) < (rlp.rlim_cur)))
            rlp.rlim_cur = syslim;
          if (((system) > 0) && ((syslim) < (rlp.rlim_max)))
            rlp.rlim_max = syslim;
          setrlimit(RLIMIT_AS, &rlp);
        }
        getrlimit(RLIMIT_AS, &rlp);
        {
          int type = 1;
          int fg = 30 + 0;
          int bg = 40 + 0;
          switch (0xFF & 4) {
          case 1:
            fg = 30 + 2;
            break;
          case 2:
            bg = 40 + 5;
            fg = 30 + 7;
            break;
          case 3:
            fg = 30 + 7;
            break;
          case 4:
            fg = 30 + 3;
            break;
          case 5:
            fg = 30 + 1;
            break;
          case 6:
            fg = 30 + 7;
            bg = 40 + 4;
            break;
          }
          if (4 & (1 << 8)) {
            char buf[82];
            memset(buf, ' ', 80);
            snprintf(buf, 70, " %lu:%lu\n", rlp.rlim_cur, rlp.rlim_max);
            buf[strlen(buf)] = ' ';
            snprintf(buf + 70, 11, "LA:%7.2f", get_la());
            buf[81] = '\0';
            assert(strlen(buf) == 80);
            fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf,
                    0x1B, 0);
          } else {
            fprintf(stdout,
                    "%c[%d;%d;%dm"
                    " %lu:%lu\n"
                    "%c[%dm",
                    0x1B, type, fg, bg, rlp.rlim_cur, rlp.rlim_max, 0x1B, 0);
          }
          fflush(stdout);
        };
      }
    };
    {
      int type = 1;
      int fg = 30 + 0;
      int bg = 40 + 0;
      switch (0xFF & 3) {
      case 1:
        fg = 30 + 2;
        break;
      case 2:
        bg = 40 + 5;
        fg = 30 + 7;
        break;
      case 3:
        fg = 30 + 7;
        break;
      case 4:
        fg = 30 + 3;
        break;
      case 5:
        fg = 30 + 1;
        break;
      case 6:
        fg = 30 + 7;
        bg = 40 + 4;
        break;
      }
      if (3 & (1 << 8)) {
        char buf[82];
        memset(buf, ' ', 80);
        snprintf(buf, 70, "I Overcommit limit : %lu\n", memsyslim);
        buf[strlen(buf)] = ' ';
        snprintf(buf + 70, 11, "LA:%7.2f", get_la());
        buf[81] = '\0';
        assert(strlen(buf) == 80);
        fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf, 0x1B,
                0);
      } else {
        fprintf(stdout,
                "%c[%d;%d;%dm"
                "I Overcommit limit : %lu\n"
                "%c[%dm",
                0x1B, type, fg, bg, memsyslim, 0x1B, 0);
      }
      fflush(stdout);
    };
    e = EXIT_SUCCESS;
  } else {
    {
      int type = 1;
      int fg = 30 + 0;
      int bg = 40 + 0;
      switch (0xFF & 5) {
      case 1:
        fg = 30 + 2;
        break;
      case 2:
        bg = 40 + 5;
        fg = 30 + 7;
        break;
      case 3:
        fg = 30 + 7;
        break;
      case 4:
        fg = 30 + 3;
        break;
      case 5:
        fg = 30 + 1;
        break;
      case 6:
        fg = 30 + 7;
        bg = 40 + 4;
        break;
      }
      if (5 & (1 << 8)) {
        char buf[82];
        memset(buf, ' ', 80);
        snprintf(buf, 70, "E Memory overcommit protection is OFF!\n");
        buf[strlen(buf)] = ' ';
        snprintf(buf + 70, 11, "LA:%7.2f", get_la());
        buf[81] = '\0';
        assert(strlen(buf) == 80);
        fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf, 0x1B,
                0);
      } else {
        fprintf(stdout,
                "%c[%d;%d;%dm"
                "E Memory overcommit protection is OFF!\n"
                "%c[%dm",
                0x1B, type, fg, bg, 0x1B, 0);
      }
      fflush(stdout);
    };
    {
      int type = 1;
      int fg = 30 + 0;
      int bg = 40 + 0;
      switch (0xFF & 5) {
      case 1:
        fg = 30 + 2;
        break;
      case 2:
        bg = 40 + 5;
        fg = 30 + 7;
        break;
      case 3:
        fg = 30 + 7;
        break;
      case 4:
        fg = 30 + 3;
        break;
      case 5:
        fg = 30 + 1;
        break;
      case 6:
        fg = 30 + 7;
        bg = 40 + 4;
        break;
      }
      if (5 & (1 << 8)) {
        char buf[82];
        memset(buf, ' ', 80);
        snprintf(buf, 70, "E \\___ Cowardly refusing to run CALLOC test.\n");
        buf[strlen(buf)] = ' ';
        snprintf(buf + 70, 11, "LA:%7.2f", get_la());
        buf[81] = '\0';
        assert(strlen(buf) == 80);
        fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf, 0x1B,
                0);
      } else {
        fprintf(stdout,
                "%c[%d;%d;%dm"
                "E \\___ Cowardly refusing to run CALLOC test.\n"
                "%c[%dm",
                0x1B, type, fg, bg, 0x1B, 0);
      }
      fflush(stdout);
    };
    {
      int type = 1;
      int fg = 30 + 0;
      int bg = 40 + 0;
      switch (0xFF & 3) {
      case 1:
        fg = 30 + 2;
        break;
      case 2:
        bg = 40 + 5;
        fg = 30 + 7;
        break;
      case 3:
        fg = 30 + 7;
        break;
      case 4:
        fg = 30 + 3;
        break;
      case 5:
        fg = 30 + 1;
        break;
      case 6:
        fg = 30 + 7;
        bg = 40 + 4;
        break;
      }
      if (3 & (1 << 8)) {
        char buf[82];
        memset(buf, ' ', 80);
        snprintf(
            buf, 70,
            "I \\___ To run this test, run: sysctl vm.overcommit_memory=2\n");
        buf[strlen(buf)] = ' ';
        snprintf(buf + 70, 11, "LA:%7.2f", get_la());
        buf[81] = '\0';
        assert(strlen(buf) == 80);
        fprintf(stdout, "%c[%d;%d;%dm%s%c[%dm", 0x1B, type, fg, bg, buf, 0x1B,
                0);
      } else {
        fprintf(stdout,
                "%c[%d;%d;%dm"
                "I \\___ To run this test, run: sysctl vm.overcommit_memory=2\n"
                "%c[%dm",
                0x1B, type, fg, bg, 0x1B, 0);
      }
      fflush(stdout);
    };
    e = EXIT_FAILURE;
  }
  return e;
}


x86 assembly (clang, -O0):
<chk_calloc_prepare>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x1d8,%rsp
mov    0x2df5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xe21(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1070 <stat@plt>
mov    0x2dc1(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2de3(%rip),%rax
mov    (%rax),%esi
lea    0xdf2(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x20,%edx
call   1040 <read@plt>
lea    -0x30(%rbp),%rdi
lea    0xded(%rip),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0x3c(%rbp),%edi
call   1030 <close@plt>
cmpl   $0x2,-0x10(%rbp)
jne    1bbd <chk_calloc_prepare+0x9fd>
movl   $0x1,-0x40(%rbp)
movl   $0x1e,-0x44(%rbp)
movl   $0x28,-0x48(%rbp)
movl   $0x25,-0x44(%rbp)
mov    0x2d4e(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%ecx
mov    -0x44(%rbp),%r8d
mov    -0x48(%rbp),%r9d
lea    0xd9c(%rip),%rsi
mov    $0x1b,%edx
xor    %eax,%eax
movl   $0x1b,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
movq   $0xffffffffffffffff,-0x60(%rbp)
ff
movq   $0xffffffffffffffff,-0x68(%rbp)
ff
lea    0xd99(%rip),%rdi
call   10b0 <read_file_lines@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
je     1372 <chk_calloc_prepare+0x1b2>
mov    -0x50(%rbp),%rdi
lea    0xd89(%rip),%rsi
call   10e0 <strstr@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
je     1324 <chk_calloc_prepare+0x164>
mov    -0x50(%rbp),%rdi
add    $0x9,%rdi
lea    0xd71(%rip),%rsi
lea    -0x60(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0x60(%rbp),%rax
shl    $0xa,%rax
mov    %rax,-0x60(%rbp)
jmp    136d <chk_calloc_prepare+0x1ad>
mov    -0x50(%rbp),%rdi
lea    0xd4f(%rip),%rsi
call   10e0 <strstr@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
je     1368 <chk_calloc_prepare+0x1a8>
mov    -0x50(%rbp),%rdi
add    $0xa,%rdi
lea    0xd28(%rip),%rsi
lea    -0x68(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0x68(%rbp),%rax
shl    $0xa,%rax
mov    %rax,-0x68(%rbp)
jmp    136d <chk_calloc_prepare+0x1ad>
jmp    12c1 <chk_calloc_prepare+0x101>
movl   $0x1,-0x6c(%rbp)
movl   $0x1e,-0x70(%rbp)
movl   $0x28,-0x74(%rbp)
movl   $0x25,-0x70(%rbp)
mov    0x2c2b(%rip),%rax
mov    (%rax),%edi
mov    -0x6c(%rbp),%ecx
mov    -0x70(%rbp),%r8d
mov    -0x74(%rbp),%r9d
mov    -0x60(%rbp),%rax
lea    0xcdc(%rip),%rsi
mov    $0x1b,%edx
xor    %r10d,%r10d
mov    %rax,(%rsp)
movl   $0x1b,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
movl   $0x1,-0x78(%rbp)
movl   $0x1e,-0x7c(%rbp)
movl   $0x28,-0x80(%rbp)
movl   $0x25,-0x7c(%rbp)
mov    0x2bbf(%rip),%rax
mov    (%rax),%edi
mov    -0x78(%rbp),%ecx
mov    -0x7c(%rbp),%r8d
mov    -0x80(%rbp),%r9d
mov    -0x68(%rbp),%rax
lea    0xc9d(%rip),%rsi
mov    $0x1b,%edx
xor    %r10d,%r10d
mov    %rax,(%rsp)
movl   $0x1b,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2b7d(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
lea    0xc92(%rip),%rdi
lea    -0xb8(%rbp),%rsi
call   1070 <stat@plt>
mov    0x2b4c(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2b6e(%rip),%rax
mov    (%rax),%esi
lea    0xc60(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,-0xbc(%rbp)
mov    -0xbc(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    $0x20,%edx
call   1040 <read@plt>
lea    -0xb0(%rbp),%rdi
lea    0xb6c(%rip),%rsi
lea    -0x84(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0xbc(%rbp),%edi
call   1030 <close@plt>
movl   $0x1,-0xc0(%rbp)
movl   $0x1e,-0xc4(%rbp)
movl   $0x28,-0xc8(%rbp)
movl   $0x25,-0xc4(%rbp)
mov    0x2ac5(%rip),%rax
mov    (%rax),%edi
mov    -0xc0(%rbp),%ecx
mov    -0xc4(%rbp),%r8d
mov    -0xc8(%rbp),%r9d
mov    -0x84(%rbp),%eax
lea    0xbdd(%rip),%rsi
mov    $0x1b,%edx
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x1b,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2a79(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    -0x68(%rbp),%rax
mov    %rax,-0xd0(%rbp)
movl   $0x0,-0xd4(%rbp)
lea    0xbbe(%rip),%rdi
lea    -0x108(%rbp),%rsi
call   1070 <stat@plt>
mov    0x2a33(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    0x2a55(%rip),%rax
mov    (%rax),%esi
lea    0xb8c(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,-0x10c(%rbp)
mov    -0x10c(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x20,%edx
call   1040 <read@plt>
lea    -0x100(%rbp),%rdi
lea    0xa53(%rip),%rsi
lea    -0xd4(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0x10c(%rbp),%edi
call   1030 <close@plt>
movl   $0x1,-0x110(%rbp)
movl   $0x1e,-0x114(%rbp)
movl   $0x28,-0x118(%rbp)
movl   $0x25,-0x114(%rbp)
mov    0x29ac(%rip),%rax
mov    (%rax),%edi
mov    -0x110(%rbp),%ecx
mov    -0x114(%rbp),%r8d
mov    -0x118(%rbp),%r9d
mov    -0xd4(%rbp),%eax
lea    0xb0f(%rip),%rsi
mov    $0x1b,%edx
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x1b,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2960(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    -0x60(%rbp),%rax
movslq -0xd4(%rbp),%rcx
imul   %rcx,%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
add    -0xd0(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rax
cmp    -0xd0(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    -0x120(%rbp),%rax
mov    %rax,-0x128(%rbp)
movl   $0x0,-0x12c(%rbp)
movl   $0x0,-0x130(%rbp)
mov    0x28e6(%rip),%rax
mov    (%rax),%edi
lea    -0x138(%rbp),%rsi
call   10d0 <getrlimit@plt>
movl   $0x1,-0x13c(%rbp)
movl   $0x1e,-0x140(%rbp)
movl   $0x28,-0x144(%rbp)
movl   $0x25,-0x140(%rbp)
mov    0x2899(%rip),%rax
mov    (%rax),%edi
mov    -0x13c(%rbp),%ecx
mov    -0x140(%rbp),%r8d
mov    -0x144(%rbp),%r9d
mov    -0x128(%rbp),%r11
mov    -0x138(%rbp),%r10d
mov    -0x134(%rbp),%eax
lea    0xa1b(%rip),%rsi
mov    $0x1b,%edx
xor    %ebx,%ebx
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
movl   $0x1b,0x18(%rsp)
movl   $0x0,0x20(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2836(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    -0x138(%rbp),%eax
mov    0x281a(%rip),%rcx
cmp    (%rcx),%eax
jne    1827 <chk_calloc_prepare+0x667>
movl   $0x1,-0x12c(%rbp)
movl   $0x1,-0x148(%rbp)
movl   $0x1e,-0x14c(%rbp)
movl   $0x28,-0x150(%rbp)
movl   $0x21,-0x14c(%rbp)
mov    0x27e1(%rip),%rax
mov    (%rax),%edi
mov    -0x148(%rbp),%ecx
mov    -0x14c(%rbp),%r8d
mov    -0x150(%rbp),%r9d
lea    0x9a9(%rip),%rsi
mov    $0x1b,%edx
xor    %eax,%eax
movl   $0x1b,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x27a0(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
cmpq   $0x0,-0x128(%rbp)
jbe    18ca <chk_calloc_prepare+0x70a>
movslq -0x138(%rbp),%rax
cmp    -0x128(%rbp),%rax
jbe    18ca <chk_calloc_prepare+0x70a>
movl   $0x1,-0x154(%rbp)
movl   $0x1e,-0x158(%rbp)
movl   $0x28,-0x15c(%rbp)
movl   $0x21,-0x158(%rbp)
mov    0x2748(%rip),%rax
mov    (%rax),%edi
mov    -0x154(%rbp),%ecx
mov    -0x158(%rbp),%r8d
mov    -0x15c(%rbp),%r9d
lea    0x940(%rip),%rsi
mov    $0x1b,%edx
xor    %eax,%eax
movl   $0x1b,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2707(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
movl   $0x1,-0x130(%rbp)
cmpl   $0x0,-0x130(%rbp)
je     1b28 <chk_calloc_prepare+0x968>
cmpl   $0x0,-0x12c(%rbp)
je     196d <chk_calloc_prepare+0x7ad>
movl   $0x1,-0x160(%rbp)
movl   $0x1e,-0x164(%rbp)
movl   $0x28,-0x168(%rbp)
movl   $0x21,-0x164(%rbp)
mov    0x26ad(%rip),%rax
mov    (%rax),%edi
mov    -0x160(%rbp),%ecx
mov    -0x164(%rbp),%r8d
mov    -0x168(%rbp),%r9d
lea    0x8e0(%rip),%rsi
mov    $0x1b,%edx
lea    0x912(%rip),%rax
xor    %r10d,%r10d
mov    %rax,(%rsp)
movl   $0x1b,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x265f(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
jmp    1a06 <chk_calloc_prepare+0x846>
movl   $0x1,-0x16c(%rbp)
movl   $0x1e,-0x170(%rbp)
movl   $0x28,-0x174(%rbp)
movl   $0x21,-0x170(%rbp)
mov    0x2624(%rip),%rax
mov    (%rax),%edi
mov    -0x16c(%rbp),%ecx
mov    -0x170(%rbp),%r8d
mov    -0x174(%rbp),%r9d
mov    -0x138(%rbp),%r10d
mov    -0x134(%rbp),%eax
lea    0x88b(%rip),%rsi
mov    $0x1b,%edx
lea    0x87c(%rip),%r11
xor    %ebx,%ebx
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
movl   $0x1b,0x18(%rsp)
movl   $0x0,0x20(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x25c1(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    0x25d3(%rip),%rax
cmpq   $0x0,(%rax)
jle    1a3b <chk_calloc_prepare+0x87b>
mov    -0x128(%rbp),%rax
movslq -0x138(%rbp),%rcx
cmp    %rcx,%rax
jae    1a3b <chk_calloc_prepare+0x87b>
mov    -0x128(%rbp),%rax
mov    %eax,-0x138(%rbp)
mov    0x259e(%rip),%rax
cmpq   $0x0,(%rax)
jle    1a70 <chk_calloc_prepare+0x8b0>
mov    -0x128(%rbp),%rax
movslq -0x134(%rbp),%rcx
cmp    %rcx,%rax
jae    1a70 <chk_calloc_prepare+0x8b0>
mov    -0x128(%rbp),%rax
mov    %eax,-0x134(%rbp)
mov    0x2559(%rip),%rax
mov    (%rax),%edi
lea    -0x138(%rbp),%rsi
call   10a0 <setrlimit@plt>
mov    0x2544(%rip),%rax
mov    (%rax),%edi
lea    -0x138(%rbp),%rsi
call   10d0 <getrlimit@plt>
movl   $0x1,-0x178(%rbp)
movl   $0x1e,-0x17c(%rbp)
movl   $0x28,-0x180(%rbp)
movl   $0x21,-0x17c(%rbp)
mov    0x24f7(%rip),%rax
mov    (%rax),%edi
mov    -0x178(%rbp),%ecx
mov    -0x17c(%rbp),%r8d
mov    -0x180(%rbp),%r9d
mov    -0x138(%rbp),%r10d
mov    -0x134(%rbp),%eax
lea    0x79b(%rip),%rsi
mov    $0x1b,%edx
xor    %r11d,%r11d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x1b,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x249f(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
movl   $0x1,-0x184(%rbp)
movl   $0x1e,-0x188(%rbp)
movl   $0x28,-0x18c(%rbp)
movl   $0x25,-0x188(%rbp)
mov    0x2469(%rip),%rax
mov    (%rax),%edi
mov    -0x184(%rbp),%ecx
mov    -0x188(%rbp),%r8d
mov    -0x18c(%rbp),%r9d
mov    -0x120(%rbp),%rax
lea    0x72f(%rip),%rsi
mov    $0x1b,%edx
xor    %r10d,%r10d
mov    %rax,(%rsp)
movl   $0x1b,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x241b(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    0x23fd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1d2e <chk_calloc_prepare+0xb6e>
movl   $0x1,-0x190(%rbp)
movl   $0x1e,-0x194(%rbp)
movl   $0x28,-0x198(%rbp)
movl   $0x1f,-0x194(%rbp)
mov    0x23d4(%rip),%rax
mov    (%rax),%edi
mov    -0x190(%rbp),%ecx
mov    -0x194(%rbp),%r8d
mov    -0x198(%rbp),%r9d
lea    0x6cd(%rip),%rsi
mov    $0x1b,%edx
xor    %eax,%eax
movl   $0x1b,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2393(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
movl   $0x1,-0x19c(%rbp)
movl   $0x1e,-0x1a0(%rbp)
movl   $0x28,-0x1a4(%rbp)
movl   $0x1f,-0x1a0(%rbp)
mov    0x235d(%rip),%rax
mov    (%rax),%edi
mov    -0x19c(%rbp),%ecx
mov    -0x1a0(%rbp),%r8d
mov    -0x1a4(%rbp),%r9d
lea    0x690(%rip),%rsi
mov    $0x1b,%edx
xor    %eax,%eax
movl   $0x1b,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x231c(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
movl   $0x1,-0x1a8(%rbp)
movl   $0x1e,-0x1ac(%rbp)
movl   $0x28,-0x1b0(%rbp)
movl   $0x25,-0x1ac(%rbp)
mov    0x22e6(%rip),%rax
mov    (%rax),%edi
mov    -0x1a8(%rbp),%ecx
mov    -0x1ac(%rbp),%r8d
mov    -0x1b0(%rbp),%r9d
lea    0x659(%rip),%rsi
mov    $0x1b,%edx
xor    %eax,%eax
movl   $0x1b,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x22a5(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    0x229f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1d8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_calloc_prepare>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xe2b(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <stat@plt>
mov    0x2dc7(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%eax
sete   %dil
call   1050 <assert@plt>
mov    0x2deb(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10c0 <open@plt>
mov    %eax,%ebx
lea    0x20(%rsp),%rbp
mov    %eax,%edi
mov    %rbp,%rsi
mov    $0x20,%edx
call   1040 <read@plt>
lea    0xdfb(%rip),%rsi
lea    0x4c(%rsp),%rdx
mov    %rbp,%rdi
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %ebx,%edi
call   1030 <close@plt>
cmpl   $0x2,0x4c(%rsp)
mov    0x2d7a(%rip),%r13
mov    0x0(%r13),%edi
jne    134c <chk_calloc_prepare+0x18c>
lea    0xdcb(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x25,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
call   1060 <fprintf@plt>
add    $0x10,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
movq   $0xffffffffffffffff,0x10(%rsp)
ff ff
movq   $0xffffffffffffffff,0x18(%rsp)
ff ff
lea    0xdc3(%rip),%rdi
call   10b0 <read_file_lines@plt>
test   %rax,%rax
je     140d <chk_calloc_prepare+0x24d>
mov    %rax,%r12
lea    0xdb9(%rip),%r13
lea    0xdc1(%rip),%r14
lea    0xdb5(%rip),%r15
lea    0xd96(%rip),%rbx
lea    0x10(%rsp),%rbp
jmp    130e <chk_calloc_prepare+0x14e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x9,%r12
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
shlq   $0xa,0x10(%rsp)
mov    %rbx,%rdi
call   10b0 <read_file_lines@plt>
mov    %rax,%r12
test   %rax,%rax
je     13ff <chk_calloc_prepare+0x23f>
mov    %r12,%rdi
mov    %r13,%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
jne    12e0 <chk_calloc_prepare+0x120>
mov    %r12,%rdi
mov    %r14,%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
je     12fa <chk_calloc_prepare+0x13a>
add    $0xa,%r12
mov    %r12,%rdi
mov    %r15,%rsi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
shlq   $0xa,0x18(%rsp)
jmp    12fa <chk_calloc_prepare+0x13a>
lea    0xf83(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x1f,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
call   1060 <fprintf@plt>
add    $0x10,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x0(%r13),%edi
lea    0xf84(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x1f,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
call   1060 <fprintf@plt>
add    $0x10,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x0(%r13),%edi
lea    0xf8b(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x25,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
call   1060 <fprintf@plt>
add    $0x10,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x2bce(%rip),%rax
jmp    188f <chk_calloc_prepare+0x6cf>
mov    0x10(%rsp),%rbp
mov    0x2bb5(%rip),%r13
jmp    1414 <chk_calloc_prepare+0x254>
mov    $0xffffffffffffffff,%rbp
mov    0x0(%r13),%edi
sub    $0x8,%rsp
lea    0xc66(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x25,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
push   %rbp
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x0(%r13),%edi
sub    $0x8,%rsp
lea    0xc55(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x25,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
push   0x30(%rsp)
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
lea    0xc49(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <stat@plt>
xor    %edi,%edi
mov    0x2b00(%rip),%r12
cmp    (%r12),%eax
sete   %dil
call   1050 <assert@plt>
mov    0x2b24(%rip),%r14
mov    (%r14),%esi
mov    %rbx,%rdi
call   10c0 <open@plt>
mov    %eax,%ebp
lea    0x20(%rsp),%rbx
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0x20,%edx
call   1040 <read@plt>
lea    0xb33(%rip),%rsi
lea    0x48(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %ebp,%edi
call   1030 <close@plt>
mov    0x0(%r13),%edi
mov    0x48(%rsp),%ebp
sub    $0x8,%rsp
lea    0xbe6(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x25,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
push   %rbp
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x18(%rsp),%r15
movl   $0x0,0x8(%rsp)
lea    0xbd0(%rip),%rbx
lea    0x50(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <stat@plt>
xor    %edi,%edi
cmp    (%r12),%eax
sete   %dil
call   1050 <assert@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   10c0 <open@plt>
mov    %eax,%ebx
lea    0x20(%rsp),%rbp
mov    %eax,%edi
mov    %rbp,%rsi
mov    $0x20,%edx
call   1040 <read@plt>
lea    0x8(%rsp),%rdx
mov    %rbp,%rdi
lea    0xa7b(%rip),%rsi
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    0x0(%r13),%edi
mov    0x8(%rsp),%ebp
sub    $0x8,%rsp
lea    0xb81(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x25,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
push   %rbp
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
movslq 0x8(%rsp),%rax
imul   0x10(%rsp),%rax
shr    $0x2,%rax
movabs $0x28f5c28f5c28f5c3,%rcx
c2 f5 28
mul    %rcx
mov    %rdx,%r12
shr    $0x2,%r12
add    %r15,%r12
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    0x299b(%rip),%r14
mov    (%r14),%edi
lea    0x20(%rsp),%rsi
call   10d0 <getrlimit@plt>
mov    0x0(%r13),%edi
mov    0x20(%rsp),%ebp
mov    0x24(%rsp),%ebx
sub    $0x8,%rsp
lea    0xb1a(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x25,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
push   %rbx
push   %rbp
push   %r12
call   1060 <fprintf@plt>
add    $0x30,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x20(%rsp),%ebp
mov    0x2922(%rip),%rax
mov    (%rax),%r15d
mov    %ebp,%eax
cmp    %r15d,%ebp
jne    16dd <chk_calloc_prepare+0x51d>
mov    0x0(%r13),%edi
lea    0xafa(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x21,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
call   1060 <fprintf@plt>
add    $0x10,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x20(%rsp),%eax
test   %r12,%r12
je     1849 <chk_calloc_prepare+0x689>
cltq
cmp    %rax,%r12
jae    1849 <chk_calloc_prepare+0x689>
mov    0x0(%r13),%edi
lea    0xad9(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x21,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
call   1060 <fprintf@plt>
add    $0x10,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x0(%r13),%edi
cmp    %r15d,%ebp
jne    176d <chk_calloc_prepare+0x5ad>
sub    $0x8,%rsp
lea    0xb10(%rip),%rbp
lea    0xacb(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x21,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
push   %rbp
call   1060 <fprintf@plt>
add    $0x20,%rsp
jmp    17b0 <chk_calloc_prepare+0x5f0>
mov    0x20(%rsp),%ebp
mov    0x24(%rsp),%ebx
sub    $0x8,%rsp
lea    0xace(%rip),%r10
lea    0xaca(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x21,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
push   %rbx
push   %rbp
push   %r10
call   1060 <fprintf@plt>
add    $0x30,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x2820(%rip),%rax
mov    (%rax),%rax
test   %rax,%rax
jle    17d7 <chk_calloc_prepare+0x617>
movslq 0x20(%rsp),%rcx
cmp    %rcx,%r12
jae    17d7 <chk_calloc_prepare+0x617>
mov    %r12d,0x20(%rsp)
test   %rax,%rax
jle    17eb <chk_calloc_prepare+0x62b>
movslq 0x24(%rsp),%rax
cmp    %rax,%r12
jae    17eb <chk_calloc_prepare+0x62b>
mov    %r12d,0x24(%rsp)
mov    (%r14),%edi
lea    0x20(%rsp),%rbp
mov    %rbp,%rsi
call   10a0 <setrlimit@plt>
mov    (%r14),%edi
mov    %rbp,%rsi
call   10d0 <getrlimit@plt>
mov    0x0(%r13),%edi
mov    0x20(%rsp),%ebp
mov    0x24(%rsp),%ebx
lea    0xa75(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x21,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
push   %rbx
push   %rbp
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x0(%r13),%edi
sub    $0x8,%rsp
lea    0xa52(%rip),%rsi
mov    $0x1b,%edx
mov    $0x1,%ecx
mov    $0x25,%r8d
mov    $0x28,%r9d
xor    %eax,%eax
push   $0x0
push   $0x1b
push   %r12
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    0x0(%r13),%edi
call   1080 <fflush@plt>
mov    0x2721(%rip),%rax
mov    (%rax),%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.rlimit = type { i32, i32 }
@EXIT_FAILURE = global i32 0
@.str = [31 x i8] c"/proc/sys/vm/overcommit_memory\00"
@EXIT_SUCCESS = global i32 0
@O_RDONLY = global i32 0
@.str.1 = [3 x i8] c"%i\00"
@stdout = global i32 0
@.str.2 = [63 x i8] c"%c[%d;%d;%dmI Memory overcommit protection is ON; Good.\0A%c[%dm\00"
@.str.3 = [14 x i8] c"/proc/meminfo\00"
@.str.4 = [10 x i8] c"MemTotal:\00"
@.str.5 = [5 x i8] c"%llu\00"
@.str.6 = [11 x i8] c"SwapTotal:\00"
@.str.7 = [45 x i8] c"%c[%d;%d;%dmI MemTotal : %llu\0A%c[%dm\00"
@.str.8 = [45 x i8] c"%c[%d;%d;%dmI SwapTotal : %llu\0A%c[%dm\00"
@.str.9 = [24 x i8] c"/proc/sys/vm/swappiness\00"
@.str.10 = [45 x i8] c"%c[%d;%d;%dmI Swappiness: : %i%%\0A%c[%dm\00"
@.str.11 = [30 x i8] c"/proc/sys/vm/overcommit_ratio\00"
@.str.12 = [45 x i8] c"%c[%d;%d;%dmI Overcommit ratio : %i%%\0A%c[%dm\00"
@RLIMIT_AS = global i32 0
@.str.13 = [50 x i8] c"%c[%d;%d;%dmI AS syslim:%lu usrlim:%lu:%lu\0A%c[%dm\00"
@RLIM_INFINITY = global i32 0
@.str.14 = [48 x i8] c"%c[%d;%d;%dmW \\___User limit is unbound!\0A%c[%dm\00"
@.str.15 = [59 x i8] c"%c[%d;%d;%dmW \\___ User limit exceeds system limit!\0A%c[%dm\00"
@.str.16 = [62 x i8] c"%c[%d;%d;%dmW \\___ Changing %s limit from INFINITY to%c[%dm\00"
@.str.17 = [3 x i8] c"AS\00"
@.str.18 = [61 x i8] c"%c[%d;%d;%dmW \\___ Changing %s limit from %lu:%lu to%c[%dm\00"
@system = global i64 0
@.str.19 = [28 x i8] c"%c[%d;%d;%dm %lu:%lu\0A%c[%dm\00"
@.str.20 = [44 x i8] c"%c[%d;%d;%dmI Overcommit limit : %lu\0A%c[%dm\00"
@.str.21 = [58 x i8] c"%c[%d;%d;%dmE Memory overcommit protection is OFF!\0A%c[%dm\00"
@.str.22 = [64 x i8] c"%c[%d;%d;%dmE \\___ Cowardly refusing to run CALLOC test.\0A%c[%dm\00"
@.str.23 = [79 x i8] c"%c[%d;%d;%dmI \\___ To run this test, run: sysctl vm.overcommit_memory=2\0A%c[%dm\00"
define i32 @chk_calloc_prepare() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [32 x i8]
%4 = alloca %struct.stat
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca [32 x i8]
%21 = alloca %struct.stat
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i64
%27 = alloca i32
%28 = alloca [32 x i8]
%29 = alloca %struct.stat
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i64
%35 = alloca i64
%36 = alloca i32
%37 = alloca i32
%38 = alloca %struct.rlimit
%39 = alloca i32
%40 = alloca i32
%41 = alloca i32
%42 = alloca i32
%43 = alloca i32
%44 = alloca i32
%45 = alloca i32
%46 = alloca i32
%47 = alloca i32
%48 = alloca i32
%49 = alloca i32
%50 = alloca i32
%51 = alloca i32
%52 = alloca i32
%53 = alloca i32
%54 = alloca i32
%55 = alloca i32
%56 = alloca i32
%57 = alloca i32
%58 = alloca i32
%59 = alloca i32
%60 = alloca i32
%61 = alloca i32
%62 = alloca i32
%63 = alloca i32
%64 = alloca i32
%65 = alloca i32
%66 = alloca i32
%67 = alloca i32
%68 = alloca i32
%69 = load i32, i32* @EXIT_FAILURE
store i32 %69, i32* %1
%70 = call i32 @stat(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), %struct.stat* %4)
%71 = load i32, i32* @EXIT_SUCCESS
%72 = icmp eq i32 %70, %71
%73 = zext i1 %72 to i32
%74 = call i64 @assert(i32 %73)
%75 = load i32, i32* @O_RDONLY
%76 = call i32 @open(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %75)
store i32 %76, i32* %5
%77 = load i32, i32* %5
%78 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%79 = call i32 @read(i32 %77, i8* %78, i32 32)
%80 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%81 = call i32 (i8*, i8*, ...) @sscanf(i8* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%82 = load i32, i32* %5
%83 = call i32 @close(i32 %82)
%84 = load i32, i32* %2
%85 = icmp eq i32 %84, 2
br i1 %85, label %86, label %317
86: ; preds = %0
store i32 1, i32* %6
store i32 30, i32* %7
store i32 40, i32* %8
store i32 37, i32* %7
%87 = load i32, i32* @stdout
%88 = load i32, i32* %6
%89 = load i32, i32* %7
%90 = load i32, i32* %8
%91 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0), i32 27, i32 %88, i32 %89, i32 %90, i32 27, i32 0)
%92 = load i32, i32* @stdout
%93 = call i32 @fflush(i32 %92)
store i64 -1, i64* %11
store i64 -1, i64* %12
br label %94
94: ; preds = %118, %86
%95 = call i8* @read_file_lines(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
store i8* %95, i8** %9
%96 = icmp ne i8* %95, null
br i1 %96, label %97, label %119
97: ; preds = %94
%98 = load i8*, i8** %9
%99 = call i8* @strstr(i8* %98, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
store i8* %99, i8** %10
%100 = icmp ne i8* %99, null
br i1 %100, label %101, label %107
101: ; preds = %97
%102 = load i8*, i8** %9
%103 = getelementptr inbounds i8, i8* %102, i64 9
%104 = call i32 (i8*, i8*, ...) @sscanf(i8* %103, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64* %11)
%105 = load i64, i64* %11
%106 = mul i64 %105, 1024
store i64 %106, i64* %11
br label %118
107: ; preds = %97
%108 = load i8*, i8** %9
%109 = call i8* @strstr(i8* %108, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
store i8* %109, i8** %10
%110 = icmp ne i8* %109, null
br i1 %110, label %111, label %117
111: ; preds = %107
%112 = load i8*, i8** %9
%113 = getelementptr inbounds i8, i8* %112, i64 10
%114 = call i32 (i8*, i8*, ...) @sscanf(i8* %113, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64* %12)
%115 = load i64, i64* %12
%116 = mul i64 %115, 1024
store i64 %116, i64* %12
br label %117
117: ; preds = %111, %107
br label %118
118: ; preds = %117, %101
br label %94
119: ; preds = %94
store i32 1, i32* %13
store i32 30, i32* %14
store i32 40, i32* %15
store i32 37, i32* %14
%120 = load i32, i32* @stdout
%121 = load i32, i32* %13
%122 = load i32, i32* %14
%123 = load i32, i32* %15
%124 = load i64, i64* %11
%125 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %120, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i32 27, i32 %121, i32 %122, i32 %123, i64 %124, i32 27, i32 0)
%126 = load i32, i32* @stdout
%127 = call i32 @fflush(i32 %126)
store i32 1, i32* %16
store i32 30, i32* %17
store i32 40, i32* %18
store i32 37, i32* %17
%128 = load i32, i32* @stdout
%129 = load i32, i32* %16
%130 = load i32, i32* %17
%131 = load i32, i32* %18
%132 = load i64, i64* %12
%133 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %128, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0), i32 27, i32 %129, i32 %130, i32 %131, i64 %132, i32 27, i32 0)
%134 = load i32, i32* @stdout
%135 = call i32 @fflush(i32 %134)
%136 = call i32 @stat(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), %struct.stat* %21)
%137 = load i32, i32* @EXIT_SUCCESS
%138 = icmp eq i32 %136, %137
%139 = zext i1 %138 to i32
%140 = call i64 @assert(i32 %139)
%141 = load i32, i32* @O_RDONLY
%142 = call i32 @open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %141)
store i32 %142, i32* %22
%143 = load i32, i32* %22
%144 = getelementptr inbounds [32 x i8], [32 x i8]* %20, i64 0, i64 0
%145 = call i32 @read(i32 %143, i8* %144, i32 32)
%146 = getelementptr inbounds [32 x i8], [32 x i8]* %20, i64 0, i64 0
%147 = call i32 (i8*, i8*, ...) @sscanf(i8* %146, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %19)
%148 = load i32, i32* %22
%149 = call i32 @close(i32 %148)
store i32 1, i32* %23
store i32 30, i32* %24
store i32 40, i32* %25
store i32 37, i32* %24
%150 = load i32, i32* @stdout
%151 = load i32, i32* %23
%152 = load i32, i32* %24
%153 = load i32, i32* %25
%154 = load i32, i32* %19
%155 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %150, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.10, i64 0, i64 0), i32 27, i32 %151, i32 %152, i32 %153, i32 %154, i32 27, i32 0)
%156 = load i32, i32* @stdout
%157 = call i32 @fflush(i32 %156)
%158 = load i64, i64* %12
store i64 %158, i64* %26
store i32 0, i32* %27
%159 = call i32 @stat(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), %struct.stat* %29)
%160 = load i32, i32* @EXIT_SUCCESS
%161 = icmp eq i32 %159, %160
%162 = zext i1 %161 to i32
%163 = call i64 @assert(i32 %162)
%164 = load i32, i32* @O_RDONLY
%165 = call i32 @open(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i32 %164)
store i32 %165, i32* %30
%166 = load i32, i32* %30
%167 = getelementptr inbounds [32 x i8], [32 x i8]* %28, i64 0, i64 0
%168 = call i32 @read(i32 %166, i8* %167, i32 32)
%169 = getelementptr inbounds [32 x i8], [32 x i8]* %28, i64 0, i64 0
%170 = call i32 (i8*, i8*, ...) @sscanf(i8* %169, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %27)
%171 = load i32, i32* %30
%172 = call i32 @close(i32 %171)
store i32 1, i32* %31
store i32 30, i32* %32
store i32 40, i32* %33
store i32 37, i32* %32
%173 = load i32, i32* @stdout
%174 = load i32, i32* %31
%175 = load i32, i32* %32
%176 = load i32, i32* %33
%177 = load i32, i32* %27
%178 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %173, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.12, i64 0, i64 0), i32 27, i32 %174, i32 %175, i32 %176, i32 %177, i32 27, i32 0)
%179 = load i32, i32* @stdout
%180 = call i32 @fflush(i32 %179)
%181 = load i64, i64* %11
%182 = load i32, i32* %27
%183 = sext i32 %182 to i64
%184 = mul i64 %181, %183
%185 = udiv i64 %184, 100
%186 = load i64, i64* %26
%187 = add i64 %186, %185
store i64 %187, i64* %26
%188 = load i64, i64* %26
store i64 %188, i64* %34
%189 = load i64, i64* %34
%190 = load i64, i64* %26
%191 = icmp eq i64 %189, %190
%192 = zext i1 %191 to i32
%193 = call i64 @assert(i32 %192)
%194 = call i64 @assert(i32 1)
%195 = load i64, i64* %34
store i64 %195, i64* %35
store i32 0, i32* %36
store i32 0, i32* %37
%196 = load i32, i32* @RLIMIT_AS
%197 = call i32 @getrlimit(i32 %196, %struct.rlimit* %38)
store i32 1, i32* %39
store i32 30, i32* %40
store i32 40, i32* %41
store i32 37, i32* %40
%198 = load i32, i32* @stdout
%199 = load i32, i32* %39
%200 = load i32, i32* %40
%201 = load i32, i32* %41
%202 = load i64, i64* %35
%203 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 0
%204 = load i32, i32* %203
%205 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 1
%206 = load i32, i32* %205
%207 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %198, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.13, i64 0, i64 0), i32 27, i32 %199, i32 %200, i32 %201, i64 %202, i32 %204, i32 %206, i32 27, i32 0)
%208 = load i32, i32* @stdout
%209 = call i32 @fflush(i32 %208)
%210 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 0
%211 = load i32, i32* %210
%212 = load i32, i32* @RLIM_INFINITY
%213 = icmp eq i32 %211, %212
br i1 %213, label %214, label %222
214: ; preds = %119
store i32 1, i32* %36
store i32 1, i32* %42
store i32 30, i32* %43
store i32 40, i32* %44
store i32 33, i32* %43
%215 = load i32, i32* @stdout
%216 = load i32, i32* %42
%217 = load i32, i32* %43
%218 = load i32, i32* %44
%219 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %215, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.14, i64 0, i64 0), i32 27, i32 %216, i32 %217, i32 %218, i32 27, i32 0)
%220 = load i32, i32* @stdout
%221 = call i32 @fflush(i32 %220)
br label %222
222: ; preds = %214, %119
%223 = load i64, i64* %35
%224 = icmp ugt i64 %223, 0
br i1 %224, label %225, label %239
225: ; preds = %222
%226 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 0
%227 = load i32, i32* %226
%228 = sext i32 %227 to i64
%229 = load i64, i64* %35
%230 = icmp ugt i64 %228, %229
br i1 %230, label %231, label %239
231: ; preds = %225
store i32 1, i32* %45
store i32 30, i32* %46
store i32 40, i32* %47
store i32 33, i32* %46
%232 = load i32, i32* @stdout
%233 = load i32, i32* %45
%234 = load i32, i32* %46
%235 = load i32, i32* %47
%236 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %232, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.15, i64 0, i64 0), i32 27, i32 %233, i32 %234, i32 %235, i32 27, i32 0)
%237 = load i32, i32* @stdout
%238 = call i32 @fflush(i32 %237)
store i32 1, i32* %37
br label %239
239: ; preds = %231, %225, %222
%240 = load i32, i32* %37
%241 = icmp ne i32 %240, 0
br i1 %241, label %242, label %307
242: ; preds = %239
%243 = load i32, i32* %36
%244 = icmp ne i32 %243, 0
br i1 %244, label %245, label %253
245: ; preds = %242
store i32 1, i32* %48
store i32 30, i32* %49
store i32 40, i32* %50
store i32 33, i32* %49
%246 = load i32, i32* @stdout
%247 = load i32, i32* %48
%248 = load i32, i32* %49
%249 = load i32, i32* %50
%250 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %246, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.16, i64 0, i64 0), i32 27, i32 %247, i32 %248, i32 %249, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i32 27, i32 0)
%251 = load i32, i32* @stdout
%252 = call i32 @fflush(i32 %251)
br label %265
253: ; preds = %242
store i32 1, i32* %51
store i32 30, i32* %52
store i32 40, i32* %53
store i32 33, i32* %52
%254 = load i32, i32* @stdout
%255 = load i32, i32* %51
%256 = load i32, i32* %52
%257 = load i32, i32* %53
%258 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 0
%259 = load i32, i32* %258
%260 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 1
%261 = load i32, i32* %260
%262 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %254, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.18, i64 0, i64 0), i32 27, i32 %255, i32 %256, i32 %257, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i32 %259, i32 %261, i32 27, i32 0)
%263 = load i32, i32* @stdout
%264 = call i32 @fflush(i32 %263)
br label %265
265: ; preds = %253, %245
%266 = load i64, i64* @system
%267 = icmp sgt i64 %266, 0
br i1 %267, label %268, label %278
268: ; preds = %265
%269 = load i64, i64* %35
%270 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 0
%271 = load i32, i32* %270
%272 = sext i32 %271 to i64
%273 = icmp ult i64 %269, %272
br i1 %273, label %274, label %278
274: ; preds = %268
%275 = load i64, i64* %35
%276 = trunc i64 %275 to i32
%277 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 0
store i32 %276, i32* %277
br label %278
278: ; preds = %274, %268, %265
%279 = load i64, i64* @system
%280 = icmp sgt i64 %279, 0
br i1 %280, label %281, label %291
281: ; preds = %278
%282 = load i64, i64* %35
%283 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 1
%284 = load i32, i32* %283
%285 = sext i32 %284 to i64
%286 = icmp ult i64 %282, %285
br i1 %286, label %287, label %291
287: ; preds = %281
%288 = load i64, i64* %35
%289 = trunc i64 %288 to i32
%290 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 1
store i32 %289, i32* %290
br label %291
291: ; preds = %287, %281, %278
%292 = load i32, i32* @RLIMIT_AS
%293 = call i32 @setrlimit(i32 %292, %struct.rlimit* %38)
%294 = load i32, i32* @RLIMIT_AS
%295 = call i32 @getrlimit(i32 %294, %struct.rlimit* %38)
store i32 1, i32* %54
store i32 30, i32* %55
store i32 40, i32* %56
store i32 33, i32* %55
%296 = load i32, i32* @stdout
%297 = load i32, i32* %54
%298 = load i32, i32* %55
%299 = load i32, i32* %56
%300 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 0
%301 = load i32, i32* %300
%302 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %38, i32 0, i32 1
%303 = load i32, i32* %302
%304 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %296, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0), i32 27, i32 %297, i32 %298, i32 %299, i32 %301, i32 %303, i32 27, i32 0)
%305 = load i32, i32* @stdout
%306 = call i32 @fflush(i32 %305)
br label %307
307: ; preds = %291, %239
store i32 1, i32* %57
store i32 30, i32* %58
store i32 40, i32* %59
store i32 37, i32* %58
%308 = load i32, i32* @stdout
%309 = load i32, i32* %57
%310 = load i32, i32* %58
%311 = load i32, i32* %59
%312 = load i64, i64* %34
%313 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %308, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.20, i64 0, i64 0), i32 27, i32 %309, i32 %310, i32 %311, i64 %312, i32 27, i32 0)
%314 = load i32, i32* @stdout
%315 = call i32 @fflush(i32 %314)
%316 = load i32, i32* @EXIT_SUCCESS
store i32 %316, i32* %1
br label %340
317: ; preds = %0
store i32 1, i32* %60
store i32 30, i32* %61
store i32 40, i32* %62
store i32 31, i32* %61
%318 = load i32, i32* @stdout
%319 = load i32, i32* %60
%320 = load i32, i32* %61
%321 = load i32, i32* %62
%322 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %318, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.21, i64 0, i64 0), i32 27, i32 %319, i32 %320, i32 %321, i32 27, i32 0)
%323 = load i32, i32* @stdout
%324 = call i32 @fflush(i32 %323)
store i32 1, i32* %63
store i32 30, i32* %64
store i32 40, i32* %65
store i32 31, i32* %64
%325 = load i32, i32* @stdout
%326 = load i32, i32* %63
%327 = load i32, i32* %64
%328 = load i32, i32* %65
%329 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %325, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.22, i64 0, i64 0), i32 27, i32 %326, i32 %327, i32 %328, i32 27, i32 0)
%330 = load i32, i32* @stdout
%331 = call i32 @fflush(i32 %330)
store i32 1, i32* %66
store i32 30, i32* %67
store i32 40, i32* %68
store i32 37, i32* %67
%332 = load i32, i32* @stdout
%333 = load i32, i32* %66
%334 = load i32, i32* %67
%335 = load i32, i32* %68
%336 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %332, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.23, i64 0, i64 0), i32 27, i32 %333, i32 %334, i32 %335, i32 27, i32 0)
%337 = load i32, i32* @stdout
%338 = call i32 @fflush(i32 %337)
%339 = load i32, i32* @EXIT_FAILURE
store i32 %339, i32* %1
br label %340
340: ; preds = %317, %307
%341 = load i32, i32* %1
ret i32 %341
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.rlimit = type { i32, i32 }
@EXIT_FAILURE = global i32 0
@.str = [31 x i8] c"/proc/sys/vm/overcommit_memory\00"
@EXIT_SUCCESS = global i32 0
@O_RDONLY = global i32 0
@.str.1 = [3 x i8] c"%i\00"
@stdout = global i32 0
@.str.2 = [63 x i8] c"%c[%d;%d;%dmI Memory overcommit protection is ON; Good.\0A%c[%dm\00"
@.str.3 = [14 x i8] c"/proc/meminfo\00"
@.str.4 = [10 x i8] c"MemTotal:\00"
@.str.5 = [5 x i8] c"%llu\00"
@.str.6 = [11 x i8] c"SwapTotal:\00"
@.str.7 = [45 x i8] c"%c[%d;%d;%dmI MemTotal : %llu\0A%c[%dm\00"
@.str.8 = [45 x i8] c"%c[%d;%d;%dmI SwapTotal : %llu\0A%c[%dm\00"
@.str.9 = [24 x i8] c"/proc/sys/vm/swappiness\00"
@.str.10 = [45 x i8] c"%c[%d;%d;%dmI Swappiness: : %i%%\0A%c[%dm\00"
@.str.11 = [30 x i8] c"/proc/sys/vm/overcommit_ratio\00"
@.str.12 = [45 x i8] c"%c[%d;%d;%dmI Overcommit ratio : %i%%\0A%c[%dm\00"
@RLIMIT_AS = global i32 0
@.str.13 = [50 x i8] c"%c[%d;%d;%dmI AS syslim:%lu usrlim:%lu:%lu\0A%c[%dm\00"
@RLIM_INFINITY = global i32 0
@.str.14 = [48 x i8] c"%c[%d;%d;%dmW \\___User limit is unbound!\0A%c[%dm\00"
@.str.15 = [59 x i8] c"%c[%d;%d;%dmW \\___ User limit exceeds system limit!\0A%c[%dm\00"
@.str.16 = [62 x i8] c"%c[%d;%d;%dmW \\___ Changing %s limit from INFINITY to%c[%dm\00"
@.str.17 = [3 x i8] c"AS\00"
@.str.18 = [61 x i8] c"%c[%d;%d;%dmW \\___ Changing %s limit from %lu:%lu to%c[%dm\00"
@system = global i64 0
@.str.19 = [28 x i8] c"%c[%d;%d;%dm %lu:%lu\0A%c[%dm\00"
@.str.20 = [44 x i8] c"%c[%d;%d;%dmI Overcommit limit : %lu\0A%c[%dm\00"
@.str.21 = [58 x i8] c"%c[%d;%d;%dmE Memory overcommit protection is OFF!\0A%c[%dm\00"
@.str.22 = [64 x i8] c"%c[%d;%d;%dmE \\___ Cowardly refusing to run CALLOC test.\0A%c[%dm\00"
@.str.23 = [79 x i8] c"%c[%d;%d;%dmI \\___ To run this test, run: sysctl vm.overcommit_memory=2\0A%c[%dm\00"
define i32 @chk_calloc_prepare() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = alloca %struct.stat
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca [32 x i8]
%8 = alloca %struct.stat
%9 = alloca i32
%10 = alloca [32 x i8]
%11 = alloca %struct.stat
%12 = alloca %struct.rlimit
%13 = bitcast i32* %1 to i8*
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%15 = bitcast %struct.stat* %3 to i8*
%16 = call i32 @stat(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), %struct.stat* %3)
%17 = load i32, i32* @EXIT_SUCCESS
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = tail call i64 @assert(i32 %19)
%21 = load i32, i32* @O_RDONLY
%22 = tail call i32 @open(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = call i32 @read(i32 %22, i8* %14, i32 32)
%24 = call i32 (i8*, i8*, ...) @sscanf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%25 = call i32 @close(i32 %22)
%26 = load i32, i32* %1
%27 = icmp eq i32 %26, 2
%28 = load i32, i32* @stdout
br i1 %27, label %29, label %188
29: ; preds = %0
%30 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0), i32 27, i32 1, i32 37, i32 40, i32 27, i32 0)
%31 = load i32, i32* @stdout
%32 = call i32 @fflush(i32 %31)
%33 = bitcast i64* %4 to i8*
store i64 -1, i64* %4
%34 = bitcast i64* %5 to i8*
store i64 -1, i64* %5
%35 = call i8* @read_file_lines(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i8* %35, null
br i1 %36, label %59, label %37
37: ; preds = %29, %54
%38 = phi i8* [ %55, %54 ], [ %35, %29 ]
%39 = call i8* @strstr(i8* %38, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%40 = icmp eq i8* %39, null
br i1 %40, label %46, label %41
41: ; preds = %37
%42 = getelementptr inbounds i8, i8* %38, i64 9
%43 = call i32 (i8*, i8*, ...) @sscanf(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64* %4)
%44 = load i64, i64* %4
%45 = shl i64 %44, 10
store i64 %45, i64* %4
br label %54
46: ; preds = %37
%47 = call i8* @strstr(i8* %38, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%48 = icmp eq i8* %47, null
br i1 %48, label %54, label %49
49: ; preds = %46
%50 = getelementptr inbounds i8, i8* %38, i64 10
%51 = call i32 (i8*, i8*, ...) @sscanf(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64* %5)
%52 = load i64, i64* %5
%53 = shl i64 %52, 10
store i64 %53, i64* %5
br label %54
54: ; preds = %46, %49, %41
%55 = call i8* @read_file_lines(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%56 = icmp eq i8* %55, null
br i1 %56, label %57, label %37
57: ; preds = %54
%58 = load i64, i64* %4
br label %59
59: ; preds = %57, %29
%60 = phi i64 [ %58, %57 ], [ -1, %29 ]
%61 = load i32, i32* @stdout
%62 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i32 27, i32 1, i32 37, i32 40, i64 %60, i32 27, i32 0)
%63 = load i32, i32* @stdout
%64 = call i32 @fflush(i32 %63)
%65 = load i32, i32* @stdout
%66 = load i64, i64* %5
%67 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0), i32 27, i32 1, i32 37, i32 40, i64 %66, i32 27, i32 0)
%68 = load i32, i32* @stdout
%69 = call i32 @fflush(i32 %68)
%70 = bitcast i32* %6 to i8*
%71 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%72 = bitcast %struct.stat* %8 to i8*
%73 = call i32 @stat(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), %struct.stat* %8)
%74 = load i32, i32* @EXIT_SUCCESS
%75 = icmp eq i32 %73, %74
%76 = zext i1 %75 to i32
%77 = call i64 @assert(i32 %76)
%78 = load i32, i32* @O_RDONLY
%79 = call i32 @open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %78)
%80 = call i32 @read(i32 %79, i8* %71, i32 32)
%81 = call i32 (i8*, i8*, ...) @sscanf(i8* %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%82 = call i32 @close(i32 %79)
%83 = load i32, i32* @stdout
%84 = load i32, i32* %6
%85 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.10, i64 0, i64 0), i32 27, i32 1, i32 37, i32 40, i32 %84, i32 27, i32 0)
%86 = load i32, i32* @stdout
%87 = call i32 @fflush(i32 %86)
%88 = load i64, i64* %5
%89 = bitcast i32* %9 to i8*
store i32 0, i32* %9
%90 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
%91 = bitcast %struct.stat* %11 to i8*
%92 = call i32 @stat(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), %struct.stat* %11)
%93 = load i32, i32* @EXIT_SUCCESS
%94 = icmp eq i32 %92, %93
%95 = zext i1 %94 to i32
%96 = call i64 @assert(i32 %95)
%97 = load i32, i32* @O_RDONLY
%98 = call i32 @open(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i32 %97)
%99 = call i32 @read(i32 %98, i8* %90, i32 32)
%100 = call i32 (i8*, i8*, ...) @sscanf(i8* %90, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%101 = call i32 @close(i32 %98)
%102 = load i32, i32* @stdout
%103 = load i32, i32* %9
%104 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.12, i64 0, i64 0), i32 27, i32 1, i32 37, i32 40, i32 %103, i32 27, i32 0)
%105 = load i32, i32* @stdout
%106 = call i32 @fflush(i32 %105)
%107 = load i64, i64* %4
%108 = load i32, i32* %9
%109 = sext i32 %108 to i64
%110 = mul i64 %107, %109
%111 = udiv i64 %110, 100
%112 = add i64 %111, %88
%113 = call i64 @assert(i32 1)
%114 = call i64 @assert(i32 1)
%115 = bitcast %struct.rlimit* %12 to i8*
%116 = load i32, i32* @RLIMIT_AS
%117 = call i32 @getrlimit(i32 %116, %struct.rlimit* %12)
%118 = load i32, i32* @stdout
%119 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %12, i64 0, i32 0
%120 = load i32, i32* %119
%121 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %12, i64 0, i32 1
%122 = load i32, i32* %121
%123 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.13, i64 0, i64 0), i32 27, i32 1, i32 37, i32 40, i64 %112, i32 %120, i32 %122, i32 27, i32 0)
%124 = load i32, i32* @stdout
%125 = call i32 @fflush(i32 %124)
%126 = load i32, i32* %119
%127 = load i32, i32* @RLIM_INFINITY
%128 = icmp eq i32 %126, %127
br i1 %128, label %129, label %135
129: ; preds = %59
%130 = load i32, i32* @stdout
%131 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.14, i64 0, i64 0), i32 27, i32 1, i32 33, i32 40, i32 27, i32 0)
%132 = load i32, i32* @stdout
%133 = call i32 @fflush(i32 %132)
%134 = load i32, i32* %119
br label %135
135: ; preds = %129, %59
%136 = phi i32 [ %134, %129 ], [ %126, %59 ]
%137 = icmp ne i64 %112, 0
%138 = sext i32 %136 to i64
%139 = icmp ult i64 %112, %138
%140 = select i1 %137, i1 %139, i1 false
br i1 %140, label %141, label %182
141: ; preds = %135
%142 = load i32, i32* @stdout
%143 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %142, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.15, i64 0, i64 0), i32 27, i32 1, i32 33, i32 40, i32 27, i32 0)
%144 = load i32, i32* @stdout
%145 = call i32 @fflush(i32 %144)
%146 = load i32, i32* @stdout
br i1 %128, label %147, label %149
147: ; preds = %141
%148 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %146, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.16, i64 0, i64 0), i32 27, i32 1, i32 33, i32 40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i32 27, i32 0)
br label %153
149: ; preds = %141
%150 = load i32, i32* %119
%151 = load i32, i32* %121
%152 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %146, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.18, i64 0, i64 0), i32 27, i32 1, i32 33, i32 40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i32 %150, i32 %151, i32 27, i32 0)
br label %153
153: ; preds = %149, %147
%154 = load i32, i32* @stdout
%155 = call i32 @fflush(i32 %154)
%156 = load i64, i64* @system
%157 = icmp sgt i64 %156, 0
%158 = load i32, i32* %119
%159 = sext i32 %158 to i64
%160 = icmp ult i64 %112, %159
%161 = select i1 %157, i1 %160, i1 false
br i1 %161, label %162, label %164
162: ; preds = %153
%163 = trunc i64 %112 to i32
store i32 %163, i32* %119
br label %164
164: ; preds = %162, %153
%165 = load i32, i32* %121
%166 = sext i32 %165 to i64
%167 = icmp ult i64 %112, %166
%168 = select i1 %157, i1 %167, i1 false
br i1 %168, label %169, label %171
169: ; preds = %164
%170 = trunc i64 %112 to i32
store i32 %170, i32* %121
br label %171
171: ; preds = %169, %164
%172 = load i32, i32* @RLIMIT_AS
%173 = call i32 @setrlimit(i32 %172, %struct.rlimit* %12)
%174 = load i32, i32* @RLIMIT_AS
%175 = call i32 @getrlimit(i32 %174, %struct.rlimit* %12)
%176 = load i32, i32* @stdout
%177 = load i32, i32* %119
%178 = load i32, i32* %121
%179 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %176, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0), i32 27, i32 1, i32 33, i32 40, i32 %177, i32 %178, i32 27, i32 0)
%180 = load i32, i32* @stdout
%181 = call i32 @fflush(i32 %180)
br label %182
182: ; preds = %135, %171
%183 = load i32, i32* @stdout
%184 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %183, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.20, i64 0, i64 0), i32 27, i32 1, i32 37, i32 40, i64 %112, i32 27, i32 0)
%185 = load i32, i32* @stdout
%186 = call i32 @fflush(i32 %185)
%187 = load i32, i32* @EXIT_SUCCESS
br label %201
188: ; preds = %0
%189 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.21, i64 0, i64 0), i32 27, i32 1, i32 31, i32 40, i32 27, i32 0)
%190 = load i32, i32* @stdout
%191 = call i32 @fflush(i32 %190)
%192 = load i32, i32* @stdout
%193 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %192, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.22, i64 0, i64 0), i32 27, i32 1, i32 31, i32 40, i32 27, i32 0)
%194 = load i32, i32* @stdout
%195 = call i32 @fflush(i32 %194)
%196 = load i32, i32* @stdout
%197 = call i32 (i32, i8*, i32, i32, i32, i32, ...) @fprintf(i32 %196, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.23, i64 0, i64 0), i32 27, i32 1, i32 37, i32 40, i32 27, i32 0)
%198 = load i32, i32* @stdout
%199 = call i32 @fflush(i32 %198)
%200 = load i32, i32* @EXIT_FAILURE
br label %201
201: ; preds = %188, %182
%202 = phi i32 [ %187, %182 ], [ %200, %188 ]
ret i32 %202
}