#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 */
double atof(char *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char s[4][10];
  char n = 0;
  char i;
  double num[4];
  double sum = 0;
  for (i = 0; i < 4; i++) {
    scanf("%s", s[i]);
  }
  for (i = 0; i < 4; i++) {
    num[i] = atof(s[i]);
    sum += num[i];
  }
  printf("%f\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x31(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movb   $0x0,-0x32(%rbp)
movsbl -0x32(%rbp),%eax
cmp    $0x4,%eax
jge    1185 <main+0x55>
movsbq -0x32(%rbp),%rax
lea    -0x30(%rbp),%rsi
imul   $0xa,%rax,%rax
add    %rax,%rsi
lea    0xe8d(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x32(%rbp),%al
add    $0x1,%al
mov    %al,-0x32(%rbp)
jmp    114f <main+0x1f>
movb   $0x0,-0x32(%rbp)
movsbl -0x32(%rbp),%eax
cmp    $0x4,%eax
jge    11d8 <main+0xa8>
movsbq -0x32(%rbp),%rax
lea    -0x30(%rbp),%rdi
imul   $0xa,%rax,%rax
add    %rax,%rdi
call   1030 <atof@plt>
movsbq -0x32(%rbp),%rax
movsd  %xmm0,-0x60(%rbp,%rax,8)
movsbq -0x32(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x32(%rbp),%al
add    $0x1,%al
mov    %al,-0x32(%rbp)
jmp    1189 <main+0x59>
movsd  -0x68(%rbp),%xmm0
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0xebc(%rip),%rbx
lea    0x10(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0x1a(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
lea    0x24(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
lea    0x2e(%rsp),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
mov    %r14,%rdi
call   1030 <atof@plt>
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r15,%rdi
call   1030 <atof@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r12,%rdi
call   1030 <atof@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r13,%rdi
call   1030 <atof@plt>
addsd  0x8(%rsp),%xmm0
lea    0xe2c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [10 x i8]]
%3 = alloca i8
%4 = alloca i8
%5 = alloca [4 x double]
%6 = alloca double
store i32 0, i32* %1
store i8 0, i8* %3
store double 0.000000e+00, double* %6
store i8 0, i8* %4
br label %7
7: ; preds = %17, %0
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 4
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i8, i8* %4
%13 = sext i8 %12 to i64
%14 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %2, i64 0, i64 %13
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %11
%18 = load i8, i8* %4
%19 = add i8 %18, 1
store i8 %19, i8* %4
br label %7
20: ; preds = %7
store i8 0, i8* %4
br label %21
21: ; preds = %40, %20
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp slt i32 %23, 4
br i1 %24, label %25, label %43
25: ; preds = %21
%26 = load i8, i8* %4
%27 = sext i8 %26 to i64
%28 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %2, i64 0, i64 %27
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %28, i64 0, i64 0
%30 = call double @atof(i8* %29)
%31 = load i8, i8* %4
%32 = sext i8 %31 to i64
%33 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 %32
store double %30, double* %33
%34 = load i8, i8* %4
%35 = sext i8 %34 to i64
%36 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 %35
%37 = load double, double* %36
%38 = load double, double* %6
%39 = fadd double %38, %37
store double %39, double* %6
br label %40
40: ; preds = %25
%41 = load i8, i8* %4
%42 = add i8 %41, 1
store i8 %42, i8* %4
br label %21
43: ; preds = %21
%44 = load double, double* %6
%45 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %44)
%46 = load i32, i32* %1
ret i32 %46
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca [4 x [10 x i8]]
%2 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 1, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 2, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [4 x [10 x i8]], [4 x [10 x i8]]* %1, i64 0, i64 3, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call double @atof(i8* %2)
%11 = fadd double %10, 0.000000e+00
%12 = call double @atof(i8* %4)
%13 = fadd double %11, %12
%14 = call double @atof(i8* %6)
%15 = fadd double %13, %14
%16 = call double @atof(i8* %8)
%17 = fadd double %15, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %17)
ret i32 0
}