#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 */
float fabs(float);
float pow(float, double);
void hace_mascara(unsigned char *mascara, int ancho) {
  int i, j;
  float x, y, t, h, b;
  unsigned int color;
  int kk;
  for (j = 0; j < ancho; j++)
    for (i = 0; i < ancho; i++) {
      y = 1.0 - (float)j / (float)(ancho - 1);
      t = -2.0 + i * (4.0 / (float)(ancho - 1));
      t *= .75;
      t = fabs(t);
      if (t > 1)
        t = 1;
      t = 1 - t;
      if (y > .1)
        t *= 1.0 - (y - .1) / (1.0 - .1);
      else
        t *= pow((y - .0) / (.1 - .0), .3);
      color = t * 255.0;
      if (color > 255)
        color = 255;
      *mascara++ = 255 - color;
    }
}


x86 assembly (clang, -O0):
<hace_mascara>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1322 <hace_mascara+0x202>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    130f <hace_mascara+0x1ef>
cvtsi2ssl -0x14(%rbp),%xmm0
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe7c(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe64(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3e(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
movss  0xe0d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1209 <hace_mascara+0xe9>
movss  0xdfc(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xdef(%rip),%xmm0
subss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    127e <hace_mascara+0x15e>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xde5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdc1(%rip),%xmm1
subsd  %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    12b5 <hace_mascara+0x195>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xd92(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xd8a(%rip),%xmm1
call   1040 <pow@plt>
mulss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd7a(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x2c(%rbp)
cmpl   $0xff,-0x2c(%rbp)
jbe    12e6 <hace_mascara+0x1c6>
movl   $0xff,-0x2c(%rbp)
mov    $0xff,%eax
sub    -0x2c(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <hace_mascara+0x29>
jmp    1314 <hace_mascara+0x1f4>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <hace_mascara+0x16>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hace_mascara>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
test   %esi,%esi
jle    1313 <hace_mascara+0x203>
mov    %rdi,%rbx
mov    %esi,%r14d
add    $0xffffffff,%esi
cvtsi2ss %esi,%xmm0
movss  %xmm0,0x8(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  0xebc(%rip),%xmm8
divsd  %xmm0,%xmm8
xor    %r15d,%r15d
movss  0xeec(%rip),%xmm3
movsd  0xeac(%rip),%xmm4
movsd  0xebc(%rip),%xmm5
movsd  0xebc(%rip),%xmm6
movss  0xed0(%rip),%xmm7
movaps 0xed5(%rip),%xmm2
movsd  0xeb4(%rip),%xmm9
mov    $0xff,%r12d
movsd  %xmm8,0x10(%rsp)
jmp    11b0 <hace_mascara+0xa0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r15d
add    %rbp,%rbx
cmp    %r14d,%r15d
je     1313 <hace_mascara+0x203>
xorps  %xmm0,%xmm0
cvtsi2ss %r15d,%xmm0
divss  0x8(%rsp),%xmm0
movaps %xmm3,%xmm1
subss  %xmm0,%xmm1
xorps  %xmm10,%xmm10
cvtss2sd %xmm1,%xmm10
movaps %xmm10,%xmm0
divsd  %xmm4,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movaps %xmm10,%xmm0
addsd  0xe24(%rip),%xmm0
divsd  0xe24(%rip),%xmm0
addsd  %xmm5,%xmm0
movsd  %xmm0,0x18(%rsp)
xorpd  %xmm11,%xmm11
xor    %ebp,%ebp
movsd  %xmm10,0x20(%rsp)
jmp    12d1 <hace_mascara+0x1c1>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  %xmm0,0x4(%rsp)
movss  0xc(%rsp),%xmm0
movsd  0xdfc(%rip),%xmm1
movsd  %xmm11,0x28(%rsp)
call   1030 <pow@plt>
movsd  0x28(%rsp),%xmm11
movsd  0x20(%rsp),%xmm10
movsd  0xde1(%rip),%xmm9
movaps 0xdf2(%rip),%xmm2
movss  0xdde(%rip),%xmm7
movsd  0xdba(%rip),%xmm6
movsd  0xdaa(%rip),%xmm5
movsd  0xd8a(%rip),%xmm4
movss  0xdba(%rip),%xmm3
movsd  0x10(%rsp),%xmm8
movss  0x4(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm9,%xmm0
cvttsd2si %xmm0,%rax
cmp    $0xff,%eax
cmovae %r12d,%eax
not    %al
mov    %al,(%rbx,%rbp,1)
addsd  %xmm5,%xmm11
add    $0x1,%rbp
cmp    %ebp,%r14d
je     11a0 <hace_mascara+0x90>
ucomisd %xmm4,%xmm10
movapd %xmm11,%xmm0
mulsd  %xmm8,%xmm0
addsd  %xmm6,%xmm0
cvtsd2ss %xmm0,%xmm0
mulss  %xmm7,%xmm0
andps  %xmm2,%xmm0
movaps %xmm3,%xmm1
minss  %xmm0,%xmm1
movaps %xmm3,%xmm0
subss  %xmm1,%xmm0
jbe    1220 <hace_mascara+0x110>
cvtss2sd %xmm0,%xmm0
mulsd  0x18(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    12a3 <hace_mascara+0x193>
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @hace_mascara(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %6
br label %14
14: ; preds = %94, %2
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %97
18: ; preds = %14
store i32 0, i32* %5
br label %19
19: ; preds = %90, %18
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %93
23: ; preds = %19
%24 = load i32, i32* %6
%25 = sitofp i32 %24 to float
%26 = load i32, i32* %4
%27 = sub nsw i32 %26, 1
%28 = sitofp i32 %27 to float
%29 = fdiv float %25, %28
%30 = fpext float %29 to double
%31 = fsub double 1.000000e+00, %30
%32 = fptrunc double %31 to float
store float %32, float* %8
%33 = load i32, i32* %5
%34 = sitofp i32 %33 to double
%35 = load i32, i32* %4
%36 = sub nsw i32 %35, 1
%37 = sitofp i32 %36 to float
%38 = fpext float %37 to double
%39 = fdiv double 4.000000e+00, %38
%40 = call double @llvm.fmuladd.f64(double %34, double %39, double -2.000000e+00)
%41 = fptrunc double %40 to float
store float %41, float* %9
%42 = load float, float* %9
%43 = fpext float %42 to double
%44 = fmul double %43, 7.500000e-01
%45 = fptrunc double %44 to float
store float %45, float* %9
%46 = load float, float* %9
%47 = call float @fabs(float %46)
store float %47, float* %9
%48 = load float, float* %9
%49 = fcmp ogt float %48, 1.000000e+00
br i1 %49, label %50, label %51
50: ; preds = %23
store float 1.000000e+00, float* %9
br label %51
51: ; preds = %50, %23
%52 = load float, float* %9
%53 = fsub float 1.000000e+00, %52
store float %53, float* %9
%54 = load float, float* %8
%55 = fpext float %54 to double
%56 = fcmp ogt double %55, 1.000000e-01
br i1 %56, label %57, label %67
57: ; preds = %51
%58 = load float, float* %8
%59 = fpext float %58 to double
%60 = fsub double %59, 1.000000e-01
%61 = fdiv double %60, 9.000000e-01
%62 = fsub double 1.000000e+00, %61
%63 = load float, float* %9
%64 = fpext float %63 to double
%65 = fmul double %64, %62
%66 = fptrunc double %65 to float
store float %66, float* %9
br label %76
67: ; preds = %51
%68 = load float, float* %8
%69 = fpext float %68 to double
%70 = fsub double %69, 0.000000e+00
%71 = fdiv double %70, 1.000000e-01
%72 = fptrunc double %71 to float
%73 = call float @pow(float %72, double 3.000000e-01)
%74 = load float, float* %9
%75 = fmul float %74, %73
store float %75, float* %9
br label %76
76: ; preds = %67, %57
%77 = load float, float* %9
%78 = fpext float %77 to double
%79 = fmul double %78, 2.550000e+02
%80 = fptoui double %79 to i32
store i32 %80, i32* %12
%81 = load i32, i32* %12
%82 = icmp ugt i32 %81, 255
br i1 %82, label %83, label %84
83: ; preds = %76
store i32 255, i32* %12
br label %84
84: ; preds = %83, %76
%85 = load i32, i32* %12
%86 = sub i32 255, %85
%87 = trunc i32 %86 to i8
%88 = load i8*, i8** %3
%89 = getelementptr inbounds i8, i8* %88, i32 1
store i8* %89, i8** %3
store i8 %87, i8* %88
br label %90
90: ; preds = %84
%91 = load i32, i32* %5
%92 = add nsw i32 %91, 1
store i32 %92, i32* %5
br label %19
93: ; preds = %19
br label %94
94: ; preds = %93
%95 = load i32, i32* %6
%96 = add nsw i32 %95, 1
store i32 %96, i32* %6
br label %14
97: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @hace_mascara(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %55
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = sitofp i32 %5 to float
%7 = fpext float %6 to double
%8 = fdiv double 4.000000e+00, %7
br label %9
9: ; preds = %52, %4
%10 = phi i8* [ %0, %4 ], [ %49, %52 ]
%11 = phi i32 [ 0, %4 ], [ %53, %52 ]
%12 = sitofp i32 %11 to float
%13 = fdiv float %12, %6
%14 = fsub float 1.000000e+00, %13
%15 = fpext float %14 to double
%16 = fcmp ogt double %15, 1.000000e-01
%17 = fdiv double %15, 1.000000e-01
%18 = fptrunc double %17 to float
%19 = fadd double %15, -1.000000e-01
%20 = fdiv double %19, 9.000000e-01
%21 = fsub double 1.000000e+00, %20
br label %22
22: ; preds = %9, %40
%23 = phi i8* [ %10, %9 ], [ %49, %40 ]
%24 = phi i32 [ 0, %9 ], [ %50, %40 ]
%25 = sitofp i32 %24 to double
%26 = tail call double @llvm.fmuladd.f64(double %25, double %8, double -2.000000e+00)
%27 = fptrunc double %26 to float
%28 = fmul float %27, 7.500000e-01
%29 = tail call float @llvm.fabs.f32(float %28)
%30 = fcmp ogt float %29, 1.000000e+00
%31 = select i1 %30, float 1.000000e+00, float %29
%32 = fsub float 1.000000e+00, %31
br i1 %16, label %33, label %37
33: ; preds = %22
%34 = fpext float %32 to double
%35 = fmul double %21, %34
%36 = fptrunc double %35 to float
br label %40
37: ; preds = %22
%38 = tail call float @pow(float %18, double 3.000000e-01)
%39 = fmul float %32, %38
br label %40
40: ; preds = %37, %33
%41 = phi float [ %36, %33 ], [ %39, %37 ]
%42 = fpext float %41 to double
%43 = fmul double %42, 2.550000e+02
%44 = fptoui double %43 to i32
%45 = icmp ult i32 %44, 255
%46 = select i1 %45, i32 %44, i32 255
%47 = trunc i32 %46 to i8
%48 = xor i8 %47, -1
%49 = getelementptr inbounds i8, i8* %23, i64 1
store i8 %48, i8* %23
%50 = add nuw nsw i32 %24, 1
%51 = icmp eq i32 %50, %1
br i1 %51, label %52, label %22
52: ; preds = %40
%53 = add nuw nsw i32 %11, 1
%54 = icmp eq i32 %53, %1
br i1 %54, label %55, label %9
55: ; preds = %52, %2
ret void
}