#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*/ fprintf(int /*<<< orphan*/, char *, char *, char *, long,
                           long, int, int, int);
int /*<<< orphan*/ run_sequential_one(char *, int, int, long, char *, long, int,
                                      int, int, int, long);
int /*<<< orphan*/ stderr;
int run_sequential_all(char *label, int writeops, int fd, long fsize, char *buf,
                       long msize, int alignment, int direct, int max_seconds,
                       int timeofday_latency) {
  long iosize;
  fprintf(stderr,
          "= %s SEQ %-6s "
          "(fsize=%ld,msize=%ld,alignment=%d,direct=%d,max_seconds=%d)\n",
          label, writeops ? "WRONLY" : "RDONLY", fsize, msize, alignment,
          direct, max_seconds);
  for (iosize = alignment; iosize <= msize; iosize <<= 1) {
    if (!run_sequential_one(label, writeops, fd, fsize, buf, msize, alignment,
                            direct, max_seconds, timeofday_latency, iosize))
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<run_sequential_all>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %edx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%esi
lea    0xeee(%rip),%rcx
lea    0xee0(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
mov    -0x30(%rbp),%r8
mov    -0x40(%rbp),%r9
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%eax
lea    0xe74(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1040 <fprintf@plt>
movslq 0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x40(%rbp),%rax
jg     1224 <run_sequential_all+0x104>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x40(%rbp),%r9
mov    0x10(%rbp),%r14d
mov    0x18(%rbp),%ebx
mov    0x20(%rbp),%r11d
mov    0x28(%rbp),%r10d
mov    -0x48(%rbp),%rax
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <run_sequential_one@plt>
cmp    $0x0,%eax
jne    120e <run_sequential_all+0xee>
movl   $0x0,-0x14(%rbp)
jmp    122b <run_sequential_all+0x10b>
jmp    1213 <run_sequential_all+0xf3>
mov    -0x48(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    11a6 <run_sequential_all+0x86>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_sequential_all>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%rbx
mov    %r8,(%rsp)
mov    %rcx,%r15
mov    %edx,%r12d
mov    %esi,%r13d
mov    %rdi,%rbp
mov    0x50(%rsp),%r10d
mov    0x48(%rsp),%r11d
mov    0x40(%rsp),%r14d
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
test   %esi,%esi
lea    0xef3(%rip),%rax
lea    0xee5(%rip),%rcx
cmove  %rax,%rcx
sub    $0x8,%rsp
lea    0xe8b(%rip),%rsi
mov    %rbp,%rdx
mov    %r15,%r8
push   %r10
push   %r11
push   %r14
call   1040 <fprintf@plt>
add    $0x20,%rsp
movslq %r14d,%r14
mov    $0x1,%eax
cmp    %rbx,%r14
jg     11ec <run_sequential_all+0xcc>
nopw   0x0(%rax,%rax,1)
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %r13d,%esi
mov    %r12d,%edx
mov    %r15,%rcx
mov    0x8(%rsp),%r8
mov    %rbx,%r9
push   %r14
mov    0x68(%rsp),%eax
push   %rax
mov    0x68(%rsp),%eax
push   %rax
mov    0x68(%rsp),%eax
push   %rax
mov    0x68(%rsp),%eax
push   %rax
call   1030 <run_sequential_one@plt>
add    $0x30,%rsp
test   %eax,%eax
je     11ea <run_sequential_all+0xca>
add    %r14,%r14
cmp    %rbx,%r14
jle    11a0 <run_sequential_all+0x80>
mov    $0x1,%eax
jmp    11ec <run_sequential_all+0xcc>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"= %s SEQ %-6s (fsize=%ld,msize=%ld,alignment=%d,direct=%d,max_seconds=%d)\0A\00"
@.str.1 = [7 x i8] c"WRONLY\00"
@.str.2 = [7 x i8] c"RDONLY\00"
define i32 @run_sequential_all(i8* %0, i32 %1, i32 %2, i64 %3, i8* %4, i64 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i64
store i8* %0, i8** %12
store i32 %1, i32* %13
store i32 %2, i32* %14
store i64 %3, i64* %15
store i8* %4, i8** %16
store i64 %5, i64* %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32 %8, i32* %20
store i32 %9, i32* %21
%23 = load i32, i32* @stderr
%24 = load i8*, i8** %12
%25 = load i32, i32* %13
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%29 = load i64, i64* %15
%30 = load i64, i64* %17
%31 = load i32, i32* %18
%32 = load i32, i32* %19
%33 = load i32, i32* %20
%34 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %24, i8* %28, i64 %29, i64 %30, i32 %31, i32 %32, i32 %33)
%35 = load i32, i32* %18
%36 = sext i32 %35 to i64
store i64 %36, i64* %22
br label %37
37: ; preds = %57, %10
%38 = load i64, i64* %22
%39 = load i64, i64* %17
%40 = icmp sle i64 %38, %39
br i1 %40, label %41, label %60
41: ; preds = %37
%42 = load i8*, i8** %12
%43 = load i32, i32* %13
%44 = load i32, i32* %14
%45 = load i64, i64* %15
%46 = load i8*, i8** %16
%47 = load i64, i64* %17
%48 = load i32, i32* %18
%49 = load i32, i32* %19
%50 = load i32, i32* %20
%51 = load i32, i32* %21
%52 = load i64, i64* %22
%53 = call i32 @run_sequential_one(i8* %42, i32 %43, i32 %44, i64 %45, i8* %46, i64 %47, i32 %48, i32 %49, i32 %50, i32 %51, i64 %52)
%54 = icmp ne i32 %53, 0
br i1 %54, label %56, label %55
55: ; preds = %41
store i32 0, i32* %11
br label %61
56: ; preds = %41
br label %57
57: ; preds = %56
%58 = load i64, i64* %22
%59 = shl i64 %58, 1
store i64 %59, i64* %22
br label %37
60: ; preds = %37
store i32 1, i32* %11
br label %61
61: ; preds = %60, %55
%62 = load i32, i32* %11
ret i32 %62
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"= %s SEQ %-6s (fsize=%ld,msize=%ld,alignment=%d,direct=%d,max_seconds=%d)\0A\00"
@.str.1 = [7 x i8] c"WRONLY\00"
@.str.2 = [7 x i8] c"RDONLY\00"
define i32 @run_sequential_all(i8* %0, i32 %1, i32 %2, i64 %3, i8* %4, i64 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = load i32, i32* @stderr
%12 = icmp eq i32 %1, 0
%13 = select i1 %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%14 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %13, i64 %3, i64 %5, i32 %6, i32 %7, i32 %8)
%15 = sext i32 %6 to i64
%16 = icmp sgt i64 %15, %5
br i1 %16, label %24, label %19
17: ; preds = %19
%18 = icmp sgt i64 %23, %5
br i1 %18, label %24, label %19
19: ; preds = %10, %17
%20 = phi i64 [ %23, %17 ], [ %15, %10 ]
%21 = tail call i32 @run_sequential_one(i8* %0, i32 %1, i32 %2, i64 %3, i8* %4, i64 %5, i32 %6, i32 %7, i32 %8, i32 %9, i64 %20)
%22 = icmp eq i32 %21, 0
%23 = shl i64 %20, 1
br i1 %22, label %24, label %17
24: ; preds = %19, %17, %10
%25 = phi i32 [ 1, %10 ], [ 1, %17 ], [ 0, %19 ]
ret i32 %25
}