#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 uint8_t;
typedef int uint64_t;
typedef int loff_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int resp_read_position_long(loff_t pos, uint8_t *buf, uint8_t *sam_stat) {
  uint64_t partition = 1L;
  ;
  memset(buf, 0, 32);
  if ((pos == 0) || (pos == 1))
    buf[0] = 0x80;
  buf[4] = (partition >> 24);
  buf[5] = (partition >> 16);
  buf[6] = (partition >> 8);
  buf[7] = partition;
  buf[8] = buf[9] = (pos >> 16);
  buf[6] = buf[10] = (pos >> 8);
  buf[7] = buf[11] = pos;
  return 32;
}


x86 assembly (clang, -O0):
<resp_read_position_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
cmpl   $0x0,-0x4(%rbp)
je     114e <resp_read_position_long+0x3e>
cmpl   $0x1,-0x4(%rbp)
jne    1158 <resp_read_position_long+0x48>
mov    -0x10(%rbp),%rax
movl   $0x80,(%rax)
mov    -0x1c(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x1c(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x1c(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x24(%rax)
mov    -0x10(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x28(%rax)
mov    -0x10(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x2c(%rax)
mov    -0x10(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    $0x20,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resp_read_position_long>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
cmp    $0x1,%ebp
ja     1132 <resp_read_position_long+0x22>
movl   $0x80,(%rbx)
movq   $0x0,0x10(%rbx)
mov    %ebp,%eax
sar    $0x10,%eax
mov    %eax,0x24(%rbx)
mov    %eax,0x20(%rbx)
mov    %ebp,%eax
sar    $0x8,%eax
mov    %eax,0x28(%rbx)
mov    %eax,0x18(%rbx)
mov    %ebp,0x2c(%rbx)
mov    %ebp,0x1c(%rbx)
mov    $0x20,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @resp_read_position_long(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 1, i32* %7
%8 = load i32*, i32** %5
%9 = call i32 @memset(i32* %8, i32 0, i32 32)
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %3
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %12, %3
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 0
store i32 128, i32* %17
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %7
%20 = ashr i32 %19, 24
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 4
store i32 %20, i32* %22
%23 = load i32, i32* %7
%24 = ashr i32 %23, 16
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 5
store i32 %24, i32* %26
%27 = load i32, i32* %7
%28 = ashr i32 %27, 8
%29 = load i32*, i32** %5
%30 = getelementptr inbounds i32, i32* %29, i64 6
store i32 %28, i32* %30
%31 = load i32, i32* %7
%32 = load i32*, i32** %5
%33 = getelementptr inbounds i32, i32* %32, i64 7
store i32 %31, i32* %33
%34 = load i32, i32* %4
%35 = ashr i32 %34, 16
%36 = load i32*, i32** %5
%37 = getelementptr inbounds i32, i32* %36, i64 9
store i32 %35, i32* %37
%38 = load i32*, i32** %5
%39 = getelementptr inbounds i32, i32* %38, i64 8
store i32 %35, i32* %39
%40 = load i32, i32* %4
%41 = ashr i32 %40, 8
%42 = load i32*, i32** %5
%43 = getelementptr inbounds i32, i32* %42, i64 10
store i32 %41, i32* %43
%44 = load i32*, i32** %5
%45 = getelementptr inbounds i32, i32* %44, i64 6
store i32 %41, i32* %45
%46 = load i32, i32* %4
%47 = load i32*, i32** %5
%48 = getelementptr inbounds i32, i32* %47, i64 11
store i32 %46, i32* %48
%49 = load i32*, i32** %5
%50 = getelementptr inbounds i32, i32* %49, i64 7
store i32 %46, i32* %50
ret i32 32
}

LLVM IR (-O2):
define i32 @resp_read_position_long(i32 %0, i32* %1, i32* nocapture readnone %2) {
%4 = tail call i32 @memset(i32* %1, i32 0, i32 32)
%5 = icmp ult i32 %0, 2
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 128, i32* %1
br label %7
7: ; preds = %3, %6
%8 = getelementptr inbounds i32, i32* %1, i64 4
store i32 0, i32* %8
%9 = getelementptr inbounds i32, i32* %1, i64 5
store i32 0, i32* %9
%10 = getelementptr inbounds i32, i32* %1, i64 6
%11 = getelementptr inbounds i32, i32* %1, i64 7
%12 = ashr i32 %0, 16
%13 = getelementptr inbounds i32, i32* %1, i64 9
store i32 %12, i32* %13
%14 = getelementptr inbounds i32, i32* %1, i64 8
store i32 %12, i32* %14
%15 = ashr i32 %0, 8
%16 = getelementptr inbounds i32, i32* %1, i64 10
store i32 %15, i32* %16
store i32 %15, i32* %10
%17 = getelementptr inbounds i32, i32* %1, i64 11
store i32 %0, i32* %17
store i32 %0, i32* %11
ret i32 32
}