#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 parse_integer_table_from_buffer(int table[], int table_size,
                                     char *buffer) {
  int tmp, i;
  unsigned char *s = (unsigned char *)buffer;
  tmp = uncompress2(&s);
  for (i = 0; i < table_size; i++) {
    tmp = uncompress2(&s);
    table[i] = tmp - 1;
  }
}


x86 assembly (clang, -O0):
<parse_integer_table_from_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
call   1030 <uncompress2@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1175 <parse_integer_table_from_buffer+0x65>
lea    -0x28(%rbp),%rdi
call   1030 <uncompress2@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    113e <parse_integer_table_from_buffer+0x2e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_integer_table_from_buffer>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r15
mov    %rdx,(%rsp)
mov    %rsp,%rdi
call   1030 <uncompress2@plt>
test   %ebp,%ebp
jle    1158 <parse_integer_table_from_buffer+0x48>
mov    %ebp,%ebp
xor    %ebx,%ebx
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <uncompress2@plt>
add    $0xffffffff,%eax
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <parse_integer_table_from_buffer+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @parse_integer_table_from_buffer(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%10 = load i8*, i8** %6
store i8* %10, i8** %9
%11 = call i32 @uncompress2(i8** %9)
store i32 %11, i32* %7
store i32 0, i32* %8
br label %12
12: ; preds = %24, %3
%13 = load i32, i32* %8
%14 = load i32, i32* %5
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %27
16: ; preds = %12
%17 = call i32 @uncompress2(i8** %9)
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 %19, i32* %23
br label %24
24: ; preds = %16
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %12
27: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @parse_integer_table_from_buffer(i32* nocapture writeonly %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
store i8* %2, i8** %4
%6 = call i32 @uncompress2(i8** %4)
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %17
8: ; preds = %3
%9 = zext i32 %1 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %15, %10 ]
%12 = call i32 @uncompress2(i8** %4)
%13 = add nsw i32 %12, -1
%14 = getelementptr inbounds i32, i32* %0, i64 %11
store i32 %13, i32* %14
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %9
br i1 %16, label %17, label %10
17: ; preds = %10, %3
ret void
}