#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*/ showiframe(char *, int);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  if (argc == 3) {
    if (strcmp(argv[1], "-p") == 0) {
      showiframe(argv[2], 1);
    }
  } else if (argc == 2) {
    showiframe(argv[1], 0);
  } else
    usage(argv[0]);
  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   $0x3,-0x8(%rbp)
jne    1185 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1180 <main+0x50>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x1,%esi
call   1030 <showiframe@plt>
jmp    11b4 <main+0x84>
cmpl   $0x2,-0x8(%rbp)
jne    11a3 <main+0x73>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %esi,%esi
call   1030 <showiframe@plt>
jmp    11af <main+0x7f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
jmp    11b4 <main+0x84>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1163 <main+0x33>
cmp    $0x3,%edi
jne    1170 <main+0x40>
mov    0x8(%rbx),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1178 <main+0x48>
mov    0x10(%rbx),%rdi
mov    $0x1,%esi
call   1030 <showiframe@plt>
jmp    1178 <main+0x48>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
call   1030 <showiframe@plt>
jmp    1178 <main+0x48>
mov    (%rbx),%rdi
call   1050 <usage@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-p\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
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @showiframe(i8* %17, i32 1)
br label %19
19: ; preds = %14, %8
br label %34
20: ; preds = %2
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @showiframe(i8* %26, i32 0)
br label %33
28: ; preds = %20
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 0
%31 = load i8*, i8** %30
%32 = call i32 @usage(i8* %31)
br label %33
33: ; preds = %28, %23
br label %34
34: ; preds = %33, %19
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-p\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %16 [
i32 3, label %3
i32 2, label %12
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %3
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @showiframe(i8* %10, i32 1)
br label %19
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32 @showiframe(i8* %14, i32 0)
br label %19
16: ; preds = %2
%17 = load i8*, i8** %1
%18 = tail call i32 @usage(i8* %17)
br label %19
19: ; preds = %12, %16, %3, %8
ret i32 0
}