#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 costofpainting(double);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int cost = costofpainting(2.0);
  printf("Cost to paint 2mi: %d\n", cost);
  cost = costofpainting(3.0);
  printf("Cost to paint 3mi: %d\n", cost);
  cost = costofpainting(7.0);
  printf("Cost to paint 7mi: %d\n", cost);
  cost = costofpainting(70.0);
  printf("Cost to paint 70mi: %d\n", cost);
  cost = costofpainting(-7.0);
  printf("Cost to paint -7mi: %d\n", cost);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xee2(%rip),%xmm0
call   1040 <costofpainting@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
movsd  0xebb(%rip),%xmm0
call   1040 <costofpainting@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe94(%rip),%xmm0
call   1040 <costofpainting@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe6d(%rip),%xmm0
call   1040 <costofpainting@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe46(%rip),%xmm0
call   1040 <costofpainting@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <costofpainting@plt>
lea    0xef3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xec4(%rip),%xmm0
call   1040 <costofpainting@plt>
lea    0xeef(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xeb1(%rip),%xmm0
call   1040 <costofpainting@plt>
lea    0xeeb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xe9e(%rip),%xmm0
call   1040 <costofpainting@plt>
lea    0xee7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xe8b(%rip),%xmm0
call   1040 <costofpainting@plt>
lea    0xee4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Cost to paint 2mi: %d\0A\00"
@.str.1 = [23 x i8] c"Cost to paint 3mi: %d\0A\00"
@.str.2 = [23 x i8] c"Cost to paint 7mi: %d\0A\00"
@.str.3 = [24 x i8] c"Cost to paint 70mi: %d\0A\00"
@.str.4 = [24 x i8] c"Cost to paint -7mi: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @costofpainting(double 2.000000e+00)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @costofpainting(double 3.000000e+00)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @costofpainting(double 7.000000e+00)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = call i32 @costofpainting(double 7.000000e+01)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = call i32 @costofpainting(double -7.000000e+00)
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Cost to paint 2mi: %d\0A\00"
@.str.1 = [23 x i8] c"Cost to paint 3mi: %d\0A\00"
@.str.2 = [23 x i8] c"Cost to paint 7mi: %d\0A\00"
@.str.3 = [24 x i8] c"Cost to paint 70mi: %d\0A\00"
@.str.4 = [24 x i8] c"Cost to paint -7mi: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @costofpainting(double 2.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @costofpainting(double 3.000000e+00)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @costofpainting(double 7.000000e+00)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 @costofpainting(double 7.000000e+01)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = tail call i32 @costofpainting(double -7.000000e+00)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %11)
ret i32 0
}