#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;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, const char *argv[]) {
  if (argc > 1) {
    printf("Usage: nope\n");
    return 1;
  }
  char str[] = "n\n";
  char buf[BUFSIZ];
  int i;
  for (i = 0; i < BUFSIZ; ++i)
    buf[i] = str[i % 2];
  for (;;)
    write(1, buf, BUFSIZ);
  return 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)
cmpl   $0x1,-0x8(%rbp)
jle    1156 <main+0x36>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
mov    %rbp,%rsp
pop    %rbp
ret
movb   $0x0,-0x12(%rbp)
movw   $0xa6e,-0x14(%rbp)
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2e43(%rip),%rcx
cmp    (%rcx),%eax
jge    11d0 <main+0xb0>
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x38(%rbp),%rax
movslq %edx,%rcx
mov    -0x14(%rbp,%rcx,1),%dl
movslq -0x2c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1193 <main+0x73>
jmp    11d5 <main+0xb5>
mov    -0x38(%rbp),%rsi
mov    0x2e00(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    11d5 <main+0xb5>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1146 <main+0x26>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    0x2e93(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
test   %edx,%edx
jle    11c0 <main+0xa0>
lea    -0x1(%rdx),%rcx
mov    %edx,%esi
and    $0x3,%esi
cmp    $0x3,%rcx
jae    1178 <main+0x58>
xor    %ecx,%ecx
jmp    1190 <main+0x70>
mov    %edx,%eax
and    $0xfffffffc,%eax
xor    %ecx,%ecx
nop
movl   $0xa6e0a6e,(%rbx,%rcx,1)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    1180 <main+0x60>
test   %rsi,%rsi
je     11c0 <main+0xa0>
lea    0xe64(%rip),%r8
nopl   0x0(%rax)
mov    %ecx,%edi
and    $0x1,%edi
movzbl (%rdi,%r8,1),%eax
mov    %al,(%rbx,%rcx,1)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    11a0 <main+0x80>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <write@plt>
mov    (%r14),%edx
jmp    11c0 <main+0xa0>

LLVM IR (-O0):
@.str = [13 x i8] c"Usage: nope\0A\00"
@__const.main.str = [3 x i8] c"n\0A\00"
@BUFSIZ = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i8]
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 1
14: ; preds = %2
%15 = bitcast [3 x i8]* %6 to i8*
%16 = load i32, i32* @BUFSIZ
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %7
%19 = alloca i8, i64 %17
store i64 %17, i64* %8
store i32 0, i32* %9
br label %20
20: ; preds = %33, %14
%21 = load i32, i32* %9
%22 = load i32, i32* @BUFSIZ
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %36
24: ; preds = %20
%25 = load i32, i32* %9
%26 = srem i32 %25, 2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %19, i64 %31
store i8 %29, i8* %32
br label %33
33: ; preds = %24
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %20
36: ; preds = %20
br label %37
37: ; preds = %37, %36
%38 = load i32, i32* @BUFSIZ
%39 = call i32 @write(i32 1, i8* %19, i32 %38)
br label %37
}

LLVM IR (-O2):
@__const.main.str = [3 x i8] c"n\0A\00"
@BUFSIZ = global i32 0
@str = [12 x i8] c"Usage: nope\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 1
6: ; preds = %2
%7 = load i32, i32* @BUFSIZ
%8 = zext i32 %7 to i64
%9 = alloca i8, i64 %8
%10 = icmp sgt i32 %7, 0
br i1 %10, label %11, label %43
11: ; preds = %6
%12 = add nsw i64 %8, -1
%13 = and i64 %8, 3
%14 = icmp ult i64 %12, 3
br i1 %14, label %30, label %15
15: ; preds = %11
%16 = and i64 %8, 4294967292
br label %17
17: ; preds = %17, %15
%18 = phi i64 [ 0, %15 ], [ %27, %17 ]
%19 = phi i64 [ 0, %15 ], [ %28, %17 ]
%20 = getelementptr inbounds i8, i8* %9, i64 %18
store i8 110, i8* %20
%21 = or i64 %18, 1
%22 = getelementptr inbounds i8, i8* %9, i64 %21
store i8 10, i8* %22
%23 = or i64 %18, 2
%24 = getelementptr inbounds i8, i8* %9, i64 %23
store i8 110, i8* %24
%25 = or i64 %18, 3
%26 = getelementptr inbounds i8, i8* %9, i64 %25
store i8 10, i8* %26
%27 = add nuw nsw i64 %18, 4
%28 = add i64 %19, 4
%29 = icmp eq i64 %28, %16
br i1 %29, label %30, label %17
30: ; preds = %17, %11
%31 = phi i64 [ 0, %11 ], [ %27, %17 ]
%32 = icmp eq i64 %13, 0
br i1 %32, label %43, label %33
33: ; preds = %30, %33
%34 = phi i64 [ %40, %33 ], [ %31, %30 ]
%35 = phi i64 [ %41, %33 ], [ 0, %30 ]
%36 = and i64 %34, 1
%37 = getelementptr inbounds [3 x i8], [3 x i8]* @__const.main.str, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = getelementptr inbounds i8, i8* %9, i64 %34
store i8 %38, i8* %39
%40 = add nuw nsw i64 %34, 1
%41 = add i64 %35, 1
%42 = icmp eq i64 %41, %13
br i1 %42, label %43, label %33
43: ; preds = %30, %33, %6
br label %44
44: ; preds = %43, %44
%45 = phi i32 [ %47, %44 ], [ %7, %43 ]
%46 = call i32 @write(i32 1, i8* %9, i32 %45)
%47 = load i32, i32* @BUFSIZ
br label %44
}