#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 atoi(int /*<<< orphan*/);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int *getCenterDisk(int *, int *, int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ strtok(char *, char *);
int main(int argc, char **argv) {
  int p1[2];
  int p2[2];
  p1[0] = 10;
  p1[1] = 10;
  p2[0] = 10;
  p2[1] = 10;
  int epsilon = 100;
  int *c = getCenterDisk(p1, p2, epsilon);
  printf("(%d,%d)\n", c[0], c[1]);
  FILE *in;
  in = fopen("test.tsv", "r");
  char line[1024];
  while (fgets(line, 1024, in)) {
    const char *tok;
    p1[0] = atoi(strtok(line, "\t"));
    p1[1] = atoi(strtok(NULL, "\t\n"));
    p2[0] = atoi(strtok(NULL, "\t\n"));
    p2[1] = atoi(strtok(NULL, "\t\n"));
    int *c = getCenterDisk(p1, p2, epsilon);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0xa,-0x20(%rbp)
movl   $0xa,-0x1c(%rbp)
movl   $0x64,-0x24(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <getCenterDisk@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe3c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe39(%rip),%rdi
lea    0xe3b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x38(%rbp)
lea    -0x440(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x400,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1286 <main+0x126>
lea    -0x440(%rbp),%rdi
lea    0xe07(%rip),%rsi
call   1070 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xdef(%rip),%rsi
call   1070 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xdd5(%rip),%rsi
call   1070 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xdbb(%rip),%rsi
call   1070 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <getCenterDisk@plt>
mov    %rax,-0x450(%rbp)
jmp    11e0 <main+0x80>
xor    %eax,%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
movabs $0xa0000000a,%rax
mov    %rax,0x8(%rsp)
mov    %rax,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x64,%edx
call   1030 <getCenterDisk@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5b(%rip),%rdi
lea    0xe5d(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r15
lea    0x10(%rsp),%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     1279 <main+0x119>
lea    0xe35(%rip),%r14
lea    0x10(%rsp),%r12
lea    0xe2b(%rip),%rbx
lea    0x8(%rsp),%r13
mov    %rsp,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
mov    %r14,%rsi
call   1070 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,0x8(%rsp)
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,0xc(%rsp)
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,(%rsp)
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,0x4(%rsp)
mov    %r13,%rdi
mov    %rbp,%rsi
mov    $0x64,%edx
call   1030 <getCenterDisk@plt>
mov    %r12,%rdi
mov    $0x400,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
jne    1200 <main+0xa0>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"(%d,%d)\0A\00"
@.str.1 = [9 x i8] c"test.tsv\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [2 x i8] c"\09\00"
@.str.4 = [3 x i8] c"\09\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca [1024 x i8]
%12 = alloca i8*
%13 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 10, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 10, i32* %15
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 10, i32* %16
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 10, i32* %17
store i32 100, i32* %8
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%20 = load i32, i32* %8
%21 = call i32* @getCenterDisk(i32* %18, i32* %19, i32 %20)
store i32* %21, i32** %9
%22 = load i32*, i32** %9
%23 = getelementptr inbounds i32, i32* %22, i64 0
%24 = load i32, i32* %23
%25 = load i32*, i32** %9
%26 = getelementptr inbounds i32, i32* %25, i64 1
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %27)
%29 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %29, i32** %10
br label %30
30: ; preds = %35, %2
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%32 = load i32*, i32** %10
%33 = call i64 @fgets(i8* %31, i32 1024, i32* %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %53
35: ; preds = %30
%36 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%37 = call i32 @strtok(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32 @atoi(i32 %37)
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 %38, i32* %39
%40 = call i32 @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%41 = call i32 @atoi(i32 %40)
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %41, i32* %42
%43 = call i32 @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%44 = call i32 @atoi(i32 %43)
%45 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %44, i32* %45
%46 = call i32 @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%47 = call i32 @atoi(i32 %46)
%48 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %47, i32* %48
%49 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%51 = load i32, i32* %8
%52 = call i32* @getCenterDisk(i32* %49, i32* %50, i32 %51)
store i32* %52, i32** %13
br label %30
53: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"(%d,%d)\0A\00"
@.str.1 = [9 x i8] c"test.tsv\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [2 x i8] c"\09\00"
@.str.4 = [3 x i8] c"\09\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = alloca [1024 x i8]
%6 = bitcast [2 x i32]* %3 to i8*
%7 = bitcast [2 x i32]* %4 to i8*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 10, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 10, i32* %9
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 10, i32* %10
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 10, i32* %11
%12 = call i32* @getCenterDisk(i32* %8, i32* %10, i32 100)
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %12, i64 1
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15)
%17 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%19 = call i64 @fgets(i8* %18, i32 1024, i32* %17)
%20 = icmp eq i64 %19, 0
br i1 %20, label %33, label %21
21: ; preds = %2, %21
%22 = call i32 @strtok(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @atoi(i32 %22)
store i32 %23, i32* %8
%24 = call i32 @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 @atoi(i32 %24)
store i32 %25, i32* %9
%26 = call i32 @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 @atoi(i32 %26)
store i32 %27, i32* %10
%28 = call i32 @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 @atoi(i32 %28)
store i32 %29, i32* %11
%30 = call i32* @getCenterDisk(i32* %8, i32* %10, i32 100)
%31 = call i64 @fgets(i8* %18, i32 1024, i32* %17)
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %21
33: ; preds = %21, %2
ret i32 0
}