#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void check_pharse(int argc, char *argv[]) {
  if (argc != 7 || (argv[1][1] != 'e' && argv[1][1] != 'd')) {
    fprintf(stdout,
            "Usage: %s\n"
            "  -e (encrypt) or -d (decrypt)\n"
            "  -o file_name\n"
            "  -k x b\n"
            "  < file\n",
            argv[0]);
    exit(EXIT_SUCCESS);
  }
  return;
}


x86 assembly (clang, -O0):
<check_pharse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x7,-0x4(%rbp)
jne    1163 <check_pharse+0x43>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x65,%eax
je     118d <check_pharse+0x6d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl 0x1(%rax),%eax
cmp    $0x64,%eax
je     118d <check_pharse+0x6d>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe86(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pharse>:
push   %rax
cmp    $0x7,%edi
jne    1135 <check_pharse+0x15>
mov    0x8(%rsi),%rax
mov    0x1(%rax),%al
and    $0xfe,%al
cmp    $0x64,%al
jne    1135 <check_pharse+0x15>
pop    %rax
ret
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [75 x i8] c"Usage: %s\0A -e (encrypt) or -d (decrypt)\0A -o file_name\0A -k x b\0A < file\0A\00"
@EXIT_SUCCESS = global i32 0
define void @check_pharse(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 7
br i1 %6, label %23, label %7
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 101
br i1 %14, label %15, label %31
15: ; preds = %7
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 100
br i1 %22, label %23, label %31
23: ; preds = %15, %2
%24 = load i32, i32* @stdout
%25 = load i8**, i8*** %4
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %27)
%29 = load i32, i32* @EXIT_SUCCESS
%30 = call i32 @exit(i32 %29)
unreachable
31: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [75 x i8] c"Usage: %s\0A -e (encrypt) or -d (decrypt)\0A -o file_name\0A -k x b\0A < file\0A\00"
@EXIT_SUCCESS = global i32 0
define void @check_pharse(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 7
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = and i8 %8, -2
%10 = icmp eq i8 %9, 100
br i1 %10, label %17, label %11
11: ; preds = %4, %2
%12 = load i32, i32* @stdout
%13 = load i8*, i8** %1
%14 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @EXIT_SUCCESS
%16 = tail call i32 @exit(i32 %15)
unreachable
17: ; preds = %4
ret void
}