#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 add(int, int /*<<< orphan*/);
int div(int /*<<< orphan*/, int);
scalar_t__ inside(int, int);
int /*<<< orphan*/ mul(int, int);
int of_int(int);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ sub(int, int);
void run(int steps) {
  int xmin, xmax, deltax, ymin, ymax, deltay, i;
  xmin = of_int(-2);
  xmax = of_int(1);
  deltax = div(sub(xmax, xmin), of_int(2 * steps));
  ymin = of_int(-1);
  ymax = of_int(1);
  deltay = div(sub(ymax, ymin), of_int(steps));
  i;
  for (i = 0; i < steps; i++) {
    int y, j;
    y = add(ymin, mul(of_int(i), deltay));
    j;
    for (j = 0; j < 2 * steps; j++) {
      int x;
      x = add(xmin, mul(of_int(j), deltax));
      if (inside(x, y))
        putchar('0');
      else
        putchar('1');
    }
    putchar(10);
  }
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xfffffffe,%edi
call   1060 <of_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1060 <of_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1090 <sub@plt>
mov    %eax,-0x34(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
call   1060 <of_int@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%esi
call   1070 <div@plt>
mov    %eax,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1060 <of_int@plt>
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
call   1060 <of_int@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1090 <sub@plt>
mov    %eax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <of_int@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%esi
call   1070 <div@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12c6 <run+0x156>
mov    -0x14(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%edi
call   1060 <of_int@plt>
mov    %eax,%edi
mov    -0x1c(%rbp),%esi
call   1080 <mul@plt>
mov    -0x38(%rbp),%edi
mov    %eax,%esi
call   1040 <add@plt>
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    12ae <run+0x13e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%edi
call   1060 <of_int@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%esi
call   1080 <mul@plt>
mov    -0x3c(%rbp),%edi
mov    %eax,%esi
call   1040 <add@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1050 <inside@plt>
cmp    $0x0,%rax
je     1291 <run+0x121>
mov    $0x30,%edi
call   1030 <putchar@plt>
jmp    129b <run+0x12b>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    12a0 <run+0x130>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1237 <run+0xc7>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11ff <run+0x8f>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,%r15d
mov    $0xfffffffe,%edi
call   1060 <of_int@plt>
mov    %eax,%ebp
mov    $0x1,%r12d
mov    $0x1,%edi
call   1060 <of_int@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1090 <sub@plt>
mov    %eax,%ebx
lea    (%r15,%r15,1),%r13d
mov    %r13d,%edi
call   1060 <of_int@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1070 <div@plt>
mov    %eax,%ebx
mov    $0xffffffff,%edi
call   1060 <of_int@plt>
mov    %eax,%r14d
mov    $0x1,%edi
call   1060 <of_int@plt>
mov    %eax,%edi
mov    %r14d,0xc(%rsp)
mov    %r14d,%esi
call   1090 <sub@plt>
mov    %eax,%r14d
mov    %r15d,%edi
call   1060 <of_int@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   1070 <div@plt>
mov    %eax,0x8(%rsp)
mov    %r15,0x10(%rsp)
test   %r15d,%r15d
jle    12a7 <run+0x137>
cmp    $0x2,%r13d
cmovge %r13d,%r12d
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
mov    %r13d,%edi
call   1060 <of_int@plt>
mov    %eax,%edi
mov    0x8(%rsp),%esi
call   1080 <mul@plt>
mov    0xc(%rsp),%edi
mov    %eax,%esi
call   1040 <add@plt>
mov    %eax,%r14d
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15d,%edi
call   1060 <of_int@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1080 <mul@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <add@plt>
mov    %eax,%edi
mov    %r14d,%esi
call   1050 <inside@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
or     $0x30,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    %r15d,%r12d
jne    1250 <run+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13d
cmp    0x10(%rsp),%r13d
jne    1220 <run+0xb0>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @run(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %2
%13 = call i32 @of_int(i32 -2)
store i32 %13, i32* %3
%14 = call i32 @of_int(i32 1)
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = call i32 @sub(i32 %15, i32 %16)
%18 = load i32, i32* %2
%19 = mul nsw i32 2, %18
%20 = call i32 @of_int(i32 %19)
%21 = call i32 @div(i32 %17, i32 %20)
store i32 %21, i32* %5
%22 = call i32 @of_int(i32 -1)
store i32 %22, i32* %6
%23 = call i32 @of_int(i32 1)
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = call i32 @sub(i32 %24, i32 %25)
%27 = load i32, i32* %2
%28 = call i32 @of_int(i32 %27)
%29 = call i32 @div(i32 %26, i32 %28)
store i32 %29, i32* %8
%30 = load i32, i32* %9
store i32 0, i32* %9
br label %31
31: ; preds = %69, %1
%32 = load i32, i32* %9
%33 = load i32, i32* %2
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %72
35: ; preds = %31
%36 = load i32, i32* %6
%37 = load i32, i32* %9
%38 = call i32 @of_int(i32 %37)
%39 = load i32, i32* %8
%40 = call i32 @mul(i32 %38, i32 %39)
%41 = call i32 @add(i32 %36, i32 %40)
store i32 %41, i32* %10
%42 = load i32, i32* %11
store i32 0, i32* %11
br label %43
43: ; preds = %64, %35
%44 = load i32, i32* %11
%45 = load i32, i32* %2
%46 = mul nsw i32 2, %45
%47 = icmp slt i32 %44, %46
br i1 %47, label %48, label %67
48: ; preds = %43
%49 = load i32, i32* %3
%50 = load i32, i32* %11
%51 = call i32 @of_int(i32 %50)
%52 = load i32, i32* %5
%53 = call i32 @mul(i32 %51, i32 %52)
%54 = call i32 @add(i32 %49, i32 %53)
store i32 %54, i32* %12
%55 = load i32, i32* %12
%56 = load i32, i32* %10
%57 = call i64 @inside(i32 %55, i32 %56)
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %48
%60 = call i32 @putchar(i32 48)
br label %63
61: ; preds = %48
%62 = call i32 @putchar(i32 49)
br label %63
63: ; preds = %61, %59
br label %64
64: ; preds = %63
%65 = load i32, i32* %11
%66 = add nsw i32 %65, 1
store i32 %66, i32* %11
br label %43
67: ; preds = %43
%68 = call i32 @putchar(i32 10)
br label %69
69: ; preds = %67
%70 = load i32, i32* %9
%71 = add nsw i32 %70, 1
store i32 %71, i32* %9
br label %31
72: ; preds = %31
ret void
}

LLVM IR (-O2):
define void @run(i32 %0) {
%2 = tail call i32 @of_int(i32 -2)
%3 = tail call i32 @of_int(i32 1)
%4 = tail call i32 @sub(i32 %3, i32 %2)
%5 = shl nsw i32 %0, 1
%6 = tail call i32 @of_int(i32 %5)
%7 = tail call i32 @div(i32 %4, i32 %6)
%8 = tail call i32 @of_int(i32 -1)
%9 = tail call i32 @of_int(i32 1)
%10 = tail call i32 @sub(i32 %9, i32 %8)
%11 = tail call i32 @of_int(i32 %0)
%12 = tail call i32 @div(i32 %10, i32 %11)
%13 = icmp sgt i32 %0, 0
br i1 %13, label %14, label %36
14: ; preds = %1
%15 = call i32 @llvm.smax.i32(i32 %5, i32 1)
br label %16
16: ; preds = %32, %14
%17 = phi i32 [ 0, %14 ], [ %34, %32 ]
%18 = tail call i32 @of_int(i32 %17)
%19 = tail call i32 @mul(i32 %18, i32 %12)
%20 = tail call i32 @add(i32 %8, i32 %19)
br label %21
21: ; preds = %16, %21
%22 = phi i32 [ %30, %21 ], [ 0, %16 ]
%23 = tail call i32 @of_int(i32 %22)
%24 = tail call i32 @mul(i32 %23, i32 %7)
%25 = tail call i32 @add(i32 %2, i32 %24)
%26 = tail call i64 @inside(i32 %25, i32 %20)
%27 = icmp eq i64 %26, 0
%28 = select i1 %27, i32 49, i32 48
%29 = tail call i32 @putchar(i32 %28)
%30 = add nuw nsw i32 %22, 1
%31 = icmp eq i32 %30, %15
br i1 %31, label %32, label %21
32: ; preds = %21
%33 = tail call i32 @putchar(i32 10)
%34 = add nuw nsw i32 %17, 1
%35 = icmp eq i32 %34, %0
br i1 %35, label %36, label %16
36: ; preds = %32, %1
ret void
}