#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 */
short atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ plD_eop_tek();
int /*<<< orphan*/ plD_init_vlt();
int /*<<< orphan*/ plD_line_tek(short, short, short, short);
int /*<<< orphan*/ plD_tidy_tek();
int main(int argc, char *argv[]) {
  short x0 = 300, y0 = 300, l = 100;
  short x1, x2, y1, y2;
  if (argc > 1)
    x0 = atoi(argv[1]);
  if (argc > 2)
    y0 = atoi(argv[2]);
  plD_init_vlt();
  plD_line_tek(0, 0, 1023, 0);
  plD_line_tek(1023, 0, 1023, 779);
  plD_line_tek(1023, 779, 0, 779);
  plD_line_tek(0, 779, 0, 0);
  x1 = x0 - l, x2 = x0 + l;
  y1 = y0 - l, y2 = y0 + l;
  plD_line_tek(x1, y0, x2, y0);
  plD_line_tek(x0, y1, x0, y2);
  plD_eop_tek();
  plD_tidy_tek();
  exit(0);
}


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)
movw   $0x12c,-0x12(%rbp)
movw   $0x12c,-0x14(%rbp)
movw   $0x64,-0x16(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11a3 <main+0x43>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %ax,-0x12(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    11be <main+0x5e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %ax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <plD_init_vlt@plt>
xor    %ecx,%ecx
mov    $0x3ff,%edx
mov    %ecx,%edi
mov    %ecx,%esi
call   1070 <plD_line_tek@plt>
mov    $0x3ff,%edx
xor    %esi,%esi
mov    $0x30b,%ecx
mov    %edx,%edi
call   1070 <plD_line_tek@plt>
mov    $0x3ff,%edi
mov    $0x30b,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1070 <plD_line_tek@plt>
xor    %ecx,%ecx
mov    $0x30b,%esi
mov    %ecx,%edi
mov    %ecx,%edx
call   1070 <plD_line_tek@plt>
movswl -0x12(%rbp),%eax
movswl -0x16(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x18(%rbp)
movswl -0x12(%rbp),%eax
movswl -0x16(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x1a(%rbp)
movswl -0x14(%rbp),%eax
movswl -0x16(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x1c(%rbp)
movswl -0x14(%rbp),%eax
movswl -0x16(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x1e(%rbp)
mov    -0x18(%rbp),%dx
mov    -0x14(%rbp),%cx
mov    -0x1a(%rbp),%ax
movswl %dx,%edi
movswl %cx,%esi
movswl %ax,%edx
movswl -0x14(%rbp),%ecx
call   1070 <plD_line_tek@plt>
mov    -0x12(%rbp),%dx
mov    -0x1c(%rbp),%cx
mov    -0x12(%rbp),%ax
movswl %dx,%edi
movswl %cx,%esi
movswl %ax,%edx
movswl -0x1e(%rbp),%ecx
call   1070 <plD_line_tek@plt>
mov    $0x0,%al
call   1030 <plD_eop_tek@plt>
mov    $0x0,%al
call   1050 <plD_tidy_tek@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x12c,%r15w
cmp    $0x2,%edi
jl     1195 <main+0x35>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%r14d
cmp    $0x2,%ebp
je     119a <main+0x3a>
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%r15d
jmp    119a <main+0x3a>
mov    $0x12c,%r14w
xor    %eax,%eax
call   1040 <plD_init_vlt@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x3ff,%edx
xor    %ecx,%ecx
call   1070 <plD_line_tek@plt>
mov    $0x3ff,%edi
xor    %esi,%esi
mov    $0x3ff,%edx
mov    $0x30b,%ecx
call   1070 <plD_line_tek@plt>
mov    $0x3ff,%edi
mov    $0x30b,%esi
xor    %edx,%edx
mov    $0x30b,%ecx
call   1070 <plD_line_tek@plt>
xor    %edi,%edi
mov    $0x30b,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1070 <plD_line_tek@plt>
lea    -0x64(%r14),%eax
lea    0x64(%r14),%ecx
lea    -0x64(%r15),%ebx
lea    0x64(%r15),%ebp
movswl %ax,%edi
movswl %cx,%edx
movswl %r15w,%ecx
mov    %ecx,%esi
call   1070 <plD_line_tek@plt>
movswl %bx,%esi
movswl %bp,%ecx
movswl %r14w,%edi
mov    %edi,%edx
call   1070 <plD_line_tek@plt>
xor    %eax,%eax
call   1030 <plD_eop_tek@plt>
xor    %eax,%eax
call   1050 <plD_tidy_tek@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i16 300, i16* %6
store i16 300, i16* %7
store i16 100, i16* %8
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call signext i16 @atoi(i8* %18)
store i16 %19, i16* %6
br label %20
20: ; preds = %15, %2
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 2
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call signext i16 @atoi(i8* %26)
store i16 %27, i16* %7
br label %28
28: ; preds = %23, %20
%29 = call i32 (...) @plD_init_vlt()
%30 = call i32 @plD_line_tek(i16 signext 0, i16 signext 0, i16 signext 1023, i16 signext 0)
%31 = call i32 @plD_line_tek(i16 signext 1023, i16 signext 0, i16 signext 1023, i16 signext 779)
%32 = call i32 @plD_line_tek(i16 signext 1023, i16 signext 779, i16 signext 0, i16 signext 779)
%33 = call i32 @plD_line_tek(i16 signext 0, i16 signext 779, i16 signext 0, i16 signext 0)
%34 = load i16, i16* %6
%35 = sext i16 %34 to i32
%36 = load i16, i16* %8
%37 = sext i16 %36 to i32
%38 = sub nsw i32 %35, %37
%39 = trunc i32 %38 to i16
store i16 %39, i16* %9
%40 = load i16, i16* %6
%41 = sext i16 %40 to i32
%42 = load i16, i16* %8
%43 = sext i16 %42 to i32
%44 = add nsw i32 %41, %43
%45 = trunc i32 %44 to i16
store i16 %45, i16* %10
%46 = load i16, i16* %7
%47 = sext i16 %46 to i32
%48 = load i16, i16* %8
%49 = sext i16 %48 to i32
%50 = sub nsw i32 %47, %49
%51 = trunc i32 %50 to i16
store i16 %51, i16* %11
%52 = load i16, i16* %7
%53 = sext i16 %52 to i32
%54 = load i16, i16* %8
%55 = sext i16 %54 to i32
%56 = add nsw i32 %53, %55
%57 = trunc i32 %56 to i16
store i16 %57, i16* %12
%58 = load i16, i16* %9
%59 = load i16, i16* %7
%60 = load i16, i16* %10
%61 = load i16, i16* %7
%62 = call i32 @plD_line_tek(i16 signext %58, i16 signext %59, i16 signext %60, i16 signext %61)
%63 = load i16, i16* %6
%64 = load i16, i16* %11
%65 = load i16, i16* %6
%66 = load i16, i16* %12
%67 = call i32 @plD_line_tek(i16 signext %63, i16 signext %64, i16 signext %65, i16 signext %66)
%68 = call i32 (...) @plD_eop_tek()
%69 = call i32 (...) @plD_tidy_tek()
%70 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call signext i16 @atoi(i8* %6)
%8 = icmp eq i32 %0, 2
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call signext i16 @atoi(i8* %11)
br label %13
13: ; preds = %2, %9, %4
%14 = phi i16 [ %7, %9 ], [ %7, %4 ], [ 300, %2 ]
%15 = phi i16 [ %12, %9 ], [ 300, %4 ], [ 300, %2 ]
%16 = tail call i32 (...) @plD_init_vlt()
%17 = tail call i32 @plD_line_tek(i16 signext 0, i16 signext 0, i16 signext 1023, i16 signext 0)
%18 = tail call i32 @plD_line_tek(i16 signext 1023, i16 signext 0, i16 signext 1023, i16 signext 779)
%19 = tail call i32 @plD_line_tek(i16 signext 1023, i16 signext 779, i16 signext 0, i16 signext 779)
%20 = tail call i32 @plD_line_tek(i16 signext 0, i16 signext 779, i16 signext 0, i16 signext 0)
%21 = add i16 %14, -100
%22 = add i16 %14, 100
%23 = add i16 %15, -100
%24 = add i16 %15, 100
%25 = tail call i32 @plD_line_tek(i16 signext %21, i16 signext %15, i16 signext %22, i16 signext %15)
%26 = tail call i32 @plD_line_tek(i16 signext %14, i16 signext %23, i16 signext %14, i16 signext %24)
%27 = tail call i32 (...) @plD_eop_tek()
%28 = tail call i32 (...) @plD_tidy_tek()
%29 = tail call i32 @exit(i32 0)
unreachable
}