#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char *DIS_le_nome(void) {
  char *n = (char *)calloc(25, sizeof(char));
  if (n == NULL) {
    printf("Espaço em memória insuficiente\n");
    exit(-1);
  }
  printf("Digite o nome\n");
  scanf(" %25[^\n]s", n);
  return n;
}


x86 assembly (clang, -O0):
<DIS_le_nome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x19,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117c <DIS_le_nome+0x3c>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DIS_le_nome>:
push   %rbx
mov    $0x19,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     1178 <DIS_le_nome+0x38>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
lea    0xe95(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Espa\C3\A7o em mem\C3\B3ria insuficiente\0A\00"
@.str.1 = [15 x i8] c"Digite o nome\0A\00"
@.str.2 = [10 x i8] c" %25[^\0A]s\00"
define i8* @DIS_le_nome() {
%1 = alloca i8*
%2 = call i64 @calloc(i32 25, i32 1)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%11 = load i8*, i8** %1
%12 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str.2 = [10 x i8] c" %25[^\0A]s\00"
@str = [14 x i8] c"Digite o nome\00"
@str.3 = [33 x i8] c"Espa\C3\A7o em mem\C3\B3ria insuficiente\00"
define i8* @DIS_le_nome() {
%1 = tail call i64 @calloc(i32 25, i32 1)
%2 = inttoptr i64 %1 to i8*
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i8* %2
}