#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*/ exit(int);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *input_malloc() {
  char *input = malloc(200 * sizeof(char));
  if (!input) {
    printf("%s: ERRO FATAL -> Nao foi possivel alocar memoria.\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/samirfor/samirforshell/refs/heads/master/"
           "strings.c");
    exit(1);
  }
  strcpy(input, "");
  return input;
}


x86 assembly (clang, -O0):
<input_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117e <input_malloc+0x3e>
lea    0xe98(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_malloc>:
push   %rbx
mov    $0xc8,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1167 <input_malloc+0x27>
mov    %rax,%rbx
lea    0xed9(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xe92(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"%s: ERRO FATAL -> Nao foi possivel alocar memoria.\0A\00"
@.str.1 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/samirfor/samirforshell/refs/heads/master/strings.c\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @input_malloc() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 200)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i8*, i8** %1
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [52 x i8] c"%s: ERRO FATAL -> Nao foi possivel alocar memoria.\0A\00"
@.str.1 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/samirfor/samirforshell/refs/heads/master/strings.c\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @input_malloc() {
%1 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret i8* %1
}