#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 */
typedef int /*<<< orphan*/ cmd;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int read(int /*<<< orphan*/, unsigned int *, int);
int main(int argc, char *argv[], char *envp[]) {
  unsigned int cmd;
  if (read(0, &cmd, sizeof(cmd)) != sizeof(cmd)) {
    printf("Error reading stdin!");
    exit(-1);
  }
  if (cmd > 0x41) {
    printf("Message: It is greater than 0x41\n");
  } else {
    printf("Message: It is smaller or equal than 0x41\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
cltq
cmp    $0x4,%rax
je     117c <main+0x4c>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
cmpl   $0x41,-0x1c(%rbp)
jbe    1197 <main+0x67>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    11a3 <main+0x73>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1050 <read@plt>
cmp    $0x4,%eax
jne    1177 <main+0x37>
cmpl   $0x42,0x4(%rsp)
lea    0xedc(%rip),%rax
lea    0xeab(%rip),%rdi
cmovae %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Error reading stdin!\00"
@.str.1 = [34 x i8] c"Message: It is greater than 0x41\0A\00"
@.str.2 = [43 x i8] c"Message: It is smaller or equal than 0x41\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = call i32 @read(i32 0, i32* %8, i32 4)
%10 = sext i32 %9 to i64
%11 = icmp ne i64 %10, 4
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %3
%16 = load i32, i32* %8
%17 = icmp ugt i32 %16, 65
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %22
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Error reading stdin!\00"
@str = [42 x i8] c"Message: It is smaller or equal than 0x41\00"
@str.3 = [33 x i8] c"Message: It is greater than 0x41\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @read(i32 0, i32* %4, i32 4)
%7 = icmp eq i32 %6, 4
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %3
%12 = load i32, i32* %4
%13 = icmp ugt i32 %12, 65
%14 = select i1 %13, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0)
%15 = tail call i32 @puts(i8* dereferenceable(1) %14)
ret i32 0
}