#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 */
int /*<<< orphan*/ *fopen(char *, char *);
int get_column(int /*<<< orphan*/ *);
int /*<<< orphan*/ getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  FILE *i = fopen("tmp.txt", "r");
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  getc(i);
  printf("Answer: %d\n", get_column(i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1060 <getc@plt>
mov    -0x10(%rbp),%rdi
call   1050 <get_column@plt>
mov    %eax,%esi
lea    0xdde(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1060 <getc@plt>
mov    %rbx,%rdi
call   1050 <get_column@plt>
lea    0xe04(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"tmp.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"Answer: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @getc(i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @getc(i32* %8)
%10 = load i32*, i32** %2
%11 = call i32 @getc(i32* %10)
%12 = load i32*, i32** %2
%13 = call i32 @getc(i32* %12)
%14 = load i32*, i32** %2
%15 = call i32 @getc(i32* %14)
%16 = load i32*, i32** %2
%17 = call i32 @getc(i32* %16)
%18 = load i32*, i32** %2
%19 = call i32 @getc(i32* %18)
%20 = load i32*, i32** %2
%21 = call i32 @getc(i32* %20)
%22 = load i32*, i32** %2
%23 = call i32 @getc(i32* %22)
%24 = load i32*, i32** %2
%25 = call i32 @getc(i32* %24)
%26 = load i32*, i32** %2
%27 = call i32 @getc(i32* %26)
%28 = load i32*, i32** %2
%29 = call i32 @getc(i32* %28)
%30 = load i32*, i32** %2
%31 = call i32 @getc(i32* %30)
%32 = load i32*, i32** %2
%33 = call i32 @getc(i32* %32)
%34 = load i32*, i32** %2
%35 = call i32 @getc(i32* %34)
%36 = load i32*, i32** %2
%37 = call i32 @getc(i32* %36)
%38 = load i32*, i32** %2
%39 = call i32 @getc(i32* %38)
%40 = load i32*, i32** %2
%41 = call i32 @getc(i32* %40)
%42 = load i32*, i32** %2
%43 = call i32 @getc(i32* %42)
%44 = load i32*, i32** %2
%45 = call i32 @get_column(i32* %44)
%46 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %45)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"tmp.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"Answer: %d\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @getc(i32* %1)
%3 = tail call i32 @getc(i32* %1)
%4 = tail call i32 @getc(i32* %1)
%5 = tail call i32 @getc(i32* %1)
%6 = tail call i32 @getc(i32* %1)
%7 = tail call i32 @getc(i32* %1)
%8 = tail call i32 @getc(i32* %1)
%9 = tail call i32 @getc(i32* %1)
%10 = tail call i32 @getc(i32* %1)
%11 = tail call i32 @getc(i32* %1)
%12 = tail call i32 @getc(i32* %1)
%13 = tail call i32 @getc(i32* %1)
%14 = tail call i32 @getc(i32* %1)
%15 = tail call i32 @getc(i32* %1)
%16 = tail call i32 @getc(i32* %1)
%17 = tail call i32 @getc(i32* %1)
%18 = tail call i32 @getc(i32* %1)
%19 = tail call i32 @getc(i32* %1)
%20 = tail call i32 @getc(i32* %1)
%21 = tail call i32 @getc(i32* %1)
%22 = tail call i32 @get_column(i32* %1)
%23 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %22)
ret i32 0
}