#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strparaint(char *);
int main(int argc, const char *argv[]) {
  int numero;
  char string[10000];
  printf("Digite a String Decimal: ");
  fgets(string, 10000, stdin);
  printf("String em inteiro: %d\n\nOperação para prova: %d\n",
         strparaint(string), strparaint(string) * 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2740,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x2730(%rbp),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    $0x2710,%esi
call   1050 <fgets@plt>
lea    -0x2730(%rbp),%rdi
call   1030 <strparaint@plt>
mov    %eax,-0x2734(%rbp)
lea    -0x2730(%rbp),%rdi
call   1030 <strparaint@plt>
mov    -0x2734(%rbp),%esi
mov    %eax,%edx
shl    $0x1,%edx
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x2740,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x2718,%rsp
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2710,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strparaint@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strparaint@plt>
lea    (%rax,%rax,1),%edx
lea    0xe9e(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x2718,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Digite a String Decimal: \00"
@stdin = global i32 0
@.str.1 = [50 x i8] c"String em inteiro: %d\0A\0AOpera\C3\A7\C3\A3o para prova: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [10000 x i8], [10000 x i8]* %7, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 10000, i32 %10)
%12 = getelementptr inbounds [10000 x i8], [10000 x i8]* %7, i64 0, i64 0
%13 = call i32 @strparaint(i8* %12)
%14 = getelementptr inbounds [10000 x i8], [10000 x i8]* %7, i64 0, i64 0
%15 = call i32 @strparaint(i8* %14)
%16 = mul nsw i32 %15, 2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Digite a String Decimal: \00"
@stdin = global i32 0
@.str.1 = [50 x i8] c"String em inteiro: %d\0A\0AOpera\C3\A7\C3\A3o para prova: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10000 x i8]
%4 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 10000, i32 %6)
%8 = call i32 @strparaint(i8* %4)
%9 = call i32 @strparaint(i8* %4)
%10 = shl nsw i32 %9, 1
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %10)
ret i32 0
}