#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 uncompress2(unsigned char **);
void uncompress_location_values(unsigned char **buf, unsigned char *flag,
                                int *filenum, int *frequency) {
  unsigned char *p = *buf;
  *frequency = 0;
  *flag = *p++;
  if (!((*flag) & 0x80)) {
    *frequency = 1;
  } else
    (*frequency) |= (*flag) & 15;
  *filenum = uncompress2(&p);
  if (!(*frequency))
    *frequency = uncompress2(&p);
  *buf = p;
}


x86 assembly (clang, -O0):
<uncompress_location_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1178 <uncompress_location_values+0x68>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
jmp    118a <uncompress_location_values+0x7a>
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
and    $0xf,%ecx
mov    -0x20(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
lea    -0x28(%rbp),%rdi
call   1030 <uncompress2@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jne    11b9 <uncompress_location_values+0xa9>
lea    -0x28(%rbp),%rdi
call   1030 <uncompress2@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncompress_location_values>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rdi,%r14
mov    (%rdi),%rax
movl   $0x0,(%rcx)
lea    0x1(%rax),%rcx
mov    %rcx,0x8(%rsp)
movzbl (%rax),%eax
mov    %al,(%rsi)
mov    $0x1,%ecx
test   $0x80,%al
je     1149 <uncompress_location_values+0x39>
and    $0xf,%eax
or     (%rbx),%eax
mov    %eax,%ecx
mov    %ecx,(%rbx)
lea    0x8(%rsp),%rdi
call   1030 <uncompress2@plt>
mov    %eax,(%r15)
cmpl   $0x0,(%rbx)
jne    1169 <uncompress_location_values+0x59>
lea    0x8(%rsp),%rdi
call   1030 <uncompress2@plt>
mov    %eax,(%rbx)
mov    0x8(%rsp),%rax
mov    %rax,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @uncompress_location_values(i8** nocapture %0, i8* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture %3) {
%5 = alloca i8*
%6 = bitcast i8** %5 to i8*
%7 = load i8*, i8** %0
store i32 0, i32* %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %5
%9 = load i8, i8* %7
store i8 %9, i8* %1
%10 = zext i8 %9 to i32
%11 = and i32 %10, 128
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %4
%14 = and i32 %10, 15
%15 = load i32, i32* %3
%16 = or i32 %15, %14
br label %17
17: ; preds = %4, %13
%18 = phi i32 [ %16, %13 ], [ 1, %4 ]
store i32 %18, i32* %3
%19 = call i32 @uncompress2(i8** %5)
store i32 %19, i32* %2
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = call i32 @uncompress2(i8** %5)
store i32 %23, i32* %3
br label %24
24: ; preds = %22, %17
%25 = load i8*, i8** %5
store i8* %25, i8** %0
ret void
}