#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 */
scalar_t__ pow(int, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  int i = 0;
  char seq[32];
  scanf("%d", &n);
  while (i < 32) {
    seq[31 - i] = n & (int)pow(2, i) ? '1' : '0';
    i++;
  }
  seq[32] = '\0';
  printf("%s", seq);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x20,-0xc(%rbp)
jge    11a6 <main+0x76>
mov    -0x8(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x2,%edi
call   1050 <pow@plt>
mov    -0x34(%rbp),%edx
and    %eax,%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,%cl
mov    $0x1f,%eax
sub    -0xc(%rbp),%eax
cltq
mov    %cl,-0x30(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <main+0x26>
movb   $0x0,-0x10(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
lea    0x2f(%rsp),%r14
xor    %ebx,%ebx
mov    0xc(%rsp),%ebp
mov    $0x2,%edi
mov    %ebx,%esi
call   1050 <pow@plt>
and    %ebp,%eax
cmp    $0x1,%eax
mov    $0x31,%al
sbb    $0x0,%al
mov    %al,(%r14)
mov    0xc(%rsp),%ebp
lea    0x1(%rbx),%esi
mov    $0x2,%edi
call   1050 <pow@plt>
and    %ebp,%eax
cmp    $0x1,%eax
mov    $0x31,%al
sbb    $0x0,%al
mov    %al,-0x1(%r14)
add    $0x2,%rbx
add    $0xfffffffffffffffe,%r14
cmp    $0x20,%rbx
jne    1150 <main+0x20>
movb   $0x0,0x30(%rsp)
lea    0xe5f(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [32 x i8]
store i32 0, i32* %1
store i32 0, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 32
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i64 @pow(i32 2, i32 %11)
%13 = trunc i64 %12 to i32
%14 = and i32 %10, %13
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 49, i32 48
%18 = trunc i32 %17 to i8
%19 = load i32, i32* %3
%20 = sub nsw i32 31, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 %21
store i8 %18, i8* %22
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %6
25: ; preds = %6
%26 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 32
store i8 0, i8* %26
%27 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %6
6: ; preds = %6, %0
%7 = phi i64 [ 0, %0 ], [ %27, %6 ]
%8 = load i32, i32* %1
%9 = trunc i64 %7 to i32
%10 = call i64 @pow(i32 2, i32 %9)
%11 = trunc i64 %10 to i32
%12 = and i32 %8, %11
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i8 48, i8 49
%15 = sub nuw nsw i64 31, %7
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 %15
store i8 %14, i8* %16
%17 = load i32, i32* %1
%18 = trunc i64 %7 to i32
%19 = or i32 %18, 1
%20 = call i64 @pow(i32 2, i32 %19)
%21 = trunc i64 %20 to i32
%22 = and i32 %17, %21
%23 = icmp eq i32 %22, 0
%24 = select i1 %23, i8 48, i8 49
%25 = sub nsw i64 30, %7
%26 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 %25
store i8 %24, i8* %26
%27 = add nuw nsw i64 %7, 2
%28 = icmp eq i64 %27, 32
br i1 %28, label %29, label %6
29: ; preds = %6
%30 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 32
store i8 0, i8* %30
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}