#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 */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
  int tm_mon;
  int tm_mday;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *,
                           char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, char *, char *, char *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strrchr(char *, char);
int /*<<< orphan*/ *strstr(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  FILE *stockListFile;
  FILE *htmlFile;
  FILE *dataFile;
  char company[1000];
  char url[1000];
  char symbol[100];
  char scriptBlock[1000];
  char year[5];
  char month[3];
  char day[3];
  char currentTime[11];
  char commandMakeRootDirectory[1000];
  char commandMakeDirectory[1000];
  char commandGetHtml[1000];
  char pathHtml[1000];
  char pathHtmlFile[1000];
  char pathDataFile[1000];
  char closedPrice[100];
  char vol[100];
  char marketCap[100];
  char *pch1;
  char *pch2;
  time_t t = time(NULL);
  struct tm tm = *localtime(&t);
  sprintf(year, "%d", tm.tm_year + 1900);
  sprintf(month, "%02d", tm.tm_mon + 1);
  sprintf(day, "%02d", tm.tm_mday);
  strcpy(currentTime, year);
  strcat(currentTime, "-");
  strcat(currentTime, month);
  strcat(currentTime, "-");
  strcat(currentTime, day);
  stockListFile = fopen("../stock.list", "r");
  while (fscanf(stockListFile, "%s %s %s", company, symbol, url) != EOF) {
    memset(closedPrice, '\0', 100);
    memset(vol, '\0', 100);
    memset(marketCap, '\0', 100);
    strcpy(pathHtml, "../data_html/");
    strcat(pathHtml, currentTime);
    strcat(pathHtml, "/");
    strcat(pathHtml, company);
    strcat(pathHtml, "/");
    strcpy(pathHtmlFile, pathHtml);
    strcat(pathHtmlFile, "finance?q=");
    strcat(pathHtmlFile, symbol);
    strcat(pathHtmlFile, ".html");
    htmlFile = fopen(pathHtmlFile, "r");
    printf("DEBUG: %s\n", pathHtmlFile);
    memset(scriptBlock, '\0', 1000);
    while (fgets(scriptBlock, 1000, htmlFile) != NULL) {
      if (strstr(scriptBlock, "<span class=\"pr\">") != NULL) {
        printf("DEBUG: %s\n", scriptBlock);
        memset(scriptBlock, '\0', 1000);
        fgets(scriptBlock, 1000, htmlFile);
        printf("DEBUG: %s\n", scriptBlock);
        pch1 = strchr(scriptBlock, '>');
        pch2 = strrchr(scriptBlock, '<');
        strncpy(closedPrice, pch1 + 1, pch2 - pch1 - 1);
        printf("DEBUG: closedPrice %s\n", closedPrice);
      }
      if (strstr(scriptBlock, "data-snapfield=\"vol_and_avg\">Vol") != NULL) {
        printf("DEBUG: %s\n", scriptBlock);
        memset(scriptBlock, '\0', 1000);
        fgets(scriptBlock, 1000, htmlFile);
        memset(scriptBlock, '\0', 1000);
        fgets(scriptBlock, 1000, htmlFile);
        printf("DEBUG: %s\n", scriptBlock);
        pch1 = strchr(scriptBlock, '>');
        pch2 = strrchr(scriptBlock, '/');
        if (pch2 == NULL) {
          for (int i = 0; i < 100; i++) {
            if (scriptBlock[i] == '\0')
              pch2 = &scriptBlock[i];
          }
        }
        printf("DEBUG: pch2 %s\n", pch2);
        strncpy(vol, pch1 + 1, pch2 - pch1 - 1);
        printf("DEBUG: vol %s\n", vol);
      }
      if (strstr(scriptBlock, "data-snapfield=\"market_cap\">Mkt cap") !=
          NULL) {
        printf("DEBUG: %s\n", scriptBlock);
        memset(scriptBlock, '\0', 1000);
        fgets(scriptBlock, 1000, htmlFile);
        memset(scriptBlock, '\0', 1000);
        fgets(scriptBlock, 1000, htmlFile);
        printf("DEBUG: %s\n", scriptBlock);
        pch1 = strchr(scriptBlock, '>');
        for (int i = 0; i < 100; i++) {
          if (scriptBlock[i] == '\0')
            pch2 = &scriptBlock[i];
        }
        strncpy(marketCap, pch1 + 1, pch2 - pch1 - 1);
        printf("DEBUG: marketCap %s\n", marketCap);
      }
    }
    fclose(htmlFile);
    strcpy(pathDataFile, pathHtml);
    strcat(pathDataFile, company);
    strcat(pathDataFile, ".data");
    dataFile = fopen(pathDataFile, "w");
    printf("DEBUG: %s %s %s\n", closedPrice, vol, marketCap);
    fprintf(dataFile, "%s\n%s\n%s", closedPrice, vol, marketCap);
    fclose(dataFile);
  }
  fclose(stockListFile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2590,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10e0 <time@plt>
mov    %eax,-0x2574(%rbp)
lea    -0x2574(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%rcx
mov    %rcx,-0x2580(%rbp)
mov    0x8(%rax),%eax
mov    %eax,-0x2578(%rbp)
lea    -0xc65(%rbp),%rdi
mov    -0x2580(%rbp),%edx
add    $0x76c,%edx
lea    0xda6(%rip),%rsi
call   1110 <sprintf@plt>
lea    -0xc68(%rbp),%rdi
mov    -0x257c(%rbp),%edx
add    $0x1,%edx
lea    0xd8d(%rip),%rsi
call   1110 <sprintf@plt>
lea    -0xc6b(%rbp),%rdi
mov    -0x2578(%rbp),%edx
lea    0xd74(%rip),%rsi
call   1110 <sprintf@plt>
lea    -0xc76(%rbp),%rdi
lea    -0xc65(%rbp),%rsi
call   1050 <strcpy@plt>
lea    -0xc76(%rbp),%rdi
lea    0xd53(%rip),%rsi
call   1100 <strcat@plt>
lea    -0xc76(%rbp),%rdi
lea    -0xc68(%rbp),%rsi
call   1100 <strcat@plt>
lea    -0xc76(%rbp),%rdi
lea    0xd2d(%rip),%rsi
call   1100 <strcat@plt>
lea    -0xc76(%rbp),%rdi
lea    -0xc6b(%rbp),%rsi
call   1100 <strcat@plt>
lea    0xd10(%rip),%rdi
lea    0xd17(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x410(%rbp),%rdx
lea    -0x870(%rbp),%rcx
lea    -0x800(%rbp),%r8
lea    0xcf0(%rip),%rsi
call   10b0 <fscanf@plt>
mov    0x2cb2(%rip),%rcx
cmp    (%rcx),%rax
je     18fb <main+0x6fb>
lea    -0x2480(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10a0 <memset@plt>
lea    -0x24f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10a0 <memset@plt>
lea    -0x2560(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10a0 <memset@plt>
lea    -0x1c30(%rbp),%rdi
lea    0xc9d(%rip),%rsi
call   1050 <strcpy@plt>
lea    -0x1c30(%rbp),%rdi
lea    -0xc76(%rbp),%rsi
call   1100 <strcat@plt>
lea    -0x1c30(%rbp),%rdi
lea    0xc83(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x1c30(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1100 <strcat@plt>
lea    -0x1c30(%rbp),%rdi
lea    0xc5d(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x2020(%rbp),%rdi
lea    -0x1c30(%rbp),%rsi
call   1050 <strcpy@plt>
lea    -0x2020(%rbp),%rdi
lea    0xc39(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x2020(%rbp),%rdi
lea    -0x870(%rbp),%rsi
call   1100 <strcat@plt>
lea    -0x2020(%rbp),%rdi
lea    0xc1e(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x2020(%rbp),%rdi
lea    0xbe7(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    -0x2020(%rbp),%rsi
lea    0xbfa(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc60(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
lea    -0xc60(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x3e8,%esi
call   10c0 <fgets@plt>
cmp    $0x0,%rax
je     184c <main+0x64c>
lea    -0xc60(%rbp),%rdi
lea    0xbbe(%rip),%rsi
call   1120 <strstr@plt>
cmp    $0x0,%rax
je     1563 <main+0x363>
lea    -0xc60(%rbp),%rsi
lea    0xb96(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc60(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
lea    -0xc60(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x3e8,%esi
call   10c0 <fgets@plt>
lea    -0xc60(%rbp),%rsi
lea    0xb59(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc60(%rbp),%rdi
mov    $0x3e,%esi
call   1070 <strchr@plt>
mov    %rax,-0x2568(%rbp)
lea    -0xc60(%rbp),%rdi
mov    $0x3c,%esi
call   1090 <strrchr@plt>
mov    %rax,-0x2570(%rbp)
lea    -0x2480(%rbp),%rdi
mov    -0x2568(%rbp),%rsi
add    $0x1,%rsi
mov    -0x2570(%rbp),%rax
mov    -0x2568(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
call   1040 <strncpy@plt>
lea    -0x2480(%rbp),%rsi
lea    0xb03(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc60(%rbp),%rdi
lea    0xb05(%rip),%rsi
call   1120 <strstr@plt>
cmp    $0x0,%rax
je     16f5 <main+0x4f5>
lea    -0xc60(%rbp),%rsi
lea    0xab4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc60(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
lea    -0xc60(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x3e8,%esi
call   10c0 <fgets@plt>
lea    -0xc60(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
lea    -0xc60(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x3e8,%esi
call   10c0 <fgets@plt>
lea    -0xc60(%rbp),%rsi
lea    0xa4f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc60(%rbp),%rdi
mov    $0x3e,%esi
call   1070 <strchr@plt>
mov    %rax,-0x2568(%rbp)
lea    -0xc60(%rbp),%rdi
mov    $0x2f,%esi
call   1090 <strrchr@plt>
mov    %rax,-0x2570(%rbp)
cmpq   $0x0,-0x2570(%rbp)
jne    169d <main+0x49d>
movl   $0x0,-0x2584(%rbp)
cmpl   $0x64,-0x2584(%rbp)
jge    1698 <main+0x498>
movslq -0x2584(%rbp),%rax
movsbl -0xc60(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
jne    167f <main+0x47f>
movslq -0x2584(%rbp),%rcx
lea    -0xc60(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x2570(%rbp)
jmp    1684 <main+0x484>
mov    -0x2584(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2584(%rbp)
jmp    1642 <main+0x442>
jmp    169d <main+0x49d>
mov    -0x2570(%rbp),%rsi
lea    0x9ec(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x24f0(%rbp),%rdi
mov    -0x2568(%rbp),%rsi
add    $0x1,%rsi
mov    -0x2570(%rbp),%rax
mov    -0x2568(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
call   1040 <strncpy@plt>
lea    -0x24f0(%rbp),%rsi
lea    0x9b9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc60(%rbp),%rdi
lea    0x9b3(%rip),%rsi
call   1120 <strstr@plt>
cmp    $0x0,%rax
je     1847 <main+0x647>
lea    -0xc60(%rbp),%rsi
lea    0x922(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc60(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
lea    -0xc60(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x3e8,%esi
call   10c0 <fgets@plt>
lea    -0xc60(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
lea    -0xc60(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x3e8,%esi
call   10c0 <fgets@plt>
lea    -0xc60(%rbp),%rsi
lea    0x8bd(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0xc60(%rbp),%rdi
mov    $0x3e,%esi
call   1070 <strchr@plt>
mov    %rax,-0x2568(%rbp)
movl   $0x0,-0x2588(%rbp)
cmpl   $0x64,-0x2588(%rbp)
jge    1804 <main+0x604>
movslq -0x2588(%rbp),%rax
movsbl -0xc60(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
jne    17eb <main+0x5eb>
movslq -0x2588(%rbp),%rcx
lea    -0xc60(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x2570(%rbp)
jmp    17f0 <main+0x5f0>
mov    -0x2588(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2588(%rbp)
jmp    17ae <main+0x5ae>
lea    -0x2560(%rbp),%rdi
mov    -0x2568(%rbp),%rsi
add    $0x1,%rsi
mov    -0x2570(%rbp),%rax
mov    -0x2568(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
call   1040 <strncpy@plt>
lea    -0x2560(%rbp),%rsi
lea    0x89a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1462 <main+0x262>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
lea    -0x2410(%rbp),%rdi
lea    -0x1c30(%rbp),%rsi
call   1050 <strcpy@plt>
lea    -0x2410(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1100 <strcat@plt>
lea    -0x2410(%rbp),%rdi
lea    0x866(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x2410(%rbp),%rdi
lea    0x859(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    -0x2480(%rbp),%rsi
lea    -0x24f0(%rbp),%rdx
lea    -0x2560(%rbp),%rcx
lea    0x836(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    -0x2480(%rbp),%rdx
lea    -0x24f0(%rbp),%rcx
lea    -0x2560(%rbp),%r8
lea    0x820(%rip),%rsi
call   10d0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
jmp    130a <main+0x10a>
mov    -0x10(%rbp),%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x2590,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1988,%rsp
xor    %edi,%edi
call   10e0 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    0x4(%rax),%ebx
mov    0x8(%rax),%r15d
mov    $0x76c,%edx
add    (%rax),%edx
lea    0xdc5(%rip),%rsi
lea    0x20(%rsp),%r14
mov    %r14,%rdi
call   1110 <sprintf@plt>
add    $0x1,%ebx
lea    0xdb1(%rip),%rbp
lea    0x15(%rsp),%r12
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %ebx,%edx
call   1110 <sprintf@plt>
lea    0x12(%rsp),%r13
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
call   1110 <sprintf@plt>
lea    0x25(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
call   1050 <strcpy@plt>
lea    0xd7a(%rip),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1100 <strcat@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1100 <strcat@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1100 <strcat@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1100 <strcat@plt>
lea    0xd49(%rip),%rdi
lea    0xd50(%rip),%rsi
call   10f0 <fopen@plt>
lea    0xd46(%rip),%rsi
lea    0x5e0(%rsp),%rdx
lea    0xa0(%rsp),%rcx
lea    0xdc0(%rsp),%r8
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   10b0 <fscanf@plt>
mov    0x2ce8(%rip),%rcx
cmp    (%rcx),%rax
jne    1323 <main+0x123>
mov    0x8(%rsp),%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x1988,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x570(%rsp),%r12
lea    0x30(%rsp),%r15
lea    0x500(%rsp),%r13
lea    0x9d0(%rsp),%rbx
lea    0x110(%rsp),%r14
jmp    1420 <main+0x220>
nopl   (%rax)
mov    %r15,%rdi
call   1060 <fclose@plt>
lea    0x11b0(%rsp),%r15
mov    %r15,%rdi
lea    0x9d0(%rsp),%rsi
call   1050 <strcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1100 <strcat@plt>
mov    %r15,%rdi
lea    0xd6a(%rip),%rsi
call   1100 <strcat@plt>
mov    %r15,%rdi
lea    0xd61(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,0x18(%rsp)
lea    0xd52(%rip),%rdi
mov    %r12,%rsi
lea    0x30(%rsp),%r15
mov    %r15,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x18(%rsp),%rbx
mov    %rbx,%rdi
lea    0xd3f(%rip),%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r13,%r8
call   10d0 <fprintf@plt>
mov    %rbx,%rdi
lea    0x9d0(%rsp),%rbx
call   1060 <fclose@plt>
mov    0x8(%rsp),%rdi
lea    0xc27(%rip),%rsi
lea    0x5e0(%rsp),%rdx
lea    0xa0(%rsp),%rcx
lea    0xdc0(%rsp),%r8
call   10b0 <fscanf@plt>
mov    0x2bd1(%rip),%rcx
cmp    (%rcx),%rax
je     1305 <main+0x105>
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10a0 <memset@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10a0 <memset@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10a0 <memset@plt>
mov    %rbx,%rdi
lea    0xbcc(%rip),%rsi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
lea    0x25(%rsp),%rsi
call   1100 <strcat@plt>
mov    %rbx,%rdi
lea    0xbbc(%rip),%r15
mov    %r15,%rsi
call   1100 <strcat@plt>
mov    %rbx,%rdi
lea    0x5e0(%rsp),%rsi
call   1100 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1100 <strcat@plt>
lea    0x15a0(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strcpy@plt>
mov    %r15,%rdi
lea    0xb7e(%rip),%rsi
call   1100 <strcat@plt>
mov    %r15,%rdi
lea    0xa0(%rsp),%rsi
call   1100 <strcat@plt>
mov    %r15,%rdi
lea    0xb6a(%rip),%rsi
call   1100 <strcat@plt>
mov    %r15,%rdi
mov    %r15,%rbx
lea    0xb34(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,%r15
lea    0xb4f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
mov    %r14,%rdi
mov    $0x3e8,%esi
mov    %r15,%rdx
call   10c0 <fgets@plt>
lea    0x5e0(%rsp),%rbx
jmp    1540 <main+0x340>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x3e8,%esi
mov    %r15,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     1350 <main+0x150>
mov    %r14,%rdi
lea    0xafa(%rip),%rsi
call   1120 <strstr@plt>
test   %rax,%rax
je     15ec <main+0x3ec>
lea    0xada(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
mov    %r14,%rdi
mov    $0x3e8,%esi
mov    %r15,%rdx
call   10c0 <fgets@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
mov    $0x3e,%esi
call   1070 <strchr@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x3c,%esi
call   1090 <strrchr@plt>
mov    %rax,%rbp
lea    0x1(%rbx),%rsi
not    %ebx
add    %ebp,%ebx
mov    %r12,%rdi
mov    %ebx,%edx
lea    0x5e0(%rsp),%rbx
call   1040 <strncpy@plt>
lea    0xa7d(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
lea    0xa80(%rip),%rsi
call   1120 <strstr@plt>
test   %rax,%rax
je     176c <main+0x56c>
mov    %r12,%rbx
lea    0xa34(%rip),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
mov    %r14,%rdi
mov    $0x3e8,%esi
mov    %r15,%rdx
call   10c0 <fgets@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
mov    %r14,%rdi
mov    $0x3e8,%esi
mov    %r15,%rdx
call   10c0 <fgets@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
mov    $0x3e,%esi
call   1070 <strchr@plt>
mov    %rax,%r12
mov    %r14,%rdi
mov    $0x2f,%esi
call   1090 <strrchr@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    171a <main+0x51a>
xor    %eax,%eax
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rsp,%rax,1),%rcx
add    $0x110,%rcx
cmpb   $0x0,0x110(%rsp,%rax,1)
cmovne %rbp,%rcx
lea    (%rsp,%rax,1),%rdx
add    $0x111,%rdx
cmpb   $0x0,0x111(%rsp,%rax,1)
cmovne %rcx,%rdx
cmpb   $0x0,0x112(%rsp,%rax,1)
lea    0x112(%rsp,%rax,1),%rcx
cmovne %rdx,%rcx
lea    (%rsp,%rax,1),%rdx
add    $0x113,%rdx
cmpb   $0x0,0x113(%rsp,%rax,1)
cmovne %rcx,%rdx
lea    (%rsp,%rax,1),%rbp
add    $0x114,%rbp
cmpb   $0x0,0x114(%rsp,%rax,1)
cmovne %rdx,%rbp
add    $0x5,%rax
cmp    $0x64,%rax
jne    16a0 <main+0x4a0>
lea    0x976(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r12,%rsi
add    $0x1,%rsi
not    %r12d
add    %ebp,%r12d
lea    0x30(%rsp),%r13
mov    %r13,%rdi
mov    %r12d,%edx
call   1040 <strncpy@plt>
lea    0x958(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%r12
lea    0x500(%rsp),%r13
lea    0x5e0(%rsp),%rbx
mov    %r14,%rdi
lea    0x940(%rip),%rsi
call   1120 <strstr@plt>
test   %rax,%rax
je     1530 <main+0x330>
mov    %r12,%rbx
lea    0x8b4(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
mov    %r14,%rdi
mov    $0x3e8,%esi
mov    %r15,%rdx
call   10c0 <fgets@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   10a0 <memset@plt>
mov    %r14,%rdi
mov    $0x3e8,%esi
mov    %r15,%rdx
call   10c0 <fgets@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
mov    $0x3e,%esi
call   1070 <strchr@plt>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rsp,%rcx,1),%rdx
add    $0x110,%rdx
cmpb   $0x0,0x110(%rsp,%rcx,1)
cmovne %rbp,%rdx
lea    (%rsp,%rcx,1),%rsi
add    $0x111,%rsi
cmpb   $0x0,0x111(%rsp,%rcx,1)
cmovne %rdx,%rsi
cmpb   $0x0,0x112(%rsp,%rcx,1)
lea    0x112(%rsp,%rcx,1),%rdx
cmovne %rsi,%rdx
lea    (%rsp,%rcx,1),%rsi
add    $0x113,%rsi
cmpb   $0x0,0x113(%rsp,%rcx,1)
cmovne %rdx,%rsi
lea    (%rsp,%rcx,1),%rbp
add    $0x114,%rbp
cmpb   $0x0,0x114(%rsp,%rcx,1)
cmovne %rsi,%rbp
add    $0x5,%rcx
cmp    $0x64,%rcx
jne    1800 <main+0x600>
mov    %rax,%rsi
add    $0x1,%rsi
not    %eax
add    %ebp,%eax
mov    %r13,%rdi
mov    %eax,%edx
call   1040 <strncpy@plt>
lea    0x844(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%r12
lea    0x5e0(%rsp),%rbx
jmp    1530 <main+0x330>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%02d\00"
@.str.2 = [2 x i8] c"-\00"
@.str.3 = [14 x i8] c"../stock.list\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [9 x i8] c"%s %s %s\00"
@EOF = global i64 0
@.str.6 = [14 x i8] c"../data_html/\00"
@.str.7 = [2 x i8] c"/\00"
@.str.8 = [11 x i8] c"finance?q=\00"
@.str.9 = [6 x i8] c".html\00"
@.str.10 = [11 x i8] c"DEBUG: %s\0A\00"
@.str.11 = [18 x i8] c"<span class=\22pr\22>\00"
@.str.12 = [23 x i8] c"DEBUG: closedPrice %s\0A\00"
@.str.13 = [33 x i8] c"data-snapfield=\22vol_and_avg\22>Vol\00"
@.str.14 = [16 x i8] c"DEBUG: pch2 %s\0A\00"
@.str.15 = [15 x i8] c"DEBUG: vol %s\0A\00"
@.str.16 = [36 x i8] c"data-snapfield=\22market_cap\22>Mkt cap\00"
@.str.17 = [21 x i8] c"DEBUG: marketCap %s\0A\00"
@.str.18 = [6 x i8] c".data\00"
@.str.19 = [2 x i8] c"w\00"
@.str.20 = [17 x i8] c"DEBUG: %s %s %s\0A\00"
@.str.21 = [9 x i8] c"%s\0A%s\0A%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1000 x i8]
%6 = alloca [1000 x i8]
%7 = alloca [100 x i8]
%8 = alloca [1000 x i8]
%9 = alloca [5 x i8]
%10 = alloca [3 x i8]
%11 = alloca [3 x i8]
%12 = alloca [11 x i8]
%13 = alloca [1000 x i8]
%14 = alloca [1000 x i8]
%15 = alloca [1000 x i8]
%16 = alloca [1000 x i8]
%17 = alloca [1000 x i8]
%18 = alloca [1000 x i8]
%19 = alloca [100 x i8]
%20 = alloca [100 x i8]
%21 = alloca [100 x i8]
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i32
%25 = alloca %struct.tm
%26 = alloca i32
%27 = alloca i32
store i32 0, i32* %1
%28 = call i32 @time(i32* null)
store i32 %28, i32* %24
%29 = call %struct.tm* @localtime(i32* %24)
%30 = bitcast %struct.tm* %25 to i8*
%31 = bitcast %struct.tm* %29 to i8*
%32 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%33 = getelementptr inbounds %struct.tm, %struct.tm* %25, i32 0, i32 0
%34 = load i32, i32* %33
%35 = add nsw i32 %34, 1900
%36 = call i32 @sprintf(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%38 = getelementptr inbounds %struct.tm, %struct.tm* %25, i32 0, i32 1
%39 = load i32, i32* %38
%40 = add nsw i32 %39, 1
%41 = call i32 @sprintf(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%43 = getelementptr inbounds %struct.tm, %struct.tm* %25, i32 0, i32 2
%44 = load i32, i32* %43
%45 = call i32 @sprintf(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %44)
%46 = getelementptr inbounds [11 x i8], [11 x i8]* %12, i64 0, i64 0
%47 = getelementptr inbounds [5 x i8], [5 x i8]* %9, i64 0, i64 0
%48 = call i32 @strcpy(i8* %46, i8* %47)
%49 = getelementptr inbounds [11 x i8], [11 x i8]* %12, i64 0, i64 0
%50 = call i32 @strcat(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%51 = getelementptr inbounds [11 x i8], [11 x i8]* %12, i64 0, i64 0
%52 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%53 = call i32 @strcat(i8* %51, i8* %52)
%54 = getelementptr inbounds [11 x i8], [11 x i8]* %12, i64 0, i64 0
%55 = call i32 @strcat(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%56 = getelementptr inbounds [11 x i8], [11 x i8]* %12, i64 0, i64 0
%57 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%58 = call i32 @strcat(i8* %56, i8* %57)
%59 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %59, i32** %2
br label %60
60: ; preds = %254, %0
%61 = load i32*, i32** %2
%62 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%63 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%64 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%65 = call i64 @fscanf(i32* %61, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %62, i8* %63, i8* %64)
%66 = load i64, i64* @EOF
%67 = icmp ne i64 %65, %66
br i1 %67, label %68, label %278
68: ; preds = %60
%69 = getelementptr inbounds [100 x i8], [100 x i8]* %19, i64 0, i64 0
%70 = call i32 @memset(i8* %69, i8 signext 0, i32 100)
%71 = getelementptr inbounds [100 x i8], [100 x i8]* %20, i64 0, i64 0
%72 = call i32 @memset(i8* %71, i8 signext 0, i32 100)
%73 = getelementptr inbounds [100 x i8], [100 x i8]* %21, i64 0, i64 0
%74 = call i32 @memset(i8* %73, i8 signext 0, i32 100)
%75 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%76 = call i32 @strcpy(i8* %75, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%77 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%78 = getelementptr inbounds [11 x i8], [11 x i8]* %12, i64 0, i64 0
%79 = call i32 @strcat(i8* %77, i8* %78)
%80 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%81 = call i32 @strcat(i8* %80, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%82 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%83 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%84 = call i32 @strcat(i8* %82, i8* %83)
%85 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%86 = call i32 @strcat(i8* %85, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%87 = getelementptr inbounds [1000 x i8], [1000 x i8]* %17, i64 0, i64 0
%88 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%89 = call i32 @strcpy(i8* %87, i8* %88)
%90 = getelementptr inbounds [1000 x i8], [1000 x i8]* %17, i64 0, i64 0
%91 = call i32 @strcat(i8* %90, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%92 = getelementptr inbounds [1000 x i8], [1000 x i8]* %17, i64 0, i64 0
%93 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%94 = call i32 @strcat(i8* %92, i8* %93)
%95 = getelementptr inbounds [1000 x i8], [1000 x i8]* %17, i64 0, i64 0
%96 = call i32 @strcat(i8* %95, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%97 = getelementptr inbounds [1000 x i8], [1000 x i8]* %17, i64 0, i64 0
%98 = call i32* @fopen(i8* %97, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %98, i32** %3
%99 = getelementptr inbounds [1000 x i8], [1000 x i8]* %17, i64 0, i64 0
%100 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %99)
%101 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%102 = call i32 @memset(i8* %101, i8 signext 0, i32 1000)
br label %103
103: ; preds = %253, %68
%104 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%105 = load i32*, i32** %3
%106 = call i32* @fgets(i8* %104, i32 1000, i32* %105)
%107 = icmp ne i32* %106, null
br i1 %107, label %108, label %254
108: ; preds = %103
%109 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%110 = call i32* @strstr(i8* %109, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
%111 = icmp ne i32* %110, null
br i1 %111, label %112, label %139
112: ; preds = %108
%113 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%114 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %113)
%115 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%116 = call i32 @memset(i8* %115, i8 signext 0, i32 1000)
%117 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%118 = load i32*, i32** %3
%119 = call i32* @fgets(i8* %117, i32 1000, i32* %118)
%120 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%121 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %120)
%122 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%123 = call i8* @strchr(i8* %122, i8 signext 62)
store i8* %123, i8** %22
%124 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%125 = call i8* @strrchr(i8* %124, i8 signext 60)
store i8* %125, i8** %23
%126 = getelementptr inbounds [100 x i8], [100 x i8]* %19, i64 0, i64 0
%127 = load i8*, i8** %22
%128 = getelementptr inbounds i8, i8* %127, i64 1
%129 = load i8*, i8** %23
%130 = load i8*, i8** %22
%131 = ptrtoint i8* %129 to i64
%132 = ptrtoint i8* %130 to i64
%133 = sub i64 %131, %132
%134 = sub nsw i64 %133, 1
%135 = trunc i64 %134 to i32
%136 = call i32 @strncpy(i8* %126, i8* %128, i32 %135)
%137 = getelementptr inbounds [100 x i8], [100 x i8]* %19, i64 0, i64 0
%138 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i8* %137)
br label %139
139: ; preds = %112, %108
%140 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%141 = call i32* @strstr(i8* %140, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0))
%142 = icmp ne i32* %141, null
br i1 %142, label %143, label %200
143: ; preds = %139
%144 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%145 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %144)
%146 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%147 = call i32 @memset(i8* %146, i8 signext 0, i32 1000)
%148 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%149 = load i32*, i32** %3
%150 = call i32* @fgets(i8* %148, i32 1000, i32* %149)
%151 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%152 = call i32 @memset(i8* %151, i8 signext 0, i32 1000)
%153 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%154 = load i32*, i32** %3
%155 = call i32* @fgets(i8* %153, i32 1000, i32* %154)
%156 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%157 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %156)
%158 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%159 = call i8* @strchr(i8* %158, i8 signext 62)
store i8* %159, i8** %22
%160 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%161 = call i8* @strrchr(i8* %160, i8 signext 47)
store i8* %161, i8** %23
%162 = load i8*, i8** %23
%163 = icmp eq i8* %162, null
br i1 %163, label %164, label %184
164: ; preds = %143
store i32 0, i32* %26
br label %165
165: ; preds = %180, %164
%166 = load i32, i32* %26
%167 = icmp slt i32 %166, 100
br i1 %167, label %168, label %183
168: ; preds = %165
%169 = load i32, i32* %26
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %170
%172 = load i8, i8* %171
%173 = sext i8 %172 to i32
%174 = icmp eq i32 %173, 0
br i1 %174, label %175, label %179
175: ; preds = %168
%176 = load i32, i32* %26
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %177
store i8* %178, i8** %23
br label %179
179: ; preds = %175, %168
br label %180
180: ; preds = %179
%181 = load i32, i32* %26
%182 = add nsw i32 %181, 1
store i32 %182, i32* %26
br label %165
183: ; preds = %165
br label %184
184: ; preds = %183, %143
%185 = load i8*, i8** %23
%186 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i8* %185)
%187 = getelementptr inbounds [100 x i8], [100 x i8]* %20, i64 0, i64 0
%188 = load i8*, i8** %22
%189 = getelementptr inbounds i8, i8* %188, i64 1
%190 = load i8*, i8** %23
%191 = load i8*, i8** %22
%192 = ptrtoint i8* %190 to i64
%193 = ptrtoint i8* %191 to i64
%194 = sub i64 %192, %193
%195 = sub nsw i64 %194, 1
%196 = trunc i64 %195 to i32
%197 = call i32 @strncpy(i8* %187, i8* %189, i32 %196)
%198 = getelementptr inbounds [100 x i8], [100 x i8]* %20, i64 0, i64 0
%199 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0), i8* %198)
br label %200
200: ; preds = %184, %139
%201 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%202 = call i32* @strstr(i8* %201, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.16, i64 0, i64 0))
%203 = icmp ne i32* %202, null
br i1 %203, label %204, label %253
204: ; preds = %200
%205 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%206 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %205)
%207 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%208 = call i32 @memset(i8* %207, i8 signext 0, i32 1000)
%209 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%210 = load i32*, i32** %3
%211 = call i32* @fgets(i8* %209, i32 1000, i32* %210)
%212 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%213 = call i32 @memset(i8* %212, i8 signext 0, i32 1000)
%214 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%215 = load i32*, i32** %3
%216 = call i32* @fgets(i8* %214, i32 1000, i32* %215)
%217 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%218 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %217)
%219 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%220 = call i8* @strchr(i8* %219, i8 signext 62)
store i8* %220, i8** %22
store i32 0, i32* %27
br label %221
221: ; preds = %236, %204
%222 = load i32, i32* %27
%223 = icmp slt i32 %222, 100
br i1 %223, label %224, label %239
224: ; preds = %221
%225 = load i32, i32* %27
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %226
%228 = load i8, i8* %227
%229 = sext i8 %228 to i32
%230 = icmp eq i32 %229, 0
br i1 %230, label %231, label %235
231: ; preds = %224
%232 = load i32, i32* %27
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %233
store i8* %234, i8** %23
br label %235
235: ; preds = %231, %224
br label %236
236: ; preds = %235
%237 = load i32, i32* %27
%238 = add nsw i32 %237, 1
store i32 %238, i32* %27
br label %221
239: ; preds = %221
%240 = getelementptr inbounds [100 x i8], [100 x i8]* %21, i64 0, i64 0
%241 = load i8*, i8** %22
%242 = getelementptr inbounds i8, i8* %241, i64 1
%243 = load i8*, i8** %23
%244 = load i8*, i8** %22
%245 = ptrtoint i8* %243 to i64
%246 = ptrtoint i8* %244 to i64
%247 = sub i64 %245, %246
%248 = sub nsw i64 %247, 1
%249 = trunc i64 %248 to i32
%250 = call i32 @strncpy(i8* %240, i8* %242, i32 %249)
%251 = getelementptr inbounds [100 x i8], [100 x i8]* %21, i64 0, i64 0
%252 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i8* %251)
br label %253
253: ; preds = %239, %200
br label %103
254: ; preds = %103
%255 = load i32*, i32** %3
%256 = call i32 @fclose(i32* %255)
%257 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%258 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%259 = call i32 @strcpy(i8* %257, i8* %258)
%260 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%261 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%262 = call i32 @strcat(i8* %260, i8* %261)
%263 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%264 = call i32 @strcat(i8* %263, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%265 = getelementptr inbounds [1000 x i8], [1000 x i8]* %18, i64 0, i64 0
%266 = call i32* @fopen(i8* %265, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
store i32* %266, i32** %4
%267 = getelementptr inbounds [100 x i8], [100 x i8]* %19, i64 0, i64 0
%268 = getelementptr inbounds [100 x i8], [100 x i8]* %20, i64 0, i64 0
%269 = getelementptr inbounds [100 x i8], [100 x i8]* %21, i64 0, i64 0
%270 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.20, i64 0, i64 0), i8* %267, i8* %268, i8* %269)
%271 = load i32*, i32** %4
%272 = getelementptr inbounds [100 x i8], [100 x i8]* %19, i64 0, i64 0
%273 = getelementptr inbounds [100 x i8], [100 x i8]* %20, i64 0, i64 0
%274 = getelementptr inbounds [100 x i8], [100 x i8]* %21, i64 0, i64 0
%275 = call i32 @fprintf(i32* %271, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i8* %272, i8* %273, i8* %274)
%276 = load i32*, i32** %4
%277 = call i32 @fclose(i32* %276)
br label %60
278: ; preds = %60
%279 = load i32*, i32** %2
%280 = call i32 @fclose(i32* %279)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%02d\00"
@.str.2 = [2 x i8] c"-\00"
@.str.3 = [14 x i8] c"../stock.list\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [9 x i8] c"%s %s %s\00"
@EOF = global i64 0
@.str.6 = [14 x i8] c"../data_html/\00"
@.str.7 = [2 x i8] c"/\00"
@.str.8 = [11 x i8] c"finance?q=\00"
@.str.9 = [6 x i8] c".html\00"
@.str.10 = [11 x i8] c"DEBUG: %s\0A\00"
@.str.11 = [18 x i8] c"<span class=\22pr\22>\00"
@.str.12 = [23 x i8] c"DEBUG: closedPrice %s\0A\00"
@.str.13 = [33 x i8] c"data-snapfield=\22vol_and_avg\22>Vol\00"
@.str.14 = [16 x i8] c"DEBUG: pch2 %s\0A\00"
@.str.15 = [15 x i8] c"DEBUG: vol %s\0A\00"
@.str.16 = [36 x i8] c"data-snapfield=\22market_cap\22>Mkt cap\00"
@.str.17 = [21 x i8] c"DEBUG: marketCap %s\0A\00"
@.str.18 = [6 x i8] c".data\00"
@.str.19 = [2 x i8] c"w\00"
@.str.20 = [17 x i8] c"DEBUG: %s %s %s\0A\00"
@.str.21 = [9 x i8] c"%s\0A%s\0A%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = alloca [100 x i8]
%4 = alloca [1000 x i8]
%5 = alloca [5 x i8]
%6 = alloca [3 x i8]
%7 = alloca [3 x i8]
%8 = alloca [11 x i8]
%9 = alloca [1000 x i8]
%10 = alloca [1000 x i8]
%11 = alloca [1000 x i8]
%12 = alloca [100 x i8]
%13 = alloca [100 x i8]
%14 = alloca [100 x i8]
%15 = alloca i32
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%23 = getelementptr inbounds [11 x i8], [11 x i8]* %8, i64 0, i64 0
%24 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%25 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%26 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%30 = bitcast i32* %15 to i8*
%31 = tail call i32 @time(i32* null)
store i32 %31, i32* %15
%32 = call %struct.tm* @localtime(i32* %15)
%33 = getelementptr inbounds %struct.tm, %struct.tm* %32, i64 0, i32 0
%34 = load i32, i32* %33
%35 = getelementptr inbounds %struct.tm, %struct.tm* %32, i64 0, i32 1
%36 = load i32, i32* %35
%37 = getelementptr inbounds %struct.tm, %struct.tm* %32, i64 0, i32 2
%38 = load i32, i32* %37
%39 = add nsw i32 %34, 1900
%40 = call i32 @sprintf(i8* %20, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = add nsw i32 %36, 1
%42 = call i32 @sprintf(i8* %21, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = call i32 @sprintf(i8* %22, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %38)
%44 = call i32 @strcpy(i8* %23, i8* %20)
%45 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%46 = call i32 @strcat(i8* %23, i8* %21)
%47 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%48 = call i32 @strcat(i8* %23, i8* %22)
%49 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%50 = call i64 @fscanf(i32* %49, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %16, i8* %18, i8* %17)
%51 = load i64, i64* @EOF
%52 = icmp eq i64 %50, %51
br i1 %52, label %212, label %53
53: ; preds = %0, %199
%54 = phi i8* [ %200, %199 ], [ undef, %0 ]
%55 = call i32 @memset(i8* %27, i8 signext 0, i32 100)
%56 = call i32 @memset(i8* %28, i8 signext 0, i32 100)
%57 = call i32 @memset(i8* %29, i8 signext 0, i32 100)
%58 = call i32 @strcpy(i8* %24, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%59 = call i32 @strcat(i8* %24, i8* %23)
%60 = call i32 @strcat(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%61 = call i32 @strcat(i8* %24, i8* %16)
%62 = call i32 @strcat(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%63 = call i32 @strcpy(i8* %25, i8* %24)
%64 = call i32 @strcat(i8* %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%65 = call i32 @strcat(i8* %25, i8* %18)
%66 = call i32 @strcat(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%67 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%68 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %25)
%69 = call i32 @memset(i8* %19, i8 signext 0, i32 1000)
%70 = call i32* @fgets(i8* %19, i32 1000, i32* %67)
%71 = icmp eq i32* %70, null
br i1 %71, label %199, label %72
72: ; preds = %53, %195
%73 = phi i8* [ %196, %195 ], [ %54, %53 ]
%74 = call i32* @strstr(i8* %19, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
%75 = icmp eq i32* %74, null
br i1 %75, label %91, label %76
76: ; preds = %72
%77 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %19)
%78 = call i32 @memset(i8* %19, i8 signext 0, i32 1000)
%79 = call i32* @fgets(i8* %19, i32 1000, i32* %67)
%80 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %19)
%81 = call i8* @strchr(i8* %19, i8 signext 62)
%82 = call i8* @strrchr(i8* %19, i8 signext 60)
%83 = getelementptr inbounds i8, i8* %81, i64 1
%84 = ptrtoint i8* %82 to i64
%85 = ptrtoint i8* %81 to i64
%86 = xor i64 %85, -1
%87 = add i64 %84, %86
%88 = trunc i64 %87 to i32
%89 = call i32 @strncpy(i8* %27, i8* %83, i32 %88)
%90 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i8* %27)
br label %91
91: ; preds = %76, %72
%92 = phi i8* [ %82, %76 ], [ %73, %72 ]
%93 = call i32* @strstr(i8* %19, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0))
%94 = icmp eq i32* %93, null
br i1 %94, label %145, label %95
95: ; preds = %91
%96 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %19)
%97 = call i32 @memset(i8* %19, i8 signext 0, i32 1000)
%98 = call i32* @fgets(i8* %19, i32 1000, i32* %67)
%99 = call i32 @memset(i8* %19, i8 signext 0, i32 1000)
%100 = call i32* @fgets(i8* %19, i32 1000, i32* %67)
%101 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %19)
%102 = call i8* @strchr(i8* %19, i8 signext 62)
%103 = call i8* @strrchr(i8* %19, i8 signext 47)
%104 = icmp eq i8* %103, null
br i1 %104, label %105, label %134
105: ; preds = %95, %105
%106 = phi i64 [ %132, %105 ], [ 0, %95 ]
%107 = phi i8* [ %131, %105 ], [ null, %95 ]
%108 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %106
%109 = load i8, i8* %108
%110 = icmp eq i8 %109, 0
%111 = select i1 %110, i8* %108, i8* %107
%112 = add nuw nsw i64 %106, 1
%113 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %112
%114 = load i8, i8* %113
%115 = icmp eq i8 %114, 0
%116 = select i1 %115, i8* %113, i8* %111
%117 = add nuw nsw i64 %106, 2
%118 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %117
%119 = load i8, i8* %118
%120 = icmp eq i8 %119, 0
%121 = select i1 %120, i8* %118, i8* %116
%122 = add nuw nsw i64 %106, 3
%123 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %122
%124 = load i8, i8* %123
%125 = icmp eq i8 %124, 0
%126 = select i1 %125, i8* %123, i8* %121
%127 = add nuw nsw i64 %106, 4
%128 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %127
%129 = load i8, i8* %128
%130 = icmp eq i8 %129, 0
%131 = select i1 %130, i8* %128, i8* %126
%132 = add nuw nsw i64 %106, 5
%133 = icmp eq i64 %132, 100
br i1 %133, label %134, label %105
134: ; preds = %105, %95
%135 = phi i8* [ %103, %95 ], [ %131, %105 ]
%136 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i8* %135)
%137 = getelementptr inbounds i8, i8* %102, i64 1
%138 = ptrtoint i8* %135 to i64
%139 = ptrtoint i8* %102 to i64
%140 = xor i64 %139, -1
%141 = add i64 %138, %140
%142 = trunc i64 %141 to i32
%143 = call i32 @strncpy(i8* %28, i8* %137, i32 %142)
%144 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0), i8* %28)
br label %145
145: ; preds = %134, %91
%146 = phi i8* [ %135, %134 ], [ %92, %91 ]
%147 = call i32* @strstr(i8* %19, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.16, i64 0, i64 0))
%148 = icmp eq i32* %147, null
br i1 %148, label %195, label %149
149: ; preds = %145
%150 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %19)
%151 = call i32 @memset(i8* %19, i8 signext 0, i32 1000)
%152 = call i32* @fgets(i8* %19, i32 1000, i32* %67)
%153 = call i32 @memset(i8* %19, i8 signext 0, i32 1000)
%154 = call i32* @fgets(i8* %19, i32 1000, i32* %67)
%155 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %19)
%156 = call i8* @strchr(i8* %19, i8 signext 62)
br label %166
157: ; preds = %166
%158 = getelementptr inbounds i8, i8* %156, i64 1
%159 = ptrtoint i8* %192 to i64
%160 = ptrtoint i8* %156 to i64
%161 = xor i64 %160, -1
%162 = add i64 %159, %161
%163 = trunc i64 %162 to i32
%164 = call i32 @strncpy(i8* %29, i8* %158, i32 %163)
%165 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i8* %29)
br label %195
166: ; preds = %166, %149
%167 = phi i64 [ 0, %149 ], [ %193, %166 ]
%168 = phi i8* [ %146, %149 ], [ %192, %166 ]
%169 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %167
%170 = load i8, i8* %169
%171 = icmp eq i8 %170, 0
%172 = select i1 %171, i8* %169, i8* %168
%173 = add nuw nsw i64 %167, 1
%174 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %173
%175 = load i8, i8* %174
%176 = icmp eq i8 %175, 0
%177 = select i1 %176, i8* %174, i8* %172
%178 = add nuw nsw i64 %167, 2
%179 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %178
%180 = load i8, i8* %179
%181 = icmp eq i8 %180, 0
%182 = select i1 %181, i8* %179, i8* %177
%183 = add nuw nsw i64 %167, 3
%184 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %183
%185 = load i8, i8* %184
%186 = icmp eq i8 %185, 0
%187 = select i1 %186, i8* %184, i8* %182
%188 = add nuw nsw i64 %167, 4
%189 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %188
%190 = load i8, i8* %189
%191 = icmp eq i8 %190, 0
%192 = select i1 %191, i8* %189, i8* %187
%193 = add nuw nsw i64 %167, 5
%194 = icmp eq i64 %193, 100
br i1 %194, label %157, label %166
195: ; preds = %157, %145
%196 = phi i8* [ %192, %157 ], [ %146, %145 ]
%197 = call i32* @fgets(i8* %19, i32 1000, i32* %67)
%198 = icmp eq i32* %197, null
br i1 %198, label %199, label %72
199: ; preds = %195, %53
%200 = phi i8* [ %54, %53 ], [ %196, %195 ]
%201 = call i32 @fclose(i32* %67)
%202 = call i32 @strcpy(i8* %26, i8* %24)
%203 = call i32 @strcat(i8* %26, i8* %16)
%204 = call i32 @strcat(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%205 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%206 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.20, i64 0, i64 0), i8* %27, i8* %28, i8* %29)
%207 = call i32 @fprintf(i32* %205, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0), i8* %27, i8* %28, i8* %29)
%208 = call i32 @fclose(i32* %205)
%209 = call i64 @fscanf(i32* %49, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %16, i8* %18, i8* %17)
%210 = load i64, i64* @EOF
%211 = icmp eq i64 %209, %210
br i1 %211, label %212, label %53
212: ; preds = %199, %0
%213 = call i32 @fclose(i32* %49)
ret i32 0
}