#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*/ FILE;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
char tolower(char);
int main(int argc, char **argv) {
  char name[BUFSIZ], lowername[BUFSIZ];
  char description[BUFSIZ];
  char filename[BUFSIZ];
  int length, i;
  FILE *code, *makefile, *makefile2, *test;
  makefile = fopen("Makefile.inc", "w");
  if (makefile == NULL) {
    printf("Error opening Makefile.inc!\n");
    exit(1);
  }
  makefile2 = fopen("Makefile2.inc", "w");
  if (makefile2 == NULL) {
    printf("Error opening Makefile2.inc!\n");
    exit(1);
  }
  test = fopen("test.sh", "w");
  if (test == NULL) {
    printf("Error opening test.sh\n");
    exit(1);
  }
  while (1) {
    if (fgets(name, BUFSIZ, stdin) == NULL)
      break;
    length = strlen(name);
    name[length - 1] = '\0';
    for (i = 0; i < length; i++) {
      lowername[i] = tolower(name[i]);
    }
    fprintf(makefile, "\t%s \\\n", lowername);
    fprintf(test, "./papi/%s\n", lowername);
    fprintf(makefile2, "###\n\n");
    fprintf(makefile2, "%s:\t%s.o ../lib/test_utils.o\n", lowername, lowername);
    fprintf(makefile2, "\t$(CC) $(LFLAGS) -o %s %s.o \\\n", lowername,
            lowername);
    fprintf(makefile2, "\t\t../lib/test_utils.o $(PAPI_LIB)\n\n");
    fprintf(makefile2, "%s.o:  %s.c\n", lowername, lowername);
    fprintf(makefile2, "\t$(CC) $(CFLAGS) $(PAPI_INCLUDE) -c %s.c\n\n",
            lowername);
    if (fgets(description, BUFSIZ, stdin) == NULL)
      break;
    length = strlen(description);
    description[length - 1] = '\0';
    sprintf(filename, "%s.c", lowername);
    code = fopen(filename, "w");
    if (code == NULL) {
      printf("Error!  Coult not open %s\n", filename);
      exit(1);
    }
    fprintf(code, "/* This code runs some sanity checks on the %s */\n", name);
    fprintf(code, "/*   (%s) events.                   */\n", description);
    fprintf(code, "\n");
    fprintf(code,
            "/* by Vince Weaver, vweaver1 _at_ eecs.utk.edu           */\n");
    fprintf(code, "\n");
    fprintf(code, "#include <stdio.h>\n");
    fprintf(code, "#include <stdlib.h>\n");
    fprintf(code, "#include <unistd.h>\n");
    fprintf(code, "\n");
    fprintf(code, "#include \"papi.h\"\n");
    fprintf(code, "\n");
    fprintf(code, "#include \"test_utils.h\"\n");
    fprintf(code, "\n");
    fprintf(code, "int main(int argc, char **argv) {\n");
    fprintf(code, "\n");
    fprintf(code, "\tint events[1];\n");
    fprintf(code, "\tlong long counts[1];\n");
    fprintf(code, "\n");
    fprintf(code, "\tint retval,quiet;\n");
    fprintf(code, "\n");
    fprintf(code, "\tchar test_string[]=\"Testing %s predefined event...\";\n",
            name);
    fprintf(code, "\n");
    fprintf(code, "\tquiet=test_quiet();\n");
    fprintf(code, "\n");
    fprintf(code, "\tretval = PAPI_library_init(PAPI_VER_CURRENT);\n");
    fprintf(code, "\tif (retval != PAPI_VER_CURRENT) {\n");
    fprintf(code, "\t\tif (!quiet) printf(\"Error! PAPI_library_init "
                  "%%d\\n\",retval);\n");
    fprintf(code, "\t\ttest_fail(test_string);\n");
    fprintf(code, "\t}\n");
    fprintf(code, "\n");
    fprintf(code, "\tretval = PAPI_query_event(%s);\n", name);
    fprintf(code, "\tif (retval != PAPI_OK) {\n");
    fprintf(code, "\t\tif (!quiet) printf(\"%s not available\\n\");\n", name);
    fprintf(code, "\t\ttest_skip(test_string);\n");
    fprintf(code, "\t}\n");
    fprintf(code, "\n");
    fprintf(code, "\tevents[0]=%s;\n", name);
    fprintf(code, "\n");
    fprintf(code, "\tPAPI_start_counters(events,1);\n");
    fprintf(code, "\n");
    fprintf(code, "\tPAPI_stop_counters(counts,1);\n");
    fprintf(code, "\n");
    fprintf(code, "\tif (counts[0]<1) {\n");
    fprintf(code, "\t\tif (!quiet) printf(\"Error! Count too low\\n\");\n");
    fprintf(code, "\t\ttest_fail(test_string);\n");
    fprintf(code, "\t}\n");
    fprintf(code, "\n");
    fprintf(code, "\tPAPI_shutdown();\n");
    fprintf(code, "\n");
    fprintf(code, "\ttest_unimplemented(test_string);\n");
    fprintf(code, "\n");
    fprintf(code, "\treturn 0;\n");
    fprintf(code, "}\n");
    fclose(code);
  }
  fclose(makefile);
  fclose(makefile2);
  fclose(test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e28(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x80(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x20(%rbp)
mov    (%rax),%ecx
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x78(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x28(%rbp)
mov    (%rax),%ecx
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x70(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x30(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
lea    0xdca(%rip),%rdi
lea    0xdd0(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1269 <main+0xd9>
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    0xdbc(%rip),%rdi
lea    0xd96(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    12a3 <main+0x113>
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
lea    0xdae(%rip),%rdi
lea    0xd5c(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    12dd <main+0x14d>
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
jmp    12e2 <main+0x152>
jmp    12e7 <main+0x157>
mov    -0x80(%rbp),%rdi
mov    0x2ce6(%rip),%rax
mov    (%rax),%esi
mov    0x2ced(%rip),%rax
mov    (%rax),%edx
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    1311 <main+0x181>
jmp    1898 <main+0x708>
mov    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x80(%rbp),%rax
mov    %ecx,-0x3c(%rbp)
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    136f <main+0x1df>
mov    -0x80(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1080 <tolower@plt>
mov    %al,%dl
mov    -0x78(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1337 <main+0x1a7>
mov    -0x78(%rbp),%rdx
mov    -0x50(%rbp),%rdi
lea    0xcf9(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x78(%rbp),%rdx
mov    -0x60(%rbp),%rdi
lea    0xcea(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x58(%rbp),%rdi
lea    0xce3(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x78(%rbp),%rcx
mov    -0x58(%rbp),%rdi
lea    0xcd3(%rip),%rsi
mov    %rcx,%rdx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x78(%rbp),%rcx
mov    -0x58(%rbp),%rdi
lea    0xcd8(%rip),%rsi
mov    %rcx,%rdx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x58(%rbp),%rdi
lea    0xce2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x78(%rbp),%rcx
mov    -0x58(%rbp),%rdi
lea    0xcf0(%rip),%rsi
mov    %rcx,%rdx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x78(%rbp),%rdx
mov    -0x58(%rbp),%rdi
lea    0xce4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x70(%rbp),%rdi
mov    0x2bad(%rip),%rax
mov    (%rax),%esi
mov    0x2bb4(%rip),%rax
mov    (%rax),%edx
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    144a <main+0x2ba>
jmp    1898 <main+0x708>
mov    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x78(%rbp),%rdx
mov    -0x68(%rbp),%rdi
mov    %eax,%ecx
mov    -0x70(%rbp),%rax
mov    %ecx,-0x3c(%rbp)
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
lea    0xcb0(%rip),%rsi
call   10a0 <sprintf@plt>
mov    -0x68(%rbp),%rdi
lea    0xb85(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    14b8 <main+0x328>
mov    -0x68(%rbp),%rsi
lea    0xc86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x80(%rbp),%rdx
mov    -0x48(%rbp),%rdi
lea    0xc81(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x70(%rbp),%rdx
mov    -0x48(%rbp),%rdi
lea    0xc9e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xb9e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xca2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xb7a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcbb(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcbd(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcc0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xb32(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcb1(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xb0e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xca0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xaea(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc95(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xac6(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc94(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc93(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xa90(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc86(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xa6c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x80(%rbp),%rdx
mov    -0x48(%rbp),%rdi
lea    0xc72(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xa44(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc85(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xa20(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc77(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc95(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xca7(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcd5(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcde(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0x9b4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x80(%rbp),%rdx
mov    -0x48(%rbp),%rdi
lea    0xcba(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcc9(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x80(%rbp),%rdx
mov    -0x48(%rbp),%rdi
lea    0xcce(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xce9(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc6a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0x940(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x80(%rbp),%rdx
mov    -0x48(%rbp),%rdi
lea    0xcca(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0x918(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcb6(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0x8f4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcb3(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0x8d0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcaf(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcb2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xb97(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xba0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0x876(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc9b(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0x852(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc8a(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0x82e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xc89(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xb23(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <fclose@plt>
jmp    12e2 <main+0x152>
mov    -0x50(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x58(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x60(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2e00(%rip),%rbx
mov    (%rbx),%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
mov    %rsp,%r13
sub    %rax,%r13
mov    %r13,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
lea    0xdef(%rip),%rdi
lea    0xdf5(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x48(%rbp)
test   %rax,%rax
je     1880 <main+0x6c0>
lea    0xdde(%rip),%rdi
lea    0xdd5(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x40(%rbp)
test   %rax,%rax
je     1889 <main+0x6c9>
lea    0x1269(%rip),%rdi
lea    0xdb5(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x38(%rbp)
test   %rax,%rax
je     1892 <main+0x6d2>
mov    (%rbx),%esi
mov    0x2d75(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
call   1080 <fgets@plt>
test   %rax,%rax
je     1838 <main+0x678>
mov    %r13,-0x50(%rbp)
nopw   0x0(%rax,%rax,1)
mov    %rbx,%r13
mov    %r14,%rdi
call   1050 <strlen@plt>
movslq %eax,%rcx
movb   $0x0,-0x1(%rcx,%r14,1)
test   %ecx,%ecx
jle    12c7 <main+0x107>
mov    %eax,%r15d
xor    %ebx,%ebx
nopl   (%rax)
movsbl (%r14,%rbx,1),%edi
call   10a0 <tolower@plt>
mov    %al,(%r12,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    12b0 <main+0xf0>
mov    -0x48(%rbp),%rdi
lea    0xd4b(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    -0x38(%rbp),%rdi
lea    0xd3d(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xd2d(%rip),%rdi
mov    -0x40(%rbp),%rbx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %rbx,%rdi
lea    0xd1d(%rip),%rsi
mov    %r12,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %rbx,%rdi
lea    0xd24(%rip),%rsi
mov    %r12,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x23,%esi
mov    $0x1,%edx
lea    0xd25(%rip),%rdi
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %rbx,%rdi
lea    0xd37(%rip),%rsi
mov    %r12,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %rbx,%rdi
lea    0xd2d(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x0(%r13),%esi
mov    0x2c5d(%rip),%rax
mov    (%rax),%edx
mov    -0x50(%rbp),%r13
mov    %r13,%rdi
call   1080 <fgets@plt>
test   %rax,%rax
je     1838 <main+0x678>
mov    %r13,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r13,1)
mov    -0x30(%rbp),%rbx
mov    %rbx,%rdi
lea    0xd0e(%rip),%rsi
mov    %r12,%rdx
call   10c0 <sprintf@plt>
mov    %rbx,%rdi
lea    0xc3b(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1864 <main+0x6a4>
mov    %rax,%r15
mov    %rax,%rdi
lea    0xd01(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r15,%rdi
lea    0xd20(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x3c,%esi
mov    $0x1,%edx
lea    0xd20(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x13,%esi
mov    $0x1,%edx
lea    0xd37(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x14,%esi
mov    $0x1,%edx
lea    0xd32(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x14,%esi
mov    $0x1,%edx
lea    0xd2e(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x12,%esi
mov    $0x1,%edx
lea    0xd1d(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x18,%esi
mov    $0x1,%edx
lea    0xd0a(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x22,%esi
mov    $0x1,%edx
lea    0xcfd(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x10,%esi
mov    $0x1,%edx
lea    0xcfa(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x16,%esi
mov    $0x1,%edx
lea    0xcf2(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x13,%esi
mov    $0x1,%edx
lea    0xce3(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    %r15,%rdi
lea    0xcd8(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x15,%esi
mov    $0x1,%edx
lea    0xce7(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x2f,%esi
mov    $0x1,%edx
lea    0xcd7(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x23,%esi
mov    $0x1,%edx
lea    0xcee(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
lea    0xd00(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1a,%esi
mov    $0x1,%edx
lea    0xd28(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xd2a(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    %r15,%rdi
lea    0xd0c(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1a,%esi
mov    $0x1,%edx
lea    0xd12(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
lea    0xd1b(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1a,%esi
mov    $0x1,%edx
lea    0xd2d(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    %r15,%rdi
lea    0xd14(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x20,%esi
mov    $0x1,%edx
lea    0xcfc(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x1f,%esi
mov    $0x1,%edx
lea    0xcf7(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x14,%esi
mov    $0x1,%edx
lea    0xcf1(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x30,%esi
mov    $0x1,%edx
lea    0xced(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x1a,%esi
mov    $0x1,%edx
lea    0xbcb(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x12,%esi
mov    $0x1,%edx
lea    0xcca(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0x22,%esi
mov    $0x1,%edx
lea    0xcb7(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
call   1070 <fputc@plt>
mov    $0xb,%esi
mov    $0x1,%edx
lea    0xcb4(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xb47(%rip),%rdi
mov    %r15,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    0x27bc(%rip),%rbx
mov    (%rbx),%esi
mov    0x27c3(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
call   1080 <fgets@plt>
test   %rax,%rax
jne    1290 <main+0xd0>
mov    -0x48(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x868(%rip),%rdi
mov    -0x30(%rbp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
lea    0xc58(%rip),%rdi
jmp    1899 <main+0x6d9>
lea    0xc32(%rip),%rdi
jmp    1899 <main+0x6d9>
lea    0xc13(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [13 x i8] c"Makefile.inc\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [29 x i8] c"Error opening Makefile.inc!\0A\00"
@.str.3 = [14 x i8] c"Makefile2.inc\00"
@.str.4 = [30 x i8] c"Error opening Makefile2.inc!\0A\00"
@.str.5 = [8 x i8] c"test.sh\00"
@.str.6 = [23 x i8] c"Error opening test.sh\0A\00"
@stdin = global i32 0
@.str.7 = [7 x i8] c"\09%s \\\0A\00"
@.str.8 = [11 x i8] c"./papi/%s\0A\00"
@.str.9 = [6 x i8] c"###\0A\0A\00"
@.str.10 = [30 x i8] c"%s:\09%s.o ../lib/test_utils.o\0A\00"
@.str.11 = [31 x i8] c"\09$(CC) $(LFLAGS) -o %s %s.o \\\0A\00"
@.str.12 = [36 x i8] c"\09\09../lib/test_utils.o $(PAPI_LIB)\0A\0A\00"
@.str.13 = [13 x i8] c"%s.o: %s.c\0A\00"
@.str.14 = [43 x i8] c"\09$(CC) $(CFLAGS) $(PAPI_INCLUDE) -c %s.c\0A\0A\00"
@.str.15 = [5 x i8] c"%s.c\00"
@.str.16 = [27 x i8] c"Error! Coult not open %s\0A\00"
@.str.17 = [51 x i8] c"/* This code runs some sanity checks on the %s */\0A\00"
@.str.18 = [40 x i8] c"/* (%s) events. */\0A\00"
@.str.19 = [2 x i8] c"\0A\00"
@.str.20 = [61 x i8] c"/* by Vince Weaver, vweaver1 _at_ eecs.utk.edu */\0A\00"
@.str.21 = [20 x i8] c"#include <stdio.h>\0A\00"
@.str.22 = [21 x i8] c"#include <stdlib.h>\0A\00"
@.str.23 = [21 x i8] c"#include <unistd.h>\0A\00"
@.str.24 = [19 x i8] c"#include \22papi.h\22\0A\00"
@.str.25 = [25 x i8] c"#include \22test_utils.h\22\0A\00"
@.str.26 = [35 x i8] c"int main(int argc, char **argv) {\0A\00"
@.str.27 = [17 x i8] c"\09int events[1];\0A\00"
@.str.28 = [23 x i8] c"\09long long counts[1];\0A\00"
@.str.29 = [20 x i8] c"\09int retval,quiet;\0A\00"
@.str.30 = [55 x i8] c"\09char test_string[]=\22Testing %s predefined event...\22;\0A\00"
@.str.31 = [22 x i8] c"\09quiet=test_quiet();\0A\00"
@.str.32 = [48 x i8] c"\09retval = PAPI_library_init(PAPI_VER_CURRENT);\0A\00"
@.str.33 = [36 x i8] c"\09if (retval != PAPI_VER_CURRENT) {\0A\00"
@.str.34 = [64 x i8] c"\09\09if (!quiet) printf(\22Error! PAPI_library_init %%d\\n\22,retval);\0A\00"
@.str.35 = [27 x i8] c"\09\09test_fail(test_string);\0A\00"
@.str.36 = [4 x i8] c"\09}\0A\00"
@.str.37 = [33 x i8] c"\09retval = PAPI_query_event(%s);\0A\00"
@.str.38 = [27 x i8] c"\09if (retval != PAPI_OK) {\0A\00"
@.str.39 = [45 x i8] c"\09\09if (!quiet) printf(\22%s not available\\n\22);\0A\00"
@.str.40 = [27 x i8] c"\09\09test_skip(test_string);\0A\00"
@.str.41 = [16 x i8] c"\09events[0]=%s;\0A\00"
@.str.42 = [33 x i8] c"\09PAPI_start_counters(events,1);\0A\00"
@.str.43 = [32 x i8] c"\09PAPI_stop_counters(counts,1);\0A\00"
@.str.44 = [21 x i8] c"\09if (counts[0]<1) {\0A\00"
@.str.45 = [49 x i8] c"\09\09if (!quiet) printf(\22Error! Count too low\\n\22);\0A\00"
@.str.46 = [19 x i8] c"\09PAPI_shutdown();\0A\00"
@.str.47 = [35 x i8] c"\09test_unimplemented(test_string);\0A\00"
@.str.48 = [12 x i8] c"\09return 0;\0A\00"
@.str.49 = [3 x i8] c"}\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* @BUFSIZ
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %6
%20 = alloca i8, i64 %18
store i64 %18, i64* %7
%21 = load i32, i32* @BUFSIZ
%22 = zext i32 %21 to i64
%23 = alloca i8, i64 %22
store i64 %22, i64* %8
%24 = load i32, i32* @BUFSIZ
%25 = zext i32 %24 to i64
%26 = alloca i8, i64 %25
store i64 %25, i64* %9
%27 = load i32, i32* @BUFSIZ
%28 = zext i32 %27 to i64
%29 = alloca i8, i64 %28
store i64 %28, i64* %10
%30 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %30, i32** %14
%31 = load i32*, i32** %14
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %36
33: ; preds = %2
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 @exit(i32 1)
unreachable
36: ; preds = %2
%37 = 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.1, i64 0, i64 0))
store i32* %37, i32** %15
%38 = load i32*, i32** %15
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %36
%44 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %44, i32** %16
%45 = load i32*, i32** %16
%46 = icmp eq i32* %45, null
br i1 %46, label %47, label %50
47: ; preds = %43
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %43
br label %51
51: ; preds = %115, %50
br label %52
52: ; preds = %51
%53 = load i32, i32* @BUFSIZ
%54 = load i32, i32* @stdin
%55 = call i32* @fgets(i8* %20, i32 %53, i32 %54)
%56 = icmp eq i32* %55, null
br i1 %56, label %57, label %58
57: ; preds = %52
br label %224
58: ; preds = %52
%59 = call i32 @strlen(i8* %20)
store i32 %59, i32* %11
%60 = load i32, i32* %11
%61 = sub nsw i32 %60, 1
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %20, i64 %62
store i8 0, i8* %63
store i32 0, i32* %12
br label %64
64: ; preds = %77, %58
%65 = load i32, i32* %12
%66 = load i32, i32* %11
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %80
68: ; preds = %64
%69 = load i32, i32* %12
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %20, i64 %70
%72 = load i8, i8* %71
%73 = call signext i8 @tolower(i8 signext %72)
%74 = load i32, i32* %12
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8, i8* %23, i64 %75
store i8 %73, i8* %76
br label %77
77: ; preds = %68
%78 = load i32, i32* %12
%79 = add nsw i32 %78, 1
store i32 %79, i32* %12
br label %64
80: ; preds = %64
%81 = load i32*, i32** %14
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %23)
%83 = load i32*, i32** %16
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* %23)
%85 = load i32*, i32** %15
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %85, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%87 = load i32*, i32** %15
%88 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8* %23, i8* %23)
%89 = load i32*, i32** %15
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %89, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %23, i8* %23)
%91 = load i32*, i32** %15
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0))
%93 = load i32*, i32** %15
%94 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i8* %23, i8* %23)
%95 = load i32*, i32** %15
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %95, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.14, i64 0, i64 0), i8* %23)
%97 = load i32, i32* @BUFSIZ
%98 = load i32, i32* @stdin
%99 = call i32* @fgets(i8* %26, i32 %97, i32 %98)
%100 = icmp eq i32* %99, null
br i1 %100, label %101, label %102
101: ; preds = %80
br label %224
102: ; preds = %80
%103 = call i32 @strlen(i8* %26)
store i32 %103, i32* %11
%104 = load i32, i32* %11
%105 = sub nsw i32 %104, 1
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %26, i64 %106
store i8 0, i8* %107
%108 = call i32 @sprintf(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* %23)
%109 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %109, i32** %13
%110 = load i32*, i32** %13
%111 = icmp eq i32* %110, null
br i1 %111, label %112, label %115
112: ; preds = %102
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0), i8* %29)
%114 = call i32 @exit(i32 1)
unreachable
115: ; preds = %102
%116 = load i32*, i32** %13
%117 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.17, i64 0, i64 0), i8* %20)
%118 = load i32*, i32** %13
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.18, i64 0, i64 0), i8* %26)
%120 = load i32*, i32** %13
%121 = call i32 (i32*, i8*, ...) @fprintf(i32* %120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%122 = load i32*, i32** %13
%123 = call i32 (i32*, i8*, ...) @fprintf(i32* %122, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.20, i64 0, i64 0))
%124 = load i32*, i32** %13
%125 = call i32 (i32*, i8*, ...) @fprintf(i32* %124, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%126 = load i32*, i32** %13
%127 = call i32 (i32*, i8*, ...) @fprintf(i32* %126, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0))
%128 = load i32*, i32** %13
%129 = call i32 (i32*, i8*, ...) @fprintf(i32* %128, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0))
%130 = load i32*, i32** %13
%131 = call i32 (i32*, i8*, ...) @fprintf(i32* %130, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0))
%132 = load i32*, i32** %13
%133 = call i32 (i32*, i8*, ...) @fprintf(i32* %132, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%134 = load i32*, i32** %13
%135 = call i32 (i32*, i8*, ...) @fprintf(i32* %134, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.24, i64 0, i64 0))
%136 = load i32*, i32** %13
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%138 = load i32*, i32** %13
%139 = call i32 (i32*, i8*, ...) @fprintf(i32* %138, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.25, i64 0, i64 0))
%140 = load i32*, i32** %13
%141 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%142 = load i32*, i32** %13
%143 = call i32 (i32*, i8*, ...) @fprintf(i32* %142, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.26, i64 0, i64 0))
%144 = load i32*, i32** %13
%145 = call i32 (i32*, i8*, ...) @fprintf(i32* %144, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%146 = load i32*, i32** %13
%147 = call i32 (i32*, i8*, ...) @fprintf(i32* %146, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.27, i64 0, i64 0))
%148 = load i32*, i32** %13
%149 = call i32 (i32*, i8*, ...) @fprintf(i32* %148, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.28, i64 0, i64 0))
%150 = load i32*, i32** %13
%151 = call i32 (i32*, i8*, ...) @fprintf(i32* %150, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%152 = load i32*, i32** %13
%153 = call i32 (i32*, i8*, ...) @fprintf(i32* %152, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.29, i64 0, i64 0))
%154 = load i32*, i32** %13
%155 = call i32 (i32*, i8*, ...) @fprintf(i32* %154, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%156 = load i32*, i32** %13
%157 = call i32 (i32*, i8*, ...) @fprintf(i32* %156, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.30, i64 0, i64 0), i8* %20)
%158 = load i32*, i32** %13
%159 = call i32 (i32*, i8*, ...) @fprintf(i32* %158, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%160 = load i32*, i32** %13
%161 = call i32 (i32*, i8*, ...) @fprintf(i32* %160, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.31, i64 0, i64 0))
%162 = load i32*, i32** %13
%163 = call i32 (i32*, i8*, ...) @fprintf(i32* %162, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%164 = load i32*, i32** %13
%165 = call i32 (i32*, i8*, ...) @fprintf(i32* %164, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.32, i64 0, i64 0))
%166 = load i32*, i32** %13
%167 = call i32 (i32*, i8*, ...) @fprintf(i32* %166, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.33, i64 0, i64 0))
%168 = load i32*, i32** %13
%169 = call i32 (i32*, i8*, ...) @fprintf(i32* %168, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.34, i64 0, i64 0))
%170 = load i32*, i32** %13
%171 = call i32 (i32*, i8*, ...) @fprintf(i32* %170, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.35, i64 0, i64 0))
%172 = load i32*, i32** %13
%173 = call i32 (i32*, i8*, ...) @fprintf(i32* %172, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.36, i64 0, i64 0))
%174 = load i32*, i32** %13
%175 = call i32 (i32*, i8*, ...) @fprintf(i32* %174, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%176 = load i32*, i32** %13
%177 = call i32 (i32*, i8*, ...) @fprintf(i32* %176, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.37, i64 0, i64 0), i8* %20)
%178 = load i32*, i32** %13
%179 = call i32 (i32*, i8*, ...) @fprintf(i32* %178, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.38, i64 0, i64 0))
%180 = load i32*, i32** %13
%181 = call i32 (i32*, i8*, ...) @fprintf(i32* %180, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.39, i64 0, i64 0), i8* %20)
%182 = load i32*, i32** %13
%183 = call i32 (i32*, i8*, ...) @fprintf(i32* %182, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.40, i64 0, i64 0))
%184 = load i32*, i32** %13
%185 = call i32 (i32*, i8*, ...) @fprintf(i32* %184, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.36, i64 0, i64 0))
%186 = load i32*, i32** %13
%187 = call i32 (i32*, i8*, ...) @fprintf(i32* %186, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%188 = load i32*, i32** %13
%189 = call i32 (i32*, i8*, ...) @fprintf(i32* %188, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.41, i64 0, i64 0), i8* %20)
%190 = load i32*, i32** %13
%191 = call i32 (i32*, i8*, ...) @fprintf(i32* %190, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%192 = load i32*, i32** %13
%193 = call i32 (i32*, i8*, ...) @fprintf(i32* %192, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.42, i64 0, i64 0))
%194 = load i32*, i32** %13
%195 = call i32 (i32*, i8*, ...) @fprintf(i32* %194, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%196 = load i32*, i32** %13
%197 = call i32 (i32*, i8*, ...) @fprintf(i32* %196, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.43, i64 0, i64 0))
%198 = load i32*, i32** %13
%199 = call i32 (i32*, i8*, ...) @fprintf(i32* %198, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%200 = load i32*, i32** %13
%201 = call i32 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.44, i64 0, i64 0))
%202 = load i32*, i32** %13
%203 = call i32 (i32*, i8*, ...) @fprintf(i32* %202, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.45, i64 0, i64 0))
%204 = load i32*, i32** %13
%205 = call i32 (i32*, i8*, ...) @fprintf(i32* %204, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.35, i64 0, i64 0))
%206 = load i32*, i32** %13
%207 = call i32 (i32*, i8*, ...) @fprintf(i32* %206, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.36, i64 0, i64 0))
%208 = load i32*, i32** %13
%209 = call i32 (i32*, i8*, ...) @fprintf(i32* %208, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%210 = load i32*, i32** %13
%211 = call i32 (i32*, i8*, ...) @fprintf(i32* %210, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.46, i64 0, i64 0))
%212 = load i32*, i32** %13
%213 = call i32 (i32*, i8*, ...) @fprintf(i32* %212, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%214 = load i32*, i32** %13
%215 = call i32 (i32*, i8*, ...) @fprintf(i32* %214, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.47, i64 0, i64 0))
%216 = load i32*, i32** %13
%217 = call i32 (i32*, i8*, ...) @fprintf(i32* %216, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%218 = load i32*, i32** %13
%219 = call i32 (i32*, i8*, ...) @fprintf(i32* %218, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.48, i64 0, i64 0))
%220 = load i32*, i32** %13
%221 = call i32 (i32*, i8*, ...) @fprintf(i32* %220, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.49, i64 0, i64 0))
%222 = load i32*, i32** %13
%223 = call i32 @fclose(i32* %222)
br label %51
224: ; preds = %101, %57
%225 = load i32*, i32** %14
%226 = call i32 @fclose(i32* %225)
%227 = load i32*, i32** %15
%228 = call i32 @fclose(i32* %227)
%229 = load i32*, i32** %16
%230 = call i32 @fclose(i32* %229)
store i32 0, i32* %3
%231 = load i8*, i8** %6
%232 = load i32, i32* %3
ret i32 %232
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [13 x i8] c"Makefile.inc\00"
@.str.1 = [2 x i8] c"w\00"
@.str.3 = [14 x i8] c"Makefile2.inc\00"
@.str.5 = [8 x i8] c"test.sh\00"
@stdin = global i32 0
@.str.7 = [7 x i8] c"\09%s \\\0A\00"
@.str.8 = [11 x i8] c"./papi/%s\0A\00"
@.str.9 = [6 x i8] c"###\0A\0A\00"
@.str.10 = [30 x i8] c"%s:\09%s.o ../lib/test_utils.o\0A\00"
@.str.11 = [31 x i8] c"\09$(CC) $(LFLAGS) -o %s %s.o \\\0A\00"
@.str.12 = [36 x i8] c"\09\09../lib/test_utils.o $(PAPI_LIB)\0A\0A\00"
@.str.13 = [13 x i8] c"%s.o: %s.c\0A\00"
@.str.14 = [43 x i8] c"\09$(CC) $(CFLAGS) $(PAPI_INCLUDE) -c %s.c\0A\0A\00"
@.str.15 = [5 x i8] c"%s.c\00"
@.str.16 = [27 x i8] c"Error! Coult not open %s\0A\00"
@.str.17 = [51 x i8] c"/* This code runs some sanity checks on the %s */\0A\00"
@.str.18 = [40 x i8] c"/* (%s) events. */\0A\00"
@.str.20 = [61 x i8] c"/* by Vince Weaver, vweaver1 _at_ eecs.utk.edu */\0A\00"
@.str.21 = [20 x i8] c"#include <stdio.h>\0A\00"
@.str.22 = [21 x i8] c"#include <stdlib.h>\0A\00"
@.str.23 = [21 x i8] c"#include <unistd.h>\0A\00"
@.str.24 = [19 x i8] c"#include \22papi.h\22\0A\00"
@.str.25 = [25 x i8] c"#include \22test_utils.h\22\0A\00"
@.str.26 = [35 x i8] c"int main(int argc, char **argv) {\0A\00"
@.str.27 = [17 x i8] c"\09int events[1];\0A\00"
@.str.28 = [23 x i8] c"\09long long counts[1];\0A\00"
@.str.29 = [20 x i8] c"\09int retval,quiet;\0A\00"
@.str.30 = [55 x i8] c"\09char test_string[]=\22Testing %s predefined event...\22;\0A\00"
@.str.31 = [22 x i8] c"\09quiet=test_quiet();\0A\00"
@.str.32 = [48 x i8] c"\09retval = PAPI_library_init(PAPI_VER_CURRENT);\0A\00"
@.str.33 = [36 x i8] c"\09if (retval != PAPI_VER_CURRENT) {\0A\00"
@.str.34 = [64 x i8] c"\09\09if (!quiet) printf(\22Error! PAPI_library_init %%d\\n\22,retval);\0A\00"
@.str.35 = [27 x i8] c"\09\09test_fail(test_string);\0A\00"
@.str.36 = [4 x i8] c"\09}\0A\00"
@.str.37 = [33 x i8] c"\09retval = PAPI_query_event(%s);\0A\00"
@.str.38 = [27 x i8] c"\09if (retval != PAPI_OK) {\0A\00"
@.str.39 = [45 x i8] c"\09\09if (!quiet) printf(\22%s not available\\n\22);\0A\00"
@.str.40 = [27 x i8] c"\09\09test_skip(test_string);\0A\00"
@.str.41 = [16 x i8] c"\09events[0]=%s;\0A\00"
@.str.42 = [33 x i8] c"\09PAPI_start_counters(events,1);\0A\00"
@.str.43 = [32 x i8] c"\09PAPI_stop_counters(counts,1);\0A\00"
@.str.44 = [21 x i8] c"\09if (counts[0]<1) {\0A\00"
@.str.45 = [49 x i8] c"\09\09if (!quiet) printf(\22Error! Count too low\\n\22);\0A\00"
@.str.46 = [19 x i8] c"\09PAPI_shutdown();\0A\00"
@.str.47 = [35 x i8] c"\09test_unimplemented(test_string);\0A\00"
@.str.48 = [12 x i8] c"\09return 0;\0A\00"
@.str.49 = [3 x i8] c"}\0A\00"
@str = [22 x i8] c"Error opening test.sh\00"
@str.50 = [29 x i8] c"Error opening Makefile2.inc!\00"
@str.51 = [28 x i8] c"Error opening Makefile.inc!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = alloca i8, i64 %4
%7 = alloca i8, i64 %4
%8 = alloca i8, i64 %4
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.51, i64 0, i64 0))
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = tail 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.1, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.50, i64 0, i64 0))
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %14
%21 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %28, label %23
23: ; preds = %20
%24 = load i32, i32* @BUFSIZ
%25 = load i32, i32* @stdin
%26 = call i32* @fgets(i8* %5, i32 %24, i32 %25)
%27 = icmp eq i32* %26, null
br i1 %27, label %130, label %31
28: ; preds = %20
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%30 = tail call i32 @exit(i32 1)
unreachable
31: ; preds = %23, %71
%32 = call i32 @strlen(i8* %5)
%33 = add nsw i32 %32, -1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %5, i64 %34
store i8 0, i8* %35
%36 = icmp sgt i32 %32, 0
br i1 %36, label %37, label %47
37: ; preds = %31
%38 = zext i32 %32 to i64
br label %39
39: ; preds = %37, %39
%40 = phi i64 [ 0, %37 ], [ %45, %39 ]
%41 = getelementptr inbounds i8, i8* %5, i64 %40
%42 = load i8, i8* %41
%43 = call signext i8 @tolower(i8 signext %42)
%44 = getelementptr inbounds i8, i8* %6, i64 %40
store i8 %43, i8* %44
%45 = add nuw nsw i64 %40, 1
%46 = icmp eq i64 %45, %38
br i1 %46, label %47, label %39
47: ; preds = %39, %31
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* %6)
%50 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i64 5, i64 1, i32* %15)
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8* %6, i8* %6)
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.11, i64 0, i64 0), i8* %6, i8* %6)
%53 = call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i64 35, i64 1, i32* %15)
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i8* %6, i8* %6)
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.14, i64 0, i64 0), i8* %6)
%56 = load i32, i32* @BUFSIZ
%57 = load i32, i32* @stdin
%58 = call i32* @fgets(i8* %7, i32 %56, i32 %57)
%59 = icmp eq i32* %58, null
br i1 %59, label %130, label %60
60: ; preds = %47
%61 = call i32 @strlen(i8* %7)
%62 = add nsw i32 %61, -1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %7, i64 %63
store i8 0, i8* %64
%65 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* %6)
%66 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%67 = icmp eq i32* %66, null
br i1 %67, label %68, label %71
68: ; preds = %60
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0), i8* %8)
%70 = call i32 @exit(i32 1)
unreachable
71: ; preds = %60
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.17, i64 0, i64 0), i8* %5)
%73 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.18, i64 0, i64 0), i8* %7)
%74 = call i32 @fputc(i32 10, i32* %66)
%75 = call i64 @fwrite(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.20, i64 0, i64 0), i64 60, i64 1, i32* %66)
%76 = call i32 @fputc(i32 10, i32* %66)
%77 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.21, i64 0, i64 0), i64 19, i64 1, i32* %66)
%78 = call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0), i64 20, i64 1, i32* %66)
%79 = call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), i64 20, i64 1, i32* %66)
%80 = call i32 @fputc(i32 10, i32* %66)
%81 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.24, i64 0, i64 0), i64 18, i64 1, i32* %66)
%82 = call i32 @fputc(i32 10, i32* %66)
%83 = call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.25, i64 0, i64 0), i64 24, i64 1, i32* %66)
%84 = call i32 @fputc(i32 10, i32* %66)
%85 = call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.26, i64 0, i64 0), i64 34, i64 1, i32* %66)
%86 = call i32 @fputc(i32 10, i32* %66)
%87 = call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.27, i64 0, i64 0), i64 16, i64 1, i32* %66)
%88 = call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.28, i64 0, i64 0), i64 22, i64 1, i32* %66)
%89 = call i32 @fputc(i32 10, i32* %66)
%90 = call i64 @fwrite(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.29, i64 0, i64 0), i64 19, i64 1, i32* %66)
%91 = call i32 @fputc(i32 10, i32* %66)
%92 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.30, i64 0, i64 0), i8* %5)
%93 = call i32 @fputc(i32 10, i32* %66)
%94 = call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.31, i64 0, i64 0), i64 21, i64 1, i32* %66)
%95 = call i32 @fputc(i32 10, i32* %66)
%96 = call i64 @fwrite(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.32, i64 0, i64 0), i64 47, i64 1, i32* %66)
%97 = call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.33, i64 0, i64 0), i64 35, i64 1, i32* %66)
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.34, i64 0, i64 0))
%99 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.35, i64 0, i64 0), i64 26, i64 1, i32* %66)
%100 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.36, i64 0, i64 0), i64 3, i64 1, i32* %66)
%101 = call i32 @fputc(i32 10, i32* %66)
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.37, i64 0, i64 0), i8* %5)
%103 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.38, i64 0, i64 0), i64 26, i64 1, i32* %66)
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.39, i64 0, i64 0), i8* %5)
%105 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.40, i64 0, i64 0), i64 26, i64 1, i32* %66)
%106 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.36, i64 0, i64 0), i64 3, i64 1, i32* %66)
%107 = call i32 @fputc(i32 10, i32* %66)
%108 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.41, i64 0, i64 0), i8* %5)
%109 = call i32 @fputc(i32 10, i32* %66)
%110 = call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.42, i64 0, i64 0), i64 32, i64 1, i32* %66)
%111 = call i32 @fputc(i32 10, i32* %66)
%112 = call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.43, i64 0, i64 0), i64 31, i64 1, i32* %66)
%113 = call i32 @fputc(i32 10, i32* %66)
%114 = call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.44, i64 0, i64 0), i64 20, i64 1, i32* %66)
%115 = call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.45, i64 0, i64 0), i64 48, i64 1, i32* %66)
%116 = call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.35, i64 0, i64 0), i64 26, i64 1, i32* %66)
%117 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.36, i64 0, i64 0), i64 3, i64 1, i32* %66)
%118 = call i32 @fputc(i32 10, i32* %66)
%119 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.46, i64 0, i64 0), i64 18, i64 1, i32* %66)
%120 = call i32 @fputc(i32 10, i32* %66)
%121 = call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.47, i64 0, i64 0), i64 34, i64 1, i32* %66)
%122 = call i32 @fputc(i32 10, i32* %66)
%123 = call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.48, i64 0, i64 0), i64 11, i64 1, i32* %66)
%124 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.49, i64 0, i64 0), i64 2, i64 1, i32* %66)
%125 = call i32 @fclose(i32* %66)
%126 = load i32, i32* @BUFSIZ
%127 = load i32, i32* @stdin
%128 = call i32* @fgets(i8* %5, i32 %126, i32 %127)
%129 = icmp eq i32* %128, null
br i1 %129, label %130, label %31
130: ; preds = %71, %47, %23
%131 = call i32 @fclose(i32* %9)
%132 = call i32 @fclose(i32* %15)
%133 = call i32 @fclose(i32* %21)
ret i32 0
}