#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*/ color(int);
int /*<<< orphan*/ draw2(double, double);
int /*<<< orphan*/ hcentertext(int);
int /*<<< orphan*/ hdrawchar(char);
int /*<<< orphan*/ hleftjustify(int);
int /*<<< orphan*/ hrightjustify(int);
int /*<<< orphan*/ move2(double, double);
int /*<<< orphan*/ qread(short *);
int /*<<< orphan*/ rectf(double, double, double, double);
drawstuff2() {
  short val;
  color(0);
  rectf(0.1, 0.1, 0.9, 0.9);
  color(7);
  move2(0.1, 0.5);
  draw2(0.9, 0.5);
  move2(0.5, 0.1);
  draw2(0.5, 0.9);
  color(2);
  move2(0.5, 0.5);
  hleftjustify(1);
  hdrawchar('B');
  qread(&val);
  color(0);
  rectf(0.1, 0.1, 0.9, 0.9);
  color(7);
  move2(0.1, 0.5);
  draw2(0.9, 0.5);
  move2(0.5, 0.1);
  draw2(0.5, 0.9);
  color(3);
  move2(0.5, 0.5);
  hcentertext(1);
  hdrawchar('B');
  hcentertext(0);
  qread(&val);
  color(0);
  rectf(0.1, 0.1, 0.9, 0.9);
  color(7);
  move2(0.1, 0.5);
  draw2(0.9, 0.5);
  move2(0.5, 0.1);
  draw2(0.5, 0.9);
  color(5);
  move2(0.5, 0.5);
  hrightjustify(1);
  hdrawchar('B');
  hrightjustify(0);
  qread(&val);
}


x86 assembly (clang, -O0):
<drawstuff2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1060 <color@plt>
movsd  0xe69(%rip),%xmm1
movsd  0xe59(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   10a0 <rectf@plt>
mov    $0x7,%edi
call   1060 <color@plt>
movsd  0xe44(%rip),%xmm0
movsd  0xe2c(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xe27(%rip),%xmm0
movsd  0xe17(%rip),%xmm1
call   1050 <draw2@plt>
movsd  0xe0a(%rip),%xmm0
movsd  0xe12(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xdf5(%rip),%xmm0
movsd  0xdf5(%rip),%xmm1
call   1050 <draw2@plt>
mov    $0x2,%edi
call   1060 <color@plt>
movsd  0xdd6(%rip),%xmm1
movaps %xmm1,%xmm0
call   1080 <move2@plt>
mov    $0x1,%edi
call   1070 <hleftjustify@plt>
mov    $0x42,%edi
call   1030 <hdrawchar@plt>
lea    -0x6(%rbp),%rdi
call   10b0 <qread@plt>
xor    %edi,%edi
call   1060 <color@plt>
movsd  0xdb2(%rip),%xmm1
movsd  0xda2(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   10a0 <rectf@plt>
mov    $0x7,%edi
call   1060 <color@plt>
movsd  0xd8d(%rip),%xmm0
movsd  0xd75(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xd70(%rip),%xmm0
movsd  0xd60(%rip),%xmm1
call   1050 <draw2@plt>
movsd  0xd53(%rip),%xmm0
movsd  0xd5b(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xd3e(%rip),%xmm0
movsd  0xd3e(%rip),%xmm1
call   1050 <draw2@plt>
mov    $0x3,%edi
call   1060 <color@plt>
movsd  0xd1f(%rip),%xmm1
movaps %xmm1,%xmm0
call   1080 <move2@plt>
mov    $0x1,%edi
call   1040 <hcentertext@plt>
mov    $0x42,%edi
call   1030 <hdrawchar@plt>
xor    %edi,%edi
call   1040 <hcentertext@plt>
lea    -0x6(%rbp),%rdi
call   10b0 <qread@plt>
xor    %edi,%edi
call   1060 <color@plt>
movsd  0xcf4(%rip),%xmm1
movsd  0xce4(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   10a0 <rectf@plt>
mov    $0x7,%edi
call   1060 <color@plt>
movsd  0xccf(%rip),%xmm0
movsd  0xcb7(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xcb2(%rip),%xmm0
movsd  0xca2(%rip),%xmm1
call   1050 <draw2@plt>
movsd  0xc95(%rip),%xmm0
movsd  0xc9d(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xc80(%rip),%xmm0
movsd  0xc80(%rip),%xmm1
call   1050 <draw2@plt>
mov    $0x5,%edi
call   1060 <color@plt>
movsd  0xc61(%rip),%xmm1
movaps %xmm1,%xmm0
call   1080 <move2@plt>
mov    $0x1,%edi
call   1090 <hrightjustify@plt>
mov    $0x42,%edi
call   1030 <hdrawchar@plt>
xor    %edi,%edi
call   1090 <hrightjustify@plt>
lea    -0x6(%rbp),%rdi
call   10b0 <qread@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawstuff2>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1060 <color@plt>
movsd  0xe5c(%rip),%xmm0
movsd  0xe5c(%rip),%xmm2
movaps %xmm0,%xmm1
movaps %xmm2,%xmm3
call   10a0 <rectf@plt>
mov    $0x7,%edi
call   1060 <color@plt>
movsd  0xe47(%rip),%xmm1
movsd  0xe2f(%rip),%xmm0
call   1080 <move2@plt>
movsd  0xe2a(%rip),%xmm0
movsd  0xe2a(%rip),%xmm1
call   1050 <draw2@plt>
movsd  0xe1d(%rip),%xmm0
movsd  0xe05(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xe08(%rip),%xmm0
movsd  0xdf8(%rip),%xmm1
call   1050 <draw2@plt>
mov    $0x2,%edi
call   1060 <color@plt>
movsd  0xde9(%rip),%xmm0
movaps %xmm0,%xmm1
call   1080 <move2@plt>
mov    $0x1,%edi
call   1070 <hleftjustify@plt>
mov    $0x42,%edi
call   1030 <hdrawchar@plt>
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
call   10b0 <qread@plt>
xor    %edi,%edi
call   1060 <color@plt>
movsd  0xda1(%rip),%xmm0
movaps %xmm0,%xmm1
movsd  0xd9e(%rip),%xmm2
movaps %xmm2,%xmm3
call   10a0 <rectf@plt>
mov    $0x7,%edi
call   1060 <color@plt>
movsd  0xd7c(%rip),%xmm0
movsd  0xd84(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xd6f(%rip),%xmm0
movsd  0xd6f(%rip),%xmm1
call   1050 <draw2@plt>
movsd  0xd62(%rip),%xmm0
movsd  0xd4a(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xd4d(%rip),%xmm0
movsd  0xd3d(%rip),%xmm1
call   1050 <draw2@plt>
mov    $0x3,%edi
call   1060 <color@plt>
movsd  0xd2e(%rip),%xmm0
movaps %xmm0,%xmm1
call   1080 <move2@plt>
mov    $0x1,%edi
call   1040 <hcentertext@plt>
mov    $0x42,%edi
call   1030 <hdrawchar@plt>
xor    %edi,%edi
call   1040 <hcentertext@plt>
mov    %rbx,%rdi
call   10b0 <qread@plt>
xor    %edi,%edi
call   1060 <color@plt>
movsd  0xce4(%rip),%xmm0
movaps %xmm0,%xmm1
movsd  0xce1(%rip),%xmm2
movaps %xmm2,%xmm3
call   10a0 <rectf@plt>
mov    $0x7,%edi
call   1060 <color@plt>
movsd  0xcbf(%rip),%xmm0
movsd  0xcc7(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xcb2(%rip),%xmm0
movsd  0xcb2(%rip),%xmm1
call   1050 <draw2@plt>
movsd  0xca5(%rip),%xmm0
movsd  0xc8d(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xc90(%rip),%xmm0
movsd  0xc80(%rip),%xmm1
call   1050 <draw2@plt>
mov    $0x5,%edi
call   1060 <color@plt>
movsd  0xc71(%rip),%xmm0
movaps %xmm0,%xmm1
call   1080 <move2@plt>
mov    $0x1,%edi
call   1090 <hrightjustify@plt>
mov    $0x42,%edi
call   1030 <hdrawchar@plt>
xor    %edi,%edi
call   1090 <hrightjustify@plt>
mov    %rbx,%rdi
call   10b0 <qread@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @drawstuff2() {
%1 = alloca i32
%2 = alloca i16
%3 = call i32 @color(i32 0)
%4 = call i32 @rectf(double 1.000000e-01, double 1.000000e-01, double 9.000000e-01, double 9.000000e-01)
%5 = call i32 @color(i32 7)
%6 = call i32 @move2(double 1.000000e-01, double 5.000000e-01)
%7 = call i32 @draw2(double 9.000000e-01, double 5.000000e-01)
%8 = call i32 @move2(double 5.000000e-01, double 1.000000e-01)
%9 = call i32 @draw2(double 5.000000e-01, double 9.000000e-01)
%10 = call i32 @color(i32 2)
%11 = call i32 @move2(double 5.000000e-01, double 5.000000e-01)
%12 = call i32 @hleftjustify(i32 1)
%13 = call i32 @hdrawchar(i8 signext 66)
%14 = call i32 @qread(i16* %2)
%15 = call i32 @color(i32 0)
%16 = call i32 @rectf(double 1.000000e-01, double 1.000000e-01, double 9.000000e-01, double 9.000000e-01)
%17 = call i32 @color(i32 7)
%18 = call i32 @move2(double 1.000000e-01, double 5.000000e-01)
%19 = call i32 @draw2(double 9.000000e-01, double 5.000000e-01)
%20 = call i32 @move2(double 5.000000e-01, double 1.000000e-01)
%21 = call i32 @draw2(double 5.000000e-01, double 9.000000e-01)
%22 = call i32 @color(i32 3)
%23 = call i32 @move2(double 5.000000e-01, double 5.000000e-01)
%24 = call i32 @hcentertext(i32 1)
%25 = call i32 @hdrawchar(i8 signext 66)
%26 = call i32 @hcentertext(i32 0)
%27 = call i32 @qread(i16* %2)
%28 = call i32 @color(i32 0)
%29 = call i32 @rectf(double 1.000000e-01, double 1.000000e-01, double 9.000000e-01, double 9.000000e-01)
%30 = call i32 @color(i32 7)
%31 = call i32 @move2(double 1.000000e-01, double 5.000000e-01)
%32 = call i32 @draw2(double 9.000000e-01, double 5.000000e-01)
%33 = call i32 @move2(double 5.000000e-01, double 1.000000e-01)
%34 = call i32 @draw2(double 5.000000e-01, double 9.000000e-01)
%35 = call i32 @color(i32 5)
%36 = call i32 @move2(double 5.000000e-01, double 5.000000e-01)
%37 = call i32 @hrightjustify(i32 1)
%38 = call i32 @hdrawchar(i8 signext 66)
%39 = call i32 @hrightjustify(i32 0)
%40 = call i32 @qread(i16* %2)
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
define i32 @drawstuff2() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = tail call i32 @color(i32 0)
%4 = tail call i32 @rectf(double 1.000000e-01, double 1.000000e-01, double 9.000000e-01, double 9.000000e-01)
%5 = tail call i32 @color(i32 7)
%6 = tail call i32 @move2(double 1.000000e-01, double 5.000000e-01)
%7 = tail call i32 @draw2(double 9.000000e-01, double 5.000000e-01)
%8 = tail call i32 @move2(double 5.000000e-01, double 1.000000e-01)
%9 = tail call i32 @draw2(double 5.000000e-01, double 9.000000e-01)
%10 = tail call i32 @color(i32 2)
%11 = tail call i32 @move2(double 5.000000e-01, double 5.000000e-01)
%12 = tail call i32 @hleftjustify(i32 1)
%13 = tail call i32 @hdrawchar(i8 signext 66)
%14 = call i32 @qread(i16* %1)
%15 = call i32 @color(i32 0)
%16 = call i32 @rectf(double 1.000000e-01, double 1.000000e-01, double 9.000000e-01, double 9.000000e-01)
%17 = call i32 @color(i32 7)
%18 = call i32 @move2(double 1.000000e-01, double 5.000000e-01)
%19 = call i32 @draw2(double 9.000000e-01, double 5.000000e-01)
%20 = call i32 @move2(double 5.000000e-01, double 1.000000e-01)
%21 = call i32 @draw2(double 5.000000e-01, double 9.000000e-01)
%22 = call i32 @color(i32 3)
%23 = call i32 @move2(double 5.000000e-01, double 5.000000e-01)
%24 = call i32 @hcentertext(i32 1)
%25 = call i32 @hdrawchar(i8 signext 66)
%26 = call i32 @hcentertext(i32 0)
%27 = call i32 @qread(i16* %1)
%28 = call i32 @color(i32 0)
%29 = call i32 @rectf(double 1.000000e-01, double 1.000000e-01, double 9.000000e-01, double 9.000000e-01)
%30 = call i32 @color(i32 7)
%31 = call i32 @move2(double 1.000000e-01, double 5.000000e-01)
%32 = call i32 @draw2(double 9.000000e-01, double 5.000000e-01)
%33 = call i32 @move2(double 5.000000e-01, double 1.000000e-01)
%34 = call i32 @draw2(double 5.000000e-01, double 9.000000e-01)
%35 = call i32 @color(i32 5)
%36 = call i32 @move2(double 5.000000e-01, double 5.000000e-01)
%37 = call i32 @hrightjustify(i32 1)
%38 = call i32 @hdrawchar(i8 signext 66)
%39 = call i32 @hrightjustify(i32 0)
%40 = call i32 @qread(i16* %1)
ret i32 undef
}