#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 */
scalar_t__ strcmp(char const *, char const *);
scalar_t__ strlen(char const *);
int check_command(const char *command, const char *rec_msg) {
  if (command != NULL && rec_msg != NULL && strlen(command) > 0 &&
      strlen(rec_msg) > 0)
    if (strcmp(command, rec_msg) == 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1194 <check_command+0x74>
cmpq   $0x0,-0x18(%rbp)
je     1194 <check_command+0x74>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    1194 <check_command+0x74>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    1194 <check_command+0x74>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    118f <check_command+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    119b <check_command+0x7b>
jmp    1194 <check_command+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_command>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115b <check_command+0x3b>
mov    %rsi,%r14
test   %rsi,%rsi
je     115b <check_command+0x3b>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
jle    115b <check_command+0x3b>
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
jle    115b <check_command+0x3b>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1165 <check_command+0x45>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x1,%eax
jmp    115d <check_command+0x3d>

LLVM IR (-O0):
define i32 @check_command(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %26
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = call i64 @strlen(i8* %12)
%14 = icmp sgt i64 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %11
%16 = load i8*, i8** %5
%17 = call i64 @strlen(i8* %16)
%18 = icmp sgt i64 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = call i64 @strcmp(i8* %20, i8* %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 1, i32* %3
br label %27
25: ; preds = %19
br label %26
26: ; preds = %25, %15, %11, %8, %2
store i32 0, i32* %3
br label %27
27: ; preds = %26, %24
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @check_command(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = tail call i64 @strlen(i8* %0)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = tail call i64 @strlen(i8* %1)
%11 = icmp sgt i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = tail call i64 @strcmp(i8* %0, i8* %1)
%14 = icmp eq i64 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %12, %9, %6, %2
br label %16
16: ; preds = %12, %15
%17 = phi i32 [ 0, %15 ], [ 1, %12 ]
ret i32 %17
}