#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 /*<<< orphan*/ scanf(char *, char *);
int main() {
  char numero[3];
  scanf("%s", numero);
  char invertido[3];
  invertido[0] = numero[2];
  invertido[1] = numero[1];
  invertido[2] = numero[0];
  printf("O NUMERO INVERTIDO = %s\n", invertido);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x3(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x4(%rbp)
lea    -0x6(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x5(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%al
mov    %al,0x2(%rsp)
movzwl 0x5(%rsp),%eax
rol    $0x8,%ax
mov    %ax,0x3(%rsp)
lea    0xeb4(%rip),%rdi
lea    0x2(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [25 x i8] c"O NUMERO INVERTIDO = %s\0A\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
%9 = load i8, i8* %8
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%12 = load i8, i8* %11
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 %12, i8* %13
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [25 x i8] c"O NUMERO INVERTIDO = %s\0A\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
%9 = load i8, i8* %8
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 %9, i8* %10
%11 = load i8, i8* %3
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 %11, i8* %12
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}