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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4ee728,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movl   $0x63427,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     117a <main+0x6a>
mov    -0xc(%rbp),%esi
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x5a06e,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     11c7 <main+0xb7>
mov    -0xc(%rbp),%esi
lea    0xdff(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2427e6,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1214 <main+0x104>
mov    -0xc(%rbp),%esi
lea    0xdb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x21507d,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1261 <main+0x151>
mov    -0xc(%rbp),%esi
lea    0xd65(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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