#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*/ hcharstr(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);
drawstuff() {
  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);
  hcharstr("This is Left Justified text");
  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);
  hcharstr("This is Centered text");
  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);
  hcharstr("This is Right Justified text");
  hrightjustify(0);
  qread(&val);
}


x86 assembly (clang, -O0):
<drawstuff>:
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>
lea    0xdd5(%rip),%rdi
call   1030 <hcharstr@plt>
lea    -0x6(%rbp),%rdi
call   10b0 <qread@plt>
xor    %edi,%edi
call   1060 <color@plt>
movsd  0xdb0(%rip),%xmm1
movsd  0xda0(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   10a0 <rectf@plt>
mov    $0x7,%edi
call   1060 <color@plt>
movsd  0xd8b(%rip),%xmm0
movsd  0xd73(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xd6e(%rip),%xmm0
movsd  0xd5e(%rip),%xmm1
call   1050 <draw2@plt>
movsd  0xd51(%rip),%xmm0
movsd  0xd59(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xd3c(%rip),%xmm0
movsd  0xd3c(%rip),%xmm1
call   1050 <draw2@plt>
mov    $0x3,%edi
call   1060 <color@plt>
movsd  0xd1d(%rip),%xmm1
movaps %xmm1,%xmm0
call   1080 <move2@plt>
mov    $0x1,%edi
call   1040 <hcentertext@plt>
lea    0xd38(%rip),%rdi
call   1030 <hcharstr@plt>
xor    %edi,%edi
call   1040 <hcentertext@plt>
lea    -0x6(%rbp),%rdi
call   10b0 <qread@plt>
xor    %edi,%edi
call   1060 <color@plt>
movsd  0xcf0(%rip),%xmm1
movsd  0xce0(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   10a0 <rectf@plt>
mov    $0x7,%edi
call   1060 <color@plt>
movsd  0xccb(%rip),%xmm0
movsd  0xcb3(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xcae(%rip),%xmm0
movsd  0xc9e(%rip),%xmm1
call   1050 <draw2@plt>
movsd  0xc91(%rip),%xmm0
movsd  0xc99(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xc7c(%rip),%xmm0
movsd  0xc7c(%rip),%xmm1
call   1050 <draw2@plt>
mov    $0x5,%edi
call   1060 <color@plt>
movsd  0xc5d(%rip),%xmm1
movaps %xmm1,%xmm0
call   1080 <move2@plt>
mov    $0x1,%edi
call   1090 <hrightjustify@plt>
lea    0xc8e(%rip),%rdi
call   1030 <hcharstr@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):
<drawstuff>:
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>
lea    0xdd8(%rip),%rdi
call   1030 <hcharstr@plt>
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
call   10b0 <qread@plt>
xor    %edi,%edi
call   1060 <color@plt>
movsd  0xd9f(%rip),%xmm0
movaps %xmm0,%xmm1
movsd  0xd9c(%rip),%xmm2
movaps %xmm2,%xmm3
call   10a0 <rectf@plt>
mov    $0x7,%edi
call   1060 <color@plt>
movsd  0xd7a(%rip),%xmm0
movsd  0xd82(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xd6d(%rip),%xmm0
movsd  0xd6d(%rip),%xmm1
call   1050 <draw2@plt>
movsd  0xd60(%rip),%xmm0
movsd  0xd48(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xd4b(%rip),%xmm0
movsd  0xd3b(%rip),%xmm1
call   1050 <draw2@plt>
mov    $0x3,%edi
call   1060 <color@plt>
movsd  0xd2c(%rip),%xmm0
movaps %xmm0,%xmm1
call   1080 <move2@plt>
mov    $0x1,%edi
call   1040 <hcentertext@plt>
lea    0xd37(%rip),%rdi
call   1030 <hcharstr@plt>
xor    %edi,%edi
call   1040 <hcentertext@plt>
mov    %rbx,%rdi
call   10b0 <qread@plt>
xor    %edi,%edi
call   1060 <color@plt>
movsd  0xce0(%rip),%xmm0
movaps %xmm0,%xmm1
movsd  0xcdd(%rip),%xmm2
movaps %xmm2,%xmm3
call   10a0 <rectf@plt>
mov    $0x7,%edi
call   1060 <color@plt>
movsd  0xcbb(%rip),%xmm0
movsd  0xcc3(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xcae(%rip),%xmm0
movsd  0xcae(%rip),%xmm1
call   1050 <draw2@plt>
movsd  0xca1(%rip),%xmm0
movsd  0xc89(%rip),%xmm1
call   1080 <move2@plt>
movsd  0xc8c(%rip),%xmm0
movsd  0xc7c(%rip),%xmm1
call   1050 <draw2@plt>
mov    $0x5,%edi
call   1060 <color@plt>
movsd  0xc6d(%rip),%xmm0
movaps %xmm0,%xmm1
call   1080 <move2@plt>
mov    $0x1,%edi
call   1090 <hrightjustify@plt>
lea    0xc8e(%rip),%rdi
call   1030 <hcharstr@plt>
xor    %edi,%edi
call   1090 <hrightjustify@plt>
mov    %rbx,%rdi
call   10b0 <qread@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"This is Left Justified text\00"
@.str.1 = [22 x i8] c"This is Centered text\00"
@.str.2 = [29 x i8] c"This is Right Justified text\00"
define i32 @drawstuff() {
%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 @hcharstr(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%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 @hcharstr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%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 @hcharstr(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%39 = call i32 @hrightjustify(i32 0)
%40 = call i32 @qread(i16* %2)
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
@.str = [28 x i8] c"This is Left Justified text\00"
@.str.1 = [22 x i8] c"This is Centered text\00"
@.str.2 = [29 x i8] c"This is Right Justified text\00"
define i32 @drawstuff() {
%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 @hcharstr(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%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 @hcharstr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%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 @hcharstr(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%39 = call i32 @hrightjustify(i32 0)
%40 = call i32 @qread(i16* %1)
ret i32 undef
}