#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 */
float area_circulo(int);
char primer_caracter(char *);
int /*<<< orphan*/ printf(char *, char);
int resta(int, int);
int suma(int, int);
int main() {
  int a = 3, b = 2, c;
  float area;
  char inicial;
  c = suma(a, b);
  printf("c: %d\n", c);
  c = resta(a, b);
  printf("c: %d\n", c);
  area = area_circulo(2);
  printf("area: %f\n", area);
  inicial = primer_caracter("chelin");
  printf("primre caracter: %c", inicial);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <suma@plt>
mov    %eax,-0x10(%rbp)
movsbl -0x10(%rbp),%esi
lea    0xe7a(%rip),%rdi
mov    %rdi,-0x20(%rbp)
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <resta@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,-0x10(%rbp)
movsbl -0x10(%rbp),%esi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1070 <area_circulo@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvttss2si %xmm0,%eax
lea    0xe3e(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
lea    0xe39(%rip),%rdi
call   1050 <primer_caracter@plt>
mov    %al,-0x15(%rbp)
lea    0xe31(%rip),%rdi
movsbl -0x15(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
mov    $0x2,%esi
call   1040 <suma@plt>
movsbl %al,%esi
lea    0xe96(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
mov    $0x2,%esi
call   1060 <resta@plt>
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1070 <area_circulo@plt>
cvttss2si %xmm0,%eax
movsbl %al,%esi
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
lea    0xe61(%rip),%rdi
call   1050 <primer_caracter@plt>
movsbl %al,%esi
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"c: %d\0A\00"
@.str.1 = [10 x i8] c"area: %f\0A\00"
@.str.2 = [7 x i8] c"chelin\00"
@.str.3 = [20 x i8] c"primre caracter: %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca i8
store i32 0, i32* %1
store i32 3, i32* %2
store i32 2, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @suma(i32 %7, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i8
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %11)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @resta(i32 %13, i32 %14)
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = trunc i32 %16 to i8
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %17)
%19 = call float @area_circulo(i32 2)
store float %19, float* %5
%20 = load float, float* %5
%21 = fptosi float %20 to i8
%22 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %21)
%23 = call signext i8 @primer_caracter(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
store i8 %23, i8* %6
%24 = load i8, i8* %6
%25 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8 signext %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"c: %d\0A\00"
@.str.1 = [10 x i8] c"area: %f\0A\00"
@.str.2 = [7 x i8] c"chelin\00"
@.str.3 = [20 x i8] c"primre caracter: %c\00"
define i32 @main() {
%1 = tail call i32 @suma(i32 3, i32 2)
%2 = trunc i32 %1 to i8
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = tail call i32 @resta(i32 3, i32 2)
%5 = trunc i32 %4 to i8
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = tail call float @area_circulo(i32 2)
%8 = fptosi float %7 to i8
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %8)
%10 = tail call signext i8 @primer_caracter(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%11 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8 signext %10)
ret i32 0
}