#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*/ AddPolyPoint(int, int);
int /*<<< orphan*/ EndPolyLine();
int /*<<< orphan*/ StartPolyLine(int, int, int);
void DoBatman(int i) {
  StartPolyLine(i, i, 4);
  AddPolyPoint(i + i / 2 + 10, i + 10);
  AddPolyPoint(i + i + 20, i);
  AddPolyPoint(i + i + 20, 10 + i + i / 2);
  AddPolyPoint(i, 10 + i + i / 2);
  EndPolyLine();
}


x86 assembly (clang, -O0):
<DoBatman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x4,%edx
call   1050 <StartPolyLine@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    %eax,%edi
add    $0xa,%edi
mov    -0x4(%rbp),%esi
add    $0xa,%esi
call   1030 <AddPolyPoint@plt>
mov    -0x4(%rbp),%edi
add    -0x4(%rbp),%edi
add    $0x14,%edi
mov    -0x4(%rbp),%esi
call   1030 <AddPolyPoint@plt>
mov    -0x4(%rbp),%edi
add    -0x4(%rbp),%edi
add    $0x14,%edi
mov    -0x4(%rbp),%esi
add    $0xa,%esi
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    %eax,%esi
call   1030 <AddPolyPoint@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
add    $0xa,%esi
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    %eax,%esi
call   1030 <AddPolyPoint@plt>
mov    $0x0,%al
call   1040 <EndPolyLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoBatman>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    %edi,%esi
mov    $0x4,%edx
call   1050 <StartPolyLine@plt>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
lea    0xa(%rbx),%esi
lea    (%rbx,%rax,1),%r14d
add    $0xa,%r14d
mov    %r14d,%edi
call   1030 <AddPolyPoint@plt>
lea    (%rbx,%rbx,1),%ebp
add    $0x14,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <AddPolyPoint@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <AddPolyPoint@plt>
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <AddPolyPoint@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <EndPolyLine@plt>

LLVM IR (-O0):
define void @DoBatman(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @StartPolyLine(i32 %3, i32 %4, i32 4)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 2
%9 = add nsw i32 %6, %8
%10 = add nsw i32 %9, 10
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 10
%13 = call i32 @AddPolyPoint(i32 %10, i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = add nsw i32 %14, %15
%17 = add nsw i32 %16, 20
%18 = load i32, i32* %2
%19 = call i32 @AddPolyPoint(i32 %17, i32 %18)
%20 = load i32, i32* %2
%21 = load i32, i32* %2
%22 = add nsw i32 %20, %21
%23 = add nsw i32 %22, 20
%24 = load i32, i32* %2
%25 = add nsw i32 10, %24
%26 = load i32, i32* %2
%27 = sdiv i32 %26, 2
%28 = add nsw i32 %25, %27
%29 = call i32 @AddPolyPoint(i32 %23, i32 %28)
%30 = load i32, i32* %2
%31 = load i32, i32* %2
%32 = add nsw i32 10, %31
%33 = load i32, i32* %2
%34 = sdiv i32 %33, 2
%35 = add nsw i32 %32, %34
%36 = call i32 @AddPolyPoint(i32 %30, i32 %35)
%37 = call i32 (...) @EndPolyLine()
ret void
}

LLVM IR (-O2):
define void @DoBatman(i32 %0) {
%2 = tail call i32 @StartPolyLine(i32 %0, i32 %0, i32 4)
%3 = sdiv i32 %0, 2
%4 = add i32 %0, 10
%5 = add i32 %4, %3
%6 = tail call i32 @AddPolyPoint(i32 %5, i32 %4)
%7 = shl nsw i32 %0, 1
%8 = add nsw i32 %7, 20
%9 = tail call i32 @AddPolyPoint(i32 %8, i32 %0)
%10 = tail call i32 @AddPolyPoint(i32 %8, i32 %5)
%11 = tail call i32 @AddPolyPoint(i32 %0, i32 %5)
%12 = tail call i32 (...) @EndPolyLine()
ret void
}