#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*/ admin(int *);
int /*<<< orphan*/ recv(int, char *, int, int /*<<< orphan*/);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ utente(int *);
void *gestisci(void *arg) {
  int connfd = *((int *)arg);
  char tipoUtente[30];
  recv(connfd, tipoUtente, 30, 0);
  if (strncmp(tipoUtente, "admin", 5) == 0) {
    admin(&connfd);
  } else {
    utente(&connfd);
  }
}


x86 assembly (clang, -O0):
<gestisci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x1e,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
lea    -0x40(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1195 <gestisci+0x55>
lea    -0x14(%rbp),%rdi
call   1050 <admin@plt>
jmp    119e <gestisci+0x5e>
lea    -0x14(%rbp),%rdi
call   1060 <utente@plt>
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gestisci>:
push   %rbx
sub    $0x30,%rsp
mov    (%rdi),%edi
mov    %edi,0xc(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x1e,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1040 <strncmp@plt>
lea    0xc(%rsp),%rdi
test   %rax,%rax
je     1184 <gestisci+0x44>
call   1060 <utente@plt>
jmp    1189 <gestisci+0x49>
call   1050 <admin@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"admin\00"
define i8* @gestisci(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [30 x i8]
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%11 = call i32 @recv(i32 %9, i8* %10, i32 30, i32 0)
%12 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%13 = call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = call i32 @admin(i32* %4)
br label %19
17: ; preds = %1
%18 = call i32 @utente(i32* %4)
br label %19
19: ; preds = %17, %15
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"admin\00"
define noalias i8* @gestisci(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca [30 x i8]
%4 = bitcast i32* %2 to i8*
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %2
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%8 = call i32 @recv(i32 %6, i8* %7, i32 30, i32 0)
%9 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @admin(i32* %2)
br label %15
13: ; preds = %1
%14 = call i32 @utente(i32* %2)
br label %15
15: ; preds = %13, %11
ret i8* undef
}