#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 ceil(float);
int floor(float);
int /*<<< orphan*/ printf(char *, float, int, float, int);
int round(float);
int main() {
  float a = 101.1;
  float b = 99.9;
  printf("round()\n\ta: [%f], [%lf]\n\tb: [%f], [%lf]\n", a, round(a), b,
         round(b));
  printf("ceil()\n\ta: [%f], [%lf]\n\tb: [%f], [%lf]\n", a, ceil(a), b,
         ceil(b));
  printf("floor()\n\ta: [%f], [%lf]\n\tb: [%f], [%lf]\n", a, floor(a), b,
         floor(b));
  printf("convert to a to int:\n\ta: [%f], [%d]\n\tb: [%f], [%d]\n", a, (int)a,
         b, (int)b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xead(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe9c(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <round@plt>
mov    %eax,-0x2c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <round@plt>
movss  -0x30(%rbp),%xmm0
mov    -0x2c(%rbp),%esi
movss  -0x28(%rbp),%xmm1
mov    %eax,%edx
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %eax,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <ceil@plt>
movss  -0x24(%rbp),%xmm0
mov    -0x20(%rbp),%esi
movss  -0x1c(%rbp),%xmm1
mov    %eax,%edx
lea    0xe41(%rip),%rdi
call   1040 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1060 <floor@plt>
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1060 <floor@plt>
movss  -0x18(%rbp),%xmm0
mov    -0x14(%rbp),%esi
movss  -0x10(%rbp),%xmm1
mov    %eax,%edx
lea    0xe23(%rip),%rdi
call   1040 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvttss2si -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm1
cvttss2si -0xc(%rbp),%edx
lea    0xe2c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movss  0xeb7(%rip),%xmm0
call   1050 <round@plt>
mov    %eax,%ebx
movss  0xeac(%rip),%xmm0
call   1050 <round@plt>
lea    0xea4(%rip),%rdi
movss  0xe94(%rip),%xmm0
mov    %ebx,%esi
movss  0xe8e(%rip),%xmm1
mov    %eax,%edx
call   1040 <printf@plt>
movss  0xe7b(%rip),%xmm0
call   1030 <ceil@plt>
mov    %eax,%ebx
movss  0xe70(%rip),%xmm0
call   1030 <ceil@plt>
lea    0xe91(%rip),%rdi
movss  0xe58(%rip),%xmm0
mov    %ebx,%esi
movss  0xe52(%rip),%xmm1
mov    %eax,%edx
call   1040 <printf@plt>
movss  0xe3f(%rip),%xmm0
call   1060 <floor@plt>
mov    %eax,%ebx
movss  0xe34(%rip),%xmm0
call   1060 <floor@plt>
lea    0xe7d(%rip),%rdi
movss  0xe1c(%rip),%xmm0
mov    %ebx,%esi
movss  0xe16(%rip),%xmm1
mov    %eax,%edx
call   1040 <printf@plt>
lea    0xe86(%rip),%rdi
movss  0xdfc(%rip),%xmm0
mov    $0x65,%esi
movss  0xdf3(%rip),%xmm1
mov    $0x63,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"round()\0A\09a: [%f], [%lf]\0A\09b: [%f], [%lf]\0A\00"
@.str.1 = [40 x i8] c"ceil()\0A\09a: [%f], [%lf]\0A\09b: [%f], [%lf]\0A\00"
@.str.2 = [41 x i8] c"floor()\0A\09a: [%f], [%lf]\0A\09b: [%f], [%lf]\0A\00"
@.str.3 = [52 x i8] c"convert to a to int:\0A\09a: [%f], [%d]\0A\09b: [%f], [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0x4059466660000000, float* %2
store float 0x4058F999A0000000, float* %3
%4 = load float, float* %2
%5 = load float, float* %2
%6 = call i32 @round(float %5)
%7 = load float, float* %3
%8 = load float, float* %3
%9 = call i32 @round(float %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), float %4, i32 %6, float %7, i32 %9)
%11 = load float, float* %2
%12 = load float, float* %2
%13 = call i32 @ceil(float %12)
%14 = load float, float* %3
%15 = load float, float* %3
%16 = call i32 @ceil(float %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), float %11, i32 %13, float %14, i32 %16)
%18 = load float, float* %2
%19 = load float, float* %2
%20 = call i32 @floor(float %19)
%21 = load float, float* %3
%22 = load float, float* %3
%23 = call i32 @floor(float %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), float %18, i32 %20, float %21, i32 %23)
%25 = load float, float* %2
%26 = load float, float* %2
%27 = fptosi float %26 to i32
%28 = load float, float* %3
%29 = load float, float* %3
%30 = fptosi float %29 to i32
%31 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), float %25, i32 %27, float %28, i32 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"round()\0A\09a: [%f], [%lf]\0A\09b: [%f], [%lf]\0A\00"
@.str.1 = [40 x i8] c"ceil()\0A\09a: [%f], [%lf]\0A\09b: [%f], [%lf]\0A\00"
@.str.2 = [41 x i8] c"floor()\0A\09a: [%f], [%lf]\0A\09b: [%f], [%lf]\0A\00"
@.str.3 = [52 x i8] c"convert to a to int:\0A\09a: [%f], [%d]\0A\09b: [%f], [%d]\0A\00"
define i32 @main() {
%1 = tail call i32 @round(float 0x4059466660000000)
%2 = tail call i32 @round(float 0x4058F999A0000000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), float 0x4059466660000000, i32 %1, float 0x4058F999A0000000, i32 %2)
%4 = tail call i32 @ceil(float 0x4059466660000000)
%5 = tail call i32 @ceil(float 0x4058F999A0000000)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), float 0x4059466660000000, i32 %4, float 0x4058F999A0000000, i32 %5)
%7 = tail call i32 @floor(float 0x4059466660000000)
%8 = tail call i32 @floor(float 0x4058F999A0000000)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), float 0x4059466660000000, i32 %7, float 0x4058F999A0000000, i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), float 0x4059466660000000, i32 101, float 0x4058F999A0000000, i32 99)
ret i32 0
}