#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ system(char *);
main() {
  int num;
  system("title Doble dun numero");
  system("cls");
  system("color 70");
  printf("PROGRAMA QUE CALCULA O DOBLE DUN NUMERO\n");
  printf("=======================================\n\n");
  printf("Introduce un numero:    ");
  scanf("%d", &num);
  printf("O doble de %d \202 %d", num, num * 2);
  fflush(stdin);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1030 <system@plt>
lea    0xeac(%rip),%rdi
call   1030 <system@plt>
lea    0xea4(%rip),%rdi
call   1030 <system@plt>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
shl    $0x1,%edx
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe98(%rip),%rdi
call   1040 <system@plt>
lea    0xea3(%rip),%rdi
call   1040 <system@plt>
lea    0xe9b(%rip),%rdi
call   1040 <system@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe80(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9b(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%esi
lea    (%rsi,%rsi,1),%edx
lea    0xe73(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"title Doble dun numero\00"
@.str.1 = [4 x i8] c"cls\00"
@.str.2 = [9 x i8] c"color 70\00"
@.str.3 = [41 x i8] c"PROGRAMA QUE CALCULA O DOBLE DUN NUMERO\0A\00"
@.str.4 = [42 x i8] c"=======================================\0A\0A\00"
@.str.5 = [25 x i8] c"Introduce un numero: \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [19 x i8] c"O doble de %d \82 %d\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = load i32, i32* %1
%11 = mul nsw i32 %10, 2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %9, i32 %11)
%13 = load i32, i32* @stdin
%14 = call i32 @fflush(i32 %13)
%15 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"title Doble dun numero\00"
@.str.1 = [4 x i8] c"cls\00"
@.str.2 = [9 x i8] c"color 70\00"
@.str.5 = [25 x i8] c"Introduce un numero: \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [19 x i8] c"O doble de %d \82 %d\00"
@stdin = global i32 0
@str = [40 x i8] c"PROGRAMA QUE CALCULA O DOBLE DUN NUMERO\00"
@str.8 = [41 x i8] c"=======================================\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.8, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = shl nsw i32 %10, 1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %10, i32 %11)
%13 = load i32, i32* @stdin
%14 = call i32 @fflush(i32 %13)
%15 = call i32 (...) @getchar()
ret i32 0
}