#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 /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int);
int /*<<< orphan*/ fread(unsigned char **, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(unsigned char **, int, int, int /*<<< orphan*/ *);
scalar_t__ maxNo(int, int, int *);
int minNo(int, int, int *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  unsigned char image[256][256];
  unsigned char image_w[256][256];
  int histgram[256] = {0};
  int mode;
  char *fn;
  FILE *fp;
  int maxRNo[256];
  int minRNo[256];
  int subRNo[256];
  int range = 16;
  int thr = 150;
  if (argc < 2) {
    printf("don't read filename\n");
    return 0;
  } else if (argc > 2) {
    printf("many arguments\n");
    return 0;
  } else {
    fp = fopen(argv[1], "rb");
    fread(image, sizeof(unsigned char), 256 * 256, fp);
    fclose(fp);
    fn = strtok(argv[1], ".");
    for (int i = 0; i < 256; i++) {
      for (int j = 0; j < 256; j++) {
        histgram[image[i][j]]++;
      }
    }
    int cnt = 0;
    for (int i = 0; i < 256 - range; i++) {
      if (maxNo(i, range, histgram) == maxNo(i + 1, range, histgram)) {
        int check = 0;
        for (int j = 1; j < range; j++) {
          if (maxNo(i, range, histgram) == maxNo(i + j, range, histgram)) {
            check++;
          }
        }
        if (check == range - 1) {
          maxRNo[cnt] = maxNo(i, range, histgram);
          cnt++;
        }
      }
    }
    minRNo[0] = minNo(0, maxRNo[0], histgram);
    for (int i = 0; i < 256; i++) {
      if (maxRNo[i + 1] == 0) {
        break;
      }
      minRNo[i + 1] = minNo(maxRNo[i], maxRNo[i + 1], histgram);
    }
    int subCnt = 0;
    for (int i = 0; i < 256; i++) {
      if (histgram[maxRNo[i]] - histgram[minRNo[i]] >= thr) {
        subRNo[subCnt] = minRNo[i];
        subCnt++;
      }
    }
    if (subRNo[0] > 0) {
      if (subRNo[1] > 0) {
        printf("many peaks\n");
      } else {
        mode = subRNo[0];
        printf("閾値 = %d\n", mode);
      }
    } else {
      printf("don't appear peak\n");
      return 0;
    }
    int newhist[256];
    for (int i = 0; i < 256; i++) {
      if (i < mode) {
        newhist[0]++;
      } else {
        newhist[255]++;
      }
    }
    for (int i = 0; i < 256; i++) {
      for (int j = 0; j < 256; j++) {
        if (image[i][j] > mode) {
          image_w[i][j] = 255;
        } else {
          image_w[i][j] = 0;
        }
      }
    }
    if (strcmp(fn, "girl") == 0) {
      fp = fopen("plot_ex4girl.dat", "wb");
    } else {
      fp = fopen("plot_ex4ei.dat", "wb");
    }
    for (int i = 0; i < 256; i++) {
      fprintf(fp, "%3d %3d\n", i, newhist[i]);
    }
    fclose(fp);
    if (strcmp(fn, "girl") == 0) {
      fp = fopen("girlex4_binary.dat", "wb");
    } else {
      fp = fopen("eiex4_binary.dat", "wb");
    }
    fwrite(image_w, sizeof(unsigned char), 256 * 256, fp);
    fclose(fp);
    if (strcmp(fn, "girl") == 0) {
      system("zsh ex4_girl.sh");
    } else {
      system("zsh ex4_ei.sh");
    }
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x21480,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
movl   $0x10,-0x21034(%rbp)
movl   $0x96,-0x21038(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1224 <main+0x64>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1925 <main+0x765>
cmpl   $0x2,-0x8(%rbp)
jle    1248 <main+0x88>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1925 <main+0x765>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdce(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20428(%rbp)
lea    -0x10010(%rbp),%rdi
mov    -0x20428(%rbp),%rcx
mov    $0x1,%esi
mov    $0x10000,%edx
call   1030 <fread@plt>
mov    -0x20428(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd8d(%rip),%rsi
call   10d0 <strtok@plt>
mov    %rax,-0x20420(%rbp)
movl   $0x0,-0x2103c(%rbp)
cmpl   $0x100,-0x2103c(%rbp)
jge    1339 <main+0x179>
movl   $0x0,-0x21040(%rbp)
cmpl   $0x100,-0x21040(%rbp)
jge    1320 <main+0x160>
movslq -0x2103c(%rbp),%rcx
lea    -0x10010(%rbp),%rax
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x21040(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x20410(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x20410(%rbp,%rax,4)
mov    -0x21040(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21040(%rbp)
jmp    12cb <main+0x10b>
jmp    1325 <main+0x165>
mov    -0x2103c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2103c(%rbp)
jmp    12b1 <main+0xf1>
movl   $0x0,-0x21044(%rbp)
movl   $0x0,-0x21048(%rbp)
mov    -0x21048(%rbp),%eax
mov    $0x100,%ecx
sub    -0x21034(%rbp),%ecx
cmp    %ecx,%eax
jge    14bd <main+0x2fd>
mov    -0x21048(%rbp),%edi
mov    -0x21034(%rbp),%esi
lea    -0x20410(%rbp),%rdx
call   10b0 <maxNo@plt>
mov    %rax,-0x21478(%rbp)
mov    -0x21048(%rbp),%edi
add    $0x1,%edi
mov    -0x21034(%rbp),%esi
lea    -0x20410(%rbp),%rdx
call   10b0 <maxNo@plt>
mov    %rax,%rcx
mov    -0x21478(%rbp),%rax
cmp    %rcx,%rax
jne    14a4 <main+0x2e4>
movl   $0x0,-0x2104c(%rbp)
movl   $0x1,-0x21050(%rbp)
mov    -0x21050(%rbp),%eax
cmp    -0x21034(%rbp),%eax
jge    1451 <main+0x291>
mov    -0x21048(%rbp),%edi
mov    -0x21034(%rbp),%esi
lea    -0x20410(%rbp),%rdx
call   10b0 <maxNo@plt>
mov    %rax,-0x21480(%rbp)
mov    -0x21048(%rbp),%edi
add    -0x21050(%rbp),%edi
mov    -0x21034(%rbp),%esi
lea    -0x20410(%rbp),%rdx
call   10b0 <maxNo@plt>
mov    %rax,%rcx
mov    -0x21480(%rbp),%rax
cmp    %rcx,%rax
jne    1438 <main+0x278>
mov    -0x2104c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2104c(%rbp)
jmp    143d <main+0x27d>
mov    -0x21050(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21050(%rbp)
jmp    13c7 <main+0x207>
mov    -0x2104c(%rbp),%eax
mov    -0x21034(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    149f <main+0x2df>
mov    -0x21048(%rbp),%edi
mov    -0x21034(%rbp),%esi
lea    -0x20410(%rbp),%rdx
call   10b0 <maxNo@plt>
mov    %eax,%ecx
movslq -0x21044(%rbp),%rax
mov    %ecx,-0x20830(%rbp,%rax,4)
mov    -0x21044(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21044(%rbp)
jmp    14a4 <main+0x2e4>
jmp    14a9 <main+0x2e9>
mov    -0x21048(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21048(%rbp)
jmp    134d <main+0x18d>
mov    -0x20830(%rbp),%esi
lea    -0x20410(%rbp),%rdx
xor    %edi,%edi
call   10a0 <minNo@plt>
mov    %eax,-0x20c30(%rbp)
movl   $0x0,-0x21054(%rbp)
cmpl   $0x100,-0x21054(%rbp)
jge    1563 <main+0x3a3>
mov    -0x21054(%rbp),%eax
add    $0x1,%eax
cltq
cmpl   $0x0,-0x20830(%rbp,%rax,4)
jne    150f <main+0x34f>
jmp    1563 <main+0x3a3>
movslq -0x21054(%rbp),%rax
mov    -0x20830(%rbp,%rax,4),%edi
mov    -0x21054(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x20830(%rbp,%rax,4),%esi
lea    -0x20410(%rbp),%rdx
call   10a0 <minNo@plt>
mov    %eax,%ecx
mov    -0x21054(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x20c30(%rbp,%rax,4)
mov    -0x21054(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21054(%rbp)
jmp    14e1 <main+0x321>
movl   $0x0,-0x21058(%rbp)
movl   $0x0,-0x2105c(%rbp)
cmpl   $0x100,-0x2105c(%rbp)
jge    1603 <main+0x443>
movslq -0x2105c(%rbp),%rax
movslq -0x20830(%rbp,%rax,4),%rax
ff
mov    -0x20410(%rbp,%rax,4),%eax
movslq -0x2105c(%rbp),%rcx
movslq -0x20c30(%rbp,%rcx,4),%rcx
ff
sub    -0x20410(%rbp,%rcx,4),%eax
cmp    -0x21038(%rbp),%eax
jl     15ea <main+0x42a>
movslq -0x2105c(%rbp),%rax
mov    -0x20c30(%rbp,%rax,4),%ecx
movslq -0x21058(%rbp),%rax
mov    %ecx,-0x21030(%rbp,%rax,4)
mov    -0x21058(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21058(%rbp)
jmp    15ef <main+0x42f>
mov    -0x2105c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2105c(%rbp)
jmp    1577 <main+0x3b7>
cmpl   $0x0,-0x21030(%rbp)
jle    1655 <main+0x495>
cmpl   $0x0,-0x2102c(%rbp)
jle    1630 <main+0x470>
lea    0xa06(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1650 <main+0x490>
mov    -0x21030(%rbp),%eax
mov    %eax,-0x20414(%rbp)
mov    -0x20414(%rbp),%esi
lea    0x9ed(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    166f <main+0x4af>
lea    0x9e7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1925 <main+0x765>
movl   $0x0,-0x21464(%rbp)
cmpl   $0x100,-0x21464(%rbp)
jge    16d7 <main+0x517>
mov    -0x21464(%rbp),%eax
cmp    -0x20414(%rbp),%eax
jge    16af <main+0x4ef>
mov    -0x21460(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21460(%rbp)
jmp    16be <main+0x4fe>
mov    -0x21064(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21064(%rbp)
jmp    16c3 <main+0x503>
mov    -0x21464(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21464(%rbp)
jmp    1679 <main+0x4b9>
movl   $0x0,-0x21468(%rbp)
cmpl   $0x100,-0x21468(%rbp)
jge    17ae <main+0x5ee>
movl   $0x0,-0x2146c(%rbp)
cmpl   $0x100,-0x2146c(%rbp)
jge    1795 <main+0x5d5>
movslq -0x21468(%rbp),%rcx
lea    -0x10010(%rbp),%rax
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x2146c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    -0x20414(%rbp),%eax
jle    175c <main+0x59c>
movslq -0x21468(%rbp),%rcx
lea    -0x20010(%rbp),%rax
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x2146c(%rbp),%rcx
movb   $0xff,(%rax,%rcx,1)
jmp    177c <main+0x5bc>
movslq -0x21468(%rbp),%rcx
lea    -0x20010(%rbp),%rax
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x2146c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1781 <main+0x5c1>
mov    -0x2146c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2146c(%rbp)
jmp    16fb <main+0x53b>
jmp    179a <main+0x5da>
mov    -0x21468(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21468(%rbp)
jmp    16e1 <main+0x521>
mov    -0x20420(%rbp),%rdi
lea    0x89a(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    17ea <main+0x62a>
lea    0x889(%rip),%rdi
lea    0x893(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20428(%rbp)
jmp    1804 <main+0x644>
lea    0x87e(%rip),%rdi
lea    0x874(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20428(%rbp)
movl   $0x0,-0x21470(%rbp)
cmpl   $0x100,-0x21470(%rbp)
jge    1859 <main+0x699>
mov    -0x20428(%rbp),%rdi
mov    -0x21470(%rbp),%edx
movslq -0x21470(%rbp),%rax
mov    -0x21460(%rbp,%rax,4),%ecx
lea    0x83e(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x21470(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21470(%rbp)
jmp    180e <main+0x64e>
mov    -0x20428(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20420(%rbp),%rdi
lea    0x7e3(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    18a1 <main+0x6e1>
lea    0x7fe(%rip),%rdi
lea    0x7dc(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20428(%rbp)
jmp    18bb <main+0x6fb>
lea    0x7f2(%rip),%rdi
lea    0x7bd(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20428(%rbp)
lea    -0x20010(%rbp),%rdi
mov    -0x20428(%rbp),%rcx
mov    $0x1,%esi
mov    $0x10000,%edx
call   10e0 <fwrite@plt>
mov    -0x20428(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20420(%rbp),%rdi
lea    0x764(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1912 <main+0x752>
lea    0x7a3(%rip),%rdi
call   1050 <system@plt>
jmp    191e <main+0x75e>
lea    0x7a2(%rip),%rdi
call   1050 <system@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x21480,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x21418,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x10(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
cmp    $0x1,%ebp
jg     120d <main+0x3d>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
jmp    1c36 <main+0xa66>
cmp    $0x2,%ebp
jne    1389 <main+0x1b9>
mov    0x8(%rbx),%rdi
lea    0xe0f(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbp
lea    0x1410(%rsp),%rdi
mov    $0x1,%esi
mov    $0x10000,%edx
mov    %rax,%rcx
call   1040 <fread@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    0x8(%rbx),%rdi
lea    0xddd(%rip),%rsi
call   10e0 <strtok@plt>
lea    0x1411(%rsp),%rdi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl -0x1(%rdi,%rdx,1),%esi
addl   $0x1,0x10(%rsp,%rsi,4)
movzbl (%rdi,%rdx,1),%esi
addl   $0x1,0x10(%rsp,%rsi,4)
add    $0x2,%rdx
cmp    $0x100,%rdx
jne    1280 <main+0xb0>
add    $0x1,%rcx
add    $0x100,%rdi
cmp    $0x100,%rcx
jne    1270 <main+0xa0>
mov    %rax,0x8(%rsp)
xor    %r15d,%r15d
lea    0x10(%rsp),%r13
xor    %eax,%eax
mov    %rax,(%rsp)
jmp    12dd <main+0x10d>
nopl   0x0(%rax)
cmp    $0xf0,%r15d
je     139a <main+0x1ca>
mov    %r15d,%r14d
mov    %r15d,%edi
mov    $0x10,%esi
mov    %r13,%rdx
call   10c0 <maxNo@plt>
mov    %rax,%r12
lea    0x1(%r14),%r15d
mov    %r15d,%edi
mov    $0x10,%esi
mov    %r13,%rdx
call   10c0 <maxNo@plt>
cmp    %rax,%r12
jne    12d0 <main+0x100>
xor    %ebx,%ebx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14d,%edi
mov    $0x10,%esi
mov    %r13,%rdx
call   10c0 <maxNo@plt>
mov    %rax,%r12
lea    (%r14,%rbp,1),%edi
mov    $0x10,%esi
mov    %r13,%rdx
call   10c0 <maxNo@plt>
xor    %ecx,%ecx
cmp    %rax,%r12
sete   %cl
add    %ecx,%ebx
add    $0x1,%ebp
cmp    $0x10,%ebp
jne    1320 <main+0x150>
cmp    $0xf,%ebx
jne    12d0 <main+0x100>
mov    %r14d,%edi
mov    $0x10,%esi
mov    %r13,%rdx
call   10c0 <maxNo@plt>
mov    (%rsp),%rcx
movslq %ecx,%rcx
mov    %eax,0x410(%rsp,%rcx,4)
add    $0x1,%ecx
mov    %rcx,(%rsp)
jmp    12d0 <main+0x100>
lea    0xd42(%rip),%rdi
call   1030 <puts@plt>
jmp    1c36 <main+0xa66>
mov    0x410(%rsp),%r15d
xor    %ebp,%ebp
lea    0x10(%rsp),%r14
xor    %edi,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   10b0 <minNo@plt>
mov    %eax,0x1010(%rsp)
nopl   (%rax)
mov    0x414(%rsp,%rbp,4),%esi
test   %esi,%esi
je     13f1 <main+0x221>
lea    0x1(%rbp),%rbx
mov    0x410(%rsp,%rbp,4),%edi
mov    %r14,%rdx
call   10b0 <minNo@plt>
mov    %eax,0x1014(%rsp,%rbp,4)
mov    %rbx,%rbp
cmp    $0x100,%rbx
jne    13c0 <main+0x1f0>
xor    %eax,%eax
xor    %ecx,%ecx
mov    0x8(%rsp),%r14
nopw   0x0(%rax,%rax,1)
movslq %r15d,%rdx
mov    0x10(%rsp,%rdx,4),%esi
movslq 0x1010(%rsp,%rax,4),%rdx
sub    0x10(%rsp,%rdx,4),%esi
cmp    $0x96,%esi
jl     1428 <main+0x258>
movslq %ecx,%rcx
mov    %edx,0xc10(%rsp,%rcx,4)
add    $0x1,%ecx
cmp    $0xff,%rax
je     143e <main+0x26e>
mov    0x414(%rsp,%rax,4),%r15d
add    $0x1,%rax
jmp    1400 <main+0x230>
mov    0xc10(%rsp),%ebx
test   %ebx,%ebx
jle    1461 <main+0x291>
cmpl   $0x0,0xc14(%rsp)
jle    1472 <main+0x2a2>
lea    0xc6d(%rip),%rdi
call   1030 <puts@plt>
jmp    1482 <main+0x2b2>
lea    0xc4d(%rip),%rdi
call   1030 <puts@plt>
jmp    1c36 <main+0xa66>
lea    0xbbc(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
movd   %ebx,%xmm0
pshufd $0x0,%xmm0,%xmm11
movdqa 0xb6c(%rip),%xmm7
pxor   %xmm5,%xmm5
mov    $0x100,%eax
movdqa 0xb6a(%rip),%xmm8
pcmpeqd %xmm10,%xmm10
movdqa 0xb6c(%rip),%xmm9
pxor   %xmm2,%xmm2
pxor   %xmm4,%xmm4
pxor   %xmm6,%xmm6
movdqa %xmm7,%xmm3
paddd  %xmm8,%xmm3
movdqa %xmm11,%xmm0
pcmpgtd %xmm7,%xmm0
movdqa %xmm11,%xmm1
pcmpgtd %xmm3,%xmm1
psubd  %xmm0,%xmm5
psubd  %xmm1,%xmm2
paddd  %xmm0,%xmm4
psubd  %xmm10,%xmm4
paddd  %xmm1,%xmm6
psubd  %xmm10,%xmm6
paddd  %xmm9,%xmm7
add    $0xfffffff8,%eax
jne    14c0 <main+0x2f0>
paddd  %xmm4,%xmm6
pshufd $0xee,%xmm6,%xmm0
paddd  %xmm6,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
paddd  %xmm5,%xmm2
pshufd $0xee,%xmm2,%xmm0
paddd  %xmm2,%xmm0
pshufd $0x55,%xmm0,%xmm2
paddd  %xmm0,%xmm2
movd   %xmm2,%r15d
movd   %xmm1,0xc0c(%rsp)
movd   %xmm2,0x810(%rsp)
xor    %eax,%eax
pxor   %xmm10,%xmm10
nopl   0x0(%rax)
movdqa 0x1410(%rsp,%rax,1),%xmm4
movdqa 0x1420(%rsp,%rax,1),%xmm0
movdqa 0x1430(%rsp,%rax,1),%xmm9
movdqa 0x1440(%rsp,%rax,1),%xmm8
movdqa %xmm4,%xmm2
punpcklbw %xmm10,%xmm2
movdqa %xmm2,%xmm3
punpcklwd %xmm10,%xmm3
punpckhwd %xmm10,%xmm2
punpckhbw %xmm10,%xmm4
movdqa %xmm4,%xmm1
punpcklwd %xmm10,%xmm1
punpckhwd %xmm10,%xmm4
movdqa %xmm0,%xmm7
punpcklbw %xmm10,%xmm7
movdqa %xmm7,%xmm6
punpcklwd %xmm10,%xmm6
punpckhwd %xmm10,%xmm7
punpckhbw %xmm10,%xmm0
movdqa %xmm0,%xmm5
punpcklwd %xmm10,%xmm5
punpckhwd %xmm10,%xmm0
pcmpgtd %xmm11,%xmm4
pcmpgtd %xmm11,%xmm1
packssdw %xmm4,%xmm1
pcmpgtd %xmm11,%xmm2
pcmpgtd %xmm11,%xmm3
packssdw %xmm2,%xmm3
packsswb %xmm1,%xmm3
pcmpgtd %xmm11,%xmm0
pcmpgtd %xmm11,%xmm5
packssdw %xmm0,%xmm5
pcmpgtd %xmm11,%xmm7
pcmpgtd %xmm11,%xmm6
packssdw %xmm7,%xmm6
packsswb %xmm5,%xmm6
movdqa %xmm3,0x11410(%rsp,%rax,1)
movdqa %xmm6,0x11420(%rsp,%rax,1)
movdqa %xmm9,%xmm2
punpcklbw %xmm10,%xmm2
movdqa %xmm2,%xmm4
punpcklwd %xmm10,%xmm4
punpckhwd %xmm10,%xmm2
punpckhbw %xmm10,%xmm9
movdqa %xmm9,%xmm0
punpcklwd %xmm10,%xmm0
punpckhwd %xmm10,%xmm9
movdqa %xmm8,%xmm6
punpcklbw %xmm10,%xmm6
movdqa %xmm6,%xmm5
punpcklwd %xmm10,%xmm5
punpckhwd %xmm10,%xmm6
punpckhbw %xmm10,%xmm8
movdqa %xmm8,%xmm1
punpcklwd %xmm10,%xmm1
punpckhwd %xmm10,%xmm8
pcmpgtd %xmm11,%xmm9
pcmpgtd %xmm11,%xmm0
packssdw %xmm9,%xmm0
pcmpgtd %xmm11,%xmm2
pcmpgtd %xmm11,%xmm4
packssdw %xmm2,%xmm4
packsswb %xmm0,%xmm4
pcmpgtd %xmm11,%xmm8
pcmpgtd %xmm11,%xmm1
packssdw %xmm8,%xmm1
pcmpgtd %xmm11,%xmm6
pcmpgtd %xmm11,%xmm5
packssdw %xmm6,%xmm5
packsswb %xmm1,%xmm5
movdqa %xmm4,0x11430(%rsp,%rax,1)
movdqa %xmm5,0x11440(%rsp,%rax,1)
movdqa 0x1450(%rsp,%rax,1),%xmm0
movdqa 0x1460(%rsp,%rax,1),%xmm3
movdqa %xmm0,%xmm6
punpcklbw %xmm10,%xmm6
movdqa %xmm6,%xmm2
punpcklwd %xmm10,%xmm2
punpckhwd %xmm10,%xmm6
punpckhbw %xmm10,%xmm0
movdqa %xmm0,%xmm1
punpcklwd %xmm10,%xmm1
punpckhwd %xmm10,%xmm0
movdqa %xmm3,%xmm5
punpcklbw %xmm10,%xmm5
movdqa %xmm5,%xmm4
punpcklwd %xmm10,%xmm4
punpckhwd %xmm10,%xmm5
punpckhbw %xmm10,%xmm3
movdqa %xmm3,%xmm7
punpcklwd %xmm10,%xmm7
punpckhwd %xmm10,%xmm3
pcmpgtd %xmm11,%xmm0
pcmpgtd %xmm11,%xmm1
packssdw %xmm0,%xmm1
pcmpgtd %xmm11,%xmm6
pcmpgtd %xmm11,%xmm2
packssdw %xmm6,%xmm2
packsswb %xmm1,%xmm2
pcmpgtd %xmm11,%xmm3
pcmpgtd %xmm11,%xmm7
packssdw %xmm3,%xmm7
pcmpgtd %xmm11,%xmm5
pcmpgtd %xmm11,%xmm4
packssdw %xmm5,%xmm4
packsswb %xmm7,%xmm4
movdqa %xmm2,0x11450(%rsp,%rax,1)
movdqa %xmm4,0x11460(%rsp,%rax,1)
movdqa 0x1470(%rsp,%rax,1),%xmm0
movdqa 0x1480(%rsp,%rax,1),%xmm3
movdqa %xmm0,%xmm6
punpcklbw %xmm10,%xmm6
movdqa %xmm6,%xmm2
punpcklwd %xmm10,%xmm2
punpckhwd %xmm10,%xmm6
punpckhbw %xmm10,%xmm0
movdqa %xmm0,%xmm1
punpcklwd %xmm10,%xmm1
punpckhwd %xmm10,%xmm0
movdqa %xmm3,%xmm5
punpcklbw %xmm10,%xmm5
movdqa %xmm5,%xmm4
punpcklwd %xmm10,%xmm4
punpckhwd %xmm10,%xmm5
punpckhbw %xmm10,%xmm3
movdqa %xmm3,%xmm7
punpcklwd %xmm10,%xmm7
punpckhwd %xmm10,%xmm3
pcmpgtd %xmm11,%xmm0
pcmpgtd %xmm11,%xmm1
packssdw %xmm0,%xmm1
pcmpgtd %xmm11,%xmm6
pcmpgtd %xmm11,%xmm2
packssdw %xmm6,%xmm2
packsswb %xmm1,%xmm2
pcmpgtd %xmm11,%xmm3
pcmpgtd %xmm11,%xmm7
packssdw %xmm3,%xmm7
pcmpgtd %xmm11,%xmm5
pcmpgtd %xmm11,%xmm4
packssdw %xmm5,%xmm4
packsswb %xmm7,%xmm4
movdqa %xmm2,0x11470(%rsp,%rax,1)
movdqa %xmm4,0x11480(%rsp,%rax,1)
movdqa 0x1490(%rsp,%rax,1),%xmm0
movdqa 0x14a0(%rsp,%rax,1),%xmm3
movdqa %xmm0,%xmm6
punpcklbw %xmm10,%xmm6
movdqa %xmm6,%xmm2
punpcklwd %xmm10,%xmm2
punpckhwd %xmm10,%xmm6
punpckhbw %xmm10,%xmm0
movdqa %xmm0,%xmm1
punpcklwd %xmm10,%xmm1
punpckhwd %xmm10,%xmm0
movdqa %xmm3,%xmm5
punpcklbw %xmm10,%xmm5
movdqa %xmm5,%xmm4
punpcklwd %xmm10,%xmm4
punpckhwd %xmm10,%xmm5
punpckhbw %xmm10,%xmm3
movdqa %xmm3,%xmm7
punpcklwd %xmm10,%xmm7
punpckhwd %xmm10,%xmm3
pcmpgtd %xmm11,%xmm0
pcmpgtd %xmm11,%xmm1
packssdw %xmm0,%xmm1
pcmpgtd %xmm11,%xmm6
pcmpgtd %xmm11,%xmm2
packssdw %xmm6,%xmm2
packsswb %xmm1,%xmm2
pcmpgtd %xmm11,%xmm3
pcmpgtd %xmm11,%xmm7
packssdw %xmm3,%xmm7
pcmpgtd %xmm11,%xmm5
pcmpgtd %xmm11,%xmm4
packssdw %xmm5,%xmm4
packsswb %xmm7,%xmm4
movdqa %xmm2,0x11490(%rsp,%rax,1)
movdqa %xmm4,0x114a0(%rsp,%rax,1)
movdqa 0x14b0(%rsp,%rax,1),%xmm4
movdqa 0x14c0(%rsp,%rax,1),%xmm5
movdqa 0x14d0(%rsp,%rax,1),%xmm9
movdqa 0x14e0(%rsp,%rax,1),%xmm8
movdqa %xmm4,%xmm2
punpcklbw %xmm10,%xmm2
movdqa %xmm2,%xmm3
punpcklwd %xmm10,%xmm3
punpckhwd %xmm10,%xmm2
punpckhbw %xmm10,%xmm4
movdqa %xmm4,%xmm0
punpcklwd %xmm10,%xmm0
punpckhwd %xmm10,%xmm4
movdqa %xmm5,%xmm7
punpcklbw %xmm10,%xmm7
movdqa %xmm7,%xmm6
punpcklwd %xmm10,%xmm6
punpckhwd %xmm10,%xmm7
punpckhbw %xmm10,%xmm5
movdqa %xmm5,%xmm1
punpcklwd %xmm10,%xmm1
punpckhwd %xmm10,%xmm5
pcmpgtd %xmm11,%xmm4
pcmpgtd %xmm11,%xmm0
packssdw %xmm4,%xmm0
pcmpgtd %xmm11,%xmm2
pcmpgtd %xmm11,%xmm3
packssdw %xmm2,%xmm3
packsswb %xmm0,%xmm3
pcmpgtd %xmm11,%xmm5
pcmpgtd %xmm11,%xmm1
packssdw %xmm5,%xmm1
pcmpgtd %xmm11,%xmm7
pcmpgtd %xmm11,%xmm6
packssdw %xmm7,%xmm6
packsswb %xmm1,%xmm6
movdqa %xmm3,0x114b0(%rsp,%rax,1)
movdqa %xmm6,0x114c0(%rsp,%rax,1)
movdqa %xmm9,%xmm2
punpcklbw %xmm10,%xmm2
movdqa %xmm2,%xmm4
punpcklwd %xmm10,%xmm4
punpckhwd %xmm10,%xmm2
punpckhbw %xmm10,%xmm9
movdqa %xmm9,%xmm0
punpcklwd %xmm10,%xmm0
punpckhwd %xmm10,%xmm9
movdqa %xmm8,%xmm6
punpcklbw %xmm10,%xmm6
movdqa %xmm6,%xmm5
punpcklwd %xmm10,%xmm5
punpckhwd %xmm10,%xmm6
punpckhbw %xmm10,%xmm8
movdqa %xmm8,%xmm1
punpcklwd %xmm10,%xmm1
punpckhwd %xmm10,%xmm8
pcmpgtd %xmm11,%xmm9
pcmpgtd %xmm11,%xmm0
packssdw %xmm9,%xmm0
pcmpgtd %xmm11,%xmm2
pcmpgtd %xmm11,%xmm4
packssdw %xmm2,%xmm4
packsswb %xmm0,%xmm4
pcmpgtd %xmm11,%xmm8
pcmpgtd %xmm11,%xmm1
packssdw %xmm8,%xmm1
pcmpgtd %xmm11,%xmm6
pcmpgtd %xmm11,%xmm5
packssdw %xmm6,%xmm5
packsswb %xmm1,%xmm5
movdqa %xmm4,0x114d0(%rsp,%rax,1)
movdqa %xmm5,0x114e0(%rsp,%rax,1)
movdqa 0x14f0(%rsp,%rax,1),%xmm0
movdqa 0x1500(%rsp,%rax,1),%xmm3
movdqa %xmm0,%xmm6
punpcklbw %xmm10,%xmm6
movdqa %xmm6,%xmm2
punpcklwd %xmm10,%xmm2
punpckhwd %xmm10,%xmm6
punpckhbw %xmm10,%xmm0
movdqa %xmm0,%xmm1
punpcklwd %xmm10,%xmm1
punpckhwd %xmm10,%xmm0
movdqa %xmm3,%xmm5
punpcklbw %xmm10,%xmm5
movdqa %xmm5,%xmm4
punpcklwd %xmm10,%xmm4
punpckhwd %xmm10,%xmm5
punpckhbw %xmm10,%xmm3
movdqa %xmm3,%xmm7
punpcklwd %xmm10,%xmm7
punpckhwd %xmm10,%xmm3
pcmpgtd %xmm11,%xmm0
pcmpgtd %xmm11,%xmm1
packssdw %xmm0,%xmm1
pcmpgtd %xmm11,%xmm6
pcmpgtd %xmm11,%xmm2
packssdw %xmm6,%xmm2
packsswb %xmm1,%xmm2
pcmpgtd %xmm11,%xmm3
pcmpgtd %xmm11,%xmm7
packssdw %xmm3,%xmm7
pcmpgtd %xmm11,%xmm5
pcmpgtd %xmm11,%xmm4
packssdw %xmm5,%xmm4
packsswb %xmm7,%xmm4
movdqa %xmm2,0x114f0(%rsp,%rax,1)
movdqa %xmm4,0x11500(%rsp,%rax,1)
add    $0x100,%rax
cmp    $0x10000,%rax
jne    1550 <main+0x380>
lea    0x509(%rip),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
lea    0x4fc(%rip),%rax
lea    0x509(%rip),%rdi
cmove  %rax,%rdi
lea    0x4fb(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbx
lea    0x4fe(%rip),%r12
mov    %rax,%rdi
mov    %r12,%rsi
xor    %edx,%edx
mov    %r15d,%ecx
call   10a0 <fprintf@plt>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x810(%rsp,%rbp,4),%ecx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   10a0 <fprintf@plt>
add    $0x1,%rbp
cmp    $0x100,%rbp
jne    1b90 <main+0x9c0>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0x482(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
lea    0x49e(%rip),%rax
lea    0x4aa(%rip),%rdi
cmove  %rax,%rdi
lea    0x471(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbp
lea    0x11410(%rsp),%rdi
mov    $0x1,%esi
mov    $0x10000,%edx
mov    %rax,%rcx
call   10f0 <fwrite@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
lea    0x471(%rip),%rax
lea    0x47a(%rip),%rdi
cmove  %rax,%rdi
call   1060 <system@plt>
xor    %eax,%eax
add    $0x21418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"don't read filename\0A\00"
@.str.1 = [16 x i8] c"many arguments\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [2 x i8] c".\00"
@.str.4 = [12 x i8] c"many peaks\0A\00"
@.str.5 = [13 x i8] c"\E9\96\BE\E5\80\A4 = %d\0A\00"
@.str.6 = [19 x i8] c"don't appear peak\0A\00"
@.str.7 = [5 x i8] c"girl\00"
@.str.8 = [17 x i8] c"plot_ex4girl.dat\00"
@.str.9 = [3 x i8] c"wb\00"
@.str.10 = [15 x i8] c"plot_ex4ei.dat\00"
@.str.11 = [9 x i8] c"%3d %3d\0A\00"
@.str.12 = [19 x i8] c"girlex4_binary.dat\00"
@.str.13 = [17 x i8] c"eiex4_binary.dat\00"
@.str.14 = [16 x i8] c"zsh ex4_girl.sh\00"
@.str.15 = [14 x i8] c"zsh ex4_ei.sh\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x [256 x i8]]
%7 = alloca [256 x [256 x i8]]
%8 = alloca [256 x i32]
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32*
%12 = alloca [256 x i32]
%13 = alloca [256 x i32]
%14 = alloca [256 x i32]
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca [256 x i32]
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%31 = bitcast [256 x i32]* %8 to i8*
store i32 16, i32* %15
store i32 150, i32* %16
%32 = load i32, i32* %4
%33 = icmp slt i32 %32, 2
br i1 %33, label %34, label %36
34: ; preds = %2
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %343
36: ; preds = %2
%37 = load i32, i32* %4
%38 = icmp sgt i32 %37, 2
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %343
41: ; preds = %36
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 1
%44 = load i8*, i8** %43
%45 = call i32* @fopen(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %45, i32** %11
%46 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %6, i64 0, i64 0
%47 = bitcast [256 x i8]* %46 to i8**
%48 = load i32*, i32** %11
%49 = call i32 @fread(i8** %47, i32 1, i32 65536, i32* %48)
%50 = load i32*, i32** %11
%51 = call i32 @fclose(i32* %50)
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = call i8* @strtok(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %55, i8** %10
store i32 0, i32* %17
br label %56
56: ; preds = %79, %41
%57 = load i32, i32* %17
%58 = icmp slt i32 %57, 256
br i1 %58, label %59, label %82
59: ; preds = %56
store i32 0, i32* %18
br label %60
60: ; preds = %75, %59
%61 = load i32, i32* %18
%62 = icmp slt i32 %61, 256
br i1 %62, label %63, label %78
63: ; preds = %60
%64 = load i32, i32* %17
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %6, i64 0, i64 %65
%67 = load i32, i32* %18
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [256 x i8], [256 x i8]* %66, i64 0, i64 %68
%70 = load i8, i8* %69
%71 = zext i8 %70 to i64
%72 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 %71
%73 = load i32, i32* %72
%74 = add nsw i32 %73, 1
store i32 %74, i32* %72
br label %75
75: ; preds = %63
%76 = load i32, i32* %18
%77 = add nsw i32 %76, 1
store i32 %77, i32* %18
br label %60
78: ; preds = %60
br label %79
79: ; preds = %78
%80 = load i32, i32* %17
%81 = add nsw i32 %80, 1
store i32 %81, i32* %17
br label %56
82: ; preds = %56
store i32 0, i32* %19
store i32 0, i32* %20
br label %83
83: ; preds = %141, %82
%84 = load i32, i32* %20
%85 = load i32, i32* %15
%86 = sub nsw i32 256, %85
%87 = icmp slt i32 %84, %86
br i1 %87, label %88, label %144
88: ; preds = %83
%89 = load i32, i32* %20
%90 = load i32, i32* %15
%91 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%92 = call i64 @maxNo(i32 %89, i32 %90, i32* %91)
%93 = load i32, i32* %20
%94 = add nsw i32 %93, 1
%95 = load i32, i32* %15
%96 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%97 = call i64 @maxNo(i32 %94, i32 %95, i32* %96)
%98 = icmp eq i64 %92, %97
br i1 %98, label %99, label %140
99: ; preds = %88
store i32 0, i32* %21
store i32 1, i32* %22
br label %100
100: ; preds = %120, %99
%101 = load i32, i32* %22
%102 = load i32, i32* %15
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %123
104: ; preds = %100
%105 = load i32, i32* %20
%106 = load i32, i32* %15
%107 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%108 = call i64 @maxNo(i32 %105, i32 %106, i32* %107)
%109 = load i32, i32* %20
%110 = load i32, i32* %22
%111 = add nsw i32 %109, %110
%112 = load i32, i32* %15
%113 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%114 = call i64 @maxNo(i32 %111, i32 %112, i32* %113)
%115 = icmp eq i64 %108, %114
br i1 %115, label %116, label %119
116: ; preds = %104
%117 = load i32, i32* %21
%118 = add nsw i32 %117, 1
store i32 %118, i32* %21
br label %119
119: ; preds = %116, %104
br label %120
120: ; preds = %119
%121 = load i32, i32* %22
%122 = add nsw i32 %121, 1
store i32 %122, i32* %22
br label %100
123: ; preds = %100
%124 = load i32, i32* %21
%125 = load i32, i32* %15
%126 = sub nsw i32 %125, 1
%127 = icmp eq i32 %124, %126
br i1 %127, label %128, label %139
128: ; preds = %123
%129 = load i32, i32* %20
%130 = load i32, i32* %15
%131 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%132 = call i64 @maxNo(i32 %129, i32 %130, i32* %131)
%133 = trunc i64 %132 to i32
%134 = load i32, i32* %19
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 %135
store i32 %133, i32* %136
%137 = load i32, i32* %19
%138 = add nsw i32 %137, 1
store i32 %138, i32* %19
br label %139
139: ; preds = %128, %123
br label %140
140: ; preds = %139, %88
br label %141
141: ; preds = %140
%142 = load i32, i32* %20
%143 = add nsw i32 %142, 1
store i32 %143, i32* %20
br label %83
144: ; preds = %83
%145 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 0
%146 = load i32, i32* %145
%147 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%148 = call i32 @minNo(i32 0, i32 %146, i32* %147)
%149 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 0
store i32 %148, i32* %149
store i32 0, i32* %23
br label %150
150: ; preds = %177, %144
%151 = load i32, i32* %23
%152 = icmp slt i32 %151, 256
br i1 %152, label %153, label %180
153: ; preds = %150
%154 = load i32, i32* %23
%155 = add nsw i32 %154, 1
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 %156
%158 = load i32, i32* %157
%159 = icmp eq i32 %158, 0
br i1 %159, label %160, label %161
160: ; preds = %153
br label %180
161: ; preds = %153
%162 = load i32, i32* %23
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 %163
%165 = load i32, i32* %164
%166 = load i32, i32* %23
%167 = add nsw i32 %166, 1
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 %168
%170 = load i32, i32* %169
%171 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%172 = call i32 @minNo(i32 %165, i32 %170, i32* %171)
%173 = load i32, i32* %23
%174 = add nsw i32 %173, 1
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 %175
store i32 %172, i32* %176
br label %177
177: ; preds = %161
%178 = load i32, i32* %23
%179 = add nsw i32 %178, 1
store i32 %179, i32* %23
br label %150
180: ; preds = %160, %150
store i32 0, i32* %24
store i32 0, i32* %25
br label %181
181: ; preds = %213, %180
%182 = load i32, i32* %25
%183 = icmp slt i32 %182, 256
br i1 %183, label %184, label %216
184: ; preds = %181
%185 = load i32, i32* %25
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds [256 x i32], [256 x i32]* %12, i64 0, i64 %186
%188 = load i32, i32* %187
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 %189
%191 = load i32, i32* %190
%192 = load i32, i32* %25
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 %193
%195 = load i32, i32* %194
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 %196
%198 = load i32, i32* %197
%199 = sub nsw i32 %191, %198
%200 = load i32, i32* %16
%201 = icmp sge i32 %199, %200
br i1 %201, label %202, label %212
202: ; preds = %184
%203 = load i32, i32* %25
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds [256 x i32], [256 x i32]* %13, i64 0, i64 %204
%206 = load i32, i32* %205
%207 = load i32, i32* %24
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 %208
store i32 %206, i32* %209
%210 = load i32, i32* %24
%211 = add nsw i32 %210, 1
store i32 %211, i32* %24
br label %212
212: ; preds = %202, %184
br label %213
213: ; preds = %212
%214 = load i32, i32* %25
%215 = add nsw i32 %214, 1
store i32 %215, i32* %25
br label %181
216: ; preds = %181
%217 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 0
%218 = load i32, i32* %217
%219 = icmp sgt i32 %218, 0
br i1 %219, label %220, label %232
220: ; preds = %216
%221 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 1
%222 = load i32, i32* %221
%223 = icmp sgt i32 %222, 0
br i1 %223, label %224, label %226
224: ; preds = %220
%225 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %231
226: ; preds = %220
%227 = getelementptr inbounds [256 x i32], [256 x i32]* %14, i64 0, i64 0
%228 = load i32, i32* %227
store i32 %228, i32* %9
%229 = load i32, i32* %9
%230 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %229)
br label %231
231: ; preds = %226, %224
br label %234
232: ; preds = %216
%233 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %3
br label %343
234: ; preds = %231
store i32 0, i32* %27
br label %235
235: ; preds = %251, %234
%236 = load i32, i32* %27
%237 = icmp slt i32 %236, 256
br i1 %237, label %238, label %254
238: ; preds = %235
%239 = load i32, i32* %27
%240 = load i32, i32* %9
%241 = icmp slt i32 %239, %240
br i1 %241, label %242, label %246
242: ; preds = %238
%243 = getelementptr inbounds [256 x i32], [256 x i32]* %26, i64 0, i64 0
%244 = load i32, i32* %243
%245 = add nsw i32 %244, 1
store i32 %245, i32* %243
br label %250
246: ; preds = %238
%247 = getelementptr inbounds [256 x i32], [256 x i32]* %26, i64 0, i64 255
%248 = load i32, i32* %247
%249 = add nsw i32 %248, 1
store i32 %249, i32* %247
br label %250
250: ; preds = %246, %242
br label %251
251: ; preds = %250
%252 = load i32, i32* %27
%253 = add nsw i32 %252, 1
store i32 %253, i32* %27
br label %235
254: ; preds = %235
store i32 0, i32* %28
br label %255
255: ; preds = %292, %254
%256 = load i32, i32* %28
%257 = icmp slt i32 %256, 256
br i1 %257, label %258, label %295
258: ; preds = %255
store i32 0, i32* %29
br label %259
259: ; preds = %288, %258
%260 = load i32, i32* %29
%261 = icmp slt i32 %260, 256
br i1 %261, label %262, label %291
262: ; preds = %259
%263 = load i32, i32* %28
%264 = sext i32 %263 to i64
%265 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %6, i64 0, i64 %264
%266 = load i32, i32* %29
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds [256 x i8], [256 x i8]* %265, i64 0, i64 %267
%269 = load i8, i8* %268
%270 = zext i8 %269 to i32
%271 = load i32, i32* %9
%272 = icmp sgt i32 %270, %271
br i1 %272, label %273, label %280
273: ; preds = %262
%274 = load i32, i32* %28
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %7, i64 0, i64 %275
%277 = load i32, i32* %29
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds [256 x i8], [256 x i8]* %276, i64 0, i64 %278
store i8 -1, i8* %279
br label %287
280: ; preds = %262
%281 = load i32, i32* %28
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %7, i64 0, i64 %282
%284 = load i32, i32* %29
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds [256 x i8], [256 x i8]* %283, i64 0, i64 %285
store i8 0, i8* %286
br label %287
287: ; preds = %280, %273
br label %288
288: ; preds = %287
%289 = load i32, i32* %29
%290 = add nsw i32 %289, 1
store i32 %290, i32* %29
br label %259
291: ; preds = %259
br label %292
292: ; preds = %291
%293 = load i32, i32* %28
%294 = add nsw i32 %293, 1
store i32 %294, i32* %28
br label %255
295: ; preds = %255
%296 = load i8*, i8** %10
%297 = call i64 @strcmp(i8* %296, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%298 = icmp eq i64 %297, 0
br i1 %298, label %299, label %301
299: ; preds = %295
%300 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32* %300, i32** %11
br label %303
301: ; preds = %295
%302 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32* %302, i32** %11
br label %303
303: ; preds = %301, %299
store i32 0, i32* %30
br label %304
304: ; preds = %315, %303
%305 = load i32, i32* %30
%306 = icmp slt i32 %305, 256
br i1 %306, label %307, label %318
307: ; preds = %304
%308 = load i32*, i32** %11
%309 = load i32, i32* %30
%310 = load i32, i32* %30
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds [256 x i32], [256 x i32]* %26, i64 0, i64 %311
%313 = load i32, i32* %312
%314 = call i32 @fprintf(i32* %308, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 %309, i32 %313)
br label %315
315: ; preds = %307
%316 = load i32, i32* %30
%317 = add nsw i32 %316, 1
store i32 %317, i32* %30
br label %304
318: ; preds = %304
%319 = load i32*, i32** %11
%320 = call i32 @fclose(i32* %319)
%321 = load i8*, i8** %10
%322 = call i64 @strcmp(i8* %321, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%323 = icmp eq i64 %322, 0
br i1 %323, label %324, label %326
324: ; preds = %318
%325 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32* %325, i32** %11
br label %328
326: ; preds = %318
%327 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
store i32* %327, i32** %11
br label %328
328: ; preds = %326, %324
%329 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %7, i64 0, i64 0
%330 = bitcast [256 x i8]* %329 to i8**
%331 = load i32*, i32** %11
%332 = call i32 @fwrite(i8** %330, i32 1, i32 65536, i32* %331)
%333 = load i32*, i32** %11
%334 = call i32 @fclose(i32* %333)
%335 = load i8*, i8** %10
%336 = call i64 @strcmp(i8* %335, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%337 = icmp eq i64 %336, 0
br i1 %337, label %338, label %340
338: ; preds = %328
%339 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0))
br label %342
340: ; preds = %328
%341 = call i32 @system(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0))
br label %342
342: ; preds = %340, %338
store i32 0, i32* %3
br label %343
343: ; preds = %342, %232, %39, %34
%344 = load i32, i32* %3
ret i32 %344
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [2 x i8] c".\00"
@.str.5 = [13 x i8] c"\E9\96\BE\E5\80\A4 = %d\0A\00"
@.str.7 = [5 x i8] c"girl\00"
@.str.8 = [17 x i8] c"plot_ex4girl.dat\00"
@.str.9 = [3 x i8] c"wb\00"
@.str.10 = [15 x i8] c"plot_ex4ei.dat\00"
@.str.11 = [9 x i8] c"%3d %3d\0A\00"
@.str.12 = [19 x i8] c"girlex4_binary.dat\00"
@.str.13 = [17 x i8] c"eiex4_binary.dat\00"
@.str.14 = [16 x i8] c"zsh ex4_girl.sh\00"
@.str.15 = [14 x i8] c"zsh ex4_ei.sh\00"
@str = [18 x i8] c"don't appear peak\00"
@str.16 = [11 x i8] c"many peaks\00"
@str.17 = [15 x i8] c"many arguments\00"
@str.18 = [20 x i8] c"don't read filename\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x [256 x i8]]
%4 = alloca [256 x [256 x i8]]
%5 = alloca [256 x i32]
%6 = alloca [256 x i32]
%7 = alloca [256 x i32]
%8 = alloca [256 x i32]
%9 = alloca [256 x i32]
%10 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 0, i64 0
%11 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 0, i64 0
%12 = bitcast [256 x i32]* %5 to i8*
%13 = bitcast [256 x i32]* %6 to i8*
%14 = bitcast [256 x i32]* %7 to i8*
%15 = bitcast [256 x i32]* %8 to i8*
%16 = icmp slt i32 %0, 2
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.18, i64 0, i64 0))
br label %341
19: ; preds = %2
%20 = icmp eq i32 %0, 2
br i1 %20, label %23, label %21
21: ; preds = %19
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.17, i64 0, i64 0))
br label %341
23: ; preds = %19
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = tail call i32* @fopen(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%27 = bitcast [256 x [256 x i8]]* %3 to i8**
%28 = call i32 @fread(i8** %27, i32 1, i32 65536, i32* %26)
%29 = tail call i32 @fclose(i32* %26)
%30 = load i8*, i8** %24
%31 = tail call i8* @strtok(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %23, %36
%33 = phi i64 [ 0, %23 ], [ %37, %36 ]
br label %39
34: ; preds = %36
%35 = getelementptr inbounds [256 x i32], [256 x i32]* %5, i64 0, i64 0
br label %61
36: ; preds = %39
%37 = add nuw nsw i64 %33, 1
%38 = icmp eq i64 %37, 256
br i1 %38, label %34, label %32
39: ; preds = %39, %32
%40 = phi i64 [ 0, %32 ], [ %54, %39 ]
%41 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %33, i64 %40
%42 = load i8, i8* %41
%43 = zext i8 %42 to i64
%44 = getelementptr inbounds [256 x i32], [256 x i32]* %5, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = add nsw i32 %45, 1
store i32 %46, i32* %44
%47 = or i64 %40, 1
%48 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %33, i64 %47
%49 = load i8, i8* %48
%50 = zext i8 %49 to i64
%51 = getelementptr inbounds [256 x i32], [256 x i32]* %5, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = add nsw i32 %52, 1
store i32 %53, i32* %51
%54 = add nuw nsw i64 %40, 2
%55 = icmp eq i64 %54, 256
br i1 %55, label %36, label %39
56: ; preds = %87
%57 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 0
%58 = load i32, i32* %57
%59 = call i32 @minNo(i32 0, i32 %58, i32* %35)
%60 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 0
store i32 %59, i32* %60
br label %90
61: ; preds = %34, %87
%62 = phi i32 [ 0, %34 ], [ %65, %87 ]
%63 = phi i32 [ 0, %34 ], [ %88, %87 ]
%64 = call i64 @maxNo(i32 %62, i32 16, i32* %35)
%65 = add nuw nsw i32 %62, 1
%66 = call i64 @maxNo(i32 %65, i32 16, i32* %35)
%67 = icmp eq i64 %64, %66
br i1 %67, label %70, label %87
68: ; preds = %70
%69 = icmp eq i32 %78, 15
br i1 %69, label %81, label %87
70: ; preds = %61, %70
%71 = phi i32 [ %79, %70 ], [ 1, %61 ]
%72 = phi i32 [ %78, %70 ], [ 0, %61 ]
%73 = call i64 @maxNo(i32 %62, i32 16, i32* %35)
%74 = add nuw nsw i32 %71, %62
%75 = call i64 @maxNo(i32 %74, i32 16, i32* %35)
%76 = icmp eq i64 %73, %75
%77 = zext i1 %76 to i32
%78 = add nuw nsw i32 %72, %77
%79 = add nuw nsw i32 %71, 1
%80 = icmp eq i32 %79, 16
br i1 %80, label %68, label %70
81: ; preds = %68
%82 = call i64 @maxNo(i32 %62, i32 16, i32* %35)
%83 = trunc i64 %82 to i32
%84 = sext i32 %63 to i64
%85 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 %84
store i32 %83, i32* %85
%86 = add nsw i32 %63, 1
br label %87
87: ; preds = %68, %81, %61
%88 = phi i32 [ %63, %61 ], [ %86, %81 ], [ %63, %68 ]
%89 = icmp eq i32 %65, 240
br i1 %89, label %56, label %61
90: ; preds = %56, %96
%91 = phi i64 [ 0, %56 ], [ %92, %96 ]
%92 = add nuw nsw i64 %91, 1
%93 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 %92
%94 = load i32, i32* %93
%95 = icmp eq i32 %94, 0
br i1 %95, label %102, label %96
96: ; preds = %90
%97 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 %91
%98 = load i32, i32* %97
%99 = call i32 @minNo(i32 %98, i32 %94, i32* %35)
%100 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 %92
store i32 %99, i32* %100
%101 = icmp eq i64 %92, 256
br i1 %101, label %102, label %90
102: ; preds = %90, %96
br label %107
103: ; preds = %125
%104 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 0
%105 = load i32, i32* %104
%106 = icmp sgt i32 %105, 0
br i1 %106, label %132, label %140
107: ; preds = %102, %129
%108 = phi i32 [ %131, %129 ], [ %58, %102 ]
%109 = phi i64 [ %127, %129 ], [ 0, %102 ]
%110 = phi i32 [ %126, %129 ], [ 0, %102 ]
%111 = sext i32 %108 to i64
%112 = getelementptr inbounds [256 x i32], [256 x i32]* %5, i64 0, i64 %111
%113 = load i32, i32* %112
%114 = getelementptr inbounds [256 x i32], [256 x i32]* %7, i64 0, i64 %109
%115 = load i32, i32* %114
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [256 x i32], [256 x i32]* %5, i64 0, i64 %116
%118 = load i32, i32* %117
%119 = sub nsw i32 %113, %118
%120 = icmp sgt i32 %119, 149
br i1 %120, label %121, label %125
121: ; preds = %107
%122 = sext i32 %110 to i64
%123 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 %122
store i32 %115, i32* %123
%124 = add nsw i32 %110, 1
br label %125
125: ; preds = %107, %121
%126 = phi i32 [ %124, %121 ], [ %110, %107 ]
%127 = add nuw nsw i64 %109, 1
%128 = icmp eq i64 %127, 256
br i1 %128, label %103, label %129
129: ; preds = %125
%130 = getelementptr inbounds [256 x i32], [256 x i32]* %6, i64 0, i64 %127
%131 = load i32, i32* %130
br label %107
132: ; preds = %103
%133 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 1
%134 = load i32, i32* %133
%135 = icmp sgt i32 %134, 0
br i1 %135, label %136, label %138
136: ; preds = %132
%137 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.16, i64 0, i64 0))
br label %142
138: ; preds = %132
%139 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %105)
br label %142
140: ; preds = %103
%141 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %341
142: ; preds = %136, %138
%143 = bitcast [256 x i32]* %9 to i8*
%144 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 255
%145 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 0
%146 = insertelement <4 x i32> poison, i32 %105, i64 0
%147 = shufflevector <4 x i32> %146, <4 x i32> poison, <4 x i32> zeroinitializer
%148 = insertelement <4 x i32> poison, i32 %105, i64 0
%149 = shufflevector <4 x i32> %148, <4 x i32> poison, <4 x i32> zeroinitializer
br label %150
150: ; preds = %150, %142
%151 = phi i32 [ 0, %142 ], [ %170, %150 ]
%152 = phi <4 x i32> [ <i32 undef, i32 0, i32 0, i32 0>, %142 ], [ %162, %150 ]
%153 = phi <4 x i32> [ zeroinitializer, %142 ], [ %163, %150 ]
%154 = phi <4 x i32> [ <i32 undef, i32 0, i32 0, i32 0>, %142 ], [ %168, %150 ]
%155 = phi <4 x i32> [ zeroinitializer, %142 ], [ %169, %150 ]
%156 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %142 ], [ %171, %150 ]
%157 = add <4 x i32> %156, <i32 4, i32 4, i32 4, i32 4>
%158 = icmp slt <4 x i32> %156, %147
%159 = icmp slt <4 x i32> %157, %149
%160 = zext <4 x i1> %158 to <4 x i32>
%161 = zext <4 x i1> %159 to <4 x i32>
%162 = add <4 x i32> %152, %160
%163 = add <4 x i32> %153, %161
%164 = xor <4 x i1> %158, <i1 true, i1 true, i1 true, i1 true>
%165 = xor <4 x i1> %159, <i1 true, i1 true, i1 true, i1 true>
%166 = zext <4 x i1> %164 to <4 x i32>
%167 = zext <4 x i1> %165 to <4 x i32>
%168 = add <4 x i32> %154, %166
%169 = add <4 x i32> %155, %167
%170 = add nuw i32 %151, 8
%171 = add <4 x i32> %156, <i32 8, i32 8, i32 8, i32 8>
%172 = icmp eq i32 %170, 256
br i1 %172, label %173, label %150
173: ; preds = %150
%174 = add <4 x i32> %169, %168
%175 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %174)
%176 = add <4 x i32> %163, %162
%177 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %176)
store i32 %175, i32* %144
store i32 %177, i32* %145
%178 = insertelement <16 x i32> poison, i32 %105, i64 0
%179 = shufflevector <16 x i32> %178, <16 x i32> poison, <16 x i32> zeroinitializer
%180 = insertelement <16 x i32> poison, i32 %105, i64 0
%181 = shufflevector <16 x i32> %180, <16 x i32> poison, <16 x i32> zeroinitializer
br label %182
182: ; preds = %173, %182
%183 = phi i64 [ 0, %173 ], [ %312, %182 ]
%184 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 0
%185 = bitcast i8* %184 to <16 x i8>*
%186 = load <16 x i8>, <16 x i8>* %185
%187 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 16
%188 = bitcast i8* %187 to <16 x i8>*
%189 = load <16 x i8>, <16 x i8>* %188
%190 = zext <16 x i8> %186 to <16 x i32>
%191 = zext <16 x i8> %189 to <16 x i32>
%192 = icmp slt <16 x i32> %179, %190
%193 = icmp slt <16 x i32> %181, %191
%194 = sext <16 x i1> %192 to <16 x i8>
%195 = sext <16 x i1> %193 to <16 x i8>
%196 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 0
%197 = bitcast i8* %196 to <16 x i8>*
store <16 x i8> %194, <16 x i8>* %197
%198 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 16
%199 = bitcast i8* %198 to <16 x i8>*
store <16 x i8> %195, <16 x i8>* %199
%200 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 32
%201 = bitcast i8* %200 to <16 x i8>*
%202 = load <16 x i8>, <16 x i8>* %201
%203 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 48
%204 = bitcast i8* %203 to <16 x i8>*
%205 = load <16 x i8>, <16 x i8>* %204
%206 = zext <16 x i8> %202 to <16 x i32>
%207 = zext <16 x i8> %205 to <16 x i32>
%208 = icmp slt <16 x i32> %179, %206
%209 = icmp slt <16 x i32> %181, %207
%210 = sext <16 x i1> %208 to <16 x i8>
%211 = sext <16 x i1> %209 to <16 x i8>
%212 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 32
%213 = bitcast i8* %212 to <16 x i8>*
store <16 x i8> %210, <16 x i8>* %213
%214 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 48
%215 = bitcast i8* %214 to <16 x i8>*
store <16 x i8> %211, <16 x i8>* %215
%216 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 64
%217 = bitcast i8* %216 to <16 x i8>*
%218 = load <16 x i8>, <16 x i8>* %217
%219 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 80
%220 = bitcast i8* %219 to <16 x i8>*
%221 = load <16 x i8>, <16 x i8>* %220
%222 = zext <16 x i8> %218 to <16 x i32>
%223 = zext <16 x i8> %221 to <16 x i32>
%224 = icmp slt <16 x i32> %179, %222
%225 = icmp slt <16 x i32> %181, %223
%226 = sext <16 x i1> %224 to <16 x i8>
%227 = sext <16 x i1> %225 to <16 x i8>
%228 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 64
%229 = bitcast i8* %228 to <16 x i8>*
store <16 x i8> %226, <16 x i8>* %229
%230 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 80
%231 = bitcast i8* %230 to <16 x i8>*
store <16 x i8> %227, <16 x i8>* %231
%232 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 96
%233 = bitcast i8* %232 to <16 x i8>*
%234 = load <16 x i8>, <16 x i8>* %233
%235 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 112
%236 = bitcast i8* %235 to <16 x i8>*
%237 = load <16 x i8>, <16 x i8>* %236
%238 = zext <16 x i8> %234 to <16 x i32>
%239 = zext <16 x i8> %237 to <16 x i32>
%240 = icmp slt <16 x i32> %179, %238
%241 = icmp slt <16 x i32> %181, %239
%242 = sext <16 x i1> %240 to <16 x i8>
%243 = sext <16 x i1> %241 to <16 x i8>
%244 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 96
%245 = bitcast i8* %244 to <16 x i8>*
store <16 x i8> %242, <16 x i8>* %245
%246 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 112
%247 = bitcast i8* %246 to <16 x i8>*
store <16 x i8> %243, <16 x i8>* %247
%248 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 128
%249 = bitcast i8* %248 to <16 x i8>*
%250 = load <16 x i8>, <16 x i8>* %249
%251 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 144
%252 = bitcast i8* %251 to <16 x i8>*
%253 = load <16 x i8>, <16 x i8>* %252
%254 = zext <16 x i8> %250 to <16 x i32>
%255 = zext <16 x i8> %253 to <16 x i32>
%256 = icmp slt <16 x i32> %179, %254
%257 = icmp slt <16 x i32> %181, %255
%258 = sext <16 x i1> %256 to <16 x i8>
%259 = sext <16 x i1> %257 to <16 x i8>
%260 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 128
%261 = bitcast i8* %260 to <16 x i8>*
store <16 x i8> %258, <16 x i8>* %261
%262 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 144
%263 = bitcast i8* %262 to <16 x i8>*
store <16 x i8> %259, <16 x i8>* %263
%264 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 160
%265 = bitcast i8* %264 to <16 x i8>*
%266 = load <16 x i8>, <16 x i8>* %265
%267 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 176
%268 = bitcast i8* %267 to <16 x i8>*
%269 = load <16 x i8>, <16 x i8>* %268
%270 = zext <16 x i8> %266 to <16 x i32>
%271 = zext <16 x i8> %269 to <16 x i32>
%272 = icmp slt <16 x i32> %179, %270
%273 = icmp slt <16 x i32> %181, %271
%274 = sext <16 x i1> %272 to <16 x i8>
%275 = sext <16 x i1> %273 to <16 x i8>
%276 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 160
%277 = bitcast i8* %276 to <16 x i8>*
store <16 x i8> %274, <16 x i8>* %277
%278 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 176
%279 = bitcast i8* %278 to <16 x i8>*
store <16 x i8> %275, <16 x i8>* %279
%280 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 192
%281 = bitcast i8* %280 to <16 x i8>*
%282 = load <16 x i8>, <16 x i8>* %281
%283 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 208
%284 = bitcast i8* %283 to <16 x i8>*
%285 = load <16 x i8>, <16 x i8>* %284
%286 = zext <16 x i8> %282 to <16 x i32>
%287 = zext <16 x i8> %285 to <16 x i32>
%288 = icmp slt <16 x i32> %179, %286
%289 = icmp slt <16 x i32> %181, %287
%290 = sext <16 x i1> %288 to <16 x i8>
%291 = sext <16 x i1> %289 to <16 x i8>
%292 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 192
%293 = bitcast i8* %292 to <16 x i8>*
store <16 x i8> %290, <16 x i8>* %293
%294 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 208
%295 = bitcast i8* %294 to <16 x i8>*
store <16 x i8> %291, <16 x i8>* %295
%296 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 224
%297 = bitcast i8* %296 to <16 x i8>*
%298 = load <16 x i8>, <16 x i8>* %297
%299 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %3, i64 0, i64 %183, i64 240
%300 = bitcast i8* %299 to <16 x i8>*
%301 = load <16 x i8>, <16 x i8>* %300
%302 = zext <16 x i8> %298 to <16 x i32>
%303 = zext <16 x i8> %301 to <16 x i32>
%304 = icmp slt <16 x i32> %179, %302
%305 = icmp slt <16 x i32> %181, %303
%306 = sext <16 x i1> %304 to <16 x i8>
%307 = sext <16 x i1> %305 to <16 x i8>
%308 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 224
%309 = bitcast i8* %308 to <16 x i8>*
store <16 x i8> %306, <16 x i8>* %309
%310 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %4, i64 0, i64 %183, i64 240
%311 = bitcast i8* %310 to <16 x i8>*
store <16 x i8> %307, <16 x i8>* %311
%312 = add nuw nsw i64 %183, 1
%313 = icmp eq i64 %312, 256
br i1 %313, label %314, label %182
314: ; preds = %182
%315 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%316 = icmp eq i64 %315, 0
%317 = select i1 %316, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0)
%318 = call i32* @fopen(i8* %317, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%319 = call i32 @fprintf(i32* %318, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 0, i32 %177)
br label %333
320: ; preds = %333
%321 = call i32 @fclose(i32* %318)
%322 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%323 = icmp eq i64 %322, 0
%324 = select i1 %323, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0)
%325 = call i32* @fopen(i8* %324, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%326 = bitcast [256 x [256 x i8]]* %4 to i8**
%327 = call i32 @fwrite(i8** %326, i32 1, i32 65536, i32* %325)
%328 = call i32 @fclose(i32* %325)
%329 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%330 = icmp eq i64 %329, 0
%331 = select i1 %330, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0)
%332 = call i32 @system(i8* %331)
br label %341
333: ; preds = %314, %333
%334 = phi i64 [ 1, %314 ], [ %339, %333 ]
%335 = getelementptr inbounds [256 x i32], [256 x i32]* %9, i64 0, i64 %334
%336 = load i32, i32* %335
%337 = trunc i64 %334 to i32
%338 = call i32 @fprintf(i32* %318, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 %337, i32 %336)
%339 = add nuw nsw i64 %334, 1
%340 = icmp eq i64 %339, 256
br i1 %340, label %320, label %333
341: ; preds = %140, %320, %21, %17
ret i32 0
}