#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 *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int test(int, char **, int);
int main(int argc, char **argv) {
  if (argc == 1 || (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) {
    printf("Usage: %s [file1name] [file2name] ...\n"
           "       Performance tests for iovec. Creates files with\n"
           "       given names, of 256MB, to get write/read speeds\n",
           argv[0]);
    return 0;
  }
  int i, r = 0;
  for (i = 0; i < 4; i++) {
    r = test(argc, argv, i);
    if (r) {
      break;
    }
  }
  return r;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     118a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     118a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe87(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11a9 <main+0x79>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11fb <main+0xcb>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    11f5 <main+0xc5>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <test@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11e2 <main+0xb2>
jmp    11f5 <main+0xc5>
jmp    11e7 <main+0xb7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b7 <main+0x87>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
cmp    $0x1,%edi
je     11b6 <main+0x86>
mov    %edi,%r14d
mov    0x8(%rbx),%rbp
lea    0xeb6(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11b6 <main+0x86>
lea    0xea6(%rip),%rsi
mov    %rbp,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11b6 <main+0x86>
mov    %r14d,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1050 <test@plt>
test   %eax,%eax
jne    11c7 <main+0x97>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1050 <test@plt>
test   %eax,%eax
jne    11c7 <main+0x97>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1050 <test@plt>
test   %eax,%eax
jne    11c7 <main+0x97>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x3,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <test@plt>
mov    (%rbx),%rsi
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [149 x i8] c"Usage: %s [file1name] [file2name] ...\0A Performance tests for iovec. Creates files with\0A given names, of 256MB, to get write/read speeds\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %22, label %10
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %10
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %27, label %22
22: ; preds = %16, %10, %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = call i32 @printf(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.2, i64 0, i64 0), i8* %25)
store i32 0, i32* %3
br label %45
27: ; preds = %16
store i32 0, i32* %7
store i32 0, i32* %6
br label %28
28: ; preds = %40, %27
%29 = load i32, i32* %6
%30 = icmp slt i32 %29, 4
br i1 %30, label %31, label %43
31: ; preds = %28
%32 = load i32, i32* %4
%33 = load i8**, i8*** %5
%34 = load i32, i32* %6
%35 = call i32 @test(i32 %32, i8** %33, i32 %34)
store i32 %35, i32* %7
%36 = load i32, i32* %7
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %31
br label %43
39: ; preds = %31
br label %40
40: ; preds = %39
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %28
43: ; preds = %38, %28
%44 = load i32, i32* %7
store i32 %44, i32* %3
br label %45
45: ; preds = %43, %22
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [149 x i8] c"Usage: %s [file1name] [file2name] ...\0A Performance tests for iovec. Creates files with\0A given names, of 256MB, to get write/read speeds\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = tail call i32 @test(i32 %0, i8** %1, i32 0)
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %26
15: ; preds = %9, %4, %2
%16 = load i8*, i8** %1
%17 = tail call i32 @printf(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.2, i64 0, i64 0), i8* %16)
br label %26
18: ; preds = %12
%19 = tail call i32 @test(i32 %0, i8** %1, i32 1)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = tail call i32 @test(i32 %0, i8** %1, i32 2)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 @test(i32 %0, i8** %1, i32 3)
br label %26
26: ; preds = %24, %12, %18, %21, %15
%27 = phi i32 [ 0, %15 ], [ %13, %12 ], [ %19, %18 ], [ %22, %21 ], [ %25, %24 ]
ret i32 %27
}