#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*/ num1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int recv(int, int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ send(int, int *, int, int /*<<< orphan*/);
funcao_do_cliente(int fd) {
  int num1, num2, tam;
  printf("Somador remoto!\nInforme o primeiro número:");
  scanf("%d", &num1);
  send(fd, &num1, sizeof(num1), 0);
  printf("Informe o segundo número:");
  scanf("%d", &num2);
  send(fd, &num2, sizeof(num1), 0);
  tam = recv(fd, &num1, sizeof(num1), 0);
  printf("Soma: %d\n", num1);
}


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

x86 assembly (clang, -O2):
<funcao_do_cliente>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xecd(%rip),%r15
mov    %rsp,%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
mov    %ebx,%edi
mov    %r12,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    (%rsp),%esi
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Somador remoto!\0AInforme o primeiro n\C3\BAmero:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Informe o segundo n\C3\BAmero:\00"
@.str.3 = [10 x i8] c"Soma: %d\0A\00"
define i32 @funcao_do_cliente(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%9 = load i32, i32* %3
%10 = call i32 @send(i32 %9, i32* %4, i32 4, i32 0)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%13 = load i32, i32* %3
%14 = call i32 @send(i32 %13, i32* %5, i32 4, i32 0)
%15 = load i32, i32* %3
%16 = call i32 @recv(i32 %15, i32* %4, i32 4, i32 0)
store i32 %16, i32* %6
%17 = load i32, i32* %4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [44 x i8] c"Somador remoto!\0AInforme o primeiro n\C3\BAmero:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Informe o segundo n\C3\BAmero:\00"
@.str.3 = [10 x i8] c"Soma: %d\0A\00"
define i32 @funcao_do_cliente(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 @send(i32 %0, i32* %2, i32 4, i32 0)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = call i32 @send(i32 %0, i32* %3, i32 4, i32 0)
%12 = call i32 @recv(i32 %0, i32* %2, i32 4, i32 0)
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %13)
ret i32 undef
}