#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 oauth_consumer_example(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  switch (oauth_consumer_example(0)) {
  case 1:
    printf("HTTP request for an oauth request-token failed.\n");
    break;
  case 2:
    printf("did not receive a request-token.\n");
    break;
  case 3:
    printf("HTTP request for an oauth access-token failed.\n");
    break;
  case 4:
    printf("did not receive an access-token.\n");
    break;
  case 5:
    printf("test call 'echo-api' did not respond correctly.\n");
    break;
  default:
    printf("request ok.\n");
    break;
  }
  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)
xor    %edi,%edi
call   1040 <oauth_consumer_example@plt>
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     11b8 <main+0x98>
mov    -0x18(%rbp),%rax
lea    0xea6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    11c4 <main+0xa4>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    11c4 <main+0xa4>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
jmp    11c4 <main+0xa4>
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
jmp    11c4 <main+0xa4>
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
jmp    11c4 <main+0xa4>
lea    0xf2b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <oauth_consumer_example@plt>
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     1142 <main+0x22>
cltq
lea    0xfa7(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1149 <main+0x29>
lea    0xf88(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"HTTP request for an oauth request-token failed.\0A\00"
@.str.1 = [34 x i8] c"did not receive a request-token.\0A\00"
@.str.2 = [48 x i8] c"HTTP request for an oauth access-token failed.\0A\00"
@.str.3 = [34 x i8] c"did not receive an access-token.\0A\00"
@.str.4 = [49 x i8] c"test call 'echo-api' did not respond correctly.\0A\00"
@.str.5 = [13 x i8] c"request ok.\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 = call i32 @oauth_consumer_example(i32 0)
switch i32 %6, label %17 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
]
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %19
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %19
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
br label %19
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %19
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
br label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %19
19: ; preds = %17, %15, %13, %11, %9, %7
ret i32 0
}

LLVM IR (-O2):
@str = [48 x i8] c"test call 'echo-api' did not respond correctly.\00"
@str.6 = [33 x i8] c"did not receive an access-token.\00"
@str.7 = [47 x i8] c"HTTP request for an oauth access-token failed.\00"
@str.8 = [33 x i8] c"did not receive a request-token.\00"
@str.9 = [48 x i8] c"HTTP request for an oauth request-token failed.\00"
@str.10 = [12 x i8] c"request ok.\00"
@reltable.main = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([48 x i8]* @str.9 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([33 x i8]* @str.8 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([47 x i8]* @str.7 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([33 x i8]* @str.6 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([48 x i8]* @str to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32)]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @oauth_consumer_example(i32 0)
%4 = add i32 %3, -1
%5 = icmp ult i32 %4, 5
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = sext i32 %4 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.main to i8*), i64 %8)
br label %10
10: ; preds = %2, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.10, i64 0, i64 0), %2 ]
%12 = tail call i32 @puts(i8* dereferenceable(1) %11)
ret i32 0
}