#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 potencia(short, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  int n, i = 1, a, b, c, d, resultado = 0;
  short int x;
  printf("N valores de x: ");
  scanf("%d", &n);
  while (i <= n) {
    printf("Valor de x: ");
    scanf("%d", &x);
    a = 12 * potencia(x, 9);
    b = 2 * potencia(x, 8);
    c = 26 * potencia(x, 5);
    d = 31 * potencia(x, 2);
    resultado = a + b + c + d + 72;
    printf("Z =  %d\n", resultado);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     121a <main+0xea>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe83(%rip),%rdi
lea    -0x22(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    $0x9,%esi
movswl -0x22(%rbp),%edi
call   1050 <potencia@plt>
imul   $0xc,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    $0x8,%esi
movswl -0x22(%rbp),%edi
call   1050 <potencia@plt>
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    $0x5,%esi
movswl -0x22(%rbp),%edi
call   1050 <potencia@plt>
imul   $0x1a,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    $0x2,%esi
movswl -0x22(%rbp),%edi
call   1050 <potencia@plt>
imul   $0x1f,%eax,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x48,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <main+0x3d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1218 <main+0xe8>
lea    0x2(%rsp),%r12
lea    0xeae(%rip),%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movswl 0x2(%rsp),%edi
mov    $0x9,%esi
call   1050 <potencia@plt>
lea    (%rax,%rax,2),%r14d
movswl 0x2(%rsp),%edi
mov    $0x8,%esi
call   1050 <potencia@plt>
mov    %eax,%ebx
add    %ebx,%ebx
movswl 0x2(%rsp),%edi
mov    $0x5,%esi
call   1050 <potencia@plt>
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%r15d
add    %eax,%r15d
movswl 0x2(%rsp),%edi
mov    $0x2,%esi
call   1050 <potencia@plt>
mov    %eax,%ecx
shl    $0x5,%ecx
sub    %eax,%ecx
lea    (%rbx,%r14,4),%eax
add    %r15d,%eax
lea    (%rcx,%rax,1),%esi
add    $0x48,%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1180 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"N valores de x: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Valor de x: \00"
@.str.3 = [9 x i8] c"Z = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i16
store i32 0, i32* %1
store i32 1, i32* %3
store i32 0, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %12
12: ; preds = %16, %0
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %43
16: ; preds = %12
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i16* %9)
%19 = load i16, i16* %9
%20 = call i32 @potencia(i16 signext %19, i32 9)
%21 = mul nsw i32 12, %20
store i32 %21, i32* %4
%22 = load i16, i16* %9
%23 = call i32 @potencia(i16 signext %22, i32 8)
%24 = mul nsw i32 2, %23
store i32 %24, i32* %5
%25 = load i16, i16* %9
%26 = call i32 @potencia(i16 signext %25, i32 5)
%27 = mul nsw i32 26, %26
store i32 %27, i32* %6
%28 = load i16, i16* %9
%29 = call i32 @potencia(i16 signext %28, i32 2)
%30 = mul nsw i32 31, %29
store i32 %30, i32* %7
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = add nsw i32 %31, %32
%34 = load i32, i32* %6
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %7
%37 = add nsw i32 %35, %36
%38 = add nsw i32 %37, 72
store i32 %38, i32* %8
%39 = load i32, i32* %8
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %12
43: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"N valores de x: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Valor de x: \00"
@.str.3 = [9 x i8] c"Z = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = bitcast i32* %1 to i8*
%4 = bitcast i16* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 1
br i1 %8, label %33, label %9
9: ; preds = %0, %9
%10 = phi i32 [ %30, %9 ], [ 1, %0 ]
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i16* %2)
%13 = load i16, i16* %2
%14 = call i32 @potencia(i16 signext %13, i32 9)
%15 = mul nsw i32 %14, 12
%16 = load i16, i16* %2
%17 = call i32 @potencia(i16 signext %16, i32 8)
%18 = shl nsw i32 %17, 1
%19 = load i16, i16* %2
%20 = call i32 @potencia(i16 signext %19, i32 5)
%21 = mul nsw i32 %20, 26
%22 = load i16, i16* %2
%23 = call i32 @potencia(i16 signext %22, i32 2)
%24 = mul nsw i32 %23, 31
%25 = add i32 %15, 72
%26 = add i32 %25, %18
%27 = add i32 %26, %21
%28 = add i32 %27, %24
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%30 = add nuw nsw i32 %10, 1
%31 = load i32, i32* %1
%32 = icmp slt i32 %10, %31
br i1 %32, label %9, label %33
33: ; preds = %9, %0
ret i32 0
}