main(argc, argv) int argc;
char **argv;
{
  short val;
  vinit("mswin");
  winopen("trivial");
  if (argc == 2)
    font(atoi(argv[1]));
  qdevice(257);
  unqdevice(262);
  while (qread(&val) != 261)
    ;
  color(0);
  clear();
  ortho2(-1.0, 1.0, -1.0, 1.0);
  color(2);
  move2(-1.0, 0.0);
  draw2(1.0, 0.0);
  qread(&val);
  move2(0.0, 0.0);
  draw2(0.0, 1.0);
  cmov2(0.0, 0.0);
  charstr("Hello");
  qread(&val);
  gexit();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   10d0 <vinit@plt>
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   10a0 <winopen@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1244 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   10e0 <atoi@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1060 <font@plt>
mov    $0x101,%edi
mov    $0x0,%al
call   1030 <qdevice@plt>
mov    $0x106,%edi
mov    $0x0,%al
call   1090 <unqdevice@plt>
lea    -0x12(%rbp),%rdi
mov    $0x0,%al
call   10f0 <qread@plt>
cmp    $0x105,%eax
je     1277 <main+0x87>
jmp    125c <main+0x6c>
xor    %edi,%edi
mov    $0x0,%al
call   10b0 <color@plt>
mov    $0x0,%al
call   1110 <clear@plt>
movsd  0xd79(%rip),%xmm2
movsd  0xd69(%rip),%xmm3
movaps %xmm2,%xmm0
movaps %xmm3,%xmm1
mov    $0x4,%al
call   1050 <ortho2@plt>
mov    $0x2,%edi
mov    $0x0,%al
call   10b0 <color@plt>
movsd  0xd50(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   10c0 <move2@plt>
movsd  0xd36(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   1070 <draw2@plt>
lea    -0x12(%rbp),%rdi
mov    $0x0,%al
call   10f0 <qread@plt>
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
mov    $0x2,%al
call   10c0 <move2@plt>
xorps  %xmm0,%xmm0
movsd  0xd09(%rip),%xmm1
mov    $0x2,%al
call   1070 <draw2@plt>
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
mov    $0x2,%al
call   1080 <cmov2@plt>
lea    0xd0c(%rip),%rdi
mov    $0x0,%al
call   1100 <charstr@plt>
lea    -0x12(%rbp),%rdi
mov    $0x0,%al
call   10f0 <qread@plt>
mov    $0x0,%al
call   1040 <gexit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe11(%rip),%rdi
xor    %eax,%eax
call   10d0 <vinit@plt>
lea    0xe09(%rip),%rdi
xor    %eax,%eax
call   10a0 <winopen@plt>
cmp    $0x2,%ebp
jne    122d <main+0x3d>
mov    0x8(%rbx),%rdi
xor    %eax,%eax
call   10e0 <atoi@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1060 <font@plt>
mov    $0x101,%edi
xor    %eax,%eax
call   1030 <qdevice@plt>
mov    $0x106,%edi
xor    %eax,%eax
call   1090 <unqdevice@plt>
lea    0x6(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   10f0 <qread@plt>
cmp    $0x105,%eax
jne    1250 <main+0x60>
xor    %edi,%edi
xor    %eax,%eax
call   10b0 <color@plt>
xor    %eax,%eax
call   1110 <clear@plt>
movsd  0xd87(%rip),%xmm0
movsd  0xd87(%rip),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
mov    $0x4,%al
call   1050 <ortho2@plt>
mov    $0x2,%edi
xor    %eax,%eax
call   10b0 <color@plt>
xorps  %xmm1,%xmm1
movsd  0xd5b(%rip),%xmm0
mov    $0x2,%al
call   10c0 <move2@plt>
xorps  %xmm1,%xmm1
movsd  0xd51(%rip),%xmm0
mov    $0x2,%al
call   1070 <draw2@plt>
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   10f0 <qread@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   10c0 <move2@plt>
xorps  %xmm0,%xmm0
movsd  0xd23(%rip),%xmm1
mov    $0x2,%al
call   1070 <draw2@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   1080 <cmov2@plt>
lea    0xd1e(%rip),%rdi
xor    %eax,%eax
call   1100 <charstr@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   10f0 <qread@plt>
xor    %eax,%eax
call   1040 <gexit@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"mswin\00"
@.str.1 = [8 x i8] c"trivial\00"
@.str.2 = [6 x i8] c"Hello\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @vinit to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @winopen to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %14)
%16 = call i32 (i32, ...) bitcast (i32 (...)* @font to i32 (i32, ...)*)(i32 %15)
br label %17
17: ; preds = %11, %2
%18 = call i32 (i32, ...) bitcast (i32 (...)* @qdevice to i32 (i32, ...)*)(i32 257)
%19 = call i32 (i32, ...) bitcast (i32 (...)* @unqdevice to i32 (i32, ...)*)(i32 262)
br label %20
20: ; preds = %23, %17
%21 = call i32 (i16*, ...) bitcast (i32 (...)* @qread to i32 (i16*, ...)*)(i16* %6)
%22 = icmp ne i32 %21, 261
br i1 %22, label %23, label %24
23: ; preds = %20
br label %20
24: ; preds = %20
%25 = call i32 (i32, ...) bitcast (i32 (...)* @color to i32 (i32, ...)*)(i32 0)
%26 = call i32 (...) @clear()
%27 = call i32 (double, double, double, double, ...) bitcast (i32 (...)* @ortho2 to i32 (double, double, double, double, ...)*)(double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
%28 = call i32 (i32, ...) bitcast (i32 (...)* @color to i32 (i32, ...)*)(i32 2)
%29 = call i32 (double, double, ...) bitcast (i32 (...)* @move2 to i32 (double, double, ...)*)(double -1.000000e+00, double 0.000000e+00)
%30 = call i32 (double, double, ...) bitcast (i32 (...)* @draw2 to i32 (double, double, ...)*)(double 1.000000e+00, double 0.000000e+00)
%31 = call i32 (i16*, ...) bitcast (i32 (...)* @qread to i32 (i16*, ...)*)(i16* %6)
%32 = call i32 (double, double, ...) bitcast (i32 (...)* @move2 to i32 (double, double, ...)*)(double 0.000000e+00, double 0.000000e+00)
%33 = call i32 (double, double, ...) bitcast (i32 (...)* @draw2 to i32 (double, double, ...)*)(double 0.000000e+00, double 1.000000e+00)
%34 = call i32 (double, double, ...) bitcast (i32 (...)* @cmov2 to i32 (double, double, ...)*)(double 0.000000e+00, double 0.000000e+00)
%35 = call i32 (i8*, ...) bitcast (i32 (...)* @charstr to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%36 = call i32 (i16*, ...) bitcast (i32 (...)* @qread to i32 (i16*, ...)*)(i16* %6)
%37 = call i32 (...) @gexit()
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
@.str = [6 x i8] c"mswin\00"
@.str.1 = [8 x i8] c"trivial\00"
@.str.2 = [6 x i8] c"Hello\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i16
%4 = bitcast i16* %3 to i8*
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @vinit to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @winopen to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %0, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %10)
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @font to i32 (i32, ...)*)(i32 %11)
br label %13
13: ; preds = %8, %2
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @qdevice to i32 (i32, ...)*)(i32 257)
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @unqdevice to i32 (i32, ...)*)(i32 262)
br label %16
16: ; preds = %16, %13
%17 = call i32 (i16*, ...) bitcast (i32 (...)* @qread to i32 (i16*, ...)*)(i16* %3)
%18 = icmp eq i32 %17, 261
br i1 %18, label %19, label %16
19: ; preds = %16
%20 = call i32 (i32, ...) bitcast (i32 (...)* @color to i32 (i32, ...)*)(i32 0)
%21 = call i32 (...) @clear()
%22 = call i32 (double, double, double, double, ...) bitcast (i32 (...)* @ortho2 to i32 (double, double, double, double, ...)*)(double -1.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
%23 = call i32 (i32, ...) bitcast (i32 (...)* @color to i32 (i32, ...)*)(i32 2)
%24 = call i32 (double, double, ...) bitcast (i32 (...)* @move2 to i32 (double, double, ...)*)(double -1.000000e+00, double 0.000000e+00)
%25 = call i32 (double, double, ...) bitcast (i32 (...)* @draw2 to i32 (double, double, ...)*)(double 1.000000e+00, double 0.000000e+00)
%26 = call i32 (i16*, ...) bitcast (i32 (...)* @qread to i32 (i16*, ...)*)(i16* %3)
%27 = call i32 (double, double, ...) bitcast (i32 (...)* @move2 to i32 (double, double, ...)*)(double 0.000000e+00, double 0.000000e+00)
%28 = call i32 (double, double, ...) bitcast (i32 (...)* @draw2 to i32 (double, double, ...)*)(double 0.000000e+00, double 1.000000e+00)
%29 = call i32 (double, double, ...) bitcast (i32 (...)* @cmov2 to i32 (double, double, ...)*)(double 0.000000e+00, double 0.000000e+00)
%30 = call i32 (i8*, ...) bitcast (i32 (...)* @charstr to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32 (i16*, ...) bitcast (i32 (...)* @qread to i32 (i16*, ...)*)(i16* %3)
%32 = call i32 (...) @gexit()
ret i32 0
}