#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 printBytesAsRank(unsigned int e) {
  int i;
  int k, l, o, p;
  i = 32 - 1;
  k = (e >> i & 0x1) == 1;
  l = (e >> (i - 1) & 0x1) == 1;
  i = 32 - 3;
  o = (e >> i & 0x1) == 1;
  p = (e >> (i - 1) & 0x1) == 1;
  if (k == 1) {
    if (l == 1) {
      printf("Rank max : 4, ");
    } else {
      printf("Rank max : 3, ");
    }
  } else {
    if (l == 1) {
      printf("Rank max : 2, ");
    } else {
      printf("Rank max : 1, ");
    }
  }
  if (o == 1) {
    if (p == 1) {
      printf("Rank min : 4 | ");
    } else {
      printf("Rank min : 3 | ");
    }
  } else {
    if (p == 1) {
      printf("Rank min : 2 | ");
    } else {
      printf("Rank min : 1 | ");
    }
  }
}


x86 assembly (clang, -O0):
<printBytesAsRank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1f,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
shr    %cl,%eax
and    $0x1,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
movl   $0x1d,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
shr    %cl,%eax
and    $0x1,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11c9 <printBytesAsRank+0xb9>
cmpl   $0x1,-0x10(%rbp)
jne    11b8 <printBytesAsRank+0xa8>
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
jmp    11c4 <printBytesAsRank+0xb4>
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
jmp    11f5 <printBytesAsRank+0xe5>
cmpl   $0x1,-0x10(%rbp)
jne    11e4 <printBytesAsRank+0xd4>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <printBytesAsRank+0xe0>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
jmp    11f5 <printBytesAsRank+0xe5>
cmpl   $0x1,-0x14(%rbp)
jne    122b <printBytesAsRank+0x11b>
cmpl   $0x1,-0x18(%rbp)
jne    121a <printBytesAsRank+0x10a>
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
jmp    1226 <printBytesAsRank+0x116>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
jmp    1257 <printBytesAsRank+0x147>
cmpl   $0x1,-0x18(%rbp)
jne    1246 <printBytesAsRank+0x136>
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
jmp    1252 <printBytesAsRank+0x142>
lea    0xe1f(%rip),%rdi
call   1030 <printf@plt>
jmp    1257 <printBytesAsRank+0x147>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBytesAsRank>:
push   %rbx
mov    %edi,%ebx
test   $0x40000000,%edi
lea    0xeef(%rip),%rax
lea    0xed9(%rip),%rcx
cmove  %rax,%rcx
lea    0xefb(%rip),%rax
lea    0xee5(%rip),%rdi
cmove  %rax,%rdi
test   %ebx,%ebx
cmovs  %rcx,%rdi
call   1030 <printf@plt>
test   $0x10000000,%ebx
lea    0xef7(%rip),%rax
lea    0xee0(%rip),%rcx
cmove  %rax,%rcx
lea    0xf05(%rip),%rax
lea    0xeee(%rip),%rdi
cmove  %rax,%rdi
test   $0x20000000,%ebx
cmovne %rcx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Rank max : 4, \00"
@.str.1 = [15 x i8] c"Rank max : 3, \00"
@.str.2 = [15 x i8] c"Rank max : 2, \00"
@.str.3 = [15 x i8] c"Rank max : 1, \00"
@.str.4 = [16 x i8] c"Rank min : 4 | \00"
@.str.5 = [16 x i8] c"Rank min : 3 | \00"
@.str.6 = [16 x i8] c"Rank min : 2 | \00"
@.str.7 = [16 x i8] c"Rank min : 1 | \00"
define void @printBytesAsRank(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
store i32 31, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = lshr i32 %8, %9
%11 = and i32 %10, 1
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
store i32 %13, i32* %4
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
%17 = lshr i32 %14, %16
%18 = and i32 %17, 1
%19 = icmp eq i32 %18, 1
%20 = zext i1 %19 to i32
store i32 %20, i32* %5
store i32 29, i32* %3
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = lshr i32 %21, %22
%24 = and i32 %23, 1
%25 = icmp eq i32 %24, 1
%26 = zext i1 %25 to i32
store i32 %26, i32* %6
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = sub nsw i32 %28, 1
%30 = lshr i32 %27, %29
%31 = and i32 %30, 1
%32 = icmp eq i32 %31, 1
%33 = zext i1 %32 to i32
store i32 %33, i32* %7
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %44
36: ; preds = %1
%37 = load i32, i32* %5
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %43
41: ; preds = %36
%42 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
br label %52
44: ; preds = %1
%45 = load i32, i32* %5
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %51
49: ; preds = %44
%50 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %49, %47
br label %52
52: ; preds = %51, %43
%53 = load i32, i32* %6
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %63
55: ; preds = %52
%56 = load i32, i32* %7
%57 = icmp eq i32 %56, 1
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %62
60: ; preds = %55
%61 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %62
62: ; preds = %60, %58
br label %71
63: ; preds = %52
%64 = load i32, i32* %7
%65 = icmp eq i32 %64, 1
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
br label %70
68: ; preds = %63
%69 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
br label %70
70: ; preds = %68, %66
br label %71
71: ; preds = %70, %62
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Rank max : 4, \00"
@.str.1 = [15 x i8] c"Rank max : 3, \00"
@.str.2 = [15 x i8] c"Rank max : 2, \00"
@.str.3 = [15 x i8] c"Rank max : 1, \00"
@.str.4 = [16 x i8] c"Rank min : 4 | \00"
@.str.5 = [16 x i8] c"Rank min : 3 | \00"
@.str.6 = [16 x i8] c"Rank min : 2 | \00"
@.str.7 = [16 x i8] c"Rank min : 1 | \00"
define void @printBytesAsRank(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = and i32 %0, 1073741824
%4 = icmp eq i32 %3, 0
%5 = and i32 %0, 536870912
%6 = icmp eq i32 %5, 0
%7 = and i32 %0, 268435456
%8 = icmp eq i32 %7, 0
%9 = select i1 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%10 = select i1 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0)
%11 = select i1 %2, i8* %9, i8* %10
%12 = tail call i32 @printf(i8* dereferenceable(1) %11)
%13 = select i1 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0)
%14 = select i1 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0)
%15 = select i1 %6, i8* %14, i8* %13
%16 = tail call i32 @printf(i8* dereferenceable(1) %15)
ret void
}