#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*/ BresenhamLine(unsigned char *, int, int, int *, int *,
                                 char *);
void DrawTrack(unsigned char *pic, int pic_w, int pic_h, int point_axis[],
               int c, char YUV[]) {
  int i;
  int start[2];
  int end[2];
  for (i = 0; i <= 2 * (c - 2); i += 2) {
    start[0] = point_axis[i];
    start[1] = point_axis[i + 1];
    end[0] = point_axis[i + 2];
    end[1] = point_axis[i + 3];
    BresenhamLine(pic, pic_w, pic_h, start, end, YUV);
  }
}


x86 assembly (clang, -O0):
<DrawTrack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x2,%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jg     11b9 <DrawTrack+0xa9>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x34(%rbp),%rcx
lea    -0x3c(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <BresenhamLine@plt>
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x2c(%rbp)
jmp    1135 <DrawTrack+0x25>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawTrack>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
add    %r8d,%r8d
add    $0xfffffffc,%r8d
js     1184 <DrawTrack+0x74>
mov    %r9,%r15
mov    %rcx,%rbx
mov    %edx,%r12d
mov    %esi,%ebp
mov    %rdi,%r13
mov    %r8d,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
nop
mov    (%rbx,%rax,4),%ecx
mov    %ecx,0x8(%rsp)
mov    0x4(%rbx,%rax,4),%ecx
mov    %ecx,0xc(%rsp)
lea    0x2(%rax),%r14
mov    0x8(%rbx,%rax,4),%ecx
mov    %ecx,(%rsp)
mov    0xc(%rbx,%rax,4),%eax
mov    %eax,0x4(%rsp)
mov    %r13,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
mov    %r15,%r9
call   1030 <BresenhamLine@plt>
mov    %r14,%rax
cmp    0x10(%rsp),%r14
jbe    1140 <DrawTrack+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @DrawTrack(i8* %0, i32 %1, i32 %2, i32* %3, i32 %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca [2 x i32]
%15 = alloca [2 x i32]
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
store i32 0, i32* %13
br label %16
16: ; preds = %57, %6
%17 = load i32, i32* %13
%18 = load i32, i32* %11
%19 = sub nsw i32 %18, 2
%20 = mul nsw i32 2, %19
%21 = icmp sle i32 %17, %20
br i1 %21, label %22, label %60
22: ; preds = %16
%23 = load i32*, i32** %10
%24 = load i32, i32* %13
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
store i32 %27, i32* %28
%29 = load i32*, i32** %10
%30 = load i32, i32* %13
%31 = add nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %29, i64 %32
%34 = load i32, i32* %33
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 1
store i32 %34, i32* %35
%36 = load i32*, i32** %10
%37 = load i32, i32* %13
%38 = add nsw i32 %37, 2
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %36, i64 %39
%41 = load i32, i32* %40
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 0
store i32 %41, i32* %42
%43 = load i32*, i32** %10
%44 = load i32, i32* %13
%45 = add nsw i32 %44, 3
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i32, i32* %43, i64 %46
%48 = load i32, i32* %47
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 1
store i32 %48, i32* %49
%50 = load i8*, i8** %7
%51 = load i32, i32* %8
%52 = load i32, i32* %9
%53 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 0
%55 = load i8*, i8** %12
%56 = call i32 @BresenhamLine(i8* %50, i32 %51, i32 %52, i32* %53, i32* %54, i8* %55)
br label %57
57: ; preds = %22
%58 = load i32, i32* %13
%59 = add nsw i32 %58, 2
store i32 %59, i32* %13
br label %16
60: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @DrawTrack(i8* %0, i32 %1, i32 %2, i32* nocapture %3, i32 %4, i8* %5) {
%7 = alloca [2 x i32]
%8 = alloca [2 x i32]
%9 = bitcast [2 x i32]* %7 to i8*
%10 = bitcast [2 x i32]* %8 to i8*
%11 = shl i32 %4, 1
%12 = add i32 %11, -4
%13 = icmp slt i32 %12, 0
br i1 %13, label %35, label %14
14: ; preds = %6
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%19 = zext i32 %12 to i64
br label %20
20: ; preds = %14, %20
%21 = phi i64 [ 0, %14 ], [ %27, %20 ]
%22 = getelementptr inbounds i32, i32* %3, i64 %21
%23 = load i32, i32* %22
store i32 %23, i32* %15
%24 = or i64 %21, 1
%25 = getelementptr inbounds i32, i32* %3, i64 %24
%26 = load i32, i32* %25
store i32 %26, i32* %16
%27 = add nuw nsw i64 %21, 2
%28 = getelementptr inbounds i32, i32* %3, i64 %27
%29 = load i32, i32* %28
store i32 %29, i32* %17
%30 = add nuw nsw i64 %21, 3
%31 = getelementptr inbounds i32, i32* %3, i64 %30
%32 = load i32, i32* %31
store i32 %32, i32* %18
%33 = call i32 @BresenhamLine(i8* %0, i32 %1, i32 %2, i32* %15, i32* %17, i8* %5)
%34 = icmp ugt i64 %27, %19
br i1 %34, label %35, label %20
35: ; preds = %20, %6
ret void
}