#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 /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n1, n2, du, dd, dc, res;
  printf("Sera que os numeros formam um palindromo?\n");
  printf("Digite dois numeros que eu te digo se sao palindromos ou nao.\n");
  scanf("%d"
        "%d",
        &n1, &n2);
  dc = (n2 / 100);
  dd = (n2 - dc * 100) / 10;
  du = (n2 - dd * 10 - dc * 100);
  res = (du * 100 + dd * 10 + dc * 1);
  if (res == n1) {
    printf("E um palindromo!\n");
  } else {
    printf("Nao e um palindromo!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
imul   $0x64,-0x18(%rbp),%ecx
sub    %ecx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   $0xa,-0x14(%rbp),%ecx
sub    %ecx,%eax
imul   $0x64,-0x18(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
imul   $0x64,-0x10(%rbp),%eax
imul   $0xa,-0x14(%rbp),%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x0,%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11c1 <main+0xa1>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    11cd <main+0xad>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
movslq (%rsp),%rcx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%edx
mov    %ecx,%esi
sub    %edx,%esi
movslq %esi,%rsi
imul   $0x66666667,%rsi,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rsi
add    %edi,%esi
add    %esi,%esi
lea    (%rsi,%rsi,4),%esi
add    %esi,%edx
sub    %edx,%ecx
imul   $0x64,%ecx,%ecx
add    %esi,%eax
add    %ecx,%eax
cmp    0x4(%rsp),%eax
lea    0xee4(%rip),%rax
lea    0xec8(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Sera que os numeros formam um palindromo?\0A\00"
@.str.1 = [63 x i8] c"Digite dois numeros que eu te digo se sao palindromos ou nao.\0A\00"
@.str.2 = [5 x i8] c"%d%d\00"
@.str.3 = [18 x i8] c"E um palindromo!\0A\00"
@.str.4 = [22 x i8] c"Nao e um palindromo!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3)
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 100
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %6
%15 = mul nsw i32 %14, 100
%16 = sub nsw i32 %13, %15
%17 = sdiv i32 %16, 10
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = mul nsw i32 %19, 10
%21 = sub nsw i32 %18, %20
%22 = load i32, i32* %6
%23 = mul nsw i32 %22, 100
%24 = sub nsw i32 %21, %23
store i32 %24, i32* %4
%25 = load i32, i32* %4
%26 = mul nsw i32 %25, 100
%27 = load i32, i32* %5
%28 = mul nsw i32 %27, 10
%29 = add nsw i32 %26, %28
%30 = load i32, i32* %6
%31 = mul nsw i32 %30, 1
%32 = add nsw i32 %29, %31
store i32 %32, i32* %7
%33 = load i32, i32* %7
%34 = load i32, i32* %2
%35 = icmp eq i32 %33, %34
br i1 %35, label %36, label %38
36: ; preds = %0
%37 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %40
38: ; preds = %0
%39 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [5 x i8] c"%d%d\00"
@str = [42 x i8] c"Sera que os numeros formam um palindromo?\00"
@str.5 = [62 x i8] c"Digite dois numeros que eu te digo se sao palindromos ou nao.\00"
@str.6 = [21 x i8] c"Nao e um palindromo!\00"
@str.7 = [17 x i8] c"E um palindromo!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.5, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 100
%10 = mul nsw i32 %9, 100
%11 = srem i32 %8, 100
%12 = srem i32 %11, 10
%13 = sub i32 %11, %12
%14 = add i32 %10, %13
%15 = sub i32 %8, %14
%16 = mul nsw i32 %15, 100
%17 = add i32 %13, %9
%18 = add i32 %17, %16
%19 = load i32, i32* %1
%20 = icmp eq i32 %18, %19
%21 = select i1 %20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.6, i64 0, i64 0)
%22 = call i32 @puts(i8* dereferenceable(1) %21)
ret i32 0
}