#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*/ polinome(int, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int n = 0;
  printf("Insira o grau do polinomio: ");
  scanf("%d", &n);
  int i, j, vetor[n], k;
  printf("Quer em quantos pontos diferentes ?\n");
  scanf("%d", &k);
  for (j = 0; j < k; j++)
    ;
  for (i = 0; i < n; i++) {
    printf("Insira o valor do %dº valor: ", i + 1);
    scanf("%d", &vetor[i]);
  }
  polinome(n, vetor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    11d6 <main+0xa6>
jmp    11c8 <main+0x98>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b7 <main+0x87>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1226 <main+0xf6>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rsi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe0a(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11dd <main+0xad>
mov    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%edi
call   1050 <polinome@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,-0x2c(%rbp)
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb0(%rip),%r15
lea    -0x2c(%rbp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
mov    %rsp,%rbx
mov    -0x2c(%rbp),%eax
mov    %rsp,%r14
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    -0x3c(%rbp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
mov    -0x2c(%rbp),%edi
test   %edi,%edi
jle    11fc <main+0xbc>
mov    %rbx,-0x38(%rbp)
lea    0xe62(%rip),%r15
lea    0xe58(%rip),%r12
mov    %r14,%r13
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
movslq -0x2c(%rbp),%rdi
add    $0x4,%r13
cmp    %rdi,%rbx
jl     11d0 <main+0x90>
mov    -0x38(%rbp),%rbx
mov    %r14,%rsi
call   1060 <polinome@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Insira o grau do polinomio: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"Quer em quantos pontos diferentes ?\0A\00"
@.str.3 = [31 x i8] c"Insira o valor do %d\C2\BA valor: \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %9
%17 = alloca i32, i64 %15
store i64 %15, i64* %10
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %11)
store i32 0, i32* %8
br label %20
20: ; preds = %25, %2
%21 = load i32, i32* %8
%22 = load i32, i32* %11
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %20
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %20
28: ; preds = %20
store i32 0, i32* %7
br label %29
29: ; preds = %41, %28
%30 = load i32, i32* %7
%31 = load i32, i32* %6
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %44
33: ; preds = %29
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %7
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %17, i64 %38
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %39)
br label %41
41: ; preds = %33
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
store i32 %43, i32* %7
br label %29
44: ; preds = %29
%45 = load i32, i32* %6
%46 = call i32 @polinome(i32 %45, i32* %17)
store i32 0, i32* %3
%47 = load i8*, i8** %9
%48 = load i32, i32* %3
ret i32 %48
}

LLVM IR (-O2):
@.str = [29 x i8] c"Insira o grau do polinomio: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [31 x i8] c"Insira o valor do %d\C2\BA valor: \00"
@str = [36 x i8] c"Quer em quantos pontos diferentes ?\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
%11 = alloca i32, i64 %9
%12 = bitcast i32* %4 to i8*
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %27
17: ; preds = %2, %17
%18 = phi i64 [ %19, %17 ], [ 0, %2 ]
%19 = add nuw nsw i64 %18, 1
%20 = trunc i64 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds i32, i32* %11, i64 %18
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %22)
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = icmp slt i64 %19, %25
br i1 %26, label %17, label %27
27: ; preds = %17, %2
%28 = phi i32 [ %15, %2 ], [ %24, %17 ]
%29 = call i32 @polinome(i32 %28, i32* %11)
ret i32 0
}