#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*/ svnRepoAdd(char *, char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char *name, *useradmin, *descriere;
  if (!(name = (char *)malloc(30 * sizeof(char)))) {
    printf("eroare la alocarea memoriei.\n");
    exit(1);
  }
  if (!(useradmin = (char *)malloc(50 * sizeof(char)))) {
    printf("eroare la alocarea memoriei.\n");
    exit(1);
  }
  if (!(descriere = (char *)malloc(300 * sizeof(char)))) {
    printf("eroare la alocarea memoriei.\n");
    exit(1);
  }
  printf("Introduceti numele repositorului: ");
  gets(name);
  printf("Introduceti utilizatorul: ");
  gets(useradmin);
  printf("Introduceti descrierea: ");
  gets(descriere);
  svnRepoAdd(name, useradmin, descriere);
  free(name);
  free(useradmin);
  free(descriere);
  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   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    11ad <main+0x3d>
lea    0xe62(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    $0x32,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11db <main+0x6b>
lea    0xe34(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    $0x12c,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%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    -0x10(%rbp),%rdi
call   1060 <gets@plt>
lea    0xe1c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <gets@plt>
lea    0xe22(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <gets@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1080 <svnRepoAdd@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
lea    0xdfa(%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   1080 <malloc@plt>
test   %rax,%rax
je     1239 <main+0xb9>
mov    %rax,%r14
mov    $0x32,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     1239 <main+0xb9>
mov    %rax,%r15
mov    $0x12c,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     1239 <main+0xb9>
mov    %rax,%rbx
lea    0xe36(%rip),%rdi
call   1060 <printf@plt>
mov    %r14,%rdi
call   1070 <gets@plt>
lea    0xe45(%rip),%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1070 <gets@plt>
lea    0xe4c(%rip),%rdi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1070 <gets@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1090 <svnRepoAdd@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe2b(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe1d(%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 = [35 x i8] c"Introduceti numele repositorului: \00"
@.str.2 = [27 x i8] c"Introduceti utilizatorul: \00"
@.str.3 = [25 x i8] c"Introduceti descrierea: \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** %2
%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 50)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %3
%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 300)
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %4
%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 ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%27 = load i8*, i8** %2
%28 = call i32 @gets(i8* %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%30 = load i8*, i8** %3
%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** %4
%34 = call i32 @gets(i8* %33)
%35 = load i8*, i8** %2
%36 = load i8*, i8** %3
%37 = load i8*, i8** %4
%38 = call i32 @svnRepoAdd(i8* %35, i8* %36, i8* %37)
%39 = load i8*, i8** %2
%40 = call i32 @free(i8* %39)
%41 = load i8*, i8** %3
%42 = call i32 @free(i8* %41)
%43 = load i8*, i8** %4
%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 = [35 x i8] c"Introduceti numele repositorului: \00"
@.str.2 = [27 x i8] c"Introduceti utilizatorul: \00"
@.str.3 = [25 x i8] c"Introduceti descrierea: \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 50)
%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 300)
%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 ([35 x i8], [35 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 ([27 x i8], [27 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 @svnRepoAdd(i8* %2, i8* %9, i8* %16)
%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
}