#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*/ draw_line(int, int, int, int, int);
void batsu(int x, int y, int c) {
  int i;
  for (i = 1; i < 4; i++) {
    draw_line(x + 8 + i, y + 9, x + 21 + i, y + 22, c);
    draw_line(x + 21 + i, y + 9, x + 8 + i, y + 22, c);
  }
}


x86 assembly (clang, -O0):
<batsu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    118e <batsu+0x7e>
mov    -0x4(%rbp),%edi
add    $0x8,%edi
add    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x9,%esi
mov    -0x4(%rbp),%edx
add    $0x15,%edx
add    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    $0x16,%ecx
mov    -0xc(%rbp),%r8d
call   1030 <draw_line@plt>
mov    -0x4(%rbp),%edi
add    $0x15,%edi
add    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x9,%esi
mov    -0x4(%rbp),%edx
add    $0x8,%edx
add    -0x10(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    $0x16,%ecx
mov    -0xc(%rbp),%r8d
call   1030 <draw_line@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <batsu+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<batsu>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %edi,%ebx
lea    0x9(%rsi),%ebp
lea    0x16(%rsi),%r15d
lea    0x9(%rbx),%r12d
lea    0x16(%rbx),%r13d
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r13d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <draw_line@plt>
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <draw_line@plt>
lea    0xa(%rbx),%r12d
lea    0x17(%rbx),%r13d
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r13d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <draw_line@plt>
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <draw_line@plt>
lea    0xb(%rbx),%r12d
add    $0x18,%ebx
mov    %r12d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <draw_line@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <draw_line@plt>

LLVM IR (-O0):
define void @batsu(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 1, i32* %7
br label %8
8: ; preds = %40, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 4
br i1 %10, label %11, label %43
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 8
%14 = load i32, i32* %7
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 9
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 21
%20 = load i32, i32* %7
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 22
%24 = load i32, i32* %6
%25 = call i32 @draw_line(i32 %15, i32 %17, i32 %21, i32 %23, i32 %24)
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 21
%28 = load i32, i32* %7
%29 = add nsw i32 %27, %28
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 9
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 8
%34 = load i32, i32* %7
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 22
%38 = load i32, i32* %6
%39 = call i32 @draw_line(i32 %29, i32 %31, i32 %35, i32 %37, i32 %38)
br label %40
40: ; preds = %11
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %8
43: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @batsu(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 9
%5 = add nsw i32 %1, 22
%6 = add i32 %0, 9
%7 = add i32 %0, 22
%8 = tail call i32 @draw_line(i32 %6, i32 %4, i32 %7, i32 %5, i32 %2)
%9 = tail call i32 @draw_line(i32 %7, i32 %4, i32 %6, i32 %5, i32 %2)
%10 = add i32 %0, 10
%11 = add i32 %0, 23
%12 = tail call i32 @draw_line(i32 %10, i32 %4, i32 %11, i32 %5, i32 %2)
%13 = tail call i32 @draw_line(i32 %11, i32 %4, i32 %10, i32 %5, i32 %2)
%14 = add i32 %0, 11
%15 = add i32 %0, 24
%16 = tail call i32 @draw_line(i32 %14, i32 %4, i32 %15, i32 %5, i32 %2)
%17 = tail call i32 @draw_line(i32 %15, i32 %4, i32 %14, i32 %5, i32 %2)
ret void
}