#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 atoi(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (2 > argc) {
    printf("Nombre de paramètres insuffisants\n");
    return 1;
  }
  int n = atoi(argv[1]);
  int reverse = 0, temp;
  temp = n;
  while (temp != 0) {
    reverse = reverse * 10;
    reverse = reverse + temp % 10;
    temp = temp / 10;
  }
  if (n == reverse)
    printf("1");
  else
    printf("0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x8(%rbp),%eax
jle    115c <main+0x3c>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e6 <main+0xc6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11b6 <main+0x96>
imul   $0xa,-0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
jmp    1179 <main+0x59>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    11d3 <main+0xb3>
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
jmp    11df <main+0xbf>
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1149 <main+0x19>
lea    0xec3(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
test   %eax,%eax
je     1195 <main+0x65>
xor    %esi,%esi
mov    %eax,%ecx
nopw   0x0(%rax,%rax,1)
lea    (%rsi,%rsi,4),%r8d
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rcx
add    %edi,%ecx
lea    (%rcx,%rcx,1),%edi
lea    (%rdi,%rdi,4),%edi
mov    %edx,%esi
sub    %edi,%esi
lea    (%rsi,%r8,2),%esi
add    $0x9,%edx
cmp    $0x12,%edx
ja     1160 <main+0x30>
cmp    %esi,%eax
jne    119c <main+0x6c>
mov    $0x31,%edi
jmp    11a1 <main+0x71>
mov    $0x30,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [35 x i8] c"Nombre de param\C3\A8tres insuffisants\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %26
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %22, label %11
11: ; preds = %6, %11
%12 = phi i32 [ %17, %11 ], [ %9, %6 ]
%13 = phi i32 [ %16, %11 ], [ 0, %6 ]
%14 = mul nsw i32 %13, 10
%15 = srem i32 %12, 10
%16 = add nsw i32 %15, %14
%17 = sdiv i32 %12, 10
%18 = add i32 %12, 9
%19 = icmp ult i32 %18, 19
br i1 %19, label %20, label %11
20: ; preds = %11
%21 = icmp eq i32 %9, %16
br i1 %21, label %22, label %24
22: ; preds = %6, %20
%23 = tail call i32 @putchar(i32 49)
br label %26
24: ; preds = %20
%25 = tail call i32 @putchar(i32 48)
br label %26
26: ; preds = %22, %24, %4
%27 = phi i32 [ 1, %4 ], [ 0, %24 ], [ 0, %22 ]
ret i32 %27
}