#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*/ exit(int);
int /*<<< orphan*/ inswap_le32_num(unsigned int *, int);
int /*<<< orphan*/ progressbar_error(char *, long long, unsigned int);
int read_inode_data(unsigned int *, long long *, unsigned int *, int);
void read_block_list(unsigned int *block_list, long long start,
                     unsigned int offset, int blocks) {
  int res;
  ;
  res = read_inode_data(block_list, &start, &offset,
                        blocks * sizeof(unsigned int));
  if (res == 0)
    do {
      progressbar_error("FATAL ERROR: "
                        "read_block_list: failed to read "
                        "inode index %lld:%d\n",
                        start, offset);
      exit(1);
    } while (0);
  inswap_le32_num(block_list, blocks);
}


x86 assembly (clang, -O0):
<read_block_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%ecx
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1060 <read_inode_data@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    11a0 <read_block_list+0x60>
jmp    1183 <read_block_list+0x43>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe6f(%rip),%rdi
call   1040 <progressbar_error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <inswap_le32_num@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_block_list>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r14d
mov    %rdi,%rbx
mov    %rsi,0x10(%rsp)
mov    %edx,0xc(%rsp)
lea    0x0(,%r14,4),%ecx
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1060 <read_inode_data@plt>
test   %eax,%eax
je     1184 <read_block_list+0x44>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <inswap_le32_num@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret
mov    0x10(%rsp),%rsi
mov    0xc(%rsp),%edx
lea    0xe6c(%rip),%rdi
call   1040 <progressbar_error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [66 x i8] c"FATAL ERROR: read_block_list: failed to read inode index %lld:%d\0A\00"
define void @read_block_list(i32* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %8
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i32 @read_inode_data(i32* %10, i64* %6, i32* %7, i32 %14)
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %4
br label %19
19: ; preds = %18
%20 = load i64, i64* %6
%21 = load i32, i32* %7
%22 = call i32 @progressbar_error(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i64 %20, i32 %21)
%23 = call i32 @exit(i32 1)
unreachable
24: ; No predecessors!
br label %25
25: ; preds = %24, %4
%26 = load i32*, i32** %5
%27 = load i32, i32* %8
%28 = call i32 @inswap_le32_num(i32* %26, i32 %27)
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"FATAL ERROR: read_block_list: failed to read inode index %lld:%d\0A\00"
define void @read_block_list(i32* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i64
%6 = alloca i32
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = shl i32 %3, 2
%8 = call i32 @read_inode_data(i32* %0, i64* %5, i32* %6, i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %4
%11 = load i64, i64* %5
%12 = load i32, i32* %6
%13 = call i32 @progressbar_error(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i64 %11, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %4
%16 = call i32 @inswap_le32_num(i32* %0, i32 %3)
ret void
}