#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ dumparray(char *, unsigned char *);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
main() {
  unsigned char runs[2][256];
  memset(runs[0], 0, 256 * sizeof(char));
  memset(runs[1], 0, 256 * sizeof(char));
  {
    register int run, runlen, i;
    runlen = 1;
    for (run = 0x80; run != 0xff; run = (run >> 1) | 0x80) {
      for (i = run - 1; i >= 0; i--) {
        runs[1][run | i] = runlen;
        runs[0][(~(run | i)) & 0xff] = runlen;
      }
      runlen++;
    }
    runs[1][0xff] = runs[0][0] = 8;
  }
  dumparray("bruns", runs[0]);
  dumparray("wruns", runs[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
lea    -0x210(%rbp),%rdi
add    $0x100,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
movl   $0x1,-0x218(%rbp)
movl   $0x80,-0x214(%rbp)
cmpl   $0xff,-0x214(%rbp)
je     121d <main+0xfd>
mov    -0x214(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x21c(%rbp)
cmpl   $0x0,-0x21c(%rbp)
jl     11f5 <main+0xd5>
mov    -0x218(%rbp),%eax
mov    %al,%cl
mov    -0x214(%rbp),%eax
or     -0x21c(%rbp),%eax
cltq
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x218(%rbp),%eax
mov    %al,%cl
mov    -0x214(%rbp),%eax
or     -0x21c(%rbp),%eax
xor    $0xffffffff,%eax
and    $0xff,%eax
cltq
mov    %cl,-0x210(%rbp,%rax,1)
mov    -0x21c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x21c(%rbp)
jmp    1192 <main+0x72>
mov    -0x218(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x218(%rbp)
mov    -0x214(%rbp),%eax
sar    $0x1,%eax
or     $0x80,%eax
mov    %eax,-0x214(%rbp)
jmp    1173 <main+0x53>
movb   $0x8,-0x210(%rbp)
movb   $0x8,-0x11(%rbp)
lea    -0x210(%rbp),%rsi
lea    0xdca(%rip),%rdi
call   1040 <dumparray@plt>
lea    -0x210(%rbp),%rsi
add    $0x100,%rsi
lea    0xdb6(%rip),%rdi
call   1040 <dumparray@plt>
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
lea    0x100(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
mov    $0x7e,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rax),%ecx
movslq %ecx,%rdx
or     $0x80,%rdx
movb   $0x1,0x100(%rsp,%rdx,1)
01
xor    $0x7f,%rcx
movb   $0x1,(%rsp,%rcx,1)
cltq
mov    %rax,%rcx
or     $0x80,%rcx
movb   $0x1,0x100(%rsp,%rcx,1)
01
mov    %eax,%ecx
xor    $0x7f,%rcx
movb   $0x1,(%rsp,%rcx,1)
add    $0xfffffffe,%eax
cmp    $0xfffffffe,%eax
jne    1160 <main+0x40>
mov    $0xbe,%eax
nopl   0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
movslq %ecx,%rcx
mov    %rcx,%rdx
or     $0xc0,%rdx
movb   $0x2,0x100(%rsp,%rdx,1)
02
and    $0x3e,%ecx
xor    $0x3e,%rcx
movb   $0x2,(%rsp,%rcx,1)
cltq
mov    %rax,%rcx
or     $0xc0,%rcx
movb   $0x2,0x100(%rsp,%rcx,1)
02
mov    %eax,%ecx
and    $0x3e,%ecx
xor    $0x3f,%rcx
movb   $0x2,(%rsp,%rcx,1)
add    $0xfffffffe,%eax
cmp    $0xfffffffe,%eax
jne    11b0 <main+0x90>
mov    $0xde,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
movslq %ecx,%rcx
mov    %rcx,%rdx
or     $0xe0,%rdx
movb   $0x3,0x100(%rsp,%rdx,1)
03
and    $0x1e,%ecx
xor    $0x1e,%rcx
movb   $0x3,(%rsp,%rcx,1)
cltq
mov    %rax,%rcx
or     $0xe0,%rcx
movb   $0x3,0x100(%rsp,%rcx,1)
03
mov    %eax,%ecx
and    $0x1e,%ecx
xor    $0x1f,%rcx
movb   $0x3,(%rsp,%rcx,1)
add    $0xfffffffe,%eax
cmp    $0xfffffffe,%eax
jne    1210 <main+0xf0>
mov    $0xee,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
movslq %ecx,%rcx
mov    %rcx,%rdx
or     $0xf0,%rdx
movb   $0x4,0x100(%rsp,%rdx,1)
04
and    $0xe,%ecx
xor    $0xe,%rcx
movb   $0x4,(%rsp,%rcx,1)
cltq
mov    %rax,%rcx
or     $0xf0,%rcx
movb   $0x4,0x100(%rsp,%rcx,1)
04
mov    %eax,%ecx
and    $0xe,%ecx
xor    $0xf,%rcx
movb   $0x4,(%rsp,%rcx,1)
add    $0xfffffffe,%eax
cmp    $0xfffffffe,%eax
jne    1270 <main+0x150>
mov    $0xf6,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
movslq %ecx,%rcx
mov    %rcx,%rdx
or     $0xf8,%rdx
movb   $0x5,0x100(%rsp,%rdx,1)
05
and    $0x6,%ecx
xor    $0x6,%rcx
movb   $0x5,(%rsp,%rcx,1)
cltq
mov    %rax,%rcx
or     $0xf8,%rcx
movb   $0x5,0x100(%rsp,%rcx,1)
05
mov    %eax,%ecx
and    $0x6,%ecx
xor    $0x7,%rcx
movb   $0x5,(%rsp,%rcx,1)
add    $0xfffffffe,%eax
cmp    $0xfffffffe,%eax
jne    12d0 <main+0x1b0>
mov    $0xfa,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
movslq %ecx,%rcx
mov    %rcx,%rdx
or     $0xfc,%rdx
movb   $0x6,0x100(%rsp,%rdx,1)
06
and    $0x2,%ecx
xor    $0x2,%rcx
movb   $0x6,(%rsp,%rcx,1)
cltq
mov    %rax,%rcx
or     $0xfc,%rcx
movb   $0x6,0x100(%rsp,%rcx,1)
06
mov    %eax,%ecx
and    $0x2,%ecx
xor    $0x3,%rcx
movb   $0x6,(%rsp,%rcx,1)
add    $0xfffffffe,%eax
cmp    $0xfffffffe,%eax
jne    1330 <main+0x210>
mov    $0xfc,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rax),%ecx
movslq %ecx,%rcx
or     $0xfe,%rcx
movb   $0x7,0x100(%rsp,%rcx,1)
07
movb   $0x7,(%rsp)
cltq
mov    %rax,%rcx
or     $0xfe,%rcx
movb   $0x7,0x100(%rsp,%rcx,1)
07
movb   $0x7,0x1(%rsp)
add    $0xfffffffe,%eax
cmp    $0xfffffffe,%eax
jne    1390 <main+0x270>
movb   $0x8,(%rsp)
movb   $0x8,0x1ff(%rsp)
08
lea    0xc23(%rip),%rdi
mov    %rsp,%rsi
call   1040 <dumparray@plt>
lea    0xc1a(%rip),%rdi
mov    %rbx,%rsi
call   1040 <dumparray@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"bruns\00"
@.str.1 = [6 x i8] c"wruns\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [256 x i8]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %2, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%8 = call i32 @memset(i8* %7, i32 0, i32 256)
%9 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %2, i64 0, i64 1
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%11 = call i32 @memset(i8* %10, i32 0, i32 256)
store i32 1, i32* %4
store i32 128, i32* %3
br label %12
12: ; preds = %46, %0
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 255
br i1 %14, label %15, label %50
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 1
store i32 %17, i32* %5
br label %18
18: ; preds = %40, %15
%19 = load i32, i32* %5
%20 = icmp sge i32 %19, 0
br i1 %20, label %21, label %43
21: ; preds = %18
%22 = load i32, i32* %4
%23 = trunc i32 %22 to i8
%24 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %2, i64 0, i64 1
%25 = load i32, i32* %3
%26 = load i32, i32* %5
%27 = or i32 %25, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %24, i64 0, i64 %28
store i8 %23, i8* %29
%30 = load i32, i32* %4
%31 = trunc i32 %30 to i8
%32 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %2, i64 0, i64 0
%33 = load i32, i32* %3
%34 = load i32, i32* %5
%35 = or i32 %33, %34
%36 = xor i32 %35, -1
%37 = and i32 %36, 255
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %32, i64 0, i64 %38
store i8 %31, i8* %39
br label %40
40: ; preds = %21
%41 = load i32, i32* %5
%42 = add nsw i32 %41, -1
store i32 %42, i32* %5
br label %18
43: ; preds = %18
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
store i32 %45, i32* %4
br label %46
46: ; preds = %43
%47 = load i32, i32* %3
%48 = ashr i32 %47, 1
%49 = or i32 %48, 128
store i32 %49, i32* %3
br label %12
50: ; preds = %12
%51 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %2, i64 0, i64 0
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %51, i64 0, i64 0
store i8 8, i8* %52
%53 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %2, i64 0, i64 1
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %53, i64 0, i64 255
store i8 8, i8* %54
%55 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %2, i64 0, i64 0
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %55, i64 0, i64 0
%57 = call i32 @dumparray(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %56)
%58 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %2, i64 0, i64 1
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %58, i64 0, i64 0
%60 = call i32 @dumparray(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %59)
%61 = load i32, i32* %1
ret i32 %61
}

LLVM IR (-O2):
@.str = [6 x i8] c"bruns\00"
@.str.1 = [6 x i8] c"wruns\00"
define i32 @main() {
%1 = alloca [2 x [256 x i8]]
%2 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 256)
%4 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 256)
br label %6
6: ; preds = %6, %0
%7 = phi i32 [ 128, %0 ], [ %15, %6 ]
%8 = add nsw i32 %7, -1
%9 = or i32 %8, 128
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %10
store i8 1, i8* %11
%12 = xor i32 %8, 127
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %13
store i8 1, i8* %14
%15 = add nsw i32 %7, -2
%16 = or i32 %15, 128
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %17
store i8 1, i8* %18
%19 = xor i32 %15, 127
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %20
store i8 1, i8* %21
%22 = icmp eq i32 %8, 1
br i1 %22, label %23, label %6
23: ; preds = %6, %23
%24 = phi i32 [ %33, %23 ], [ 192, %6 ]
%25 = add nsw i32 %24, -1
%26 = or i32 %25, 192
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %27
store i8 2, i8* %28
%29 = and i32 %25, 62
%30 = xor i32 %29, 62
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %31
store i8 2, i8* %32
%33 = add nsw i32 %24, -2
%34 = or i32 %33, 192
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %35
store i8 2, i8* %36
%37 = and i32 %33, 62
%38 = xor i32 %37, 63
%39 = zext i32 %38 to i64
%40 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %39
store i8 2, i8* %40
%41 = icmp eq i32 %25, 1
br i1 %41, label %42, label %23
42: ; preds = %23, %42
%43 = phi i32 [ %52, %42 ], [ 224, %23 ]
%44 = add nsw i32 %43, -1
%45 = or i32 %44, 224
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %46
store i8 3, i8* %47
%48 = and i32 %44, 30
%49 = xor i32 %48, 30
%50 = zext i32 %49 to i64
%51 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %50
store i8 3, i8* %51
%52 = add nsw i32 %43, -2
%53 = or i32 %52, 224
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %54
store i8 3, i8* %55
%56 = and i32 %52, 30
%57 = xor i32 %56, 31
%58 = zext i32 %57 to i64
%59 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %58
store i8 3, i8* %59
%60 = icmp eq i32 %44, 1
br i1 %60, label %61, label %42
61: ; preds = %42, %61
%62 = phi i32 [ %71, %61 ], [ 240, %42 ]
%63 = add nsw i32 %62, -1
%64 = or i32 %63, 240
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %65
store i8 4, i8* %66
%67 = and i32 %63, 14
%68 = xor i32 %67, 14
%69 = zext i32 %68 to i64
%70 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %69
store i8 4, i8* %70
%71 = add nsw i32 %62, -2
%72 = or i32 %71, 240
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %73
store i8 4, i8* %74
%75 = and i32 %71, 14
%76 = xor i32 %75, 15
%77 = zext i32 %76 to i64
%78 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %77
store i8 4, i8* %78
%79 = icmp eq i32 %63, 1
br i1 %79, label %80, label %61
80: ; preds = %61, %80
%81 = phi i32 [ %90, %80 ], [ 248, %61 ]
%82 = add nsw i32 %81, -1
%83 = or i32 %82, 248
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %84
store i8 5, i8* %85
%86 = and i32 %82, 6
%87 = xor i32 %86, 6
%88 = zext i32 %87 to i64
%89 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %88
store i8 5, i8* %89
%90 = add nsw i32 %81, -2
%91 = or i32 %90, 248
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %92
store i8 5, i8* %93
%94 = and i32 %90, 6
%95 = xor i32 %94, 7
%96 = zext i32 %95 to i64
%97 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %96
store i8 5, i8* %97
%98 = icmp eq i32 %82, 1
br i1 %98, label %99, label %80
99: ; preds = %80, %99
%100 = phi i32 [ %109, %99 ], [ 252, %80 ]
%101 = add nsw i32 %100, -1
%102 = or i32 %101, 252
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %103
store i8 6, i8* %104
%105 = and i32 %101, 2
%106 = xor i32 %105, 2
%107 = zext i32 %106 to i64
%108 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %107
store i8 6, i8* %108
%109 = add nsw i32 %100, -2
%110 = or i32 %109, 252
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %111
store i8 6, i8* %112
%113 = and i32 %109, 2
%114 = xor i32 %113, 3
%115 = zext i32 %114 to i64
%116 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 %115
store i8 6, i8* %116
%117 = icmp eq i32 %101, 1
br i1 %117, label %118, label %99
118: ; preds = %99
%119 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 0
%120 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 0, i64 1
br label %121
121: ; preds = %121, %118
%122 = phi i32 [ 254, %118 ], [ %127, %121 ]
%123 = add nsw i32 %122, -1
%124 = or i32 %123, 254
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %125
store i8 7, i8* %126
store i8 7, i8* %119
%127 = add nsw i32 %122, -2
%128 = or i32 %127, 254
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 %129
store i8 7, i8* %130
store i8 7, i8* %120
%131 = icmp eq i32 %123, 1
br i1 %131, label %132, label %121
132: ; preds = %121
store i8 8, i8* %2
%133 = getelementptr inbounds [2 x [256 x i8]], [2 x [256 x i8]]* %1, i64 0, i64 1, i64 255
store i8 8, i8* %133
%134 = call i32 @dumparray(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%135 = call i32 @dumparray(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}