#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 */
typedef int __u16;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int, int);
void dump_sectors(__u16 *w, unsigned int count) {
  unsigned int i;
  for (i = 0; i < (count * 256 / 8); ++i) {
    printf("%04x %04x %04x %04x %04x %04x %04x %04x\n", w[0], w[1], w[2], w[3],
           w[4], w[5], w[6], w[7]);
    w += 8;
  }
}


x86 assembly (clang, -O0):
<dump_sectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
shr    $0x3,%ecx
cmp    %ecx,%eax
jae    11a8 <dump_sectors+0x98>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%r11d
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%r10d
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
lea    0xe84(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump_sectors+0x16>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sectors>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
shl    $0x5,%ebp
and    $0x1fffffe0,%ebp
je     1169 <dump_sectors+0x59>
mov    %rdi,%rbx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%ecx
mov    0xc(%rbx),%r8d
mov    0x10(%rbx),%r9d
mov    0x14(%rbx),%r10d
mov    0x18(%rbx),%r11d
mov    0x1c(%rbx),%eax
sub    $0x8,%rsp
mov    %r14,%rdi
push   %rax
push   %r11
push   %r10
call   1030 <printf@plt>
add    $0x20,%rsp
add    $0x20,%rbx
add    $0xffffffff,%ebp
jne    1130 <dump_sectors+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"%04x %04x %04x %04x %04x %04x %04x %04x\0A\00"
define void @dump_sectors(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %40, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = mul i32 %8, 256
%10 = udiv i32 %9, 8
%11 = icmp ult i32 %7, %10
br i1 %11, label %12, label %43
12: ; preds = %6
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 2
%21 = load i32, i32* %20
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 3
%24 = load i32, i32* %23
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 4
%27 = load i32, i32* %26
%28 = load i32*, i32** %3
%29 = getelementptr inbounds i32, i32* %28, i64 5
%30 = load i32, i32* %29
%31 = load i32*, i32** %3
%32 = getelementptr inbounds i32, i32* %31, i64 6
%33 = load i32, i32* %32
%34 = load i32*, i32** %3
%35 = getelementptr inbounds i32, i32* %34, i64 7
%36 = load i32, i32* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %18, i32 %21, i32 %24, i32 %27, i32 %30, i32 %33, i32 %36)
%38 = load i32*, i32** %3
%39 = getelementptr inbounds i32, i32* %38, i64 8
store i32* %39, i32** %3
br label %40
40: ; preds = %12
%41 = load i32, i32* %5
%42 = add i32 %41, 1
store i32 %42, i32* %5
br label %6
43: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"%04x %04x %04x %04x %04x %04x %04x %04x\0A\00"
define void @dump_sectors(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 5
%4 = and i32 %3, 536870880
%5 = icmp eq i32 %4, 0
br i1 %5, label %28, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %26, %6 ], [ 0, %2 ]
%8 = phi i32* [ %25, %6 ], [ %0, %2 ]
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %8, i64 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %8, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %8, i64 3
%15 = load i32, i32* %14
%16 = getelementptr inbounds i32, i32* %8, i64 4
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %8, i64 5
%19 = load i32, i32* %18
%20 = getelementptr inbounds i32, i32* %8, i64 6
%21 = load i32, i32* %20
%22 = getelementptr inbounds i32, i32* %8, i64 7
%23 = load i32, i32* %22
%24 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i32 %13, i32 %15, i32 %17, i32 %19, i32 %21, i32 %23)
%25 = getelementptr inbounds i32, i32* %8, i64 8
%26 = add nuw nsw i32 %7, 1
%27 = icmp eq i32 %26, %4
br i1 %27, label %28, label %6
28: ; preds = %6, %2
ret void
}