#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*/ detab(int, int);
int /*<<< orphan*/ printf(char *, char);
main(int argc, char *argv[]) {
  int start = 0, tab = 8;
  while (--argc > 0)
    switch (**++argv) {
    case '-':
      start = atoi(++*argv);
      break;
    case '+':
      tab = atoi(++*argv);
      break;
    default:
      printf("detab: illegal option %c\n", **argv);
      argc = 0;
      break;
    }
  detab(start, tab);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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    11f6 <main+0xc6>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x2b,%eax
je     11b9 <main+0x89>
jmp    118d <main+0x5d>
mov    -0x1c(%rbp),%eax
sub    $0x2d,%eax
jne    11d4 <main+0xa4>
jmp    119e <main+0x6e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
mov    %rdi,(%rax)
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    11f1 <main+0xc1>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
mov    %rdi,(%rax)
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    11f1 <main+0xc1>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
lea    0xe1e(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
jmp    1154 <main+0x24>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <detab@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     118c <main+0x5c>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x8,%rbx
xor    %r15d,%r15d
mov    $0x8,%r14d
jmp    116b <main+0x3b>
add    $0x1,%rdi
mov    %rdi,(%rbx)
call   1050 <atoi@plt>
mov    %eax,%r14d
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x1,%ebp
jbe    11a3 <main+0x73>
mov    (%rbx),%rdi
movsbl (%rdi),%esi
cmp    $0x2b,%esi
je     1150 <main+0x20>
cmp    $0x2d,%esi
jne    1197 <main+0x67>
add    $0x1,%rdi
mov    %rdi,(%rbx)
call   1050 <atoi@plt>
mov    %eax,%r15d
jmp    115f <main+0x2f>
mov    $0x8,%r14d
xor    %r15d,%r15d
jmp    11a3 <main+0x73>
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
mov    %r15d,%edi
mov    %r14d,%esi
call   1030 <detab@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"detab: illegal option %c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca 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 %8
8: ; preds = %33, %2
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %34
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %5
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
switch i32 %17, label %28 [
i32 45, label %18
i32 43, label %23
]
18: ; preds = %12
%19 = load i8**, i8*** %5
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %19
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %6
br label %33
23: ; preds = %12
%24 = load i8**, i8*** %5
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %24
%27 = call i32 @atoi(i8* %26)
store i32 %27, i32* %7
br label %33
28: ; preds = %12
%29 = load i8**, i8*** %5
%30 = load i8*, i8** %29
%31 = load i8, i8* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8 signext %31)
store i32 0, i32* %4
br label %33
33: ; preds = %28, %23, %18
br label %8
34: ; preds = %8
%35 = load i32, i32* %6
%36 = load i32, i32* %7
%37 = call i32 @detab(i32 %35, i32 %36)
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
@.str = [26 x i8] c"detab: illegal option %c\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %26
4: ; preds = %2, %22
%5 = phi i32 [ %9, %22 ], [ %0, %2 ]
%6 = phi i32 [ %24, %22 ], [ 8, %2 ]
%7 = phi i32 [ %23, %22 ], [ 0, %2 ]
%8 = phi i8** [ %10, %22 ], [ %1, %2 ]
%9 = add nsw i32 %5, -1
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
switch i32 %13, label %20 [
i32 45, label %14
i32 43, label %17
]
14: ; preds = %4
%15 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %15, i8** %10
%16 = tail call i32 @atoi(i8* %15)
br label %22
17: ; preds = %4
%18 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %18, i8** %10
%19 = tail call i32 @atoi(i8* %18)
br label %22
20: ; preds = %4
%21 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8 signext %12)
br label %26
22: ; preds = %17, %14
%23 = phi i32 [ %7, %17 ], [ %16, %14 ]
%24 = phi i32 [ %19, %17 ], [ %6, %14 ]
%25 = icmp ugt i32 %9, 1
br i1 %25, label %4, label %26
26: ; preds = %22, %20, %2
%27 = phi i32 [ 0, %2 ], [ %7, %20 ], [ %23, %22 ]
%28 = phi i32 [ 8, %2 ], [ %6, %20 ], [ %24, %22 ]
%29 = tail call i32 @detab(i32 %27, i32 %28)
ret i32 0
}