#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*/ vdmnum(int, char *);
int /*<<< orphan*/ vdmprintf(char *, ...);
void vdmpolyline(int numpoints, int *points) {
  int i, *p = points;
  char xcoord[4], ycoord[4];
  if (numpoints < 2)
    return;
  vdmprintf("1%s%s", vdmnum(*p, xcoord), vdmnum(*(p + 1), ycoord));
  p += 2;
  for (i = 1; i < numpoints; i++) {
    vdmprintf("%s%s", vdmnum(*p, xcoord), vdmnum(*(p + 1), ycoord));
    p += 2;
  }
  vdmprintf("\x1e\n");
}


x86 assembly (clang, -O0):
<vdmpolyline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1146 <vdmpolyline+0x26>
jmp    11f7 <vdmpolyline+0xd7>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
lea    -0x24(%rbp),%rsi
call   1030 <vdmnum@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edi
lea    -0x28(%rbp),%rsi
call   1030 <vdmnum@plt>
mov    -0x2c(%rbp),%esi
mov    %eax,%edx
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1040 <vdmprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11e9 <vdmpolyline+0xc9>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
lea    -0x24(%rbp),%rsi
call   1030 <vdmnum@plt>
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edi
lea    -0x28(%rbp),%rsi
call   1030 <vdmnum@plt>
mov    -0x30(%rbp),%esi
mov    %eax,%edx
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <vdmprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118e <vdmpolyline+0x6e>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1040 <vdmprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdmpolyline>:
cmp    $0x2,%edi
jl     11cf <vdmpolyline+0xaf>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%r14d
mov    (%rsi),%edi
mov    %rsp,%rsi
call   1030 <vdmnum@plt>
mov    %eax,%ebp
mov    0x4(%rbx),%edi
lea    0x4(%rsp),%r12
mov    %r12,%rsi
call   1030 <vdmnum@plt>
lea    0xea3(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <vdmprintf@plt>
add    $0xffffffff,%r14d
lea    0xe8e(%rip),%r13
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%rbx,%r15,8),%edi
mov    %rsp,%rsi
call   1030 <vdmnum@plt>
mov    %eax,%ebp
mov    0xc(%rbx,%r15,8),%edi
mov    %r12,%rsi
call   1030 <vdmnum@plt>
mov    %r13,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <vdmprintf@plt>
add    $0x1,%r15
cmp    %r15d,%r14d
jne    1180 <vdmpolyline+0x60>
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
call   1040 <vdmprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1%s%s\00"
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [3 x i8] c"\1E\0A\00"
define void @vdmpolyline(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca [4 x i8]
%8 = alloca [4 x i8]
store i32 %0, i32* %3
store i32* %1, i32** %4
%9 = load i32*, i32** %4
store i32* %9, i32** %6
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %2
br label %48
13: ; preds = %2
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%17 = call i32 @vdmnum(i32 %15, i8* %16)
%18 = load i32*, i32** %6
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%22 = call i32 @vdmnum(i32 %20, i8* %21)
%23 = call i32 (i8*, ...) @vdmprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %22)
%24 = load i32*, i32** %6
%25 = getelementptr inbounds i32, i32* %24, i64 2
store i32* %25, i32** %6
store i32 1, i32* %5
br label %26
26: ; preds = %43, %13
%27 = load i32, i32* %5
%28 = load i32, i32* %3
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %46
30: ; preds = %26
%31 = load i32*, i32** %6
%32 = load i32, i32* %31
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%34 = call i32 @vdmnum(i32 %32, i8* %33)
%35 = load i32*, i32** %6
%36 = getelementptr inbounds i32, i32* %35, i64 1
%37 = load i32, i32* %36
%38 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%39 = call i32 @vdmnum(i32 %37, i8* %38)
%40 = call i32 (i8*, ...) @vdmprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %34, i32 %39)
%41 = load i32*, i32** %6
%42 = getelementptr inbounds i32, i32* %41, i64 2
store i32* %42, i32** %6
br label %43
43: ; preds = %30
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %26
46: ; preds = %26
%47 = call i32 (i8*, ...) @vdmprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %46, %12
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"1%s%s\00"
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [3 x i8] c"\1E\0A\00"
define void @vdmpolyline(i32 %0, i32* nocapture %1) {
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 2
br i1 %7, label %29, label %8
8: ; preds = %2
%9 = load i32, i32* %1
%10 = call i32 @vdmnum(i32 %9, i8* %5)
%11 = getelementptr inbounds i32, i32* %1, i64 1
%12 = load i32, i32* %11
%13 = call i32 @vdmnum(i32 %12, i8* %6)
%14 = call i32 (i8*, ...) @vdmprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13)
br label %15
15: ; preds = %8, %15
%16 = phi i32* [ %18, %15 ], [ %1, %8 ]
%17 = phi i32 [ %25, %15 ], [ 1, %8 ]
%18 = getelementptr inbounds i32, i32* %16, i64 2
%19 = load i32, i32* %18
%20 = call i32 @vdmnum(i32 %19, i8* %5)
%21 = getelementptr inbounds i32, i32* %16, i64 3
%22 = load i32, i32* %21
%23 = call i32 @vdmnum(i32 %22, i8* %6)
%24 = call i32 (i8*, ...) @vdmprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %23)
%25 = add nuw nsw i32 %17, 1
%26 = icmp eq i32 %25, %0
br i1 %26, label %27, label %15
27: ; preds = %15
%28 = call i32 (i8*, ...) @vdmprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %2, %27
ret void
}