#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 scsi_request(char *, unsigned char *, int *, int, int /*<<< orphan*/, int,
                 int, int /*<<< orphan*/, unsigned char, unsigned char,
                 unsigned char, unsigned char, int /*<<< orphan*/,
                 unsigned char, unsigned char, int /*<<< orphan*/);
int read_10(int lba, int len, unsigned char *buf, int *buflen) {
  return scsi_request(
      "read_10", buf, buflen, 10, 0, 0x01, 0x28, 0,
      ((unsigned char)(((lba)) >> 24)), ((unsigned char)(((lba)) >> 16)),
      ((unsigned char)(((lba)) >> 8)), ((unsigned char)(lba)), 0,
      ((unsigned char)(((len)) >> 8)), ((unsigned char)(len)), 0);
}


x86 assembly (clang, -O0):
<read_10>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x1c(%rbp),%eax
sar    $0x18,%eax
mov    %al,%r15b
mov    -0x1c(%rbp),%eax
sar    $0x10,%eax
mov    %al,%r14b
mov    -0x1c(%rbp),%eax
sar    $0x8,%eax
mov    %al,%bl
mov    -0x1c(%rbp),%eax
mov    %al,%r11b
mov    -0x20(%rbp),%eax
sar    $0x8,%eax
mov    %al,%r10b
mov    -0x20(%rbp),%eax
lea    0xe9a(%rip),%rdi
mov    $0xa,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
movl   $0x28,(%rsp)
movl   $0x0,0x8(%rsp)
movzbl %r15b,%r15d
mov    %r15d,0x10(%rsp)
movzbl %r14b,%r14d
mov    %r14d,0x18(%rsp)
movzbl %bl,%ebx
mov    %ebx,0x20(%rsp)
movzbl %r11b,%r11d
mov    %r11d,0x28(%rsp)
movl   $0x0,0x30(%rsp)
movzbl %r10b,%r10d
mov    %r10d,0x38(%rsp)
movzbl %al,%eax
mov    %eax,0x40(%rsp)
movl   $0x0,0x48(%rsp)
call   1030 <scsi_request@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_10>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%eax
mov    %edi,%ebx
mov    %edi,%ebp
shr    $0x18,%ebp
mov    %edi,%esi
shr    $0x10,%esi
movzbl %al,%r10d
movzbl %ah,%eax
movzbl %bl,%r11d
movzbl %bh,%ebx
movzbl %sil,%r14d
lea    0xec5(%rip),%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    $0xa,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
push   $0x0
push   %r10
push   %rax
push   $0x0
push   %r11
push   %rbx
push   %r14
push   %rbp
push   $0x0
push   $0x28
call   1030 <scsi_request@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"read_10\00"
define i32 @read_10(i32 %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %7
%10 = load i32*, i32** %8
%11 = load i32, i32* %5
%12 = ashr i32 %11, 24
%13 = trunc i32 %12 to i8
%14 = load i32, i32* %5
%15 = ashr i32 %14, 16
%16 = trunc i32 %15 to i8
%17 = load i32, i32* %5
%18 = ashr i32 %17, 8
%19 = trunc i32 %18 to i8
%20 = load i32, i32* %5
%21 = trunc i32 %20 to i8
%22 = load i32, i32* %6
%23 = ashr i32 %22, 8
%24 = trunc i32 %23 to i8
%25 = load i32, i32* %6
%26 = trunc i32 %25 to i8
%27 = call i32 @scsi_request(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9, i32* %10, i32 10, i32 0, i32 1, i32 40, i32 0, i8 zeroext %13, i8 zeroext %16, i8 zeroext %19, i8 zeroext %21, i32 0, i8 zeroext %24, i8 zeroext %26, i32 0)
ret i32 %27
}

LLVM IR (-O2):
@.str = [8 x i8] c"read_10\00"
define i32 @read_10(i32 %0, i32 %1, i8* %2, i32* %3) {
%5 = lshr i32 %0, 24
%6 = trunc i32 %5 to i8
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = lshr i32 %0, 8
%10 = trunc i32 %9 to i8
%11 = trunc i32 %0 to i8
%12 = lshr i32 %1, 8
%13 = trunc i32 %12 to i8
%14 = trunc i32 %1 to i8
%15 = tail call i32 @scsi_request(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2, i32* %3, i32 10, i32 0, i32 1, i32 40, i32 0, i8 zeroext %6, i8 zeroext %8, i8 zeroext %10, i8 zeroext %11, i32 0, i8 zeroext %13, i8 zeroext %14, i32 0)
ret i32 %15
}