#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 main() {
  int counter, digit, number = 0;
  int first_digit, second_digit, third_digit, fourth_digit, fifth_digit;
  printf("Enter five-digits integer number");
  scanf("%d", &number);
  for (counter = 0; counter < 5; counter++) {
    digit = number % 10;
    number = number / 10;
    switch (counter) {
    case 0:
      first_digit = digit;
      break;
    case 1:
      second_digit = digit;
      break;
    case 2:
      third_digit = digit;
      break;
    case 3:
      fourth_digit = digit;
      break;
    case 4:
      fifth_digit = digit;
    }
  }
  printf("The number separated by spaces : %d %d %d %d %d", fifth_digit,
         fourth_digit, third_digit, second_digit, first_digit);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1210 <main+0xf0>
movslq -0x10(%rbp),%rcx
mov    %ecx,%eax
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rdx
add    %ecx,%edx
add    %edx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movslq -0x10(%rbp),%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x30(%rbp)
sub    $0x4,%rax
ja     11fd <main+0xdd>
mov    -0x30(%rbp),%rax
lea    0xe3e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11fd <main+0xdd>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    11fd <main+0xdd>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11fd <main+0xdd>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11fd <main+0xdd>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1202 <main+0xe2>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <main+0x3b>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%r9
imul   $0x66666667,%r9,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x22,%rcx
add    %eax,%ecx
lea    (%rcx,%rcx,1),%eax
lea    (%rax,%rax,4),%r8d
imul   $0x51eb851f,%r9,%r10
imul   $0x10624dd3,%r9,%r11
imul   $0x68db8bad,%r9,%rbx
imul   $0x14f8b589,%r9,%rdi
sub    %r8d,%r9d
movslq %ecx,%r8
imul   $0x66666667,%r8,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%r8d
mov    %r10,%rcx
shr    $0x3f,%rcx
sar    $0x25,%r10
add    %ecx,%r10d
movslq %r10d,%rcx
imul   $0x66666667,%rcx,%rsi
mov    %rsi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rsi
add    %edx,%esi
add    %esi,%esi
lea    (%rsi,%rsi,4),%edx
sub    %edx,%ecx
mov    %r11,%rdx
shr    $0x3f,%rdx
sar    $0x26,%r11
add    %edx,%r11d
movslq %r11d,%rdx
imul   $0x66666667,%rdx,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x22,%rsi
add    %eax,%esi
add    %esi,%esi
lea    (%rsi,%rsi,4),%eax
sub    %eax,%edx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x2c,%rbx
add    %eax,%ebx
movslq %ebx,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rbx
shr    $0x3f,%rbx
sar    $0x22,%rax
add    %ebx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x2d,%rdi
add    %eax,%edi
mov    %edi,0xc(%rsp)
lea    0xddc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter five-digits integer number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [48 x i8] c"The number separated by spaces : %d %d %d %d %d\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
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
store i32 0, i32* %2
br label %12
12: ; preds = %32, %0
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 5
br i1 %14, label %15, label %35
15: ; preds = %12
%16 = load i32, i32* %4
%17 = srem i32 %16, 10
store i32 %17, i32* %3
%18 = load i32, i32* %4
%19 = sdiv i32 %18, 10
store i32 %19, i32* %4
%20 = load i32, i32* %2
switch i32 %20, label %31 [
i32 0, label %21
i32 1, label %23
i32 2, label %25
i32 3, label %27
i32 4, label %29
]
21: ; preds = %15
%22 = load i32, i32* %3
store i32 %22, i32* %5
br label %31
23: ; preds = %15
%24 = load i32, i32* %3
store i32 %24, i32* %6
br label %31
25: ; preds = %15
%26 = load i32, i32* %3
store i32 %26, i32* %7
br label %31
27: ; preds = %15
%28 = load i32, i32* %3
store i32 %28, i32* %8
br label %31
29: ; preds = %15
%30 = load i32, i32* %3
store i32 %30, i32* %9
br label %31
31: ; preds = %29, %15, %27, %25, %23, %21
br label %32
32: ; preds = %31
%33 = load i32, i32* %2
%34 = add nsw i32 %33, 1
store i32 %34, i32* %2
br label %12
35: ; preds = %12
%36 = load i32, i32* %9
%37 = load i32, i32* %8
%38 = load i32, i32* %7
%39 = load i32, i32* %6
%40 = load i32, i32* %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 %36, i32 %37, i32 %38, i32 %39, i32 %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter five-digits integer number\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [48 x i8] c"The number separated by spaces : %d %d %d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 10
%7 = sdiv i32 %5, 10
%8 = srem i32 %7, 10
%9 = sdiv i32 %5, 100
%10 = srem i32 %9, 10
%11 = sdiv i32 %5, 1000
%12 = srem i32 %11, 10
%13 = sdiv i32 %5, 10000
%14 = srem i32 %13, 10
%15 = sdiv i32 %5, 100000
store i32 %15, i32* %1
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %12, i32 %10, i32 %8, i32 %6)
ret i32 0
}