#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int numero;
  scanf("%i", &numero);
  int n3 = numero % 10;
  int n2 = (numero - n3) / 10 % 10;
  int n1 = (numero - numero % 100) / 100;
  int soma = n1 + n2 * 3 + n3 * 5;
  int digito = soma % 7;
  int novo = numero * 10 + digito;
  printf("O NOVO NUMERO E = %i\n", novo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x24(%rbp),%eax
sub    %edx,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   $0x3,-0x10(%rbp),%ecx
add    %ecx,%eax
imul   $0x5,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
imul   $0xa,-0x8(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x2,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
imul   $0x51eb851f,%rax,%rsi
lea    (%rax,%rax,4),%r8d
sub    %edx,%eax
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
shr    $0x20,%rdx
sar    $0x2,%edx
add    %edi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
mov    %rsi,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rsi
sar    $0x5,%esi
add    %edx,%esi
lea    (%rcx,%rcx,2),%ecx
lea    (%rax,%rax,4),%eax
add    %esi,%eax
add    %ecx,%eax
cltq
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %eax,%ecx
lea    (%rcx,%r8,2),%esi
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [22 x i8] c"O NOVO NUMERO E = %i\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
store i32 0, i32* %1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
%15 = sdiv i32 %14, 10
%16 = srem i32 %15, 10
store i32 %16, i32* %4
%17 = load i32, i32* %2
%18 = load i32, i32* %2
%19 = srem i32 %18, 100
%20 = sub nsw i32 %17, %19
%21 = sdiv i32 %20, 100
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = mul nsw i32 %23, 3
%25 = add nsw i32 %22, %24
%26 = load i32, i32* %3
%27 = mul nsw i32 %26, 5
%28 = add nsw i32 %25, %27
store i32 %28, i32* %6
%29 = load i32, i32* %6
%30 = srem i32 %29, 7
store i32 %30, i32* %7
%31 = load i32, i32* %2
%32 = mul nsw i32 %31, 10
%33 = load i32, i32* %7
%34 = add nsw i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [22 x i8] c"O NOVO NUMERO E = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 10
%6 = sdiv i32 %4, 10
%7 = srem i32 %6, 10
%8 = sdiv i32 %4, 100
%9 = mul nsw i32 %7, 3
%10 = mul nsw i32 %5, 5
%11 = add nsw i32 %10, %8
%12 = add nsw i32 %11, %9
%13 = srem i32 %12, 7
%14 = mul nsw i32 %4, 10
%15 = add nsw i32 %13, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}