#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 atoi(char *);
int myGetline(char *, int);
int /*<<< orphan*/ printf(char *, ...);
main(int argc, char *argv[]) {
  int c, len;
  int i;
  char line[1000];
  int tabstop;
  int spaceCount;
  if (argc == 1)
    tabstop = 8;
  else if (argc == 2)
    tabstop = atoi(*++argv);
  else {
    printf("Usage entab (8)(tabstop)\n");
    return 1;
  }
  while ((len = myGetline(line, 1000)) > 0) {
    spaceCount = 0;
    for (i = 0; i < len; ++i) {
      if (line[i] == ' ')
        spaceCount++;
      else
        spaceCount = 0;
      if (spaceCount == tabstop) {
      }
    }
    printf("%s", line);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1162 <main+0x32>
movl   $0x8,-0x414(%rbp)
jmp    11ae <main+0x7e>
cmpl   $0x2,-0x8(%rbp)
jne    118f <main+0x5f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x414(%rbp)
jmp    11a9 <main+0x79>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1264 <main+0x134>
jmp    11ae <main+0x7e>
jmp    11b3 <main+0x83>
lea    -0x410(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <myGetline@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jle    1264 <main+0x134>
movl   $0x0,-0x418(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    124a <main+0x11a>
movslq -0x1c(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    1216 <main+0xe6>
mov    -0x418(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x418(%rbp)
jmp    1220 <main+0xf0>
movl   $0x0,-0x418(%rbp)
mov    -0x418(%rbp),%eax
cmp    -0x414(%rbp),%eax
jne    1237 <main+0x107>
jmp    1237 <main+0x107>
jmp    123c <main+0x10c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e1 <main+0xb1>
lea    -0x410(%rbp),%rsi
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b3 <main+0x83>
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x3f0,%rsp
add    $0xffffffff,%edi
cmp    $0x1,%edi
ja     1190 <main+0x60>
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <myGetline@plt>
test   %eax,%eax
jle    11a3 <main+0x73>
lea    0xea4(%rip),%r14
mov    %rsp,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    $0x3e8,%esi
call   1050 <myGetline@plt>
test   %eax,%eax
jg     1170 <main+0x40>
jmp    11a5 <main+0x75>
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
jmp    11a5 <main+0x75>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x3f0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Usage entab (8)(tabstop)\0A\00"
@.str.1 = [3 x i8] c"%s\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 [1000 x i8]
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 8, i32* %10
br label %26
15: ; preds = %2
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i32 1
store i8** %20, i8*** %5
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %10
br label %25
23: ; preds = %15
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %59
25: ; preds = %18
br label %26
26: ; preds = %25, %14
br label %27
27: ; preds = %56, %26
%28 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%29 = call i32 @myGetline(i8* %28, i32 1000)
store i32 %29, i32* %7
%30 = icmp sgt i32 %29, 0
br i1 %30, label %31, label %59
31: ; preds = %27
store i32 0, i32* %11
store i32 0, i32* %8
br label %32
32: ; preds = %53, %31
%33 = load i32, i32* %8
%34 = load i32, i32* %7
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %56
36: ; preds = %32
%37 = load i32, i32* %8
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 32
br i1 %42, label %43, label %46
43: ; preds = %36
%44 = load i32, i32* %11
%45 = add nsw i32 %44, 1
store i32 %45, i32* %11
br label %47
46: ; preds = %36
store i32 0, i32* %11
br label %47
47: ; preds = %46, %43
%48 = load i32, i32* %11
%49 = load i32, i32* %10
%50 = icmp eq i32 %48, %49
br i1 %50, label %51, label %52
51: ; preds = %47
br label %52
52: ; preds = %51, %47
br label %53
53: ; preds = %52
%54 = load i32, i32* %8
%55 = add nsw i32 %54, 1
store i32 %55, i32* %8
br label %32
56: ; preds = %32
%57 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %57)
br label %27
59: ; preds = %23, %27
%60 = load i32, i32* %3
ret i32 %60
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [25 x i8] c"Usage entab (8)(tabstop)\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = add i32 %0, -1
%6 = icmp ult i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @myGetline(i8* %4, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %12, label %16
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %16
12: ; preds = %7, %12
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%14 = call i32 @myGetline(i8* %4, i32 1000)
%15 = icmp sgt i32 %14, 0
br i1 %15, label %12, label %16
16: ; preds = %12, %7, %10
%17 = phi i32 [ 1, %10 ], [ 0, %7 ], [ 0, %12 ]
ret i32 %17
}