#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 /*<<< orphan*/ GetHistorical(char *, char *, char *);
int /*<<< orphan*/ GetStocks(char *);
int /*<<< orphan*/ Usage();
int main(int argc, char **argv) {
  if (argc == 2) {
    GetStocks(argv[1]);
  } else if (argc == 4) {
    GetHistorical(argv[1], argv[2], argv[3]);
  } else {
    Usage();
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1162 <main+0x32>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <GetStocks@plt>
jmp    119a <main+0x6a>
cmpl   $0x4,-0x8(%rbp)
jne    118e <main+0x5e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1050 <GetHistorical@plt>
jmp    1195 <main+0x65>
mov    $0x0,%al
call   1040 <Usage@plt>
jmp    119a <main+0x6a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x4,%edi
je     1146 <main+0x16>
cmp    $0x2,%edi
jne    115c <main+0x2c>
mov    0x8(%rsi),%rdi
call   1030 <GetStocks@plt>
jmp    1163 <main+0x33>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rax
mov    0x18(%rsi),%rdx
mov    %rax,%rsi
call   1050 <GetHistorical@plt>
jmp    1163 <main+0x33>
xor    %eax,%eax
call   1040 <Usage@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @GetStocks(i8* %11)
br label %30
13: ; preds = %2
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 4
br i1 %15, label %16, label %27
16: ; preds = %13
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 3
%25 = load i8*, i8** %24
%26 = call i32 @GetHistorical(i8* %19, i8* %22, i8* %25)
br label %29
27: ; preds = %13
%28 = call i32 (...) @Usage()
br label %29
29: ; preds = %27, %16
br label %30
30: ; preds = %29, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %15 [
i32 2, label %3
i32 4, label %7
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @GetStocks(i8* %5)
br label %17
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 3
%13 = load i8*, i8** %12
%14 = tail call i32 @GetHistorical(i8* %9, i8* %11, i8* %13)
br label %17
15: ; preds = %2
%16 = tail call i32 (...) @Usage()
br label %17
17: ; preds = %7, %15, %3
ret i32 0
}