#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);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int xyard, yyard, yard_area, xhouse, yhouse, house_area;
  int yard_area_feet, time_req, feet_per_sec = 2;
  puts("Input house x & y;");
  scanf(" %d %d", &xhouse, &yhouse);
  house_area = xhouse * yhouse;
  puts("Input yard x & y;");
  scanf(" %d %d", &xyard, &yyard);
  yard_area = xyard * yyard - house_area;
  yard_area_feet = yard_area * 9;
  time_req = yard_area_feet / feet_per_sec;
  printf("Tid det ville tage: %d sec\n", time_req);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x28(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
lea    0xe90(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0x9,-0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cltd
idivl  -0x28(%rbp)
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeca(%rip),%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%ebp
imul   0xc(%rsp),%ebp
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x10(%rsp),%eax
imul   0x14(%rsp),%eax
sub    %ebp,%eax
lea    (%rax,%rax,8),%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Input house x & y;\00"
@.str.1 = [7 x i8] c" %d %d\00"
@.str.2 = [18 x i8] c"Input yard x & y;\00"
@.str.3 = [28 x i8] c"Tid det ville tage: %d sec\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %10
%11 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
store i32 %15, i32* %7
%16 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = mul nsw i32 %18, %19
%21 = load i32, i32* %7
%22 = sub nsw i32 %20, %21
store i32 %22, i32* %4
%23 = load i32, i32* %4
%24 = mul nsw i32 %23, 9
store i32 %24, i32* %8
%25 = load i32, i32* %8
%26 = load i32, i32* %10
%27 = sdiv i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %9
%29 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Input house x & y;\00"
@.str.1 = [7 x i8] c" %d %d\00"
@.str.2 = [18 x i8] c"Input yard x & y;\00"
@.str.3 = [28 x i8] c"Tid det ville tage: %d sec\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = mul nsw i32 %12, %11
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = mul nsw i32 %17, %16
%19 = sub nsw i32 %18, %13
%20 = mul nsw i32 %19, 9
%21 = sdiv i32 %20, 2
%22 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %21)
ret i32 0
}