#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 sifreli_sayi, sayi, binler, yuzler, onlar, birler, ara_degisken;
  printf("Programdan cikmak icin -1 giriniz.\n");
  printf("Sifresi cozulecek sayiyi giriniz:");
  scanf("%d", &sayi);
  while (sayi != -1) {
    binler = sayi / 1000;
    binler = binler + 3;
    binler = binler % 10;
    yuzler = sayi / 100;
    yuzler = yuzler + 3;
    yuzler = yuzler % 10;
    onlar = sayi / 10;
    onlar = onlar + 3;
    onlar = onlar % 10;
    birler = sayi % 10;
    birler = birler + 3;
    birler = birler % 10;
    ara_degisken = birler;
    birler = yuzler;
    yuzler = ara_degisken;
    ara_degisken = onlar;
    onlar = binler;
    binler = ara_degisken;
    sifreli_sayi = (1000 * binler) + (100 * yuzler) + (10 * onlar) + (birler);
    printf("Sifreli sayiniz %d dir. Gonderilen sayiniz %d dir.\n", sayi,
           sifreli_sayi);
    printf("Sifresi cozulecek sayiyi giriniz:");
    scanf("%d", &sayi);
  }
  printf("Programdan Sonlandirilmistir.");
  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    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0xc(%rbp)
je     126d <main+0x14d>
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0x3e8,-0x10(%rbp),%eax
imul   $0x64,-0x14(%rbp),%ecx
add    %ecx,%eax
imul   $0xa,-0x18(%rbp),%ecx
add    %ecx,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
jmp    115b <main+0x3b>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xf33(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0xffffffff,%eax
je     12a4 <main+0x174>
lea    0xea9(%rip),%r14
lea    0xe7d(%rip),%r15
lea    0xe98(%rip),%r12
lea    0xc(%rsp),%r13
nop
movslq %eax,%rsi
imul   $0x10624dd3,%rsi,%rax
mov    %rax,%rcx
sar    $0x26,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x3,%eax
movslq %eax,%r8
imul   $0x66666667,%r8,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%r8d
imul   $0x51eb851f,%rsi,%rcx
mov    %rcx,%rdx
sar    $0x25,%rdx
shr    $0x3f,%rcx
add    %edx,%ecx
add    $0x3,%ecx
movslq %ecx,%r9
imul   $0x66666667,%r9,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rdx
add    %edi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%r9d
imul   $0x66666667,%rsi,%rdi
mov    %rdi,%rbx
shr    $0x3f,%rbx
sar    $0x22,%rdi
lea    (%rdi,%rbx,1),%edx
add    $0x3,%edx
movslq %edx,%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
add    %ebx,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
mov    %esi,%ecx
sub    %eax,%ecx
add    $0x3,%cl
movsbl %cl,%eax
imul   $0x67,%eax,%ecx
movzwl %cx,%edi
shr    $0xa,%ecx
shr    $0xf,%edi
add    %cl,%dil
movzbl %dil,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
movsbl %al,%eax
imul   $0x3e8,%edx,%ecx
add    %r9d,%ecx
imul   $0x64,%eax,%eax
lea    (%r8,%r8,4),%edx
lea    (%rcx,%rdx,2),%edx
add    %eax,%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0xffffffff,%eax
jne    1190 <main+0x60>
lea    0xdae(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Programdan cikmak icin -1 giriniz.\0A\00"
@.str.1 = [34 x i8] c"Sifresi cozulecek sayiyi giriniz:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [52 x i8] c"Sifreli sayiniz %d dir. Gonderilen sayiniz %d dir.\0A\00"
@.str.4 = [30 x i8] c"Programdan Sonlandirilmistir.\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
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
br label %12
12: ; preds = %15, %0
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %61
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sdiv i32 %16, 1000
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 3
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = srem i32 %20, 10
store i32 %21, i32* %4
%22 = load i32, i32* %3
%23 = sdiv i32 %22, 100
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 3
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = srem i32 %26, 10
store i32 %27, i32* %5
%28 = load i32, i32* %3
%29 = sdiv i32 %28, 10
store i32 %29, i32* %6
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 3
store i32 %31, i32* %6
%32 = load i32, i32* %6
%33 = srem i32 %32, 10
store i32 %33, i32* %6
%34 = load i32, i32* %3
%35 = srem i32 %34, 10
store i32 %35, i32* %7
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 3
store i32 %37, i32* %7
%38 = load i32, i32* %7
%39 = srem i32 %38, 10
store i32 %39, i32* %7
%40 = load i32, i32* %7
store i32 %40, i32* %8
%41 = load i32, i32* %5
store i32 %41, i32* %7
%42 = load i32, i32* %8
store i32 %42, i32* %5
%43 = load i32, i32* %6
store i32 %43, i32* %8
%44 = load i32, i32* %4
store i32 %44, i32* %6
%45 = load i32, i32* %8
store i32 %45, i32* %4
%46 = load i32, i32* %4
%47 = mul nsw i32 1000, %46
%48 = load i32, i32* %5
%49 = mul nsw i32 100, %48
%50 = add nsw i32 %47, %49
%51 = load i32, i32* %6
%52 = mul nsw i32 10, %51
%53 = add nsw i32 %50, %52
%54 = load i32, i32* %7
%55 = add nsw i32 %53, %54
store i32 %55, i32* %2
%56 = load i32, i32* %3
%57 = load i32, i32* %2
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 %56, i32 %57)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%60 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
br label %12
61: ; preds = %12
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"Sifresi cozulecek sayiyi giriniz:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [52 x i8] c"Sifreli sayiniz %d dir. Gonderilen sayiniz %d dir.\0A\00"
@.str.4 = [30 x i8] c"Programdan Sonlandirilmistir.\00"
@str = [35 x i8] c"Programdan cikmak icin -1 giriniz.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 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 = icmp eq i32 %6, -1
br i1 %7, label %35, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %33, %8 ], [ %6, %0 ]
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %10, 3
%12 = srem i32 %11, 10
%13 = sdiv i32 %9, 100
%14 = add nsw i32 %13, 3
%15 = srem i32 %14, 10
%16 = sdiv i32 %9, 10
%17 = add nsw i32 %16, 3
%18 = srem i32 %17, 10
%19 = srem i32 %9, 10
%20 = trunc i32 %19 to i8
%21 = add nsw i8 %20, 3
%22 = srem i8 %21, 10
%23 = sext i8 %22 to i32
%24 = mul nsw i32 %18, 1000
%25 = mul nsw i32 %23, 100
%26 = mul nsw i32 %12, 10
%27 = add nsw i32 %24, %15
%28 = add nsw i32 %27, %26
%29 = add nsw i32 %28, %25
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%33 = load i32, i32* %1
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %8
35: ; preds = %8, %0
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}