#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);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ gets(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ svnUserAdd(char *, char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char *utilizator, *nume, *prenume;
  if (!(nume = (char *)malloc(30 * sizeof(char)))) {
    printf("eroare la alocarea memoriei.\n");
    exit(1);
  }
  if (!(prenume = (char *)malloc(30 * sizeof(char)))) {
    printf("eroare la alocarea memoriei.\n");
    exit(1);
  }
  if (!(utilizator = (char *)malloc(30 * sizeof(char)))) {
    printf("eroare la alocarea memoriei.\n");
    exit(1);
  }
  printf("Introduceti numele: ");
  gets(nume);
  printf("Introduceti prenumele: ");
  gets(prenume);
  printf("Introduceti utilizator: ");
  gets(utilizator);
  svnUserAdd(utilizator, nume, prenume);
  free(nume);
  free(prenume);
  free(utilizator);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1e,%edi
call   1080 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11ad <main+0x3d>
lea    0xe62(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    $0x1e,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    11db <main+0x6b>
lea    0xe34(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    $0x1e,%edi
call   1080 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1209 <main+0x99>
lea    0xe06(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    0xe0e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <gets@plt>
lea    0xe0e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1070 <gets@plt>
lea    0xe11(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <gets@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1060 <svnUserAdd@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xde9(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1e,%edi
call   1090 <malloc@plt>
test   %rax,%rax
je     1239 <main+0xb9>
mov    %rax,%r14
mov    $0x1e,%edi
call   1090 <malloc@plt>
test   %rax,%rax
je     1239 <main+0xb9>
mov    %rax,%r15
mov    $0x1e,%edi
call   1090 <malloc@plt>
test   %rax,%rax
je     1239 <main+0xb9>
mov    %rax,%rbx
lea    0xe36(%rip),%rdi
call   1060 <printf@plt>
mov    %r14,%rdi
call   1080 <gets@plt>
lea    0xe37(%rip),%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1080 <gets@plt>
lea    0xe3b(%rip),%rdi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1080 <gets@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1070 <svnUserAdd@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe1a(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe0c(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"eroare la alocarea memoriei.\0A\00"
@.str.1 = [21 x i8] c"Introduceti numele: \00"
@.str.2 = [24 x i8] c"Introduceti prenumele: \00"
@.str.3 = [25 x i8] c"Introduceti utilizator: \00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i64 @malloc(i32 30)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = call i64 @malloc(i32 30)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %18, label %15
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %11
%19 = call i64 @malloc(i32 30)
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %2
%21 = icmp ne i8* %20, null
br i1 %21, label %25, label %22
22: ; preds = %18
%23 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %18
%26 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%27 = load i8*, i8** %3
%28 = call i32 @gets(i8* %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%30 = load i8*, i8** %4
%31 = call i32 @gets(i8* %30)
%32 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%33 = load i8*, i8** %2
%34 = call i32 @gets(i8* %33)
%35 = load i8*, i8** %2
%36 = load i8*, i8** %3
%37 = load i8*, i8** %4
%38 = call i32 @svnUserAdd(i8* %35, i8* %36, i8* %37)
%39 = load i8*, i8** %3
%40 = call i32 @free(i8* %39)
%41 = load i8*, i8** %4
%42 = call i32 @free(i8* %41)
%43 = load i8*, i8** %2
%44 = call i32 @free(i8* %43)
%45 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"Introduceti numele: \00"
@.str.2 = [24 x i8] c"Introduceti prenumele: \00"
@.str.3 = [25 x i8] c"Introduceti utilizator: \00"
@.str.4 = [6 x i8] c"pause\00"
@str.6 = [29 x i8] c"eroare la alocarea memoriei.\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 30)
%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 ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = tail call i64 @malloc(i32 30)
%9 = inttoptr i64 %8 to i8*
%10 = icmp eq i64 %8, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %7
%15 = tail call i64 @malloc(i32 30)
%16 = inttoptr i64 %15 to i8*
%17 = icmp eq i64 %15, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %14
%22 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%23 = tail call i32 @gets(i8* %2)
%24 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%25 = tail call i32 @gets(i8* %9)
%26 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%27 = tail call i32 @gets(i8* %16)
%28 = tail call i32 @svnUserAdd(i8* %16, i8* %2, i8* %9)
%29 = tail call i32 @free(i8* %2)
%30 = tail call i32 @free(i8* %9)
%31 = tail call i32 @free(i8* %16)
%32 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}