#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 *, unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int integer, i;
  unsigned mask, y;
  scanf("%d", &integer);
  mask = ~0 << 2;
  mask = ~mask;
  for (i = 0; i < 16; i++) {
    y = integer & mask;
    printf("%d 0x%X 0o%o\n", y, y, y);
    integer = integer >> 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0xfffffffc,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    118e <main+0x6e>
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <main+0x2f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x10,%ebp
mov    0x4(%rsp),%ecx
lea    0xebf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
and    $0x3,%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <printf@plt>
mov    0x4(%rsp),%ecx
sar    $0x2,%ecx
mov    %ecx,0x4(%rsp)
add    $0xffffffff,%ebp
jne    1150 <main+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"%d 0x%X 0o%o\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
store i32 -4, i32* %3
%6 = load i32, i32* %3
%7 = xor i32 %6, -1
store i32 %7, i32* %3
store i32 0, i32* %2
br label %8
8: ; preds = %21, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 16
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i32, i32* %1
%13 = load i32, i32* %3
%14 = and i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = load i32, i32* %4
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
%19 = load i32, i32* %1
%20 = ashr i32 %19, 2
store i32 %20, i32* %1
br label %21
21: ; preds = %11
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %8
24: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"%d 0x%X 0o%o\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ %4, %0 ], [ %11, %5 ]
%7 = phi i32 [ 0, %0 ], [ %12, %5 ]
%8 = and i32 %6, 3
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %8, i32 %8)
%10 = load i32, i32* %1
%11 = ashr i32 %10, 2
store i32 %11, i32* %1
%12 = add nuw nsw i32 %7, 1
%13 = icmp eq i32 %12, 16
br i1 %13, label %14, label %5
14: ; preds = %5
ret void
}