#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 BUFSIZ;
scalar_t__ EOF;
int atoi(char *);
int /*<<< orphan*/ err(int, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ putchar(char);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int len, count;
  register int i, j, fc, nc;
  char outbuf[BUFSIZ];
  setbuf(stdout, outbuf);
  if (argc >= 2)
    len = atoi(argv[1]);
  else
    len = 79;
  if (argc >= 3)
    count = atoi(argv[2]);
  else
    count = 200;
  fc = ' ';
  for (i = 0; i < count; i++) {
    if (++fc == 0177)
      fc = ' ';
    nc = fc;
    for (j = 0; j < len; j++) {
      if (putchar(nc) == EOF)
        err(1, "Write error");
      if (++nc == 0177)
        nc = ' ';
    }
    if (putchar('\n') == EOF)
      err(1, "Write error");
  }
  (void)fflush(stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e5b(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x38(%rbp)
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
call   1040 <setbuf@plt>
cmpl   $0x2,-0x8(%rbp)
jl     11cb <main+0x6b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    11d2 <main+0x72>
movl   $0x4f,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11f1 <main+0x91>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    11f8 <main+0x98>
movl   $0xc8,-0x18(%rbp)
movl   $0x20,-0x24(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    12da <main+0x17a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmp    $0x7f,%eax
jne    122b <main+0xcb>
movl   $0x20,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    129c <main+0x13c>
mov    -0x28(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    0x2d92(%rip),%rcx
cmp    (%rcx),%rax
jne    1270 <main+0x110>
mov    $0x1,%edi
lea    0xd95(%rip),%rsi
call   1050 <err@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmp    $0x7f,%eax
jne    1289 <main+0x129>
movl   $0x20,-0x28(%rbp)
jmp    128e <main+0x12e>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1238 <main+0xd8>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2d3b(%rip),%rcx
cmp    (%rcx),%rax
jne    12c7 <main+0x167>
mov    $0x1,%edi
lea    0xd3e(%rip),%rsi
call   1050 <err@plt>
jmp    12cc <main+0x16c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1206 <main+0xa6>
mov    0x2cef(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r12
mov    %edi,%ebx
mov    0x2e5b(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rsi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
call   1040 <setbuf@plt>
mov    $0x4f,%r15d
movl   $0xc8,-0x30(%rbp)
cmp    $0x2,%ebx
jl     11d7 <main+0x77>
mov    0x8(%r12),%rdi
call   1070 <atoi@plt>
mov    %eax,%r15d
cmp    $0x2,%ebx
je     11d7 <main+0x77>
mov    0x10(%r12),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x30(%rbp)
test   %eax,%eax
jle    1295 <main+0x135>
xor    %ebx,%ebx
mov    $0x20,%r13d
mov    0x2e02(%rip),%r14
movl   $0x20,-0x2c(%rbp)
mov    %r15d,-0x34(%rbp)
jmp    1210 <main+0xb0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
cmp    -0x30(%rbp),%ebx
mov    -0x34(%rbp),%r15d
je     1295 <main+0x135>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cmp    $0x7f,%eax
cmove  %r13d,%eax
mov    %eax,-0x2c(%rbp)
test   %r15d,%r15d
jle    1270 <main+0x110>
mov    -0x34(%rbp),%r12d
mov    -0x2c(%rbp),%r15d
jmp    1242 <main+0xe2>
nop
add    $0x1,%r15d
cmp    $0x7f,%r15d
cmove  %r13d,%r15d
add    $0xffffffff,%r12d
je     1270 <main+0x110>
movsbl %r15b,%edi
call   1030 <putchar@plt>
cmp    (%r14),%rax
jne    1230 <main+0xd0>
mov    $0x1,%edi
lea    0xda4(%rip),%rsi
call   1050 <err@plt>
jmp    1230 <main+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    (%r14),%rax
jne    1200 <main+0xa0>
mov    $0x1,%edi
lea    0xd75(%rip),%rsi
call   1050 <err@plt>
jmp    1200 <main+0xa0>
mov    0x2d34(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@BUFSIZ = global i32 0
@stdout = global i32 0
@EOF = global i64 0
@.str = [12 x i8] c"Write error\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* @BUFSIZ
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %12
%17 = alloca i8, i64 %15
store i64 %15, i64* %13
%18 = load i32, i32* @stdout
%19 = call i32 @setbuf(i32 %18, i8* %17)
%20 = load i32, i32* %4
%21 = icmp sge i32 %20, 2
br i1 %21, label %22, label %27
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
store i32 %26, i32* %6
br label %28
27: ; preds = %2
store i32 79, i32* %6
br label %28
28: ; preds = %27, %22
%29 = load i32, i32* %4
%30 = icmp sge i32 %29, 3
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %7
br label %37
36: ; preds = %28
store i32 200, i32* %7
br label %37
37: ; preds = %36, %31
store i32 32, i32* %10
store i32 0, i32* %8
br label %38
38: ; preds = %77, %37
%39 = load i32, i32* %8
%40 = load i32, i32* %7
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %80
42: ; preds = %38
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 1
store i32 %44, i32* %10
%45 = icmp eq i32 %44, 127
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 32, i32* %10
br label %47
47: ; preds = %46, %42
%48 = load i32, i32* %10
store i32 %48, i32* %11
store i32 0, i32* %9
br label %49
49: ; preds = %67, %47
%50 = load i32, i32* %9
%51 = load i32, i32* %6
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %70
53: ; preds = %49
%54 = load i32, i32* %11
%55 = trunc i32 %54 to i8
%56 = call i64 @putchar(i8 signext %55)
%57 = load i64, i64* @EOF
%58 = icmp eq i64 %56, %57
br i1 %58, label %59, label %61
59: ; preds = %53
%60 = call i32 @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %61
61: ; preds = %59, %53
%62 = load i32, i32* %11
%63 = add nsw i32 %62, 1
store i32 %63, i32* %11
%64 = icmp eq i32 %63, 127
br i1 %64, label %65, label %66
65: ; preds = %61
store i32 32, i32* %11
br label %66
66: ; preds = %65, %61
br label %67
67: ; preds = %66
%68 = load i32, i32* %9
%69 = add nsw i32 %68, 1
store i32 %69, i32* %9
br label %49
70: ; preds = %49
%71 = call i64 @putchar(i8 signext 10)
%72 = load i64, i64* @EOF
%73 = icmp eq i64 %71, %72
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = call i32 @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %76
76: ; preds = %74, %70
br label %77
77: ; preds = %76
%78 = load i32, i32* %8
%79 = add nsw i32 %78, 1
store i32 %79, i32* %8
br label %38
80: ; preds = %38
%81 = load i32, i32* @stdout
%82 = call i32 @fflush(i32 %81)
%83 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@stdout = global i32 0
@EOF = global i64 0
@.str = [12 x i8] c"Write error\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = load i32, i32* @stdout
%7 = call i32 @setbuf(i32 %6, i8* %5)
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = icmp eq i32 %0, 2
br i1 %13, label %19, label %14
14: ; preds = %9
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %53
19: ; preds = %2, %9, %14
%20 = phi i32 [ %17, %14 ], [ 200, %9 ], [ 200, %2 ]
%21 = phi i32 [ %12, %14 ], [ %12, %9 ], [ 79, %2 ]
%22 = icmp sgt i32 %21, 0
br label %23
23: ; preds = %19, %50
%24 = phi i32 [ 32, %19 ], [ %28, %50 ]
%25 = phi i32 [ 0, %19 ], [ %51, %50 ]
%26 = add nsw i32 %24, 1
%27 = icmp eq i32 %26, 127
%28 = select i1 %27, i32 32, i32 %26
br i1 %22, label %29, label %44
29: ; preds = %23, %38
%30 = phi i32 [ %41, %38 ], [ %28, %23 ]
%31 = phi i32 [ %42, %38 ], [ 0, %23 ]
%32 = trunc i32 %30 to i8
%33 = call i64 @putchar(i8 signext %32)
%34 = load i64, i64* @EOF
%35 = icmp eq i64 %33, %34
br i1 %35, label %36, label %38
36: ; preds = %29
%37 = call i32 @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %38
38: ; preds = %36, %29
%39 = add nsw i32 %30, 1
%40 = icmp eq i32 %39, 127
%41 = select i1 %40, i32 32, i32 %39
%42 = add nuw nsw i32 %31, 1
%43 = icmp eq i32 %42, %21
br i1 %43, label %44, label %29
44: ; preds = %38, %23
%45 = call i64 @putchar(i8 signext 10)
%46 = load i64, i64* @EOF
%47 = icmp eq i64 %45, %46
br i1 %47, label %48, label %50
48: ; preds = %44
%49 = call i32 @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %50
50: ; preds = %44, %48
%51 = add nuw nsw i32 %25, 1
%52 = icmp eq i32 %51, %20
br i1 %52, label %53, label %23
53: ; preds = %50, %14
%54 = load i32, i32* @stdout
%55 = call i32 @fflush(i32 %54)
%56 = call i32 @exit(i32 0)
unreachable
}