#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 EOF;
int /*<<< orphan*/ entab(int, int, int);
int getchar();
int set_detab_start_column(int, char **);
int set_tab_stop(int, char **);
int main(int argc, char *argv[]) {
  int place_holder;
  int start_column = ((place_holder = set_detab_start_column(argc, argv)) > 0)
                         ? place_holder
                         : 0;
  int tab_stop =
      ((place_holder = set_tab_stop(argc, argv)) > 0) ? place_holder : 8;
  int character;
  while ((character = getchar()) != EOF)
    entab(character, start_column, tab_stop);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <set_detab_start_column@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    1179 <main+0x39>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1183 <main+0x43>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1183 <main+0x43>
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <set_tab_stop@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    11ac <main+0x6c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    11b9 <main+0x79>
mov    $0x8,%eax
mov    %eax,-0x28(%rbp)
jmp    11b9 <main+0x79>
mov    -0x28(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e18(%rip),%rcx
cmp    (%rcx),%eax
je     11eb <main+0xab>
mov    -0x20(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1060 <entab@plt>
jmp    11bf <main+0x7f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1050 <set_detab_start_column@plt>
mov    %eax,%ebx
xor    %eax,%eax
test   %ebx,%ebx
cmovs  %eax,%ebx
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <set_tab_stop@plt>
test   %eax,%eax
mov    $0x8,%ebp
cmovg  %eax,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2e6f(%rip),%r14
cmp    (%r14),%eax
je     1197 <main+0x57>
xchg   %ax,%ax
mov    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
call   1060 <entab@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1180 <main+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @set_detab_start_column(i32 %10, i8** %11)
store i32 %12, i32* %6
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i32, i32* %6
br label %17
16: ; preds = %2
br label %17
17: ; preds = %16, %14
%18 = phi i32 [ %15, %14 ], [ 0, %16 ]
store i32 %18, i32* %7
%19 = load i32, i32* %4
%20 = load i8**, i8*** %5
%21 = call i32 @set_tab_stop(i32 %19, i8** %20)
store i32 %21, i32* %6
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = load i32, i32* %6
br label %26
25: ; preds = %17
br label %26
26: ; preds = %25, %23
%27 = phi i32 [ %24, %23 ], [ 8, %25 ]
store i32 %27, i32* %8
br label %28
28: ; preds = %32, %26
%29 = call i32 (...) @getchar()
store i32 %29, i32* %9
%30 = load i32, i32* @EOF
%31 = icmp ne i32 %29, %30
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = load i32, i32* %9
%34 = load i32, i32* %7
%35 = load i32, i32* %8
%36 = call i32 @entab(i32 %33, i32 %34, i32 %35)
br label %28
37: ; preds = %28
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @set_detab_start_column(i32 %0, i8** %1)
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
%6 = tail call i32 @set_tab_stop(i32 %0, i8** %1)
%7 = icmp sgt i32 %6, 0
%8 = select i1 %7, i32 %6, i32 8
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %18, label %12
12: ; preds = %2, %12
%13 = phi i32 [ %15, %12 ], [ %9, %2 ]
%14 = tail call i32 @entab(i32 %13, i32 %5, i32 %8)
%15 = tail call i32 (...) @getchar()
%16 = load i32, i32* @EOF
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %12
18: ; preds = %12, %2
ret i32 0
}