#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 */
double pow(double, int);
int /*<<< orphan*/ printf(char *, ...);
double sqrt(double);
int main(void) {
  double numer, denom, ratio;
  numer = 17.3;
  denom = -4.1;
  if (denom == 0.0)
    printf("Error: Division by zero.\n");
  else {
    ratio = numer / denom;
    if (ratio > 0.0)
      printf("The ratio is positive.\n");
    else if (ratio == 0.0)
      printf("The ratio is zero.\n");
    else
      printf("The ratio is negative.\n");
  }
  while (numer > 1.5) {
    printf("numer is %f.\n", numer);
    numer = sqrt(numer);
  }
  int i;
  for (i = 0; i < 7; i = i + 2) {
    printf("Here is i: %d.\n", i);
    printf("Here is denom^i: %f.\n", pow(denom, i));
  }
  i = 0;
  while (i < 7) {
    printf("Here is i: %d.\n", i);
    printf("Here is denom^i: %f.\n", pow(denom, i));
    i = i + 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1184 <main+0x54>
jp     1184 <main+0x54>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fb <main+0xcb>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11b8 <main+0x88>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f6 <main+0xc6>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11e3 <main+0xb3>
jp     11e3 <main+0xb3>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f1 <main+0xc1>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f6 <main+0xc6>
jmp    11fb <main+0xcb>
jmp    1200 <main+0xd0>
movsd  -0x10(%rbp),%xmm0
movsd  0xe03(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    123e <main+0x10e>
movsd  -0x10(%rbp),%xmm0
lea    0xe53(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1200 <main+0xd0>
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    1289 <main+0x159>
mov    -0x24(%rbp),%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x24(%rbp),%edi
call   1040 <pow@plt>
lea    0xe20(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    1245 <main+0x115>
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    12d4 <main+0x1a4>
mov    -0x24(%rbp),%esi
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x24(%rbp),%edi
call   1040 <pow@plt>
lea    0xdd5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    1290 <main+0x160>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rbx
movsd  0xeb1(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xea7(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe9d(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xeaa(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xe80(%rip),%xmm0
xor    %edi,%edi
call   1050 <pow@plt>
lea    0xe98(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xe51(%rip),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xe26(%rip),%xmm0
mov    $0x4,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xdfb(%rip),%xmm0
mov    $0x6,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xdd3(%rip),%xmm0
xor    %edi,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xdab(%rip),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xd80(%rip),%xmm0
mov    $0x4,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xd55(%rip),%xmm0
mov    $0x6,%edi
call   1050 <pow@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Error: Division by zero.\0A\00"
@.str.1 = [24 x i8] c"The ratio is positive.\0A\00"
@.str.2 = [20 x i8] c"The ratio is zero.\0A\00"
@.str.3 = [24 x i8] c"The ratio is negative.\0A\00"
@.str.4 = [14 x i8] c"numer is %f.\0A\00"
@.str.5 = [16 x i8] c"Here is i: %d.\0A\00"
@.str.6 = [22 x i8] c"Here is denom^i: %f.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
store double 1.730000e+01, double* %2
store double -4.100000e+00, double* %3
%6 = load double, double* %3
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %27
10: ; preds = %0
%11 = load double, double* %2
%12 = load double, double* %3
%13 = fdiv double %11, %12
store double %13, double* %4
%14 = load double, double* %4
%15 = fcmp ogt double %14, 0.000000e+00
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %26
18: ; preds = %10
%19 = load double, double* %4
%20 = fcmp oeq double %19, 0.000000e+00
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %25
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
br label %26
26: ; preds = %25, %16
br label %27
27: ; preds = %26, %8
br label %28
28: ; preds = %31, %27
%29 = load double, double* %2
%30 = fcmp ogt double %29, 1.500000e+00
br i1 %30, label %31, label %36
31: ; preds = %28
%32 = load double, double* %2
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %32)
%34 = load double, double* %2
%35 = call double @sqrt(double %34)
store double %35, double* %2
br label %28
36: ; preds = %28
store i32 0, i32* %5
br label %37
37: ; preds = %47, %36
%38 = load i32, i32* %5
%39 = icmp slt i32 %38, 7
br i1 %39, label %40, label %50
40: ; preds = %37
%41 = load i32, i32* %5
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %41)
%43 = load double, double* %3
%44 = load i32, i32* %5
%45 = call double @pow(double %43, i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %45)
br label %47
47: ; preds = %40
%48 = load i32, i32* %5
%49 = add nsw i32 %48, 2
store i32 %49, i32* %5
br label %37
50: ; preds = %37
store i32 0, i32* %5
br label %51
51: ; preds = %54, %50
%52 = load i32, i32* %5
%53 = icmp slt i32 %52, 7
br i1 %53, label %54, label %63
54: ; preds = %51
%55 = load i32, i32* %5
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %55)
%57 = load double, double* %3
%58 = load i32, i32* %5
%59 = call double @pow(double %57, i32 %58)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %59)
%61 = load i32, i32* %5
%62 = add nsw i32 %61, 2
store i32 %62, i32* %5
br label %51
63: ; preds = %51
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [14 x i8] c"numer is %f.\0A\00"
@.str.5 = [16 x i8] c"Here is i: %d.\0A\00"
@.str.6 = [22 x i8] c"Here is denom^i: %f.\0A\00"
@str = [23 x i8] c"The ratio is negative.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double 1.730000e+01)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double 0x4010A3269528567E)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double 0x400050C760D5C0F3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 0)
%6 = tail call double @pow(double -4.100000e+00, i32 0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 2)
%9 = tail call double @pow(double -4.100000e+00, i32 2)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 4)
%12 = tail call double @pow(double -4.100000e+00, i32 4)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %12)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 6)
%15 = tail call double @pow(double -4.100000e+00, i32 6)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %15)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 0)
%18 = tail call double @pow(double -4.100000e+00, i32 0)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %18)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 2)
%21 = tail call double @pow(double -4.100000e+00, i32 2)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %21)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 4)
%24 = tail call double @pow(double -4.100000e+00, i32 4)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %24)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 6)
%27 = tail call double @pow(double -4.100000e+00, i32 6)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), double %27)
ret i32 0
}