#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(double);
int /*<<< orphan*/ printf(char *, ...);
void generateGraph(double num) {
  int k;
  int roundedNum = ceil(num);
  double tempNum;
  printf("|\n|************************* %d\n", roundedNum);
  printf("|__________________________________________________\n");
  for (k = 0; k < 9; k++) {
    double tempNum = (double)k * (double)roundedNum / 4;
    if (tempNum < 10) {
      printf("%.2lf  ", tempNum);
    } else if (tempNum < 100) {
      printf("%.1lf  ", tempNum);
    } else {
      printf("%.1lf ", tempNum);
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<generateGraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    120a <generateGraph+0xea>
cvtsi2sdl -0xc(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe88(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe6f(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11b4 <generateGraph+0x94>
movsd  -0x20(%rbp),%xmm0
lea    0xec6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11f7 <generateGraph+0xd7>
movsd  0xe54(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11df <generateGraph+0xbf>
movsd  -0x20(%rbp),%xmm0
lea    0xea3(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11f2 <generateGraph+0xd2>
movsd  -0x20(%rbp),%xmm0
lea    0xe93(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11f7 <generateGraph+0xd7>
jmp    11fc <generateGraph+0xdc>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <generateGraph+0x40>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateGraph>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
call   1050 <ceil@plt>
mov    %eax,%ebx
lea    0xef1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf19(%rip),%rdi
call   1040 <puts@plt>
cvtsi2sd %ebx,%xmm1
movsd  %xmm1,0x8(%rsp)
xorpd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xe7a(%rip),%xmm0
movsd  0xe7a(%rip),%xmm1
ucomisd %xmm0,%xmm1
lea    0xed8(%rip),%r14
lea    0xed9(%rip),%rbx
mov    %rbx,%rdi
cmova  %r14,%rdi
movsd  0xe61(%rip),%xmm1
ucomisd %xmm0,%xmm1
lea    0xeaf(%rip),%r15
cmova  %r15,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xe2d(%rip),%xmm0
movsd  0xe2d(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    %rbx,%rdi
cmova  %r14,%rdi
movsd  0xe22(%rip),%xmm1
ucomisd %xmm0,%xmm1
cmova  %r15,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
mulsd  0xdf1(%rip),%xmm0
movsd  0xdf1(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    %rbx,%rdi
cmova  %r14,%rdi
movsd  0xde6(%rip),%xmm1
ucomisd %xmm0,%xmm1
cmova  %r15,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xdd7(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  0xdb1(%rip),%xmm0
movsd  0xdb1(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    %rbx,%rdi
cmova  %r14,%rdi
movsd  0xda6(%rip),%xmm1
ucomisd %xmm0,%xmm1
cmova  %r15,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xd9f(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  0xd71(%rip),%xmm0
movsd  0xd71(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    %rbx,%rdi
cmova  %r14,%rdi
movsd  0xd66(%rip),%xmm1
ucomisd %xmm0,%xmm1
cmova  %r15,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xd67(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  0xd31(%rip),%xmm0
movsd  0xd31(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    %rbx,%rdi
cmova  %r14,%rdi
movsd  0xd26(%rip),%xmm1
ucomisd %xmm0,%xmm1
cmova  %r15,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xd2f(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  0xcf1(%rip),%xmm0
movsd  0xcf1(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    %rbx,%rdi
cmova  %r14,%rdi
movsd  0xce6(%rip),%xmm1
ucomisd %xmm0,%xmm1
cmova  %r15,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xcf7(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  0xcb1(%rip),%xmm0
movsd  0xcb1(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    %rbx,%rdi
cmova  %r14,%rdi
movsd  0xca6(%rip),%xmm1
ucomisd %xmm0,%xmm1
cmova  %r15,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xcb9(%rip),%xmm0
mulsd  0xc71(%rip),%xmm0
movsd  0xc71(%rip),%xmm1
ucomisd %xmm0,%xmm1
cmova  %r14,%rbx
movsd  0xc69(%rip),%xmm1
ucomisd %xmm0,%xmm1
cmova  %r15,%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"|\0A|************************* %d\0A\00"
@.str.1 = [53 x i8] c"|__________________________________________________\0A\00"
@.str.2 = [8 x i8] c"%.2lf \00"
@.str.3 = [8 x i8] c"%.1lf \00"
@.str.4 = [7 x i8] c"%.1lf \00"
@.str.5 = [2 x i8] c"\0A\00"
define void @generateGraph(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store double %0, double* %2
%7 = load double, double* %2
%8 = call i32 @ceil(double %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %12
12: ; preds = %38, %1
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 9
br i1 %14, label %15, label %41
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sitofp i32 %16 to double
%18 = load i32, i32* %4
%19 = sitofp i32 %18 to double
%20 = fmul double %17, %19
%21 = fdiv double %20, 4.000000e+00
store double %21, double* %6
%22 = load double, double* %6
%23 = fcmp olt double %22, 1.000000e+01
br i1 %23, label %24, label %27
24: ; preds = %15
%25 = load double, double* %6
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %25)
br label %37
27: ; preds = %15
%28 = load double, double* %6
%29 = fcmp olt double %28, 1.000000e+02
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load double, double* %6
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %31)
br label %36
33: ; preds = %27
%34 = load double, double* %6
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %34)
br label %36
36: ; preds = %33, %30
br label %37
37: ; preds = %36, %24
br label %38
38: ; preds = %37
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %12
41: ; preds = %12
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"|\0A|************************* %d\0A\00"
@.str.2 = [8 x i8] c"%.2lf \00"
@.str.3 = [8 x i8] c"%.1lf \00"
@.str.4 = [7 x i8] c"%.1lf \00"
@str = [52 x i8] c"|__________________________________________________\00"
define void @generateGraph(double %0) {
%2 = tail call i32 @ceil(double %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%5 = sitofp i32 %2 to double
%6 = fmul double %5, 0.000000e+00
%7 = fmul double %6, 2.500000e-01
%8 = fcmp olt double %7, 1.000000e+01
%9 = fcmp olt double %7, 1.000000e+02
%10 = select i1 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%11 = select i1 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %11, double %7)
%13 = fmul double %5, 2.500000e-01
%14 = fcmp olt double %13, 1.000000e+01
%15 = fcmp olt double %13, 1.000000e+02
%16 = select i1 %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%17 = select i1 %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %17, double %13)
%19 = fmul double %5, 2.000000e+00
%20 = fmul double %19, 2.500000e-01
%21 = fcmp olt double %20, 1.000000e+01
%22 = fcmp olt double %20, 1.000000e+02
%23 = select i1 %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%24 = select i1 %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %23
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %24, double %20)
%26 = fmul double %5, 3.000000e+00
%27 = fmul double %26, 2.500000e-01
%28 = fcmp olt double %27, 1.000000e+01
%29 = fcmp olt double %27, 1.000000e+02
%30 = select i1 %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%31 = select i1 %28, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %30
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %31, double %27)
%33 = fmul double %5, 4.000000e+00
%34 = fmul double %33, 2.500000e-01
%35 = fcmp olt double %34, 1.000000e+01
%36 = fcmp olt double %34, 1.000000e+02
%37 = select i1 %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%38 = select i1 %35, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %37
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %38, double %34)
%40 = fmul double %5, 5.000000e+00
%41 = fmul double %40, 2.500000e-01
%42 = fcmp olt double %41, 1.000000e+01
%43 = fcmp olt double %41, 1.000000e+02
%44 = select i1 %43, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%45 = select i1 %42, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %44
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %45, double %41)
%47 = fmul double %5, 6.000000e+00
%48 = fmul double %47, 2.500000e-01
%49 = fcmp olt double %48, 1.000000e+01
%50 = fcmp olt double %48, 1.000000e+02
%51 = select i1 %50, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%52 = select i1 %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %51
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %52, double %48)
%54 = fmul double %5, 7.000000e+00
%55 = fmul double %54, 2.500000e-01
%56 = fcmp olt double %55, 1.000000e+01
%57 = fcmp olt double %55, 1.000000e+02
%58 = select i1 %57, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%59 = select i1 %56, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %58
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %59, double %55)
%61 = fmul double %5, 8.000000e+00
%62 = fmul double %61, 2.500000e-01
%63 = fcmp olt double %62, 1.000000e+01
%64 = fcmp olt double %62, 1.000000e+02
%65 = select i1 %64, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0)
%66 = select i1 %63, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %65
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %66, double %62)
%68 = tail call i32 @putchar(i32 10)
ret void
}