#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*/ adc(int, int);
int /*<<< orphan*/ asl(int, int);
scalar_t__ beq();
int /*<<< orphan*/ bit(int, int);
scalar_t__ bne();
int /*<<< orphan*/ clc();
int /*<<< orphan*/ dex();
int /*<<< orphan*/ div7();
int /*<<< orphan*/ eor(int /*<<< orphan*/, int);
int /*<<< orphan*/ lda(int, int);
int /*<<< orphan*/ ldx(int, int);
int /*<<< orphan*/ ora(int, int);
int /*<<< orphan*/ pha();
int /*<<< orphan*/ pla();
int /*<<< orphan*/ sta(int, int);
void jsr_hplot() {
  lda(1, 0xf2);
  sta(1, 0xf9);
  lda(1, 0xf1);
  sta(1, 0xf8);
  div7();
  lda(0, 1);
  ldx(1, 0xfe);
make_mask:
  if (beq())
    goto done_mask;
  asl(3, 1);
  dex();
  goto make_mask;
done_mask:
  sta(1, 0xf0);
  lda(1, 0xf7);
  sta(1, 0xec);
  lda(1, 0xf6);
  sta(1, 0xeb);
  clc();
  adc(1, 0xff);
  sta(1, 0xeb);
  lda(1, 0xec);
  adc(0, 0);
  sta(1, 0xec);
  lda(2, 0xeb);
  sta(1, 0xef);
  lda(0, 1);
  bit(1, 0xf1);
  if (beq())
    goto even;
  lda(0, 2);
  bit(1, 0xf3);
  if (bne())
    goto set_bit;
  goto clear_bit;
even:
  lda(0, 1);
  bit(1, 0xf3);
  if (beq())
    goto clear_bit;
set_bit:
  lda(1, 0xf0);
  ora(1, 0xef);
  goto done_pset;
clear_bit:
  lda(1, 0xf0);
  eor(0, 0xff);
  and(1, 0xef);
done_pset:
  ora(0, 0x80);
  sta(1, 0xef);
  ldx(0, 8);
make_blocky:
  sta(2, 0xeb);
  pha();
  clc();
  lda(1, 0xec);
  adc(0, 0x04);
  sta(1, 0xec);
  pla();
  dex();
  if (bne())
    goto make_blocky;
}


x86 assembly (clang, -O0):
<jsr_hplot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0xf2,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xf9,%esi
call   1040 <sta@plt>
mov    $0x1,%edi
mov    $0xf1,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xf8,%esi
call   1040 <sta@plt>
mov    $0x0,%al
call   10a0 <div7@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xfe,%esi
call   10b0 <ldx@plt>
mov    $0x0,%al
call   1050 <beq@plt>
cmp    $0x0,%rax
je     1278 <jsr_hplot+0x78>
jmp    1293 <jsr_hplot+0x93>
mov    $0x3,%edi
mov    $0x1,%esi
call   10f0 <asl@plt>
mov    $0x0,%al
call   1100 <dex@plt>
jmp    1262 <jsr_hplot+0x62>
mov    $0x1,%edi
mov    $0xf0,%esi
call   1040 <sta@plt>
mov    $0x1,%edi
mov    $0xf7,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xec,%esi
call   1040 <sta@plt>
mov    $0x1,%edi
mov    $0xf6,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xeb,%esi
call   1040 <sta@plt>
mov    $0x0,%al
call   10e0 <clc@plt>
mov    $0x1,%edi
mov    $0xff,%esi
call   10d0 <adc@plt>
mov    $0x1,%edi
mov    $0xeb,%esi
call   1040 <sta@plt>
mov    $0x1,%edi
mov    $0xec,%esi
call   1120 <lda@plt>
xor    %esi,%esi
mov    %esi,%edi
call   10d0 <adc@plt>
mov    $0x1,%edi
mov    $0xec,%esi
call   1040 <sta@plt>
mov    $0x2,%edi
mov    $0xeb,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xef,%esi
call   1040 <sta@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xf1,%esi
call   1060 <bit@plt>
mov    $0x0,%al
call   1050 <beq@plt>
cmp    $0x0,%rax
je     1379 <jsr_hplot+0x179>
jmp    13af <jsr_hplot+0x1af>
xor    %edi,%edi
mov    $0x2,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xf3,%esi
call   1060 <bit@plt>
mov    $0x0,%al
call   1080 <bne@plt>
cmp    $0x0,%rax
je     13aa <jsr_hplot+0x1aa>
jmp    13e5 <jsr_hplot+0x1e5>
jmp    1408 <jsr_hplot+0x208>
xor    %edi,%edi
mov    $0x1,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xf3,%esi
call   1060 <bit@plt>
mov    $0x0,%al
call   1050 <beq@plt>
cmp    $0x0,%rax
je     13e0 <jsr_hplot+0x1e0>
jmp    1408 <jsr_hplot+0x208>
jmp    13e5 <jsr_hplot+0x1e5>
mov    $0x1,%edi
mov    $0xf0,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xef,%esi
call   1070 <ora@plt>
jmp    1434 <jsr_hplot+0x234>
mov    $0x1,%edi
mov    $0xf0,%esi
call   1120 <lda@plt>
xor    %edi,%edi
mov    $0xff,%esi
call   1110 <eor@plt>
mov    $0x1,%edi
mov    $0xef,%esi
mov    $0x0,%al
call   1090 <and@plt>
xor    %edi,%edi
mov    $0x80,%esi
call   1070 <ora@plt>
mov    $0x1,%edi
mov    $0xef,%esi
call   1040 <sta@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   10b0 <ldx@plt>
mov    $0x2,%edi
mov    $0xeb,%esi
call   1040 <sta@plt>
mov    $0x0,%al
call   10c0 <pha@plt>
mov    $0x0,%al
call   10e0 <clc@plt>
mov    $0x1,%edi
mov    $0xec,%esi
call   1120 <lda@plt>
xor    %edi,%edi
mov    $0x4,%esi
call   10d0 <adc@plt>
mov    $0x1,%edi
mov    $0xec,%esi
call   1040 <sta@plt>
mov    $0x0,%al
call   1030 <pla@plt>
mov    $0x0,%al
call   1100 <dex@plt>
mov    $0x0,%al
call   1080 <bne@plt>
cmp    $0x0,%rax
je     14c6 <jsr_hplot+0x2c6>
jmp    145b <jsr_hplot+0x25b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsr_hplot>:
push   %rax
mov    $0x1,%edi
mov    $0xf2,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xf9,%esi
call   1040 <sta@plt>
mov    $0x1,%edi
mov    $0xf1,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xf8,%esi
call   1040 <sta@plt>
xor    %eax,%eax
call   10a0 <div7@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xfe,%esi
call   10b0 <ldx@plt>
nop
xor    %eax,%eax
call   1050 <beq@plt>
test   %rax,%rax
jne    1284 <jsr_hplot+0x84>
mov    $0x3,%edi
mov    $0x1,%esi
call   10f0 <asl@plt>
xor    %eax,%eax
call   1100 <dex@plt>
jmp    1260 <jsr_hplot+0x60>
mov    $0x1,%edi
mov    $0xf0,%esi
call   1040 <sta@plt>
mov    $0x1,%edi
mov    $0xf7,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xec,%esi
call   1040 <sta@plt>
mov    $0x1,%edi
mov    $0xf6,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xeb,%esi
call   1040 <sta@plt>
xor    %eax,%eax
call   10e0 <clc@plt>
mov    $0x1,%edi
mov    $0xff,%esi
call   10d0 <adc@plt>
mov    $0x1,%edi
mov    $0xeb,%esi
call   1040 <sta@plt>
mov    $0x1,%edi
mov    $0xec,%esi
call   1120 <lda@plt>
xor    %edi,%edi
xor    %esi,%esi
call   10d0 <adc@plt>
mov    $0x1,%edi
mov    $0xec,%esi
call   1040 <sta@plt>
mov    $0x2,%edi
mov    $0xeb,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xef,%esi
call   1040 <sta@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xf1,%esi
call   1060 <bit@plt>
xor    %eax,%eax
call   1050 <beq@plt>
xor    %edi,%edi
test   %rax,%rax
je     13b5 <jsr_hplot+0x1b5>
mov    $0x1,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xf3,%esi
call   1060 <bit@plt>
xor    %eax,%eax
call   1050 <beq@plt>
test   %rax,%rax
je     13da <jsr_hplot+0x1da>
mov    $0x1,%edi
mov    $0xf0,%esi
call   1120 <lda@plt>
xor    %edi,%edi
mov    $0xff,%esi
call   1110 <eor@plt>
mov    $0x1,%edi
mov    $0xef,%esi
xor    %eax,%eax
call   1090 <and@plt>
jmp    13f8 <jsr_hplot+0x1f8>
mov    $0x2,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xf3,%esi
call   1060 <bit@plt>
xor    %eax,%eax
call   1080 <bne@plt>
test   %rax,%rax
je     1387 <jsr_hplot+0x187>
mov    $0x1,%edi
mov    $0xf0,%esi
call   1120 <lda@plt>
mov    $0x1,%edi
mov    $0xef,%esi
call   1070 <ora@plt>
xor    %edi,%edi
mov    $0x80,%esi
call   1070 <ora@plt>
mov    $0x1,%edi
mov    $0xef,%esi
call   1040 <sta@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   10b0 <ldx@plt>
nop
mov    $0x2,%edi
mov    $0xeb,%esi
call   1040 <sta@plt>
xor    %eax,%eax
call   10c0 <pha@plt>
xor    %eax,%eax
call   10e0 <clc@plt>
mov    $0x1,%edi
mov    $0xec,%esi
call   1120 <lda@plt>
xor    %edi,%edi
mov    $0x4,%esi
call   10d0 <adc@plt>
mov    $0x1,%edi
mov    $0xec,%esi
call   1040 <sta@plt>
xor    %eax,%eax
call   1030 <pla@plt>
xor    %eax,%eax
call   1100 <dex@plt>
xor    %eax,%eax
call   1080 <bne@plt>
test   %rax,%rax
jne    1420 <jsr_hplot+0x220>
pop    %rax
ret

LLVM IR (-O0):
define void @jsr_hplot() {
%1 = call i32 @lda(i32 1, i32 242)
%2 = call i32 @sta(i32 1, i32 249)
%3 = call i32 @lda(i32 1, i32 241)
%4 = call i32 @sta(i32 1, i32 248)
%5 = call i32 (...) @div7()
%6 = call i32 @lda(i32 0, i32 1)
%7 = call i32 @ldx(i32 1, i32 254)
br label %8
8: ; preds = %12, %0
%9 = call i64 (...) @beq()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
br label %15
12: ; preds = %8
%13 = call i32 @asl(i32 3, i32 1)
%14 = call i32 (...) @dex()
br label %8
15: ; preds = %11
%16 = call i32 @sta(i32 1, i32 240)
%17 = call i32 @lda(i32 1, i32 247)
%18 = call i32 @sta(i32 1, i32 236)
%19 = call i32 @lda(i32 1, i32 246)
%20 = call i32 @sta(i32 1, i32 235)
%21 = call i32 (...) @clc()
%22 = call i32 @adc(i32 1, i32 255)
%23 = call i32 @sta(i32 1, i32 235)
%24 = call i32 @lda(i32 1, i32 236)
%25 = call i32 @adc(i32 0, i32 0)
%26 = call i32 @sta(i32 1, i32 236)
%27 = call i32 @lda(i32 2, i32 235)
%28 = call i32 @sta(i32 1, i32 239)
%29 = call i32 @lda(i32 0, i32 1)
%30 = call i32 @bit(i32 1, i32 241)
%31 = call i64 (...) @beq()
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %15
br label %41
34: ; preds = %15
%35 = call i32 @lda(i32 0, i32 2)
%36 = call i32 @bit(i32 1, i32 243)
%37 = call i64 (...) @bne()
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %34
br label %48
40: ; preds = %34
br label %51
41: ; preds = %33
%42 = call i32 @lda(i32 0, i32 1)
%43 = call i32 @bit(i32 1, i32 243)
%44 = call i64 (...) @beq()
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %41
br label %51
47: ; preds = %41
br label %48
48: ; preds = %47, %39
%49 = call i32 @lda(i32 1, i32 240)
%50 = call i32 @ora(i32 1, i32 239)
br label %55
51: ; preds = %46, %40
%52 = call i32 @lda(i32 1, i32 240)
%53 = call i32 @eor(i32 0, i32 255)
%54 = call i32 (i32, i32, ...) bitcast (i32 (...)* @and to i32 (i32, i32, ...)*)(i32 1, i32 239)
br label %55
55: ; preds = %51, %48
%56 = call i32 @ora(i32 0, i32 128)
%57 = call i32 @sta(i32 1, i32 239)
%58 = call i32 @ldx(i32 0, i32 8)
br label %59
59: ; preds = %70, %55
%60 = call i32 @sta(i32 2, i32 235)
%61 = call i32 (...) @pha()
%62 = call i32 (...) @clc()
%63 = call i32 @lda(i32 1, i32 236)
%64 = call i32 @adc(i32 0, i32 4)
%65 = call i32 @sta(i32 1, i32 236)
%66 = call i32 (...) @pla()
%67 = call i32 (...) @dex()
%68 = call i64 (...) @bne()
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %59
br label %59
71: ; preds = %59
ret void
}

LLVM IR (-O2):
define void @jsr_hplot() {
%1 = tail call i32 @lda(i32 1, i32 242)
%2 = tail call i32 @sta(i32 1, i32 249)
%3 = tail call i32 @lda(i32 1, i32 241)
%4 = tail call i32 @sta(i32 1, i32 248)
%5 = tail call i32 (...) @div7()
%6 = tail call i32 @lda(i32 0, i32 1)
%7 = tail call i32 @ldx(i32 1, i32 254)
%8 = tail call i64 (...) @beq()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %0, %10
%11 = tail call i32 @asl(i32 3, i32 1)
%12 = tail call i32 (...) @dex()
%13 = tail call i64 (...) @beq()
%14 = icmp eq i64 %13, 0
br i1 %14, label %10, label %15
15: ; preds = %10, %0
%16 = tail call i32 @sta(i32 1, i32 240)
%17 = tail call i32 @lda(i32 1, i32 247)
%18 = tail call i32 @sta(i32 1, i32 236)
%19 = tail call i32 @lda(i32 1, i32 246)
%20 = tail call i32 @sta(i32 1, i32 235)
%21 = tail call i32 (...) @clc()
%22 = tail call i32 @adc(i32 1, i32 255)
%23 = tail call i32 @sta(i32 1, i32 235)
%24 = tail call i32 @lda(i32 1, i32 236)
%25 = tail call i32 @adc(i32 0, i32 0)
%26 = tail call i32 @sta(i32 1, i32 236)
%27 = tail call i32 @lda(i32 2, i32 235)
%28 = tail call i32 @sta(i32 1, i32 239)
%29 = tail call i32 @lda(i32 0, i32 1)
%30 = tail call i32 @bit(i32 1, i32 241)
%31 = tail call i64 (...) @beq()
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %38
33: ; preds = %15
%34 = tail call i32 @lda(i32 0, i32 2)
%35 = tail call i32 @bit(i32 1, i32 243)
%36 = tail call i64 (...) @bne()
%37 = icmp eq i64 %36, 0
br i1 %37, label %46, label %43
38: ; preds = %15
%39 = tail call i32 @lda(i32 0, i32 1)
%40 = tail call i32 @bit(i32 1, i32 243)
%41 = tail call i64 (...) @beq()
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %38, %33
%44 = tail call i32 @lda(i32 1, i32 240)
%45 = tail call i32 @ora(i32 1, i32 239)
br label %50
46: ; preds = %38, %33
%47 = tail call i32 @lda(i32 1, i32 240)
%48 = tail call i32 @eor(i32 0, i32 255)
%49 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @and to i32 (i32, i32, ...)*)(i32 1, i32 239)
br label %50
50: ; preds = %46, %43
%51 = tail call i32 @ora(i32 0, i32 128)
%52 = tail call i32 @sta(i32 1, i32 239)
%53 = tail call i32 @ldx(i32 0, i32 8)
br label %54
54: ; preds = %54, %50
%55 = tail call i32 @sta(i32 2, i32 235)
%56 = tail call i32 (...) @pha()
%57 = tail call i32 (...) @clc()
%58 = tail call i32 @lda(i32 1, i32 236)
%59 = tail call i32 @adc(i32 0, i32 4)
%60 = tail call i32 @sta(i32 1, i32 236)
%61 = tail call i32 (...) @pla()
%62 = tail call i32 (...) @dex()
%63 = tail call i64 (...) @bne()
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %54
65: ; preds = %54
ret void
}