#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*/ printf(char *, ...);
void check_zoned_byte_validity(int byte, int ps) {
  if (ps == 0) {
    if (((byte & 0x30) != 0x30))
      printf("!=30");
  } else {
    if (((byte & 0xf0) != 0xf0))
      printf("%x !=f0 ", byte);
  }
  if ((byte & 0x0f) > 0x9)
    printf("!(0..9)");
}


x86 assembly (clang, -O0):
<check_zoned_byte_validity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114a <check_zoned_byte_validity+0x3a>
mov    -0x4(%rbp),%eax
and    $0x30,%eax
cmp    $0x30,%eax
je     1145 <check_zoned_byte_validity+0x35>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1173 <check_zoned_byte_validity+0x63>
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
cmp    $0xf0,%eax
je     116e <check_zoned_byte_validity+0x5e>
mov    -0x4(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1173 <check_zoned_byte_validity+0x63>
mov    -0x4(%rbp),%eax
and    $0xf,%eax
cmp    $0x9,%eax
jle    1190 <check_zoned_byte_validity+0x80>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_zoned_byte_validity>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
not    %eax
test   %esi,%esi
je     1131 <check_zoned_byte_validity+0x21>
test   $0xf0,%al
je     1143 <check_zoned_byte_validity+0x33>
lea    0xedf(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1143 <check_zoned_byte_validity+0x33>
test   $0x30,%al
je     1143 <check_zoned_byte_validity+0x33>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
and    $0xe,%ebx
cmp    $0xa,%ebx
jb     115a <check_zoned_byte_validity+0x4a>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"!=30\00"
@.str.1 = [9 x i8] c"%x !=f0 \00"
@.str.2 = [8 x i8] c"!(0..9)\00"
define void @check_zoned_byte_validity(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* %3
%9 = and i32 %8, 48
%10 = icmp ne i32 %9, 48
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
br label %22
14: ; preds = %2
%15 = load i32, i32* %3
%16 = and i32 %15, 240
%17 = icmp ne i32 %16, 240
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18, %14
br label %22
22: ; preds = %21, %13
%23 = load i32, i32* %3
%24 = and i32 %23, 15
%25 = icmp sgt i32 %24, 9
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"!=30\00"
@.str.1 = [9 x i8] c"%x !=f0 \00"
@.str.2 = [8 x i8] c"!(0..9)\00"
define void @check_zoned_byte_validity(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = and i32 %0, 48
%6 = icmp eq i32 %5, 48
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %14
9: ; preds = %2
%10 = and i32 %0, 240
%11 = icmp eq i32 %10, 240
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %14
14: ; preds = %9, %12, %4, %7
%15 = and i32 %0, 14
%16 = icmp ugt i32 %15, 9
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
ret void
}