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

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ getline(char **, size_t *, int /*<<< orphan*/ *);
int main() {
  ssize_t count = 0;
  size_t n = 1024;
  char line[1024] = {
      0,
  };
  FILE *stream =
      fopen("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/tehmaze-labs/wright/refs/heads/master/"
            "test/test/have_getline.c",
            "r");
  count = getline(&line, &n, stream);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x400,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
lea    0xe95(%rip),%rdi
lea    0xf27(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rdx
lea    -0x10(%rbp),%rsi
call   1050 <getline@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
movq   $0x400,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xea4(%rip),%rdi
lea    0xf36(%rip),%rsi
call   1040 <fopen@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1050 <getline@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tehmaze-labs/wright/refs/heads/master/test/test/have_getline.c\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca [1024 x i8]
%5 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
store i64 1024, i64* %3
%6 = bitcast [1024 x i8]* %4 to i8*
%7 = call i32* @fopen(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %5
%8 = bitcast [1024 x i8]* %4 to i8**
%9 = load i32*, i32** %5
%10 = call i32 @getline(i8** %8, i64* %3, i32* %9)
store i32 %10, i32* %2
ret i32 0
}

LLVM IR (-O2):
@.str = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tehmaze-labs/wright/refs/heads/master/test/test/have_getline.c\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [1024 x i8]
%3 = bitcast i64* %1 to i8*
store i64 1024, i64* %1
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = bitcast [1024 x i8]* %2 to i8**
%7 = call i32 @getline(i8** %6, i64* %1, i32* %5)
ret i32 0
}