#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*/ free(char *);
int /*<<< orphan*/ ft_strcpy(char *, char *);
int ft_strlen(char *);
scalar_t__ malloc(int);
int fullfillline(char ****line, char **newline) {
  if (!(***line = (char *)malloc(sizeof(char) * (ft_strlen(*newline) + 1))))
    return (0);
  ft_strcpy(***line, *newline);
  free(*newline);
  return (1);
}


x86 assembly (clang, -O0):
<fullfillline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1050 <ft_strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
mov    (%rcx),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    118f <fullfillline+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    11bb <fullfillline+0x7b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
call   1040 <ft_strcpy@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fullfillline>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%rdi
call   1050 <ft_strlen@plt>
lea    0x1(%rax),%edi
call   1060 <malloc@plt>
mov    (%r14),%rcx
mov    (%rcx),%rcx
mov    %rax,(%rcx)
test   %rax,%rax
je     1188 <fullfillline+0x48>
mov    (%r14),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
mov    (%rbx),%rsi
call   1040 <ft_strcpy@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
jmp    118a <fullfillline+0x4a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fullfillline(i8**** %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8****
%5 = alloca i8**
store i8**** %0, i8***** %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = load i8*, i8** %6
%8 = call i32 @ft_strlen(i8* %7)
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 1, %10
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
%15 = load i8****, i8***** %4
%16 = load i8***, i8**** %15
%17 = load i8**, i8*** %16
store i8* %14, i8** %17
%18 = icmp ne i8* %14, null
br i1 %18, label %20, label %19
19: ; preds = %2
store i32 0, i32* %3
br label %31
20: ; preds = %2
%21 = load i8****, i8***** %4
%22 = load i8***, i8**** %21
%23 = load i8**, i8*** %22
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %5
%26 = load i8*, i8** %25
%27 = call i32 @ft_strcpy(i8* %24, i8* %26)
%28 = load i8**, i8*** %5
%29 = load i8*, i8** %28
%30 = call i32 @free(i8* %29)
store i32 1, i32* %3
br label %31
31: ; preds = %20, %19
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @fullfillline(i8**** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @ft_strlen(i8* %3)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = load i8***, i8**** %0
%9 = load i8**, i8*** %8
store i8* %7, i8** %9
%10 = icmp eq i64 %6, 0
br i1 %10, label %19, label %11
11: ; preds = %2
%12 = load i8***, i8**** %0
%13 = load i8**, i8*** %12
%14 = load i8*, i8** %13
%15 = load i8*, i8** %1
%16 = tail call i32 @ft_strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %1
%18 = tail call i32 @free(i8* %17)
br label %19
19: ; preds = %2, %11
%20 = phi i32 [ 1, %11 ], [ 0, %2 ]
ret i32 %20
}