#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 uint64_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(int);
unsigned int strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  uint64_t divs[] = {1,   2,   4,   5,    8,    10,   16,   20,  25,  32,
                     40,  50,  64,  80,   100,  125,  160,  200, 250, 320,
                     400, 500, 800, 1000, 1600, 2000, 4000, 8000};
  if (argc != 3)
    exit(EXIT_FAILURE);
  unsigned halfwidth = strtol(argv[1], NULL, 10);
  unsigned cycles = strtol(argv[2], NULL, 10);
  for (unsigned cycle = 0; cycle < cycles; cycle++) {
    for (unsigned i = 0; i < halfwidth; i++)
      putchar(255);
    for (unsigned i = 0; i < halfwidth; i++)
      putchar(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x70,%edx
call   1050 <memcpy@plt>
cmpl   $0x3,-0x8(%rbp)
je     1186 <main+0x46>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x84(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x88(%rbp)
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x88(%rbp),%eax
jae    1264 <main+0x124>
movl   $0x0,-0x90(%rbp)
mov    -0x90(%rbp),%eax
cmp    -0x84(%rbp),%eax
jae    1214 <main+0xd4>
mov    $0xff,%edi
call   1030 <putchar@plt>
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    11e4 <main+0xa4>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x84(%rbp),%eax
jae    124b <main+0x10b>
xor    %edi,%edi
call   1030 <putchar@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    121e <main+0xde>
jmp    1250 <main+0x110>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    11c8 <main+0x88>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x3,%edi
jne    11bb <main+0x8b>
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
xor    %ebp,%ebp
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%r15d
mov    0x10(%r14),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
test   %eax,%eax
je     11ae <main+0x7e>
mov    %eax,%r14d
jmp    1178 <main+0x48>
nopl   (%rax)
add    $0x1,%ebp
cmp    %r14d,%ebp
je     11ae <main+0x7e>
mov    %r15d,%ebx
test   %r15d,%r15d
je     1170 <main+0x40>
mov    $0xff,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1180 <main+0x50>
mov    %r15d,%ebx
test   %r15d,%r15d
je     1170 <main+0x40>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11a0 <main+0x70>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@__const.main.divs = [28 x i32] [i32 1, i32 2, i32 4, i32 5, i32 8, i32 10, i32 16, i32 20, i32 25, i32 32, i32 40, i32 50, i32 64, i32 80, i32 100, i32 125, i32 160, i32 200, i32 250, i32 320, i32 400, i32 500, i32 800, i32 1000, i32 1600, i32 2000, i32 4000, i32 8000]
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [28 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [28 x i32]* %6 to i8*
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @strtol(i8* %21, i32* null, i32 10)
store i32 %22, i32* %7
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @strtol(i8* %25, i32* null, i32 10)
store i32 %26, i32* %8
store i32 0, i32* %9
br label %27
27: ; preds = %52, %18
%28 = load i32, i32* %9
%29 = load i32, i32* %8
%30 = icmp ult i32 %28, %29
br i1 %30, label %31, label %55
31: ; preds = %27
store i32 0, i32* %10
br label %32
32: ; preds = %38, %31
%33 = load i32, i32* %10
%34 = load i32, i32* %7
%35 = icmp ult i32 %33, %34
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = call i32 @putchar(i32 255)
br label %38
38: ; preds = %36
%39 = load i32, i32* %10
%40 = add i32 %39, 1
store i32 %40, i32* %10
br label %32
41: ; preds = %32
store i32 0, i32* %11
br label %42
42: ; preds = %48, %41
%43 = load i32, i32* %11
%44 = load i32, i32* %7
%45 = icmp ult i32 %43, %44
br i1 %45, label %46, label %51
46: ; preds = %42
%47 = call i32 @putchar(i32 0)
br label %48
48: ; preds = %46
%49 = load i32, i32* %11
%50 = add i32 %49, 1
store i32 %50, i32* %11
br label %42
51: ; preds = %42
br label %52
52: ; preds = %51
%53 = load i32, i32* %9
%54 = add i32 %53, 1
store i32 %54, i32* %9
br label %27
55: ; preds = %27
ret i32 0
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strtol(i8* nocapture %9, i32* null, i32 10)
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @strtol(i8* nocapture %12, i32* null, i32 10)
%14 = icmp eq i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %7
%16 = icmp eq i32 %10, 0
br label %17
17: ; preds = %15, %26
%18 = phi i32 [ 0, %15 ], [ %27, %26 ]
br i1 %16, label %26, label %21
19: ; preds = %26, %7
ret i32 0
20: ; preds = %21
br i1 %16, label %26, label %29
21: ; preds = %17, %21
%22 = phi i32 [ %24, %21 ], [ 0, %17 ]
%23 = tail call i32 @putchar(i32 255)
%24 = add nuw i32 %22, 1
%25 = icmp eq i32 %24, %10
br i1 %25, label %20, label %21
26: ; preds = %29, %17, %20
%27 = add nuw i32 %18, 1
%28 = icmp eq i32 %27, %13
br i1 %28, label %19, label %17
29: ; preds = %20, %29
%30 = phi i32 [ %32, %29 ], [ 0, %20 ]
%31 = tail call i32 @putchar(i32 0)
%32 = add nuw i32 %30, 1
%33 = icmp eq i32 %32, %10
br i1 %33, label %26, label %29
}