#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*/ strcmp(char *, char *);
int /*<<< orphan*/ sys_call(int, int /*<<< orphan*/, int);
void run(char *c) {
  if (!strcmp("dummy", c)) {
    sys_call(7, 0, 1);
  } else if (!strcmp("editor", c)) {
    sys_call(7, 0, 2);
  } else if (!strcmp("fortune", c)) {
    sys_call(7, 0, 3);
  }
  return;
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    115b <run+0x3b>
mov    $0x7,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <sys_call@plt>
jmp    11be <run+0x9e>
mov    -0x8(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    118a <run+0x6a>
mov    $0x7,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <sys_call@plt>
jmp    11b9 <run+0x99>
mov    -0x8(%rbp),%rsi
lea    0xe78(%rip),%rdi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11b4 <run+0x94>
mov    $0x7,%edi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <sys_call@plt>
jmp    11b9 <run+0x99>
jmp    11be <run+0x9e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     115f <run+0x3f>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1166 <run+0x46>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     116d <run+0x4d>
pop    %rbx
ret
mov    $0x1,%edx
jmp    1172 <run+0x52>
mov    $0x2,%edx
jmp    1172 <run+0x52>
mov    $0x3,%edx
mov    $0x7,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"dummy\00"
@.str.1 = [7 x i8] c"editor\00"
@.str.2 = [8 x i8] c"fortune\00"
define void @run(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @sys_call(i32 7, i32 0, i32 1)
br label %22
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = call i32 @sys_call(i32 7, i32 0, i32 2)
br label %21
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = call i32 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %14
%19 = call i32 @sys_call(i32 7, i32 0, i32 3)
br label %20
20: ; preds = %18, %14
br label %21
21: ; preds = %20, %12
br label %22
22: ; preds = %21, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"dummy\00"
@.str.1 = [7 x i8] c"editor\00"
@.str.2 = [8 x i8] c"fortune\00"
define void @run(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* dereferenceable(1) %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @strcmp(i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* dereferenceable(1) %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7, %4, %1
%11 = phi i32 [ 1, %1 ], [ 2, %4 ], [ 3, %7 ]
%12 = tail call i32 @sys_call(i32 7, i32 0, i32 %11)
br label %13
13: ; preds = %10, %7
ret void
}