#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*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *malloc(int);
int /*<<< orphan*/ stderr;
char *log_readline(FILE *logfile) {
  char *line = malloc((25000) * sizeof(char));
  if (fgets(line, 25000, logfile) != NULL) {
    fprintf(stderr, "%s\t*********************************\n", line);
    return line;
  }
  return (char *)NULL;
}


x86 assembly (clang, -O0):
<log_readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x61a8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x61a8,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
je     118c <log_readline+0x5c>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe86(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1194 <log_readline+0x64>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_readline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x61a8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x61a8,%esi
mov    %r14,%rdx
call   1030 <fgets@plt>
test   %rax,%rax
je     1173 <log_readline+0x43>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
jmp    1175 <log_readline+0x45>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"%s\09*********************************\0A\00"
define i8* @log_readline(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
%5 = call i8* @malloc(i32 25000)
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i32*, i32** %3
%8 = call i32* @fgets(i8* %6, i32 25000, i32* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %4
store i8* %14, i8** %2
br label %16
15: ; preds = %1
store i8* null, i8** %2
br label %16
16: ; preds = %15, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"%s\09*********************************\0A\00"
define i8* @log_readline(i32* nocapture %0) {
%2 = tail call dereferenceable_or_null(25000) i8* @malloc(i32 25000)
%3 = tail call i32* @fgets(i8* %2, i32 25000, i32* %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %1, %5
%9 = phi i8* [ %2, %5 ], [ null, %1 ]
ret i8* %9
}