#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*/ cov_check(char *, char *, char *);
int /*<<< orphan*/ cov_log(double, char *, char *);
double foo(double, double);
int main(int argc, char *argv[]) {
  double a = 2;
  double b = 3;
  double c = foo(a + b, a);
  cov_log(c, "result", argv[2]);
  cov_check(argv[2], argv[1], argv[3]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeba(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <foo@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe83(%rip),%rdi
call   1050 <cov_log@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1030 <cov_check@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
movsd  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
call   1040 <foo@plt>
mov    0x10(%rbx),%rsi
lea    0xebc(%rip),%rdi
call   1050 <cov_log@plt>
mov    0x8(%rbx),%rsi
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rdx
call   1030 <cov_check@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"result\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 2.000000e+00, double* %6
store double 3.000000e+00, double* %7
%9 = load double, double* %6
%10 = load double, double* %7
%11 = fadd double %9, %10
%12 = load double, double* %6
%13 = call double @foo(double %11, double %12)
store double %13, double* %8
%14 = load double, double* %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @cov_log(double %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 2
%21 = load i8*, i8** %20
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 3
%27 = load i8*, i8** %26
%28 = call i32 @cov_check(i8* %21, i8* %24, i8* %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"result\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call double @foo(double 5.000000e+00, double 2.000000e+00)
%4 = getelementptr inbounds i8*, i8** %1, i64 2
%5 = load i8*, i8** %4
%6 = tail call i32 @cov_log(double %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 3
%11 = load i8*, i8** %10
%12 = tail call i32 @cov_check(i8* %7, i8* %9, i8* %11)
ret i32 0
}