#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(void) {
  int number;
  int a, b, c;
  int k, l, m;
  int f, g, h, j;
  int x, y, z, q;
  int sth;
  printf("\n          Created by: MCHD\n\n\n");
  printf("Enter the number that will be encrypt: ");
  scanf("%d", &number);
  a = number / 1000;
  k = number % 1000;
  b = k / 100;
  l = k % 100;
  c = l / 10;
  m = l % 10;
  f = a + 7;
  g = b + 7;
  h = c + 7;
  j = m + 7;
  x = f % 10;
  y = g % 10;
  z = h % 10;
  q = j % 10;
  printf("\n\n     Encrypted number:   %d %d %d %d\n\n\n\n", z, q, x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x34(%rbp)
mov    -0x28(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x3c(%rbp)
mov    -0x30(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x40(%rbp)
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%r8
shr    $0x3f,%r8
sar    $0x26,%rcx
lea    (%rcx,%r8,1),%edx
imul   $0x3e8,%edx,%edx
sub    %edx,%eax
movswl %ax,%edx
imul   $0x147b,%edx,%edx
mov    %edx,%esi
shr    $0x1f,%esi
sar    $0x13,%edx
add    %esi,%edx
imul   $0x64,%edx,%esi
sub    %esi,%eax
movsbl %al,%esi
imul   $0x67,%esi,%esi
movzwl %si,%esi
movswl %si,%edi
shr    $0xf,%esi
shr    $0xa,%edi
add    %sil,%dil
movzbl %dil,%r9d
lea    (%r9,%r9,1),%edi
lea    (%rdi,%rdi,4),%edi
sub    %dil,%al
add    %r8d,%ecx
add    $0x7,%ecx
add    $0x7,%r9b
add    $0x7,%al
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdi
add    %esi,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%esi
sub    %esi,%ecx
add    $0x7,%dl
movsbl %dl,%edx
imul   $0x67,%edx,%esi
movzwl %si,%edi
shr    $0xa,%esi
shr    $0xf,%edi
add    %sil,%dil
movzbl %dil,%esi
add    %esi,%esi
lea    (%rsi,%rsi,4),%esi
sub    %sil,%dl
movsbl %dl,%r8d
movsbl %r9b,%edx
imul   $0x67,%edx,%esi
movzwl %si,%edi
shr    $0xa,%esi
shr    $0xf,%edi
add    %sil,%dil
movzbl %dil,%esi
add    %esi,%esi
lea    (%rsi,%rsi,4),%esi
sub    %sil,%dl
movsbl %dl,%esi
movsbl %al,%eax
imul   $0x67,%eax,%edx
movzwl %dx,%edi
shr    $0xa,%edx
shr    $0xf,%edi
add    %dl,%dil
movzbl %dil,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%al
movsbl %al,%edx
lea    0xdd9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0A Created by: MCHD\0A\0A\0A\00"
@.str.1 = [40 x i8] c"Enter the number that will be encrypt: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [43 x i8] c"\0A\0A Encrypted number: %d %d %d %d\0A\0A\0A\0A\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
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store i32 0, i32* %1
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%21 = load i32, i32* %2
%22 = sdiv i32 %21, 1000
store i32 %22, i32* %3
%23 = load i32, i32* %2
%24 = srem i32 %23, 1000
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = sdiv i32 %25, 100
store i32 %26, i32* %4
%27 = load i32, i32* %6
%28 = srem i32 %27, 100
store i32 %28, i32* %7
%29 = load i32, i32* %7
%30 = sdiv i32 %29, 10
store i32 %30, i32* %5
%31 = load i32, i32* %7
%32 = srem i32 %31, 10
store i32 %32, i32* %8
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 7
store i32 %34, i32* %9
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 7
store i32 %36, i32* %10
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 7
store i32 %38, i32* %11
%39 = load i32, i32* %8
%40 = add nsw i32 %39, 7
store i32 %40, i32* %12
%41 = load i32, i32* %9
%42 = srem i32 %41, 10
store i32 %42, i32* %13
%43 = load i32, i32* %10
%44 = srem i32 %43, 10
store i32 %44, i32* %14
%45 = load i32, i32* %11
%46 = srem i32 %45, 10
store i32 %46, i32* %15
%47 = load i32, i32* %12
%48 = srem i32 %47, 10
store i32 %48, i32* %16
%49 = load i32, i32* %15
%50 = load i32, i32* %16
%51 = load i32, i32* %13
%52 = load i32, i32* %14
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %49, i32 %50, i32 %51, i32 %52)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [40 x i8] c"Enter the number that will be encrypt: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [43 x i8] c"\0A\0A Encrypted number: %d %d %d %d\0A\0A\0A\0A\00"
@str = [30 x i8] c"\0A Created by: MCHD\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 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, 1000
%8 = srem i32 %6, 1000
%9 = trunc i32 %8 to i16
%10 = sdiv i16 %9, 100
%11 = srem i16 %9, 100
%12 = trunc i16 %11 to i8
%13 = sdiv i8 %12, 10
%14 = srem i8 %12, 10
%15 = add nsw i32 %7, 7
%16 = add nsw i8 %13, 7
%17 = add nsw i8 %14, 7
%18 = srem i32 %15, 10
%19 = trunc i16 %10 to i8
%20 = add nsw i8 %19, 7
%21 = srem i8 %20, 10
%22 = sext i8 %21 to i32
%23 = srem i8 %16, 10
%24 = sext i8 %23 to i32
%25 = srem i8 %17, 10
%26 = sext i8 %25 to i32
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %24, i32 %26, i32 %18, i32 %22)
ret i32 0
}