#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, int);
int main() {
  int num = 5170984, r, rn = 0, print = num;
  while (num) {
    r = num % 10;
    rn = rn * 10 + r;
    num = num / 10;
  }
  printf("%d   %d\n", print, rn);
  num = 406567;
  r = 0;
  rn = 0;
  print = num;
  while (num) {
    r = num % 10;
    rn = rn * 10 + r;
    num = num / 10;
  }
  printf("%d   %d\n", print, rn);
  num = 368750;
  r = 0;
  rn = 0;
  print = num;
  while (num) {
    r = num % 10;
    rn = rn * 10 + r;
    num = num / 10;
  }
  printf("%d   %d\n", print, rn);
  num = 2369510;
  r = 0;
  rn = 0;
  print = num;
  while (num) {
    r = num % 10;
    rn = rn * 10 + r;
    num = num / 10;
  }
  printf("%d   %d\n", print, rn);
  num = 2183293;
  r = 0;
  rn = 0;
  print = num;
  while (num) {
    r = num % 10;
    rn = rn * 10 + r;
    num = num / 10;
  }
  printf("%d   %d\n", print, rn);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4ee728,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1168 <main+0x58>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1133 <main+0x23>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x63427,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11ca <main+0xba>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1195 <main+0x85>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
movl   $0x5a06e,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     122c <main+0x11c>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    11f7 <main+0xe7>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xdc7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2427e6,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     128e <main+0x17e>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1259 <main+0x149>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xd65(%rip),%rdi
call   1030 <printf@plt>
movl   $0x21507d,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     12f0 <main+0x1e0>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
imul   $0xa,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    12bb <main+0x1ab>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xd03(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4ee728,%esi
mov    $0x4aa05b,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x63427,%esi
mov    $0xbaea4,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5a06e,%esi
mov    $0xe207,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2427e6,%esi
mov    $0x26f90,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x21507d,%esi
mov    $0x3bdf64,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 5170984, i32* %2
store i32 0, i32* %4
%6 = load i32, i32* %2
store i32 %6, i32* %5
br label %7
7: ; preds = %10, %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, 10
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
store i32 %16, i32* %4
%17 = load i32, i32* %2
%18 = sdiv i32 %17, 10
store i32 %18, i32* %2
br label %7
19: ; preds = %7
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21)
store i32 406567, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%23 = load i32, i32* %2
store i32 %23, i32* %5
br label %24
24: ; preds = %27, %19
%25 = load i32, i32* %2
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %36
27: ; preds = %24
%28 = load i32, i32* %2
%29 = srem i32 %28, 10
store i32 %29, i32* %3
%30 = load i32, i32* %4
%31 = mul nsw i32 %30, 10
%32 = load i32, i32* %3
%33 = add nsw i32 %31, %32
store i32 %33, i32* %4
%34 = load i32, i32* %2
%35 = sdiv i32 %34, 10
store i32 %35, i32* %2
br label %24
36: ; preds = %24
%37 = load i32, i32* %5
%38 = load i32, i32* %4
%39 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %37, i32 %38)
store i32 368750, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%40 = load i32, i32* %2
store i32 %40, i32* %5
br label %41
41: ; preds = %44, %36
%42 = load i32, i32* %2
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %53
44: ; preds = %41
%45 = load i32, i32* %2
%46 = srem i32 %45, 10
store i32 %46, i32* %3
%47 = load i32, i32* %4
%48 = mul nsw i32 %47, 10
%49 = load i32, i32* %3
%50 = add nsw i32 %48, %49
store i32 %50, i32* %4
%51 = load i32, i32* %2
%52 = sdiv i32 %51, 10
store i32 %52, i32* %2
br label %41
53: ; preds = %41
%54 = load i32, i32* %5
%55 = load i32, i32* %4
%56 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %54, i32 %55)
store i32 2369510, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%57 = load i32, i32* %2
store i32 %57, i32* %5
br label %58
58: ; preds = %61, %53
%59 = load i32, i32* %2
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %70
61: ; preds = %58
%62 = load i32, i32* %2
%63 = srem i32 %62, 10
store i32 %63, i32* %3
%64 = load i32, i32* %4
%65 = mul nsw i32 %64, 10
%66 = load i32, i32* %3
%67 = add nsw i32 %65, %66
store i32 %67, i32* %4
%68 = load i32, i32* %2
%69 = sdiv i32 %68, 10
store i32 %69, i32* %2
br label %58
70: ; preds = %58
%71 = load i32, i32* %5
%72 = load i32, i32* %4
%73 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %71, i32 %72)
store i32 2183293, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%74 = load i32, i32* %2
store i32 %74, i32* %5
br label %75
75: ; preds = %78, %70
%76 = load i32, i32* %2
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %87
78: ; preds = %75
%79 = load i32, i32* %2
%80 = srem i32 %79, 10
store i32 %80, i32* %3
%81 = load i32, i32* %4
%82 = mul nsw i32 %81, 10
%83 = load i32, i32* %3
%84 = add nsw i32 %82, %83
store i32 %84, i32* %4
%85 = load i32, i32* %2
%86 = sdiv i32 %85, 10
store i32 %86, i32* %2
br label %75
87: ; preds = %75
%88 = load i32, i32* %5
%89 = load i32, i32* %4
%90 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %88, i32 %89)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 5170984, i32 4890715)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 406567, i32 765604)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 368750, i32 57863)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2369510, i32 159632)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2183293, i32 3923812)
ret i32 0
}