#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 v;

/* Variables and functions */
int /*<<< orphan*/ printatomi(int);
int /*<<< orphan*/ printf(char *, ...);
void printvar(int v) {
  if (v & 0x40000000)
    printf("-");
  if (((v)&0x80000000))
    printf("*");
  switch (((v)&0x30000000)) {
  case 0x30000000:
    printf("AUX%i", ((v)&0x0FFFFFFF));
    break;
  case 0x20000000:
    printatomi(((v)&0x0FFFFFFF));
    break;
  case 0x10000000:
    printf("OP%i", ((v)&0x0FFFFFFF));
    break;
  default:
    printf("(INCORRECT VAR TYPE %i", v);
    break;
  }
}


x86 assembly (clang, -O0):
<printvar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40000000,%eax
cmp    $0x0,%eax
je     114a <printvar+0x2a>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     1169 <printvar+0x49>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x30000000,%eax
mov    %eax,-0x8(%rbp)
sub    $0x10000000,%eax
je     11d9 <printvar+0xb9>
jmp    1184 <printvar+0x64>
mov    -0x8(%rbp),%eax
sub    $0x20000000,%eax
je     11c6 <printvar+0xa6>
jmp    1197 <printvar+0x77>
mov    -0x8(%rbp),%eax
sub    $0x30000000,%eax
jne    11f5 <printvar+0xd5>
jmp    11aa <printvar+0x8a>
mov    -0x4(%rbp),%esi
and    $0xfffffff,%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1206 <printvar+0xe6>
mov    -0x4(%rbp),%edi
and    $0xfffffff,%edi
call   1040 <printatomi@plt>
jmp    1206 <printvar+0xe6>
mov    -0x4(%rbp),%esi
and    $0xfffffff,%esi
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1206 <printvar+0xe6>
mov    -0x4(%rbp),%esi
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printvar>:
push   %rbx
mov    %edi,%ebx
test   $0x40000000,%edi
je     1145 <printvar+0x15>
mov    $0x2d,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jns    1153 <printvar+0x23>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x30000000,%eax
cmp    $0x10000000,%eax
je     117e <printvar+0x4e>
cmp    $0x20000000,%eax
je     118d <printvar+0x5d>
cmp    $0x30000000,%eax
jne    119b <printvar+0x6b>
and    $0xfffffff,%ebx
lea    0xe84(%rip),%rdi
jmp    11a2 <printvar+0x72>
and    $0xfffffff,%ebx
lea    0xe7b(%rip),%rdi
jmp    11a2 <printvar+0x72>
and    $0xfffffff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1050 <printatomi@plt>
lea    0xe69(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [6 x i8] c"AUX%i\00"
@.str.3 = [5 x i8] c"OP%i\00"
@.str.4 = [23 x i8] c"(INCORRECT VAR TYPE %i\00"
define void @printvar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1073741824
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = and i32 %9, -2147483648
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %2
%16 = and i32 %15, 805306368
switch i32 %16, label %29 [
i32 805306368, label %17
i32 536870912, label %21
i32 268435456, label %25
]
17: ; preds = %14
%18 = load i32, i32* %2
%19 = and i32 %18, 268435455
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %32
21: ; preds = %14
%22 = load i32, i32* %2
%23 = and i32 %22, 268435455
%24 = call i32 @printatomi(i32 %23)
br label %32
25: ; preds = %14
%26 = load i32, i32* %2
%27 = and i32 %26, 268435455
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %27)
br label %32
29: ; preds = %14
%30 = load i32, i32* %2
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %29, %25, %21, %17
ret void
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"AUX%i\00"
@.str.3 = [5 x i8] c"OP%i\00"
@.str.4 = [23 x i8] c"(INCORRECT VAR TYPE %i\00"
define void @printvar(i32 %0) {
%2 = and i32 %0, 1073741824
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @putchar(i32 45)
br label %6
6: ; preds = %4, %1
%7 = icmp sgt i32 %0, -1
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @putchar(i32 42)
br label %10
10: ; preds = %8, %6
%11 = and i32 %0, 805306368
switch i32 %11, label %21 [
i32 805306368, label %12
i32 536870912, label %15
i32 268435456, label %18
]
12: ; preds = %10
%13 = and i32 %0, 268435455
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %13)
br label %23
15: ; preds = %10
%16 = and i32 %0, 268435455
%17 = tail call i32 @printatomi(i32 %16)
br label %23
18: ; preds = %10
%19 = and i32 %0, 268435455
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %19)
br label %23
21: ; preds = %10
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %0)
br label %23
23: ; preds = %21, %18, %15, %12
ret void
}