#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int N, C, D, U;
  printf("\n ** Inversor de numeros de 3 digitos **\n\n");
  printf("Informe um numero de 3 digitos >=1,<=999 com o primeiro diferente de "
         "0: ");
  scanf("%i", &N);
  C = N / 100;
  D = (N % 100) / 10;
  U = ((N % 100) % 10) / 1;
  printf("\nO inverso do numero %i é: %i%i%i.\n\n", N, U, D, C);
  printf("<< Marco Tulio >>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf19(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
movslq 0x4(%rsp),%rsi
imul   $0x51eb851f,%rsi,%r8
mov    %r8,%rax
shr    $0x3f,%rax
sar    $0x25,%r8
add    %eax,%r8d
imul   $0x64,%r8d,%ecx
mov    %esi,%eax
sub    %ecx,%eax
movsbl %al,%ecx
imul   $0x67,%ecx,%ecx
movzwl %cx,%ecx
movswl %cx,%edx
shr    $0xf,%ecx
shr    $0xa,%edx
add    %cl,%dl
movsbl %dl,%ecx
movzbl %cl,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%al
movsbl %al,%edx
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\0A ** Inversor de numeros de 3 digitos **\0A\0A\00"
@.str.1 = [73 x i8] c"Informe um numero de 3 digitos >=1,<=999 com o primeiro diferente de 0: \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [38 x i8] c"\0AO inverso do numero %i \C3\A9: %i%i%i.\0A\0A\00"
@.str.4 = [19 x i8] c"<< Marco Tulio >>\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = sdiv i32 %8, 100
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = srem i32 %10, 100
%12 = sdiv i32 %11, 10
store i32 %12, i32* %3
%13 = load i32, i32* %1
%14 = srem i32 %13, 100
%15 = srem i32 %14, 10
%16 = sdiv i32 %15, 1
store i32 %16, i32* %4
%17 = load i32, i32* %1
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %17, i32 %18, i32 %19, i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 (...) @getchar()
%24 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [73 x i8] c"Informe um numero de 3 digitos >=1,<=999 com o primeiro diferente de 0: \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [38 x i8] c"\0AO inverso do numero %i \C3\A9: %i%i%i.\0A\0A\00"
@str = [42 x i8] c"\0A ** Inversor de numeros de 3 digitos **\0A\00"
@str.5 = [18 x i8] c"<< Marco Tulio >>\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 100
%8 = srem i32 %6, 100
%9 = trunc i32 %8 to i8
%10 = sdiv i8 %9, 10
%11 = sext i8 %10 to i32
%12 = srem i8 %9, 10
%13 = sext i8 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %6, i32 %13, i32 %11, i32 %7)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0))
%16 = call i32 (...) @getchar()
%17 = call i32 (...) @getchar()
ret i32 0
}