#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 device_model(double, double, double, int);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  double id = device_model(0.2, 0.2, 0.2, 1);
  printf("%f\n", id);
  id = device_model(0.0, 0.0, 0.2, 1);
  printf("%f\n", id);
  id = device_model(0.1, 0.0, 0.2, 1);
  printf("%f\n", id);
  id = device_model(0.0, 0.1, 0.2, 1);
  printf("%f\n", id);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xed1(%rip),%xmm2
mov    $0x1,%edi
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <device_model@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xorps  %xmm1,%xmm1
movsd  0xea0(%rip),%xmm2
mov    $0x1,%edi
movaps %xmm1,%xmm0
call   1030 <device_model@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe6d(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  0xe6a(%rip),%xmm2
mov    $0x1,%edi
call   1030 <device_model@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movsd  0xe37(%rip),%xmm1
movsd  0xe37(%rip),%xmm2
mov    $0x1,%edi
call   1030 <device_model@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe24(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xed7(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
mov    $0x1,%edi
call   1030 <device_model@plt>
lea    0xed0(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movsd  0xeaa(%rip),%xmm2
mov    $0x1,%edi
call   1030 <device_model@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0xe98(%rip),%xmm0
xorps  %xmm1,%xmm1
movsd  0xe85(%rip),%xmm2
mov    $0x1,%edi
call   1030 <device_model@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movsd  0xe70(%rip),%xmm1
movsd  0xe60(%rip),%xmm2
mov    $0x1,%edi
call   1030 <device_model@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @device_model(double 2.000000e-01, double 2.000000e-01, double 2.000000e-01, i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call double @device_model(double 0.000000e+00, double 0.000000e+00, double 2.000000e-01, i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
%7 = tail call double @device_model(double 1.000000e-01, double 0.000000e+00, double 2.000000e-01, i32 1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
%9 = tail call double @device_model(double 0.000000e+00, double 1.000000e-01, double 2.000000e-01, i32 1)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}