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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4ee728,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116f <main+0x5f>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x63427,-0x8(%rbp)
movl   $0x63427,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11e2 <main+0xd2>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    11ad <main+0x9d>
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x5a06e,-0x8(%rbp)
movl   $0x5a06e,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1255 <main+0x145>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1220 <main+0x110>
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2427e6,-0x8(%rbp)
movl   $0x2427e6,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     12c8 <main+0x1b8>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1293 <main+0x183>
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x21507d,-0x8(%rbp)
movl   $0x21507d,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     133b <main+0x22b>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1306 <main+0x1f6>
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xcb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"%d-%d\0A\00"
@.str.1 = [2 x i8] c"\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
%6 = load i32, i32* %2
store i32 %6, i32* %3
store i32 0, i32* %4
store i32 0, 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* %4
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 10
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
store i32 %16, i32* %5
%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* %3
%21 = load i32, i32* %5
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 406567, i32* %2
store i32 406567, i32* %3
store i32 0, i32* %4
store i32 0, 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* %4
%30 = load i32, i32* %5
%31 = mul nsw i32 %30, 10
%32 = load i32, i32* %4
%33 = add nsw i32 %31, %32
store i32 %33, i32* %5
%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* %3
%38 = load i32, i32* %5
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %37, i32 %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 368750, i32* %2
store i32 368750, i32* %3
store i32 0, i32* %4
store i32 0, 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* %4
%47 = load i32, i32* %5
%48 = mul nsw i32 %47, 10
%49 = load i32, i32* %4
%50 = add nsw i32 %48, %49
store i32 %50, i32* %5
%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* %3
%55 = load i32, i32* %5
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %54, i32 %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 2369510, i32* %2
store i32 2369510, i32* %3
store i32 0, i32* %4
store i32 0, 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* %4
%64 = load i32, i32* %5
%65 = mul nsw i32 %64, 10
%66 = load i32, i32* %4
%67 = add nsw i32 %65, %66
store i32 %67, i32* %5
%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* %3
%72 = load i32, i32* %5
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %71, i32 %72)
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 2183293, i32* %2
store i32 2183293, i32* %3
store i32 0, i32* %4
store i32 0, 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* %4
%81 = load i32, i32* %5
%82 = mul nsw i32 %81, 10
%83 = load i32, i32* %4
%84 = add nsw i32 %82, %83
store i32 %84, i32* %5
%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* %3
%89 = load i32, i32* %5
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %88, i32 %89)
ret i32 0
}

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