#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 *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  for (int i = 0; i < 16; i++)
    printf("%d", (num << i & 1 << 15) ? 1 : 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1187 <main+0x67>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
and    $0x8000,%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
shr    $0xf,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0xe,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0xd,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0xc,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0xb,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0xa,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0x9,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0x8,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0x7,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0x6,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0x5,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0x4,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0x3,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    $0x2,%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
shr    %esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
and    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @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
%5 = lshr i32 %4, 15
%6 = and i32 %5, 1
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = lshr i32 %8, 14
%10 = and i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %1
%13 = lshr i32 %12, 13
%14 = and i32 %13, 1
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %1
%17 = lshr i32 %16, 12
%18 = and i32 %17, 1
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %1
%21 = lshr i32 %20, 11
%22 = and i32 %21, 1
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %1
%25 = lshr i32 %24, 10
%26 = and i32 %25, 1
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %1
%29 = lshr i32 %28, 9
%30 = and i32 %29, 1
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %1
%33 = lshr i32 %32, 8
%34 = and i32 %33, 1
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %1
%37 = lshr i32 %36, 7
%38 = and i32 %37, 1
%39 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %1
%41 = lshr i32 %40, 6
%42 = and i32 %41, 1
%43 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %1
%45 = lshr i32 %44, 5
%46 = and i32 %45, 1
%47 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %1
%49 = lshr i32 %48, 4
%50 = and i32 %49, 1
%51 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %1
%53 = lshr i32 %52, 3
%54 = and i32 %53, 1
%55 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %54)
%56 = load i32, i32* %1
%57 = lshr i32 %56, 2
%58 = and i32 %57, 1
%59 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %58)
%60 = load i32, i32* %1
%61 = lshr i32 %60, 1
%62 = and i32 %61, 1
%63 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %62)
%64 = load i32, i32* %1
%65 = and i32 %64, 1
%66 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %65)
ret i32 0
}