#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*/ DevReadBlock(int, char *);
int /*<<< orphan*/ printf(char *, ...);
void PrintDiskInfo(int start_blk, int end_blk) {
  int i;
  char buf[1024];
  printf("Disk block Info\n");
  for (i = start_blk; i <= end_blk; i++) {
    DevReadBlock(i, buf);
    printf("%d : %s ", i, buf);
  }
  printf("\n----------------------------------\n");
}


x86 assembly (clang, -O0):
<PrintDiskInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1186 <PrintDiskInfo+0x66>
mov    -0xc(%rbp),%edi
lea    -0x410(%rbp),%rsi
call   1040 <DevReadBlock@plt>
mov    -0xc(%rbp),%esi
lea    -0x410(%rbp),%rdx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <PrintDiskInfo+0x25>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintDiskInfo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
cmp    %r14d,%ebp
jg     1191 <PrintDiskInfo+0x61>
add    $0x1,%r14d
mov    %rsp,%rbx
lea    0xe9f(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <DevReadBlock@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1170 <PrintDiskInfo+0x40>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Disk block Info\0A\00"
@.str.1 = [9 x i8] c"%d : %s \00"
@.str.2 = [37 x i8] c"\0A----------------------------------\0A\00"
define void @PrintDiskInfo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [1024 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
store i32 %8, i32* %5
br label %9
9: ; preds = %20, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32, i32* %5
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%16 = call i32 @DevReadBlock(i32 %14, i8* %15)
%17 = load i32, i32* %5
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %17, i8* %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %9
23: ; preds = %9
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d : %s \00"
@str = [16 x i8] c"Disk block Info\00"
@str.3 = [36 x i8] c"\0A----------------------------------\00"
define void @PrintDiskInfo(i32 %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%6 = icmp sgt i32 %0, %1
br i1 %6, label %13, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %11, %7 ], [ %0, %2 ]
%9 = call i32 @DevReadBlock(i32 %8, i8* %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %8, i8* %4)
%11 = add i32 %8, 1
%12 = icmp eq i32 %8, %1
br i1 %12, label %13, label %7
13: ; preds = %7, %2
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.3, i64 0, i64 0))
ret void
}