#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 *, double);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int i = 4;
  double d = 4.0;
  char s[] = "HackerRank ";
  int j = 0;
  double d1;
  char s1[] = "";
  scanf("%d", &j);
  scanf("%lf", &d1);
  scanf("%s", s1);
  printf("%d\n", i + j);
  printf("%lf\n", d + d1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xeac(%rip),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x29(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
lea    0xe8f(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe80(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x29(%rbp),%rsi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm0
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movb   $0x0,0xb(%rsp)
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeb1(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0x4,%eax
cvtsi2sd %eax,%xmm0
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0xe71(%rip),%xmm0
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [12 x i8] c"HackerRank \00"
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca [12 x i8]
%5 = alloca i32
%6 = alloca double
%7 = alloca [1 x i8]
store i32 0, i32* %1
store i32 4, i32* %2
store double 4.000000e+00, double* %3
%8 = bitcast [12 x i8]* %4 to i8*
store i32 0, i32* %5
%9 = bitcast [1 x i8]* %7 to i8*
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
%12 = getelementptr inbounds [1 x i8], [1 x i8]* %7, i64 0, i64 0
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = load i32, i32* %2
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = sitofp i32 %16 to double
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %17)
%19 = load double, double* %3
%20 = load double, double* %6
%21 = fadd double %19, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca [1 x i8]
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast double* %2 to i8*
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 0, i8* %6
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 4
%12 = sitofp i32 %11 to double
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %12)
%14 = load double, double* %2
%15 = fadd double %14, 4.000000e+00
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), double %15)
ret i32 0
}