#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*/ tail(int);
int main(int argc, char *argv[]) {
  int n = 10;
  while (--argc > 0) {
    char *arg = *++argv;
    if (*arg == '-') {
      n = atoi(++arg);
    }
  }
  tail(n);
}


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   $0xa,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    118f <main+0x6f>
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    118a <main+0x6a>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x20(%rbp)
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    -0x14(%rbp),%edi
call   1030 <tail@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0xa,%eax
cmp    $0x2,%edi
jl     115f <main+0x3f>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
add    $0x8,%rbx
mov    $0xa,%eax
jmp    114c <main+0x2c>
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x2,%ebp
jbe    115f <main+0x3f>
mov    (%rbx),%rdi
cmpb   $0x2d,(%rdi)
jne    1140 <main+0x20>
add    $0x1,%rdi
call   1040 <atoi@plt>
jmp    1140 <main+0x20>
mov    %eax,%edi
call   1030 <tail@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
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 i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
br label %8
8: ; preds = %24, %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 %25
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
store i8* %15, i8** %7
%16 = load i8*, i8** %7
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 45
br i1 %19, label %20, label %24
20: ; preds = %12
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %7
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %6
br label %24
24: ; preds = %20, %12
br label %8
25: ; preds = %8
%26 = load i32, i32* %6
%27 = call i32 @tail(i32 %26)
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %19
4: ; preds = %2, %16
%5 = phi i32 [ %8, %16 ], [ %0, %2 ]
%6 = phi i32 [ %17, %16 ], [ 10, %2 ]
%7 = phi i8** [ %9, %16 ], [ %1, %2 ]
%8 = add nsw i32 %5, -1
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 45
br i1 %12, label %13, label %16
13: ; preds = %4
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = tail call i32 @atoi(i8* %14)
br label %16
16: ; preds = %13, %4
%17 = phi i32 [ %15, %13 ], [ %6, %4 ]
%18 = icmp ugt i32 %5, 2
br i1 %18, label %4, label %19
19: ; preds = %16, %2
%20 = phi i32 [ 10, %2 ], [ %17, %16 ]
%21 = tail call i32 @tail(i32 %20)
ret i32 0
}