#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 *, char *);
int main(void) {
  int inteiro = 3;
  int tamanho = sizeof(int) * 8;
  char binario[tamanho + 1];
  int i = tamanho - 1;
  while (i > 0) {
    binario[i] = inteiro % 2 + 48;
    inteiro /= 2;
    i--;
  }
  binario[tamanho] = '\0';
  printf("%s", binario);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    119e <main+0x8e>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x30(%rbp),%rax
add    $0x30,%edx
movslq -0x24(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    115f <main+0x4f>
mov    -0x30(%rbp),%rsi
movslq -0xc(%rbp),%rax
movb   $0x0,(%rsi,%rax,1)
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    $0x3,%ecx
mov    $0x1f,%eax
xchg   %ax,%ax
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
mov    %edx,%esi
and    $0xfe,%esi
mov    %ecx,%edi
sub    %esi,%edi
add    $0x30,%dil
mov    %dil,(%rsp,%rax,1)
cmp    $0x2,%rax
jb     116c <main+0x5c>
sar    %edx
mov    %edx,%esi
shr    $0x1f,%esi
add    %edx,%esi
and    $0xfe,%esi
sub    %esi,%edx
add    $0x30,%dl
mov    %dl,-0x1(%rsp,%rax,1)
lea    0x3(%rcx),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
sar    $0x2,%edx
add    $0xfffffffffffffffe,%rax
mov    %edx,%ecx
jmp    1120 <main+0x10>
movb   $0x0,0x20(%rsp)
lea    0xe88(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [33 x i8]
br label %2
2: ; preds = %11, %0
%3 = phi i64 [ 31, %0 ], [ %18, %11 ]
%4 = phi i32 [ 3, %0 ], [ %17, %11 ]
%5 = srem i32 %4, 2
%6 = sdiv i32 %4, 2
%7 = trunc i32 %5 to i8
%8 = add nsw i8 %7, 48
%9 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 %3
store i8 %8, i8* %9
%10 = icmp ugt i64 %3, 1
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = add nsw i64 %3, -1
%13 = srem i32 %6, 2
%14 = trunc i32 %13 to i8
%15 = add nsw i8 %14, 48
%16 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 %12
store i8 %15, i8* %16
%17 = sdiv i32 %4, 4
%18 = add nsw i64 %3, -2
br label %2
19: ; preds = %2
%20 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%21 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 32
store i8 0, i8* %21
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %20)
ret i32 0
}