#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 DecToBin(int number) {
  int c, k;
  int bin;
  for (c = 20; c >= 0; c--) {
    k = number >> c;
    if (k & 1)
      printf("1");
    else
      printf("0");
  }
  return bin;
}


x86 assembly (clang, -O0):
<DecToBin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1176 <DecToBin+0x66>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1157 <DecToBin+0x47>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1163 <DecToBin+0x53>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <DecToBin+0x58>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <DecToBin+0x12>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecToBin>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%eax
and    $0x100000,%eax
cmp    $0x1,%eax
mov    $0x31,%ebp
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x80000,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x40000,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x20000,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x10000,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x8000,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x4000,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x2000,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x1000,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x800,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x400,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x200,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x100,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x80,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x40,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x20,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x10,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x8,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x4,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x2,%eax
cmp    $0x1,%eax
sbb    $0x0,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
and    $0x1,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define i32 @DecToBin(i32 %0) {
%2 = and i32 %0, 1048576
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 48, i32 49
%5 = tail call i32 @putchar(i32 %4)
%6 = and i32 %0, 524288
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 48, i32 49
%9 = tail call i32 @putchar(i32 %8)
%10 = and i32 %0, 262144
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 48, i32 49
%13 = tail call i32 @putchar(i32 %12)
%14 = and i32 %0, 131072
%15 = icmp eq i32 %14, 0
%16 = select i1 %15, i32 48, i32 49
%17 = tail call i32 @putchar(i32 %16)
%18 = and i32 %0, 65536
%19 = icmp eq i32 %18, 0
%20 = select i1 %19, i32 48, i32 49
%21 = tail call i32 @putchar(i32 %20)
%22 = and i32 %0, 32768
%23 = icmp eq i32 %22, 0
%24 = select i1 %23, i32 48, i32 49
%25 = tail call i32 @putchar(i32 %24)
%26 = and i32 %0, 16384
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i32 48, i32 49
%29 = tail call i32 @putchar(i32 %28)
%30 = and i32 %0, 8192
%31 = icmp eq i32 %30, 0
%32 = select i1 %31, i32 48, i32 49
%33 = tail call i32 @putchar(i32 %32)
%34 = and i32 %0, 4096
%35 = icmp eq i32 %34, 0
%36 = select i1 %35, i32 48, i32 49
%37 = tail call i32 @putchar(i32 %36)
%38 = and i32 %0, 2048
%39 = icmp eq i32 %38, 0
%40 = select i1 %39, i32 48, i32 49
%41 = tail call i32 @putchar(i32 %40)
%42 = and i32 %0, 1024
%43 = icmp eq i32 %42, 0
%44 = select i1 %43, i32 48, i32 49
%45 = tail call i32 @putchar(i32 %44)
%46 = and i32 %0, 512
%47 = icmp eq i32 %46, 0
%48 = select i1 %47, i32 48, i32 49
%49 = tail call i32 @putchar(i32 %48)
%50 = and i32 %0, 256
%51 = icmp eq i32 %50, 0
%52 = select i1 %51, i32 48, i32 49
%53 = tail call i32 @putchar(i32 %52)
%54 = and i32 %0, 128
%55 = icmp eq i32 %54, 0
%56 = select i1 %55, i32 48, i32 49
%57 = tail call i32 @putchar(i32 %56)
%58 = and i32 %0, 64
%59 = icmp eq i32 %58, 0
%60 = select i1 %59, i32 48, i32 49
%61 = tail call i32 @putchar(i32 %60)
%62 = and i32 %0, 32
%63 = icmp eq i32 %62, 0
%64 = select i1 %63, i32 48, i32 49
%65 = tail call i32 @putchar(i32 %64)
%66 = and i32 %0, 16
%67 = icmp eq i32 %66, 0
%68 = select i1 %67, i32 48, i32 49
%69 = tail call i32 @putchar(i32 %68)
%70 = and i32 %0, 8
%71 = icmp eq i32 %70, 0
%72 = select i1 %71, i32 48, i32 49
%73 = tail call i32 @putchar(i32 %72)
%74 = and i32 %0, 4
%75 = icmp eq i32 %74, 0
%76 = select i1 %75, i32 48, i32 49
%77 = tail call i32 @putchar(i32 %76)
%78 = and i32 %0, 2
%79 = icmp eq i32 %78, 0
%80 = select i1 %79, i32 48, i32 49
%81 = tail call i32 @putchar(i32 %80)
%82 = and i32 %0, 1
%83 = or i32 %82, 48
%84 = tail call i32 @putchar(i32 %83)
ret i32 undef
}