#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 sayi1, birler, onlar, yuzler, binler, onbinler;
  printf("Bu program girdiginiz sayinin ilk 5 basamagini soyler.\n");
  printf("Bir sayi giriniz: ");
  scanf("%d", &sayi1);
  onbinler = sayi1 / 10000;
  onbinler = onbinler % 10;
  binler = sayi1 / 1000;
  binler = binler % 10;
  yuzler = sayi1 / 100;
  yuzler = yuzler % 10;
  onlar = sayi1 / 10;
  onlar = onlar % 10;
  birler = sayi1 % 10;
  printf("Onbinler basamagi:%d\nBinler basamagi:%d\nYuzler basamagi:%d\nOnlar "
         "basamagi:%d\nBirler basamagi:%d",
         onbinler, binler, yuzler, onlar, birler);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf56(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf3b(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf1e(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%r9
imul   $0x68db8bad,%r9,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2c,%rax
add    %ecx,%eax
movslq %eax,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
imul   $0x10624dd3,%r9,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
imul   $0x51eb851f,%r9,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rax
add    %edi,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ecx
imul   $0x66666667,%r9,%rax
mov    %rax,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rax
add    %edi,%eax
cltq
imul   $0x66666667,%rax,%rdi
mov    %rdi,%r8
shr    $0x3f,%r8
sar    $0x22,%rdi
add    %r8d,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%edi
mov    %eax,%r8d
sub    %edi,%r8d
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%r9d
lea    0xdd7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"Bu program girdiginiz sayinin ilk 5 basamagini soyler.\0A\00"
@.str.1 = [19 x i8] c"Bir sayi giriniz: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [96 x i8] c"Onbinler basamagi:%d\0ABinler basamagi:%d\0AYuzler basamagi:%d\0AOnlar basamagi:%d\0ABirler basamagi:%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
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 10000
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = srem i32 %13, 10
store i32 %14, i32* %7
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 1000
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = srem i32 %17, 10
store i32 %18, i32* %6
%19 = load i32, i32* %2
%20 = sdiv i32 %19, 100
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = srem i32 %21, 10
store i32 %22, i32* %5
%23 = load i32, i32* %2
%24 = sdiv i32 %23, 10
store i32 %24, i32* %4
%25 = load i32, i32* %4
%26 = srem i32 %25, 10
store i32 %26, i32* %4
%27 = load i32, i32* %2
%28 = srem i32 %27, 10
store i32 %28, i32* %3
%29 = load i32, i32* %7
%30 = load i32, i32* %6
%31 = load i32, i32* %5
%32 = load i32, i32* %4
%33 = load i32, i32* %3
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %30, i32 %31, i32 %32, i32 %33)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"Bir sayi giriniz: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [96 x i8] c"Onbinler basamagi:%d\0ABinler basamagi:%d\0AYuzler basamagi:%d\0AOnlar basamagi:%d\0ABirler basamagi:%d\00"
@str = [55 x i8] c"Bu program girdiginiz sayinin ilk 5 basamagini soyler.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 10000
%8 = srem i32 %7, 10
%9 = sdiv i32 %6, 1000
%10 = srem i32 %9, 10
%11 = sdiv i32 %6, 100
%12 = srem i32 %11, 10
%13 = sdiv i32 %6, 10
%14 = srem i32 %13, 10
%15 = srem i32 %6, 10
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @.str.3, i64 0, i64 0), i32 %8, i32 %10, i32 %12, i32 %14, i32 %15)
ret i32 0
}