#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 */
typedef int /*<<< orphan*/ tam;
typedef int /*<<< orphan*/ num2;
typedef int /*<<< orphan*/ num1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int recv(int, int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ send(int, int *, int, int /*<<< orphan*/);
funcao_do_servidor(int fd) {
  int num1 = 0, num2 = 0;
  int tam = 0;
  tam = recv(fd, &num1, sizeof(num1), 0);
  tam = recv(fd, &num2, sizeof(num2), 0);
  printf("Recebi: %i e %i\nBytes: %i\n", num1, num2, tam);
  tam = num1 + num2;
  send(fd, &tam, sizeof(tam), 0);
}


x86 assembly (clang, -O0):
<funcao_do_servidor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe74(%rip),%rdi
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcao_do_servidor>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
lea    0x4(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xe86(%rip),%rdi
mov    %eax,%ecx
call   1050 <printf@plt>
mov    0x4(%rsp),%eax
add    0x8(%rsp),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Recebi: %i e %i\0ABytes: %i\0A\00"
define i32 @funcao_do_servidor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %3
%8 = call i32 @recv(i32 %7, i32* %4, i32 4, i32 0)
store i32 %8, i32* %6
%9 = load i32, i32* %3
%10 = call i32 @recv(i32 %9, i32* %5, i32 4, i32 0)
store i32 %10, i32* %6
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = add nsw i32 %15, %16
store i32 %17, i32* %6
%18 = load i32, i32* %3
%19 = call i32 @send(i32 %18, i32* %6, i32 4, i32 0)
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [27 x i8] c"Recebi: %i e %i\0ABytes: %i\0A\00"
define i32 @funcao_do_servidor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
%8 = call i32 @recv(i32 %0, i32* %2, i32 4, i32 0)
%9 = call i32 @recv(i32 %0, i32* %3, i32 4, i32 0)
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %9)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %4
%16 = call i32 @send(i32 %0, i32* %4, i32 4, i32 0)
ret i32 undef
}