#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 integer_number = 0;
  double decimal_number = 0.0;
  char character_string[] = "Your Name Here";
  printf("\nhello, world - from: %s\n", character_string);
  printf("\nPlease enter a number, then I'll double it: ");
  scanf("%d", &integer_number);
  printf("You entered: %d\n", integer_number);
  integer_number = integer_number * 2;
  printf("Your number doubled: %d\n\n", integer_number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xeb9(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xeb3(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xeab(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x1f(%rbp),%rsi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x4(%rsp)
movabs $0x6572654820656d,%rax
mov    %rax,0xf(%rsp)
movabs $0x6d614e2072756f59,%rax
4e 61 6d
mov    %rax,0x8(%rsp)
lea    0xebe(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
add    %esi,%esi
mov    %esi,0x4(%rsp)
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.character_string = [15 x i8] c"Your Name Here\00"
@.str = [26 x i8] c"\0Ahello, world - from: %s\0A\00"
@.str.1 = [46 x i8] c"\0APlease enter a number, then I'll double it: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [17 x i8] c"You entered: %d\0A\00"
@.str.4 = [26 x i8] c"Your number doubled: %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca [15 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store double 0.000000e+00, double* %3
%5 = bitcast [15 x i8]* %4 to i8*
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %4, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, 2
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.character_string = [15 x i8] c"Your Name Here\00"
@.str = [26 x i8] c"\0Ahello, world - from: %s\0A\00"
@.str.1 = [46 x i8] c"\0APlease enter a number, then I'll double it: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [17 x i8] c"You entered: %d\0A\00"
@.str.4 = [26 x i8] c"Your number doubled: %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
%11 = shl nsw i32 %10, 1
store i32 %11, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %11)
ret i32 0
}