#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 lzss_io {
  int dummy;
};
struct lzss {
  int dummy;
};

/* Variables and functions */
scalar_t__ output_word(struct lzss *, struct lzss_io *, int, int);
scalar_t__ putbit1(struct lzss *, struct lzss_io *);
int output1(struct lzss *lzss, struct lzss_io *io, int c) {
  if (putbit1(lzss, io))
    return -1;
  if (output_word(lzss, io, 0x100, c))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<output1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <putbit1@plt>
cmp    $0x0,%rax
je     1156 <output1+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <output1+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%ecx
mov    $0x100,%edx
call   1040 <output_word@plt>
cmp    $0x0,%rax
je     1181 <output1+0x61>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <output1+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output1>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <putbit1@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1157 <output1+0x37>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x100,%edx
mov    %r14d,%ecx
call   1040 <output_word@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.lzss = type { i32 }
%struct.lzss_io = type { i32 }
define i32 @output1(%struct.lzss* %0, %struct.lzss_io* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.lzss*
%6 = alloca %struct.lzss_io*
%7 = alloca i32
store %struct.lzss* %0, %struct.lzss** %5
store %struct.lzss_io* %1, %struct.lzss_io** %6
store i32 %2, i32* %7
%8 = load %struct.lzss*, %struct.lzss** %5
%9 = load %struct.lzss_io*, %struct.lzss_io** %6
%10 = call i64 @putbit1(%struct.lzss* %8, %struct.lzss_io* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 -1, i32* %4
br label %21
13: ; preds = %3
%14 = load %struct.lzss*, %struct.lzss** %5
%15 = load %struct.lzss_io*, %struct.lzss_io** %6
%16 = load i32, i32* %7
%17 = call i64 @output_word(%struct.lzss* %14, %struct.lzss_io* %15, i32 256, i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %13
store i32 -1, i32* %4
br label %21
20: ; preds = %13
store i32 0, i32* %4
br label %21
21: ; preds = %20, %19, %12
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
%struct.lzss = type { i32 }
%struct.lzss_io = type { i32 }
define i32 @output1(%struct.lzss* %0, %struct.lzss_io* %1, i32 %2) {
%4 = tail call i64 @putbit1(%struct.lzss* %0, %struct.lzss_io* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @output_word(%struct.lzss* %0, %struct.lzss_io* %1, i32 256, i32 %2)
%8 = icmp ne i64 %7, 0
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ -1, %3 ], [ %9, %6 ]
ret i32 %11
}