#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 */
float baby(float);
char getchar();
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float input, output;
  printf("Enter quantity you plan on feeding the baby %c ", 16);
  scanf("%f", &input);
  while (getchar() != '\n')
    continue;
  output = baby(input);
  puts("\n\n\tBased on many, many calculations made by this awesome pc.. ");
  puts("based on this diet..");
  printf("\tthe baby will produce %.2f waste materials!\n\n", output);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9e(%rip),%rdi
movss  0xe92(%rip),%xmm0
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     119b <main+0x4b>
jmp    1183 <main+0x33>
movss  -0x8(%rbp),%xmm0
call   1060 <baby@plt>
movss  %xmm0,-0xc(%rbp)
lea    0xe86(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
movss  -0xc(%rbp),%xmm0
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeac(%rip),%rdi
movss  0xea0(%rip),%xmm0
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    1180 <main+0x30>
movss  0x4(%rsp),%xmm0
call   1060 <baby@plt>
movss  %xmm0,(%rsp)
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed1(%rip),%rdi
movss  (%rsp),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Enter quantity you plan on feeding the baby %c \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [63 x i8] c"\0A\0A\09Based on many, many calculations made by this awesome pc.. \00"
@.str.3 = [21 x i8] c"based on this diet..\00"
@.str.4 = [47 x i8] c"\09the baby will produce %.2f waste materials!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), float 1.600000e+01)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
br label %6
6: ; preds = %10, %0
%7 = call signext i8 (...) @getchar()
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
%12 = load float, float* %2
%13 = call float @baby(float %12)
store float %13, float* %3
%14 = call i32 @puts(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%16 = load float, float* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0), float %16)
%18 = call signext i8 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"Enter quantity you plan on feeding the baby %c \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [63 x i8] c"\0A\0A\09Based on many, many calculations made by this awesome pc.. \00"
@.str.3 = [21 x i8] c"based on this diet..\00"
@.str.4 = [47 x i8] c"\09the baby will produce %.2f waste materials!\0A\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), float 1.600000e+01)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
br label %5
5: ; preds = %5, %0
%6 = call signext i8 (...) @getchar()
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %5
8: ; preds = %5
%9 = load float, float* %1
%10 = call float @baby(float %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0), float %10)
%14 = call signext i8 (...) @getchar()
ret i32 0
}