#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 *, double *, double *);
int main(void) {
  double lengthyard, widthyard, lengthhouse, widthhouse;
  double yard, house, areal, tid;
  printf("Indtast havens længde derefter bredde i feet \n");
  scanf("%lf %lf", &lengthyard, &widthyard);
  printf("Indtast husets længde derefter bredde i feet \n");
  scanf("%lf %lf", &lengthhouse, &widthhouse);
  yard = lengthyard * widthyard;
  house = lengthhouse * widthhouse;
  areal = yard - house;
  tid = areal / 2;
  printf("Det tager %8.4f sekunder at slaa graesset paa arealet %8.4f kvadrat "
         "feet\n",
         tid, areal);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xe53(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    0xea9(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xf1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rbx
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe67(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe6c(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Indtast havens l\C3\A6ngde derefter bredde i feet \0A\00"
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [48 x i8] c"Indtast husets l\C3\A6ngde derefter bredde i feet \0A\00"
@.str.3 = [74 x i8] c"Det tager %8.4f sekunder at slaa graesset paa arealet %8.4f kvadrat feet\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %4, double* %5)
%14 = load double, double* %2
%15 = load double, double* %3
%16 = fmul double %14, %15
store double %16, double* %6
%17 = load double, double* %4
%18 = load double, double* %5
%19 = fmul double %17, %18
store double %19, double* %7
%20 = load double, double* %6
%21 = load double, double* %7
%22 = fsub double %20, %21
store double %22, double* %8
%23 = load double, double* %8
%24 = fdiv double %23, 2.000000e+00
store double %24, double* %9
%25 = load double, double* %9
%26 = load double, double* %8
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.3, i64 0, i64 0), double %25, double %26)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.3 = [74 x i8] c"Det tager %8.4f sekunder at slaa graesset paa arealet %8.4f kvadrat feet\0A\00"
@str = [47 x i8] c"Indtast havens l\C3\A6ngde derefter bredde i feet \00"
@str.4 = [47 x i8] c"Indtast husets l\C3\A6ngde derefter bredde i feet \00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.4, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %3, double* %4)
%13 = load double, double* %1
%14 = load double, double* %2
%15 = fmul double %13, %14
%16 = load double, double* %3
%17 = load double, double* %4
%18 = fmul double %16, %17
%19 = fsub double %15, %18
%20 = fmul double %19, 5.000000e-01
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.3, i64 0, i64 0), double %20, double %19)
ret i32 0
}