#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*/ DoPlot(int, float *, float *, int);
int /*<<< orphan*/ DrawAxis();
int /*<<< orphan*/ DrawGrid();
int /*<<< orphan*/ PrintText(char *, char *, char *);
int /*<<< orphan*/ SetScales(int, float *, float *, int);
scalar_t__ SetViewPort(int, int, int, int);
void Plot(int npts, float *x, float *y, char *mt, char *xt, char *yt, int col,
          int flags) {
  if ((flags & 0x00000002) || (flags & 0x00000001)) {
    if (SetViewPort(9, 22, 65, 19) == 0)
      return;
    if (flags & 0x00000001)
      flags &= ~(0x00000040 | 0x00000080);
    SetScales(npts, x, y, flags);
    if (flags & 0x00000004)
      DrawGrid();
    else
      DrawAxis();
    PrintText(mt, xt, yt);
  }
  DoPlot(npts, x, y, col);
}


x86 assembly (clang, -O0):
<Plot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x18(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    11a3 <Plot+0x43>
mov    0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     122b <Plot+0xcb>
mov    $0x9,%edi
mov    $0x16,%esi
mov    $0x41,%edx
mov    $0x13,%ecx
call   1030 <SetViewPort@plt>
cmp    $0x0,%rax
jne    11cb <Plot+0x6b>
jmp    123e <Plot+0xde>
mov    0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11e5 <Plot+0x85>
mov    0x18(%rbp),%eax
and    $0xffffff3f,%eax
mov    %eax,0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x18(%rbp),%ecx
call   1040 <SetScales@plt>
mov    0x18(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1213 <Plot+0xb3>
mov    $0x0,%al
call   1060 <DrawGrid@plt>
jmp    121a <Plot+0xba>
mov    $0x0,%al
call   1050 <DrawAxis@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1080 <PrintText@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x10(%rbp),%ecx
call   1070 <DoPlot@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Plot>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r13
mov    %rsi,%r12
mov    %edi,%r14d
mov    0x58(%rsp),%r15d
mov    0x50(%rsp),%ebp
test   $0x3,%r15b
je     1213 <Plot+0xb3>
mov    %r9,%rbx
mov    %rcx,0x8(%rsp)
mov    %r8,0x10(%rsp)
mov    $0x9,%edi
mov    $0x16,%esi
mov    $0x41,%edx
mov    $0x13,%ecx
call   1030 <SetViewPort@plt>
test   %rax,%rax
je     11ea <Plot+0x8a>
mov    %r13,%rdx
mov    %r15d,%r13d
and    $0xffffff3f,%r13d
test   $0x1,%r15b
cmove  %r15d,%r13d
mov    %r14d,%edi
mov    %r12,%rsi
mov    %rdx,%r15
mov    %r13d,%ecx
call   1040 <SetScales@plt>
xor    %eax,%eax
test   $0x4,%r13b
jne    11f9 <Plot+0x99>
call   1050 <DrawAxis@plt>
jmp    11fe <Plot+0x9e>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
call   1060 <DrawGrid@plt>
mov    0x8(%rsp),%rdi
mov    0x10(%rsp),%rsi
mov    %rbx,%rdx
call   1080 <PrintText@plt>
mov    %r15,%r13
mov    %r14d,%edi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %ebp,%ecx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <DoPlot@plt>

LLVM IR (-O0):
define void @Plot(i32 %0, float* %1, float* %2, i8* %3, i8* %4, i8* %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca float*
%11 = alloca float*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store float* %1, float** %10
store float* %2, float** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i32, i32* %16
%18 = and i32 %17, 2
%19 = icmp ne i32 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %8
%21 = load i32, i32* %16
%22 = and i32 %21, 1
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %53
24: ; preds = %20, %8
%25 = call i64 @SetViewPort(i32 9, i32 22, i32 65, i32 19)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %24
br label %59
28: ; preds = %24
%29 = load i32, i32* %16
%30 = and i32 %29, 1
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i32, i32* %16
%34 = and i32 %33, -193
store i32 %34, i32* %16
br label %35
35: ; preds = %32, %28
%36 = load i32, i32* %9
%37 = load float*, float** %10
%38 = load float*, float** %11
%39 = load i32, i32* %16
%40 = call i32 @SetScales(i32 %36, float* %37, float* %38, i32 %39)
%41 = load i32, i32* %16
%42 = and i32 %41, 4
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %35
%45 = call i32 (...) @DrawGrid()
br label %48
46: ; preds = %35
%47 = call i32 (...) @DrawAxis()
br label %48
48: ; preds = %46, %44
%49 = load i8*, i8** %12
%50 = load i8*, i8** %13
%51 = load i8*, i8** %14
%52 = call i32 @PrintText(i8* %49, i8* %50, i8* %51)
br label %53
53: ; preds = %48, %20
%54 = load i32, i32* %9
%55 = load float*, float** %10
%56 = load float*, float** %11
%57 = load i32, i32* %15
%58 = call i32 @DoPlot(i32 %54, float* %55, float* %56, i32 %57)
br label %59
59: ; preds = %53, %27
ret void
}

LLVM IR (-O2):
define void @Plot(i32 %0, float* %1, float* %2, i8* %3, i8* %4, i8* %5, i32 %6, i32 %7) {
%9 = and i32 %7, 1
%10 = icmp eq i32 %9, 0
%11 = and i32 %7, 3
%12 = icmp eq i32 %11, 0
br i1 %12, label %28, label %13
13: ; preds = %8
%14 = tail call i64 @SetViewPort(i32 9, i32 22, i32 65, i32 19)
%15 = icmp eq i64 %14, 0
br i1 %15, label %30, label %16
16: ; preds = %13
%17 = and i32 %7, -193
%18 = select i1 %10, i32 %7, i32 %17
%19 = tail call i32 @SetScales(i32 %0, float* %1, float* %2, i32 %18)
%20 = and i32 %18, 4
%21 = icmp eq i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %16
%23 = tail call i32 (...) @DrawGrid()
br label %26
24: ; preds = %16
%25 = tail call i32 (...) @DrawAxis()
br label %26
26: ; preds = %24, %22
%27 = tail call i32 @PrintText(i8* %3, i8* %4, i8* %5)
br label %28
28: ; preds = %8, %26
%29 = tail call i32 @DoPlot(i32 %0, float* %1, float* %2, i32 %6)
br label %30
30: ; preds = %13, %28
ret void
}