#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*/ column(char *, int, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
scalar_t__ get_line(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
scalar_t__ timlib_strcmp(char *, char *);
void column_grep(int column_offset, char *pattern_to_search) {
  char buffer[65536];
  char column_buffer[4096];
  while (get_line(buffer, stdin)) {
    if (!column(column_buffer, column_offset, buffer)) {
      fprintf(stderr, "%s: cannot get column: %d\n(%s)\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/timhriley/appaserver/refs/heads/"
              "master/utility/column_grep.c",
              column_offset, buffer);
      continue;
    }
    if (timlib_strcmp(pattern_to_search, column_buffer) == 0)
      printf("%s\n", buffer);
  }
}


x86 assembly (clang, -O0):
<column_grep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x11010,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10010(%rbp),%rdi
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
call   1030 <get_line@plt>
cmp    $0x0,%rax
je     11fd <column_grep+0xad>
lea    -0x11010(%rbp),%rdi
mov    -0x4(%rbp),%esi
lea    -0x10010(%rbp),%rdx
call   1060 <column@plt>
cmp    $0x0,%eax
jne    11cb <column_grep+0x7b>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    -0x10010(%rbp),%r8
lea    0xe46(%rip),%rsi
lea    0xe5f(%rip),%rdx
call   1050 <fprintf@plt>
jmp    1162 <column_grep+0x12>
mov    -0x10(%rbp),%rdi
lea    -0x11010(%rbp),%rsi
call   1070 <timlib_strcmp@plt>
cmp    $0x0,%rax
jne    11f8 <column_grep+0xa8>
lea    -0x10010(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
jmp    1162 <column_grep+0x12>
add    $0x11010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<column_grep>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x11008,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x2e7b(%rip),%r12
mov    (%r12),%esi
lea    0x1000(%rsp),%rdi
call   1030 <get_line@plt>
test   %rax,%rax
je     1200 <column_grep+0xb0>
mov    %rsp,%r15
lea    0x1000(%rsp),%rbx
lea    0xe8b(%rip),%r13
jmp    11ce <column_grep+0x7e>
nopw   0x0(%rax,%rax,1)
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
lea    0xe50(%rip),%rsi
mov    %r13,%rdx
mov    %ebp,%ecx
mov    %rbx,%r8
call   1050 <fprintf@plt>
mov    (%r12),%esi
mov    %rbx,%rdi
call   1030 <get_line@plt>
test   %rax,%rax
je     1200 <column_grep+0xb0>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1060 <column@plt>
test   %eax,%eax
je     11a0 <column_grep+0x50>
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <timlib_strcmp@plt>
test   %rax,%rax
jne    11bd <column_grep+0x6d>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    11bd <column_grep+0x6d>
add    $0x11008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@stderr = global i32 0
@.str = [32 x i8] c"%s: cannot get column: %d\0A(%s)\0A\00"
@.str.1 = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/timhriley/appaserver/refs/heads/master/utility/column_grep.c\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @column_grep(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [65536 x i8]
%6 = alloca [4096 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
br label %7
7: ; preds = %31, %18, %2
%8 = getelementptr inbounds [65536 x i8], [65536 x i8]* %5, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i64 @get_line(i8* %8, i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %32
12: ; preds = %7
%13 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%14 = load i32, i32* %3
%15 = getelementptr inbounds [65536 x i8], [65536 x i8]* %5, i64 0, i64 0
%16 = call i32 @column(i8* %13, i32 %14, i8* %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %12
%19 = load i32, i32* @stderr
%20 = load i32, i32* %3
%21 = getelementptr inbounds [65536 x i8], [65536 x i8]* %5, i64 0, i64 0
%22 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str.1, i64 0, i64 0), i32 %20, i8* %21)
br label %7
23: ; preds = %12
%24 = load i8*, i8** %4
%25 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%26 = call i64 @timlib_strcmp(i8* %24, i8* %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %23
%29 = getelementptr inbounds [65536 x i8], [65536 x i8]* %5, i64 0, i64 0
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %28, %23
br label %7
32: ; preds = %7
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@stderr = global i32 0
@.str = [32 x i8] c"%s: cannot get column: %d\0A(%s)\0A\00"
@.str.1 = [151 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/timhriley/appaserver/refs/heads/master/utility/column_grep.c\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @column_grep(i32 %0, i8* %1) {
%3 = alloca [65536 x i8]
%4 = alloca [4096 x i8]
%5 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i64 @get_line(i8* %5, i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %25, label %10
10: ; preds = %2, %16
%11 = call i32 @column(i8* %6, i32 %0, i8* %5)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8* %5)
br label %16
16: ; preds = %20, %23, %13
%17 = load i32, i32* @stdin
%18 = call i64 @get_line(i8* %5, i32 %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %25, label %10
20: ; preds = %10
%21 = call i64 @timlib_strcmp(i8* %1, i8* %6)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %16
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %5)
br label %16
25: ; preds = %16, %2
ret void
}