#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 */
struct ascii85 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ascii85_encode(struct ascii85 *, unsigned char);
void _ascii85_write_tile_lines(struct ascii85 *ascii85_p, unsigned int zl) {
  if (zl) {
    ascii85_encode(ascii85_p, 0xFF);
    ascii85_encode(ascii85_p, 0xFF);
    ascii85_encode(ascii85_p, (unsigned char)((zl >> 8) & 0xFF));
    ascii85_encode(ascii85_p, (unsigned char)(zl & 0xFF));
  }
}


x86 assembly (clang, -O0):
<_ascii85_write_tile_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1170 <_ascii85_write_tile_lines+0x60>
mov    -0x8(%rbp),%rdi
mov    $0xff,%esi
call   1030 <ascii85_encode@plt>
mov    -0x8(%rbp),%rdi
mov    $0xff,%esi
call   1030 <ascii85_encode@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
movzbl %al,%esi
call   1030 <ascii85_encode@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movzbl %al,%esi
call   1030 <ascii85_encode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ascii85_write_tile_lines>:
test   %esi,%esi
je     1154 <_ascii85_write_tile_lines+0x44>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %rdi,%rbx
mov    $0xff,%esi
mov    %eax,%ebp
call   1030 <ascii85_encode@plt>
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <ascii85_encode@plt>
mov    %ebp,%eax
movzbl %ah,%esi
mov    %rbx,%rdi
call   1030 <ascii85_encode@plt>
movzbl %bpl,%esi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ascii85_encode@plt>
ret

LLVM IR (-O0):
%struct.ascii85 = type { i32 }
define void @_ascii85_write_tile_lines(%struct.ascii85* %0, i32 %1) {
%3 = alloca %struct.ascii85*
%4 = alloca i32
store %struct.ascii85* %0, %struct.ascii85** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %23
7: ; preds = %2
%8 = load %struct.ascii85*, %struct.ascii85** %3
%9 = call i32 @ascii85_encode(%struct.ascii85* %8, i8 zeroext -1)
%10 = load %struct.ascii85*, %struct.ascii85** %3
%11 = call i32 @ascii85_encode(%struct.ascii85* %10, i8 zeroext -1)
%12 = load %struct.ascii85*, %struct.ascii85** %3
%13 = load i32, i32* %4
%14 = lshr i32 %13, 8
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = call i32 @ascii85_encode(%struct.ascii85* %12, i8 zeroext %16)
%18 = load %struct.ascii85*, %struct.ascii85** %3
%19 = load i32, i32* %4
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = call i32 @ascii85_encode(%struct.ascii85* %18, i8 zeroext %21)
br label %23
23: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
%struct.ascii85 = type { i32 }
define void @_ascii85_write_tile_lines(%struct.ascii85* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i32 @ascii85_encode(%struct.ascii85* %0, i8 zeroext -1)
%6 = tail call i32 @ascii85_encode(%struct.ascii85* %0, i8 zeroext -1)
%7 = lshr i32 %1, 8
%8 = trunc i32 %7 to i8
%9 = tail call i32 @ascii85_encode(%struct.ascii85* %0, i8 zeroext %8)
%10 = trunc i32 %1 to i8
%11 = tail call i32 @ascii85_encode(%struct.ascii85* %0, i8 zeroext %10)
br label %12
12: ; preds = %4, %2
ret void
}