#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 EXIT_SUCCESS;
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  int base, altura;
  float area;
  printf("Introdueix la base i l'altura del triangle: ");
  scanf("%d %d", &base, &altura);
  __fpurge(stdin);
  printf("\nL'àrea del triangle val: ", (float)base * altura / 2);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cvtsi2ssl -0x14(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe74(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
cvtsi2ssl 0x4(%rsp),%xmm0
cvtsi2ssl (%rsp),%xmm1
mulss  %xmm0,%xmm1
mulss  0xe88(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Introdueix la base i l'altura del triangle: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@stdin = global i32 0
@.str.2 = [28 x i8] c"\0AL'\C3\A0rea del triangle val: \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%11 = load i32, i32* @stdin
%12 = call i32 @__fpurge(i32 %11)
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to float
%15 = load i32, i32* %7
%16 = sitofp i32 %15 to float
%17 = fmul float %14, %16
%18 = fdiv float %17, 2.000000e+00
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %19)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@.str = [45 x i8] c"Introdueix la base i l'altura del triangle: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@stdin = global i32 0
@.str.2 = [28 x i8] c"\0AL'\C3\A0rea del triangle val: \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%9 = load i32, i32* @stdin
%10 = call i32 @__fpurge(i32 %9)
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to float
%13 = load i32, i32* %4
%14 = sitofp i32 %13 to float
%15 = fmul float %12, %14
%16 = fmul float %15, 5.000000e-01
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}