#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 *);
bool check_kill(int argc, char **argv) {
  switch (argv[1][0]) {
  case 'm':
    if (argc > 2) {
      if (strcmp(argv[2], "-k") == 0) {
        return true;
      }
    }
    break;
  case 'p':
    if (argc > 2) {
      if (strcmp(argv[2], "-k") == 0) {
        return true;
      }
    }
    break;
  case 's':
    if (argc > 3) {
      if (strcmp(argv[3], "-k") == 0) {
        return true;
      }
    }
    break;
  }
  return false;
}


x86 assembly (clang, -O0):
<check_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x6d,%eax
je     115d <check_kill+0x4d>
jmp    113b <check_kill+0x2b>
mov    -0x14(%rbp),%eax
sub    $0x70,%eax
je     119a <check_kill+0x8a>
jmp    114c <check_kill+0x3c>
mov    -0x14(%rbp),%eax
sub    $0x73,%eax
je     11d7 <check_kill+0xc7>
jmp    1214 <check_kill+0x104>
cmpl   $0x2,-0x8(%rbp)
jle    1195 <check_kill+0x85>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1190 <check_kill+0x80>
movl   $0x1,-0x4(%rbp)
jmp    121b <check_kill+0x10b>
jmp    1195 <check_kill+0x85>
jmp    1214 <check_kill+0x104>
cmpl   $0x2,-0x8(%rbp)
jle    11d2 <check_kill+0xc2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe4d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11cd <check_kill+0xbd>
movl   $0x1,-0x4(%rbp)
jmp    121b <check_kill+0x10b>
jmp    11d2 <check_kill+0xc2>
jmp    1214 <check_kill+0x104>
cmpl   $0x3,-0x8(%rbp)
jle    120f <check_kill+0xff>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe10(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    120a <check_kill+0xfa>
movl   $0x1,-0x4(%rbp)
jmp    121b <check_kill+0x10b>
jmp    120f <check_kill+0xff>
jmp    1214 <check_kill+0x104>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_kill>:
push   %rax
mov    0x8(%rsi),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
je     1132 <check_kill+0x22>
cmp    $0x70,%eax
je     1127 <check_kill+0x17>
cmp    $0x6d,%eax
jne    114b <check_kill+0x3b>
cmp    $0x3,%edi
jl     114b <check_kill+0x3b>
mov    0x10(%rsi),%rdi
jmp    113b <check_kill+0x2b>
cmp    $0x4,%edi
jl     114b <check_kill+0x3b>
mov    0x18(%rsi),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     114f <check_kill+0x3f>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-k\00"
define i32 @check_kill(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 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
switch i32 %11, label %48 [
i32 109, label %12
i32 112, label %24
i32 115, label %36
]
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 2
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 1, i32* %3
br label %49
22: ; preds = %15
br label %23
23: ; preds = %22, %12
br label %48
24: ; preds = %2
%25 = load i32, i32* %4
%26 = icmp sgt i32 %25, 2
br i1 %26, label %27, label %35
27: ; preds = %24
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @strcmp(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %27
store i32 1, i32* %3
br label %49
34: ; preds = %27
br label %35
35: ; preds = %34, %24
br label %48
36: ; preds = %2
%37 = load i32, i32* %4
%38 = icmp sgt i32 %37, 3
br i1 %38, label %39, label %47
39: ; preds = %36
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 3
%42 = load i8*, i8** %41
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %39
store i32 1, i32* %3
br label %49
46: ; preds = %39
br label %47
47: ; preds = %46, %36
br label %48
48: ; preds = %2, %47, %35, %23
store i32 0, i32* %3
br label %49
49: ; preds = %48, %45, %33, %21
%50 = load i32, i32* %3
ret i32 %50
}

LLVM IR (-O2):
@.str = [3 x i8] c"-k\00"
define i32 @check_kill(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %28 [
i32 109, label %7
i32 112, label %14
i32 115, label %21
]
7: ; preds = %2
%8 = icmp sgt i32 %0, 2
br i1 %8, label %9, label %28
9: ; preds = %7
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %29, label %28
14: ; preds = %2
%15 = icmp sgt i32 %0, 2
br i1 %15, label %16, label %28
16: ; preds = %14
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %18, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %29, label %28
21: ; preds = %2
%22 = icmp sgt i32 %0, 3
br i1 %22, label %23, label %28
23: ; preds = %21
%24 = getelementptr inbounds i8*, i8** %1, i64 3
%25 = load i8*, i8** %24
%26 = tail call i32 @strcmp(i8* dereferenceable(1) %25, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%27 = icmp eq i32 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %21, %23, %14, %16, %7, %9, %2
br label %29
29: ; preds = %23, %16, %9, %28
%30 = phi i32 [ 0, %28 ], [ 1, %9 ], [ 1, %16 ], [ 1, %23 ]
ret i32 %30
}