#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*/ assert(int);
char lzmadec_header_properties(unsigned char *pb, unsigned char *lp,
                               unsigned char *lc, const unsigned char c) {
  if (c > (9 * 5 * 5))
    return -1;
  *pb = c / (9 * 5);
  *lp = (c % (9 * 5)) / 9;
  *lc = c % 9;
  assert(*pb < 5 && *lp < 5 && *lc < 9);
  return 0;
}


x86 assembly (clang, -O0):
<lzmadec_header_properties>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%eax
cmp    $0xe1,%eax
jle    1141 <lzmadec_header_properties+0x31>
movb   $0xff,-0x1(%rbp)
jmp    11d2 <lzmadec_header_properties+0xc2>
movzbl -0x21(%rbp),%eax
mov    $0x2d,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x21(%rbp),%eax
mov    $0x2d,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movzbl -0x21(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
mov    %al,-0x22(%rbp)
jge    11c1 <lzmadec_header_properties+0xb1>
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
mov    %al,-0x22(%rbp)
jge    11c1 <lzmadec_header_properties+0xb1>
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x9,%eax
setl   %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lzmadec_header_properties>:
mov    $0xff,%al
cmp    $0xe1,%cl
ja     1177 <lzmadec_header_properties+0x67>
push   %rax
movzbl %cl,%r8d
imul   $0x6d,%r8d,%r9d
shr    $0x8,%r9d
mov    %ecx,%eax
sub    %r9b,%al
shr    %al
add    %r9b,%al
shr    $0x5,%al
mov    %al,(%rdi)
movzbl %al,%eax
lea    (%rax,%rax,8),%eax
lea    (%rax,%rax,4),%r9d
mov    %ecx,%eax
sub    %r9b,%al
movzbl %al,%eax
imul   $0x39,%eax,%eax
shr    $0x9,%eax
mov    %al,(%rsi)
imul   $0x39,%r8d,%eax
shr    $0x9,%eax
lea    (%rax,%rax,8),%eax
sub    %al,%cl
mov    %cl,(%rdx)
xor    %eax,%eax
cmpb   $0x4,(%rdi)
ja     116a <lzmadec_header_properties+0x5a>
xor    %eax,%eax
cmpb   $0x5,(%rsi)
setb   %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define signext i8 @lzmadec_header_properties(i8* %0, i8* %1, i8* %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8 %3, i8* %9
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = icmp sgt i32 %11, 225
br i1 %12, label %13, label %14
13: ; preds = %4
store i8 -1, i8* %5
br label %49
14: ; preds = %4
%15 = load i8, i8* %9
%16 = zext i8 %15 to i32
%17 = sdiv i32 %16, 45
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %6
store i8 %18, i8* %19
%20 = load i8, i8* %9
%21 = zext i8 %20 to i32
%22 = srem i32 %21, 45
%23 = sdiv i32 %22, 9
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %7
store i8 %24, i8* %25
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = srem i32 %27, 9
%29 = trunc i32 %28 to i8
%30 = load i8*, i8** %8
store i8 %29, i8* %30
%31 = load i8*, i8** %6
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = icmp slt i32 %33, 5
br i1 %34, label %35, label %45
35: ; preds = %14
%36 = load i8*, i8** %7
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = icmp slt i32 %38, 5
br i1 %39, label %40, label %45
40: ; preds = %35
%41 = load i8*, i8** %8
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = icmp slt i32 %43, 9
br label %45
45: ; preds = %40, %35, %14
%46 = phi i1 [ false, %35 ], [ false, %14 ], [ %44, %40 ]
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
store i8 0, i8* %5
br label %49
49: ; preds = %45, %13
%50 = load i8, i8* %5
ret i8 %50
}

LLVM IR (-O2):
define signext i8 @lzmadec_header_properties(i8* nocapture %0, i8* nocapture %1, i8* nocapture writeonly %2, i8 zeroext %3) {
%5 = icmp ugt i8 %3, -31
br i1 %5, label %20, label %6
6: ; preds = %4
%7 = udiv i8 %3, 45
store i8 %7, i8* %0
%8 = urem i8 %3, 45
%9 = udiv i8 %8, 9
store i8 %9, i8* %1
%10 = urem i8 %3, 9
store i8 %10, i8* %2
%11 = load i8, i8* %0
%12 = icmp ult i8 %11, 5
br i1 %12, label %13, label %17
13: ; preds = %6
%14 = load i8, i8* %1
%15 = icmp ult i8 %14, 5
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %13, %6
%18 = phi i32 [ 0, %6 ], [ %16, %13 ]
%19 = tail call i32 @assert(i32 %18)
br label %20
20: ; preds = %4, %17
%21 = phi i8 [ 0, %17 ], [ -1, %4 ]
ret i8 %21
}