#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 atoi(char *);
int /*<<< orphan*/ column(char *, int, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ get_line(char *, int /*<<< orphan*/);
scalar_t__ piece(char *, char, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  char buffer[8192];
  char component[8192];
  char offset_piece[20];
  int i, offset;
  if (argc != 2) {
    fprintf(stderr, "usage: column.e offset_1[,offset_n...]\n");
    exit(1);
  }
  while (get_line(buffer, stdin)) {
    for (i = 0; piece(offset_piece, ',', argv[1], i); i++) {
      offset = atoi(offset_piece);
      if (!column(component, offset, buffer)) {
        continue;
      }
      if (i == 0)
        printf("%s", component);
      else
        printf(" %s", component);
    }
    printf("\n");
    fflush(stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11c2 <main+0x42>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
lea    0xe4d(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
jmp    11c7 <main+0x47>
lea    -0x2010(%rbp),%rdi
mov    0x2e13(%rip),%rax
mov    (%rax),%esi
call   1030 <get_line@plt>
cmp    $0x0,%rax
je     12c8 <main+0x148>
movl   $0x0,-0x4034(%rbp)
lea    -0x4030(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x4034(%rbp),%ecx
mov    $0x2c,%esi
call   10a0 <piece@plt>
cmp    $0x0,%rax
je     12a7 <main+0x127>
lea    -0x4030(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x4038(%rbp)
lea    -0x4010(%rbp),%rdi
mov    -0x4038(%rbp),%esi
lea    -0x2010(%rbp),%rdx
call   1070 <column@plt>
cmp    $0x0,%eax
jne    1252 <main+0xd2>
jmp    1293 <main+0x113>
cmpl   $0x0,-0x4034(%rbp)
jne    1279 <main+0xf9>
lea    -0x4010(%rbp),%rsi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    128e <main+0x10e>
lea    -0x4010(%rbp),%rsi
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1293 <main+0x113>
mov    -0x4034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4034(%rbp)
jmp    11f0 <main+0x70>
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d14(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
jmp    11c7 <main+0x47>
xor    %eax,%eax
add    $0x4040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4028,%rsp
cmp    $0x2,%edi
jne    12eb <main+0x15b>
mov    %rsi,%r14
mov    0x2e34(%rip),%rax
mov    (%rax),%esi
lea    0x20(%rsp),%rdi
call   1040 <get_line@plt>
test   %rax,%rax
je     12d7 <main+0x147>
mov    %rsp,%rbx
lea    0x20(%rsp),%r15
lea    0x2020(%rsp),%r12
lea    0xe48(%rip),%r13
jmp    1222 <main+0x92>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2dcf(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    0x2dd9(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   1040 <get_line@plt>
test   %rax,%rax
je     12d7 <main+0x147>
mov    0x8(%r14),%rdx
mov    %rbx,%rdi
mov    $0x2c,%esi
xor    %ecx,%ecx
call   10b0 <piece@plt>
test   %rax,%rax
je     11f0 <main+0x60>
mov    %rbx,%rdi
call   1090 <atoi@plt>
mov    %r12,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1080 <column@plt>
test   %eax,%eax
je     1264 <main+0xd4>
lea    0xdcf(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%r14),%rdx
mov    %rbx,%rdi
mov    $0x2c,%esi
mov    $0x1,%ecx
call   10b0 <piece@plt>
test   %rax,%rax
je     11f0 <main+0x60>
mov    $0x2,%ebp
jmp    12af <main+0x11f>
nopw   0x0(%rax,%rax,1)
mov    0x8(%r14),%rdx
mov    %rbx,%rdi
mov    $0x2c,%esi
mov    %ebp,%ecx
call   10b0 <piece@plt>
add    $0x1,%ebp
test   %rax,%rax
je     11f0 <main+0x60>
mov    %rbx,%rdi
call   1090 <atoi@plt>
mov    %r12,%rdi
mov    %eax,%esi
mov    %r15,%rdx
call   1080 <column@plt>
test   %eax,%eax
je     1290 <main+0x100>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1290 <main+0x100>
xor    %eax,%eax
add    $0x4028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2ce6(%rip),%rax
mov    (%rax),%edi
lea    0xd05(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"usage: column.e offset_1[,offset_n...]\0A\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c" %s\00"
@.str.3 = [2 x i8] c"\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8192 x i8]
%7 = alloca [8192 x i8]
%8 = alloca [20 x i8]
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
br label %18
18: ; preds = %54, %17
%19 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%20 = load i32, i32* @stdin
%21 = call i64 @get_line(i8* %19, i32 %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %58
23: ; preds = %18
store i32 0, i32* %9
br label %24
24: ; preds = %51, %23
%25 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = load i32, i32* %9
%30 = call i64 @piece(i8* %25, i8 signext 44, i8* %28, i32 %29)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %54
32: ; preds = %24
%33 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%34 = call i32 @atoi(i8* %33)
store i32 %34, i32* %10
%35 = getelementptr inbounds [8192 x i8], [8192 x i8]* %7, i64 0, i64 0
%36 = load i32, i32* %10
%37 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%38 = call i32 @column(i8* %35, i32 %36, i8* %37)
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %32
br label %51
41: ; preds = %32
%42 = load i32, i32* %9
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = getelementptr inbounds [8192 x i8], [8192 x i8]* %7, i64 0, i64 0
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %45)
br label %50
47: ; preds = %41
%48 = getelementptr inbounds [8192 x i8], [8192 x i8]* %7, i64 0, i64 0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %48)
br label %50
50: ; preds = %47, %44
br label %51
51: ; preds = %50, %40
%52 = load i32, i32* %9
%53 = add nsw i32 %52, 1
store i32 %53, i32* %9
br label %24
54: ; preds = %24
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%56 = load i32, i32* @stdout
%57 = call i32 @fflush(i32 %56)
br label %18
58: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"usage: column.e offset_1[,offset_n...]\0A\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c" %s\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [8192 x i8]
%4 = alloca [8192 x i8]
%5 = alloca [20 x i8]
%6 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 2
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @stdin
%12 = call i64 @get_line(i8* %6, i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %53, label %14
14: ; preds = %10
%15 = getelementptr inbounds i8*, i8** %1, i64 1
br label %20
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %14, %46
%21 = load i8*, i8** %15
%22 = call i64 @piece(i8* %8, i8 signext 44, i8* %21, i32 0)
%23 = icmp eq i64 %22, 0
br i1 %23, label %46, label %24
24: ; preds = %20
%25 = call i32 @atoi(i8* %8)
%26 = call i32 @column(i8* %7, i32 %25, i8* %6)
%27 = icmp eq i32 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %30
30: ; preds = %28, %24
%31 = load i8*, i8** %15
%32 = call i64 @piece(i8* %8, i8 signext 44, i8* %31, i32 1)
%33 = icmp eq i64 %32, 0
br i1 %33, label %46, label %34
34: ; preds = %30, %41
%35 = phi i32 [ %42, %41 ], [ 1, %30 ]
%36 = call i32 @atoi(i8* %8)
%37 = call i32 @column(i8* %7, i32 %36, i8* %6)
%38 = icmp eq i32 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %34
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7)
br label %41
41: ; preds = %39, %34
%42 = add nuw nsw i32 %35, 1
%43 = load i8*, i8** %15
%44 = call i64 @piece(i8* %8, i8 signext 44, i8* %43, i32 %42)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %34
46: ; preds = %41, %30, %20
%47 = call i32 @putchar(i32 10)
%48 = load i32, i32* @stdout
%49 = call i32 @fflush(i32 %48)
%50 = load i32, i32* @stdin
%51 = call i64 @get_line(i8* %6, i32 %50)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %20
53: ; preds = %46, %10
ret i32 0
}