#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 /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ scanf(char *, double *);
void readEquation(double eqCoef[], size_t degree) {
  for (int i = degree, cf = 97; i >= 0; i--, cf++) {
    if (i > 0)
      printf("%cx^%d + ", cf, i);
    else
      printf("%c = 0\n", cf, i);
  }
  for (int i = degree, cf = 97; i >= 0; i--, cf++) {
    printf("%c = ", cf);
    scanf("%lf", &eqCoef[i]);
  }
}


x86 assembly (clang, -O0):
<readEquation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
movl   $0x61,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     119b <readEquation+0x7b>
cmpl   $0x0,-0x14(%rbp)
jle    116b <readEquation+0x4b>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117f <readEquation+0x5f>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1184 <readEquation+0x64>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113e <readEquation+0x1e>
mov    -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
movl   $0x61,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     11f6 <readEquation+0xd6>
mov    -0x20(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe3e(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11a9 <readEquation+0x89>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readEquation>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
test   %r13d,%r13d
js     11de <readEquation+0xbe>
mov    %rdi,%r14
mov    $0x61,%ebp
lea    0xec4(%rip),%r15
lea    0xeb3(%rip),%r12
mov    %r13d,%edx
mov    %r13d,%ebx
jmp    1178 <readEquation+0x58>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %ebp,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
mov    %ebx,%edx
cmp    $0xffffffff,%ebx
je     1184 <readEquation+0x64>
sub    $0x1,%ebx
jb     1160 <readEquation+0x40>
mov    %r12,%rdi
mov    %ebp,%esi
jmp    1167 <readEquation+0x47>
test   %r13d,%r13d
js     11de <readEquation+0xbe>
mov    %r13d,%eax
lea    (%r14,%rax,8),%rbp
neg    %r13d
mov    $0x61,%ebx
lea    0xe73(%rip),%r14
lea    0xe72(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1040 <scanf@plt>
add    $0xfffffffffffffff8,%rbp
lea    (%rbx,%r13,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x62,%eax
jne    11b0 <readEquation+0x90>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%cx^%d + \00"
@.str.1 = [8 x i8] c"%c = 0\0A\00"
@.str.2 = [6 x i8] c"%c = \00"
@.str.3 = [4 x i8] c"%lf\00"
define void @readEquation(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %3
store i64 %1, i64* %4
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
store i32 %10, i32* %5
store i32 97, i32* %6
br label %11
11: ; preds = %26, %2
%12 = load i32, i32* %5
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %31
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19)
br label %25
21: ; preds = %14
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23)
br label %25
25: ; preds = %21, %17
br label %26
26: ; preds = %25
%27 = load i32, i32* %5
%28 = add nsw i32 %27, -1
store i32 %28, i32* %5
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %11
31: ; preds = %11
%32 = load i64, i64* %4
%33 = trunc i64 %32 to i32
store i32 %33, i32* %7
store i32 97, i32* %8
br label %34
34: ; preds = %45, %31
%35 = load i32, i32* %7
%36 = icmp sge i32 %35, 0
br i1 %36, label %37, label %50
37: ; preds = %34
%38 = load i32, i32* %8
%39 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = load double*, double** %3
%41 = load i32, i32* %7
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %40, i64 %42
%44 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %43)
br label %45
45: ; preds = %37
%46 = load i32, i32* %7
%47 = add nsw i32 %46, -1
store i32 %47, i32* %7
%48 = load i32, i32* %8
%49 = add nsw i32 %48, 1
store i32 %49, i32* %8
br label %34
50: ; preds = %34
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%cx^%d + \00"
@.str.1 = [8 x i8] c"%c = 0\0A\00"
@.str.2 = [6 x i8] c"%c = \00"
@.str.3 = [4 x i8] c"%lf\00"
define void @readEquation(double* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %23
5: ; preds = %2
%6 = add i32 %3, 97
br label %11
7: ; preds = %19
br i1 %4, label %8, label %23
8: ; preds = %7
%9 = and i64 %1, 4294967295
%10 = add i32 %3, 97
br label %24
11: ; preds = %5, %19
%12 = phi i32 [ %21, %19 ], [ 97, %5 ]
%13 = phi i32 [ %20, %19 ], [ %3, %5 ]
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
br label %19
17: ; preds = %11
%18 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 0)
br label %19
19: ; preds = %15, %17
%20 = add nsw i32 %13, -1
%21 = add nuw i32 %12, 1
%22 = icmp eq i32 %12, %6
br i1 %22, label %7, label %11
23: ; preds = %24, %2, %7
ret void
24: ; preds = %8, %24
%25 = phi i64 [ %9, %8 ], [ %30, %24 ]
%26 = phi i32 [ 97, %8 ], [ %31, %24 ]
%27 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds double, double* %0, i64 %25
%29 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %28)
%30 = add nsw i64 %25, -1
%31 = add nuw i32 %26, 1
%32 = icmp eq i32 %26, %10
br i1 %32, label %23, label %24
}