#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*/ printf(char *, char *);
int run_interactive(int, char **);
int run_start(int, char **);
int /*<<< orphan*/ strcmp(char *, char *);
int run_command(int argc, char **argv) {
  if (!strcmp("run", argv[1]))
    return run_start(argc, argv);
  if (!strcmp("interactive", argv[1]))
    return run_interactive(argc, argv);
  printf("There is no command '%s'\n", argv[1]);
  return 1;
}


x86 assembly (clang, -O0):
<run_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea2(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1180 <run_command+0x40>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <run_start@plt>
mov    %eax,-0x4(%rbp)
jmp    11cc <run_command+0x8c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe75(%rip),%rdi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11b1 <run_command+0x71>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <run_interactive@plt>
mov    %eax,-0x4(%rbp)
jmp    11cc <run_command+0x8c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_command>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rbx
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     118c <run_command+0x4c>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     119a <run_command+0x5a>
lea    0xe96(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <run_start@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <run_interactive@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"run\00"
@.str.1 = [12 x i8] c"interactive\00"
@.str.2 = [26 x i8] c"There is no command '%s'\0A\00"
define i32 @run_command(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @run_start(i32 %12, i8** %13)
store i32 %14, i32* %3
br label %30
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strcmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = icmp ne i32 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %15
%22 = load i32, i32* %4
%23 = load i8**, i8*** %5
%24 = call i32 @run_interactive(i32 %22, i8** %23)
store i32 %24, i32* %3
br label %30
25: ; preds = %15
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %28)
store i32 1, i32* %3
br label %30
30: ; preds = %25, %21, %11
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
@.str = [4 x i8] c"run\00"
@.str.1 = [12 x i8] c"interactive\00"
@.str.2 = [26 x i8] c"There is no command '%s'\0A\00"
define i32 @run_command(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @run_start(i32 %0, i8** %1)
br label %16
9: ; preds = %2
%10 = tail call i32 @strcmp(i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* dereferenceable(1) %4)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @run_interactive(i32 %0, i8** %1)
br label %16
14: ; preds = %9
%15 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %4)
br label %16
16: ; preds = %14, %12, %7
%17 = phi i32 [ 1, %14 ], [ %13, %12 ], [ %8, %7 ]
ret i32 %17
}