#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*/ check_auth();
int /*<<< orphan*/ get_friends_timeline();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ update_status(char *);
int main(int argc, char *argv[]) {
  switch (argc) {
  case 1:
    check_auth();
    get_friends_timeline();
    break;
  case 2:
    check_auth();
    update_status(argv[1]);
    break;
  default:
    printf("Not a valid number of arguments\n");
    return 1;
  }
  printf("WARNING: IN ITS CURRENT STATE, THIS PROGRAM IS UNSAFE \nFOR THE "
         "PRIVACY OF YOUR TWITTER ACCOUNT.\n");
  return 0;
}


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)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     117b <main+0x3b>
jmp    116a <main+0x2a>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     118e <main+0x4e>
jmp    11a7 <main+0x67>
mov    $0x0,%al
call   1050 <check_auth@plt>
mov    $0x0,%al
call   1030 <get_friends_timeline@plt>
jmp    11bf <main+0x7f>
mov    $0x0,%al
call   1050 <check_auth@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <update_status@plt>
jmp    11bf <main+0x7f>
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d2 <main+0x92>
lea    0xe5b(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
je     115f <main+0x1f>
cmp    $0x1,%edi
jne    117d <main+0x3d>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <check_auth@plt>
xor    %eax,%eax
call   1030 <get_friends_timeline@plt>
jmp    1174 <main+0x34>
mov    %rsi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <check_auth@plt>
mov    0x8(%rbx),%rdi
call   1060 <update_status@plt>
lea    0xe85(%rip),%rdi
jmp    1189 <main+0x49>
mov    $0x1,%ebp
lea    0xed7(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Not a valid number of arguments\0A\00"
@.str.1 = [97 x i8] c"WARNING: IN ITS CURRENT STATE, THIS PROGRAM IS UNSAFE \0AFOR THE PRIVACY OF YOUR TWITTER ACCOUNT.\0A\00"
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
switch i32 %6, label %16 [
i32 1, label %7
i32 2, label %10
]
7: ; preds = %2
%8 = call i32 (...) @check_auth()
%9 = call i32 (...) @get_friends_timeline()
br label %18
10: ; preds = %2
%11 = call i32 (...) @check_auth()
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @update_status(i8* %14)
br label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %20
18: ; preds = %10, %7
%19 = call i32 @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %20
20: ; preds = %18, %16
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@str = [96 x i8] c"WARNING: IN ITS CURRENT STATE, THIS PROGRAM IS UNSAFE \0AFOR THE PRIVACY OF YOUR TWITTER ACCOUNT.\00"
@str.2 = [32 x i8] c"Not a valid number of arguments\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %11 [
i32 1, label %3
i32 2, label %6
]
3: ; preds = %2
%4 = tail call i32 (...) @check_auth()
%5 = tail call i32 (...) @get_friends_timeline()
br label %11
6: ; preds = %2
%7 = tail call i32 (...) @check_auth()
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @update_status(i8* %9)
br label %11
11: ; preds = %3, %6, %2
%12 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0), %2 ], [ getelementptr inbounds ([96 x i8], [96 x i8]* @str, i64 0, i64 0), %6 ], [ getelementptr inbounds ([96 x i8], [96 x i8]* @str, i64 0, i64 0), %3 ]
%13 = phi i32 [ 1, %2 ], [ 0, %6 ], [ 0, %3 ]
%14 = tail call i32 @puts(i8* dereferenceable(1) %12)
ret i32 %13
}