#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 main(int argc, const char *argv[]) {
  int a, b, i;
  double x, y, p, q;
  for (a = 0; a < 22; a++) {
    for (b = 0; b < 78; b++) {
      x = 0.0;
      y = 0.0;
      i = 0;
      while ((x * x + y * y) < 4.0 && (i < 100)) {
        p = x * x - y * y + b / (78 / 2.0) - 1.5;
        q = 2.0 * x * y + a / (22 / 2.0) - 1.0;
        x = p;
        y = q;
        i++;
      }
      (i > 99) ? printf("#") : printf(".");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x16,-0x14(%rbp)
jge    12b2 <main+0x1a2>
movl   $0x0,-0x18(%rbp)
cmpl   $0x4e,-0x18(%rbp)
jge    1298 <main+0x188>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x1c(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
xor    %eax,%eax
movsd  0xe7b(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x41(%rbp)
jbe    119c <main+0x8c>
cmpl   $0x64,-0x1c(%rbp)
setl   %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    11ac <main+0x9c>
jmp    1263 <main+0x153>
movsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  0xe3c(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xe24(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe0b(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xdec(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xdd0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115f <main+0x4f>
cmpl   $0x63,-0x1c(%rbp)
jle    127e <main+0x16e>
lea    0xdbc(%rip),%rdi
call   1030 <printf@plt>
jmp    128a <main+0x17a>
lea    0xdad(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113e <main+0x2e>
lea    0xd95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
xor    %r14d,%r14d
xorpd  %xmm0,%xmm0
mov    $0x23,%ebp
jmp    1156 <main+0x46>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xee0(%rip),%xmm0
add    $0x1,%r14d
cmp    $0x16,%r14d
je     1244 <main+0x134>
movsd  %xmm0,0x8(%rsp)
movapd %xmm0,%xmm8
divsd  0xe96(%rip),%xmm8
xorpd  %xmm0,%xmm0
xor    %ebx,%ebx
movsd  %xmm8,0x10(%rsp)
jmp    11ad <main+0x9d>
nopl   0x0(%rax)
cmp    $0x63,%eax
mov    $0x2e,%edi
cmovae %ebp,%edi
call   1030 <putchar@plt>
movsd  0x10(%rsp),%xmm8
movsd  0x18(%rsp),%xmm0
addsd  0xe83(%rip),%xmm0
add    $0x1,%ebx
cmp    $0x4e,%ebx
je     1130 <main+0x20>
movsd  %xmm0,0x18(%rsp)
divsd  0xe4d(%rip),%xmm0
xorpd  %xmm3,%xmm3
mov    $0xffffffff,%eax
xorpd  %xmm2,%xmm2
xorpd  %xmm1,%xmm1
movsd  0xe3c(%rip),%xmm5
movsd  0xe3c(%rip),%xmm6
movsd  0xe3c(%rip),%xmm7
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm1,%xmm4
add    $0x1,%eax
mulsd  %xmm1,%xmm1
subsd  %xmm3,%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm5,%xmm1
addsd  %xmm4,%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm8,%xmm4
movapd %xmm4,%xmm2
addsd  %xmm6,%xmm2
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm1,%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
ucomisd %xmm4,%xmm7
jbe    1180 <main+0x70>
cmp    $0x63,%eax
jb     11f0 <main+0xe0>
jmp    1180 <main+0x70>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"#\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [2 x i8] c"\0A\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 double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %13
13: ; preds = %73, %2
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 22
br i1 %15, label %16, label %76
16: ; preds = %13
store i32 0, i32* %7
br label %17
17: ; preds = %68, %16
%18 = load i32, i32* %7
%19 = icmp slt i32 %18, 78
br i1 %19, label %20, label %71
20: ; preds = %17
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
store i32 0, i32* %8
br label %21
21: ; preds = %34, %20
%22 = load double, double* %9
%23 = load double, double* %9
%24 = load double, double* %10
%25 = load double, double* %10
%26 = fmul double %24, %25
%27 = call double @llvm.fmuladd.f64(double %22, double %23, double %26)
%28 = fcmp olt double %27, 4.000000e+00
br i1 %28, label %29, label %32
29: ; preds = %21
%30 = load i32, i32* %8
%31 = icmp slt i32 %30, 100
br label %32
32: ; preds = %29, %21
%33 = phi i1 [ false, %21 ], [ %31, %29 ]
br i1 %33, label %34, label %59
34: ; preds = %32
%35 = load double, double* %9
%36 = load double, double* %9
%37 = load double, double* %10
%38 = load double, double* %10
%39 = fmul double %37, %38
%40 = fneg double %39
%41 = call double @llvm.fmuladd.f64(double %35, double %36, double %40)
%42 = load i32, i32* %7
%43 = sitofp i32 %42 to double
%44 = fdiv double %43, 3.900000e+01
%45 = fadd double %41, %44
%46 = fsub double %45, 1.500000e+00
store double %46, double* %11
%47 = load double, double* %9
%48 = fmul double 2.000000e+00, %47
%49 = load double, double* %10
%50 = load i32, i32* %6
%51 = sitofp i32 %50 to double
%52 = fdiv double %51, 1.100000e+01
%53 = call double @llvm.fmuladd.f64(double %48, double %49, double %52)
%54 = fsub double %53, 1.000000e+00
store double %54, double* %12
%55 = load double, double* %11
store double %55, double* %9
%56 = load double, double* %12
store double %56, double* %10
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
br label %21
59: ; preds = %32
%60 = load i32, i32* %8
%61 = icmp sgt i32 %60, 99
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %66
64: ; preds = %59
%65 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %66
66: ; preds = %64, %62
%67 = phi i32 [ %63, %62 ], [ %65, %64 ]
br label %68
68: ; preds = %66
%69 = load i32, i32* %7
%70 = add nsw i32 %69, 1
store i32 %70, i32* %7
br label %17
71: ; preds = %17
%72 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %73
73: ; preds = %71
%74 = load i32, i32* %6
%75 = add nsw i32 %74, 1
store i32 %75, i32* %6
br label %13
76: ; preds = %13
%77 = load i32, i32* %3
ret i32 %77
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %35
%4 = phi i32 [ 0, %2 ], [ %37, %35 ]
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 1.100000e+01
br label %7
7: ; preds = %3, %29
%8 = phi i32 [ 0, %3 ], [ %33, %29 ]
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 3.900000e+01
br label %11
11: ; preds = %7, %11
%12 = phi double [ 0.000000e+00, %7 ], [ %24, %11 ]
%13 = phi double [ 0.000000e+00, %7 ], [ %22, %11 ]
%14 = phi double [ 0.000000e+00, %7 ], [ %19, %11 ]
%15 = phi i32 [ 0, %7 ], [ %23, %11 ]
%16 = fneg double %12
%17 = tail call double @llvm.fmuladd.f64(double %14, double %14, double %16)
%18 = fadd double %10, %17
%19 = fadd double %18, -1.500000e+00
%20 = fmul double %14, 2.000000e+00
%21 = tail call double @llvm.fmuladd.f64(double %20, double %13, double %6)
%22 = fadd double %21, -1.000000e+00
%23 = add nuw nsw i32 %15, 1
%24 = fmul double %22, %22
%25 = tail call double @llvm.fmuladd.f64(double %19, double %19, double %24)
%26 = fcmp olt double %25, 4.000000e+00
%27 = icmp ult i32 %15, 99
%28 = select i1 %26, i1 %27, i1 false
br i1 %28, label %11, label %29
29: ; preds = %11
%30 = icmp ugt i32 %15, 98
%31 = select i1 %30, i32 35, i32 46
%32 = tail call i32 @putchar(i32 %31)
%33 = add nuw nsw i32 %8, 1
%34 = icmp eq i32 %33, 78
br i1 %34, label %35, label %7
35: ; preds = %29
%36 = tail call i32 @putchar(i32 10)
%37 = add nuw nsw i32 %4, 1
%38 = icmp eq i32 %37, 22
br i1 %38, label %39, label %3
39: ; preds = %35
ret i32 0
}