#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*/ DDSpriteBuffer_BltImg(int, int, int, int);
int GetStretchX(int);
int GetStretchY(int);
void subDrawSnikSnakFromLeft(int si, int bx) {
  int X, Y;
  bx = bx - 0x27;
  X = GetStretchX(si - 1);
  Y = GetStretchY(si);
  DDSpriteBuffer_BltImg(X, Y, 156, 0);
  DDSpriteBuffer_BltImg(X + bx * ((2) * 2), Y, 123, bx);
}


x86 assembly (clang, -O0):
<subDrawSnikSnakFromLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x27,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <GetStretchX@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <GetStretchY@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x9c,%edx
xor    %ecx,%ecx
call   1040 <DDSpriteBuffer_BltImg@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
add    %eax,%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x7b,%edx
call   1040 <DDSpriteBuffer_BltImg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subDrawSnikSnakFromLeft>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    -0x27(%r14),%r15d
lea    -0x1(%rbx),%edi
call   1030 <GetStretchX@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <GetStretchY@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %eax,%esi
mov    $0x9c,%edx
xor    %ecx,%ecx
call   1040 <DDSpriteBuffer_BltImg@plt>
lea    -0x9c(%rbp,%r14,4),%edi
ff
mov    %ebx,%esi
mov    $0x7b,%edx
mov    %r15d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <DDSpriteBuffer_BltImg@plt>

LLVM IR (-O0):
define void @subDrawSnikSnakFromLeft(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 39
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = call i32 @GetStretchX(i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = call i32 @GetStretchY(i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @DDSpriteBuffer_BltImg(i32 %14, i32 %15, i32 156, i32 0)
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = mul nsw i32 %18, 4
%20 = add nsw i32 %17, %19
%21 = load i32, i32* %6
%22 = load i32, i32* %4
%23 = call i32 @DDSpriteBuffer_BltImg(i32 %20, i32 %21, i32 123, i32 %22)
ret void
}

LLVM IR (-O2):
define void @subDrawSnikSnakFromLeft(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -39
%4 = add nsw i32 %0, -1
%5 = tail call i32 @GetStretchX(i32 %4)
%6 = tail call i32 @GetStretchY(i32 %0)
%7 = tail call i32 @DDSpriteBuffer_BltImg(i32 %5, i32 %6, i32 156, i32 0)
%8 = shl nsw i32 %3, 2
%9 = add nsw i32 %5, %8
%10 = tail call i32 @DDSpriteBuffer_BltImg(i32 %9, i32 %6, i32 123, i32 %3)
ret void
}