#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 *);
int /*<<< orphan*/ print_run(char *, char *, char *, char const *, size_t, int,
                             unsigned int);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int, ...);
int /*<<< orphan*/ stderr;
void csvcut_csvkit(const char *restrict buffer, size_t buffer_size,
                   unsigned int buffer_copy, unsigned int repeats,
                   unsigned int columns) {
  (void)buffer_copy;
  fprintf(stderr, "Running csvkit csvcut\n");
  print_run("csvkit csvcut", "first column",
            "python bench/csvkit-csvcut.py -c column1 > /dev/null", buffer,
            buffer_size, 1, repeats);
  char command[255];
  sprintf(command, "python bench/csvkit-csvcut.py -c column%u > /dev/null",
          columns / 2);
  print_run("csvkit csvcut", "middle column", command, buffer, buffer_size, 1,
            repeats);
  sprintf(command, "python bench/csvkit-csvcut.py -c column%u > /dev/null",
          columns);
  print_run("csvkit csvcut", "last column", command, buffer, buffer_size, 1,
            repeats);
  sprintf(command,
          "python bench/csvkit-csvcut.py -c column%u,column%u > /dev/null",
          columns - 3, columns - 2);
  print_run("csvkit csvcut", "two adjoining column", command, buffer,
            buffer_size, 1, repeats);
  sprintf(command,
          "python bench/csvkit-csvcut.py -c column%u,column%u > /dev/null",
          columns / 2, columns - 1);
  print_run("csvkit csvcut", "two distinct column", command, buffer,
            buffer_size, 1, repeats);
}


x86 assembly (clang, -O0):
<csvcut_csvkit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%eax
lea    0xea3(%rip),%rdi
lea    0xeaa(%rip),%rsi
lea    0xeb0(%rip),%rdx
mov    $0x1,%r9d
mov    %eax,(%rsp)
call   1040 <print_run@plt>
lea    -0x120(%rbp),%rdi
mov    -0x1c(%rbp),%edx
shr    $0x1,%edx
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x120(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%eax
lea    0xe53(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x1,%r9d
mov    %eax,(%rsp)
call   1040 <print_run@plt>
lea    -0x120(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xe7d(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x120(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%eax
lea    0xe0d(%rip),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x1,%r9d
mov    %eax,(%rsp)
call   1040 <print_run@plt>
lea    -0x120(%rbp),%rdi
mov    -0x1c(%rbp),%edx
sub    $0x3,%edx
mov    -0x1c(%rbp),%ecx
sub    $0x2,%ecx
lea    0xe7e(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x120(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%eax
lea    0xdbe(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x1,%r9d
mov    %eax,(%rsp)
call   1040 <print_run@plt>
lea    -0x120(%rbp),%rdi
mov    -0x1c(%rbp),%edx
shr    $0x1,%edx
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
lea    0xe2f(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x120(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%eax
lea    0xd6f(%rip),%rdi
lea    0xe5c(%rip),%rsi
mov    $0x1,%r9d
mov    %eax,(%rsp)
call   1040 <print_run@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csvcut_csvkit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %r8d,%ebx
mov    %ecx,%r15d
mov    %rsi,%rbp
mov    %rsi,0x8(%rsp)
mov    %rdi,%r14
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    %r15d,(%rsp)
lea    0xea5(%rip),%rdi
lea    0xeac(%rip),%rsi
lea    0xeb2(%rip),%rdx
mov    %r14,%rcx
mov    %rbp,%r8
mov    $0x1,%r9d
call   1040 <print_run@plt>
mov    %ebx,%r12d
shr    %r12d
lea    0xec9(%rip),%rsi
lea    0x10(%rsp),%r13
mov    %r13,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r15d,(%rsp)
lea    0xee2(%rip),%rsi
lea    0xe55(%rip),%rdi
mov    %r13,%rdx
mov    %r14,%rbp
mov    %r14,%rcx
mov    0x8(%rsp),%r14
mov    %r14,%r8
mov    $0x1,%r9d
call   1040 <print_run@plt>
mov    %r13,%rdi
lea    0xe7f(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r15d,(%rsp)
lea    0xeaf(%rip),%rsi
lea    0xe14(%rip),%rdi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
mov    $0x1,%r9d
call   1040 <print_run@plt>
lea    -0x3(%rbx),%edx
lea    -0x2(%rbx),%ecx
lea    0xe93(%rip),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r15d,(%rsp)
lea    0xebd(%rip),%rsi
lea    0xdd7(%rip),%rdi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
mov    $0x1,%r9d
call   1040 <print_run@plt>
add    $0xffffffff,%ebx
mov    %r13,%rdi
lea    0xe56(%rip),%rsi
mov    %r12d,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r15d,(%rsp)
lea    0xe93(%rip),%rsi
lea    0xd98(%rip),%rdi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
mov    $0x1,%r9d
call   1040 <print_run@plt>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Running csvkit csvcut\0A\00"
@.str.1 = [14 x i8] c"csvkit csvcut\00"
@.str.2 = [13 x i8] c"first column\00"
@.str.3 = [53 x i8] c"python bench/csvkit-csvcut.py -c column1 > /dev/null\00"
@.str.4 = [54 x i8] c"python bench/csvkit-csvcut.py -c column%u > /dev/null\00"
@.str.5 = [14 x i8] c"middle column\00"
@.str.6 = [12 x i8] c"last column\00"
@.str.7 = [63 x i8] c"python bench/csvkit-csvcut.py -c column%u,column%u > /dev/null\00"
@.str.8 = [21 x i8] c"two adjoining column\00"
@.str.9 = [20 x i8] c"two distinct column\00"
define void @csvcut_csvkit(i8* noalias %0, i64 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [255 x i8]
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %8
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %6
%16 = load i64, i64* %7
%17 = load i32, i32* %9
%18 = call i32 @print_run(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %15, i64 %16, i32 1, i32 %17)
%19 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%20 = load i32, i32* %10
%21 = udiv i32 %20, 2
%22 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %19, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%24 = load i8*, i8** %6
%25 = load i64, i64* %7
%26 = load i32, i32* %9
%27 = call i32 @print_run(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %23, i8* %24, i64 %25, i32 1, i32 %26)
%28 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%29 = load i32, i32* %10
%30 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %28, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%32 = load i8*, i8** %6
%33 = load i64, i64* %7
%34 = load i32, i32* %9
%35 = call i32 @print_run(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %31, i8* %32, i64 %33, i32 1, i32 %34)
%36 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%37 = load i32, i32* %10
%38 = sub i32 %37, 3
%39 = load i32, i32* %10
%40 = sub i32 %39, 2
%41 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %36, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0), i32 %38, i32 %40)
%42 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%43 = load i8*, i8** %6
%44 = load i64, i64* %7
%45 = load i32, i32* %9
%46 = call i32 @print_run(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %42, i8* %43, i64 %44, i32 1, i32 %45)
%47 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%48 = load i32, i32* %10
%49 = udiv i32 %48, 2
%50 = load i32, i32* %10
%51 = sub i32 %50, 1
%52 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %47, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0), i32 %49, i32 %51)
%53 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%54 = load i8*, i8** %6
%55 = load i64, i64* %7
%56 = load i32, i32* %9
%57 = call i32 @print_run(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i8* %53, i8* %54, i64 %55, i32 1, i32 %56)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Running csvkit csvcut\0A\00"
@.str.1 = [14 x i8] c"csvkit csvcut\00"
@.str.2 = [13 x i8] c"first column\00"
@.str.3 = [53 x i8] c"python bench/csvkit-csvcut.py -c column1 > /dev/null\00"
@.str.4 = [54 x i8] c"python bench/csvkit-csvcut.py -c column%u > /dev/null\00"
@.str.5 = [14 x i8] c"middle column\00"
@.str.6 = [12 x i8] c"last column\00"
@.str.7 = [63 x i8] c"python bench/csvkit-csvcut.py -c column%u,column%u > /dev/null\00"
@.str.8 = [21 x i8] c"two adjoining column\00"
@.str.9 = [20 x i8] c"two distinct column\00"
define void @csvcut_csvkit(i8* noalias %0, i64 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca [255 x i8]
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @print_run(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %0, i64 %1, i32 1, i32 %3)
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%11 = lshr i32 %4, 1
%12 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = call i32 @print_run(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %10, i8* %0, i64 %1, i32 1, i32 %3)
%14 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), i32 %4)
%15 = call i32 @print_run(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %10, i8* %0, i64 %1, i32 1, i32 %3)
%16 = add i32 %4, -3
%17 = add i32 %4, -2
%18 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0), i32 %16, i32 %17)
%19 = call i32 @print_run(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %10, i8* %0, i64 %1, i32 1, i32 %3)
%20 = add i32 %4, -1
%21 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0), i32 %11, i32 %20)
%22 = call i32 @print_run(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i8* %10, i8* %0, i64 %1, i32 1, i32 %3)
ret void
}