void decToBin(int vl) {
  typedef struct {
    int elementos[50];
    int topo;
  } tpilha[2];
  tpilha pt;
  int aux, i, t = 0;
  for (i = 0; i < 2; i++) {
    inicializa(&pt[i]);
  }
  while ((vl != 0) && (vl != 1)) {
    aux = vl % 2;
    vl = vl / 2;
    empilha(&pt[0], aux);
    t++;
  }
  empilha(&pt[0], vl);
  t++;
  for (i = 0; i <= t; i++) {
    desempilha(&pt[0], &aux);
    empilha(&pt[1], aux);
  }
  printf("\n\tO valor convertido para binario e = ");
  for (i = 0; i < t; i++) {
    printf("%d", pt[1].elementos[i]);
  }
}


x86 assembly (clang, -O0):
<decToBin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x1ac(%rbp)
movl   $0x0,-0x1a8(%rbp)
cmpl   $0x2,-0x1a8(%rbp)
jge    11a2 <decToBin+0x62>
movslq -0x1a8(%rbp),%rax
lea    -0x1a0(%rbp),%rdi
imul   $0xcc,%rax,%rax
add    %rax,%rdi
mov    $0x0,%al
call   1060 <inicializa@plt>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    1162 <decToBin+0x22>
jmp    11a7 <decToBin+0x67>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x1ad(%rbp)
je     11c6 <decToBin+0x86>
cmpl   $0x1,-0x4(%rbp)
setne  %al
mov    %al,-0x1ad(%rbp)
mov    -0x1ad(%rbp),%al
test   $0x1,%al
jne    11d9 <decToBin+0x99>
jmp    1220 <decToBin+0xe0>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1a4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    -0x1a4(%rbp),%esi
mov    $0x0,%al
call   1030 <empilha@plt>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    11a7 <decToBin+0x67>
lea    -0x1a0(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0x0,%al
call   1030 <empilha@plt>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
movl   $0x0,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%eax
cmp    -0x1ac(%rbp),%eax
jg     12a0 <decToBin+0x160>
lea    -0x1a0(%rbp),%rdi
lea    -0x1a4(%rbp),%rsi
mov    $0x0,%al
call   1040 <desempilha@plt>
lea    -0x1a0(%rbp),%rdi
add    $0xcc,%rdi
mov    -0x1a4(%rbp),%esi
mov    $0x0,%al
call   1030 <empilha@plt>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    124a <decToBin+0x10a>
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%eax
cmp    -0x1ac(%rbp),%eax
jge    12fa <decToBin+0x1ba>
movslq -0x1a8(%rbp),%rax
mov    -0xd4(%rbp,%rax,4),%esi
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    12b8 <decToBin+0x178>
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decToBin>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1b0,%rsp
mov    %edi,%ebp
lea    0x10(%rsp),%rdi
xor    %eax,%eax
call   1060 <inicializa@plt>
lea    0xdc(%rsp),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <inicializa@plt>
cmp    $0x2,%ebp
jae    1189 <decToBin+0x49>
lea    0x10(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <empilha@plt>
mov    $0x1,%ebx
jmp    11da <decToBin+0x9a>
mov    $0x1,%ebx
lea    0x10(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%eax
shr    $0x1f,%eax
add    %ebp,%eax
mov    %ebp,%esi
mov    %eax,%ebp
and    $0xfffffffe,%eax
sub    %eax,%esi
mov    %esi,0xc(%rsp)
sar    %ebp
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <empilha@plt>
add    $0x1,%ebx
cmp    $0x1,%ebp
ja     11a0 <decToBin+0x60>
lea    0x10(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <empilha@plt>
test   %ebx,%ebx
js     124c <decToBin+0x10c>
mov    $0xffffffff,%ebp
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%r12
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <desempilha@plt>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <empilha@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    11f0 <decToBin+0xb0>
lea    0xde7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
jle    125a <decToBin+0x11a>
mov    %ebx,%ebp
lea    0xdfa(%rip),%r14
xor    %ebx,%ebx
nop
mov    0xdc(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1230 <decToBin+0xf0>
jmp    125a <decToBin+0x11a>
lea    0xdad(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1b0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.anon = type { [50 x i32], i32 }
@.str = [39 x i8] c"\0A\09O valor convertido para binario e = \00"
@.str.1 = [3 x i8] c"%d\00"
define void @decToBin(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x %struct.anon]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %15, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %3, i64 0, i64 %12
%14 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @inicializa to i32 (%struct.anon*, ...)*)(%struct.anon* %13)
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %7
18: ; preds = %7
br label %19
19: ; preds = %27, %18
%20 = load i32, i32* %2
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32, i32* %2
%24 = icmp ne i32 %23, 1
br label %25
25: ; preds = %22, %19
%26 = phi i1 [ false, %19 ], [ %24, %22 ]
br i1 %26, label %27, label %37
27: ; preds = %25
%28 = load i32, i32* %2
%29 = srem i32 %28, 2
store i32 %29, i32* %4
%30 = load i32, i32* %2
%31 = sdiv i32 %30, 2
store i32 %31, i32* %2
%32 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %3, i64 0, i64 0
%33 = load i32, i32* %4
%34 = call i32 (%struct.anon*, i32, ...) bitcast (i32 (...)* @empilha to i32 (%struct.anon*, i32, ...)*)(%struct.anon* %32, i32 %33)
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %19
37: ; preds = %25
%38 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %3, i64 0, i64 0
%39 = load i32, i32* %2
%40 = call i32 (%struct.anon*, i32, ...) bitcast (i32 (...)* @empilha to i32 (%struct.anon*, i32, ...)*)(%struct.anon* %38, i32 %39)
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
store i32 0, i32* %5
br label %43
43: ; preds = %53, %37
%44 = load i32, i32* %5
%45 = load i32, i32* %6
%46 = icmp sle i32 %44, %45
br i1 %46, label %47, label %56
47: ; preds = %43
%48 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %3, i64 0, i64 0
%49 = call i32 (%struct.anon*, i32*, ...) bitcast (i32 (...)* @desempilha to i32 (%struct.anon*, i32*, ...)*)(%struct.anon* %48, i32* %4)
%50 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %3, i64 0, i64 1
%51 = load i32, i32* %4
%52 = call i32 (%struct.anon*, i32, ...) bitcast (i32 (...)* @empilha to i32 (%struct.anon*, i32, ...)*)(%struct.anon* %50, i32 %51)
br label %53
53: ; preds = %47
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 1
store i32 %55, i32* %5
br label %43
56: ; preds = %43
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %58
58: ; preds = %70, %56
%59 = load i32, i32* %5
%60 = load i32, i32* %6
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %73
62: ; preds = %58
%63 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %3, i64 0, i64 1
%64 = getelementptr inbounds %struct.anon, %struct.anon* %63, i32 0, i32 0
%65 = load i32, i32* %5
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [50 x i32], [50 x i32]* %64, i64 0, i64 %66
%68 = load i32, i32* %67
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %68)
br label %70
70: ; preds = %62
%71 = load i32, i32* %5
%72 = add nsw i32 %71, 1
store i32 %72, i32* %5
br label %58
73: ; preds = %58
ret void
}

LLVM IR (-O2):
%struct.anon = type { [50 x i32], i32 }
@.str = [39 x i8] c"\0A\09O valor convertido para binario e = \00"
@.str.1 = [3 x i8] c"%d\00"
define void @decToBin(i32 %0) {
%2 = alloca [2 x %struct.anon]
%3 = alloca i32
%4 = bitcast [2 x %struct.anon]* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %2, i64 0, i64 0
%7 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @inicializa to i32 (%struct.anon*, ...)*)(%struct.anon* %6)
%8 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %2, i64 0, i64 1
%9 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @inicializa to i32 (%struct.anon*, ...)*)(%struct.anon* %8)
%10 = icmp ult i32 %0, 2
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 (%struct.anon*, i32, ...) bitcast (i32 (...)* @empilha to i32 (%struct.anon*, i32, ...)*)(%struct.anon* %6, i32 %0)
br label %26
13: ; preds = %1, %13
%14 = phi i32 [ %19, %13 ], [ 1, %1 ]
%15 = phi i32 [ %17, %13 ], [ %0, %1 ]
%16 = srem i32 %15, 2
store i32 %16, i32* %3
%17 = sdiv i32 %15, 2
%18 = call i32 (%struct.anon*, i32, ...) bitcast (i32 (...)* @empilha to i32 (%struct.anon*, i32, ...)*)(%struct.anon* %6, i32 %16)
%19 = add i32 %14, 1
%20 = icmp ult i32 %17, 2
br i1 %20, label %21, label %13
21: ; preds = %13
%22 = call i32 (%struct.anon*, i32, ...) bitcast (i32 (...)* @empilha to i32 (%struct.anon*, i32, ...)*)(%struct.anon* %6, i32 %17)
%23 = icmp slt i32 %19, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %47
26: ; preds = %11, %21
%27 = phi i32 [ 1, %11 ], [ %19, %21 ]
br label %28
28: ; preds = %26, %28
%29 = phi i32 [ 0, %26 ], [ %33, %28 ]
%30 = call i32 (%struct.anon*, i32*, ...) bitcast (i32 (...)* @desempilha to i32 (%struct.anon*, i32*, ...)*)(%struct.anon* %6, i32* %3)
%31 = load i32, i32* %3
%32 = call i32 (%struct.anon*, i32, ...) bitcast (i32 (...)* @empilha to i32 (%struct.anon*, i32, ...)*)(%struct.anon* %8, i32 %31)
%33 = add nuw i32 %29, 1
%34 = icmp eq i32 %29, %27
br i1 %34, label %35, label %28
35: ; preds = %28
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%37 = icmp sgt i32 %27, 0
br i1 %37, label %38, label %47
38: ; preds = %35
%39 = zext i32 %27 to i64
br label %40
40: ; preds = %38, %40
%41 = phi i64 [ 0, %38 ], [ %45, %40 ]
%42 = getelementptr inbounds [2 x %struct.anon], [2 x %struct.anon]* %2, i64 0, i64 1, i32 0, i64 %41
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %43)
%45 = add nuw nsw i64 %41, 1
%46 = icmp eq i64 %45, %39
br i1 %46, label %47, label %40
47: ; preds = %40, %24, %35
ret void
}