#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 scalar_t__ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, const char *argv[]) {
  printf("Enter A and B: ");
  int a = 0;
  int b = 0;
  scanf("%d %d", &a, &b);
  float c = ((float)(a) + b) / 2;
  printf("Arithmetic mean:\nAs real number: %f\nAs Integer: %d\n", c, (int)(c));
  return 0;
}


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    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xebb(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cvtsi2ssl -0x14(%rbp),%xmm0
cvtsi2ssl -0x18(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  0xe84(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvttss2si -0x1c(%rbp),%esi
lea    0xe80(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cvtsi2ssl 0x4(%rsp),%xmm0
cvtsi2ssl (%rsp),%xmm1
addss  %xmm0,%xmm1
mulss  0xe97(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
cvttss2si %xmm1,%esi
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter A and B: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [52 x i8] c"Arithmetic mean:\0AAs real number: %f\0AAs Integer: %d\0A\00"
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 ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
store i32 0, i32* %7
%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* %6
%12 = sitofp i32 %11 to float
%13 = load i32, i32* %7
%14 = sitofp i32 %13 to float
%15 = fadd float %12, %14
%16 = fdiv float %15, 2.000000e+00
store float %16, float* %8
%17 = load float, float* %8
%18 = fpext float %17 to double
%19 = load float, float* %8
%20 = fptosi float %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), double %18, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter A and B: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [52 x i8] c"Arithmetic mean:\0AAs real number: %f\0AAs Integer: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%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* %3
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to float
%13 = fadd float %10, %12
%14 = fmul float %13, 5.000000e-01
%15 = fpext float %14 to double
%16 = fptosi float %14 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), double %15, i32 %16)
ret i32 0
}