#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*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
void prints(char function[], long double *degrees, unsigned long size) {
  unsigned long i;
  char trash[100];
  if (degrees[size - 1] != 0) {
    sprintf(trash, "%.4Lf*x**%lu", degrees[size - 1], size - 1);
    strcat(function, trash);
  }
  for (i = size - 2; i > 0; i--) {
    if (degrees[i] != 0) {
      sprintf(trash, "%s%.4Lf", ((degrees[i] < 0) ? " - " : " + "),
              ((degrees[i] < 0) ? -degrees[i] : degrees[i]));
      strcat(function, trash);
      if (i != 1)
        sprintf(trash, "*x**%lu", i);
      else
        sprintf(trash, "*x");
      strcat(function, trash);
    }
  }
  if (degrees[i] != 0)
    sprintf(trash, "%s%.4Lf\n", ((degrees[i] < 0) ? " - " : " + "),
            ((degrees[i] < 0) ? -degrees[i] : degrees[i]));
  else
    sprintf(trash, "\n");
  strcat(function, trash);
}


x86 assembly (clang, -O0):
<prints>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
shl    $0x4,%rax
fldt   -0x10(%rax,%rcx,1)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1160 <prints+0x40>
jp     1160 <prints+0x40>
jmp    11a2 <prints+0x82>
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
shl    $0x4,%rax
fldt   -0x10(%rax,%rcx,1)
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe75(%rip),%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x18(%rbp),%rax
sub    $0x2,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jbe    12fa <prints+0x1da>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    11e1 <prints+0xc1>
jp     11e1 <prints+0xc1>
jmp    12e4 <prints+0x1c4>
lea    -0x90(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
fldz
fucomip %st(1),%st
fstp   %st(0)
lea    0xe0a(%rip),%rcx
lea    0xe07(%rip),%rax
cmova  %rcx,%rax
mov    %rax,-0x98(%rbp)
jbe    124a <prints+0x12a>
jmp    1228 <prints+0x108>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x4,%rcx
mov    %rax,%rdx
add    %rcx,%rdx
fldt   (%rax,%rcx,1)
fchs
fstpt  -0xac(%rbp)
jmp    125f <prints+0x13f>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
fstpt  -0xac(%rbp)
mov    -0x98(%rbp),%rdx
mov    -0xa0(%rbp),%rdi
fldt   -0xac(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xd8e(%rip),%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcat@plt>
cmpq   $0x1,-0x20(%rbp)
je     12bf <prints+0x19f>
lea    -0x90(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xd52(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    12d4 <prints+0x1b4>
lea    -0x90(%rbp),%rdi
lea    0xd50(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcat@plt>
jmp    12e9 <prints+0x1c9>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    11ae <prints+0x8e>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1322 <prints+0x202>
jp     1322 <prints+0x202>
jmp    13cc <prints+0x2ac>
lea    -0x90(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
fldz
fucomip %st(1),%st
fstp   %st(0)
lea    0xcc9(%rip),%rcx
lea    0xcc6(%rip),%rax
cmova  %rcx,%rax
mov    %rax,-0xb8(%rbp)
jbe    138b <prints+0x26b>
jmp    1369 <prints+0x249>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x4,%rcx
mov    %rax,%rdx
add    %rcx,%rdx
fldt   (%rax,%rcx,1)
fchs
fstpt  -0xcc(%rbp)
jmp    13a0 <prints+0x280>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
fstpt  -0xcc(%rbp)
mov    -0xb8(%rbp),%rdx
mov    -0xc0(%rbp),%rdi
fldt   -0xcc(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xc60(%rip),%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
jmp    13e1 <prints+0x2c1>
lea    -0x90(%rbp),%rdi
lea    0xc4d(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcat@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prints>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdx,%rbp
mov    %rdi,%r15
add    $0xffffffffffffffff,%rdx
mov    %rdx,%rax
shl    $0x4,%rax
mov    %rsi,0x18(%rsp)
fldt   (%rsi,%rax,1)
fldz
fxch   %st(1)
fucomi %st(1),%st
fld    %st(1)
fstpt  0x24(%rsp)
jne    115a <prints+0x3a>
jnp    1186 <prints+0x66>
fstp   %st(1)
fstpt  (%rsp)
lea    0xe9a(%rip),%rsi
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcat@plt>
fldt   0x24(%rsp)
fldz
fstp   %st(0)
mov    %rbp,%rbx
add    $0xfffffffffffffffe,%rbx
je     1239 <prints+0x119>
add    $0xfffffffffffffffd,%rbp
shl    $0x4,%rbx
add    0x18(%rsp),%rbx
lea    0xe64(%rip),%r12
lea    0x30(%rsp),%r13
jmp    11d9 <prints+0xb9>
movb   $0x0,0x32(%rsp)
movw   $0x782a,0x30(%rsp)
mov    %r15,%rdi
mov    %r13,%rsi
call   1030 <strcat@plt>
fldt   0x24(%rsp)
fldz
fstp   %st(0)
add    $0xfffffffffffffff0,%rbx
add    $0xffffffffffffffff,%rbp
jae    1239 <prints+0x119>
fldt   (%rbx)
fucomi %st(1),%st
jne    11e1 <prints+0xc1>
jnp    11cd <prints+0xad>
lea    0x1(%rbp),%r14
fxch   %st(1)
fucomip %st(1),%st
lea    0xe25(%rip),%rdx
ja     11f9 <prints+0xd9>
lea    0xe20(%rip),%rdx
fld    %st(0)
fchs
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
fstpt  (%rsp)
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1030 <strcat@plt>
test   %rbp,%rbp
je     11b0 <prints+0x90>
mov    %r13,%rdi
lea    0xdd8(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sprintf@plt>
jmp    11bc <prints+0x9c>
mov    0x18(%rsp),%rax
fldt   (%rax)
fucomi %st(1),%st
jne    1246 <prints+0x126>
jnp    127e <prints+0x15e>
fxch   %st(1)
fucomip %st(1),%st
lea    0xdc4(%rip),%rax
lea    0xdc1(%rip),%rdx
cmova  %rax,%rdx
fld    %st(0)
fchs
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
fstpt  (%rsp)
lea    0xdb0(%rip),%rsi
lea    0x30(%rsp),%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
jmp    1289 <prints+0x169>
fstp   %st(0)
fstp   %st(0)
movw   $0xa,0x30(%rsp)
lea    0x30(%rsp),%rsi
mov    %r15,%rdi
call   1030 <strcat@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%.4Lf*x**%lu\00"
@.str.1 = [8 x i8] c"%s%.4Lf\00"
@.str.2 = [4 x i8] c" - \00"
@.str.3 = [4 x i8] c" + \00"
@.str.4 = [8 x i8] c"*x**%lu\00"
@.str.5 = [3 x i8] c"*x\00"
@.str.6 = [9 x i8] c"%s%.4Lf\0A\00"
@.str.7 = [2 x i8] c"\0A\00"
define void @prints(i8* %0, x86_fp80* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca x86_fp80*
%6 = alloca i64
%7 = alloca i64
%8 = alloca [100 x i8]
store i8* %0, i8** %4
store x86_fp80* %1, x86_fp80** %5
store i64 %2, i64* %6
%9 = load x86_fp80*, x86_fp80** %5
%10 = load i64, i64* %6
%11 = sub i64 %10, 1
%12 = getelementptr inbounds x86_fp80, x86_fp80* %9, i64 %11
%13 = load x86_fp80, x86_fp80* %12
%14 = fcmp une x86_fp80 %13, 0xK00000000000000000000
br i1 %14, label %15, label %28
15: ; preds = %3
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%17 = load x86_fp80*, x86_fp80** %5
%18 = load i64, i64* %6
%19 = sub i64 %18, 1
%20 = getelementptr inbounds x86_fp80, x86_fp80* %17, i64 %19
%21 = load x86_fp80, x86_fp80* %20
%22 = load i64, i64* %6
%23 = sub i64 %22, 1
%24 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), x86_fp80 %21, i64 %23)
%25 = load i8*, i8** %4
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%27 = call i32 @strcat(i8* %25, i8* %26)
br label %28
28: ; preds = %15, %3
%29 = load i64, i64* %6
%30 = sub i64 %29, 2
store i64 %30, i64* %7
br label %31
31: ; preds = %85, %28
%32 = load i64, i64* %7
%33 = icmp ugt i64 %32, 0
br i1 %33, label %34, label %88
34: ; preds = %31
%35 = load x86_fp80*, x86_fp80** %5
%36 = load i64, i64* %7
%37 = getelementptr inbounds x86_fp80, x86_fp80* %35, i64 %36
%38 = load x86_fp80, x86_fp80* %37
%39 = fcmp une x86_fp80 %38, 0xK00000000000000000000
br i1 %39, label %40, label %84
40: ; preds = %34
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%42 = load x86_fp80*, x86_fp80** %5
%43 = load i64, i64* %7
%44 = getelementptr inbounds x86_fp80, x86_fp80* %42, i64 %43
%45 = load x86_fp80, x86_fp80* %44
%46 = fcmp olt x86_fp80 %45, 0xK00000000000000000000
%47 = zext i1 %46 to i64
%48 = select i1 %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%49 = load x86_fp80*, x86_fp80** %5
%50 = load i64, i64* %7
%51 = getelementptr inbounds x86_fp80, x86_fp80* %49, i64 %50
%52 = load x86_fp80, x86_fp80* %51
%53 = fcmp olt x86_fp80 %52, 0xK00000000000000000000
br i1 %53, label %54, label %60
54: ; preds = %40
%55 = load x86_fp80*, x86_fp80** %5
%56 = load i64, i64* %7
%57 = getelementptr inbounds x86_fp80, x86_fp80* %55, i64 %56
%58 = load x86_fp80, x86_fp80* %57
%59 = fneg x86_fp80 %58
br label %65
60: ; preds = %40
%61 = load x86_fp80*, x86_fp80** %5
%62 = load i64, i64* %7
%63 = getelementptr inbounds x86_fp80, x86_fp80* %61, i64 %62
%64 = load x86_fp80, x86_fp80* %63
br label %65
65: ; preds = %60, %54
%66 = phi x86_fp80 [ %59, %54 ], [ %64, %60 ]
%67 = call i32 (i8*, i8*, ...) @sprintf(i8* %41, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %48, x86_fp80 %66)
%68 = load i8*, i8** %4
%69 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%70 = call i32 @strcat(i8* %68, i8* %69)
%71 = load i64, i64* %7
%72 = icmp ne i64 %71, 1
br i1 %72, label %73, label %77
73: ; preds = %65
%74 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%75 = load i64, i64* %7
%76 = call i32 (i8*, i8*, ...) @sprintf(i8* %74, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i64 %75)
br label %80
77: ; preds = %65
%78 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%79 = call i32 (i8*, i8*, ...) @sprintf(i8* %78, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %80
80: ; preds = %77, %73
%81 = load i8*, i8** %4
%82 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%83 = call i32 @strcat(i8* %81, i8* %82)
br label %84
84: ; preds = %80, %34
br label %85
85: ; preds = %84
%86 = load i64, i64* %7
%87 = add i64 %86, -1
store i64 %87, i64* %7
br label %31
88: ; preds = %31
%89 = load x86_fp80*, x86_fp80** %5
%90 = load i64, i64* %7
%91 = getelementptr inbounds x86_fp80, x86_fp80* %89, i64 %90
%92 = load x86_fp80, x86_fp80* %91
%93 = fcmp une x86_fp80 %92, 0xK00000000000000000000
br i1 %93, label %94, label %122
94: ; preds = %88
%95 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%96 = load x86_fp80*, x86_fp80** %5
%97 = load i64, i64* %7
%98 = getelementptr inbounds x86_fp80, x86_fp80* %96, i64 %97
%99 = load x86_fp80, x86_fp80* %98
%100 = fcmp olt x86_fp80 %99, 0xK00000000000000000000
%101 = zext i1 %100 to i64
%102 = select i1 %100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%103 = load x86_fp80*, x86_fp80** %5
%104 = load i64, i64* %7
%105 = getelementptr inbounds x86_fp80, x86_fp80* %103, i64 %104
%106 = load x86_fp80, x86_fp80* %105
%107 = fcmp olt x86_fp80 %106, 0xK00000000000000000000
br i1 %107, label %108, label %114
108: ; preds = %94
%109 = load x86_fp80*, x86_fp80** %5
%110 = load i64, i64* %7
%111 = getelementptr inbounds x86_fp80, x86_fp80* %109, i64 %110
%112 = load x86_fp80, x86_fp80* %111
%113 = fneg x86_fp80 %112
br label %119
114: ; preds = %94
%115 = load x86_fp80*, x86_fp80** %5
%116 = load i64, i64* %7
%117 = getelementptr inbounds x86_fp80, x86_fp80* %115, i64 %116
%118 = load x86_fp80, x86_fp80* %117
br label %119
119: ; preds = %114, %108
%120 = phi x86_fp80 [ %113, %108 ], [ %118, %114 ]
%121 = call i32 (i8*, i8*, ...) @sprintf(i8* %95, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %102, x86_fp80 %120)
br label %125
122: ; preds = %88
%123 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%124 = call i32 (i8*, i8*, ...) @sprintf(i8* %123, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %125
125: ; preds = %122, %119
%126 = load i8*, i8** %4
%127 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%128 = call i32 @strcat(i8* %126, i8* %127)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%.4Lf*x**%lu\00"
@.str.1 = [8 x i8] c"%s%.4Lf\00"
@.str.2 = [4 x i8] c" - \00"
@.str.3 = [4 x i8] c" + \00"
@.str.4 = [8 x i8] c"*x**%lu\00"
@.str.5 = [3 x i8] c"*x\00"
@.str.6 = [9 x i8] c"%s%.4Lf\0A\00"
define void @prints(i8* %0, x86_fp80* nocapture %1, i64 %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = add i64 %2, -1
%7 = getelementptr inbounds x86_fp80, x86_fp80* %1, i64 %6
%8 = load x86_fp80, x86_fp80* %7
%9 = fcmp une x86_fp80 %8, 0xK00000000000000000000
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), x86_fp80 %8, i64 %6)
%12 = call i32 @strcat(i8* %0, i8* %5)
br label %13
13: ; preds = %10, %3
%14 = add i64 %2, -2
%15 = icmp eq i64 %14, 0
br i1 %15, label %37, label %16
16: ; preds = %13, %34
%17 = phi i64 [ %35, %34 ], [ %14, %13 ]
%18 = getelementptr inbounds x86_fp80, x86_fp80* %1, i64 %17
%19 = load x86_fp80, x86_fp80* %18
%20 = fcmp une x86_fp80 %19, 0xK00000000000000000000
br i1 %20, label %21, label %34
21: ; preds = %16
%22 = fcmp olt x86_fp80 %19, 0xK00000000000000000000
%23 = select i1 %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%24 = fneg x86_fp80 %19
%25 = select i1 %22, x86_fp80 %24, x86_fp80 %19
%26 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %23, x86_fp80 %25)
%27 = call i32 @strcat(i8* %0, i8* %5)
%28 = icmp eq i64 %17, 1
br i1 %28, label %31, label %29
29: ; preds = %21
%30 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i64 %17)
br label %32
31: ; preds = %21
br label %32
32: ; preds = %31, %29
%33 = call i32 @strcat(i8* %0, i8* %5)
br label %34
34: ; preds = %16, %32
%35 = add i64 %17, -1
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %16
37: ; preds = %34, %13
%38 = load x86_fp80, x86_fp80* %1
%39 = fcmp une x86_fp80 %38, 0xK00000000000000000000
br i1 %39, label %40, label %46
40: ; preds = %37
%41 = fcmp olt x86_fp80 %38, 0xK00000000000000000000
%42 = select i1 %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%43 = fneg x86_fp80 %38
%44 = select i1 %41, x86_fp80 %43, x86_fp80 %38
%45 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %42, x86_fp80 %44)
br label %48
46: ; preds = %37
%47 = bitcast [100 x i8]* %4 to i16*
store i16 10, i16* %47
br label %48
48: ; preds = %46, %40
%49 = call i32 @strcat(i8* %0, i8* %5)
ret void
}