#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 /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ get_line(int /*<<< orphan*/ *, char **, int *);
int /*<<< orphan*/ printf(char *, ...);
void slit(FILE *fp, int n, int *col) {
  int i, nwords;
  char coltext[256][256];
  while (get_line(fp, coltext, &nwords) != EOF) {
    if (nwords > 0) {
      (void)printf("%s", coltext[col[0]]);
      for (i = 1; i < n; i++)
        (void)printf(" %s", coltext[col[i]]);
    }
    (void)printf("\n");
  }
}


x86 assembly (clang, -O0):
<slit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10020,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10020(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <get_line@plt>
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%rax
je     11e8 <slit+0xc8>
cmpl   $0x0,-0x20(%rbp)
jle    11d5 <slit+0xb5>
mov    -0x18(%rbp),%rax
movslq (%rax),%rax
lea    -0x10020(%rbp),%rsi
shl    $0x8,%rax
add    %rax,%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d0 <slit+0xb0>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movslq (%rax,%rcx,4),%rax
lea    -0x10020(%rbp),%rsi
shl    $0x8,%rax
add    %rax,%rsi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    118e <slit+0x6e>
jmp    11d5 <slit+0xb5>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1136 <slit+0x16>
add    $0x10020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10018,%rsp
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r12
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <get_line@plt>
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
jne    1177 <slit+0x47>
add    $0x10018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14d,%r13d
lea    0xe7f(%rip),%rbp
jmp    11b8 <slit+0x88>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r12,%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <get_line@plt>
mov    0x2e35(%rip),%rcx
cmp    (%rcx),%rax
je     1165 <slit+0x35>
cmpl   $0x0,0xc(%rsp)
jle    1190 <slit+0x60>
movslq (%rbx),%rax
shl    $0x8,%rax
lea    (%rsp,%rax,1),%rsi
add    $0x10,%rsi
lea    0xe2c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x2,%r14d
jl     1190 <slit+0x60>
mov    $0x1,%r15d
nopl   0x0(%rax,%rax,1)
movslq (%rbx,%r15,4),%rax
shl    $0x8,%rax
lea    (%rsp,%rax,1),%rsi
add    $0x10,%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r13
jne    11f0 <slit+0xc0>
jmp    1190 <slit+0x60>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c" %s\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @slit(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [256 x [256 x i8]]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
br label %10
10: ; preds = %46, %3
%11 = load i32*, i32** %4
%12 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %9, i64 0, i64 0
%13 = bitcast [256 x i8]* %12 to i8**
%14 = call i64 @get_line(i32* %11, i8** %13, i32* %8)
%15 = load i64, i64* @EOF
%16 = icmp ne i64 %14, %15
br i1 %16, label %17, label %48
17: ; preds = %10
%18 = load i32, i32* %8
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %46
20: ; preds = %17
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 0
%23 = load i32, i32* %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %9, i64 0, i64 %24
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %25, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %26)
store i32 1, i32* %7
br label %28
28: ; preds = %42, %20
%29 = load i32, i32* %7
%30 = load i32, i32* %5
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %45
32: ; preds = %28
%33 = load i32*, i32** %6
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %33, i64 %35
%37 = load i32, i32* %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %9, i64 0, i64 %38
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %39, i64 0, i64 0
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %40)
br label %42
42: ; preds = %32
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %28
45: ; preds = %28
br label %46
46: ; preds = %45, %17
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %10
48: ; preds = %10
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c" %s\00"
define void @slit(i32* %0, i32 %1, i32* nocapture %2) {
%4 = alloca i32
%5 = alloca [256 x [256 x i8]]
%6 = bitcast i32* %4 to i8*
%7 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %5, i64 0, i64 0, i64 0
%8 = bitcast [256 x [256 x i8]]* %5 to i8**
%9 = call i64 @get_line(i32* %0, i8** %8, i32* %4)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %37, label %12
12: ; preds = %3
%13 = icmp sgt i32 %1, 1
%14 = zext i32 %1 to i64
br label %15
15: ; preds = %12, %32
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %32
18: ; preds = %15
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %5, i64 0, i64 %20, i64 0
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %21)
br i1 %13, label %23, label %32
23: ; preds = %18, %23
%24 = phi i64 [ %30, %23 ], [ 1, %18 ]
%25 = getelementptr inbounds i32, i32* %2, i64 %24
%26 = load i32, i32* %25
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [256 x [256 x i8]], [256 x [256 x i8]]* %5, i64 0, i64 %27, i64 0
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = add nuw nsw i64 %24, 1
%31 = icmp eq i64 %30, %14
br i1 %31, label %32, label %23
32: ; preds = %23, %18, %15
%33 = call i32 @putchar(i32 10)
%34 = call i64 @get_line(i32* %0, i8** %8, i32* %4)
%35 = load i64, i64* @EOF
%36 = icmp eq i64 %34, %35
br i1 %36, label %37, label %15
37: ; preds = %32, %3
ret void
}