#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*/ printf(char *, unsigned char, unsigned char, unsigned char,
                          unsigned char, unsigned char, unsigned char,
                          unsigned char, unsigned char, unsigned char,
                          unsigned char, unsigned char, unsigned char,
                          unsigned char, unsigned char, unsigned char,
                          unsigned char);
void print_sector(unsigned char *sector) {
  int i;
  for (i = 0; i < (512 - 8); i += 8) {
    printf(" %02x%02x%02x%02x %02x%02x%02x%02x        %c%c%c%c %c%c%c%c\n",
           sector[i], sector[i + 1], sector[i + 2], sector[i + 3],
           sector[i + 4], sector[i + 5], sector[i + 6], sector[i + 7],
           sector[i], sector[i + 1], sector[i + 2], sector[i + 3],
           sector[i + 4], sector[i + 5], sector[i + 6], sector[i + 7]);
  }
}


x86 assembly (clang, -O0):
<print_sector>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdi,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x1f8,-0x34(%rbp)
jge    12e9 <print_sector+0x1d9>
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,1),%sil
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%edi
add    $0x3,%edi
movslq %edi,%rdi
mov    (%rax,%rdi,1),%r8b
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%edi
add    $0x4,%edi
movslq %edi,%rdi
mov    (%rax,%rdi,1),%r9b
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%edi
add    $0x5,%edi
movslq %edi,%rdi
mov    (%rax,%rdi,1),%al
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%r10d
add    $0x6,%r10d
movslq %r10d,%r10
mov    (%rdi,%r10,1),%dil
mov    %dil,-0x43(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%r10d
add    $0x7,%r10d
movslq %r10d,%r10
mov    (%rdi,%r10,1),%dil
mov    %dil,-0x42(%rbp)
mov    -0x30(%rbp),%rdi
movslq -0x34(%rbp),%r10
mov    (%rdi,%r10,1),%dil
mov    %dil,-0x41(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%r10d
add    $0x1,%r10d
movslq %r10d,%r10
mov    (%rdi,%r10,1),%r13b
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%r10d
add    $0x2,%r10d
movslq %r10d,%r10
mov    (%rdi,%r10,1),%r12b
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%r10d
add    $0x3,%r10d
movslq %r10d,%r10
mov    (%rdi,%r10,1),%r15b
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%r10d
add    $0x4,%r10d
movslq %r10d,%r10
mov    (%rdi,%r10,1),%r14b
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%r10d
add    $0x5,%r10d
movslq %r10d,%r10
mov    (%rdi,%r10,1),%bl
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%r10d
add    $0x6,%r10d
movslq %r10d,%r10
mov    (%rdi,%r10,1),%r11b
mov    -0x30(%rbp),%rdi
mov    %rdi,-0x40(%rbp)
mov    -0x34(%rbp),%edi
add    $0x7,%edi
movslq %edi,%r10
lea    0xda1(%rip),%rdi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %al,%eax
mov    %eax,(%rsp)
mov    -0x43(%rbp),%al
movzbl %al,%eax
mov    %eax,0x8(%rsp)
mov    -0x42(%rbp),%al
movzbl %al,%eax
mov    %eax,0x10(%rsp)
mov    -0x41(%rbp),%al
movzbl %al,%eax
mov    %eax,0x18(%rsp)
mov    -0x40(%rbp),%rax
movzbl %r13b,%r13d
mov    %r13d,0x20(%rsp)
movzbl %r12b,%r12d
mov    %r12d,0x28(%rsp)
movzbl %r15b,%r15d
mov    %r15d,0x30(%rsp)
movzbl %r14b,%r14d
mov    %r14d,0x38(%rsp)
movzbl %bl,%ebx
mov    %ebx,0x40(%rsp)
movzbl %r11b,%r11d
mov    %r11d,0x48(%rsp)
movzbl (%rax,%r10,1),%eax
mov    %eax,0x50(%rsp)
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x34(%rbp)
jmp    112c <print_sector+0x1c>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sector>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    $0xfffffffffffffff8,%rbx
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
movzbl 0x8(%r15,%rbx,1),%esi
movzbl 0x9(%r15,%rbx,1),%edx
movzbl 0xa(%r15,%rbx,1),%ecx
movzbl 0xb(%r15,%rbx,1),%r8d
movzbl 0xc(%r15,%rbx,1),%r9d
movzbl 0xd(%r15,%rbx,1),%r10d
movzbl 0xe(%r15,%rbx,1),%r11d
movzbl 0xf(%r15,%rbx,1),%eax
sub    $0x8,%rsp
mov    %r14,%rdi
push   %rax
push   %r11
push   %r10
push   %r9
push   %r8
push   %rcx
push   %rdx
push   %rsi
push   %rax
push   %r11
push   %r10
call   1030 <printf@plt>
add    $0x60,%rsp
add    $0x8,%rbx
cmp    $0x1f0,%rbx
jb     1130 <print_sector+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [61 x i8] c" %02x%02x%02x%02x %02x%02x%02x%02x %c%c%c%c %c%c%c%c\0A\00"
define void @print_sector(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %103, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 504
br i1 %6, label %7, label %106
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8, i8* %23
%25 = load i8*, i8** %2
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %25, i64 %28
%30 = load i8, i8* %29
%31 = load i8*, i8** %2
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %31, i64 %34
%36 = load i8, i8* %35
%37 = load i8*, i8** %2
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 5
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %37, i64 %40
%42 = load i8, i8* %41
%43 = load i8*, i8** %2
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 6
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %43, i64 %46
%48 = load i8, i8* %47
%49 = load i8*, i8** %2
%50 = load i32, i32* %3
%51 = add nsw i32 %50, 7
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %49, i64 %52
%54 = load i8, i8* %53
%55 = load i8*, i8** %2
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %55, i64 %57
%59 = load i8, i8* %58
%60 = load i8*, i8** %2
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %60, i64 %63
%65 = load i8, i8* %64
%66 = load i8*, i8** %2
%67 = load i32, i32* %3
%68 = add nsw i32 %67, 2
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8, i8* %66, i64 %69
%71 = load i8, i8* %70
%72 = load i8*, i8** %2
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 3
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8, i8* %72, i64 %75
%77 = load i8, i8* %76
%78 = load i8*, i8** %2
%79 = load i32, i32* %3
%80 = add nsw i32 %79, 4
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %78, i64 %81
%83 = load i8, i8* %82
%84 = load i8*, i8** %2
%85 = load i32, i32* %3
%86 = add nsw i32 %85, 5
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %84, i64 %87
%89 = load i8, i8* %88
%90 = load i8*, i8** %2
%91 = load i32, i32* %3
%92 = add nsw i32 %91, 6
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %90, i64 %93
%95 = load i8, i8* %94
%96 = load i8*, i8** %2
%97 = load i32, i32* %3
%98 = add nsw i32 %97, 7
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8, i8* %96, i64 %99
%101 = load i8, i8* %100
%102 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8 zeroext %12, i8 zeroext %18, i8 zeroext %24, i8 zeroext %30, i8 zeroext %36, i8 zeroext %42, i8 zeroext %48, i8 zeroext %54, i8 zeroext %59, i8 zeroext %65, i8 zeroext %71, i8 zeroext %77, i8 zeroext %83, i8 zeroext %89, i8 zeroext %95, i8 zeroext %101)
br label %103
103: ; preds = %7
%104 = load i32, i32* %3
%105 = add nsw i32 %104, 8
store i32 %105, i32* %3
br label %4
106: ; preds = %4
ret void
}

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