#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);
void inverte(int a) {
  int tam = 1, i, j = 1;
  while (1) {
    if (a >= tam && a < tam * 10)
      break;
    tam = tam * 10;
  }
  for (i = 10; i <= tam; i = i * 10) {
    printf("[%d]", ((a % i) / j));
    j = j * 10;
  }
  printf("[%d]\n", (a / tam));
}


x86 assembly (clang, -O0):
<inverte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1149 <inverte+0x39>
mov    -0x4(%rbp),%eax
imul   $0xa,-0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    1149 <inverte+0x39>
jmp    1155 <inverte+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <inverte+0x19>
movl   $0xa,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1196 <inverte+0x86>
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
imul   $0xa,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    115c <inverte+0x4c>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%esi
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverte>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%r15d
mov    $0x1,%eax
mov    %eax,%r12d
lea    (%r12,%r12,1),%eax
lea    (%rax,%rax,4),%eax
cmp    %r15d,%r12d
jg     1120 <inverte+0x10>
cmp    %r15d,%eax
jle    1120 <inverte+0x10>
cmp    $0xa,%r12d
jb     1175 <inverte+0x65>
mov    $0xa,%ebp
mov    $0x1,%ebx
lea    0xeb5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r15d,%eax
cltd
idiv   %ebp
mov    %edx,%eax
cltd
idiv   %ebx
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%ebx
add    %ebp,%ebp
lea    0x0(%rbp,%rbp,4),%ebp
cmp    %r12d,%ebp
jbe    1150 <inverte+0x40>
mov    %r15d,%eax
cltd
idiv   %r12d
lea    0xe82(%rip),%rdi
mov    %eax,%esi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"[%d]\00"
@.str.1 = [6 x i8] c"[%d]\0A\00"
define void @inverte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 1, i32* %5
br label %6
6: ; preds = %1, %16
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 10
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %16
15: ; preds = %10
br label %19
16: ; preds = %10, %6
%17 = load i32, i32* %3
%18 = mul nsw i32 %17, 10
store i32 %18, i32* %3
br label %6
19: ; preds = %15
store i32 10, i32* %4
br label %20
20: ; preds = %33, %19
%21 = load i32, i32* %4
%22 = load i32, i32* %3
%23 = icmp sle i32 %21, %22
br i1 %23, label %24, label %36
24: ; preds = %20
%25 = load i32, i32* %2
%26 = load i32, i32* %4
%27 = srem i32 %25, %26
%28 = load i32, i32* %5
%29 = sdiv i32 %27, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %5
%32 = mul nsw i32 %31, 10
store i32 %32, i32* %5
br label %33
33: ; preds = %24
%34 = load i32, i32* %4
%35 = mul nsw i32 %34, 10
store i32 %35, i32* %4
br label %20
36: ; preds = %20
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = sdiv i32 %37, %38
%40 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %39)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"[%d]\00"
@.str.1 = [6 x i8] c"[%d]\0A\00"
define void @inverte(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp sle i32 %3, %0
%5 = mul nsw i32 %3, 10
%6 = icmp sgt i32 %5, %0
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = icmp ult i32 %3, 10
br i1 %9, label %19, label %10
10: ; preds = %8, %10
%11 = phi i32 [ %16, %10 ], [ 1, %8 ]
%12 = phi i32 [ %17, %10 ], [ 10, %8 ]
%13 = srem i32 %0, %12
%14 = sdiv i32 %13, %11
%15 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = mul nsw i32 %11, 10
%17 = mul nsw i32 %12, 10
%18 = icmp ugt i32 %17, %3
br i1 %18, label %19, label %10
19: ; preds = %10, %8
%20 = sdiv i32 %0, %3
%21 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret void
}