#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 main() {
  int i = 4;
  double d = 4.0;
  char s[] = "HackerRank ";
  int j, index = 0, counter = 0;
  char buffer[100];
  double sum;
  char name[100];
  scanf("%d", &j);
  scanf("%lf", &sum);
  do {
    index++;
    scanf("%c", &name[counter]);
    buffer[index] = name[counter];
    counter++;
  } while (buffer[index] != '\n');
  printf("%d\n", i + j);
  printf("%.1f\n", sum + d);
  printf("%sis the best place to learn and practice coding!", s);
  counter = 0;
  while (name[counter] != '\n') {
    printf("%c", name[counter]);
    counter++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xeb9(%rip),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    0xea5(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe96(%rip),%rdi
lea    -0x98(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movslq -0x28(%rbp),%rax
lea    -0x100(%rbp),%rsi
add    %rax,%rsi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x28(%rbp),%rax
mov    -0x100(%rbp,%rax,1),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x90(%rbp,%rax,1)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
movslq -0x24(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    118f <main+0x6f>
mov    -0x8(%rbp),%esi
add    -0x20(%rbp),%esi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0x10(%rbp),%xmm0
lea    0xe12(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rsi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
movslq -0x28(%rbp),%rax
movsbl -0x100(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
je     126d <main+0x14d>
movslq -0x28(%rbp),%rax
movsbl -0x100(%rbp,%rax,1),%esi
ff
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1230 <main+0x110>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
movabs $0x615272656b636148,%rax
72 52 61
mov    %rax,0x10(%rsp)
movl   $0x206b6e,0x18(%rsp)
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeac(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x20(%rsp),%rbx
lea    0xe98(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpb   $0xa,(%rbx)
lea    0x1(%rbx),%rbx
jne    1190 <main+0x60>
mov    0x4(%rsp),%esi
add    $0x4,%esi
lea    0xe6a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe37(%rip),%xmm0
lea    0xe52(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe4a(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%al
cmp    $0xa,%al
je     1213 <main+0xe3>
lea    0x21(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
cmp    $0xa,%al
jne    1200 <main+0xd0>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
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"%c\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [6 x i8] c"%.1f\0A\00"
@.str.5 = [50 x i8] c"%sis the best place to learn and practice coding!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca [12 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [100 x i8]
%9 = alloca double
%10 = alloca [100 x i8]
store i32 0, i32* %1
store i32 4, i32* %2
store double 4.000000e+00, double* %3
%11 = bitcast [12 x i8]* %4 to i8*
store i32 0, i32* %6
store i32 0, i32* %7
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %9)
br label %14
14: ; preds = %30, %0
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 %18
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 %26
store i8 %24, i8* %27
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %30
30: ; preds = %14
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %35, 10
br i1 %36, label %14, label %37
37: ; preds = %30
%38 = load i32, i32* %2
%39 = load i32, i32* %5
%40 = add nsw i32 %38, %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %40)
%42 = load double, double* %9
%43 = load double, double* %3
%44 = fadd double %42, %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %44)
%46 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i8* %46)
store i32 0, i32* %7
br label %48
48: ; preds = %55, %37
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp ne i32 %53, 10
br i1 %54, label %55, label %64
55: ; preds = %48
%56 = load i32, i32* %7
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %60)
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
br label %48
64: ; preds = %48
ret i32 0
}

LLVM IR (-O2):
@__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"%c\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [6 x i8] c"%.1f\0A\00"
@.str.5 = [50 x i8] c"%sis the best place to learn and practice coding!\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca i32
%3 = alloca double
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%6 = bitcast i32* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
br label %11
11: ; preds = %11, %0
%12 = phi i64 [ %16, %11 ], [ 0, %0 ]
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %12
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = load i8, i8* %13
%16 = add nuw i64 %12, 1
%17 = icmp eq i8 %15, 10
br i1 %17, label %18, label %11
18: ; preds = %11
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 4
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load double, double* %3
%23 = fadd double %22, 4.000000e+00
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %23)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%26 = load i8, i8* %8
%27 = icmp eq i8 %26, 10
br i1 %27, label %37, label %28
28: ; preds = %18, %28
%29 = phi i64 [ %33, %28 ], [ 0, %18 ]
%30 = phi i8 [ %35, %28 ], [ %26, %18 ]
%31 = sext i8 %30 to i32
%32 = call i32 @putchar(i32 %31)
%33 = add nuw i64 %29, 1
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 10
br i1 %36, label %37, label %28
37: ; preds = %28, %18
ret i32 0
}