#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 /*<<< orphan*/ entab(int *);
int /*<<< orphan*/ settab(int, int, int *);
int main(int argc, char *argv[]) {
  int start = 0;
  int step = 8;
  while (--argc > 0) {
    char *s = *++argv;
    if (*s == '-') {
      start = atoi(++s);
    } else if (*s == '+') {
      step = atoi(++s);
    }
  }
  int tab[100];
  settab(start, step, tab);
  entab(tab);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    11d7 <main+0xa7>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11a9 <main+0x79>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x20(%rbp)
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    11d2 <main+0xa2>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    11cd <main+0x9d>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x20(%rbp)
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    11d2 <main+0xa2>
jmp    1157 <main+0x27>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
lea    -0x1b0(%rbp),%rdx
call   1030 <settab@plt>
lea    -0x1b0(%rbp),%rdi
call   1050 <entab@plt>
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x198,%rsp
cmp    $0x2,%edi
jl     1194 <main+0x64>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
add    $0x8,%rbx
xor    %r15d,%r15d
mov    $0x8,%r14d
jmp    1178 <main+0x48>
nopl   0x0(%rax)
add    $0x1,%rdi
call   1040 <atoi@plt>
mov    %eax,%r14d
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x2,%ebp
jbe    119d <main+0x6d>
mov    (%rbx),%rdi
movzbl (%rdi),%eax
cmp    $0x2b,%al
je     1160 <main+0x30>
cmp    $0x2d,%al
jne    116c <main+0x3c>
add    $0x1,%rdi
call   1040 <atoi@plt>
mov    %eax,%r15d
jmp    116c <main+0x3c>
mov    $0x8,%r14d
xor    %r15d,%r15d
mov    %rsp,%rbx
mov    %r15d,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1030 <settab@plt>
mov    %rbx,%rdi
call   1050 <entab@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [100 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 8, i32* %7
br label %10
10: ; preds = %36, %2
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %37
14: ; preds = %10
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %5
%17 = load i8*, i8** %16
store i8* %17, i8** %8
%18 = load i8*, i8** %8
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 45
br i1 %21, label %22, label %26
22: ; preds = %14
%23 = load i8*, i8** %8
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %8
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %6
br label %36
26: ; preds = %14
%27 = load i8*, i8** %8
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 43
br i1 %30, label %31, label %35
31: ; preds = %26
%32 = load i8*, i8** %8
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %8
%34 = call i32 @atoi(i8* %33)
store i32 %34, i32* %7
br label %35
35: ; preds = %31, %26
br label %36
36: ; preds = %35, %22
br label %10
37: ; preds = %10
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = getelementptr inbounds [100 x i32], [100 x i32]* %9, i64 0, i64 0
%41 = call i32 @settab(i32 %38, i32 %39, i32* %40)
%42 = getelementptr inbounds [100 x i32], [100 x i32]* %9, i64 0, i64 0
%43 = call i32 @entab(i32* %42)
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i32]
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %24
5: ; preds = %2, %20
%6 = phi i32 [ %10, %20 ], [ %0, %2 ]
%7 = phi i32 [ %22, %20 ], [ 8, %2 ]
%8 = phi i32 [ %21, %20 ], [ 0, %2 ]
%9 = phi i8** [ %11, %20 ], [ %1, %2 ]
%10 = add nsw i32 %6, -1
%11 = getelementptr inbounds i8*, i8** %9, i64 1
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
switch i8 %13, label %20 [
i8 45, label %14
i8 43, label %17
]
14: ; preds = %5
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = tail call i32 @atoi(i8* %15)
br label %20
17: ; preds = %5
%18 = getelementptr inbounds i8, i8* %12, i64 1
%19 = tail call i32 @atoi(i8* %18)
br label %20
20: ; preds = %5, %17, %14
%21 = phi i32 [ %16, %14 ], [ %8, %17 ], [ %8, %5 ]
%22 = phi i32 [ %7, %14 ], [ %19, %17 ], [ %7, %5 ]
%23 = icmp ugt i32 %6, 2
br i1 %23, label %5, label %24
24: ; preds = %20, %2
%25 = phi i32 [ 0, %2 ], [ %21, %20 ]
%26 = phi i32 [ 8, %2 ], [ %22, %20 ]
%27 = bitcast [100 x i32]* %3 to i8*
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%29 = call i32 @settab(i32 %25, i32 %26, i32* %28)
%30 = call i32 @entab(i32* %28)
ret i32 0
}